From 731195db560442c465e0d94e5c2b0aa98936610f Mon Sep 17 00:00:00 2001 From: Aleksandr Slapoguzov Date: Mon, 19 Jan 2026 21:05:26 +0100 Subject: [PATCH] Update codex version to 0.87.0 --- package-lock.json | 8 ++--- package.json | 2 +- src/CodexAcpClient.ts | 8 ++--- src/CodexEventHandler.ts | 16 +++++++++ .../CodexACPAgent/data/auth-with-key.json | 21 ++++++++---- .../data/send-attachments-turn-start.json | 9 +++-- src/app-server/AgentStatus.ts | 8 +++++ src/app-server/ByteRange.ts | 13 +++++++ src/app-server/ClientRequest.ts | 2 +- .../CollabAgentInteractionBeginEvent.ts | 23 +++++++++++++ .../CollabAgentInteractionEndEvent.ts | 28 +++++++++++++++ src/app-server/CollabAgentSpawnBeginEvent.ts | 19 +++++++++++ src/app-server/CollabAgentSpawnEndEvent.ts | 28 +++++++++++++++ src/app-server/CollabCloseBeginEvent.ts | 18 ++++++++++ src/app-server/CollabCloseEndEvent.ts | 24 +++++++++++++ src/app-server/CollabWaitingBeginEvent.ts | 18 ++++++++++ src/app-server/CollabWaitingEndEvent.ts | 19 +++++++++++ src/app-server/EventMsg.ts | 14 ++++++-- src/app-server/InputItem.ts | 7 +++- src/app-server/ServerNotification.ts | 3 +- src/app-server/SkillInterface.ts | 5 +++ src/app-server/SkillMetadata.ts | 7 +++- src/app-server/TextElement.ts | 14 ++++++++ src/app-server/TurnCompleteEvent.ts | 5 +++ src/app-server/TurnStartedEvent.ts | 5 +++ src/app-server/UserInput.ts | 10 +++++- src/app-server/UserMessageEvent.ts | 19 ++++++++++- src/app-server/WebSearchMode.ts | 5 +++ src/app-server/index.ts | 15 ++++++++ src/app-server/v2/ByteRange.ts | 5 +++ src/app-server/v2/CollabAgentState.ts | 6 ++++ src/app-server/v2/CollabAgentStatus.ts | 5 +++ src/app-server/v2/CollabAgentTool.ts | 5 +++ .../v2/CollabAgentToolCallStatus.ts | 5 +++ src/app-server/v2/Config.ts | 3 +- .../v2/ConfigWarningNotification.ts | 13 +++++++ src/app-server/v2/McpServerRefreshResponse.ts | 5 +++ src/app-server/v2/ProfileV2.ts | 3 +- src/app-server/v2/SkillInterface.ts | 5 +++ src/app-server/v2/SkillMetadata.ts | 7 +++- src/app-server/v2/TextElement.ts | 14 ++++++++ src/app-server/v2/ThreadItem.ts | 34 ++++++++++++++++++- src/app-server/v2/UserInput.ts | 7 +++- src/app-server/v2/index.ts | 9 +++++ 44 files changed, 467 insertions(+), 32 deletions(-) create mode 100644 src/app-server/AgentStatus.ts create mode 100644 src/app-server/ByteRange.ts create mode 100644 src/app-server/CollabAgentInteractionBeginEvent.ts create mode 100644 src/app-server/CollabAgentInteractionEndEvent.ts create mode 100644 src/app-server/CollabAgentSpawnBeginEvent.ts create mode 100644 src/app-server/CollabAgentSpawnEndEvent.ts create mode 100644 src/app-server/CollabCloseBeginEvent.ts create mode 100644 src/app-server/CollabCloseEndEvent.ts create mode 100644 src/app-server/CollabWaitingBeginEvent.ts create mode 100644 src/app-server/CollabWaitingEndEvent.ts create mode 100644 src/app-server/SkillInterface.ts create mode 100644 src/app-server/TextElement.ts create mode 100644 src/app-server/TurnCompleteEvent.ts create mode 100644 src/app-server/TurnStartedEvent.ts create mode 100644 src/app-server/WebSearchMode.ts create mode 100644 src/app-server/v2/ByteRange.ts create mode 100644 src/app-server/v2/CollabAgentState.ts create mode 100644 src/app-server/v2/CollabAgentStatus.ts create mode 100644 src/app-server/v2/CollabAgentTool.ts create mode 100644 src/app-server/v2/CollabAgentToolCallStatus.ts create mode 100644 src/app-server/v2/ConfigWarningNotification.ts create mode 100644 src/app-server/v2/McpServerRefreshResponse.ts create mode 100644 src/app-server/v2/SkillInterface.ts create mode 100644 src/app-server/v2/TextElement.ts diff --git a/package-lock.json b/package-lock.json index 00a1d24b..49b09caf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "vscode-jsonrpc": "^8.2.1" }, "devDependencies": { - "@openai/codex": "^0.80.0", + "@openai/codex": "^0.87.0", "@types/node": "^24.10.1", "tsx": "^4.20.6", "typescript": "^5.9.3", @@ -481,9 +481,9 @@ "license": "MIT" }, "node_modules/@openai/codex": { - "version": "0.80.0", - "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.80.0.tgz", - "integrity": "sha512-U1DWDy7eTjx+SF32Wx9oO6cyX1dd9WiRvIW4XCP3FVcv7Xq7CSCvDrFAdzpFxPNPg6CLz9a4qtO42yntpcJpDw==", + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.87.0.tgz", + "integrity": "sha512-VaPB2gcJ6XLqs8Kvv5bkel1cItSDZIHk0xA71IFux+lYTHmyV6ihup6FolSWROmiYfr7dXxPrtb01CQ7sl0AdA==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 7d73f2d1..e03d6bcf 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "type": "module", "devDependencies": { "@types/node": "^24.10.1", - "@openai/codex": "^0.80.0", + "@openai/codex": "^0.87.0", "tsx": "^4.20.6", "typescript": "^5.9.3", "vitest": "^4.0.10" diff --git a/src/CodexAcpClient.ts b/src/CodexAcpClient.ts index 568edbf1..3ba43a2d 100644 --- a/src/CodexAcpClient.ts +++ b/src/CodexAcpClient.ts @@ -268,19 +268,19 @@ function buildPromptItems(prompt: acp.ContentBlock[]): UserInput[] { return prompt.map((block): UserInput | null => { switch (block.type) { case "text": - return {type: "text", text: block.text}; + return {type: "text", text: block.text, text_elements: []}; case "image": { const url = block.uri ?? `data:${block.mimeType};base64,${block.data}`; return {type: "image", url}; } case "resource_link": - return {type: "text", text: formatUriAsLink(block.name, block.uri)}; + return {type: "text", text: formatUriAsLink(block.name, block.uri), text_elements: []}; case "resource": { const resource = block.resource as EmbeddedResourceResource; if ("text" in resource) { const link = formatUriAsLink(null, resource.uri); const context = `\n${resource.text}\n`; - return {type: "text", text: `${link}\n${context}`}; + return {type: "text", text: `${link}\n${context}`, text_elements: []}; } return null; } @@ -326,4 +326,4 @@ function mergeGatewayConfig(config: JsonObject, gatewayConfig: GatewayConfig | n } else { return config; } -} \ No newline at end of file +} diff --git a/src/CodexEventHandler.ts b/src/CodexEventHandler.ts index 945f2a11..2403d0a8 100644 --- a/src/CodexEventHandler.ts +++ b/src/CodexEventHandler.ts @@ -9,6 +9,7 @@ import type { AgentMessageDeltaNotification, CodexErrorInfo, CommandAction, CommandExecutionStatus, + ConfigWarningNotification, ErrorNotification, FileUpdateChange, ItemCompletedNotification, @@ -100,6 +101,8 @@ export class CodexEventHandler { case "account/rateLimits/updated": this.handleRateLimitsUpdated(notification.params); return null; + case "configWarning": + return await this.createConfigWarningEvent(notification.params); case "thread/compacted": case "windows/worldWritableWarning": case "account/login/completed": @@ -124,12 +127,24 @@ export class CodexEventHandler { } } + private async createConfigWarningEvent(event: ConfigWarningNotification): Promise { + const detailsText = event.details ? `\n\n${event.details}` : ""; + return { + sessionUpdate: "agent_message_chunk", + content: { + type: "text", + text: `Config warning: ${event.summary}${detailsText}\n\n` + } + } + } + private async createItemEvent(event: ItemStartedNotification): Promise { switch (event.item.type) { case "fileChange": return await this.createFileChangeEvent(event.item) case "commandExecution": return await this.createCommandEvent(event.item) + case "collabAgentToolCall": case "userMessage": case "agentMessage": case "reasoning": @@ -161,6 +176,7 @@ export class CodexEventHandler { text: summary } } + case "collabAgentToolCall": case "userMessage": case "agentMessage": case "mcpToolCall": diff --git a/src/__tests__/CodexACPAgent/data/auth-with-key.json b/src/__tests__/CodexACPAgent/data/auth-with-key.json index 6e3a9e14..3392d171 100644 --- a/src/__tests__/CodexACPAgent/data/auth-with-key.json +++ b/src/__tests__/CodexACPAgent/data/auth-with-key.json @@ -86,8 +86,8 @@ { "id": "id", "model": "model", - "displayName": "gpt-5.1-codex-max", - "description": "Codex-optimized flagship for deep and fast reasoning.", + "displayName": "gpt-5.2-codex", + "description": "Latest frontier agentic coding model.", "supportedReasoningEfforts": "supportedReasoningEfforts", "defaultReasoningEffort": "medium", "isDefault": true @@ -95,8 +95,8 @@ { "id": "id", "model": "model", - "displayName": "gpt-5.1-codex-mini", - "description": "Optimized for codex. Cheaper, faster, but less capable.", + "displayName": "gpt-5.2", + "description": "Latest frontier model with improvements across knowledge, reasoning and coding", "supportedReasoningEfforts": "supportedReasoningEfforts", "defaultReasoningEffort": "medium", "isDefault": false @@ -104,8 +104,17 @@ { "id": "id", "model": "model", - "displayName": "gpt-5.2", - "description": "Latest frontier model with improvements across knowledge, reasoning and coding", + "displayName": "gpt-5.1-codex-max", + "description": "Codex-optimized flagship for deep and fast reasoning.", + "supportedReasoningEfforts": "supportedReasoningEfforts", + "defaultReasoningEffort": "medium", + "isDefault": false + }, + { + "id": "id", + "model": "model", + "displayName": "gpt-5.1-codex-mini", + "description": "Optimized for codex. Cheaper, faster, but less capable.", "supportedReasoningEfforts": "supportedReasoningEfforts", "defaultReasoningEffort": "medium", "isDefault": false diff --git a/src/__tests__/CodexACPAgent/data/send-attachments-turn-start.json b/src/__tests__/CodexACPAgent/data/send-attachments-turn-start.json index c2513f88..285994d3 100644 --- a/src/__tests__/CodexACPAgent/data/send-attachments-turn-start.json +++ b/src/__tests__/CodexACPAgent/data/send-attachments-turn-start.json @@ -7,7 +7,8 @@ "input": [ { "type": "text", - "text": "Hello" + "text": "Hello", + "text_elements": [] }, { "type": "image", @@ -15,11 +16,13 @@ }, { "type": "text", - "text": "[@report.txt](file:///tmp/report.txt)" + "text": "[@report.txt](file:///tmp/report.txt)", + "text_elements": [] }, { "type": "text", - "text": "[@notes.txt](file:///tmp/notes.txt)\n\nNotes body\n" + "text": "[@notes.txt](file:///tmp/notes.txt)\n\nNotes body\n", + "text_elements": [] } ], "approvalPolicy": "on-request", diff --git a/src/app-server/AgentStatus.ts b/src/app-server/AgentStatus.ts new file mode 100644 index 00000000..ddf6789c --- /dev/null +++ b/src/app-server/AgentStatus.ts @@ -0,0 +1,8 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * Agent lifecycle status, derived from emitted events. + */ +export type AgentStatus = "pending_init" | "running" | { "completed": string | null } | { "errored": string } | "shutdown" | "not_found"; diff --git a/src/app-server/ByteRange.ts b/src/app-server/ByteRange.ts new file mode 100644 index 00000000..ab36a79a --- /dev/null +++ b/src/app-server/ByteRange.ts @@ -0,0 +1,13 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ByteRange = { +/** + * Start byte offset (inclusive) within the UTF-8 text buffer. + */ +start: number, +/** + * End byte offset (exclusive) within the UTF-8 text buffer. + */ +end: number, }; diff --git a/src/app-server/ClientRequest.ts b/src/app-server/ClientRequest.ts index 4766173c..7a11a437 100644 --- a/src/app-server/ClientRequest.ts +++ b/src/app-server/ClientRequest.ts @@ -47,4 +47,4 @@ import type { TurnStartParams } from "./v2/TurnStartParams"; /** * Request from the client to the server. */ -export type ClientRequest = { "method": "initialize", id: RequestId, params: InitializeParams, } | { "method": "thread/start", id: RequestId, params: ThreadStartParams, } | { "method": "thread/resume", id: RequestId, params: ThreadResumeParams, } | { "method": "thread/fork", id: RequestId, params: ThreadForkParams, } | { "method": "thread/archive", id: RequestId, params: ThreadArchiveParams, } | { "method": "thread/rollback", id: RequestId, params: ThreadRollbackParams, } | { "method": "thread/list", id: RequestId, params: ThreadListParams, } | { "method": "thread/loaded/list", id: RequestId, params: ThreadLoadedListParams, } | { "method": "skills/list", id: RequestId, params: SkillsListParams, } | { "method": "turn/start", id: RequestId, params: TurnStartParams, } | { "method": "turn/interrupt", id: RequestId, params: TurnInterruptParams, } | { "method": "review/start", id: RequestId, params: ReviewStartParams, } | { "method": "model/list", id: RequestId, params: ModelListParams, } | { "method": "mcpServer/oauth/login", id: RequestId, params: McpServerOauthLoginParams, } | { "method": "mcpServerStatus/list", id: RequestId, params: ListMcpServerStatusParams, } | { "method": "account/login/start", id: RequestId, params: LoginAccountParams, } | { "method": "account/login/cancel", id: RequestId, params: CancelLoginAccountParams, } | { "method": "account/logout", id: RequestId, params: undefined, } | { "method": "account/rateLimits/read", id: RequestId, params: undefined, } | { "method": "feedback/upload", id: RequestId, params: FeedbackUploadParams, } | { "method": "command/exec", id: RequestId, params: CommandExecParams, } | { "method": "config/read", id: RequestId, params: ConfigReadParams, } | { "method": "config/value/write", id: RequestId, params: ConfigValueWriteParams, } | { "method": "config/batchWrite", id: RequestId, params: ConfigBatchWriteParams, } | { "method": "configRequirements/read", id: RequestId, params: undefined, } | { "method": "account/read", id: RequestId, params: GetAccountParams, } | { "method": "newConversation", id: RequestId, params: NewConversationParams, } | { "method": "getConversationSummary", id: RequestId, params: GetConversationSummaryParams, } | { "method": "listConversations", id: RequestId, params: ListConversationsParams, } | { "method": "resumeConversation", id: RequestId, params: ResumeConversationParams, } | { "method": "forkConversation", id: RequestId, params: ForkConversationParams, } | { "method": "archiveConversation", id: RequestId, params: ArchiveConversationParams, } | { "method": "sendUserMessage", id: RequestId, params: SendUserMessageParams, } | { "method": "sendUserTurn", id: RequestId, params: SendUserTurnParams, } | { "method": "interruptConversation", id: RequestId, params: InterruptConversationParams, } | { "method": "addConversationListener", id: RequestId, params: AddConversationListenerParams, } | { "method": "removeConversationListener", id: RequestId, params: RemoveConversationListenerParams, } | { "method": "gitDiffToRemote", id: RequestId, params: GitDiffToRemoteParams, } | { "method": "loginApiKey", id: RequestId, params: LoginApiKeyParams, } | { "method": "loginChatGpt", id: RequestId, params: undefined, } | { "method": "cancelLoginChatGpt", id: RequestId, params: CancelLoginChatGptParams, } | { "method": "logoutChatGpt", id: RequestId, params: undefined, } | { "method": "getAuthStatus", id: RequestId, params: GetAuthStatusParams, } | { "method": "getUserSavedConfig", id: RequestId, params: undefined, } | { "method": "setDefaultModel", id: RequestId, params: SetDefaultModelParams, } | { "method": "getUserAgent", id: RequestId, params: undefined, } | { "method": "userInfo", id: RequestId, params: undefined, } | { "method": "fuzzyFileSearch", id: RequestId, params: FuzzyFileSearchParams, } | { "method": "execOneOffCommand", id: RequestId, params: ExecOneOffCommandParams, }; +export type ClientRequest = { "method": "initialize", id: RequestId, params: InitializeParams, } | { "method": "thread/start", id: RequestId, params: ThreadStartParams, } | { "method": "thread/resume", id: RequestId, params: ThreadResumeParams, } | { "method": "thread/fork", id: RequestId, params: ThreadForkParams, } | { "method": "thread/archive", id: RequestId, params: ThreadArchiveParams, } | { "method": "thread/rollback", id: RequestId, params: ThreadRollbackParams, } | { "method": "thread/list", id: RequestId, params: ThreadListParams, } | { "method": "thread/loaded/list", id: RequestId, params: ThreadLoadedListParams, } | { "method": "skills/list", id: RequestId, params: SkillsListParams, } | { "method": "turn/start", id: RequestId, params: TurnStartParams, } | { "method": "turn/interrupt", id: RequestId, params: TurnInterruptParams, } | { "method": "review/start", id: RequestId, params: ReviewStartParams, } | { "method": "model/list", id: RequestId, params: ModelListParams, } | { "method": "mcpServer/oauth/login", id: RequestId, params: McpServerOauthLoginParams, } | { "method": "config/mcpServer/reload", id: RequestId, params: undefined, } | { "method": "mcpServerStatus/list", id: RequestId, params: ListMcpServerStatusParams, } | { "method": "account/login/start", id: RequestId, params: LoginAccountParams, } | { "method": "account/login/cancel", id: RequestId, params: CancelLoginAccountParams, } | { "method": "account/logout", id: RequestId, params: undefined, } | { "method": "account/rateLimits/read", id: RequestId, params: undefined, } | { "method": "feedback/upload", id: RequestId, params: FeedbackUploadParams, } | { "method": "command/exec", id: RequestId, params: CommandExecParams, } | { "method": "config/read", id: RequestId, params: ConfigReadParams, } | { "method": "config/value/write", id: RequestId, params: ConfigValueWriteParams, } | { "method": "config/batchWrite", id: RequestId, params: ConfigBatchWriteParams, } | { "method": "configRequirements/read", id: RequestId, params: undefined, } | { "method": "account/read", id: RequestId, params: GetAccountParams, } | { "method": "newConversation", id: RequestId, params: NewConversationParams, } | { "method": "getConversationSummary", id: RequestId, params: GetConversationSummaryParams, } | { "method": "listConversations", id: RequestId, params: ListConversationsParams, } | { "method": "resumeConversation", id: RequestId, params: ResumeConversationParams, } | { "method": "forkConversation", id: RequestId, params: ForkConversationParams, } | { "method": "archiveConversation", id: RequestId, params: ArchiveConversationParams, } | { "method": "sendUserMessage", id: RequestId, params: SendUserMessageParams, } | { "method": "sendUserTurn", id: RequestId, params: SendUserTurnParams, } | { "method": "interruptConversation", id: RequestId, params: InterruptConversationParams, } | { "method": "addConversationListener", id: RequestId, params: AddConversationListenerParams, } | { "method": "removeConversationListener", id: RequestId, params: RemoveConversationListenerParams, } | { "method": "gitDiffToRemote", id: RequestId, params: GitDiffToRemoteParams, } | { "method": "loginApiKey", id: RequestId, params: LoginApiKeyParams, } | { "method": "loginChatGpt", id: RequestId, params: undefined, } | { "method": "cancelLoginChatGpt", id: RequestId, params: CancelLoginChatGptParams, } | { "method": "logoutChatGpt", id: RequestId, params: undefined, } | { "method": "getAuthStatus", id: RequestId, params: GetAuthStatusParams, } | { "method": "getUserSavedConfig", id: RequestId, params: undefined, } | { "method": "setDefaultModel", id: RequestId, params: SetDefaultModelParams, } | { "method": "getUserAgent", id: RequestId, params: undefined, } | { "method": "userInfo", id: RequestId, params: undefined, } | { "method": "fuzzyFileSearch", id: RequestId, params: FuzzyFileSearchParams, } | { "method": "execOneOffCommand", id: RequestId, params: ExecOneOffCommandParams, }; diff --git a/src/app-server/CollabAgentInteractionBeginEvent.ts b/src/app-server/CollabAgentInteractionBeginEvent.ts new file mode 100644 index 00000000..71097419 --- /dev/null +++ b/src/app-server/CollabAgentInteractionBeginEvent.ts @@ -0,0 +1,23 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ThreadId } from "./ThreadId"; + +export type CollabAgentInteractionBeginEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receiver. + */ +receiver_thread_id: ThreadId, +/** + * Prompt sent from the sender to the receiver. Can be empty to prevent CoT + * leaking at the beginning. + */ +prompt: string, }; diff --git a/src/app-server/CollabAgentInteractionEndEvent.ts b/src/app-server/CollabAgentInteractionEndEvent.ts new file mode 100644 index 00000000..0596300b --- /dev/null +++ b/src/app-server/CollabAgentInteractionEndEvent.ts @@ -0,0 +1,28 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AgentStatus } from "./AgentStatus"; +import type { ThreadId } from "./ThreadId"; + +export type CollabAgentInteractionEndEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receiver. + */ +receiver_thread_id: ThreadId, +/** + * Prompt sent from the sender to the receiver. Can be empty to prevent CoT + * leaking at the beginning. + */ +prompt: string, +/** + * Last known status of the receiver agent reported to the sender agent. + */ +status: AgentStatus, }; diff --git a/src/app-server/CollabAgentSpawnBeginEvent.ts b/src/app-server/CollabAgentSpawnBeginEvent.ts new file mode 100644 index 00000000..a86598e2 --- /dev/null +++ b/src/app-server/CollabAgentSpawnBeginEvent.ts @@ -0,0 +1,19 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ThreadId } from "./ThreadId"; + +export type CollabAgentSpawnBeginEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the + * beginning. + */ +prompt: string, }; diff --git a/src/app-server/CollabAgentSpawnEndEvent.ts b/src/app-server/CollabAgentSpawnEndEvent.ts new file mode 100644 index 00000000..e880b5a4 --- /dev/null +++ b/src/app-server/CollabAgentSpawnEndEvent.ts @@ -0,0 +1,28 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AgentStatus } from "./AgentStatus"; +import type { ThreadId } from "./ThreadId"; + +export type CollabAgentSpawnEndEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the newly spawned agent, if it was created. + */ +new_thread_id: ThreadId | null, +/** + * Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the + * beginning. + */ +prompt: string, +/** + * Last known status of the new agent reported to the sender agent. + */ +status: AgentStatus, }; diff --git a/src/app-server/CollabCloseBeginEvent.ts b/src/app-server/CollabCloseBeginEvent.ts new file mode 100644 index 00000000..355d5952 --- /dev/null +++ b/src/app-server/CollabCloseBeginEvent.ts @@ -0,0 +1,18 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ThreadId } from "./ThreadId"; + +export type CollabCloseBeginEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receiver. + */ +receiver_thread_id: ThreadId, }; diff --git a/src/app-server/CollabCloseEndEvent.ts b/src/app-server/CollabCloseEndEvent.ts new file mode 100644 index 00000000..70343cbe --- /dev/null +++ b/src/app-server/CollabCloseEndEvent.ts @@ -0,0 +1,24 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AgentStatus } from "./AgentStatus"; +import type { ThreadId } from "./ThreadId"; + +export type CollabCloseEndEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receiver. + */ +receiver_thread_id: ThreadId, +/** + * Last known status of the receiver agent reported to the sender agent before + * the close. + */ +status: AgentStatus, }; diff --git a/src/app-server/CollabWaitingBeginEvent.ts b/src/app-server/CollabWaitingBeginEvent.ts new file mode 100644 index 00000000..0cbe04f6 --- /dev/null +++ b/src/app-server/CollabWaitingBeginEvent.ts @@ -0,0 +1,18 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ThreadId } from "./ThreadId"; + +export type CollabWaitingBeginEvent = { +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receivers. + */ +receiver_thread_ids: Array, +/** + * ID of the waiting call. + */ +call_id: string, }; diff --git a/src/app-server/CollabWaitingEndEvent.ts b/src/app-server/CollabWaitingEndEvent.ts new file mode 100644 index 00000000..57f914c1 --- /dev/null +++ b/src/app-server/CollabWaitingEndEvent.ts @@ -0,0 +1,19 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AgentStatus } from "./AgentStatus"; +import type { ThreadId } from "./ThreadId"; + +export type CollabWaitingEndEvent = { +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * ID of the waiting call. + */ +call_id: string, +/** + * Last known status of the receiver agents reported to the sender agent. + */ +statuses: { [key in ThreadId]?: AgentStatus }, }; diff --git a/src/app-server/EventMsg.ts b/src/app-server/EventMsg.ts index 663280c5..9a7c3790 100644 --- a/src/app-server/EventMsg.ts +++ b/src/app-server/EventMsg.ts @@ -11,6 +11,14 @@ import type { AgentReasoningRawContentEvent } from "./AgentReasoningRawContentEv import type { AgentReasoningSectionBreakEvent } from "./AgentReasoningSectionBreakEvent"; import type { ApplyPatchApprovalRequestEvent } from "./ApplyPatchApprovalRequestEvent"; import type { BackgroundEventEvent } from "./BackgroundEventEvent"; +import type { CollabAgentInteractionBeginEvent } from "./CollabAgentInteractionBeginEvent"; +import type { CollabAgentInteractionEndEvent } from "./CollabAgentInteractionEndEvent"; +import type { CollabAgentSpawnBeginEvent } from "./CollabAgentSpawnBeginEvent"; +import type { CollabAgentSpawnEndEvent } from "./CollabAgentSpawnEndEvent"; +import type { CollabCloseBeginEvent } from "./CollabCloseBeginEvent"; +import type { CollabCloseEndEvent } from "./CollabCloseEndEvent"; +import type { CollabWaitingBeginEvent } from "./CollabWaitingBeginEvent"; +import type { CollabWaitingEndEvent } from "./CollabWaitingEndEvent"; import type { ContextCompactedEvent } from "./ContextCompactedEvent"; import type { DeprecationNoticeEvent } from "./DeprecationNoticeEvent"; import type { ElicitationRequestEvent } from "./ElicitationRequestEvent"; @@ -38,13 +46,13 @@ import type { ReasoningRawContentDeltaEvent } from "./ReasoningRawContentDeltaEv import type { ReviewRequest } from "./ReviewRequest"; import type { SessionConfiguredEvent } from "./SessionConfiguredEvent"; import type { StreamErrorEvent } from "./StreamErrorEvent"; -import type { TaskCompleteEvent } from "./TaskCompleteEvent"; -import type { TaskStartedEvent } from "./TaskStartedEvent"; import type { TerminalInteractionEvent } from "./TerminalInteractionEvent"; import type { ThreadRolledBackEvent } from "./ThreadRolledBackEvent"; import type { TokenCountEvent } from "./TokenCountEvent"; import type { TurnAbortedEvent } from "./TurnAbortedEvent"; +import type { TurnCompleteEvent } from "./TurnCompleteEvent"; import type { TurnDiffEvent } from "./TurnDiffEvent"; +import type { TurnStartedEvent } from "./TurnStartedEvent"; import type { UndoCompletedEvent } from "./UndoCompletedEvent"; import type { UndoStartedEvent } from "./UndoStartedEvent"; import type { UpdatePlanArgs } from "./UpdatePlanArgs"; @@ -58,4 +66,4 @@ import type { WebSearchEndEvent } from "./WebSearchEndEvent"; * Response event from the agent * NOTE: Make sure none of these values have optional types, as it will mess up the extension code-gen. */ -export type EventMsg = { "type": "error" } & ErrorEvent | { "type": "warning" } & WarningEvent | { "type": "context_compacted" } & ContextCompactedEvent | { "type": "thread_rolled_back" } & ThreadRolledBackEvent | { "type": "task_started" } & TaskStartedEvent | { "type": "task_complete" } & TaskCompleteEvent | { "type": "token_count" } & TokenCountEvent | { "type": "agent_message" } & AgentMessageEvent | { "type": "user_message" } & UserMessageEvent | { "type": "agent_message_delta" } & AgentMessageDeltaEvent | { "type": "agent_reasoning" } & AgentReasoningEvent | { "type": "agent_reasoning_delta" } & AgentReasoningDeltaEvent | { "type": "agent_reasoning_raw_content" } & AgentReasoningRawContentEvent | { "type": "agent_reasoning_raw_content_delta" } & AgentReasoningRawContentDeltaEvent | { "type": "agent_reasoning_section_break" } & AgentReasoningSectionBreakEvent | { "type": "session_configured" } & SessionConfiguredEvent | { "type": "mcp_startup_update" } & McpStartupUpdateEvent | { "type": "mcp_startup_complete" } & McpStartupCompleteEvent | { "type": "mcp_tool_call_begin" } & McpToolCallBeginEvent | { "type": "mcp_tool_call_end" } & McpToolCallEndEvent | { "type": "web_search_begin" } & WebSearchBeginEvent | { "type": "web_search_end" } & WebSearchEndEvent | { "type": "exec_command_begin" } & ExecCommandBeginEvent | { "type": "exec_command_output_delta" } & ExecCommandOutputDeltaEvent | { "type": "terminal_interaction" } & TerminalInteractionEvent | { "type": "exec_command_end" } & ExecCommandEndEvent | { "type": "view_image_tool_call" } & ViewImageToolCallEvent | { "type": "exec_approval_request" } & ExecApprovalRequestEvent | { "type": "elicitation_request" } & ElicitationRequestEvent | { "type": "apply_patch_approval_request" } & ApplyPatchApprovalRequestEvent | { "type": "deprecation_notice" } & DeprecationNoticeEvent | { "type": "background_event" } & BackgroundEventEvent | { "type": "undo_started" } & UndoStartedEvent | { "type": "undo_completed" } & UndoCompletedEvent | { "type": "stream_error" } & StreamErrorEvent | { "type": "patch_apply_begin" } & PatchApplyBeginEvent | { "type": "patch_apply_end" } & PatchApplyEndEvent | { "type": "turn_diff" } & TurnDiffEvent | { "type": "get_history_entry_response" } & GetHistoryEntryResponseEvent | { "type": "mcp_list_tools_response" } & McpListToolsResponseEvent | { "type": "list_custom_prompts_response" } & ListCustomPromptsResponseEvent | { "type": "list_skills_response" } & ListSkillsResponseEvent | { "type": "skills_update_available" } | { "type": "plan_update" } & UpdatePlanArgs | { "type": "turn_aborted" } & TurnAbortedEvent | { "type": "shutdown_complete" } | { "type": "entered_review_mode" } & ReviewRequest | { "type": "exited_review_mode" } & ExitedReviewModeEvent | { "type": "raw_response_item" } & RawResponseItemEvent | { "type": "item_started" } & ItemStartedEvent | { "type": "item_completed" } & ItemCompletedEvent | { "type": "agent_message_content_delta" } & AgentMessageContentDeltaEvent | { "type": "reasoning_content_delta" } & ReasoningContentDeltaEvent | { "type": "reasoning_raw_content_delta" } & ReasoningRawContentDeltaEvent; +export type EventMsg = { "type": "error" } & ErrorEvent | { "type": "warning" } & WarningEvent | { "type": "context_compacted" } & ContextCompactedEvent | { "type": "thread_rolled_back" } & ThreadRolledBackEvent | { "type": "task_started" } & TurnStartedEvent | { "type": "task_complete" } & TurnCompleteEvent | { "type": "token_count" } & TokenCountEvent | { "type": "agent_message" } & AgentMessageEvent | { "type": "user_message" } & UserMessageEvent | { "type": "agent_message_delta" } & AgentMessageDeltaEvent | { "type": "agent_reasoning" } & AgentReasoningEvent | { "type": "agent_reasoning_delta" } & AgentReasoningDeltaEvent | { "type": "agent_reasoning_raw_content" } & AgentReasoningRawContentEvent | { "type": "agent_reasoning_raw_content_delta" } & AgentReasoningRawContentDeltaEvent | { "type": "agent_reasoning_section_break" } & AgentReasoningSectionBreakEvent | { "type": "session_configured" } & SessionConfiguredEvent | { "type": "mcp_startup_update" } & McpStartupUpdateEvent | { "type": "mcp_startup_complete" } & McpStartupCompleteEvent | { "type": "mcp_tool_call_begin" } & McpToolCallBeginEvent | { "type": "mcp_tool_call_end" } & McpToolCallEndEvent | { "type": "web_search_begin" } & WebSearchBeginEvent | { "type": "web_search_end" } & WebSearchEndEvent | { "type": "exec_command_begin" } & ExecCommandBeginEvent | { "type": "exec_command_output_delta" } & ExecCommandOutputDeltaEvent | { "type": "terminal_interaction" } & TerminalInteractionEvent | { "type": "exec_command_end" } & ExecCommandEndEvent | { "type": "view_image_tool_call" } & ViewImageToolCallEvent | { "type": "exec_approval_request" } & ExecApprovalRequestEvent | { "type": "elicitation_request" } & ElicitationRequestEvent | { "type": "apply_patch_approval_request" } & ApplyPatchApprovalRequestEvent | { "type": "deprecation_notice" } & DeprecationNoticeEvent | { "type": "background_event" } & BackgroundEventEvent | { "type": "undo_started" } & UndoStartedEvent | { "type": "undo_completed" } & UndoCompletedEvent | { "type": "stream_error" } & StreamErrorEvent | { "type": "patch_apply_begin" } & PatchApplyBeginEvent | { "type": "patch_apply_end" } & PatchApplyEndEvent | { "type": "turn_diff" } & TurnDiffEvent | { "type": "get_history_entry_response" } & GetHistoryEntryResponseEvent | { "type": "mcp_list_tools_response" } & McpListToolsResponseEvent | { "type": "list_custom_prompts_response" } & ListCustomPromptsResponseEvent | { "type": "list_skills_response" } & ListSkillsResponseEvent | { "type": "skills_update_available" } | { "type": "plan_update" } & UpdatePlanArgs | { "type": "turn_aborted" } & TurnAbortedEvent | { "type": "shutdown_complete" } | { "type": "entered_review_mode" } & ReviewRequest | { "type": "exited_review_mode" } & ExitedReviewModeEvent | { "type": "raw_response_item" } & RawResponseItemEvent | { "type": "item_started" } & ItemStartedEvent | { "type": "item_completed" } & ItemCompletedEvent | { "type": "agent_message_content_delta" } & AgentMessageContentDeltaEvent | { "type": "reasoning_content_delta" } & ReasoningContentDeltaEvent | { "type": "reasoning_raw_content_delta" } & ReasoningRawContentDeltaEvent | { "type": "collab_agent_spawn_begin" } & CollabAgentSpawnBeginEvent | { "type": "collab_agent_spawn_end" } & CollabAgentSpawnEndEvent | { "type": "collab_agent_interaction_begin" } & CollabAgentInteractionBeginEvent | { "type": "collab_agent_interaction_end" } & CollabAgentInteractionEndEvent | { "type": "collab_waiting_begin" } & CollabWaitingBeginEvent | { "type": "collab_waiting_end" } & CollabWaitingEndEvent | { "type": "collab_close_begin" } & CollabCloseBeginEvent | { "type": "collab_close_end" } & CollabCloseEndEvent; diff --git a/src/app-server/InputItem.ts b/src/app-server/InputItem.ts index b1352d6c..3ac72d31 100644 --- a/src/app-server/InputItem.ts +++ b/src/app-server/InputItem.ts @@ -1,5 +1,10 @@ // GENERATED CODE! DO NOT MODIFY BY HAND! // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { TextElement } from "./TextElement"; -export type InputItem = { "type": "text", "data": { text: string, } } | { "type": "image", "data": { image_url: string, } } | { "type": "localImage", "data": { path: string, } }; +export type InputItem = { "type": "text", "data": { text: string, +/** + * UI-defined spans within `text` used to render or persist special elements. + */ +text_elements: Array, } } | { "type": "image", "data": { image_url: string, } } | { "type": "localImage", "data": { path: string, } }; diff --git a/src/app-server/ServerNotification.ts b/src/app-server/ServerNotification.ts index cb596378..545ef966 100644 --- a/src/app-server/ServerNotification.ts +++ b/src/app-server/ServerNotification.ts @@ -9,6 +9,7 @@ import type { AccountRateLimitsUpdatedNotification } from "./v2/AccountRateLimit import type { AccountUpdatedNotification } from "./v2/AccountUpdatedNotification"; import type { AgentMessageDeltaNotification } from "./v2/AgentMessageDeltaNotification"; import type { CommandExecutionOutputDeltaNotification } from "./v2/CommandExecutionOutputDeltaNotification"; +import type { ConfigWarningNotification } from "./v2/ConfigWarningNotification"; import type { ContextCompactedNotification } from "./v2/ContextCompactedNotification"; import type { DeprecationNoticeNotification } from "./v2/DeprecationNoticeNotification"; import type { ErrorNotification } from "./v2/ErrorNotification"; @@ -33,4 +34,4 @@ import type { WindowsWorldWritableWarningNotification } from "./v2/WindowsWorldW /** * Notification sent from the server to the client. */ -export type ServerNotification = { "method": "error", "params": ErrorNotification } | { "method": "thread/started", "params": ThreadStartedNotification } | { "method": "thread/tokenUsage/updated", "params": ThreadTokenUsageUpdatedNotification } | { "method": "turn/started", "params": TurnStartedNotification } | { "method": "turn/completed", "params": TurnCompletedNotification } | { "method": "turn/diff/updated", "params": TurnDiffUpdatedNotification } | { "method": "turn/plan/updated", "params": TurnPlanUpdatedNotification } | { "method": "item/started", "params": ItemStartedNotification } | { "method": "item/completed", "params": ItemCompletedNotification } | { "method": "rawResponseItem/completed", "params": RawResponseItemCompletedNotification } | { "method": "item/agentMessage/delta", "params": AgentMessageDeltaNotification } | { "method": "item/commandExecution/outputDelta", "params": CommandExecutionOutputDeltaNotification } | { "method": "item/commandExecution/terminalInteraction", "params": TerminalInteractionNotification } | { "method": "item/fileChange/outputDelta", "params": FileChangeOutputDeltaNotification } | { "method": "item/mcpToolCall/progress", "params": McpToolCallProgressNotification } | { "method": "mcpServer/oauthLogin/completed", "params": McpServerOauthLoginCompletedNotification } | { "method": "account/updated", "params": AccountUpdatedNotification } | { "method": "account/rateLimits/updated", "params": AccountRateLimitsUpdatedNotification } | { "method": "item/reasoning/summaryTextDelta", "params": ReasoningSummaryTextDeltaNotification } | { "method": "item/reasoning/summaryPartAdded", "params": ReasoningSummaryPartAddedNotification } | { "method": "item/reasoning/textDelta", "params": ReasoningTextDeltaNotification } | { "method": "thread/compacted", "params": ContextCompactedNotification } | { "method": "deprecationNotice", "params": DeprecationNoticeNotification } | { "method": "windows/worldWritableWarning", "params": WindowsWorldWritableWarningNotification } | { "method": "account/login/completed", "params": AccountLoginCompletedNotification } | { "method": "authStatusChange", "params": AuthStatusChangeNotification } | { "method": "loginChatGptComplete", "params": LoginChatGptCompleteNotification } | { "method": "sessionConfigured", "params": SessionConfiguredNotification }; +export type ServerNotification = { "method": "error", "params": ErrorNotification } | { "method": "thread/started", "params": ThreadStartedNotification } | { "method": "thread/tokenUsage/updated", "params": ThreadTokenUsageUpdatedNotification } | { "method": "turn/started", "params": TurnStartedNotification } | { "method": "turn/completed", "params": TurnCompletedNotification } | { "method": "turn/diff/updated", "params": TurnDiffUpdatedNotification } | { "method": "turn/plan/updated", "params": TurnPlanUpdatedNotification } | { "method": "item/started", "params": ItemStartedNotification } | { "method": "item/completed", "params": ItemCompletedNotification } | { "method": "rawResponseItem/completed", "params": RawResponseItemCompletedNotification } | { "method": "item/agentMessage/delta", "params": AgentMessageDeltaNotification } | { "method": "item/commandExecution/outputDelta", "params": CommandExecutionOutputDeltaNotification } | { "method": "item/commandExecution/terminalInteraction", "params": TerminalInteractionNotification } | { "method": "item/fileChange/outputDelta", "params": FileChangeOutputDeltaNotification } | { "method": "item/mcpToolCall/progress", "params": McpToolCallProgressNotification } | { "method": "mcpServer/oauthLogin/completed", "params": McpServerOauthLoginCompletedNotification } | { "method": "account/updated", "params": AccountUpdatedNotification } | { "method": "account/rateLimits/updated", "params": AccountRateLimitsUpdatedNotification } | { "method": "item/reasoning/summaryTextDelta", "params": ReasoningSummaryTextDeltaNotification } | { "method": "item/reasoning/summaryPartAdded", "params": ReasoningSummaryPartAddedNotification } | { "method": "item/reasoning/textDelta", "params": ReasoningTextDeltaNotification } | { "method": "thread/compacted", "params": ContextCompactedNotification } | { "method": "deprecationNotice", "params": DeprecationNoticeNotification } | { "method": "configWarning", "params": ConfigWarningNotification } | { "method": "windows/worldWritableWarning", "params": WindowsWorldWritableWarningNotification } | { "method": "account/login/completed", "params": AccountLoginCompletedNotification } | { "method": "authStatusChange", "params": AuthStatusChangeNotification } | { "method": "loginChatGptComplete", "params": LoginChatGptCompleteNotification } | { "method": "sessionConfigured", "params": SessionConfiguredNotification }; diff --git a/src/app-server/SkillInterface.ts b/src/app-server/SkillInterface.ts new file mode 100644 index 00000000..30250b93 --- /dev/null +++ b/src/app-server/SkillInterface.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type SkillInterface = { display_name?: string, short_description?: string, icon_small?: string, icon_large?: string, brand_color?: string, default_prompt?: string, }; diff --git a/src/app-server/SkillMetadata.ts b/src/app-server/SkillMetadata.ts index 1a30825e..e112fa6c 100644 --- a/src/app-server/SkillMetadata.ts +++ b/src/app-server/SkillMetadata.ts @@ -1,6 +1,11 @@ // GENERATED CODE! DO NOT MODIFY BY HAND! // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SkillInterface } from "./SkillInterface"; import type { SkillScope } from "./SkillScope"; -export type SkillMetadata = { name: string, description: string, short_description?: string, path: string, scope: SkillScope, }; +export type SkillMetadata = { name: string, description: string, +/** + * Legacy short_description from SKILL.md. Prefer SKILL.toml interface.short_description. + */ +short_description?: string, interface?: SkillInterface, path: string, scope: SkillScope, }; diff --git a/src/app-server/TextElement.ts b/src/app-server/TextElement.ts new file mode 100644 index 00000000..8841d004 --- /dev/null +++ b/src/app-server/TextElement.ts @@ -0,0 +1,14 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ByteRange } from "./ByteRange"; + +export type TextElement = { +/** + * Byte range in the parent `text` buffer that this element occupies. + */ +byteRange: ByteRange, +/** + * Optional human-readable placeholder for the element, displayed in the UI. + */ +placeholder: string | null, }; diff --git a/src/app-server/TurnCompleteEvent.ts b/src/app-server/TurnCompleteEvent.ts new file mode 100644 index 00000000..ab271ba9 --- /dev/null +++ b/src/app-server/TurnCompleteEvent.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type TurnCompleteEvent = { last_agent_message: string | null, }; diff --git a/src/app-server/TurnStartedEvent.ts b/src/app-server/TurnStartedEvent.ts new file mode 100644 index 00000000..ae8ab73a --- /dev/null +++ b/src/app-server/TurnStartedEvent.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type TurnStartedEvent = { model_context_window: bigint | null, }; diff --git a/src/app-server/UserInput.ts b/src/app-server/UserInput.ts index e643d5ec..3e4d7d83 100644 --- a/src/app-server/UserInput.ts +++ b/src/app-server/UserInput.ts @@ -1,8 +1,16 @@ // GENERATED CODE! DO NOT MODIFY BY HAND! // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { TextElement } from "./TextElement"; /** * User input */ -export type UserInput = { "type": "text", text: string, } | { "type": "image", image_url: string, } | { "type": "local_image", path: string, } | { "type": "skill", name: string, path: string, }; +export type UserInput = { "type": "text", text: string, +/** + * UI-defined spans within `text` that should be treated as special elements. + * These are byte ranges into the UTF-8 `text` buffer and are used to render + * or persist rich input markers (e.g., image placeholders) across history + * and resume without mutating the literal text. + */ +text_elements: Array, } | { "type": "image", image_url: string, } | { "type": "local_image", path: string, } | { "type": "skill", name: string, path: string, }; diff --git a/src/app-server/UserMessageEvent.ts b/src/app-server/UserMessageEvent.ts index 137850dd..2fde364d 100644 --- a/src/app-server/UserMessageEvent.ts +++ b/src/app-server/UserMessageEvent.ts @@ -1,5 +1,22 @@ // GENERATED CODE! DO NOT MODIFY BY HAND! // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { TextElement } from "./TextElement"; -export type UserMessageEvent = { message: string, images: Array | null, }; +export type UserMessageEvent = { message: string, +/** + * Image URLs sourced from `UserInput::Image`. These are safe + * to replay in legacy UI history events and correspond to images sent to + * the model. + */ +images: Array | null, +/** + * Local file paths sourced from `UserInput::LocalImage`. These are kept so + * the UI can reattach images when editing history, and should not be sent + * to the model or treated as API-ready URLs. + */ +local_images: Array, +/** + * UI-defined spans within `message` used to render or persist special elements. + */ +text_elements: Array, }; diff --git a/src/app-server/WebSearchMode.ts b/src/app-server/WebSearchMode.ts new file mode 100644 index 00000000..695c13e3 --- /dev/null +++ b/src/app-server/WebSearchMode.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type WebSearchMode = "disabled" | "cached" | "live"; diff --git a/src/app-server/index.ts b/src/app-server/index.ts index 215820f9..509b9485 100644 --- a/src/app-server/index.ts +++ b/src/app-server/index.ts @@ -13,6 +13,7 @@ export type { AgentReasoningEvent } from "./AgentReasoningEvent"; export type { AgentReasoningRawContentDeltaEvent } from "./AgentReasoningRawContentDeltaEvent"; export type { AgentReasoningRawContentEvent } from "./AgentReasoningRawContentEvent"; export type { AgentReasoningSectionBreakEvent } from "./AgentReasoningSectionBreakEvent"; +export type { AgentStatus } from "./AgentStatus"; export type { Annotations } from "./Annotations"; export type { ApplyPatchApprovalParams } from "./ApplyPatchApprovalParams"; export type { ApplyPatchApprovalRequestEvent } from "./ApplyPatchApprovalRequestEvent"; @@ -25,6 +26,7 @@ export type { AuthMode } from "./AuthMode"; export type { AuthStatusChangeNotification } from "./AuthStatusChangeNotification"; export type { BackgroundEventEvent } from "./BackgroundEventEvent"; export type { BlobResourceContents } from "./BlobResourceContents"; +export type { ByteRange } from "./ByteRange"; export type { CallToolResult } from "./CallToolResult"; export type { CancelLoginChatGptParams } from "./CancelLoginChatGptParams"; export type { CancelLoginChatGptResponse } from "./CancelLoginChatGptResponse"; @@ -32,6 +34,14 @@ export type { ClientInfo } from "./ClientInfo"; export type { ClientNotification } from "./ClientNotification"; export type { ClientRequest } from "./ClientRequest"; export type { CodexErrorInfo } from "./CodexErrorInfo"; +export type { CollabAgentInteractionBeginEvent } from "./CollabAgentInteractionBeginEvent"; +export type { CollabAgentInteractionEndEvent } from "./CollabAgentInteractionEndEvent"; +export type { CollabAgentSpawnBeginEvent } from "./CollabAgentSpawnBeginEvent"; +export type { CollabAgentSpawnEndEvent } from "./CollabAgentSpawnEndEvent"; +export type { CollabCloseBeginEvent } from "./CollabCloseBeginEvent"; +export type { CollabCloseEndEvent } from "./CollabCloseEndEvent"; +export type { CollabWaitingBeginEvent } from "./CollabWaitingBeginEvent"; +export type { CollabWaitingEndEvent } from "./CollabWaitingEndEvent"; export type { ContentBlock } from "./ContentBlock"; export type { ContentItem } from "./ContentItem"; export type { ContextCompactedEvent } from "./ContextCompactedEvent"; @@ -161,6 +171,7 @@ export type { SessionSource } from "./SessionSource"; export type { SetDefaultModelParams } from "./SetDefaultModelParams"; export type { SetDefaultModelResponse } from "./SetDefaultModelResponse"; export type { SkillErrorInfo } from "./SkillErrorInfo"; +export type { SkillInterface } from "./SkillInterface"; export type { SkillMetadata } from "./SkillMetadata"; export type { SkillScope } from "./SkillScope"; export type { SkillsListEntry } from "./SkillsListEntry"; @@ -171,6 +182,7 @@ export type { TaskCompleteEvent } from "./TaskCompleteEvent"; export type { TaskStartedEvent } from "./TaskStartedEvent"; export type { TerminalInteractionEvent } from "./TerminalInteractionEvent"; export type { TextContent } from "./TextContent"; +export type { TextElement } from "./TextElement"; export type { TextResourceContents } from "./TextResourceContents"; export type { ThreadId } from "./ThreadId"; export type { ThreadRolledBackEvent } from "./ThreadRolledBackEvent"; @@ -184,8 +196,10 @@ export type { ToolOutputSchema } from "./ToolOutputSchema"; export type { Tools } from "./Tools"; export type { TurnAbortReason } from "./TurnAbortReason"; export type { TurnAbortedEvent } from "./TurnAbortedEvent"; +export type { TurnCompleteEvent } from "./TurnCompleteEvent"; export type { TurnDiffEvent } from "./TurnDiffEvent"; export type { TurnItem } from "./TurnItem"; +export type { TurnStartedEvent } from "./TurnStartedEvent"; export type { UndoCompletedEvent } from "./UndoCompletedEvent"; export type { UndoStartedEvent } from "./UndoStartedEvent"; export type { UpdatePlanArgs } from "./UpdatePlanArgs"; @@ -201,4 +215,5 @@ export type { WebSearchAction } from "./WebSearchAction"; export type { WebSearchBeginEvent } from "./WebSearchBeginEvent"; export type { WebSearchEndEvent } from "./WebSearchEndEvent"; export type { WebSearchItem } from "./WebSearchItem"; +export type { WebSearchMode } from "./WebSearchMode"; export * as v2 from "./v2"; diff --git a/src/app-server/v2/ByteRange.ts b/src/app-server/v2/ByteRange.ts new file mode 100644 index 00000000..6cb81b87 --- /dev/null +++ b/src/app-server/v2/ByteRange.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ByteRange = { start: number, end: number, }; diff --git a/src/app-server/v2/CollabAgentState.ts b/src/app-server/v2/CollabAgentState.ts new file mode 100644 index 00000000..785dbf1f --- /dev/null +++ b/src/app-server/v2/CollabAgentState.ts @@ -0,0 +1,6 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { CollabAgentStatus } from "./CollabAgentStatus"; + +export type CollabAgentState = { status: CollabAgentStatus, message: string | null, }; diff --git a/src/app-server/v2/CollabAgentStatus.ts b/src/app-server/v2/CollabAgentStatus.ts new file mode 100644 index 00000000..3672d19d --- /dev/null +++ b/src/app-server/v2/CollabAgentStatus.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type CollabAgentStatus = "pendingInit" | "running" | "completed" | "errored" | "shutdown" | "notFound"; diff --git a/src/app-server/v2/CollabAgentTool.ts b/src/app-server/v2/CollabAgentTool.ts new file mode 100644 index 00000000..11db4dbf --- /dev/null +++ b/src/app-server/v2/CollabAgentTool.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type CollabAgentTool = "spawnAgent" | "sendInput" | "wait" | "closeAgent"; diff --git a/src/app-server/v2/CollabAgentToolCallStatus.ts b/src/app-server/v2/CollabAgentToolCallStatus.ts new file mode 100644 index 00000000..f21f7bd5 --- /dev/null +++ b/src/app-server/v2/CollabAgentToolCallStatus.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type CollabAgentToolCallStatus = "inProgress" | "completed" | "failed"; diff --git a/src/app-server/v2/Config.ts b/src/app-server/v2/Config.ts index 77942136..22e84c8f 100644 --- a/src/app-server/v2/Config.ts +++ b/src/app-server/v2/Config.ts @@ -5,6 +5,7 @@ import type { ForcedLoginMethod } from "../ForcedLoginMethod"; import type { ReasoningEffort } from "../ReasoningEffort"; import type { ReasoningSummary } from "../ReasoningSummary"; import type { Verbosity } from "../Verbosity"; +import type { WebSearchMode } from "../WebSearchMode"; import type { JsonValue } from "../serde_json/JsonValue"; import type { AnalyticsConfig } from "./AnalyticsConfig"; import type { AskForApproval } from "./AskForApproval"; @@ -13,4 +14,4 @@ import type { SandboxMode } from "./SandboxMode"; import type { SandboxWorkspaceWrite } from "./SandboxWorkspaceWrite"; import type { ToolsV2 } from "./ToolsV2"; -export type Config = { model: string | null, review_model: string | null, model_context_window: bigint | null, model_auto_compact_token_limit: bigint | null, model_provider: string | null, approval_policy: AskForApproval | null, sandbox_mode: SandboxMode | null, sandbox_workspace_write: SandboxWorkspaceWrite | null, forced_chatgpt_workspace_id: string | null, forced_login_method: ForcedLoginMethod | null, tools: ToolsV2 | null, profile: string | null, profiles: { [key in string]?: ProfileV2 }, instructions: string | null, developer_instructions: string | null, compact_prompt: string | null, model_reasoning_effort: ReasoningEffort | null, model_reasoning_summary: ReasoningSummary | null, model_verbosity: Verbosity | null, analytics: AnalyticsConfig | null, } & ({ [key in string]?: number | string | boolean | Array | { [key in string]?: JsonValue } | null }); +export type Config = { model: string | null, review_model: string | null, model_context_window: bigint | null, model_auto_compact_token_limit: bigint | null, model_provider: string | null, approval_policy: AskForApproval | null, sandbox_mode: SandboxMode | null, sandbox_workspace_write: SandboxWorkspaceWrite | null, forced_chatgpt_workspace_id: string | null, forced_login_method: ForcedLoginMethod | null, web_search: WebSearchMode | null, tools: ToolsV2 | null, profile: string | null, profiles: { [key in string]?: ProfileV2 }, instructions: string | null, developer_instructions: string | null, compact_prompt: string | null, model_reasoning_effort: ReasoningEffort | null, model_reasoning_summary: ReasoningSummary | null, model_verbosity: Verbosity | null, analytics: AnalyticsConfig | null, } & ({ [key in string]?: number | string | boolean | Array | { [key in string]?: JsonValue } | null }); diff --git a/src/app-server/v2/ConfigWarningNotification.ts b/src/app-server/v2/ConfigWarningNotification.ts new file mode 100644 index 00000000..5f7a7db6 --- /dev/null +++ b/src/app-server/v2/ConfigWarningNotification.ts @@ -0,0 +1,13 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ConfigWarningNotification = { +/** + * Concise summary of the warning. + */ +summary: string, +/** + * Optional extra guidance or error details. + */ +details: string | null, }; diff --git a/src/app-server/v2/McpServerRefreshResponse.ts b/src/app-server/v2/McpServerRefreshResponse.ts new file mode 100644 index 00000000..48a25d2f --- /dev/null +++ b/src/app-server/v2/McpServerRefreshResponse.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type McpServerRefreshResponse = Record; diff --git a/src/app-server/v2/ProfileV2.ts b/src/app-server/v2/ProfileV2.ts index 766612c4..56428ba7 100644 --- a/src/app-server/v2/ProfileV2.ts +++ b/src/app-server/v2/ProfileV2.ts @@ -4,7 +4,8 @@ import type { ReasoningEffort } from "../ReasoningEffort"; import type { ReasoningSummary } from "../ReasoningSummary"; import type { Verbosity } from "../Verbosity"; +import type { WebSearchMode } from "../WebSearchMode"; import type { JsonValue } from "../serde_json/JsonValue"; import type { AskForApproval } from "./AskForApproval"; -export type ProfileV2 = { model: string | null, model_provider: string | null, approval_policy: AskForApproval | null, model_reasoning_effort: ReasoningEffort | null, model_reasoning_summary: ReasoningSummary | null, model_verbosity: Verbosity | null, chatgpt_base_url: string | null, } & ({ [key in string]?: number | string | boolean | Array | { [key in string]?: JsonValue } | null }); +export type ProfileV2 = { model: string | null, model_provider: string | null, approval_policy: AskForApproval | null, model_reasoning_effort: ReasoningEffort | null, model_reasoning_summary: ReasoningSummary | null, model_verbosity: Verbosity | null, web_search: WebSearchMode | null, chatgpt_base_url: string | null, } & ({ [key in string]?: number | string | boolean | Array | { [key in string]?: JsonValue } | null }); diff --git a/src/app-server/v2/SkillInterface.ts b/src/app-server/v2/SkillInterface.ts new file mode 100644 index 00000000..86c37a0b --- /dev/null +++ b/src/app-server/v2/SkillInterface.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type SkillInterface = { displayName?: string, shortDescription?: string, iconSmall?: string, iconLarge?: string, brandColor?: string, defaultPrompt?: string, }; diff --git a/src/app-server/v2/SkillMetadata.ts b/src/app-server/v2/SkillMetadata.ts index 7d798788..ed25c794 100644 --- a/src/app-server/v2/SkillMetadata.ts +++ b/src/app-server/v2/SkillMetadata.ts @@ -1,6 +1,11 @@ // GENERATED CODE! DO NOT MODIFY BY HAND! // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SkillInterface } from "./SkillInterface"; import type { SkillScope } from "./SkillScope"; -export type SkillMetadata = { name: string, description: string, shortDescription?: string, path: string, scope: SkillScope, }; +export type SkillMetadata = { name: string, description: string, +/** + * Legacy short_description from SKILL.md. Prefer SKILL.toml interface.short_description. + */ +shortDescription?: string, interface?: SkillInterface, path: string, scope: SkillScope, }; diff --git a/src/app-server/v2/TextElement.ts b/src/app-server/v2/TextElement.ts new file mode 100644 index 00000000..8841d004 --- /dev/null +++ b/src/app-server/v2/TextElement.ts @@ -0,0 +1,14 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ByteRange } from "./ByteRange"; + +export type TextElement = { +/** + * Byte range in the parent `text` buffer that this element occupies. + */ +byteRange: ByteRange, +/** + * Optional human-readable placeholder for the element, displayed in the UI. + */ +placeholder: string | null, }; diff --git a/src/app-server/v2/ThreadItem.ts b/src/app-server/v2/ThreadItem.ts index 344f01e4..475b2a60 100644 --- a/src/app-server/v2/ThreadItem.ts +++ b/src/app-server/v2/ThreadItem.ts @@ -2,6 +2,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { JsonValue } from "../serde_json/JsonValue"; +import type { CollabAgentState } from "./CollabAgentState"; +import type { CollabAgentTool } from "./CollabAgentTool"; +import type { CollabAgentToolCallStatus } from "./CollabAgentToolCallStatus"; import type { CommandAction } from "./CommandAction"; import type { CommandExecutionStatus } from "./CommandExecutionStatus"; import type { FileUpdateChange } from "./FileUpdateChange"; @@ -45,4 +48,33 @@ durationMs: number | null, } | { "type": "fileChange", id: string, changes: Arra /** * The duration of the MCP tool call in milliseconds. */ -durationMs: number | null, } | { "type": "webSearch", id: string, query: string, } | { "type": "imageView", id: string, path: string, } | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, }; +durationMs: number | null, } | { "type": "collabAgentToolCall", +/** + * Unique identifier for this collab tool call. + */ +id: string, +/** + * Name of the collab tool that was invoked. + */ +tool: CollabAgentTool, +/** + * Current status of the collab tool call. + */ +status: CollabAgentToolCallStatus, +/** + * Thread ID of the agent issuing the collab request. + */ +senderThreadId: string, +/** + * Thread ID of the receiving agent, when applicable. In case of spawn operation, + * this corresponds to the newly spawned agent. + */ +receiverThreadIds: Array, +/** + * Prompt text sent as part of the collab tool call, when available. + */ +prompt: string | null, +/** + * Last known status of the target agents, when available. + */ +agentsStates: { [key in string]?: CollabAgentState }, } | { "type": "webSearch", id: string, query: string, } | { "type": "imageView", id: string, path: string, } | { "type": "enteredReviewMode", id: string, review: string, } | { "type": "exitedReviewMode", id: string, review: string, }; diff --git a/src/app-server/v2/UserInput.ts b/src/app-server/v2/UserInput.ts index 33749a6f..e983fce1 100644 --- a/src/app-server/v2/UserInput.ts +++ b/src/app-server/v2/UserInput.ts @@ -1,5 +1,10 @@ // GENERATED CODE! DO NOT MODIFY BY HAND! // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { TextElement } from "./TextElement"; -export type UserInput = { "type": "text", text: string, } | { "type": "image", url: string, } | { "type": "localImage", path: string, } | { "type": "skill", name: string, path: string, }; +export type UserInput = { "type": "text", text: string, +/** + * UI-defined spans within `text` used to render or persist special elements. + */ +text_elements: Array, } | { "type": "image", url: string, } | { "type": "localImage", path: string, } | { "type": "skill", name: string, path: string, }; diff --git a/src/app-server/v2/index.ts b/src/app-server/v2/index.ts index f37e1f5f..8a94ceef 100644 --- a/src/app-server/v2/index.ts +++ b/src/app-server/v2/index.ts @@ -8,10 +8,15 @@ export type { AgentMessageDeltaNotification } from "./AgentMessageDeltaNotificat export type { AnalyticsConfig } from "./AnalyticsConfig"; export type { ApprovalDecision } from "./ApprovalDecision"; export type { AskForApproval } from "./AskForApproval"; +export type { ByteRange } from "./ByteRange"; export type { CancelLoginAccountParams } from "./CancelLoginAccountParams"; export type { CancelLoginAccountResponse } from "./CancelLoginAccountResponse"; export type { CancelLoginAccountStatus } from "./CancelLoginAccountStatus"; export type { CodexErrorInfo } from "./CodexErrorInfo"; +export type { CollabAgentState } from "./CollabAgentState"; +export type { CollabAgentStatus } from "./CollabAgentStatus"; +export type { CollabAgentTool } from "./CollabAgentTool"; +export type { CollabAgentToolCallStatus } from "./CollabAgentToolCallStatus"; export type { CommandAction } from "./CommandAction"; export type { CommandExecParams } from "./CommandExecParams"; export type { CommandExecResponse } from "./CommandExecResponse"; @@ -34,6 +39,7 @@ export type { ConfigReadResponse } from "./ConfigReadResponse"; export type { ConfigRequirements } from "./ConfigRequirements"; export type { ConfigRequirementsReadResponse } from "./ConfigRequirementsReadResponse"; export type { ConfigValueWriteParams } from "./ConfigValueWriteParams"; +export type { ConfigWarningNotification } from "./ConfigWarningNotification"; export type { ConfigWriteResponse } from "./ConfigWriteResponse"; export type { ContextCompactedNotification } from "./ContextCompactedNotification"; export type { CreditsSnapshot } from "./CreditsSnapshot"; @@ -65,6 +71,7 @@ export type { McpServer } from "./McpServer"; export type { McpServerOauthLoginCompletedNotification } from "./McpServerOauthLoginCompletedNotification"; export type { McpServerOauthLoginParams } from "./McpServerOauthLoginParams"; export type { McpServerOauthLoginResponse } from "./McpServerOauthLoginResponse"; +export type { McpServerRefreshResponse } from "./McpServerRefreshResponse"; export type { McpServerStatus } from "./McpServerStatus"; export type { McpToolCallError } from "./McpToolCallError"; export type { McpToolCallProgressNotification } from "./McpToolCallProgressNotification"; @@ -96,12 +103,14 @@ export type { SandboxPolicy } from "./SandboxPolicy"; export type { SandboxWorkspaceWrite } from "./SandboxWorkspaceWrite"; export type { SessionSource } from "./SessionSource"; export type { SkillErrorInfo } from "./SkillErrorInfo"; +export type { SkillInterface } from "./SkillInterface"; export type { SkillMetadata } from "./SkillMetadata"; export type { SkillScope } from "./SkillScope"; export type { SkillsListEntry } from "./SkillsListEntry"; export type { SkillsListParams } from "./SkillsListParams"; export type { SkillsListResponse } from "./SkillsListResponse"; export type { TerminalInteractionNotification } from "./TerminalInteractionNotification"; +export type { TextElement } from "./TextElement"; export type { Thread } from "./Thread"; export type { ThreadArchiveParams } from "./ThreadArchiveParams"; export type { ThreadArchiveResponse } from "./ThreadArchiveResponse";