diff --git a/packages/cli/src/tui.ts b/packages/cli/src/tui.ts index 053b99f433..2c2d3fcc5c 100644 --- a/packages/cli/src/tui.ts +++ b/packages/cli/src/tui.ts @@ -14,7 +14,7 @@ export function runTui(transport: Transport, reload?: () => Promise) return Effect.gen(function* () { const options = { baseUrl: transport.url, headers: transport.headers } const api = OpenCode.make(options) - const directory = yield* Effect.tryPromise(() => api.files.list({ location: { directory: process.cwd() } })).pipe( + const directory = yield* Effect.tryPromise(() => api.file.list({ location: { directory: process.cwd() } })).pipe( Effect.map((response) => response.location.directory), Effect.catch(() => Effect.tryPromise(() => api.location.get()).pipe(Effect.map((response) => response.directory)), diff --git a/packages/client/src/contract.ts b/packages/client/src/contract.ts index 32f85abb97..2cc838c3dc 100644 --- a/packages/client/src/contract.ts +++ b/packages/client/src/contract.ts @@ -19,24 +19,25 @@ export const ClientApi = makeDefaultApi({ export const groupNames = { "server.health": "health", "server.location": "location", - "server.agent": "agents", - "server.session": "sessions", - "server.message": "messages", - "server.model": "models", + "server.agent": "agent", + "server.session": "session", + "server.message": "message", + "server.model": "model", "server.generate": "generate", - "server.provider": "providers", - "server.integration": "integrations", - "server.credential": "credentials", - "server.permission": "permissions", - "server.fs": "files", - "server.command": "commands", - "server.skill": "skills", - "server.event": "events", - "server.pty": "ptys", - "server.question": "questions", - "server.reference": "references", + "server.provider": "provider", + "server.integration": "integration", + "server.credential": "credential", + "server.permission": "permission", + "server.fs": "file", + "server.command": "command", + "server.skill": "skill", + "server.event": "event", + "server.pty": "pty", + "server.shell": "shell", + "server.question": "question", + "server.reference": "reference", "server.project": "project", - "server.projectCopy": "projectCopies", + "server.projectCopy": "projectCopy", } as const export const endpointNames = { diff --git a/packages/client/src/generated-effect/client.ts b/packages/client/src/generated-effect/client.ts index 30047f4a04..59f12e225d 100644 --- a/packages/client/src/generated-effect/client.ts +++ b/packages/client/src/generated-effect/client.ts @@ -805,25 +805,25 @@ const adaptGroup20 = (raw: RawClient["server.projectCopy"]) => ({ const adaptClient = (raw: RawClient) => ({ health: adaptGroup0(raw["server.health"]), location: adaptGroup1(raw["server.location"]), - agents: adaptGroup2(raw["server.agent"]), - sessions: adaptGroup3(raw["server.session"]), - messages: adaptGroup4(raw["server.message"]), - models: adaptGroup5(raw["server.model"]), + agent: adaptGroup2(raw["server.agent"]), + session: adaptGroup3(raw["server.session"]), + message: adaptGroup4(raw["server.message"]), + model: adaptGroup5(raw["server.model"]), generate: adaptGroup6(raw["server.generate"]), - providers: adaptGroup7(raw["server.provider"]), - integrations: adaptGroup8(raw["server.integration"]), - credentials: adaptGroup9(raw["server.credential"]), + provider: adaptGroup7(raw["server.provider"]), + integration: adaptGroup8(raw["server.integration"]), + credential: adaptGroup9(raw["server.credential"]), project: adaptGroup10(raw["server.project"]), - permissions: adaptGroup11(raw["server.permission"]), - files: adaptGroup12(raw["server.fs"]), - commands: adaptGroup13(raw["server.command"]), - skills: adaptGroup14(raw["server.skill"]), - events: adaptGroup15(raw["server.event"]), - ptys: adaptGroup16(raw["server.pty"]), - "server.shell": adaptGroup17(raw["server.shell"]), - questions: adaptGroup18(raw["server.question"]), - references: adaptGroup19(raw["server.reference"]), - projectCopies: adaptGroup20(raw["server.projectCopy"]), + permission: adaptGroup11(raw["server.permission"]), + file: adaptGroup12(raw["server.fs"]), + command: adaptGroup13(raw["server.command"]), + skill: adaptGroup14(raw["server.skill"]), + event: adaptGroup15(raw["server.event"]), + pty: adaptGroup16(raw["server.pty"]), + shell: adaptGroup17(raw["server.shell"]), + question: adaptGroup18(raw["server.question"]), + reference: adaptGroup19(raw["server.reference"]), + projectCopy: adaptGroup20(raw["server.projectCopy"]), }) export const make = (options?: { readonly baseUrl?: URL | string }) => diff --git a/packages/client/src/generated/client.ts b/packages/client/src/generated/client.ts index 8a830f49b7..a3402e0c4c 100644 --- a/packages/client/src/generated/client.ts +++ b/packages/client/src/generated/client.ts @@ -2,138 +2,138 @@ import type { HealthGetOutput, LocationGetInput, LocationGetOutput, - AgentsListInput, - AgentsListOutput, - SessionsListInput, - SessionsListOutput, - SessionsCreateInput, - SessionsCreateOutput, - SessionsActiveOutput, - SessionsGetInput, - SessionsGetOutput, - SessionsForkInput, - SessionsForkOutput, - SessionsSwitchAgentInput, - SessionsSwitchAgentOutput, - SessionsSwitchModelInput, - SessionsSwitchModelOutput, - SessionsRenameInput, - SessionsRenameOutput, - SessionsPromptInput, - SessionsPromptOutput, - SessionsCompactInput, - SessionsCompactOutput, - SessionsWaitInput, - SessionsWaitOutput, - SessionsStageInput, - SessionsStageOutput, - SessionsClearInput, - SessionsClearOutput, - SessionsCommitInput, - SessionsCommitOutput, - SessionsContextInput, - SessionsContextOutput, - SessionsHistoryInput, - SessionsHistoryOutput, - SessionsEventsInput, - SessionsEventsOutput, - SessionsInterruptInput, - SessionsInterruptOutput, - SessionsMessageInput, - SessionsMessageOutput, - MessagesListInput, - MessagesListOutput, - ModelsListInput, - ModelsListOutput, + AgentListInput, + AgentListOutput, + SessionListInput, + SessionListOutput, + SessionCreateInput, + SessionCreateOutput, + SessionActiveOutput, + SessionGetInput, + SessionGetOutput, + SessionForkInput, + SessionForkOutput, + SessionSwitchAgentInput, + SessionSwitchAgentOutput, + SessionSwitchModelInput, + SessionSwitchModelOutput, + SessionRenameInput, + SessionRenameOutput, + SessionPromptInput, + SessionPromptOutput, + SessionCompactInput, + SessionCompactOutput, + SessionWaitInput, + SessionWaitOutput, + SessionStageInput, + SessionStageOutput, + SessionClearInput, + SessionClearOutput, + SessionCommitInput, + SessionCommitOutput, + SessionContextInput, + SessionContextOutput, + SessionHistoryInput, + SessionHistoryOutput, + SessionEventsInput, + SessionEventsOutput, + SessionInterruptInput, + SessionInterruptOutput, + SessionMessageInput, + SessionMessageOutput, + MessageListInput, + MessageListOutput, + ModelListInput, + ModelListOutput, GenerateTextInput, GenerateTextOutput, - ProvidersListInput, - ProvidersListOutput, - ProvidersGetInput, - ProvidersGetOutput, - IntegrationsListInput, - IntegrationsListOutput, - IntegrationsGetInput, - IntegrationsGetOutput, - IntegrationsConnectKeyInput, - IntegrationsConnectKeyOutput, - IntegrationsConnectOauthInput, - IntegrationsConnectOauthOutput, - IntegrationsAttemptStatusInput, - IntegrationsAttemptStatusOutput, - IntegrationsAttemptCompleteInput, - IntegrationsAttemptCompleteOutput, - IntegrationsAttemptCancelInput, - IntegrationsAttemptCancelOutput, - CredentialsUpdateInput, - CredentialsUpdateOutput, - CredentialsRemoveInput, - CredentialsRemoveOutput, + ProviderListInput, + ProviderListOutput, + ProviderGetInput, + ProviderGetOutput, + IntegrationListInput, + IntegrationListOutput, + IntegrationGetInput, + IntegrationGetOutput, + IntegrationConnectKeyInput, + IntegrationConnectKeyOutput, + IntegrationConnectOauthInput, + IntegrationConnectOauthOutput, + IntegrationAttemptStatusInput, + IntegrationAttemptStatusOutput, + IntegrationAttemptCompleteInput, + IntegrationAttemptCompleteOutput, + IntegrationAttemptCancelInput, + IntegrationAttemptCancelOutput, + CredentialUpdateInput, + CredentialUpdateOutput, + CredentialRemoveInput, + CredentialRemoveOutput, ProjectCurrentInput, ProjectCurrentOutput, ProjectDirectoriesInput, ProjectDirectoriesOutput, - PermissionsListRequestsInput, - PermissionsListRequestsOutput, - PermissionsListSavedInput, - PermissionsListSavedOutput, - PermissionsRemoveSavedInput, - PermissionsRemoveSavedOutput, - PermissionsCreateInput, - PermissionsCreateOutput, - PermissionsListInput, - PermissionsListOutput, - PermissionsGetInput, - PermissionsGetOutput, - PermissionsReplyInput, - PermissionsReplyOutput, - FilesReadInput, - FilesReadOutput, - FilesListInput, - FilesListOutput, - FilesFindInput, - FilesFindOutput, - CommandsListInput, - CommandsListOutput, - SkillsListInput, - SkillsListOutput, - EventsSubscribeOutput, - PtysListInput, - PtysListOutput, - PtysCreateInput, - PtysCreateOutput, - PtysGetInput, - PtysGetOutput, - PtysUpdateInput, - PtysUpdateOutput, - PtysRemoveInput, - PtysRemoveOutput, - ServerShellListInput, - ServerShellListOutput, - ServerShellCreateInput, - ServerShellCreateOutput, - ServerShellGetInput, - ServerShellGetOutput, - ServerShellOutputInput, - ServerShellOutputOutput, - ServerShellRemoveInput, - ServerShellRemoveOutput, - QuestionsListRequestsInput, - QuestionsListRequestsOutput, - QuestionsListInput, - QuestionsListOutput, - QuestionsReplyInput, - QuestionsReplyOutput, - QuestionsRejectInput, - QuestionsRejectOutput, - ReferencesListInput, - ReferencesListOutput, - ProjectCopiesCreateInput, - ProjectCopiesCreateOutput, - ProjectCopiesRemoveInput, - ProjectCopiesRemoveOutput, - ProjectCopiesRefreshInput, - ProjectCopiesRefreshOutput, + PermissionListRequestsInput, + PermissionListRequestsOutput, + PermissionListSavedInput, + PermissionListSavedOutput, + PermissionRemoveSavedInput, + PermissionRemoveSavedOutput, + PermissionCreateInput, + PermissionCreateOutput, + PermissionListInput, + PermissionListOutput, + PermissionGetInput, + PermissionGetOutput, + PermissionReplyInput, + PermissionReplyOutput, + FileReadInput, + FileReadOutput, + FileListInput, + FileListOutput, + FileFindInput, + FileFindOutput, + CommandListInput, + CommandListOutput, + SkillListInput, + SkillListOutput, + EventSubscribeOutput, + PtyListInput, + PtyListOutput, + PtyCreateInput, + PtyCreateOutput, + PtyGetInput, + PtyGetOutput, + PtyUpdateInput, + PtyUpdateOutput, + PtyRemoveInput, + PtyRemoveOutput, + ShellListInput, + ShellListOutput, + ShellCreateInput, + ShellCreateOutput, + ShellGetInput, + ShellGetOutput, + ShellOutputInput, + ShellOutputOutput, + ShellRemoveInput, + ShellRemoveOutput, + QuestionListRequestsInput, + QuestionListRequestsOutput, + QuestionListInput, + QuestionListOutput, + QuestionReplyInput, + QuestionReplyOutput, + QuestionRejectInput, + QuestionRejectOutput, + ReferenceListInput, + ReferenceListOutput, + ProjectCopyCreateInput, + ProjectCopyCreateOutput, + ProjectCopyRemoveInput, + ProjectCopyRemoveOutput, + ProjectCopyRefreshInput, + ProjectCopyRefreshOutput, } from "./types" import { ClientError } from "./client-error" @@ -292,9 +292,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - agents: { - list: (input?: AgentsListInput, requestOptions?: RequestOptions) => - request( + agent: { + list: (input?: AgentListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/agent`, @@ -306,9 +306,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - sessions: { - list: (input?: SessionsListInput, requestOptions?: RequestOptions) => - request( + session: { + list: (input?: SessionListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/session`, @@ -328,8 +328,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - create: (input?: SessionsCreateInput, requestOptions?: RequestOptions) => - request<{ readonly data: SessionsCreateOutput }>( + create: (input?: SessionCreateInput, requestOptions?: RequestOptions) => + request<{ readonly data: SessionCreateOutput }>( { method: "POST", path: `/api/session`, @@ -346,7 +346,7 @@ export function make(options: ClientOptions) { requestOptions, ).then((value) => value.data), active: (requestOptions?: RequestOptions) => - request<{ readonly data: SessionsActiveOutput }>( + request<{ readonly data: SessionActiveOutput }>( { method: "GET", path: `/api/session/active`, @@ -356,8 +356,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - get: (input: SessionsGetInput, requestOptions?: RequestOptions) => - request<{ readonly data: SessionsGetOutput }>( + get: (input: SessionGetInput, requestOptions?: RequestOptions) => + request<{ readonly data: SessionGetOutput }>( { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}`, @@ -367,8 +367,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - fork: (input: SessionsForkInput, requestOptions?: RequestOptions) => - request<{ readonly data: SessionsForkOutput }>( + fork: (input: SessionForkInput, requestOptions?: RequestOptions) => + request<{ readonly data: SessionForkOutput }>( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/fork`, @@ -379,8 +379,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - switchAgent: (input: SessionsSwitchAgentInput, requestOptions?: RequestOptions) => - request( + switchAgent: (input: SessionSwitchAgentInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/agent`, @@ -391,8 +391,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - switchModel: (input: SessionsSwitchModelInput, requestOptions?: RequestOptions) => - request( + switchModel: (input: SessionSwitchModelInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/model`, @@ -403,8 +403,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - rename: (input: SessionsRenameInput, requestOptions?: RequestOptions) => - request( + rename: (input: SessionRenameInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/rename`, @@ -415,8 +415,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - prompt: (input: SessionsPromptInput, requestOptions?: RequestOptions) => - request<{ readonly data: SessionsPromptOutput }>( + prompt: (input: SessionPromptInput, requestOptions?: RequestOptions) => + request<{ readonly data: SessionPromptOutput }>( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/prompt`, @@ -427,8 +427,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - compact: (input: SessionsCompactInput, requestOptions?: RequestOptions) => - request( + compact: (input: SessionCompactInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/compact`, @@ -438,8 +438,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - wait: (input: SessionsWaitInput, requestOptions?: RequestOptions) => - request( + wait: (input: SessionWaitInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/wait`, @@ -449,8 +449,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - stage: (input: SessionsStageInput, requestOptions?: RequestOptions) => - request<{ readonly data: SessionsStageOutput }>( + stage: (input: SessionStageInput, requestOptions?: RequestOptions) => + request<{ readonly data: SessionStageOutput }>( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/revert/stage`, @@ -461,8 +461,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - clear: (input: SessionsClearInput, requestOptions?: RequestOptions) => - request( + clear: (input: SessionClearInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/revert/clear`, @@ -472,8 +472,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - commit: (input: SessionsCommitInput, requestOptions?: RequestOptions) => - request( + commit: (input: SessionCommitInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/revert/commit`, @@ -483,8 +483,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - context: (input: SessionsContextInput, requestOptions?: RequestOptions) => - request<{ readonly data: SessionsContextOutput }>( + context: (input: SessionContextInput, requestOptions?: RequestOptions) => + request<{ readonly data: SessionContextOutput }>( { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/context`, @@ -494,8 +494,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - history: (input: SessionsHistoryInput, requestOptions?: RequestOptions) => - request( + history: (input: SessionHistoryInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/history`, @@ -506,8 +506,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - events: (input: SessionsEventsInput, requestOptions?: RequestOptions): AsyncIterable => - sse( + events: (input: SessionEventsInput, requestOptions?: RequestOptions): AsyncIterable => + sse( { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/event`, @@ -518,8 +518,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - interrupt: (input: SessionsInterruptInput, requestOptions?: RequestOptions) => - request( + interrupt: (input: SessionInterruptInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/interrupt`, @@ -529,8 +529,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - message: (input: SessionsMessageInput, requestOptions?: RequestOptions) => - request<{ readonly data: SessionsMessageOutput }>( + message: (input: SessionMessageInput, requestOptions?: RequestOptions) => + request<{ readonly data: SessionMessageOutput }>( { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/message/${encodeURIComponent(input.messageID)}`, @@ -541,9 +541,9 @@ export function make(options: ClientOptions) { requestOptions, ).then((value) => value.data), }, - messages: { - list: (input: MessagesListInput, requestOptions?: RequestOptions) => - request( + message: { + list: (input: MessageListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/message`, @@ -555,9 +555,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - models: { - list: (input?: ModelsListInput, requestOptions?: RequestOptions) => - request( + model: { + list: (input?: ModelListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/model`, @@ -584,9 +584,9 @@ export function make(options: ClientOptions) { requestOptions, ).then((value) => value.data), }, - providers: { - list: (input?: ProvidersListInput, requestOptions?: RequestOptions) => - request( + provider: { + list: (input?: ProviderListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/provider`, @@ -597,8 +597,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - get: (input: ProvidersGetInput, requestOptions?: RequestOptions) => - request( + get: (input: ProviderGetInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/provider/${encodeURIComponent(input.providerID)}`, @@ -610,9 +610,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - integrations: { - list: (input?: IntegrationsListInput, requestOptions?: RequestOptions) => - request( + integration: { + list: (input?: IntegrationListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/integration`, @@ -623,8 +623,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - get: (input: IntegrationsGetInput, requestOptions?: RequestOptions) => - request( + get: (input: IntegrationGetInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/integration/${encodeURIComponent(input.integrationID)}`, @@ -635,8 +635,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - connectKey: (input: IntegrationsConnectKeyInput, requestOptions?: RequestOptions) => - request( + connectKey: (input: IntegrationConnectKeyInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/key`, @@ -648,8 +648,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - connectOauth: (input: IntegrationsConnectOauthInput, requestOptions?: RequestOptions) => - request( + connectOauth: (input: IntegrationConnectOauthInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth`, @@ -661,8 +661,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - attemptStatus: (input: IntegrationsAttemptStatusInput, requestOptions?: RequestOptions) => - request( + attemptStatus: (input: IntegrationAttemptStatusInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/integration/attempt/${encodeURIComponent(input.attemptID)}`, @@ -673,8 +673,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - attemptComplete: (input: IntegrationsAttemptCompleteInput, requestOptions?: RequestOptions) => - request( + attemptComplete: (input: IntegrationAttemptCompleteInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/integration/attempt/${encodeURIComponent(input.attemptID)}/complete`, @@ -686,8 +686,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - attemptCancel: (input: IntegrationsAttemptCancelInput, requestOptions?: RequestOptions) => - request( + attemptCancel: (input: IntegrationAttemptCancelInput, requestOptions?: RequestOptions) => + request( { method: "DELETE", path: `/api/integration/attempt/${encodeURIComponent(input.attemptID)}`, @@ -699,9 +699,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - credentials: { - update: (input: CredentialsUpdateInput, requestOptions?: RequestOptions) => - request( + credential: { + update: (input: CredentialUpdateInput, requestOptions?: RequestOptions) => + request( { method: "PATCH", path: `/api/credential/${encodeURIComponent(input.credentialID)}`, @@ -713,8 +713,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - remove: (input: CredentialsRemoveInput, requestOptions?: RequestOptions) => - request( + remove: (input: CredentialRemoveInput, requestOptions?: RequestOptions) => + request( { method: "DELETE", path: `/api/credential/${encodeURIComponent(input.credentialID)}`, @@ -752,9 +752,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - permissions: { - listRequests: (input?: PermissionsListRequestsInput, requestOptions?: RequestOptions) => - request( + permission: { + listRequests: (input?: PermissionListRequestsInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/permission/request`, @@ -765,8 +765,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - listSaved: (input?: PermissionsListSavedInput, requestOptions?: RequestOptions) => - request<{ readonly data: PermissionsListSavedOutput }>( + listSaved: (input?: PermissionListSavedInput, requestOptions?: RequestOptions) => + request<{ readonly data: PermissionListSavedOutput }>( { method: "GET", path: `/api/permission/saved`, @@ -777,8 +777,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - removeSaved: (input: PermissionsRemoveSavedInput, requestOptions?: RequestOptions) => - request( + removeSaved: (input: PermissionRemoveSavedInput, requestOptions?: RequestOptions) => + request( { method: "DELETE", path: `/api/permission/saved/${encodeURIComponent(input.id)}`, @@ -788,8 +788,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - create: (input: PermissionsCreateInput, requestOptions?: RequestOptions) => - request<{ readonly data: PermissionsCreateOutput }>( + create: (input: PermissionCreateInput, requestOptions?: RequestOptions) => + request<{ readonly data: PermissionCreateOutput }>( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/permission`, @@ -808,8 +808,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - list: (input: PermissionsListInput, requestOptions?: RequestOptions) => - request<{ readonly data: PermissionsListOutput }>( + list: (input: PermissionListInput, requestOptions?: RequestOptions) => + request<{ readonly data: PermissionListOutput }>( { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/permission`, @@ -819,8 +819,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - get: (input: PermissionsGetInput, requestOptions?: RequestOptions) => - request<{ readonly data: PermissionsGetOutput }>( + get: (input: PermissionGetInput, requestOptions?: RequestOptions) => + request<{ readonly data: PermissionGetOutput }>( { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/${encodeURIComponent(input.requestID)}`, @@ -830,8 +830,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - reply: (input: PermissionsReplyInput, requestOptions?: RequestOptions) => - request( + reply: (input: PermissionReplyInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/${encodeURIComponent(input.requestID)}/reply`, @@ -843,9 +843,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - files: { - read: (input: FilesReadInput, requestOptions?: RequestOptions) => - request( + file: { + read: (input: FileReadInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/fs/read/${encodePath(input.path)}`, @@ -857,8 +857,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - list: (input?: FilesListInput, requestOptions?: RequestOptions) => - request( + list: (input?: FileListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/fs/list`, @@ -869,8 +869,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - find: (input: FilesFindInput, requestOptions?: RequestOptions) => - request( + find: (input: FileFindInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/fs/find`, @@ -882,9 +882,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - commands: { - list: (input?: CommandsListInput, requestOptions?: RequestOptions) => - request( + command: { + list: (input?: CommandListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/command`, @@ -896,9 +896,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - skills: { - list: (input?: SkillsListInput, requestOptions?: RequestOptions) => - request( + skill: { + list: (input?: SkillListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/skill`, @@ -910,16 +910,16 @@ export function make(options: ClientOptions) { requestOptions, ), }, - events: { - subscribe: (requestOptions?: RequestOptions): AsyncIterable => - sse( + event: { + subscribe: (requestOptions?: RequestOptions): AsyncIterable => + sse( { method: "GET", path: `/api/event`, successStatus: 200, declaredStatuses: [401, 400], empty: false }, requestOptions, ), }, - ptys: { - list: (input?: PtysListInput, requestOptions?: RequestOptions) => - request( + pty: { + list: (input?: PtyListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/pty`, @@ -930,8 +930,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - create: (input?: PtysCreateInput, requestOptions?: RequestOptions) => - request( + create: (input?: PtyCreateInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/pty`, @@ -949,8 +949,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - get: (input: PtysGetInput, requestOptions?: RequestOptions) => - request( + get: (input: PtyGetInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/pty/${encodeURIComponent(input.ptyID)}`, @@ -961,8 +961,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - update: (input: PtysUpdateInput, requestOptions?: RequestOptions) => - request( + update: (input: PtyUpdateInput, requestOptions?: RequestOptions) => + request( { method: "PUT", path: `/api/pty/${encodeURIComponent(input.ptyID)}`, @@ -974,8 +974,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - remove: (input: PtysRemoveInput, requestOptions?: RequestOptions) => - request( + remove: (input: PtyRemoveInput, requestOptions?: RequestOptions) => + request( { method: "DELETE", path: `/api/pty/${encodeURIComponent(input.ptyID)}`, @@ -987,9 +987,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - "server.shell": { - list: (input?: ServerShellListInput, requestOptions?: RequestOptions) => - request( + shell: { + list: (input?: ShellListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/shell`, @@ -1000,8 +1000,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - create: (input: ServerShellCreateInput, requestOptions?: RequestOptions) => - request( + create: (input: ShellCreateInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/shell`, @@ -1018,8 +1018,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - get: (input: ServerShellGetInput, requestOptions?: RequestOptions) => - request( + get: (input: ShellGetInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/shell/${encodeURIComponent(input.id)}`, @@ -1030,8 +1030,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - output: (input: ServerShellOutputInput, requestOptions?: RequestOptions) => - request( + output: (input: ShellOutputInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/shell/${encodeURIComponent(input.id)}/output`, @@ -1042,8 +1042,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - remove: (input: ServerShellRemoveInput, requestOptions?: RequestOptions) => - request( + remove: (input: ShellRemoveInput, requestOptions?: RequestOptions) => + request( { method: "DELETE", path: `/api/shell/${encodeURIComponent(input.id)}`, @@ -1055,9 +1055,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - questions: { - listRequests: (input?: QuestionsListRequestsInput, requestOptions?: RequestOptions) => - request( + question: { + listRequests: (input?: QuestionListRequestsInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/question/request`, @@ -1068,8 +1068,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - list: (input: QuestionsListInput, requestOptions?: RequestOptions) => - request<{ readonly data: QuestionsListOutput }>( + list: (input: QuestionListInput, requestOptions?: RequestOptions) => + request<{ readonly data: QuestionListOutput }>( { method: "GET", path: `/api/session/${encodeURIComponent(input.sessionID)}/question`, @@ -1079,8 +1079,8 @@ export function make(options: ClientOptions) { }, requestOptions, ).then((value) => value.data), - reply: (input: QuestionsReplyInput, requestOptions?: RequestOptions) => - request( + reply: (input: QuestionReplyInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/question/${encodeURIComponent(input.requestID)}/reply`, @@ -1091,8 +1091,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - reject: (input: QuestionsRejectInput, requestOptions?: RequestOptions) => - request( + reject: (input: QuestionRejectInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/question/${encodeURIComponent(input.requestID)}/reject`, @@ -1103,9 +1103,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - references: { - list: (input?: ReferencesListInput, requestOptions?: RequestOptions) => - request( + reference: { + list: (input?: ReferenceListInput, requestOptions?: RequestOptions) => + request( { method: "GET", path: `/api/reference`, @@ -1117,9 +1117,9 @@ export function make(options: ClientOptions) { requestOptions, ), }, - projectCopies: { - create: (input: ProjectCopiesCreateInput, requestOptions?: RequestOptions) => - request( + projectCopy: { + create: (input: ProjectCopyCreateInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/experimental/project/${encodeURIComponent(input.projectID)}/copy`, @@ -1131,8 +1131,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - remove: (input: ProjectCopiesRemoveInput, requestOptions?: RequestOptions) => - request( + remove: (input: ProjectCopyRemoveInput, requestOptions?: RequestOptions) => + request( { method: "DELETE", path: `/experimental/project/${encodeURIComponent(input.projectID)}/copy`, @@ -1144,8 +1144,8 @@ export function make(options: ClientOptions) { }, requestOptions, ), - refresh: (input: ProjectCopiesRefreshInput, requestOptions?: RequestOptions) => - request( + refresh: (input: ProjectCopyRefreshInput, requestOptions?: RequestOptions) => + request( { method: "POST", path: `/experimental/project/${encodeURIComponent(input.projectID)}/copy/refresh`, diff --git a/packages/client/src/generated/types.ts b/packages/client/src/generated/types.ts index a375bc1e7c..d09c3bdcfd 100644 --- a/packages/client/src/generated/types.ts +++ b/packages/client/src/generated/types.ts @@ -127,13 +127,13 @@ export type LocationGetOutput = { readonly project: { readonly id: string; readonly directory: string } } -export type AgentsListInput = { +export type AgentListInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type AgentsListOutput = { +export type AgentListOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -160,7 +160,7 @@ export type AgentsListOutput = { }> } -export type SessionsListInput = { +export type SessionListInput = { readonly workspace?: { readonly workspace?: string | undefined readonly limit?: number | undefined @@ -243,7 +243,7 @@ export type SessionsListInput = { }["cursor"] } -export type SessionsListOutput = { +export type SessionListOutput = { readonly data: ReadonlyArray<{ readonly id: string readonly parentID?: string @@ -278,7 +278,7 @@ export type SessionsListOutput = { readonly cursor: { readonly previous?: string | null; readonly next?: string | null } } -export type SessionsCreateInput = { +export type SessionCreateInput = { readonly id?: { readonly id?: string | null readonly agent?: string | null @@ -305,7 +305,7 @@ export type SessionsCreateInput = { }["location"] } -export type SessionsCreateOutput = { +export type SessionCreateOutput = { readonly data: { readonly id: string readonly parentID?: string @@ -339,11 +339,11 @@ export type SessionsCreateOutput = { } }["data"] -export type SessionsActiveOutput = { readonly data: { readonly [x: string]: { readonly type: "running" } } }["data"] +export type SessionActiveOutput = { readonly data: { readonly [x: string]: { readonly type: "running" } } }["data"] -export type SessionsGetInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } +export type SessionGetInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } -export type SessionsGetOutput = { +export type SessionGetOutput = { readonly data: { readonly id: string readonly parentID?: string @@ -377,12 +377,12 @@ export type SessionsGetOutput = { } }["data"] -export type SessionsForkInput = { +export type SessionForkInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] readonly messageID?: { readonly messageID?: string | undefined }["messageID"] } -export type SessionsForkOutput = { +export type SessionForkOutput = { readonly data: { readonly id: string readonly parentID?: string @@ -416,30 +416,30 @@ export type SessionsForkOutput = { } }["data"] -export type SessionsSwitchAgentInput = { +export type SessionSwitchAgentInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] readonly agent: { readonly agent: string }["agent"] } -export type SessionsSwitchAgentOutput = void +export type SessionSwitchAgentOutput = void -export type SessionsSwitchModelInput = { +export type SessionSwitchModelInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] readonly model: { readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } }["model"] } -export type SessionsSwitchModelOutput = void +export type SessionSwitchModelOutput = void -export type SessionsRenameInput = { +export type SessionRenameInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] readonly title: { readonly title: string }["title"] } -export type SessionsRenameOutput = void +export type SessionRenameOutput = void -export type SessionsPromptInput = { +export type SessionPromptInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] readonly id?: { readonly id?: string | null @@ -515,7 +515,7 @@ export type SessionsPromptInput = { }["resume"] } -export type SessionsPromptOutput = { +export type SessionPromptOutput = { readonly data: { readonly admittedSeq: number readonly id: string @@ -540,21 +540,21 @@ export type SessionsPromptOutput = { } }["data"] -export type SessionsCompactInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } +export type SessionCompactInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } -export type SessionsCompactOutput = void +export type SessionCompactOutput = void -export type SessionsWaitInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } +export type SessionWaitInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } -export type SessionsWaitOutput = void +export type SessionWaitOutput = void -export type SessionsStageInput = { +export type SessionStageInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] readonly messageID: { readonly messageID: string; readonly files?: boolean | undefined }["messageID"] readonly files?: { readonly messageID: string; readonly files?: boolean | undefined }["files"] } -export type SessionsStageOutput = { +export type SessionStageOutput = { readonly data: { readonly messageID: string readonly partID?: string @@ -570,17 +570,17 @@ export type SessionsStageOutput = { } }["data"] -export type SessionsClearInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } +export type SessionClearInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } -export type SessionsClearOutput = void +export type SessionClearOutput = void -export type SessionsCommitInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } +export type SessionCommitInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } -export type SessionsCommitOutput = void +export type SessionCommitOutput = void -export type SessionsContextInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } +export type SessionContextInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } -export type SessionsContextOutput = { +export type SessionContextOutput = { readonly data: ReadonlyArray< | { readonly id: string @@ -734,13 +734,13 @@ export type SessionsContextOutput = { > }["data"] -export type SessionsHistoryInput = { +export type SessionHistoryInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] readonly limit?: { readonly limit?: number | undefined; readonly after?: number | undefined }["limit"] readonly after?: { readonly limit?: number | undefined; readonly after?: number | undefined }["after"] } -export type SessionsHistoryOutput = { +export type SessionHistoryOutput = { readonly data: ReadonlyArray< | { readonly id: string @@ -1215,12 +1215,12 @@ export type SessionsHistoryOutput = { readonly hasMore: boolean } -export type SessionsEventsInput = { +export type SessionEventsInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] readonly after?: { readonly after?: number | undefined }["after"] } -export type SessionsEventsOutput = +export type SessionEventsOutput = | { readonly id: string readonly metadata?: { readonly [x: string]: unknown } @@ -1691,16 +1691,16 @@ export type SessionsEventsOutput = readonly data: { readonly timestamp: number; readonly sessionID: string; readonly messageID: string } } -export type SessionsInterruptInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } +export type SessionInterruptInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } -export type SessionsInterruptOutput = void +export type SessionInterruptOutput = void -export type SessionsMessageInput = { +export type SessionMessageInput = { readonly sessionID: { readonly sessionID: string; readonly messageID: string }["sessionID"] readonly messageID: { readonly sessionID: string; readonly messageID: string }["messageID"] } -export type SessionsMessageOutput = { +export type SessionMessageOutput = { readonly data: | { readonly id: string @@ -1853,7 +1853,7 @@ export type SessionsMessageOutput = { } }["data"] -export type MessagesListInput = { +export type MessageListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] readonly limit?: { readonly limit?: number | undefined @@ -1872,7 +1872,7 @@ export type MessagesListInput = { }["cursor"] } -export type MessagesListOutput = { +export type MessageListOutput = { readonly data: ReadonlyArray< | { readonly id: string @@ -2027,13 +2027,13 @@ export type MessagesListOutput = { readonly cursor: { readonly previous?: string | null; readonly next?: string | null } } -export type ModelsListInput = { +export type ModelListInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type ModelsListOutput = { +export type ModelListOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2102,13 +2102,13 @@ export type GenerateTextInput = { export type GenerateTextOutput = { readonly data: { readonly text: string } }["data"] -export type ProvidersListInput = { +export type ProviderListInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type ProvidersListOutput = { +export type ProviderListOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2134,14 +2134,14 @@ export type ProvidersListOutput = { }> } -export type ProvidersGetInput = { +export type ProviderGetInput = { readonly providerID: { readonly providerID: string }["providerID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type ProvidersGetOutput = { +export type ProviderGetOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2167,13 +2167,13 @@ export type ProvidersGetOutput = { } } -export type IntegrationsListInput = { +export type IntegrationListInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type IntegrationsListOutput = { +export type IntegrationListOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2218,14 +2218,14 @@ export type IntegrationsListOutput = { }> } -export type IntegrationsGetInput = { +export type IntegrationGetInput = { readonly integrationID: { readonly integrationID: string }["integrationID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type IntegrationsGetOutput = { +export type IntegrationGetOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2270,7 +2270,7 @@ export type IntegrationsGetOutput = { } | null } -export type IntegrationsConnectKeyInput = { +export type IntegrationConnectKeyInput = { readonly integrationID: { readonly integrationID: string }["integrationID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined @@ -2279,9 +2279,9 @@ export type IntegrationsConnectKeyInput = { readonly label?: { readonly key: string; readonly label?: string | undefined }["label"] } -export type IntegrationsConnectKeyOutput = void +export type IntegrationConnectKeyOutput = void -export type IntegrationsConnectOauthInput = { +export type IntegrationConnectOauthInput = { readonly integrationID: { readonly integrationID: string }["integrationID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined @@ -2303,7 +2303,7 @@ export type IntegrationsConnectOauthInput = { }["label"] } -export type IntegrationsConnectOauthOutput = { +export type IntegrationConnectOauthOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2321,14 +2321,14 @@ export type IntegrationsConnectOauthOutput = { } } -export type IntegrationsAttemptStatusInput = { +export type IntegrationAttemptStatusInput = { readonly attemptID: { readonly attemptID: string }["attemptID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type IntegrationsAttemptStatusOutput = { +export type IntegrationAttemptStatusOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2366,7 +2366,7 @@ export type IntegrationsAttemptStatusOutput = { } } -export type IntegrationsAttemptCompleteInput = { +export type IntegrationAttemptCompleteInput = { readonly attemptID: { readonly attemptID: string }["attemptID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined @@ -2374,18 +2374,18 @@ export type IntegrationsAttemptCompleteInput = { readonly code?: { readonly code?: string | undefined }["code"] } -export type IntegrationsAttemptCompleteOutput = void +export type IntegrationAttemptCompleteOutput = void -export type IntegrationsAttemptCancelInput = { +export type IntegrationAttemptCancelInput = { readonly attemptID: { readonly attemptID: string }["attemptID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type IntegrationsAttemptCancelOutput = void +export type IntegrationAttemptCancelOutput = void -export type CredentialsUpdateInput = { +export type CredentialUpdateInput = { readonly credentialID: { readonly credentialID: string }["credentialID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined @@ -2393,16 +2393,16 @@ export type CredentialsUpdateInput = { readonly label: { readonly label: string }["label"] } -export type CredentialsUpdateOutput = void +export type CredentialUpdateOutput = void -export type CredentialsRemoveInput = { +export type CredentialRemoveInput = { readonly credentialID: { readonly credentialID: string }["credentialID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type CredentialsRemoveOutput = void +export type CredentialRemoveOutput = void export type ProjectCurrentInput = { readonly location?: { @@ -2421,13 +2421,13 @@ export type ProjectDirectoriesInput = { export type ProjectDirectoriesOutput = ReadonlyArray<{ readonly directory: string; readonly strategy?: string }> -export type PermissionsListRequestsInput = { +export type PermissionListRequestsInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type PermissionsListRequestsOutput = { +export type PermissionListRequestsOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2444,11 +2444,9 @@ export type PermissionsListRequestsOutput = { }> } -export type PermissionsListSavedInput = { - readonly projectID?: { readonly projectID?: string | undefined }["projectID"] -} +export type PermissionListSavedInput = { readonly projectID?: { readonly projectID?: string | undefined }["projectID"] } -export type PermissionsListSavedOutput = { +export type PermissionListSavedOutput = { readonly data: ReadonlyArray<{ readonly id: string readonly projectID: string @@ -2457,11 +2455,11 @@ export type PermissionsListSavedOutput = { }> }["data"] -export type PermissionsRemoveSavedInput = { readonly id: { readonly id: string }["id"] } +export type PermissionRemoveSavedInput = { readonly id: { readonly id: string }["id"] } -export type PermissionsRemoveSavedOutput = void +export type PermissionRemoveSavedOutput = void -export type PermissionsCreateInput = { +export type PermissionCreateInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] readonly id?: { readonly id?: string | null @@ -2528,13 +2526,13 @@ export type PermissionsCreateInput = { }["agent"] } -export type PermissionsCreateOutput = { +export type PermissionCreateOutput = { readonly data: { readonly id: string; readonly effect: "allow" | "deny" | "ask" } }["data"] -export type PermissionsListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } +export type PermissionListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } -export type PermissionsListOutput = { +export type PermissionListOutput = { readonly data: ReadonlyArray<{ readonly id: string readonly sessionID: string @@ -2546,12 +2544,12 @@ export type PermissionsListOutput = { }> }["data"] -export type PermissionsGetInput = { +export type PermissionGetInput = { readonly sessionID: { readonly sessionID: string; readonly requestID: string }["sessionID"] readonly requestID: { readonly sessionID: string; readonly requestID: string }["requestID"] } -export type PermissionsGetOutput = { +export type PermissionGetOutput = { readonly data: { readonly id: string readonly sessionID: string @@ -2563,25 +2561,25 @@ export type PermissionsGetOutput = { } }["data"] -export type PermissionsReplyInput = { +export type PermissionReplyInput = { readonly sessionID: { readonly sessionID: string; readonly requestID: string }["sessionID"] readonly requestID: { readonly sessionID: string; readonly requestID: string }["requestID"] readonly reply: { readonly reply: "once" | "always" | "reject"; readonly message?: string | undefined }["reply"] readonly message?: { readonly reply: "once" | "always" | "reject"; readonly message?: string | undefined }["message"] } -export type PermissionsReplyOutput = void +export type PermissionReplyOutput = void -export type FilesReadInput = { +export type FileReadInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] readonly path: string } -export type FilesReadOutput = globalThis.Uint8Array +export type FileReadOutput = globalThis.Uint8Array -export type FilesListInput = { +export type FileListInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined readonly path?: string | undefined @@ -2592,7 +2590,7 @@ export type FilesListInput = { }["path"] } -export type FilesListOutput = { +export type FileListOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2601,7 +2599,7 @@ export type FilesListOutput = { readonly data: ReadonlyArray<{ readonly path: string; readonly type: "file" | "directory" }> } -export type FilesFindInput = { +export type FileFindInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined readonly query: string @@ -2628,7 +2626,7 @@ export type FilesFindInput = { }["limit"] } -export type FilesFindOutput = { +export type FileFindOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2637,13 +2635,13 @@ export type FilesFindOutput = { readonly data: ReadonlyArray<{ readonly path: string; readonly type: "file" | "directory" }> } -export type CommandsListInput = { +export type CommandListInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type CommandsListOutput = { +export type CommandListOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2659,13 +2657,13 @@ export type CommandsListOutput = { }> } -export type SkillsListInput = { +export type SkillListInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type SkillsListOutput = { +export type SkillListOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2680,15 +2678,1333 @@ export type SkillsListOutput = { }> } -export type EventsSubscribeOutput = OpenCodeEventEncoded +export type EventSubscribeOutput = + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "models-dev.refreshed" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: {} + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "integration.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: {} + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "integration.connection.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly integrationID: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "catalog.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: {} + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.created" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly sessionID: string + readonly info: { + readonly id: string + readonly slug: string + readonly projectID: string + readonly workspaceID?: string + readonly directory: string + readonly path?: string + readonly parentID?: string + readonly summary?: { + readonly additions: number + readonly deletions: number + readonly files: number + readonly diffs?: ReadonlyArray<{ + readonly file?: string + readonly patch?: string + readonly additions: number + readonly deletions: number + readonly status?: "added" | "deleted" | "modified" + }> + } + readonly cost?: number + readonly tokens?: { + readonly input: number + readonly output: number + readonly reasoning: number + readonly cache: { readonly read: number; readonly write: number } + } + readonly share?: { readonly url: string } + readonly title: string + readonly agent?: string + readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } + readonly version: string + readonly metadata?: { readonly [x: string]: any } + readonly time: { + readonly created: number + readonly updated: number + readonly compacting?: number + readonly archived?: number + } + readonly permission?: ReadonlyArray<{ + readonly permission: string + readonly pattern: string + readonly action: "allow" | "deny" | "ask" + }> + readonly revert?: { + readonly messageID: string + readonly partID?: string + readonly snapshot?: string + readonly diff?: string + } + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly sessionID: string + readonly info: { + readonly id: string + readonly slug: string + readonly projectID: string + readonly workspaceID?: string + readonly directory: string + readonly path?: string + readonly parentID?: string + readonly summary?: { + readonly additions: number + readonly deletions: number + readonly files: number + readonly diffs?: ReadonlyArray<{ + readonly file?: string + readonly patch?: string + readonly additions: number + readonly deletions: number + readonly status?: "added" | "deleted" | "modified" + }> + } + readonly cost?: number + readonly tokens?: { + readonly input: number + readonly output: number + readonly reasoning: number + readonly cache: { readonly read: number; readonly write: number } + } + readonly share?: { readonly url: string } + readonly title: string + readonly agent?: string + readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } + readonly version: string + readonly metadata?: { readonly [x: string]: any } + readonly time: { + readonly created: number + readonly updated: number + readonly compacting?: number + readonly archived?: number + } + readonly permission?: ReadonlyArray<{ + readonly permission: string + readonly pattern: string + readonly action: "allow" | "deny" | "ask" + }> + readonly revert?: { + readonly messageID: string + readonly partID?: string + readonly snapshot?: string + readonly diff?: string + } + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.deleted" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly sessionID: string + readonly info: { + readonly id: string + readonly slug: string + readonly projectID: string + readonly workspaceID?: string + readonly directory: string + readonly path?: string + readonly parentID?: string + readonly summary?: { + readonly additions: number + readonly deletions: number + readonly files: number + readonly diffs?: ReadonlyArray<{ + readonly file?: string + readonly patch?: string + readonly additions: number + readonly deletions: number + readonly status?: "added" | "deleted" | "modified" + }> + } + readonly cost?: number + readonly tokens?: { + readonly input: number + readonly output: number + readonly reasoning: number + readonly cache: { readonly read: number; readonly write: number } + } + readonly share?: { readonly url: string } + readonly title: string + readonly agent?: string + readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } + readonly version: string + readonly metadata?: { readonly [x: string]: any } + readonly time: { + readonly created: number + readonly updated: number + readonly compacting?: number + readonly archived?: number + } + readonly permission?: ReadonlyArray<{ + readonly permission: string + readonly pattern: string + readonly action: "allow" | "deny" | "ask" + }> + readonly revert?: { + readonly messageID: string + readonly partID?: string + readonly snapshot?: string + readonly diff?: string + } + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "message.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly sessionID: string + readonly info: + | { + readonly id: string + readonly sessionID: string + readonly role: "user" + readonly time: { readonly created: number } + readonly format?: + | ( + | { readonly type: "text" } + | { + readonly type: "json_schema" + readonly schema: { readonly [x: string]: any } + readonly retryCount?: number | undefined | undefined + } + ) + | undefined + readonly summary?: + | { + readonly title?: string | undefined + readonly body?: string | undefined + readonly diffs: ReadonlyArray<{ + readonly file?: string + readonly patch?: string + readonly additions: number + readonly deletions: number + readonly status?: "added" | "deleted" | "modified" + }> + } + | undefined + readonly agent: string + readonly model: { + readonly providerID: string + readonly modelID: string + readonly variant?: string | undefined + } + readonly system?: string | undefined + readonly tools?: { readonly [x: string]: boolean } | undefined + } + | { + readonly id: string + readonly sessionID: string + readonly role: "assistant" + readonly time: { readonly created: number; readonly completed?: number | undefined } + readonly error?: + | { + readonly name: "ProviderAuthError" + readonly data: { readonly providerID: string; readonly message: string } + } + | { + readonly name: "UnknownError" + readonly data: { readonly message: string; readonly ref?: string | undefined } + } + | { readonly name: "MessageOutputLengthError"; readonly data: {} } + | { readonly name: "MessageAbortedError"; readonly data: { readonly message: string } } + | { + readonly name: "StructuredOutputError" + readonly data: { readonly message: string; readonly retries: number } + } + | { + readonly name: "ContextOverflowError" + readonly data: { readonly message: string; readonly responseBody?: string | undefined } + } + | { readonly name: "ContentFilterError"; readonly data: { readonly message: string } } + | { + readonly name: "APIError" + readonly data: { + readonly message: string + readonly statusCode?: number | undefined + readonly isRetryable: boolean + readonly responseHeaders?: { readonly [x: string]: string } | undefined + readonly responseBody?: string | undefined + readonly metadata?: { readonly [x: string]: string } | undefined + } + } + | undefined + readonly parentID: string + readonly modelID: string + readonly providerID: string + readonly mode: string + readonly agent: string + readonly path: { readonly cwd: string; readonly root: string } + readonly summary?: boolean | undefined + readonly cost: number + readonly tokens: { + readonly total?: number | undefined + readonly input: number + readonly output: number + readonly reasoning: number + readonly cache: { readonly read: number; readonly write: number } + } + readonly structured?: any | undefined + readonly variant?: string | undefined + readonly finish?: string | undefined + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "message.removed" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly sessionID: string; readonly messageID: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "message.part.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly sessionID: string + readonly part: + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "text" + readonly text: string + readonly synthetic?: boolean | undefined + readonly ignored?: boolean | undefined + readonly time?: { readonly start: number; readonly end?: number | undefined } | undefined + readonly metadata?: { readonly [x: string]: any } | undefined + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "subtask" + readonly prompt: string + readonly description: string + readonly agent: string + readonly model?: { readonly providerID: string; readonly modelID: string } | undefined + readonly command?: string | undefined + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "reasoning" + readonly text: string + readonly metadata?: { readonly [x: string]: any } | undefined + readonly time: { readonly start: number; readonly end?: number | undefined } + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "file" + readonly mime: string + readonly filename?: string | undefined + readonly url: string + readonly source?: + | ( + | { + readonly text: { readonly value: string; readonly start: number; readonly end: number } + readonly type: "file" + readonly path: string + } + | { + readonly text: { readonly value: string; readonly start: number; readonly end: number } + readonly type: "symbol" + readonly path: string + readonly range: { + readonly start: { readonly line: number; readonly character: number } + readonly end: { readonly line: number; readonly character: number } + } + readonly name: string + readonly kind: number + } + | { + readonly text: { readonly value: string; readonly start: number; readonly end: number } + readonly type: "resource" + readonly clientName: string + readonly uri: string + } + ) + | undefined + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "tool" + readonly callID: string + readonly tool: string + readonly state: + | { readonly status: "pending"; readonly input: { readonly [x: string]: any }; readonly raw: string } + | { + readonly status: "running" + readonly input: { readonly [x: string]: any } + readonly title?: string | undefined + readonly metadata?: { readonly [x: string]: any } | undefined + readonly time: { readonly start: number } + } + | { + readonly status: "completed" + readonly input: { readonly [x: string]: any } + readonly output: string + readonly title: string + readonly metadata: { readonly [x: string]: any } + readonly time: { + readonly start: number + readonly end: number + readonly compacted?: number | undefined + } + readonly attachments?: + | ReadonlyArray<{ + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "file" + readonly mime: string + readonly filename?: string | undefined + readonly url: string + readonly source?: + | ( + | { + readonly text: { + readonly value: string + readonly start: number + readonly end: number + } + readonly type: "file" + readonly path: string + } + | { + readonly text: { + readonly value: string + readonly start: number + readonly end: number + } + readonly type: "symbol" + readonly path: string + readonly range: { + readonly start: { readonly line: number; readonly character: number } + readonly end: { readonly line: number; readonly character: number } + } + readonly name: string + readonly kind: number + } + | { + readonly text: { + readonly value: string + readonly start: number + readonly end: number + } + readonly type: "resource" + readonly clientName: string + readonly uri: string + } + ) + | undefined + }> + | undefined + } + | { + readonly status: "error" + readonly input: { readonly [x: string]: any } + readonly error: string + readonly metadata?: { readonly [x: string]: any } | undefined + readonly time: { readonly start: number; readonly end: number } + } + readonly metadata?: { readonly [x: string]: any } | undefined + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "step-start" + readonly snapshot?: string | undefined + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "step-finish" + readonly reason: string + readonly snapshot?: string | undefined + readonly cost: number + readonly tokens: { + readonly total?: number | undefined + readonly input: number + readonly output: number + readonly reasoning: number + readonly cache: { readonly read: number; readonly write: number } + } + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "snapshot" + readonly snapshot: string + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "patch" + readonly hash: string + readonly files: ReadonlyArray + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "agent" + readonly name: string + readonly source?: { readonly value: string; readonly start: number; readonly end: number } | undefined + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "retry" + readonly attempt: number + readonly error: { + readonly name: "APIError" + readonly data: { + readonly message: string + readonly statusCode?: number | undefined + readonly isRetryable: boolean + readonly responseHeaders?: { readonly [x: string]: string } | undefined + readonly responseBody?: string | undefined + readonly metadata?: { readonly [x: string]: string } | undefined + } + } + readonly time: { readonly created: number } + } + | { + readonly id: string + readonly sessionID: string + readonly messageID: string + readonly type: "compaction" + readonly auto: boolean + readonly overflow?: boolean | undefined + readonly tail_start_id?: string | undefined + } + readonly time: number + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "message.part.removed" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly sessionID: string; readonly messageID: string; readonly partID: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.agent.switched" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly messageID: string + readonly agent: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.model.switched" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly messageID: string + readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.moved" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly location: { readonly directory: string; readonly workspaceID?: string } + readonly subdirectory?: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.renamed" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly timestamp: number; readonly sessionID: string; readonly title: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.forked" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly parentID: string + readonly messageID?: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.prompted" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly messageID: string + readonly prompt: { + readonly text: string + readonly files?: ReadonlyArray<{ + readonly uri: string + readonly mime: string + readonly name?: string + readonly description?: string + readonly source?: { readonly start: number; readonly end: number; readonly text: string } + }> + readonly agents?: ReadonlyArray<{ + readonly name: string + readonly source?: { readonly start: number; readonly end: number; readonly text: string } + }> + } + readonly delivery: "steer" | "queue" + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.prompt.admitted" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly messageID: string + readonly prompt: { + readonly text: string + readonly files?: ReadonlyArray<{ + readonly uri: string + readonly mime: string + readonly name?: string + readonly description?: string + readonly source?: { readonly start: number; readonly end: number; readonly text: string } + }> + readonly agents?: ReadonlyArray<{ + readonly name: string + readonly source?: { readonly start: number; readonly end: number; readonly text: string } + }> + } + readonly delivery: "steer" | "queue" + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.context.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly messageID: string + readonly text: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.synthetic" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly messageID: string + readonly text: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.shell.started" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly messageID: string + readonly callID: string + readonly command: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.shell.ended" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly callID: string + readonly output: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.step.started" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly agent: string + readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } + readonly snapshot?: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.step.ended" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly finish: string + readonly cost: number + readonly tokens: { + readonly input: number + readonly output: number + readonly reasoning: number + readonly cache: { readonly read: number; readonly write: number } + } + readonly snapshot?: string + readonly files?: ReadonlyArray + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.step.failed" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly error: { readonly type: "unknown"; readonly message: string } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.text.started" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly textID: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.text.delta" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly textID: string + readonly delta: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.text.ended" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly textID: string + readonly text: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.reasoning.started" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly reasoningID: string + readonly providerMetadata?: { readonly [x: string]: { readonly [x: string]: unknown } } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.reasoning.delta" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly reasoningID: string + readonly delta: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.reasoning.ended" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly reasoningID: string + readonly text: string + readonly providerMetadata?: { readonly [x: string]: { readonly [x: string]: unknown } } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.tool.input.started" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly callID: string + readonly name: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.tool.input.delta" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly callID: string + readonly delta: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.tool.input.ended" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly callID: string + readonly text: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.tool.called" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly callID: string + readonly tool: string + readonly input: { readonly [x: string]: unknown } + readonly provider: { + readonly executed: boolean + readonly metadata?: { readonly [x: string]: { readonly [x: string]: unknown } } + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.tool.progress" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly callID: string + readonly structured: { readonly [x: string]: unknown } + readonly content: ReadonlyArray< + | { readonly type: "text"; readonly text: string } + | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + > + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.tool.success" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly callID: string + readonly structured: { readonly [x: string]: unknown } + readonly content: ReadonlyArray< + | { readonly type: "text"; readonly text: string } + | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + > + readonly outputPaths?: ReadonlyArray + readonly result?: unknown + readonly provider: { + readonly executed: boolean + readonly metadata?: { readonly [x: string]: { readonly [x: string]: unknown } } + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.tool.failed" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly assistantMessageID: string + readonly callID: string + readonly error: { readonly type: "unknown"; readonly message: string } + readonly result?: unknown + readonly provider: { + readonly executed: boolean + readonly metadata?: { readonly [x: string]: { readonly [x: string]: unknown } } + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.retried" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly attempt: number + readonly error: { + readonly message: string + readonly statusCode?: number + readonly isRetryable: boolean + readonly responseHeaders?: { readonly [x: string]: string } + readonly responseBody?: string + readonly metadata?: { readonly [x: string]: string } + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.compaction.started" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly messageID: string + readonly reason: "auto" | "manual" + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.compaction.delta" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly messageID: string + readonly text: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.compaction.ended" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly messageID: string + readonly reason: "auto" | "manual" + readonly text: string + readonly recent: string + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.revert.staged" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly timestamp: number + readonly sessionID: string + readonly revert: { + readonly messageID: string + readonly partID?: string + readonly snapshot?: string + readonly diff?: string + readonly files?: ReadonlyArray<{ + readonly path: string + readonly status: "added" | "modified" | "deleted" + readonly additions: number + readonly deletions: number + readonly patch: string + }> + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.revert.cleared" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly timestamp: number; readonly sessionID: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "session.next.revert.committed" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly timestamp: number; readonly sessionID: string; readonly messageID: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "file.edited" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly file: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "reference.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: {} + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "permission.v2.asked" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly id: string + readonly sessionID: string + readonly action: string + readonly resources: ReadonlyArray + readonly save?: ReadonlyArray + readonly metadata?: { readonly [x: string]: unknown } + readonly source?: { readonly type: "tool"; readonly messageID: string; readonly callID: string } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "permission.v2.replied" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly sessionID: string + readonly requestID: string + readonly reply: "once" | "always" | "reject" + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "plugin.added" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly id: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "project.directories.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly projectID: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "file.watcher.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly file: string; readonly event: "add" | "change" | "unlink" } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "pty.created" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly info: { + readonly id: string + readonly title: string + readonly command: string + readonly args: ReadonlyArray + readonly cwd: string + readonly status: "running" | "exited" + readonly pid: number + readonly exitCode?: number + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "pty.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly info: { + readonly id: string + readonly title: string + readonly command: string + readonly args: ReadonlyArray + readonly cwd: string + readonly status: "running" | "exited" + readonly pid: number + readonly exitCode?: number + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "pty.exited" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly id: string; readonly exitCode: number } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "pty.deleted" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly id: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "shell.created" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly info: { + readonly id: string + readonly status: "running" | "exited" | "timeout" | "killed" + readonly command: string + readonly cwd: string + readonly shell: string + readonly file: string + readonly pid?: number + readonly exit?: number + readonly metadata: { readonly [x: string]: unknown } + readonly time: { readonly started: number; readonly completed?: number } + } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "shell.exited" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly id: string + readonly exit?: number + readonly status: "running" | "exited" | "timeout" | "killed" + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "shell.deleted" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly id: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "question.v2.asked" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly id: string + readonly sessionID: string + readonly questions: ReadonlyArray<{ + readonly question: string + readonly header: string + readonly options: ReadonlyArray<{ readonly label: string; readonly description: string }> + readonly multiple?: boolean + readonly custom?: boolean + }> + readonly tool?: { readonly messageID: string; readonly callID: string } + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "question.v2.replied" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly sessionID: string + readonly requestID: string + readonly answers: ReadonlyArray> + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "question.v2.rejected" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { readonly sessionID: string; readonly requestID: string } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } + readonly type: "todo.updated" + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } + readonly location?: { readonly directory: string; readonly workspaceID?: string } + readonly data: { + readonly sessionID: string + readonly todos: ReadonlyArray<{ readonly content: string; readonly status: string; readonly priority: string }> + } + } + | { + readonly id: string + readonly metadata?: { readonly [x: string]: unknown } | undefined + readonly durable?: { readonly aggregateID: string; readonly seq: number; readonly version: number } | undefined + readonly location?: { readonly directory: string; readonly workspaceID?: string } | undefined + readonly type: "server.connected" + readonly data: {} + } -export type PtysListInput = { +export type PtyListInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type PtysListOutput = { +export type PtyListOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2706,7 +4022,7 @@ export type PtysListOutput = { }> } -export type PtysCreateInput = { +export type PtyCreateInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] @@ -2747,7 +4063,7 @@ export type PtysCreateInput = { }["env"] } -export type PtysCreateOutput = { +export type PtyCreateOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2765,14 +4081,14 @@ export type PtysCreateOutput = { } } -export type PtysGetInput = { +export type PtyGetInput = { readonly ptyID: { readonly ptyID: string }["ptyID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type PtysGetOutput = { +export type PtyGetOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2790,7 +4106,7 @@ export type PtysGetOutput = { } } -export type PtysUpdateInput = { +export type PtyUpdateInput = { readonly ptyID: { readonly ptyID: string }["ptyID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined @@ -2802,7 +4118,7 @@ export type PtysUpdateInput = { readonly size?: { readonly title?: string; readonly size?: { readonly rows: number; readonly cols: number } }["size"] } -export type PtysUpdateOutput = { +export type PtyUpdateOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2820,22 +4136,22 @@ export type PtysUpdateOutput = { } } -export type PtysRemoveInput = { +export type PtyRemoveInput = { readonly ptyID: { readonly ptyID: string }["ptyID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type PtysRemoveOutput = void +export type PtyRemoveOutput = void -export type ServerShellListInput = { +export type ShellListInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type ServerShellListOutput = { +export type ShellListOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2858,7 +4174,7 @@ export type ServerShellListOutput = { }> } -export type ServerShellCreateInput = { +export type ShellCreateInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] @@ -2888,7 +4204,7 @@ export type ServerShellCreateInput = { }["metadata"] } -export type ServerShellCreateOutput = { +export type ShellCreateOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2911,14 +4227,14 @@ export type ServerShellCreateOutput = { } } -export type ServerShellGetInput = { +export type ShellGetInput = { readonly id: { readonly id: string }["id"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type ServerShellGetOutput = { +export type ShellGetOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2941,7 +4257,7 @@ export type ServerShellGetOutput = { } } -export type ServerShellOutputInput = { +export type ShellOutputInput = { readonly id: { readonly id: string }["id"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined @@ -2960,7 +4276,7 @@ export type ServerShellOutputInput = { }["limit"] } -export type ServerShellOutputOutput = { +export type ShellOutputOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -2974,22 +4290,22 @@ export type ServerShellOutputOutput = { } } -export type ServerShellRemoveInput = { +export type ShellRemoveInput = { readonly id: { readonly id: string }["id"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type ServerShellRemoveOutput = void +export type ShellRemoveOutput = void -export type QuestionsListRequestsInput = { +export type QuestionListRequestsInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type QuestionsListRequestsOutput = { +export type QuestionListRequestsOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -3009,9 +4325,9 @@ export type QuestionsListRequestsOutput = { }> } -export type QuestionsListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } +export type QuestionListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } -export type QuestionsListOutput = { +export type QuestionListOutput = { readonly data: ReadonlyArray<{ readonly id: string readonly sessionID: string @@ -3026,28 +4342,28 @@ export type QuestionsListOutput = { }> }["data"] -export type QuestionsReplyInput = { +export type QuestionReplyInput = { readonly sessionID: { readonly sessionID: string; readonly requestID: string }["sessionID"] readonly requestID: { readonly sessionID: string; readonly requestID: string }["requestID"] readonly answers: { readonly answers: ReadonlyArray> }["answers"] } -export type QuestionsReplyOutput = void +export type QuestionReplyOutput = void -export type QuestionsRejectInput = { +export type QuestionRejectInput = { readonly sessionID: { readonly sessionID: string; readonly requestID: string }["sessionID"] readonly requestID: { readonly sessionID: string; readonly requestID: string }["requestID"] } -export type QuestionsRejectOutput = void +export type QuestionRejectOutput = void -export type ReferencesListInput = { +export type ReferenceListInput = { readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type ReferencesListOutput = { +export type ReferenceListOutput = { readonly location: { readonly directory: string readonly workspaceID?: string @@ -3070,7 +4386,7 @@ export type ReferencesListOutput = { }> } -export type ProjectCopiesCreateInput = { +export type ProjectCopyCreateInput = { readonly projectID: { readonly projectID: string }["projectID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined @@ -3080,9 +4396,9 @@ export type ProjectCopiesCreateInput = { readonly name?: { readonly strategy: string; readonly directory: string; readonly name?: string }["name"] } -export type ProjectCopiesCreateOutput = { readonly directory: string } +export type ProjectCopyCreateOutput = { readonly directory: string } -export type ProjectCopiesRemoveInput = { +export type ProjectCopyRemoveInput = { readonly projectID: { readonly projectID: string }["projectID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined @@ -3091,13 +4407,13 @@ export type ProjectCopiesRemoveInput = { readonly force: { readonly directory: string; readonly force: boolean }["force"] } -export type ProjectCopiesRemoveOutput = void +export type ProjectCopyRemoveOutput = void -export type ProjectCopiesRefreshInput = { +export type ProjectCopyRefreshInput = { readonly projectID: { readonly projectID: string }["projectID"] readonly location?: { readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined }["location"] } -export type ProjectCopiesRefreshOutput = void +export type ProjectCopyRefreshOutput = void diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index 82b671ea39..e9e848b160 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -1,3 +1,3 @@ export * from "./generated/index" -export type { EventsSubscribeOutput as OpenCodeEvent } from "./generated/types" +export type { EventSubscribeOutput as OpenCodeEvent } from "./generated/types" export type OpenCodeClient = ReturnType diff --git a/packages/client/test/effect.test.ts b/packages/client/test/effect.test.ts index 7bf4d26f8f..37105dfa23 100644 --- a/packages/client/test/effect.test.ts +++ b/packages/client/test/effect.test.ts @@ -3,19 +3,19 @@ import { DateTime, Effect, Stream } from "effect" import { HttpClient, HttpClientResponse } from "effect/unstable/http" import { AbsolutePath, Agent, Location, Model, OpenCode, Prompt, Session, SessionMessage } from "../src/effect" -test("sessions.get returns the decoded Effect projection", async () => { +test("session.get returns the decoded Effect projection", async () => { const httpClient = HttpClient.make((request) => Effect.succeed(HttpClientResponse.fromWeb(request, Response.json(session))), ) const result = await Effect.gen(function* () { const client = yield* OpenCode.make({ baseUrl: "http://localhost:3000" }) - return yield* client.sessions.get({ sessionID: Session.ID.make("ses_test") }) + return yield* client.session.get({ sessionID: Session.ID.make("ses_test") }) }).pipe(Effect.provideService(HttpClient.HttpClient, httpClient), Effect.runPromise) expect(DateTime.toEpochMillis(result.time.created)).toBe(1_717_171_717_000) }) -test("events.subscribe exposes and decodes the native Effect event stream", async () => { +test("event.subscribe exposes and decodes the native Effect event stream", async () => { const httpClient = HttpClient.make((request) => Effect.succeed( HttpClientResponse.fromWeb( @@ -30,7 +30,7 @@ test("events.subscribe exposes and decodes the native Effect event stream", asyn ) const events = await Effect.gen(function* () { const client = yield* OpenCode.make({ baseUrl: "http://localhost:3000" }) - return yield* client.events.subscribe().pipe(Stream.runCollect) + return yield* client.event.subscribe().pipe(Stream.runCollect) }).pipe(Effect.provideService(HttpClient.HttpClient, httpClient), Effect.runPromise) expect(Array.from(events).map((event) => event.type)).toEqual(["server.connected", "session.next.model.switched"]) @@ -40,7 +40,7 @@ test("events.subscribe exposes and decodes the native Effect event stream", asyn expect(durable.durable).toEqual({ aggregateID: "ses_test", seq: 1, version: 1 }) }) -test("events.subscribe terminates on Effect protocol decode failures", async () => { +test("event.subscribe terminates on Effect protocol decode failures", async () => { const httpClient = HttpClient.make((request) => Effect.succeed( HttpClientResponse.fromWeb( @@ -53,7 +53,7 @@ test("events.subscribe terminates on Effect protocol decode failures", async () ) const error = await Effect.gen(function* () { const client = yield* OpenCode.make({ baseUrl: "http://localhost:3000" }) - return yield* client.events.subscribe().pipe(Stream.runCollect, Effect.flip) + return yield* client.event.subscribe().pipe(Stream.runCollect, Effect.flip) }).pipe(Effect.provideService(HttpClient.HttpClient, httpClient), Effect.runPromise) expect(error._tag).toBe("ClientError") @@ -112,41 +112,41 @@ test("session methods retain decoded Effect inputs and outputs", async () => { }) const result = await Effect.gen(function* () { const client = yield* OpenCode.make({ baseUrl: "http://localhost:3000" }) - const page = yield* client.sessions.list({ limit: 10 }) - const active = yield* client.sessions.active() - const created = yield* client.sessions.create({ + const page = yield* client.session.list({ limit: 10 }) + const active = yield* client.session.active() + const created = yield* client.session.create({ location: Location.Ref.make({ directory: AbsolutePath.make("/tmp/project") }), }) - yield* client.sessions.switchAgent({ sessionID: Session.ID.make("ses_test"), agent: Agent.ID.make("build") }) - yield* client.sessions.switchModel({ + yield* client.session.switchAgent({ sessionID: Session.ID.make("ses_test"), agent: Agent.ID.make("build") }) + yield* client.session.switchModel({ sessionID: Session.ID.make("ses_test"), model: Model.Ref.make({ id: "claude", providerID: "anthropic" }), }) - const admitted = yield* client.sessions.prompt({ + const admitted = yield* client.session.prompt({ sessionID: Session.ID.make("ses_test"), prompt: Prompt.make({ text: "Hello" }), resume: false, }) - yield* client.sessions.compact({ sessionID: Session.ID.make("ses_test") }) - yield* client.sessions.wait({ sessionID: Session.ID.make("ses_test") }) - const context = yield* client.sessions.context({ sessionID: Session.ID.make("ses_test") }) - const history = yield* client.sessions.history({ + yield* client.session.compact({ sessionID: Session.ID.make("ses_test") }) + yield* client.session.wait({ sessionID: Session.ID.make("ses_test") }) + const context = yield* client.session.context({ sessionID: Session.ID.make("ses_test") }) + const history = yield* client.session.history({ sessionID: Session.ID.make("ses_test"), after: 0, limit: 1, }) const historyNext = history.hasMore - ? yield* client.sessions.history({ + ? yield* client.session.history({ sessionID: Session.ID.make("ses_test"), after: history.data.at(-1)?.durable?.seq, limit: 2, }) : undefined - const events = yield* client.sessions + const events = yield* client.session .events({ sessionID: Session.ID.make("ses_test"), after: 0 }) .pipe(Stream.runCollect) - yield* client.sessions.interrupt({ sessionID: Session.ID.make("ses_test") }) - const message = yield* client.sessions.message({ + yield* client.session.interrupt({ sessionID: Session.ID.make("ses_test") }) + const message = yield* client.session.message({ sessionID: Session.ID.make("ses_test"), messageID: SessionMessage.ID.make("msg_model"), }) @@ -171,7 +171,7 @@ test("session methods retain decoded Effect inputs and outputs", async () => { expect(result.message).toEqual(expect.objectContaining({ id: "msg_model", type: "model-switched" })) }) -test("sessions.history retains the typed SessionNotFoundError", async () => { +test("session.history retains the typed SessionNotFoundError", async () => { const httpClient = HttpClient.make((request) => Effect.succeed( HttpClientResponse.fromWeb( @@ -185,7 +185,7 @@ test("sessions.history retains the typed SessionNotFoundError", async () => { ) const error = await Effect.gen(function* () { const client = yield* OpenCode.make({ baseUrl: "http://localhost:3000" }) - return yield* client.sessions + return yield* client.session .history({ sessionID: Session.ID.make("ses_missing"), }) diff --git a/packages/client/test/promise.test.ts b/packages/client/test/promise.test.ts index d00db17d85..bf7e441c09 100644 --- a/packages/client/test/promise.test.ts +++ b/packages/client/test/promise.test.ts @@ -7,28 +7,28 @@ test("exposes every standard HTTP API group", () => { expect(Object.keys(client)).toEqual([ "health", "location", - "agents", - "sessions", - "messages", - "models", + "agent", + "session", + "message", + "model", "generate", - "providers", - "integrations", - "credentials", + "provider", + "integration", + "credential", "project", - "permissions", - "files", - "commands", - "skills", - "events", - "ptys", - "server.shell", - "questions", - "references", - "projectCopies", + "permission", + "file", + "command", + "skill", + "event", + "pty", + "shell", + "question", + "reference", + "projectCopy", ]) - expect(Object.keys(client.messages)).toEqual(["list"]) - expect(Object.keys(client.integrations)).toEqual([ + expect(Object.keys(client.message)).toEqual(["list"]) + expect(Object.keys(client.integration)).toEqual([ "list", "get", "connectKey", @@ -37,12 +37,13 @@ test("exposes every standard HTTP API group", () => { "attemptComplete", "attemptCancel", ]) - expect(Object.keys(client.files)).toEqual(["read", "list", "find"]) - expect(Object.keys(client.ptys)).toEqual(["list", "create", "get", "update", "remove"]) + expect(Object.keys(client.file)).toEqual(["read", "list", "find"]) + expect(Object.keys(client.pty)).toEqual(["list", "create", "get", "update", "remove"]) + expect(Object.keys(client.shell)).toEqual(["list", "create", "get", "output", "remove"]) expect(Object.keys(client.project)).toEqual(["current", "directories"]) }) -test("files.read returns binary content from the public HTTP contract", async () => { +test("file.read returns binary content from the public HTTP contract", async () => { let request: Request | undefined const client = OpenCode.make({ baseUrl: "http://localhost:3000", @@ -52,7 +53,7 @@ test("files.read returns binary content from the public HTTP contract", async () }, }) - const content = await client.files.read({ + const content = await client.file.read({ path: "src/a b#c.ts", location: { directory: "/tmp/project" }, }) @@ -89,7 +90,42 @@ test("project methods use the public HTTP contract", async () => { ]) }) -test("sessions.get returns the wire projection", async () => { +test("shell list and remove use the public HTTP contract", async () => { + const requests: Array<{ method: string; url: string }> = [] + const shell = { + id: "sh_test", + status: "running", + command: "pwd", + cwd: "/tmp/project", + shell: "/bin/zsh", + file: "/tmp/opencode-shell", + metadata: { sessionID: "ses_test" }, + time: { started: 1_717_171_717_000 }, + } + const client = OpenCode.make({ + baseUrl: "http://localhost:3000", + fetch: async (input, init) => { + const request = input instanceof Request ? input : new Request(input, init) + requests.push({ method: request.method, url: request.url }) + if (request.method === "DELETE") return new Response(null, { status: 204 }) + return Response.json({ + location: { directory: "/tmp/project", project: { id: "proj_test", directory: "/tmp/project" } }, + data: [shell], + }) + }, + }) + + const result = await client.shell.list({ location: { directory: "/tmp/project" } }) + await client.shell.remove({ id: shell.id }) + + expect(result.data).toEqual([shell]) + expect(requests).toEqual([ + { method: "GET", url: "http://localhost:3000/api/shell?location%5Bdirectory%5D=%2Ftmp%2Fproject" }, + { method: "DELETE", url: "http://localhost:3000/api/shell/sh_test" }, + ]) +}) + +test("session.get returns the wire projection", async () => { const client = OpenCode.make({ baseUrl: "http://localhost:3000", fetch: async (input) => { @@ -100,12 +136,12 @@ test("sessions.get returns the wire projection", async () => { }, }) - const result = await client.sessions.get({ sessionID: "ses_test" }) + const result = await client.session.get({ sessionID: "ses_test" }) expect(result.time.created).toBe(1_717_171_717_000) }) -test("events.subscribe exposes the Promise event stream wire projection", async () => { +test("event.subscribe exposes the Promise event stream wire projection", async () => { const client = OpenCode.make({ baseUrl: "http://localhost:3000", fetch: async () => @@ -116,19 +152,19 @@ test("events.subscribe exposes the Promise event stream wire projection", async ), }) const events = [] - for await (const event of client.events.subscribe()) events.push(event) + for await (const event of client.event.subscribe()) events.push(event) expect(events).toEqual([{ id: "evt_connected", type: "server.connected", data: {} }, modelSwitchedEvent]) expect(events[1]?.type === "session.next.model.switched" && events[1].data.timestamp).toBe(1_717_171_717_000) }) -test("events.subscribe terminates on malformed Promise SSE data", async () => { +test("event.subscribe terminates on malformed Promise SSE data", async () => { const client = OpenCode.make({ baseUrl: "http://localhost:3000", fetch: async () => new Response("data: {not-json}\n\n", { headers: { "content-type": "text/event-stream" } }), }) - await expect(client.events.subscribe()[Symbol.asyncIterator]().next()).rejects.toMatchObject({ + await expect(client.event.subscribe()[Symbol.asyncIterator]().next()).rejects.toMatchObject({ name: "ClientError", reason: "MalformedResponse", }) @@ -163,31 +199,31 @@ test("session methods use the public HTTP contract", async () => { }, }) - const page = await client.sessions.list({ limit: 10, order: "desc" }) - const active = await client.sessions.active() - const created = await client.sessions.create({ location: { directory: "/tmp/project" } }) - await client.sessions.switchAgent({ sessionID: "ses_test", agent: "build" }) - await client.sessions.switchModel({ + const page = await client.session.list({ limit: 10, order: "desc" }) + const active = await client.session.active() + const created = await client.session.create({ location: { directory: "/tmp/project" } }) + await client.session.switchAgent({ sessionID: "ses_test", agent: "build" }) + await client.session.switchModel({ sessionID: "ses_test", model: { id: "claude", providerID: "anthropic" }, }) - const admitted = await client.sessions.prompt({ + const admitted = await client.session.prompt({ sessionID: "ses_test", prompt: { text: "Hello" }, resume: false, }) - await client.sessions.compact({ sessionID: "ses_test" }) - await client.sessions.wait({ sessionID: "ses_test" }) - const context = await client.sessions.context({ sessionID: "ses_test" }) - const history = await client.sessions.history({ sessionID: "ses_test", after: 0, limit: 1 }) + await client.session.compact({ sessionID: "ses_test" }) + await client.session.wait({ sessionID: "ses_test" }) + const context = await client.session.context({ sessionID: "ses_test" }) + const history = await client.session.history({ sessionID: "ses_test", after: 0, limit: 1 }) const historyAfter = history.data.at(-1)?.durable?.seq const historyNext = history.hasMore - ? await client.sessions.history({ sessionID: "ses_test", after: historyAfter, limit: 2 }) + ? await client.session.history({ sessionID: "ses_test", after: historyAfter, limit: 2 }) : undefined const events = [] - for await (const event of client.sessions.events({ sessionID: "ses_test", after: 0 })) events.push(event) - await client.sessions.interrupt({ sessionID: "ses_test" }) - const message = await client.sessions.message({ sessionID: "ses_test", messageID: "msg_model" }) + for await (const event of client.session.events({ sessionID: "ses_test", after: 0 })) events.push(event) + await client.session.interrupt({ sessionID: "ses_test" }) + const message = await client.session.message({ sessionID: "ses_test", messageID: "msg_model" }) expect(page.cursor.next).toBe("next") expect(active).toEqual({ ses_test: { type: "running" } }) @@ -230,14 +266,14 @@ test("middleware errors remain declared client errors", async () => { }) try { - await client.sessions.create({}) + await client.session.create({}) throw new Error("Expected request to fail") } catch (error) { expect(isUnauthorizedError(error)).toBe(true) } }) -test("sessions.history decodes SessionNotFoundError", async () => { +test("session.history decodes SessionNotFoundError", async () => { const client = OpenCode.make({ baseUrl: "http://localhost:3000", fetch: async () => @@ -248,7 +284,7 @@ test("sessions.history decodes SessionNotFoundError", async () => { }) try { - await client.sessions.history({ sessionID: "ses_missing" }) + await client.session.history({ sessionID: "ses_missing" }) throw new Error("Expected request to fail") } catch (error) { expect(isSessionNotFoundError(error)).toBe(true) diff --git a/packages/tui/src/component/dialog-integration.tsx b/packages/tui/src/component/dialog-integration.tsx index 20beb09ded..a1ef0b05e7 100644 --- a/packages/tui/src/component/dialog-integration.tsx +++ b/packages/tui/src/component/dialog-integration.tsx @@ -1,5 +1,5 @@ import { TextAttributes } from "@opentui/core" -import type { IntegrationsConnectOauthOutput } from "@opencode-ai/client" +import type { IntegrationConnectOauthOutput } from "@opencode-ai/client" import type { ConnectionInfo, IntegrationInfo, IntegrationOAuthMethod } from "@opencode-ai/sdk/v2" import { createMemo, createSignal, onCleanup, onMount, Show } from "solid-js" import { useClipboard } from "../context/clipboard" @@ -23,7 +23,7 @@ const INTEGRATION_PRIORITY: Record = { } type ConnectMethod = Exclude -type IntegrationAttempt = IntegrationsConnectOauthOutput["data"] +type IntegrationAttempt = IntegrationConnectOauthOutput["data"] export function integrationOptions(list: IntegrationInfo[]) { return list.toSorted( @@ -111,7 +111,7 @@ function manageConnections( title: `Disconnect ${connection.label}`, value: connection.id, onSelect: () => { - void sdk.api.credentials + void sdk.api.credential .remove({ credentialID: connection.id, location: location(data) }) .then(() => disconnected(integration.name, data, dialog, toast)) .catch(toast.error) @@ -159,7 +159,7 @@ function KeyMethod(props: { integration: IntegrationInfo; method: Extract { if (!key) return - void sdk.api.integrations + void sdk.api.integration .connectKey({ integrationID: props.integration.id, location: location(data), @@ -194,7 +194,7 @@ function OAuthStarting(props: { const toast = useToast() onMount(() => { - void sdk.api.integrations + void sdk.api.integration .connectOauth({ integrationID: props.integration.id, location: location(data), @@ -248,7 +248,7 @@ function OAuthAuto(props: { integration: IntegrationInfo; title: string; attempt })) const poll = () => { - void sdk.api.integrations + void sdk.api.integration .attemptStatus({ attemptID: props.attempt.attemptID, location: location(data) }) .then((result) => { const status = result.data @@ -275,7 +275,7 @@ function OAuthAuto(props: { integration: IntegrationInfo; title: string; attempt onCleanup(() => { if (timer) clearTimeout(timer) if (settled) return - void sdk.api.integrations.attemptCancel({ attemptID: props.attempt.attemptID, location: location(data) }) + void sdk.api.integration.attemptCancel({ attemptID: props.attempt.attemptID, location: location(data) }) }) return ( @@ -300,7 +300,7 @@ function OAuthCode(props: { integration: IntegrationInfo; title: string; attempt onCleanup(() => { if (settled) return - void sdk.api.integrations.attemptCancel({ attemptID: props.attempt.attemptID, location: location(data) }) + void sdk.api.integration.attemptCancel({ attemptID: props.attempt.attemptID, location: location(data) }) }) return ( @@ -309,7 +309,7 @@ function OAuthCode(props: { integration: IntegrationInfo; title: string; attempt placeholder="Authorization code" onConfirm={(code) => { if (!code) return - void sdk.api.integrations + void sdk.api.integration .attemptComplete({ attemptID: props.attempt.attemptID, location: location(data), code }) .then(() => { settled = true diff --git a/packages/tui/src/component/dialog-move-session.tsx b/packages/tui/src/component/dialog-move-session.tsx index e4f29686d5..7cf6bc1ad7 100644 --- a/packages/tui/src/component/dialog-move-session.tsx +++ b/packages/tui/src/component/dialog-move-session.tsx @@ -77,7 +77,7 @@ export function DialogMoveSession(props: DialogMoveSessionProps) { async (projectID, info): Promise | undefined> => { try { const location = { directory: projectContext.instance.directory() || paths.cwd } - await sdk.api.projectCopies.refresh({ + await sdk.api.projectCopy.refresh({ projectID, location, }) @@ -227,7 +227,7 @@ export function DialogMoveSession(props: DialogMoveSessionProps) { setToDelete(undefined) setRemoving(selected.directory) setWorking(true) - const error = await sdk.api.projectCopies + const error = await sdk.api.projectCopy .remove({ projectID: props.projectID, location: { directory: projectContext.instance.directory() || paths.cwd }, @@ -252,7 +252,7 @@ export function DialogMoveSession(props: DialogMoveSessionProps) { return } reopen(selected.directory) - const forcedError = await sdk.api.projectCopies + const forcedError = await sdk.api.projectCopy .remove({ projectID: props.projectID, location: { directory: projectContext.instance.directory() || paths.cwd }, diff --git a/packages/tui/src/component/dialog-session-list.tsx b/packages/tui/src/component/dialog-session-list.tsx index fc1915e398..3713e9fc47 100644 --- a/packages/tui/src/component/dialog-session-list.tsx +++ b/packages/tui/src/component/dialog-session-list.tsx @@ -32,7 +32,7 @@ export function DialogSessionList() { const [searchResults] = createResource(search, async (query) => { if (!query) return const location = data.location.default() - const response = await sdk.api.sessions.list({ + const response = await sdk.api.session.list({ search: query, limit: 50, order: "desc", diff --git a/packages/tui/src/component/dialog-session-rename.tsx b/packages/tui/src/component/dialog-session-rename.tsx index 1b9e3372cd..f2b1d07832 100644 --- a/packages/tui/src/component/dialog-session-rename.tsx +++ b/packages/tui/src/component/dialog-session-rename.tsx @@ -17,7 +17,7 @@ export function DialogSessionRename(props: { sessionID: string; currentTitle?: s onConfirm={(value) => { const title = value.trim() if (!title) return - void sdk.api.sessions + void sdk.api.session .rename({ sessionID: props.sessionID, title }) .then(() => dialog.clear()) .catch((error) => diff --git a/packages/tui/src/component/dialog-tag.tsx b/packages/tui/src/component/dialog-tag.tsx index 2b3dc83524..aa32c98ab7 100644 --- a/packages/tui/src/component/dialog-tag.tsx +++ b/packages/tui/src/component/dialog-tag.tsx @@ -17,7 +17,7 @@ export function DialogTag(props: { onSelect?: (value: string) => void }) { const [files] = createResource( () => [store.filter], async () => { - const result = await sdk.api.files + const result = await sdk.api.file .find({ query: store.filter, type: "file", diff --git a/packages/tui/src/component/prompt/autocomplete.tsx b/packages/tui/src/component/prompt/autocomplete.tsx index 38e387e499..6d3e341250 100644 --- a/packages/tui/src/component/prompt/autocomplete.tsx +++ b/packages/tui/src/component/prompt/autocomplete.tsx @@ -320,7 +320,7 @@ export function Autocomplete(props: { if (referenceMatch()) return [] const { lineRange, baseQuery } = extractLineRange(input.query ?? "") - const result = await sdk.api.files + const result = await sdk.api.file .find({ query: baseQuery, limit: 20, diff --git a/packages/tui/src/component/prompt/index.tsx b/packages/tui/src/component/prompt/index.tsx index f868f33679..288fdaf710 100644 --- a/packages/tui/src/component/prompt/index.tsx +++ b/packages/tui/src/component/prompt/index.tsx @@ -425,7 +425,7 @@ export function Prompt(props: PromptProps) { }, 5000) if (store.interrupt >= 2) { - void sdk.api.sessions.interrupt({ + void sdk.api.session.interrupt({ sessionID: props.sessionID, }) setStore("interrupt", 0) @@ -1012,7 +1012,7 @@ export function Prompt(props: PromptProps) { finishMoveProgress = Boolean(move.progress()) const location = data.location.default() - const created = await sdk.api.sessions + const created = await sdk.api.session .create({ location: directory ? { directory, workspaceID } @@ -1114,20 +1114,20 @@ export function Prompt(props: PromptProps) { session = data.session.get(sessionID) } if (session?.agent !== agent.id) { - await sdk.api.sessions.switchAgent({ sessionID, agent: agent.id }) + await sdk.api.session.switchAgent({ sessionID, agent: agent.id }) } if ( session?.model?.providerID !== selectedModel.providerID || session.model.id !== selectedModel.modelID || session.model.variant !== variant ) { - await sdk.api.sessions.switchModel({ + await sdk.api.session.switchModel({ sessionID, model: { providerID: selectedModel.providerID, id: selectedModel.modelID, variant }, }) } if (session?.revert) { - const error = await sdk.api.sessions.commit({ sessionID }).then( + const error = await sdk.api.session.commit({ sessionID }).then( () => undefined, (error) => error, ) @@ -1136,7 +1136,7 @@ export function Prompt(props: PromptProps) { return false } } - const error = await sdk.api.sessions + const error = await sdk.api.session .prompt({ sessionID, prompt: { diff --git a/packages/tui/src/component/prompt/move.tsx b/packages/tui/src/component/prompt/move.tsx index b567fd97f4..9fdd5c9d6a 100644 --- a/packages/tui/src/component/prompt/move.tsx +++ b/packages/tui/src/component/prompt/move.tsx @@ -37,7 +37,7 @@ export function usePromptMove(input: { projectID: () => string | undefined; sess { projectID, context }, { throwOnError: true }, ) - const result = await sdk.api.projectCopies.create({ + const result = await sdk.api.projectCopy.create({ projectID, location: { directory: project.instance.directory() || paths.cwd }, strategy: "git_worktree", diff --git a/packages/tui/src/context/data.tsx b/packages/tui/src/context/data.tsx index c14516b0af..ae56634a22 100644 --- a/packages/tui/src/context/data.tsx +++ b/packages/tui/src/context/data.tsx @@ -554,7 +554,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.session.status[sessionID] ?? "idle" }, async refresh(sessionID: string) { - setStore("session", "info", sessionID, mutable(await sdk.api.sessions.get({ sessionID }))) + setStore("session", "info", sessionID, mutable(await sdk.api.session.get({ sessionID }))) }, message: { ids(sessionID: string) { @@ -572,7 +572,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ setStore("session", "message", sessionID, []) messageIndex.set(sessionID, new Map()) const loaded = mutable( - (await sdk.api.messages.list({ sessionID, limit: 200, order: "desc" })).data, + (await sdk.api.message.list({ sessionID, limit: 200, order: "desc" })).data, ).toReversed() const live = store.session.message[sessionID] ?? [] const liveByID = new Map(live.map((message) => [message.id, message])) @@ -588,7 +588,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.session.permission[sessionID] }, async refresh(sessionID: string) { - setStore("session", "permission", sessionID, mutable(await sdk.api.permissions.list({ sessionID }))) + setStore("session", "permission", sessionID, mutable(await sdk.api.permission.list({ sessionID }))) }, }, question: { @@ -596,7 +596,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.session.question[sessionID] }, async refresh(sessionID: string) { - setStore("session", "question", sessionID, mutable(await sdk.api.questions.list({ sessionID }))) + setStore("session", "question", sessionID, mutable(await sdk.api.question.list({ sessionID }))) }, }, }, @@ -606,7 +606,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.project.permission[projectID] }, async refresh(projectID: string) { - setStore("project", "permission", projectID, mutable(await sdk.api.permissions.listSaved({ projectID }))) + setStore("project", "permission", projectID, mutable(await sdk.api.permission.listSaved({ projectID }))) }, }, }, @@ -618,16 +618,16 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.shell[id] }, async refresh(ref?: LocationRef) { - const result = await sdk.client.v2.shell.list({ location: locationQuery(ref) }, { throwOnError: true }) + const result = await sdk.api.shell.list({ location: locationQuery(ref) }) setStore( "shell", produce((draft) => { - for (const info of result.data.data) draft[info.id] = info + for (const info of mutable(result.data)) draft[info.id] = info }), ) }, async remove(id: string) { - await sdk.client.v2.shell.remove({ id }, { throwOnError: true }) + await sdk.api.shell.remove({ id }) setStore("shell", id, undefined!) }, }, @@ -646,7 +646,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.location[locationKey(location ?? defaultLocation())]?.agent }, async refresh(ref?: LocationRef) { - const result = await sdk.api.agents.list({ location: locationQuery(ref ?? defaultLocation()) }) + const result = await sdk.api.agent.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) setStore("location", key, { ...store.location[key], agent: mutable(result.data) }) }, @@ -656,7 +656,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.location[locationKey(location ?? defaultLocation())]?.command }, async refresh(ref?: LocationRef) { - const result = await sdk.api.commands.list({ location: locationQuery(ref ?? defaultLocation()) }) + const result = await sdk.api.command.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) setStore("location", key, { ...store.location[key], command: mutable(result.data) }) }, @@ -666,7 +666,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.location[locationKey(location ?? defaultLocation())]?.integration }, async refresh(ref?: LocationRef) { - const result = await sdk.api.integrations.list({ location: locationQuery(ref ?? defaultLocation()) }) + const result = await sdk.api.integration.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) setStore("location", key, { ...store.location[key], integration: mutable(result.data) }) }, @@ -676,7 +676,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.location[locationKey(location ?? defaultLocation())]?.model }, async refresh(ref?: LocationRef) { - const result = await sdk.api.models.list({ location: locationQuery(ref ?? defaultLocation()) }) + const result = await sdk.api.model.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) setStore("location", key, { ...store.location[key], model: mutable(result.data) }) }, @@ -686,7 +686,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.location[locationKey(location ?? defaultLocation())]?.provider }, async refresh(ref?: LocationRef) { - const result = await sdk.api.providers.list({ location: locationQuery(ref ?? defaultLocation()) }) + const result = await sdk.api.provider.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) setStore("location", key, { ...store.location[key], provider: mutable(result.data) }) }, @@ -696,7 +696,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.location[locationKey(location ?? defaultLocation())]?.reference }, async refresh(ref?: LocationRef) { - const result = await sdk.api.references.list({ location: locationQuery(ref ?? defaultLocation()) }) + const result = await sdk.api.reference.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) setStore("location", key, { ...store.location[key], reference: mutable(result.data) }) }, @@ -706,7 +706,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.location[locationKey(location ?? defaultLocation())]?.skill }, async refresh(ref?: LocationRef) { - const result = await sdk.api.skills.list({ location: locationQuery(ref ?? defaultLocation()) }) + const result = await sdk.api.skill.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) setStore("location", key, { ...store.location[key], skill: mutable(result.data) }) }, @@ -716,7 +716,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ async function bootstrap() { const settled = await Promise.allSettled([ - sdk.api.sessions + sdk.api.session .list({ limit: 50, order: "desc", @@ -732,7 +732,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ }), ), ), - sdk.api.sessions + sdk.api.session .active() .then((active) => setStore( diff --git a/packages/tui/src/routes/session/dialog-message.tsx b/packages/tui/src/routes/session/dialog-message.tsx index 2fa53ef377..b1f376c740 100644 --- a/packages/tui/src/routes/session/dialog-message.tsx +++ b/packages/tui/src/routes/session/dialog-message.tsx @@ -22,7 +22,7 @@ export function DialogMessage(props: { messageID: string; sessionID: string; set value: "session.revert", description: "undo messages and file changes", onSelect: async (dialog) => { - await sdk.api.sessions + await sdk.api.session .stage({ sessionID: props.sessionID, messageID: props.messageID }) .catch((error) => toast.show({ message: errorMessage(error), variant: "error", duration: 5000 })) dialog.clear() diff --git a/packages/tui/src/routes/session/index.tsx b/packages/tui/src/routes/session/index.tsx index 6109074df0..95ec719d59 100644 --- a/packages/tui/src/routes/session/index.tsx +++ b/packages/tui/src/routes/session/index.tsx @@ -369,7 +369,7 @@ export function Session() { aliases: ["summarize"], }, run: () => { - void sdk.api.sessions.compact({ sessionID: route.sessionID }) + void sdk.api.session.compact({ sessionID: route.sessionID }) dialog.clear() }, }, @@ -403,7 +403,7 @@ export function Session() { dialog.clear() return } - const error = await sdk.api.sessions.stage({ sessionID: route.sessionID, messageID: target }).then( + const error = await sdk.api.session.stage({ sessionID: route.sessionID, messageID: target }).then( () => undefined, (error) => error, ) @@ -420,7 +420,7 @@ export function Session() { slash: { name: "redo" }, run: () => { void (async () => { - const error = await sdk.api.sessions.clear({ sessionID: route.sessionID }).then( + const error = await sdk.api.session.clear({ sessionID: route.sessionID }).then( () => undefined, (error) => error, ) @@ -843,7 +843,12 @@ export function Session() { // snap to bottom when session changes createEffect(on(() => route.sessionID, toBottom)) - createEffect(on(() => route.sessionID, () => setComposer("open", false))) + createEffect( + on( + () => route.sessionID, + () => setComposer("open", false), + ), + ) return ( @@ -913,9 +918,7 @@ export function Session() { onClose={() => setComposer("open", false)} /> - - {null} - + {null} 0}> @@ -1230,7 +1233,7 @@ function RevertMessage(props: { onMouseUp={() => { if (renderer.getSelection()?.getSelectedText()) return void (async () => { - const error = await sdk.api.sessions.clear({ sessionID: route.sessionID }).then( + const error = await sdk.api.session.clear({ sessionID: route.sessionID }).then( () => undefined, (error) => error, ) diff --git a/packages/tui/src/routes/session/permission.tsx b/packages/tui/src/routes/session/permission.tsx index 35230f1160..a137d6272a 100644 --- a/packages/tui/src/routes/session/permission.tsx +++ b/packages/tui/src/routes/session/permission.tsx @@ -186,7 +186,7 @@ export function PermissionPrompt(props: { request: PermissionV2Request; director onSelect={(option) => { setStore("stage", "permission") if (option === "cancel") return - void sdk.api.permissions.reply({ + void sdk.api.permission.reply({ sessionID: props.request.sessionID, reply: "always", requestID: props.request.id, @@ -197,7 +197,7 @@ export function PermissionPrompt(props: { request: PermissionV2Request; director { - void sdk.api.permissions.reply({ + void sdk.api.permission.reply({ sessionID: props.request.sessionID, reply: "reject", requestID: props.request.id, @@ -443,14 +443,14 @@ export function PermissionPrompt(props: { request: PermissionV2Request; director setStore("stage", "reject") return } - void sdk.api.permissions.reply({ + void sdk.api.permission.reply({ sessionID: props.request.sessionID, reply: "reject", requestID: props.request.id, }) return } - void sdk.api.permissions.reply({ + void sdk.api.permission.reply({ sessionID: props.request.sessionID, reply: "once", requestID: props.request.id, diff --git a/packages/tui/src/routes/session/question.tsx b/packages/tui/src/routes/session/question.tsx index 9bbabaaaee..8659884a45 100644 --- a/packages/tui/src/routes/session/question.tsx +++ b/packages/tui/src/routes/session/question.tsx @@ -47,7 +47,7 @@ export function QuestionPrompt(props: { request: QuestionV2Request; directory?: function submit() { const answers = questions().map((_, i) => store.answers[i] ?? []) - void sdk.api.questions.reply({ + void sdk.api.question.reply({ sessionID: props.request.sessionID, requestID: props.request.id, answers, @@ -55,7 +55,7 @@ export function QuestionPrompt(props: { request: QuestionV2Request; directory?: } function reject() { - void sdk.api.questions.reject({ + void sdk.api.question.reject({ sessionID: props.request.sessionID, requestID: props.request.id, }) @@ -71,7 +71,7 @@ export function QuestionPrompt(props: { request: QuestionV2Request; directory?: setStore("custom", inputs) } if (single()) { - void sdk.api.questions.reply({ + void sdk.api.question.reply({ sessionID: props.request.sessionID, requestID: props.request.id, answers: [[answer]],