feat: model list (#96)

This commit is contained in:
Nathan Flurry 2026-02-06 02:59:23 -08:00 committed by GitHub
parent 6a3345b954
commit b74539172b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1174 additions and 52 deletions

View file

@ -2,6 +2,7 @@ import type { SandboxAgentSpawnHandle, SandboxAgentSpawnOptions } from "./spawn.
import type {
AgentInstallRequest,
AgentListResponse,
AgentModelsResponse,
AgentModesResponse,
CreateSessionRequest,
CreateSessionResponse,
@ -113,6 +114,10 @@ export class SandboxAgent {
return this.requestJson("GET", `${API_PREFIX}/agents/${encodeURIComponent(agent)}/modes`);
}
async getAgentModels(agent: string): Promise<AgentModelsResponse> {
return this.requestJson("GET", `${API_PREFIX}/agents/${encodeURIComponent(agent)}/models`);
}
async createSession(sessionId: string, request: CreateSessionRequest): Promise<CreateSessionResponse> {
return this.requestJson("POST", `${API_PREFIX}/sessions/${encodeURIComponent(sessionId)}`, {
body: request,

View file

@ -11,6 +11,9 @@ export interface paths {
"/v1/agents/{agent}/install": {
post: operations["install_agent"];
};
"/v1/agents/{agent}/models": {
get: operations["get_agent_models"];
};
"/v1/agents/{agent}/modes": {
get: operations["get_agent_modes"];
};
@ -73,6 +76,7 @@ export interface components {
textMessages: boolean;
toolCalls: boolean;
toolResults: boolean;
variants: boolean;
};
AgentError: {
agent?: string | null;
@ -100,6 +104,16 @@ export interface components {
id: string;
name: string;
};
AgentModelInfo: {
defaultVariant?: string | null;
id: string;
name?: string | null;
variants?: string[] | null;
};
AgentModelsResponse: {
defaultModel?: string | null;
models: components["schemas"]["AgentModelInfo"][];
};
AgentModesResponse: {
modes: components["schemas"]["AgentModeInfo"][];
};
@ -383,6 +397,26 @@ export interface operations {
};
};
};
get_agent_models: {
parameters: {
path: {
/** @description Agent id */
agent: string;
};
};
responses: {
200: {
content: {
"application/json": components["schemas"]["AgentModelsResponse"];
};
};
400: {
content: {
"application/json": components["schemas"]["ProblemDetails"];
};
};
};
};
get_agent_modes: {
parameters: {
path: {

View file

@ -10,6 +10,8 @@ export type {
AgentInfo,
AgentInstallRequest,
AgentListResponse,
AgentModelInfo,
AgentModelsResponse,
AgentModeInfo,
AgentModesResponse,
AgentUnparsedData,

View file

@ -6,6 +6,8 @@ export type AgentCapabilities = S["AgentCapabilities"];
export type AgentInfo = S["AgentInfo"];
export type AgentInstallRequest = S["AgentInstallRequest"];
export type AgentListResponse = S["AgentListResponse"];
export type AgentModelInfo = S["AgentModelInfo"];
export type AgentModelsResponse = S["AgentModelsResponse"];
export type AgentModeInfo = S["AgentModeInfo"];
export type AgentModesResponse = S["AgentModesResponse"];
export type AgentUnparsedData = S["AgentUnparsedData"];