diff --git a/codex-rs/app-server-protocol/schema/json/ClientRequest.json b/codex-rs/app-server-protocol/schema/json/ClientRequest.json index 9e0a87b5e3f2..4a69b4d8cc67 100644 --- a/codex-rs/app-server-protocol/schema/json/ClientRequest.json +++ b/codex-rs/app-server-protocol/schema/json/ClientRequest.json @@ -1277,6 +1277,27 @@ ], "type": "string" }, + "McpServerToolCallParams": { + "properties": { + "_meta": true, + "arguments": true, + "server": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + } + }, + "required": [ + "server", + "threadId", + "tool" + ], + "type": "object" + }, "MergeStrategy": { "enum": [ "replace", @@ -4569,6 +4590,30 @@ "title": "McpServer/resource/readRequest", "type": "object" }, + { + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "enum": [ + "mcpServer/tool/call" + ], + "title": "McpServer/tool/callRequestMethod", + "type": "string" + }, + "params": { + "$ref": "#/definitions/McpServerToolCallParams" + } + }, + "required": [ + "id", + "method", + "params" + ], + "title": "McpServer/tool/callRequest", + "type": "object" + }, { "properties": { "id": { diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index 4308f8e84a1c..95de3343a9e6 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -1225,6 +1225,30 @@ "title": "McpServer/resource/readRequest", "type": "object" }, + { + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "enum": [ + "mcpServer/tool/call" + ], + "title": "McpServer/tool/callRequestMethod", + "type": "string" + }, + "params": { + "$ref": "#/definitions/v2/McpServerToolCallParams" + } + }, + "required": [ + "id", + "method", + "params" + ], + "title": "McpServer/tool/callRequest", + "type": "object" + }, { "properties": { "id": { @@ -9214,6 +9238,51 @@ "title": "McpServerStatusUpdatedNotification", "type": "object" }, + "McpServerToolCallParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "_meta": true, + "arguments": true, + "server": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + } + }, + "required": [ + "server", + "threadId", + "tool" + ], + "title": "McpServerToolCallParams", + "type": "object" + }, + "McpServerToolCallResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "_meta": true, + "content": { + "items": true, + "type": "array" + }, + "isError": { + "type": [ + "boolean", + "null" + ] + }, + "structuredContent": true + }, + "required": [ + "content" + ], + "title": "McpServerToolCallResponse", + "type": "object" + }, "McpToolCallError": { "properties": { "message": { diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 378e26dd6c7b..88df6dce4a64 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -1807,6 +1807,30 @@ "title": "McpServer/resource/readRequest", "type": "object" }, + { + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "enum": [ + "mcpServer/tool/call" + ], + "title": "McpServer/tool/callRequestMethod", + "type": "string" + }, + "params": { + "$ref": "#/definitions/McpServerToolCallParams" + } + }, + "required": [ + "id", + "method", + "params" + ], + "title": "McpServer/tool/callRequest", + "type": "object" + }, { "properties": { "id": { @@ -6010,6 +6034,51 @@ "title": "McpServerStatusUpdatedNotification", "type": "object" }, + "McpServerToolCallParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "_meta": true, + "arguments": true, + "server": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + } + }, + "required": [ + "server", + "threadId", + "tool" + ], + "title": "McpServerToolCallParams", + "type": "object" + }, + "McpServerToolCallResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "_meta": true, + "content": { + "items": true, + "type": "array" + }, + "isError": { + "type": [ + "boolean", + "null" + ] + }, + "structuredContent": true + }, + "required": [ + "content" + ], + "title": "McpServerToolCallResponse", + "type": "object" + }, "McpToolCallError": { "properties": { "message": { diff --git a/codex-rs/app-server-protocol/schema/json/v2/McpServerToolCallParams.json b/codex-rs/app-server-protocol/schema/json/v2/McpServerToolCallParams.json new file mode 100644 index 000000000000..3465e60c83b0 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/json/v2/McpServerToolCallParams.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "_meta": true, + "arguments": true, + "server": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + } + }, + "required": [ + "server", + "threadId", + "tool" + ], + "title": "McpServerToolCallParams", + "type": "object" +} \ No newline at end of file diff --git a/codex-rs/app-server-protocol/schema/json/v2/McpServerToolCallResponse.json b/codex-rs/app-server-protocol/schema/json/v2/McpServerToolCallResponse.json new file mode 100644 index 000000000000..0e5ecdf78de0 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/json/v2/McpServerToolCallResponse.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "_meta": true, + "content": { + "items": true, + "type": "array" + }, + "isError": { + "type": [ + "boolean", + "null" + ] + }, + "structuredContent": true + }, + "required": [ + "content" + ], + "title": "McpServerToolCallResponse", + "type": "object" +} \ No newline at end of file diff --git a/codex-rs/app-server-protocol/schema/typescript/ApplyPatchApprovalParams.ts b/codex-rs/app-server-protocol/schema/typescript/ApplyPatchApprovalParams.ts index d04f7b75df38..34060772564c 100644 --- a/codex-rs/app-server-protocol/schema/typescript/ApplyPatchApprovalParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/ApplyPatchApprovalParams.ts @@ -4,16 +4,16 @@ import type { FileChange } from "./FileChange"; import type { ThreadId } from "./ThreadId"; -export type ApplyPatchApprovalParams = { conversationId: ThreadId, +export type ApplyPatchApprovalParams = { conversationId: ThreadId, /** * Use to correlate this with [codex_protocol::protocol::PatchApplyBeginEvent] * and [codex_protocol::protocol::PatchApplyEndEvent]. */ -callId: string, fileChanges: { [key in string]?: FileChange }, +callId: string, fileChanges: { [key in string]?: FileChange }, /** * Optional explanatory reason (e.g. request for extra write access). */ -reason: string | null, +reason: string | null, /** * When set, the agent is asking the user to allow writes under this root * for the remainder of the session (unclear if this is honored today). diff --git a/codex-rs/app-server-protocol/schema/typescript/ClientRequest.ts b/codex-rs/app-server-protocol/schema/typescript/ClientRequest.ts index d12599d7a9ef..1bbc9b7ac945 100644 --- a/codex-rs/app-server-protocol/schema/typescript/ClientRequest.ts +++ b/codex-rs/app-server-protocol/schema/typescript/ClientRequest.ts @@ -35,6 +35,7 @@ import type { ListMcpServerStatusParams } from "./v2/ListMcpServerStatusParams"; import type { LoginAccountParams } from "./v2/LoginAccountParams"; import type { McpResourceReadParams } from "./v2/McpResourceReadParams"; import type { McpServerOauthLoginParams } from "./v2/McpServerOauthLoginParams"; +import type { McpServerToolCallParams } from "./v2/McpServerToolCallParams"; import type { ModelListParams } from "./v2/ModelListParams"; import type { PluginInstallParams } from "./v2/PluginInstallParams"; import type { PluginListParams } from "./v2/PluginListParams"; @@ -65,4 +66,4 @@ import type { WindowsSandboxSetupStartParams } from "./v2/WindowsSandboxSetupSta /** * 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/unsubscribe", id: RequestId, params: ThreadUnsubscribeParams, } | { "method": "thread/name/set", id: RequestId, params: ThreadSetNameParams, } | { "method": "thread/metadata/update", id: RequestId, params: ThreadMetadataUpdateParams, } | { "method": "thread/unarchive", id: RequestId, params: ThreadUnarchiveParams, } | { "method": "thread/compact/start", id: RequestId, params: ThreadCompactStartParams, } | { "method": "thread/shellCommand", id: RequestId, params: ThreadShellCommandParams, } | { "method": "thread/rollback", id: RequestId, params: ThreadRollbackParams, } | { "method": "thread/list", id: RequestId, params: ThreadListParams, } | { "method": "thread/loaded/list", id: RequestId, params: ThreadLoadedListParams, } | { "method": "thread/read", id: RequestId, params: ThreadReadParams, } | { "method": "skills/list", id: RequestId, params: SkillsListParams, } | { "method": "plugin/list", id: RequestId, params: PluginListParams, } | { "method": "plugin/read", id: RequestId, params: PluginReadParams, } | { "method": "app/list", id: RequestId, params: AppsListParams, } | { "method": "fs/readFile", id: RequestId, params: FsReadFileParams, } | { "method": "fs/writeFile", id: RequestId, params: FsWriteFileParams, } | { "method": "fs/createDirectory", id: RequestId, params: FsCreateDirectoryParams, } | { "method": "fs/getMetadata", id: RequestId, params: FsGetMetadataParams, } | { "method": "fs/readDirectory", id: RequestId, params: FsReadDirectoryParams, } | { "method": "fs/remove", id: RequestId, params: FsRemoveParams, } | { "method": "fs/copy", id: RequestId, params: FsCopyParams, } | { "method": "fs/watch", id: RequestId, params: FsWatchParams, } | { "method": "fs/unwatch", id: RequestId, params: FsUnwatchParams, } | { "method": "skills/config/write", id: RequestId, params: SkillsConfigWriteParams, } | { "method": "plugin/install", id: RequestId, params: PluginInstallParams, } | { "method": "plugin/uninstall", id: RequestId, params: PluginUninstallParams, } | { "method": "turn/start", id: RequestId, params: TurnStartParams, } | { "method": "turn/steer", id: RequestId, params: TurnSteerParams, } | { "method": "turn/interrupt", id: RequestId, params: TurnInterruptParams, } | { "method": "review/start", id: RequestId, params: ReviewStartParams, } | { "method": "model/list", id: RequestId, params: ModelListParams, } | { "method": "experimentalFeature/list", id: RequestId, params: ExperimentalFeatureListParams, } | { "method": "experimentalFeature/enablement/set", id: RequestId, params: ExperimentalFeatureEnablementSetParams, } | { "method": "mcpServer/oauth/login", id: RequestId, params: McpServerOauthLoginParams, } | { "method": "config/mcpServer/reload", id: RequestId, params: undefined, } | { "method": "mcpServerStatus/list", id: RequestId, params: ListMcpServerStatusParams, } | { "method": "mcpServer/resource/read", id: RequestId, params: McpResourceReadParams, } | { "method": "windowsSandbox/setupStart", id: RequestId, params: WindowsSandboxSetupStartParams, } | { "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": "command/exec/write", id: RequestId, params: CommandExecWriteParams, } | { "method": "command/exec/terminate", id: RequestId, params: CommandExecTerminateParams, } | { "method": "command/exec/resize", id: RequestId, params: CommandExecResizeParams, } | { "method": "config/read", id: RequestId, params: ConfigReadParams, } | { "method": "externalAgentConfig/detect", id: RequestId, params: ExternalAgentConfigDetectParams, } | { "method": "externalAgentConfig/import", id: RequestId, params: ExternalAgentConfigImportParams, } | { "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": "getConversationSummary", id: RequestId, params: GetConversationSummaryParams, } | { "method": "gitDiffToRemote", id: RequestId, params: GitDiffToRemoteParams, } | { "method": "getAuthStatus", id: RequestId, params: GetAuthStatusParams, } | { "method": "fuzzyFileSearch", id: RequestId, params: FuzzyFileSearchParams, }; +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/unsubscribe", id: RequestId, params: ThreadUnsubscribeParams, } | { "method": "thread/name/set", id: RequestId, params: ThreadSetNameParams, } | { "method": "thread/metadata/update", id: RequestId, params: ThreadMetadataUpdateParams, } | { "method": "thread/unarchive", id: RequestId, params: ThreadUnarchiveParams, } | { "method": "thread/compact/start", id: RequestId, params: ThreadCompactStartParams, } | { "method": "thread/shellCommand", id: RequestId, params: ThreadShellCommandParams, } | { "method": "thread/rollback", id: RequestId, params: ThreadRollbackParams, } | { "method": "thread/list", id: RequestId, params: ThreadListParams, } | { "method": "thread/loaded/list", id: RequestId, params: ThreadLoadedListParams, } | { "method": "thread/read", id: RequestId, params: ThreadReadParams, } | { "method": "skills/list", id: RequestId, params: SkillsListParams, } | { "method": "plugin/list", id: RequestId, params: PluginListParams, } | { "method": "plugin/read", id: RequestId, params: PluginReadParams, } | { "method": "app/list", id: RequestId, params: AppsListParams, } | { "method": "fs/readFile", id: RequestId, params: FsReadFileParams, } | { "method": "fs/writeFile", id: RequestId, params: FsWriteFileParams, } | { "method": "fs/createDirectory", id: RequestId, params: FsCreateDirectoryParams, } | { "method": "fs/getMetadata", id: RequestId, params: FsGetMetadataParams, } | { "method": "fs/readDirectory", id: RequestId, params: FsReadDirectoryParams, } | { "method": "fs/remove", id: RequestId, params: FsRemoveParams, } | { "method": "fs/copy", id: RequestId, params: FsCopyParams, } | { "method": "fs/watch", id: RequestId, params: FsWatchParams, } | { "method": "fs/unwatch", id: RequestId, params: FsUnwatchParams, } | { "method": "skills/config/write", id: RequestId, params: SkillsConfigWriteParams, } | { "method": "plugin/install", id: RequestId, params: PluginInstallParams, } | { "method": "plugin/uninstall", id: RequestId, params: PluginUninstallParams, } | { "method": "turn/start", id: RequestId, params: TurnStartParams, } | { "method": "turn/steer", id: RequestId, params: TurnSteerParams, } | { "method": "turn/interrupt", id: RequestId, params: TurnInterruptParams, } | { "method": "review/start", id: RequestId, params: ReviewStartParams, } | { "method": "model/list", id: RequestId, params: ModelListParams, } | { "method": "experimentalFeature/list", id: RequestId, params: ExperimentalFeatureListParams, } | { "method": "experimentalFeature/enablement/set", id: RequestId, params: ExperimentalFeatureEnablementSetParams, } | { "method": "mcpServer/oauth/login", id: RequestId, params: McpServerOauthLoginParams, } | { "method": "config/mcpServer/reload", id: RequestId, params: undefined, } | { "method": "mcpServerStatus/list", id: RequestId, params: ListMcpServerStatusParams, } | { "method": "mcpServer/resource/read", id: RequestId, params: McpResourceReadParams, } | { "method": "mcpServer/tool/call", id: RequestId, params: McpServerToolCallParams, } | { "method": "windowsSandbox/setupStart", id: RequestId, params: WindowsSandboxSetupStartParams, } | { "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": "command/exec/write", id: RequestId, params: CommandExecWriteParams, } | { "method": "command/exec/terminate", id: RequestId, params: CommandExecTerminateParams, } | { "method": "command/exec/resize", id: RequestId, params: CommandExecResizeParams, } | { "method": "config/read", id: RequestId, params: ConfigReadParams, } | { "method": "externalAgentConfig/detect", id: RequestId, params: ExternalAgentConfigDetectParams, } | { "method": "externalAgentConfig/import", id: RequestId, params: ExternalAgentConfigImportParams, } | { "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": "getConversationSummary", id: RequestId, params: GetConversationSummaryParams, } | { "method": "gitDiffToRemote", id: RequestId, params: GitDiffToRemoteParams, } | { "method": "getAuthStatus", id: RequestId, params: GetAuthStatusParams, } | { "method": "fuzzyFileSearch", id: RequestId, params: FuzzyFileSearchParams, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/ExecCommandApprovalParams.ts b/codex-rs/app-server-protocol/schema/typescript/ExecCommandApprovalParams.ts index f68872905d5f..b7470c15b7e1 100644 --- a/codex-rs/app-server-protocol/schema/typescript/ExecCommandApprovalParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/ExecCommandApprovalParams.ts @@ -4,12 +4,12 @@ import type { ParsedCommand } from "./ParsedCommand"; import type { ThreadId } from "./ThreadId"; -export type ExecCommandApprovalParams = { conversationId: ThreadId, +export type ExecCommandApprovalParams = { conversationId: ThreadId, /** * Use to correlate this with [codex_protocol::protocol::ExecCommandBeginEvent] * and [codex_protocol::protocol::ExecCommandEndEvent]. */ -callId: string, +callId: string, /** * Identifier for this specific approval callback. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/InitializeCapabilities.ts b/codex-rs/app-server-protocol/schema/typescript/InitializeCapabilities.ts index 125b4b1f1c07..5d42cc4852db 100644 --- a/codex-rs/app-server-protocol/schema/typescript/InitializeCapabilities.ts +++ b/codex-rs/app-server-protocol/schema/typescript/InitializeCapabilities.ts @@ -5,11 +5,11 @@ /** * Client-declared capabilities negotiated during initialize. */ -export type InitializeCapabilities = { +export type InitializeCapabilities = { /** * Opt into receiving experimental API methods and fields. */ -experimentalApi: boolean, +experimentalApi: boolean, /** * Exact notification method names that should be suppressed for this * connection (for example `thread/started`). diff --git a/codex-rs/app-server-protocol/schema/typescript/InitializeResponse.ts b/codex-rs/app-server-protocol/schema/typescript/InitializeResponse.ts index c1d0a822f248..f1f79d173c77 100644 --- a/codex-rs/app-server-protocol/schema/typescript/InitializeResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/InitializeResponse.ts @@ -3,16 +3,16 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "./AbsolutePathBuf"; -export type InitializeResponse = { userAgent: string, +export type InitializeResponse = { userAgent: string, /** * Absolute path to the server's $CODEX_HOME directory. */ -codexHome: AbsolutePathBuf, +codexHome: AbsolutePathBuf, /** * Platform family for the running app-server target, for example * `"unix"` or `"windows"`. */ -platformFamily: string, +platformFamily: string, /** * Operating system for the running app-server target, for example * `"macos"`, `"linux"`, or `"windows"`. diff --git a/codex-rs/app-server-protocol/schema/typescript/ParsedCommand.ts b/codex-rs/app-server-protocol/schema/typescript/ParsedCommand.ts index 146d7816c285..092476e9ac23 100644 --- a/codex-rs/app-server-protocol/schema/typescript/ParsedCommand.ts +++ b/codex-rs/app-server-protocol/schema/typescript/ParsedCommand.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ParsedCommand = { "type": "read", cmd: string, name: string, +export type ParsedCommand = { "type": "read", cmd: string, name: string, /** * (Best effort) Path to the file being read by the command. When * possible, this is an absolute path, though when relative, it should diff --git a/codex-rs/app-server-protocol/schema/typescript/ResourceContent.ts b/codex-rs/app-server-protocol/schema/typescript/ResourceContent.ts index 60fe239dc48b..f5bcf2d5126a 100644 --- a/codex-rs/app-server-protocol/schema/typescript/ResourceContent.ts +++ b/codex-rs/app-server-protocol/schema/typescript/ResourceContent.ts @@ -6,11 +6,11 @@ import type { JsonValue } from "./serde_json/JsonValue"; /** * Contents returned when reading a resource from an MCP server. */ -export type ResourceContent = { +export type ResourceContent = { /** * The URI of this resource. */ -uri: string, mimeType?: string, text: string, _meta?: JsonValue, } | { +uri: string, mimeType?: string, text: string, _meta?: JsonValue, } | { /** * The URI of this resource. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/ResponseItem.ts b/codex-rs/app-server-protocol/schema/typescript/ResponseItem.ts index e9ab2a84f4db..04b8bdcdad65 100644 --- a/codex-rs/app-server-protocol/schema/typescript/ResponseItem.ts +++ b/codex-rs/app-server-protocol/schema/typescript/ResponseItem.ts @@ -11,7 +11,7 @@ import type { ReasoningItemContent } from "./ReasoningItemContent"; import type { ReasoningItemReasoningSummary } from "./ReasoningItemReasoningSummary"; import type { WebSearchAction } from "./WebSearchAction"; -export type ResponseItem = { "type": "message", role: string, content: Array, end_turn?: boolean, phase?: MessagePhase, } | { "type": "reasoning", summary: Array, content?: Array, encrypted_content: string | null, } | { "type": "local_shell_call", +export type ResponseItem = { "type": "message", role: string, content: Array, end_turn?: boolean, phase?: MessagePhase, } | { "type": "reasoning", summary: Array, content?: Array, encrypted_content: string | null, } | { "type": "local_shell_call", /** * Set when using the Responses API. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/AppInfo.ts b/codex-rs/app-server-protocol/schema/typescript/v2/AppInfo.ts index 565521371898..ef1f54aa6826 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/AppInfo.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/AppInfo.ts @@ -7,7 +7,7 @@ import type { AppMetadata } from "./AppMetadata"; /** * EXPERIMENTAL - app metadata returned by app-list APIs. */ -export type AppInfo = { id: string, name: string, description: string | null, logoUrl: string | null, logoUrlDark: string | null, distributionChannel: string | null, branding: AppBranding | null, appMetadata: AppMetadata | null, labels: { [key in string]?: string } | null, installUrl: string | null, isAccessible: boolean, +export type AppInfo = { id: string, name: string, description: string | null, logoUrl: string | null, logoUrlDark: string | null, distributionChannel: string | null, branding: AppBranding | null, appMetadata: AppMetadata | null, labels: { [key in string]?: string } | null, installUrl: string | null, isAccessible: boolean, /** * Whether this app is enabled in config.toml. * Example: diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/AppsListParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/AppsListParams.ts index 7687144c532f..b96829567b22 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/AppsListParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/AppsListParams.ts @@ -5,19 +5,19 @@ /** * EXPERIMENTAL - list available apps/connectors. */ -export type AppsListParams = { +export type AppsListParams = { /** * Opaque pagination cursor returned by a previous call. */ -cursor?: string | null, +cursor?: string | null, /** * Optional page size; defaults to a reasonable server-side value. */ -limit?: number | null, +limit?: number | null, /** * Optional thread id used to evaluate app feature gating from that thread's config. */ -threadId?: string | null, +threadId?: string | null, /** * When true, bypass app caches and fetch the latest data from sources. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/AppsListResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/AppsListResponse.ts index cb1e45f203fe..dabeded178cc 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/AppsListResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/AppsListResponse.ts @@ -6,7 +6,7 @@ import type { AppInfo } from "./AppInfo"; /** * EXPERIMENTAL - app list response. */ -export type AppsListResponse = { data: Array, +export type AppsListResponse = { data: Array, /** * Opaque cursor to pass to the next call to continue after the last item. * If None, there are no more items to return. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ChatgptAuthTokensRefreshParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ChatgptAuthTokensRefreshParams.ts index 7358d80347e7..d59cc30d88d4 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ChatgptAuthTokensRefreshParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ChatgptAuthTokensRefreshParams.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ChatgptAuthTokensRefreshReason } from "./ChatgptAuthTokensRefreshReason"; -export type ChatgptAuthTokensRefreshParams = { reason: ChatgptAuthTokensRefreshReason, +export type ChatgptAuthTokensRefreshParams = { reason: ChatgptAuthTokensRefreshReason, /** * Workspace/account identifier that Codex was previously using. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecOutputDeltaNotification.ts b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecOutputDeltaNotification.ts index 9a4b72806231..a6c2ea45dc97 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecOutputDeltaNotification.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecOutputDeltaNotification.ts @@ -9,20 +9,20 @@ import type { CommandExecOutputStream } from "./CommandExecOutputStream"; * These notifications are connection-scoped. If the originating connection * closes, the server terminates the process. */ -export type CommandExecOutputDeltaNotification = { +export type CommandExecOutputDeltaNotification = { /** * Client-supplied, connection-scoped `processId` from the original * `command/exec` request. */ -processId: string, +processId: string, /** * Output stream for this chunk. */ -stream: CommandExecOutputStream, +stream: CommandExecOutputStream, /** * Base64-encoded output bytes. */ -deltaBase64: string, +deltaBase64: string, /** * `true` on the final streamed chunk for a stream when `outputBytesCap` * truncated later output on that stream. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecParams.ts index 2e132f781840..097cfdfeccda 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecParams.ts @@ -12,11 +12,11 @@ import type { SandboxPolicy } from "./SandboxPolicy"; * sent only after all `command/exec/outputDelta` notifications for that * connection have been emitted. */ -export type CommandExecParams = { +export type CommandExecParams = { /** * Command argv vector. Empty arrays are rejected. */ -command: Array, +command: Array, /** * Optional client-supplied, connection-scoped process id. * @@ -25,56 +25,56 @@ command: Array, * `command/exec/terminate` calls. When omitted, buffered execution gets an * internal id that is not exposed to the client. */ -processId?: string | null, +processId?: string | null, /** * Enable PTY mode. * * This implies `streamStdin` and `streamStdoutStderr`. */ -tty?: boolean, +tty?: boolean, /** * Allow follow-up `command/exec/write` requests to write stdin bytes. * * Requires a client-supplied `processId`. */ -streamStdin?: boolean, +streamStdin?: boolean, /** * Stream stdout/stderr via `command/exec/outputDelta` notifications. * * Streamed bytes are not duplicated into the final response and require a * client-supplied `processId`. */ -streamStdoutStderr?: boolean, +streamStdoutStderr?: boolean, /** * Optional per-stream stdout/stderr capture cap in bytes. * * When omitted, the server default applies. Cannot be combined with * `disableOutputCap`. */ -outputBytesCap?: number | null, +outputBytesCap?: number | null, /** * Disable stdout/stderr capture truncation for this request. * * Cannot be combined with `outputBytesCap`. */ -disableOutputCap?: boolean, +disableOutputCap?: boolean, /** * Disable the timeout entirely for this request. * * Cannot be combined with `timeoutMs`. */ -disableTimeout?: boolean, +disableTimeout?: boolean, /** * Optional timeout in milliseconds. * * When omitted, the server default applies. Cannot be combined with * `disableTimeout`. */ -timeoutMs?: number | null, +timeoutMs?: number | null, /** * Optional working directory. Defaults to the server cwd. */ -cwd?: string | null, +cwd?: string | null, /** * Optional environment overrides merged into the server-computed * environment. @@ -82,12 +82,12 @@ cwd?: string | null, * Matching names override inherited values. Set a key to `null` to unset * an inherited variable. */ -env?: { [key in string]?: string | null } | null, +env?: { [key in string]?: string | null } | null, /** * Optional initial PTY size in character cells. Only valid when `tty` is * true. */ -size?: CommandExecTerminalSize | null, +size?: CommandExecTerminalSize | null, /** * Optional sandbox policy for this command. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecResizeParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecResizeParams.ts index dde1417c0a38..40a05dc780db 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecResizeParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecResizeParams.ts @@ -6,12 +6,12 @@ import type { CommandExecTerminalSize } from "./CommandExecTerminalSize"; /** * Resize a running PTY-backed `command/exec` session. */ -export type CommandExecResizeParams = { +export type CommandExecResizeParams = { /** * Client-supplied, connection-scoped `processId` from the original * `command/exec` request. */ -processId: string, +processId: string, /** * New PTY size in character cells. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecResponse.ts index c13efeffe6c1..25e01eb53bfd 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecResponse.ts @@ -5,17 +5,17 @@ /** * Final buffered result for `command/exec`. */ -export type CommandExecResponse = { +export type CommandExecResponse = { /** * Process exit code. */ -exitCode: number, +exitCode: number, /** * Buffered stdout capture. * * Empty when stdout was streamed via `command/exec/outputDelta`. */ -stdout: string, +stdout: string, /** * Buffered stderr capture. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecTerminalSize.ts b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecTerminalSize.ts index 5181b154ffc0..0bfacb62c6d1 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecTerminalSize.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecTerminalSize.ts @@ -5,11 +5,11 @@ /** * PTY size in character cells for `command/exec` PTY sessions. */ -export type CommandExecTerminalSize = { +export type CommandExecTerminalSize = { /** * Terminal height in character cells. */ -rows: number, +rows: number, /** * Terminal width in character cells. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecTerminateParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecTerminateParams.ts index 8012d29e41e0..cae970575234 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecTerminateParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecTerminateParams.ts @@ -5,7 +5,7 @@ /** * Terminate a running `command/exec` session. */ -export type CommandExecTerminateParams = { +export type CommandExecTerminateParams = { /** * Client-supplied, connection-scoped `processId` from the original * `command/exec` request. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecWriteParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecWriteParams.ts index b4df50f1bfbb..2092c7938175 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecWriteParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecWriteParams.ts @@ -6,16 +6,16 @@ * Write stdin bytes to a running `command/exec` session, close stdin, or * both. */ -export type CommandExecWriteParams = { +export type CommandExecWriteParams = { /** * Client-supplied, connection-scoped `processId` from the original * `command/exec` request. */ -processId: string, +processId: string, /** * Optional base64-encoded stdin bytes to write. */ -deltaBase64?: string | null, +deltaBase64?: string | null, /** * Close stdin after writing `deltaBase64`, if present. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecutionRequestApprovalParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecutionRequestApprovalParams.ts index 8fb6375e6950..e1330e2591c9 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecutionRequestApprovalParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/CommandExecutionRequestApprovalParams.ts @@ -8,7 +8,7 @@ import type { ExecPolicyAmendment } from "./ExecPolicyAmendment"; import type { NetworkApprovalContext } from "./NetworkApprovalContext"; import type { NetworkPolicyAmendment } from "./NetworkPolicyAmendment"; -export type CommandExecutionRequestApprovalParams = { threadId: string, turnId: string, itemId: string, +export type CommandExecutionRequestApprovalParams = { threadId: string, turnId: string, itemId: string, /** * Unique identifier for this specific approval callback. * @@ -18,39 +18,39 @@ export type CommandExecutionRequestApprovalParams = { threadId: string, turnId: * one parent `itemId`, so `approvalId` is a distinct opaque callback id * (a UUID) used to disambiguate routing. */ -approvalId?: string | null, +approvalId?: string | null, /** * Optional explanatory reason (e.g. request for network access). */ -reason?: string | null, +reason?: string | null, /** * Optional context for a managed-network approval prompt. */ -networkApprovalContext?: NetworkApprovalContext | null, +networkApprovalContext?: NetworkApprovalContext | null, /** * The command to be executed. */ -command?: string | null, +command?: string | null, /** * The command's working directory. */ -cwd?: string | null, +cwd?: string | null, /** * Best-effort parsed command actions for friendly display. */ -commandActions?: Array | null, +commandActions?: Array | null, /** * Optional additional permissions requested for this command. */ -additionalPermissions?: AdditionalPermissionProfile | null, +additionalPermissions?: AdditionalPermissionProfile | null, /** * Optional proposed execpolicy amendment to allow similar commands without prompting. */ -proposedExecpolicyAmendment?: ExecPolicyAmendment | null, +proposedExecpolicyAmendment?: ExecPolicyAmendment | null, /** * Optional proposed network policy amendments (allow/deny host) for future requests. */ -proposedNetworkPolicyAmendments?: Array | null, +proposedNetworkPolicyAmendments?: Array | null, /** * Ordered list of decisions the client may present for this prompt. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigBatchWriteParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigBatchWriteParams.ts index 6103039ef6d5..352eac28e344 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigBatchWriteParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigBatchWriteParams.ts @@ -3,11 +3,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ConfigEdit } from "./ConfigEdit"; -export type ConfigBatchWriteParams = { edits: Array, +export type ConfigBatchWriteParams = { edits: Array, /** * Path to the config file to write; defaults to the user's `config.toml` when omitted. */ -filePath?: string | null, expectedVersion?: string | null, +filePath?: string | null, expectedVersion?: string | null, /** * When true, hot-reload the updated user config into all loaded threads after writing. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigLayerSource.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigLayerSource.ts index b20c373bcb3c..1fe19b676584 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigLayerSource.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigLayerSource.ts @@ -3,12 +3,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; -export type ConfigLayerSource = { "type": "mdm", domain: string, key: string, } | { "type": "system", +export type ConfigLayerSource = { "type": "mdm", domain: string, key: string, } | { "type": "system", /** * This is the path to the system config.toml file, though it is not * guaranteed to exist. */ -file: AbsolutePathBuf, } | { "type": "user", +file: AbsolutePathBuf, } | { "type": "user", /** * This is the path to the user's config.toml file, though it is not * guaranteed to exist. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigReadParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigReadParams.ts index c5d5bc874cdf..1fd418d1820d 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigReadParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigReadParams.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ConfigReadParams = { includeLayers: boolean, +export type ConfigReadParams = { includeLayers: boolean, /** * Optional working directory to resolve project config layers. If specified, * return the effective config as seen from that directory (i.e., including any diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigRequirementsReadResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigRequirementsReadResponse.ts index c2891d939eb6..f2de11d98e49 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigRequirementsReadResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigRequirementsReadResponse.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ConfigRequirements } from "./ConfigRequirements"; -export type ConfigRequirementsReadResponse = { +export type ConfigRequirementsReadResponse = { /** * Null if no requirements are configured (e.g. no requirements.toml/MDM entries). */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigValueWriteParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigValueWriteParams.ts index 9204760f8516..709173d795d3 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigValueWriteParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigValueWriteParams.ts @@ -4,7 +4,7 @@ import type { JsonValue } from "../serde_json/JsonValue"; import type { MergeStrategy } from "./MergeStrategy"; -export type ConfigValueWriteParams = { keyPath: string, value: JsonValue, mergeStrategy: MergeStrategy, +export type ConfigValueWriteParams = { keyPath: string, value: JsonValue, mergeStrategy: MergeStrategy, /** * Path to the config file to write; defaults to the user's `config.toml` when omitted. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigWarningNotification.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigWarningNotification.ts index fae64c7a2cce..e0cdf392d9bf 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigWarningNotification.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigWarningNotification.ts @@ -3,19 +3,19 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { TextRange } from "./TextRange"; -export type ConfigWarningNotification = { +export type ConfigWarningNotification = { /** * Concise summary of the warning. */ -summary: string, +summary: string, /** * Optional extra guidance or error details. */ -details: string | null, +details: string | null, /** * Optional path to the config file that triggered the warning. */ -path?: string, +path?: string, /** * Optional range for the error location inside the config file. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigWriteResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigWriteResponse.ts index 536a680b2082..55cdce375191 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ConfigWriteResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ConfigWriteResponse.ts @@ -5,7 +5,7 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; import type { OverriddenMetadata } from "./OverriddenMetadata"; import type { WriteStatus } from "./WriteStatus"; -export type ConfigWriteResponse = { status: WriteStatus, version: string, +export type ConfigWriteResponse = { status: WriteStatus, version: string, /** * Canonical path to the config file that was written. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/DeprecationNoticeNotification.ts b/codex-rs/app-server-protocol/schema/typescript/v2/DeprecationNoticeNotification.ts index e0d2e7d6e62f..29b611715762 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/DeprecationNoticeNotification.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/DeprecationNoticeNotification.ts @@ -2,11 +2,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type DeprecationNoticeNotification = { +export type DeprecationNoticeNotification = { /** * Concise summary of what is deprecated. */ -summary: string, +summary: string, /** * Optional extra guidance, such as migration steps or rationale. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeature.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeature.ts index e17ef83138fb..2baf710080ad 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeature.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeature.ts @@ -3,34 +3,34 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ExperimentalFeatureStage } from "./ExperimentalFeatureStage"; -export type ExperimentalFeature = { +export type ExperimentalFeature = { /** * Stable key used in config.toml and CLI flag toggles. */ -name: string, +name: string, /** * Lifecycle stage of this feature flag. */ -stage: ExperimentalFeatureStage, +stage: ExperimentalFeatureStage, /** * User-facing display name shown in the experimental features UI. * Null when this feature is not in beta. */ -displayName: string | null, +displayName: string | null, /** * Short summary describing what the feature does. * Null when this feature is not in beta. */ -description: string | null, +description: string | null, /** * Announcement copy shown to users when the feature is introduced. * Null when this feature is not in beta. */ -announcement: string | null, +announcement: string | null, /** * Whether this feature is currently enabled in the loaded config. */ -enabled: boolean, +enabled: boolean, /** * Whether this feature is enabled by default. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureEnablementSetParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureEnablementSetParams.ts index cd9ced0b3ab3..d96955bf3dc5 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureEnablementSetParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureEnablementSetParams.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ExperimentalFeatureEnablementSetParams = { +export type ExperimentalFeatureEnablementSetParams = { /** * Process-wide runtime feature enablement keyed by canonical feature name. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureEnablementSetResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureEnablementSetResponse.ts index 903576d9bc20..d0a8975b8170 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureEnablementSetResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureEnablementSetResponse.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ExperimentalFeatureEnablementSetResponse = { +export type ExperimentalFeatureEnablementSetResponse = { /** * Feature enablement entries updated by this request. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureListParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureListParams.ts index 1d4dc84e0d48..0a1555d9980b 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureListParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureListParams.ts @@ -2,11 +2,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ExperimentalFeatureListParams = { +export type ExperimentalFeatureListParams = { /** * Opaque pagination cursor returned by a previous call. */ -cursor?: string | null, +cursor?: string | null, /** * Optional page size; defaults to a reasonable server-side value. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureListResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureListResponse.ts index 46b39ba0194f..4d055fa80b68 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureListResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ExperimentalFeatureListResponse.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ExperimentalFeature } from "./ExperimentalFeature"; -export type ExperimentalFeatureListResponse = { data: Array, +export type ExperimentalFeatureListResponse = { data: Array, /** * Opaque cursor to pass to the next call to continue after the last item. * If None, there are no more items to return. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ExternalAgentConfigDetectParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ExternalAgentConfigDetectParams.ts index 2a79b8107af4..163d96192536 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ExternalAgentConfigDetectParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ExternalAgentConfigDetectParams.ts @@ -2,11 +2,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ExternalAgentConfigDetectParams = { +export type ExternalAgentConfigDetectParams = { /** * If true, include detection under the user's home (~/.claude, ~/.codex, etc.). */ -includeHome?: boolean, +includeHome?: boolean, /** * Zero or more working directories to include for repo-scoped detection. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ExternalAgentConfigMigrationItem.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ExternalAgentConfigMigrationItem.ts index 442143c81eda..45e5585a7784 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ExternalAgentConfigMigrationItem.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ExternalAgentConfigMigrationItem.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ExternalAgentConfigMigrationItemType } from "./ExternalAgentConfigMigrationItemType"; -export type ExternalAgentConfigMigrationItem = { itemType: ExternalAgentConfigMigrationItemType, description: string, +export type ExternalAgentConfigMigrationItem = { itemType: ExternalAgentConfigMigrationItemType, description: string, /** * Null or empty means home-scoped migration; non-empty means repo-scoped migration. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FileChangeRequestApprovalParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FileChangeRequestApprovalParams.ts index a7951b6858d9..c514ed621955 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FileChangeRequestApprovalParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FileChangeRequestApprovalParams.ts @@ -2,11 +2,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type FileChangeRequestApprovalParams = { threadId: string, turnId: string, itemId: string, +export type FileChangeRequestApprovalParams = { threadId: string, turnId: string, itemId: string, /** * Optional explanatory reason (e.g. request for extra write access). */ -reason?: string | null, +reason?: string | null, /** * [UNSTABLE] When set, the agent is asking the user to allow writes under this root * for the remainder of the session (unclear if this is honored today). diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsChangedNotification.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsChangedNotification.ts index fc0fa9cf6db6..3f3be8ff3d1a 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsChangedNotification.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsChangedNotification.ts @@ -6,11 +6,11 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; /** * Filesystem watch notification emitted for `fs/watch` subscribers. */ -export type FsChangedNotification = { +export type FsChangedNotification = { /** * Watch identifier previously provided to `fs/watch`. */ -watchId: string, +watchId: string, /** * File or directory paths associated with this event. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsCopyParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsCopyParams.ts index 8f1ec8d4e075..d19aca926807 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsCopyParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsCopyParams.ts @@ -6,15 +6,15 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; /** * Copy a file or directory tree on the host filesystem. */ -export type FsCopyParams = { +export type FsCopyParams = { /** * Absolute source path. */ -sourcePath: AbsolutePathBuf, +sourcePath: AbsolutePathBuf, /** * Absolute destination path. */ -destinationPath: AbsolutePathBuf, +destinationPath: AbsolutePathBuf, /** * Required for directory copies; ignored for file copies. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsCreateDirectoryParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsCreateDirectoryParams.ts index 2afc9950ba9c..b648d3502921 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsCreateDirectoryParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsCreateDirectoryParams.ts @@ -6,11 +6,11 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; /** * Create a directory on the host filesystem. */ -export type FsCreateDirectoryParams = { +export type FsCreateDirectoryParams = { /** * Absolute directory path to create. */ -path: AbsolutePathBuf, +path: AbsolutePathBuf, /** * Whether parent directories should also be created. Defaults to `true`. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataParams.ts index 38e46c7b1cde..4ea0445cd688 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataParams.ts @@ -6,7 +6,7 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; /** * Request metadata for an absolute path. */ -export type FsGetMetadataParams = { +export type FsGetMetadataParams = { /** * Absolute path to inspect. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataResponse.ts index 351c646224b8..14b4db7e3ff2 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsGetMetadataResponse.ts @@ -5,19 +5,19 @@ /** * Metadata returned by `fs/getMetadata`. */ -export type FsGetMetadataResponse = { +export type FsGetMetadataResponse = { /** * Whether the path currently resolves to a directory. */ -isDirectory: boolean, +isDirectory: boolean, /** * Whether the path currently resolves to a regular file. */ -isFile: boolean, +isFile: boolean, /** * File creation time in Unix milliseconds when available, otherwise `0`. */ -createdAtMs: number, +createdAtMs: number, /** * File modification time in Unix milliseconds when available, otherwise `0`. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryEntry.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryEntry.ts index 2696d7a4e215..197673d2bb21 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryEntry.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryEntry.ts @@ -5,15 +5,15 @@ /** * A directory entry returned by `fs/readDirectory`. */ -export type FsReadDirectoryEntry = { +export type FsReadDirectoryEntry = { /** * Direct child entry name only, not an absolute or relative path. */ -fileName: string, +fileName: string, /** * Whether this entry resolves to a directory. */ -isDirectory: boolean, +isDirectory: boolean, /** * Whether this entry resolves to a regular file. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryParams.ts index 770eea3a3560..94eaae435594 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryParams.ts @@ -6,7 +6,7 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; /** * List direct child names for a directory. */ -export type FsReadDirectoryParams = { +export type FsReadDirectoryParams = { /** * Absolute directory path to read. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryResponse.ts index 878e858f021e..0ffb8acd4c8d 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadDirectoryResponse.ts @@ -6,7 +6,7 @@ import type { FsReadDirectoryEntry } from "./FsReadDirectoryEntry"; /** * Directory entries returned by `fs/readDirectory`. */ -export type FsReadDirectoryResponse = { +export type FsReadDirectoryResponse = { /** * Direct child entries in the requested directory. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileParams.ts index f389b44fc591..d5bf22e33a7d 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileParams.ts @@ -6,7 +6,7 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; /** * Read a file from the host filesystem. */ -export type FsReadFileParams = { +export type FsReadFileParams = { /** * Absolute path to read. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileResponse.ts index 075d126907ea..26b6126970fe 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsReadFileResponse.ts @@ -5,7 +5,7 @@ /** * Base64-encoded file contents returned by `fs/readFile`. */ -export type FsReadFileResponse = { +export type FsReadFileResponse = { /** * File contents encoded as base64. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsRemoveParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsRemoveParams.ts index c9f02eb0082d..c95b860acaca 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsRemoveParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsRemoveParams.ts @@ -6,15 +6,15 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; /** * Remove a file or directory tree from the host filesystem. */ -export type FsRemoveParams = { +export type FsRemoveParams = { /** * Absolute path to remove. */ -path: AbsolutePathBuf, +path: AbsolutePathBuf, /** * Whether directory removal should recurse. Defaults to `true`. */ -recursive?: boolean | null, +recursive?: boolean | null, /** * Whether missing paths should be ignored. Defaults to `true`. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsUnwatchParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsUnwatchParams.ts index 34b70a930756..ff314814f032 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsUnwatchParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsUnwatchParams.ts @@ -5,7 +5,7 @@ /** * Stop filesystem watch notifications for a prior `fs/watch`. */ -export type FsUnwatchParams = { +export type FsUnwatchParams = { /** * Watch identifier previously provided to `fs/watch`. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsWatchParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsWatchParams.ts index 60755538cb20..b990b8e0ec26 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsWatchParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsWatchParams.ts @@ -6,11 +6,11 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; /** * Start filesystem watch notifications for an absolute path. */ -export type FsWatchParams = { +export type FsWatchParams = { /** * Connection-scoped watch identifier used for `fs/unwatch` and `fs/changed`. */ -watchId: string, +watchId: string, /** * Absolute file or directory path to watch. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsWatchResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsWatchResponse.ts index b640306d8250..82e6c7e9b31d 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsWatchResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsWatchResponse.ts @@ -6,7 +6,7 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; /** * Successful response for `fs/watch`. */ -export type FsWatchResponse = { +export type FsWatchResponse = { /** * Canonicalized path associated with the watch. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/FsWriteFileParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/FsWriteFileParams.ts index 7c22abdb3a27..1e8672b52965 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/FsWriteFileParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/FsWriteFileParams.ts @@ -6,11 +6,11 @@ import type { AbsolutePathBuf } from "../AbsolutePathBuf"; /** * Write a file on the host filesystem. */ -export type FsWriteFileParams = { +export type FsWriteFileParams = { /** * Absolute path to write. */ -path: AbsolutePathBuf, +path: AbsolutePathBuf, /** * File contents encoded as base64. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountParams.ts index efc646d16dd9..a5c5c25f6647 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountParams.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type GetAccountParams = { +export type GetAccountParams = { /** * When `true`, requests a proactive token refresh before returning. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountRateLimitsResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountRateLimitsResponse.ts index e75e9b8283cb..02cc77793436 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountRateLimitsResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/GetAccountRateLimitsResponse.ts @@ -3,11 +3,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { RateLimitSnapshot } from "./RateLimitSnapshot"; -export type GetAccountRateLimitsResponse = { +export type GetAccountRateLimitsResponse = { /** * Backward-compatible single-bucket view; mirrors the historical payload. */ -rateLimits: RateLimitSnapshot, +rateLimits: RateLimitSnapshot, /** * Multi-bucket view keyed by metered `limit_id` (for example, `codex`). */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ItemGuardianApprovalReviewCompletedNotification.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ItemGuardianApprovalReviewCompletedNotification.ts index a345e3d655ad..f5114ab67593 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ItemGuardianApprovalReviewCompletedNotification.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ItemGuardianApprovalReviewCompletedNotification.ts @@ -9,11 +9,11 @@ import type { GuardianApprovalReviewAction } from "./GuardianApprovalReviewActio * [UNSTABLE] Temporary notification payload for guardian automatic approval * review. This shape is expected to change soon. */ -export type ItemGuardianApprovalReviewCompletedNotification = { threadId: string, turnId: string, +export type ItemGuardianApprovalReviewCompletedNotification = { threadId: string, turnId: string, /** * Stable identifier for this review. */ -reviewId: string, +reviewId: string, /** * Identifier for the reviewed item or tool call when one exists. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ItemGuardianApprovalReviewStartedNotification.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ItemGuardianApprovalReviewStartedNotification.ts index f917aa3ee7e6..e2330610a517 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ItemGuardianApprovalReviewStartedNotification.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ItemGuardianApprovalReviewStartedNotification.ts @@ -8,11 +8,11 @@ import type { GuardianApprovalReviewAction } from "./GuardianApprovalReviewActio * [UNSTABLE] Temporary notification payload for guardian automatic approval * review. This shape is expected to change soon. */ -export type ItemGuardianApprovalReviewStartedNotification = { threadId: string, turnId: string, +export type ItemGuardianApprovalReviewStartedNotification = { threadId: string, turnId: string, /** * Stable identifier for this review. */ -reviewId: string, +reviewId: string, /** * Identifier for the reviewed item or tool call when one exists. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ListMcpServerStatusParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ListMcpServerStatusParams.ts index 8225c462b1c3..fa00b8ea0101 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ListMcpServerStatusParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ListMcpServerStatusParams.ts @@ -3,15 +3,15 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { McpServerStatusDetail } from "./McpServerStatusDetail"; -export type ListMcpServerStatusParams = { +export type ListMcpServerStatusParams = { /** * Opaque pagination cursor returned by a previous call. */ -cursor?: string | null, +cursor?: string | null, /** * Optional page size; defaults to a server-defined value. */ -limit?: number | null, +limit?: number | null, /** * Controls how much MCP inventory data to fetch for each server. * Defaults to `Full` when omitted. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ListMcpServerStatusResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ListMcpServerStatusResponse.ts index 35a92bdcb961..18696ed89007 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ListMcpServerStatusResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ListMcpServerStatusResponse.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { McpServerStatus } from "./McpServerStatus"; -export type ListMcpServerStatusResponse = { data: Array, +export type ListMcpServerStatusResponse = { data: Array, /** * Opaque cursor to pass to the next call to continue after the last item. * If None, there are no more items to return. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/LoginAccountParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/LoginAccountParams.ts index 9fcb01f97cc6..4831a6b2ded2 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/LoginAccountParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/LoginAccountParams.ts @@ -2,16 +2,16 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type LoginAccountParams = { "type": "apiKey", apiKey: string, } | { "type": "chatgpt" } | { "type": "chatgptDeviceCode" } | { "type": "chatgptAuthTokens", +export type LoginAccountParams = { "type": "apiKey", apiKey: string, } | { "type": "chatgpt" } | { "type": "chatgptDeviceCode" } | { "type": "chatgptAuthTokens", /** * Access token (JWT) supplied by the client. * This token is used for backend API requests and email extraction. */ -accessToken: string, +accessToken: string, /** * Workspace/account identifier supplied by the client. */ -chatgptAccountId: string, +chatgptAccountId: string, /** * Optional plan type supplied by the client. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/LoginAccountResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/LoginAccountResponse.ts index 651f171e319b..34bccd6578e1 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/LoginAccountResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/LoginAccountResponse.ts @@ -2,15 +2,15 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type LoginAccountResponse = { "type": "apiKey", } | { "type": "chatgpt", loginId: string, +export type LoginAccountResponse = { "type": "apiKey", } | { "type": "chatgpt", loginId: string, /** * URL the client should open in a browser to initiate the OAuth flow. */ -authUrl: string, } | { "type": "chatgptDeviceCode", loginId: string, +authUrl: string, } | { "type": "chatgptDeviceCode", loginId: string, /** * URL the client should open in a browser to complete device code authorization. */ -verificationUrl: string, +verificationUrl: string, /** * One-time code the user must enter after signing in. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/McpServerElicitationRequestParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/McpServerElicitationRequestParams.ts index 13855adc3e3c..90d60f77c7b7 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/McpServerElicitationRequestParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/McpServerElicitationRequestParams.ts @@ -4,7 +4,7 @@ import type { JsonValue } from "../serde_json/JsonValue"; import type { McpElicitationSchema } from "./McpElicitationSchema"; -export type McpServerElicitationRequestParams = { threadId: string, +export type McpServerElicitationRequestParams = { threadId: string, /** * Active Codex turn when this elicitation was observed, if app-server could correlate one. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/McpServerElicitationRequestResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/McpServerElicitationRequestResponse.ts index 054ef23f4a12..a3d145744ea6 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/McpServerElicitationRequestResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/McpServerElicitationRequestResponse.ts @@ -4,13 +4,13 @@ import type { JsonValue } from "../serde_json/JsonValue"; import type { McpServerElicitationAction } from "./McpServerElicitationAction"; -export type McpServerElicitationRequestResponse = { action: McpServerElicitationAction, +export type McpServerElicitationRequestResponse = { action: McpServerElicitationAction, /** * Structured user input for accepted elicitations, mirroring RMCP `CreateElicitationResult`. * * This is nullable because decline/cancel responses have no content. */ -content: JsonValue | null, +content: JsonValue | null, /** * Optional client metadata for form-mode action handling. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/McpServerToolCallParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/McpServerToolCallParams.ts new file mode 100644 index 000000000000..046a3fdc28c0 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/v2/McpServerToolCallParams.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 { JsonValue } from "../serde_json/JsonValue"; + +export type McpServerToolCallParams = { threadId: string, server: string, tool: string, arguments?: JsonValue, _meta?: JsonValue, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/McpServerToolCallResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/McpServerToolCallResponse.ts new file mode 100644 index 000000000000..fe14692ad263 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/v2/McpServerToolCallResponse.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 { JsonValue } from "../serde_json/JsonValue"; + +export type McpServerToolCallResponse = { content: Array, structuredContent?: JsonValue, isError?: boolean, _meta?: JsonValue, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ModelListParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ModelListParams.ts index a1e7b8fa74f2..dae406dd2dfd 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ModelListParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ModelListParams.ts @@ -2,15 +2,15 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ModelListParams = { +export type ModelListParams = { /** * Opaque pagination cursor returned by a previous call. */ -cursor?: string | null, +cursor?: string | null, /** * Optional page size; defaults to a reasonable server-side value. */ -limit?: number | null, +limit?: number | null, /** * When true, include models that are hidden from the default picker list. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ModelListResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ModelListResponse.ts index be5ba25dc875..b664b6c0774e 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ModelListResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ModelListResponse.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Model } from "./Model"; -export type ModelListResponse = { data: Array, +export type ModelListResponse = { data: Array, /** * Opaque cursor to pass to the next call to continue after the last item. * If None, there are no more items to return. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/NetworkRequirements.ts b/codex-rs/app-server-protocol/schema/typescript/v2/NetworkRequirements.ts index c685b9539c56..d1cd1ab29803 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/NetworkRequirements.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/NetworkRequirements.ts @@ -4,28 +4,28 @@ import type { NetworkDomainPermission } from "./NetworkDomainPermission"; import type { NetworkUnixSocketPermission } from "./NetworkUnixSocketPermission"; -export type NetworkRequirements = { enabled: boolean | null, httpPort: number | null, socksPort: number | null, allowUpstreamProxy: boolean | null, dangerouslyAllowNonLoopbackProxy: boolean | null, dangerouslyAllowAllUnixSockets: boolean | null, +export type NetworkRequirements = { enabled: boolean | null, httpPort: number | null, socksPort: number | null, allowUpstreamProxy: boolean | null, dangerouslyAllowNonLoopbackProxy: boolean | null, dangerouslyAllowAllUnixSockets: boolean | null, /** * Canonical network permission map for `experimental_network`. */ -domains: { [key in string]?: NetworkDomainPermission } | null, +domains: { [key in string]?: NetworkDomainPermission } | null, /** * When true, only managed allowlist entries are respected while managed * network enforcement is active. */ -managedAllowedDomainsOnly: boolean | null, +managedAllowedDomainsOnly: boolean | null, /** * Legacy compatibility view derived from `domains`. */ -allowedDomains: Array | null, +allowedDomains: Array | null, /** * Legacy compatibility view derived from `domains`. */ -deniedDomains: Array | null, +deniedDomains: Array | null, /** * Canonical unix socket permission map for `experimental_network`. */ -unixSockets: { [key in string]?: NetworkUnixSocketPermission } | null, +unixSockets: { [key in string]?: NetworkUnixSocketPermission } | null, /** * Legacy compatibility view derived from `unix_sockets`. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/PluginInstallParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/PluginInstallParams.ts index 190dee04c37a..9ac1c50c1e8e 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/PluginInstallParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/PluginInstallParams.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; -export type PluginInstallParams = { marketplacePath: AbsolutePathBuf, pluginName: string, +export type PluginInstallParams = { marketplacePath: AbsolutePathBuf, pluginName: string, /** * When true, apply the remote plugin change before the local install flow. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/PluginInterface.ts b/codex-rs/app-server-protocol/schema/typescript/v2/PluginInterface.ts index cea42d29e190..7e0a48aaecc4 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/PluginInterface.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/PluginInterface.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; -export type PluginInterface = { displayName: string | null, shortDescription: string | null, longDescription: string | null, developerName: string | null, category: string | null, capabilities: Array, websiteUrl: string | null, privacyPolicyUrl: string | null, termsOfServiceUrl: string | null, +export type PluginInterface = { displayName: string | null, shortDescription: string | null, longDescription: string | null, developerName: string | null, category: string | null, capabilities: Array, websiteUrl: string | null, privacyPolicyUrl: string | null, termsOfServiceUrl: string | null, /** * Starter prompts for the plugin. Capped at 3 entries with a maximum of * 128 characters per entry. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/PluginListParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/PluginListParams.ts index 07ecee5e5ffe..cd2a0cde1eb1 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/PluginListParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/PluginListParams.ts @@ -3,12 +3,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; -export type PluginListParams = { +export type PluginListParams = { /** * Optional working directories used to discover repo marketplaces. When omitted, * only home-scoped marketplaces and the official curated marketplace are considered. */ -cwds?: Array | null, +cwds?: Array | null, /** * When true, reconcile the official curated marketplace against the remote plugin state * before listing marketplaces. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/PluginUninstallParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/PluginUninstallParams.ts index b92a21c9bde0..aa1d1bfef95a 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/PluginUninstallParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/PluginUninstallParams.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type PluginUninstallParams = { pluginId: string, +export type PluginUninstallParams = { pluginId: string, /** * When true, apply the remote plugin change before the local uninstall flow. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ReviewStartParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ReviewStartParams.ts index 363e6dda37a2..9833e08a222a 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ReviewStartParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ReviewStartParams.ts @@ -4,7 +4,7 @@ import type { ReviewDelivery } from "./ReviewDelivery"; import type { ReviewTarget } from "./ReviewTarget"; -export type ReviewStartParams = { threadId: string, target: ReviewTarget, +export type ReviewStartParams = { threadId: string, target: ReviewTarget, /** * Where to run the review: inline (default) on the current thread or * detached on a new thread (returned in `reviewThreadId`). diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ReviewStartResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ReviewStartResponse.ts index 25eb6f82fe47..6d6c2bb74fa9 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ReviewStartResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ReviewStartResponse.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Turn } from "./Turn"; -export type ReviewStartResponse = { turn: Turn, +export type ReviewStartResponse = { turn: Turn, /** * Identifies the thread where the review runs. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ReviewTarget.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ReviewTarget.ts index a79f1e993cb7..a69b68c056c7 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ReviewTarget.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ReviewTarget.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ReviewTarget = { "type": "uncommittedChanges" } | { "type": "baseBranch", branch: string, } | { "type": "commit", sha: string, +export type ReviewTarget = { "type": "uncommittedChanges" } | { "type": "baseBranch", branch: string, } | { "type": "commit", sha: string, /** * Optional human-readable label (e.g., commit subject) for UIs. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/SkillMetadata.ts b/codex-rs/app-server-protocol/schema/typescript/v2/SkillMetadata.ts index 52c0cd494597..b620fffbdbbe 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/SkillMetadata.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/SkillMetadata.ts @@ -5,7 +5,7 @@ import type { SkillDependencies } from "./SkillDependencies"; import type { SkillInterface } from "./SkillInterface"; import type { SkillScope } from "./SkillScope"; -export type SkillMetadata = { name: string, description: string, +export type SkillMetadata = { name: string, description: string, /** * Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/SkillsConfigWriteParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/SkillsConfigWriteParams.ts index 273d593cfdc1..39192e075e0d 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/SkillsConfigWriteParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/SkillsConfigWriteParams.ts @@ -3,11 +3,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { AbsolutePathBuf } from "../AbsolutePathBuf"; -export type SkillsConfigWriteParams = { +export type SkillsConfigWriteParams = { /** * Path-based selector. */ -path?: AbsolutePathBuf | null, +path?: AbsolutePathBuf | null, /** * Name-based selector. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/SkillsListParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/SkillsListParams.ts index f58444381090..ad714a329787 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/SkillsListParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/SkillsListParams.ts @@ -3,15 +3,15 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { SkillsListExtraRootsForCwd } from "./SkillsListExtraRootsForCwd"; -export type SkillsListParams = { +export type SkillsListParams = { /** * When empty, defaults to the current session working directory. */ -cwds?: Array, +cwds?: Array, /** * When true, bypass the skills cache and re-scan skills from disk. */ -forceReload?: boolean, +forceReload?: boolean, /** * Optional per-cwd extra roots to scan as user-scoped skills. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/TextElement.ts b/codex-rs/app-server-protocol/schema/typescript/v2/TextElement.ts index 8841d004998d..535e0a1dde80 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/TextElement.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/TextElement.ts @@ -3,11 +3,11 @@ // 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 = { +export type TextElement = { /** * Byte range in the parent `text` buffer that this element occupies. */ -byteRange: ByteRange, +byteRange: ByteRange, /** * Optional human-readable placeholder for the element, displayed in the UI. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/TextPosition.ts b/codex-rs/app-server-protocol/schema/typescript/v2/TextPosition.ts index e0a6d11a01ba..0e6eeb13767f 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/TextPosition.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/TextPosition.ts @@ -2,11 +2,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type TextPosition = { +export type TextPosition = { /** * 1-based line number. */ -line: number, +line: number, /** * 1-based column number (in Unicode scalar values). */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/Thread.ts b/codex-rs/app-server-protocol/schema/typescript/v2/Thread.ts index 7a8bf4aca47b..57ef3c1075df 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/Thread.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/Thread.ts @@ -6,67 +6,67 @@ import type { SessionSource } from "./SessionSource"; import type { ThreadStatus } from "./ThreadStatus"; import type { Turn } from "./Turn"; -export type Thread = { id: string, +export type Thread = { id: string, /** * Source thread id when this thread was created by forking another thread. */ -forkedFromId: string | null, +forkedFromId: string | null, /** * Usually the first user message in the thread, if available. */ -preview: string, +preview: string, /** * Whether the thread is ephemeral and should not be materialized on disk. */ -ephemeral: boolean, +ephemeral: boolean, /** * Model provider used for this thread (for example, 'openai'). */ -modelProvider: string, +modelProvider: string, /** * Unix timestamp (in seconds) when the thread was created. */ -createdAt: number, +createdAt: number, /** * Unix timestamp (in seconds) when the thread was last updated. */ -updatedAt: number, +updatedAt: number, /** * Current runtime status for the thread. */ -status: ThreadStatus, +status: ThreadStatus, /** * [UNSTABLE] Path to the thread on disk. */ -path: string | null, +path: string | null, /** * Working directory captured for the thread. */ -cwd: string, +cwd: string, /** * Version of the CLI that created the thread. */ -cliVersion: string, +cliVersion: string, /** * Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.). */ -source: SessionSource, +source: SessionSource, /** * Optional random unique nickname assigned to an AgentControl-spawned sub-agent. */ -agentNickname: string | null, +agentNickname: string | null, /** * Optional role (agent_role) assigned to an AgentControl-spawned sub-agent. */ -agentRole: string | null, +agentRole: string | null, /** * Optional Git metadata captured when the thread was created. */ -gitInfo: GitInfo | null, +gitInfo: GitInfo | null, /** * Optional user-facing thread title. */ -name: string | null, +name: string | null, /** * Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` * (when `includeTurns` is true) responses. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadForkResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadForkResponse.ts index 00dade9f1f41..5e9d460a9aeb 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadForkResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadForkResponse.ts @@ -8,7 +8,7 @@ import type { AskForApproval } from "./AskForApproval"; import type { SandboxPolicy } from "./SandboxPolicy"; import type { Thread } from "./Thread"; -export type ThreadForkResponse = { thread: Thread, model: string, modelProvider: string, serviceTier: ServiceTier | null, cwd: string, approvalPolicy: AskForApproval, +export type ThreadForkResponse = { thread: Thread, model: string, modelProvider: string, serviceTier: ServiceTier | null, cwd: string, approvalPolicy: AskForApproval, /** * Reviewer currently used for approval requests on this thread. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts index 9202f3728f05..54d3eaaa8b8a 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts @@ -22,78 +22,78 @@ import type { PatchApplyStatus } from "./PatchApplyStatus"; import type { UserInput } from "./UserInput"; import type { WebSearchAction } from "./WebSearchAction"; -export type ThreadItem = { "type": "userMessage", id: string, content: Array, } | { "type": "hookPrompt", id: string, fragments: Array, } | { "type": "agentMessage", id: string, text: string, phase: MessagePhase | null, memoryCitation: MemoryCitation | null, } | { "type": "plan", id: string, text: string, } | { "type": "reasoning", id: string, summary: Array, content: Array, } | { "type": "commandExecution", id: string, +export type ThreadItem = { "type": "userMessage", id: string, content: Array, } | { "type": "hookPrompt", id: string, fragments: Array, } | { "type": "agentMessage", id: string, text: string, phase: MessagePhase | null, memoryCitation: MemoryCitation | null, } | { "type": "plan", id: string, text: string, } | { "type": "reasoning", id: string, summary: Array, content: Array, } | { "type": "commandExecution", id: string, /** * The command to be executed. */ -command: string, +command: string, /** * The command's working directory. */ -cwd: string, +cwd: string, /** * Identifier for the underlying PTY process (when available). */ -processId: string | null, source: CommandExecutionSource, status: CommandExecutionStatus, +processId: string | null, source: CommandExecutionSource, status: CommandExecutionStatus, /** * A best-effort parsing of the command to understand the action(s) it will perform. * This returns a list of CommandAction objects because a single shell command may * be composed of many commands piped together. */ -commandActions: Array, +commandActions: Array, /** * The command's output, aggregated from stdout and stderr. */ -aggregatedOutput: string | null, +aggregatedOutput: string | null, /** * The command's exit code. */ -exitCode: number | null, +exitCode: number | null, /** * The duration of the command execution in milliseconds. */ -durationMs: number | null, } | { "type": "fileChange", id: string, changes: Array, status: PatchApplyStatus, } | { "type": "mcpToolCall", id: string, server: string, tool: string, status: McpToolCallStatus, arguments: JsonValue, result: McpToolCallResult | null, error: McpToolCallError | null, +durationMs: number | null, } | { "type": "fileChange", id: string, changes: Array, status: PatchApplyStatus, } | { "type": "mcpToolCall", id: string, server: string, tool: string, status: McpToolCallStatus, arguments: JsonValue, result: McpToolCallResult | null, error: McpToolCallError | null, /** * The duration of the MCP tool call in milliseconds. */ -durationMs: number | null, } | { "type": "dynamicToolCall", id: string, tool: string, arguments: JsonValue, status: DynamicToolCallStatus, contentItems: Array | null, success: boolean | null, +durationMs: number | null, } | { "type": "dynamicToolCall", id: string, tool: string, arguments: JsonValue, status: DynamicToolCallStatus, contentItems: Array | null, success: boolean | null, /** * The duration of the dynamic tool call in milliseconds. */ -durationMs: number | null, } | { "type": "collabAgentToolCall", +durationMs: number | null, } | { "type": "collabAgentToolCall", /** * Unique identifier for this collab tool call. */ -id: string, +id: string, /** * Name of the collab tool that was invoked. */ -tool: CollabAgentTool, +tool: CollabAgentTool, /** * Current status of the collab tool call. */ -status: CollabAgentToolCallStatus, +status: CollabAgentToolCallStatus, /** * Thread ID of the agent issuing the collab request. */ -senderThreadId: string, +senderThreadId: string, /** * Thread ID of the receiving agent, when applicable. In case of spawn operation, * this corresponds to the newly spawned agent. */ -receiverThreadIds: Array, +receiverThreadIds: Array, /** * Prompt text sent as part of the collab tool call, when available. */ -prompt: string | null, +prompt: string | null, /** * Model requested for the spawned agent, when applicable. */ -model: string | null, +model: string | null, /** * Reasoning effort requested for the spawned agent, when applicable. */ -reasoningEffort: ReasoningEffort | null, +reasoningEffort: ReasoningEffort | null, /** * Last known status of the target agents, when available. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListParams.ts index ea14ec3d45b6..87857b7f73e4 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListParams.ts @@ -4,39 +4,39 @@ import type { ThreadSortKey } from "./ThreadSortKey"; import type { ThreadSourceKind } from "./ThreadSourceKind"; -export type ThreadListParams = { +export type ThreadListParams = { /** * Opaque pagination cursor returned by a previous call. */ -cursor?: string | null, +cursor?: string | null, /** * Optional page size; defaults to a reasonable server-side value. */ -limit?: number | null, +limit?: number | null, /** * Optional sort key; defaults to created_at. */ -sortKey?: ThreadSortKey | null, +sortKey?: ThreadSortKey | null, /** * Optional provider filter; when set, only sessions recorded under these * providers are returned. When present but empty, includes all providers. */ -modelProviders?: Array | null, +modelProviders?: Array | null, /** * Optional source filter; when set, only sessions from these source kinds * are returned. When omitted or empty, defaults to interactive sources. */ -sourceKinds?: Array | null, +sourceKinds?: Array | null, /** * Optional archived filter; when set to true, only archived threads are returned. * If false or null, only non-archived threads are returned. */ -archived?: boolean | null, +archived?: boolean | null, /** * Optional cwd filter; when set, only threads whose session cwd exactly * matches this path are returned. */ -cwd?: string | null, +cwd?: string | null, /** * Optional substring filter for the extracted thread title. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListResponse.ts index 3c0296e5e0eb..3e4d4f57a4d1 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadListResponse.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Thread } from "./Thread"; -export type ThreadListResponse = { data: Array, +export type ThreadListResponse = { data: Array, /** * Opaque cursor to pass to the next call to continue after the last item. * if None, there are no more items to return. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadLoadedListParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadLoadedListParams.ts index ef1e0ac0850c..a7889e4f09a7 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadLoadedListParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadLoadedListParams.ts @@ -2,11 +2,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ThreadLoadedListParams = { +export type ThreadLoadedListParams = { /** * Opaque pagination cursor returned by a previous call. */ -cursor?: string | null, +cursor?: string | null, /** * Optional page size; defaults to no limit. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadLoadedListResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadLoadedListResponse.ts index d215a45d01f0..21a48c37e9f9 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadLoadedListResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadLoadedListResponse.ts @@ -2,11 +2,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ThreadLoadedListResponse = { +export type ThreadLoadedListResponse = { /** * Thread ids for sessions currently loaded in memory. */ -data: Array, +data: Array, /** * Opaque cursor to pass to the next call to continue after the last item. * if None, there are no more items to return. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadMetadataGitInfoUpdateParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadMetadataGitInfoUpdateParams.ts index 7424ae36066b..865b53462253 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadMetadataGitInfoUpdateParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadMetadataGitInfoUpdateParams.ts @@ -2,17 +2,17 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ThreadMetadataGitInfoUpdateParams = { +export type ThreadMetadataGitInfoUpdateParams = { /** * Omit to leave the stored commit unchanged, set to `null` to clear it, * or provide a non-empty string to replace it. */ -sha?: string | null, +sha?: string | null, /** * Omit to leave the stored branch unchanged, set to `null` to clear it, * or provide a non-empty string to replace it. */ -branch?: string | null, +branch?: string | null, /** * Omit to leave the stored origin URL unchanged, set to `null` to clear it, * or provide a non-empty string to replace it. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadMetadataUpdateParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadMetadataUpdateParams.ts index 5b6eb8a05f9a..bec4bc1284d0 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadMetadataUpdateParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadMetadataUpdateParams.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ThreadMetadataGitInfoUpdateParams } from "./ThreadMetadataGitInfoUpdateParams"; -export type ThreadMetadataUpdateParams = { threadId: string, +export type ThreadMetadataUpdateParams = { threadId: string, /** * Patch the stored Git metadata for this thread. * Omit a field to leave it unchanged, set it to `null` to clear it, or diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadReadParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadReadParams.ts index b274d1e774c2..64169d2bf665 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadReadParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadReadParams.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ThreadReadParams = { threadId: string, +export type ThreadReadParams = { threadId: string, /** * When true, include turns and their items from rollout history. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRealtimeStartTransport.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRealtimeStartTransport.ts index e6450a6690d6..339e1b1b17a4 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRealtimeStartTransport.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRealtimeStartTransport.ts @@ -5,7 +5,7 @@ /** * EXPERIMENTAL - transport used by thread realtime. */ -export type ThreadRealtimeStartTransport = { "type": "websocket" } | { "type": "webrtc", +export type ThreadRealtimeStartTransport = { "type": "websocket" } | { "type": "webrtc", /** * SDP offer generated by a WebRTC RTCPeerConnection after configuring audio and the * realtime events data channel. diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadResumeResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadResumeResponse.ts index ba70bd8f57b4..9c7ec4527b6c 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadResumeResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadResumeResponse.ts @@ -8,7 +8,7 @@ import type { AskForApproval } from "./AskForApproval"; import type { SandboxPolicy } from "./SandboxPolicy"; import type { Thread } from "./Thread"; -export type ThreadResumeResponse = { thread: Thread, model: string, modelProvider: string, serviceTier: ServiceTier | null, cwd: string, approvalPolicy: AskForApproval, +export type ThreadResumeResponse = { thread: Thread, model: string, modelProvider: string, serviceTier: ServiceTier | null, cwd: string, approvalPolicy: AskForApproval, /** * Reviewer currently used for approval requests on this thread. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRollbackParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRollbackParams.ts index b86797820223..1c938e3bfdf7 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRollbackParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRollbackParams.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ThreadRollbackParams = { threadId: string, +export type ThreadRollbackParams = { threadId: string, /** * The number of turns to drop from the end of the thread. Must be >= 1. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRollbackResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRollbackResponse.ts index 1f88f1763079..6597cc817884 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRollbackResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadRollbackResponse.ts @@ -3,7 +3,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Thread } from "./Thread"; -export type ThreadRollbackResponse = { +export type ThreadRollbackResponse = { /** * The updated thread after applying the rollback, with `turns` populated. * diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadShellCommandParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadShellCommandParams.ts index 8c50612cabe3..2761dee2d0ba 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadShellCommandParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadShellCommandParams.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ThreadShellCommandParams = { threadId: string, +export type ThreadShellCommandParams = { threadId: string, /** * Shell command string evaluated by the thread's configured shell. * Unlike `command/exec`, this intentionally preserves shell syntax diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadStartResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadStartResponse.ts index ee97bdf401a8..c85f81f52bdb 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadStartResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadStartResponse.ts @@ -8,7 +8,7 @@ import type { AskForApproval } from "./AskForApproval"; import type { SandboxPolicy } from "./SandboxPolicy"; import type { Thread } from "./Thread"; -export type ThreadStartResponse = { thread: Thread, model: string, modelProvider: string, serviceTier: ServiceTier | null, cwd: string, approvalPolicy: AskForApproval, +export type ThreadStartResponse = { thread: Thread, model: string, modelProvider: string, serviceTier: ServiceTier | null, cwd: string, approvalPolicy: AskForApproval, /** * Reviewer currently used for approval requests on this thread. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/Turn.ts b/codex-rs/app-server-protocol/schema/typescript/v2/Turn.ts index 074ac215fd3a..844c09c4fd19 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/Turn.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/Turn.ts @@ -5,25 +5,25 @@ import type { ThreadItem } from "./ThreadItem"; import type { TurnError } from "./TurnError"; import type { TurnStatus } from "./TurnStatus"; -export type Turn = { id: string, +export type Turn = { id: string, /** * Only populated on a `thread/resume` or `thread/fork` response. * For all other responses and notifications returning a Turn, * the items field will be an empty list. */ -items: Array, status: TurnStatus, +items: Array, status: TurnStatus, /** * Only populated when the Turn's status is failed. */ -error: TurnError | null, +error: TurnError | null, /** * Unix timestamp (in seconds) when the turn started. */ -startedAt: number | null, +startedAt: number | null, /** * Unix timestamp (in seconds) when the turn completed. */ -completedAt: number | null, +completedAt: number | null, /** * Duration between turn start and completion in milliseconds, if known. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/UserInput.ts b/codex-rs/app-server-protocol/schema/typescript/v2/UserInput.ts index 65196fe5d98c..38abc2338bcc 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/UserInput.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/UserInput.ts @@ -3,7 +3,7 @@ // 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, +export type UserInput = { "type": "text", text: string, /** * UI-defined spans within `text` used to render or persist special elements. */ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/index.ts b/codex-rs/app-server-protocol/schema/typescript/v2/index.ts index 7803355794d8..f815fee3e9d3 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/index.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/index.ts @@ -187,6 +187,8 @@ export type { McpServerStartupState } from "./McpServerStartupState"; export type { McpServerStatus } from "./McpServerStatus"; export type { McpServerStatusDetail } from "./McpServerStatusDetail"; export type { McpServerStatusUpdatedNotification } from "./McpServerStatusUpdatedNotification"; +export type { McpServerToolCallParams } from "./McpServerToolCallParams"; +export type { McpServerToolCallResponse } from "./McpServerToolCallResponse"; export type { McpToolCallError } from "./McpToolCallError"; export type { McpToolCallProgressNotification } from "./McpToolCallProgressNotification"; export type { McpToolCallResult } from "./McpToolCallResult"; diff --git a/codex-rs/app-server-protocol/src/export.rs b/codex-rs/app-server-protocol/src/export.rs index 358bb5c2df60..96bb8d17a973 100644 --- a/codex-rs/app-server-protocol/src/export.rs +++ b/codex-rs/app-server-protocol/src/export.rs @@ -129,12 +129,7 @@ pub fn generate_ts_with_options( } // Ensure our header is present on all TS files (root + subdirs like v2/). - let mut ts_files = Vec::new(); - let should_collect_ts_files = - options.ensure_headers || (options.run_prettier && prettier.is_some()); - if should_collect_ts_files { - ts_files = ts_files_in_recursive(out_dir)?; - } + let ts_files = ts_files_in_recursive(out_dir)?; if options.ensure_headers { let worker_count = thread::available_parallelism() @@ -179,6 +174,8 @@ pub fn generate_ts_with_options( } } + trim_trailing_whitespace_in_ts_files(&ts_files)?; + Ok(()) } @@ -1942,6 +1939,32 @@ fn ts_files_in_recursive(dir: &Path) -> Result> { Ok(files) } +fn trim_trailing_whitespace_in_ts_files(paths: &[PathBuf]) -> Result<()> { + for path in paths { + let content = fs::read_to_string(path) + .with_context(|| format!("Failed to read {}", path.display()))?; + let trimmed = trim_trailing_line_whitespace(&content); + if trimmed != content { + fs::write(path, trimmed) + .with_context(|| format!("Failed to write {}", path.display()))?; + } + } + Ok(()) +} + +pub(crate) fn trim_trailing_line_whitespace(content: &str) -> String { + let mut trimmed = String::with_capacity(content.len()); + for line in content.split_inclusive('\n') { + if let Some(line_without_newline) = line.strip_suffix('\n') { + trimmed.push_str(line_without_newline.trim_end_matches([' ', '\t'])); + trimmed.push('\n'); + } else { + trimmed.push_str(line.trim_end_matches([' ', '\t'])); + } + } + trimmed +} + /// Generate an index.ts file that re-exports all generated types. /// This allows consumers to import all types from a single file. fn generate_index_ts(out_dir: &Path) -> Result { diff --git a/codex-rs/app-server-protocol/src/protocol/common.rs b/codex-rs/app-server-protocol/src/protocol/common.rs index 731288272b1d..3f9ba7bfdf6a 100644 --- a/codex-rs/app-server-protocol/src/protocol/common.rs +++ b/codex-rs/app-server-protocol/src/protocol/common.rs @@ -470,6 +470,11 @@ client_request_definitions! { response: v2::McpResourceReadResponse, }, + McpServerToolCall => "mcpServer/tool/call" { + params: v2::McpServerToolCallParams, + response: v2::McpServerToolCallResponse, + }, + WindowsSandboxSetupStart => "windowsSandbox/setupStart" { params: v2::WindowsSandboxSetupStartParams, response: v2::WindowsSandboxSetupStartResponse, diff --git a/codex-rs/app-server-protocol/src/protocol/v2.rs b/codex-rs/app-server-protocol/src/protocol/v2.rs index d0a280ff8b19..e562981f0a72 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -29,6 +29,7 @@ use codex_protocol::config_types::WebSearchMode; use codex_protocol::config_types::WebSearchToolConfig; use codex_protocol::items::AgentMessageContent as CoreAgentMessageContent; use codex_protocol::items::TurnItem as CoreTurnItem; +use codex_protocol::mcp::CallToolResult as CoreMcpCallToolResult; use codex_protocol::mcp::Resource as McpResource; pub use codex_protocol::mcp::ResourceContent as McpResourceContent; use codex_protocol::mcp::ResourceTemplate as McpResourceTemplate; @@ -2017,6 +2018,48 @@ pub struct McpResourceReadResponse { pub contents: Vec, } +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "v2/")] +pub struct McpServerToolCallParams { + pub thread_id: String, + pub server: String, + pub tool: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub arguments: Option, + #[serde(rename = "_meta", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub meta: Option, +} + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] +#[serde(rename_all = "camelCase")] +#[ts(export_to = "v2/")] +pub struct McpServerToolCallResponse { + pub content: Vec, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub structured_content: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub is_error: Option, + #[serde(rename = "_meta", default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] + pub meta: Option, +} + +impl From for McpServerToolCallResponse { + fn from(result: CoreMcpCallToolResult) -> Self { + Self { + content: result.content, + structured_content: result.structured_content, + is_error: result.is_error, + meta: result.meta, + } + } +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default, JsonSchema, TS)] #[serde(rename_all = "camelCase")] #[ts(export_to = "v2/")] diff --git a/codex-rs/app-server-protocol/src/schema_fixtures.rs b/codex-rs/app-server-protocol/src/schema_fixtures.rs index 56dcf33a4d48..447fcf8cfe3a 100644 --- a/codex-rs/app-server-protocol/src/schema_fixtures.rs +++ b/codex-rs/app-server-protocol/src/schema_fixtures.rs @@ -5,6 +5,7 @@ use crate::ServerRequest; use crate::export::GENERATED_TS_HEADER; use crate::export::filter_experimental_ts_tree; use crate::export::generate_index_ts_tree; +use crate::export::trim_trailing_line_whitespace; use crate::protocol::common::visit_client_response_types; use crate::protocol::common::visit_server_response_types; use anyhow::Context; @@ -68,6 +69,9 @@ pub fn generate_typescript_schema_fixture_subtree_for_tests() -> Result { + self.call_mcp_server_tool(to_connection_request_id(request_id), params) + .await; + } ClientRequest::WindowsSandboxSetupStart { request_id, params } => { self.windows_sandbox_setup_start(to_connection_request_id(request_id), params) .await; @@ -5350,6 +5356,46 @@ impl CodexMessageProcessor { }); } + async fn call_mcp_server_tool( + &self, + request_id: ConnectionRequestId, + params: McpServerToolCallParams, + ) { + let outgoing = Arc::clone(&self.outgoing); + let (_, thread) = match self.load_thread(¶ms.thread_id).await { + Ok(thread) => thread, + Err(error) => { + self.outgoing.send_error(request_id, error).await; + return; + } + }; + + tokio::spawn(async move { + let result = thread + .call_mcp_tool(¶ms.server, ¶ms.tool, params.arguments, params.meta) + .await; + match result { + Ok(result) => { + outgoing + .send_response(request_id, McpServerToolCallResponse::from(result)) + .await; + } + Err(error) => { + outgoing + .send_error( + request_id, + JSONRPCErrorError { + code: INTERNAL_ERROR_CODE, + message: format!("{error:#}"), + data: None, + }, + ) + .await; + } + } + }); + } + async fn send_invalid_request_error(&self, request_id: ConnectionRequestId, message: String) { let error = JSONRPCErrorError { code: INVALID_REQUEST_ERROR_CODE, diff --git a/codex-rs/app-server/tests/common/mcp_process.rs b/codex-rs/app-server/tests/common/mcp_process.rs index 03c2284b8419..76bb7bff4346 100644 --- a/codex-rs/app-server/tests/common/mcp_process.rs +++ b/codex-rs/app-server/tests/common/mcp_process.rs @@ -48,6 +48,7 @@ use codex_app_server_protocol::JSONRPCResponse; use codex_app_server_protocol::ListMcpServerStatusParams; use codex_app_server_protocol::LoginAccountParams; use codex_app_server_protocol::McpResourceReadParams; +use codex_app_server_protocol::McpServerToolCallParams; use codex_app_server_protocol::MockExperimentalMethodParams; use codex_app_server_protocol::ModelListParams; use codex_app_server_protocol::PluginInstallParams; @@ -493,6 +494,15 @@ impl McpProcess { self.send_request("mcpServer/resource/read", params).await } + /// Send an `mcpServer/tool/call` JSON-RPC request. + pub async fn send_mcp_server_tool_call_request( + &mut self, + params: McpServerToolCallParams, + ) -> anyhow::Result { + let params = Some(serde_json::to_value(params)?); + self.send_request("mcpServer/tool/call", params).await + } + /// Send a `skills/list` JSON-RPC request. pub async fn send_skills_list_request( &mut self, diff --git a/codex-rs/app-server/tests/suite/v2/mcp_tool.rs b/codex-rs/app-server/tests/suite/v2/mcp_tool.rs new file mode 100644 index 000000000000..87556c83646c --- /dev/null +++ b/codex-rs/app-server/tests/suite/v2/mcp_tool.rs @@ -0,0 +1,243 @@ +use std::borrow::Cow; +use std::collections::BTreeMap; +use std::sync::Arc; +use std::time::Duration; + +use anyhow::Result; +use app_test_support::McpProcess; +use app_test_support::to_response; +use app_test_support::write_mock_responses_config_toml; +use axum::Router; +use codex_app_server_protocol::JSONRPCError; +use codex_app_server_protocol::JSONRPCResponse; +use codex_app_server_protocol::McpServerToolCallParams; +use codex_app_server_protocol::McpServerToolCallResponse; +use codex_app_server_protocol::RequestId; +use codex_app_server_protocol::ThreadStartParams; +use codex_app_server_protocol::ThreadStartResponse; +use core_test_support::responses; +use pretty_assertions::assert_eq; +use rmcp::handler::server::ServerHandler; +use rmcp::model::CallToolRequestParams; +use rmcp::model::CallToolResult; +use rmcp::model::Content; +use rmcp::model::JsonObject; +use rmcp::model::ListToolsResult; +use rmcp::model::Meta; +use rmcp::model::ServerCapabilities; +use rmcp::model::ServerInfo; +use rmcp::model::Tool; +use rmcp::model::ToolAnnotations; +use rmcp::service::RequestContext; +use rmcp::service::RoleServer; +use rmcp::transport::StreamableHttpServerConfig; +use rmcp::transport::StreamableHttpService; +use rmcp::transport::streamable_http_server::session::local::LocalSessionManager; +use serde_json::json; +use tempfile::TempDir; +use tokio::net::TcpListener; +use tokio::task::JoinHandle; +use tokio::time::timeout; + +const DEFAULT_READ_TIMEOUT: Duration = Duration::from_secs(10); +const TEST_SERVER_NAME: &str = "tool_server"; +const TEST_TOOL_NAME: &str = "echo_tool"; + +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn mcp_server_tool_call_returns_tool_result() -> Result<()> { + let responses_server = responses::start_mock_server().await; + let (mcp_server_url, mcp_server_handle) = start_mcp_server().await?; + let codex_home = TempDir::new()?; + write_mock_responses_config_toml( + codex_home.path(), + &responses_server.uri(), + &BTreeMap::new(), + /*auto_compact_limit*/ 1024, + /*requires_openai_auth*/ None, + "mock_provider", + "compact", + )?; + + let config_path = codex_home.path().join("config.toml"); + let mut config_toml = std::fs::read_to_string(&config_path)?; + config_toml.push_str(&format!( + r#" +[mcp_servers.{TEST_SERVER_NAME}] +url = "{mcp_server_url}/mcp" +"# + )); + std::fs::write(config_path, config_toml)?; + + let mut mcp = McpProcess::new(codex_home.path()).await?; + timeout(DEFAULT_READ_TIMEOUT, mcp.initialize()).await??; + + let thread_start_id = mcp + .send_thread_start_request(ThreadStartParams { + model: Some("mock-model".to_string()), + ..Default::default() + }) + .await?; + let thread_start_resp: JSONRPCResponse = timeout( + DEFAULT_READ_TIMEOUT, + mcp.read_stream_until_response_message(RequestId::Integer(thread_start_id)), + ) + .await??; + let ThreadStartResponse { thread, .. } = to_response(thread_start_resp)?; + + let tool_call_request_id = mcp + .send_mcp_server_tool_call_request(McpServerToolCallParams { + thread_id: thread.id, + server: TEST_SERVER_NAME.to_string(), + tool: TEST_TOOL_NAME.to_string(), + arguments: Some(json!({ + "message": "hello from app", + })), + meta: Some(json!({ + "source": "mcp-app", + })), + }) + .await?; + let tool_call_response: JSONRPCResponse = timeout( + DEFAULT_READ_TIMEOUT, + mcp.read_stream_until_response_message(RequestId::Integer(tool_call_request_id)), + ) + .await??; + let response: McpServerToolCallResponse = to_response(tool_call_response)?; + + assert_eq!(response.content.len(), 1); + assert_eq!(response.content[0].get("type"), Some(&json!("text"))); + assert_eq!( + response.content[0].get("text"), + Some(&json!("echo: hello from app")) + ); + assert_eq!( + response.structured_content, + Some(json!({ + "echoed": "hello from app", + })) + ); + assert_eq!(response.is_error, Some(false)); + assert_eq!( + response.meta, + Some(json!({ + "calledBy": "mcp-app", + })) + ); + + mcp_server_handle.abort(); + let _ = mcp_server_handle.await; + + Ok(()) +} + +#[tokio::test] +async fn mcp_server_tool_call_returns_error_for_unknown_thread() -> Result<()> { + let codex_home = TempDir::new()?; + let mut mcp = McpProcess::new(codex_home.path()).await?; + timeout(DEFAULT_READ_TIMEOUT, mcp.initialize()).await??; + + let request_id = mcp + .send_mcp_server_tool_call_request(McpServerToolCallParams { + thread_id: "00000000-0000-4000-8000-000000000000".to_string(), + server: TEST_SERVER_NAME.to_string(), + tool: TEST_TOOL_NAME.to_string(), + arguments: Some(json!({})), + meta: None, + }) + .await?; + let error: JSONRPCError = timeout( + DEFAULT_READ_TIMEOUT, + mcp.read_stream_until_error_message(RequestId::Integer(request_id)), + ) + .await??; + + assert!( + error.error.message.contains("thread not found"), + "expected thread-not-found error, got: {error:?}" + ); + + Ok(()) +} + +#[derive(Clone, Default)] +struct ToolAppsMcpServer; + +impl ServerHandler for ToolAppsMcpServer { + fn get_info(&self) -> ServerInfo { + ServerInfo { + capabilities: ServerCapabilities::builder().enable_tools().build(), + ..ServerInfo::default() + } + } + + async fn list_tools( + &self, + _request: Option, + _context: RequestContext, + ) -> Result { + let input_schema: JsonObject = serde_json::from_value(json!({ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "additionalProperties": false + })) + .map_err(|err| rmcp::ErrorData::internal_error(err.to_string(), None))?; + + let mut tool = Tool::new( + Cow::Borrowed(TEST_TOOL_NAME), + Cow::Borrowed("Echo a message."), + Arc::new(input_schema), + ); + tool.annotations = Some(ToolAnnotations::new().read_only(true)); + + Ok(ListToolsResult { + tools: vec![tool], + next_cursor: None, + meta: None, + }) + } + + async fn call_tool( + &self, + request: CallToolRequestParams, + _context: RequestContext, + ) -> Result { + assert_eq!(request.name.as_ref(), TEST_TOOL_NAME); + let message = request + .arguments + .as_ref() + .and_then(|arguments| arguments.get("message")) + .and_then(|value| value.as_str()) + .unwrap_or_default(); + + let mut meta = Meta::new(); + meta.0.insert("calledBy".to_string(), json!("mcp-app")); + + let mut result = CallToolResult::structured(json!({ + "echoed": message, + })); + result.content = vec![Content::text(format!("echo: {message}"))]; + result.meta = Some(meta); + Ok(result) + } +} + +async fn start_mcp_server() -> Result<(String, JoinHandle<()>)> { + let listener = TcpListener::bind("127.0.0.1:0").await?; + let addr = listener.local_addr()?; + let mcp_service = StreamableHttpService::new( + || Ok(ToolAppsMcpServer), + Arc::new(LocalSessionManager::default()), + StreamableHttpServerConfig::default(), + ); + let router = Router::new().nest_service("/mcp", mcp_service); + + let handle = tokio::spawn(async move { + let _ = axum::serve(listener, router).await; + }); + + Ok((format!("http://{addr}"), handle)) +} diff --git a/codex-rs/app-server/tests/suite/v2/mod.rs b/codex-rs/app-server/tests/suite/v2/mod.rs index 1bb74ccc6b50..db82c1368f09 100644 --- a/codex-rs/app-server/tests/suite/v2/mod.rs +++ b/codex-rs/app-server/tests/suite/v2/mod.rs @@ -18,6 +18,7 @@ mod initialize; mod mcp_resource; mod mcp_server_elicitation; mod mcp_server_status; +mod mcp_tool; mod model_list; mod output_schema; mod plan_item; diff --git a/codex-rs/core/src/codex_thread.rs b/codex-rs/core/src/codex_thread.rs index e90dd0f80a10..86decbe6b22b 100644 --- a/codex-rs/core/src/codex_thread.rs +++ b/codex-rs/core/src/codex_thread.rs @@ -9,6 +9,7 @@ use codex_protocol::config_types::Personality; use codex_protocol::config_types::ServiceTier; use codex_protocol::error::CodexErr; use codex_protocol::error::Result as CodexResult; +use codex_protocol::mcp::CallToolResult; use codex_protocol::models::ContentItem; use codex_protocol::models::ResponseInputItem; use codex_protocol::models::ResponseItem; @@ -224,6 +225,19 @@ impl CodexThread { Ok(serde_json::to_value(result)?) } + pub async fn call_mcp_tool( + &self, + server: &str, + tool: &str, + arguments: Option, + meta: Option, + ) -> anyhow::Result { + self.codex + .session + .call_tool(server, tool, arguments, meta) + .await + } + pub fn enabled(&self, feature: Feature) -> bool { self.codex.enabled(feature) }