From ae7f29fff3b343fdc9661f43aa14fd131fe83001 Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 11:02:22 +0200 Subject: [PATCH 01/15] chore(schema): bump CLI schema 1.0.63 -> 1.0.65 and regenerate wire specs Bump `.copilot-schema-version` to 1.0.65 (@github/copilot) and regenerate the pinned JSON Schemas plus the auto-generated event specs via `bb schemas:fetch` and `bb codegen`. Adapt `script/codegen/fetch_schemas.clj` to the upstream package split. The session-events delta adds new event types (citations, binary assets, additional canvas events, ScheduleRearmed, MCP OAuth). Event-data specs are open maps, so these pass through automatically; public event-type entries are added in the feature commit only where upstream exposes a public SDK event. Foundational for the v1.0.1 -> v1.0.4 upstream sync. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .copilot-schema-version | 2 +- schemas/README.md | 4 +- schemas/api.schema.json | 2644 +++++++++++++---- schemas/session-events.schema.json | 1619 ++++++++-- script/codegen/fetch_schemas.clj | 88 +- .../copilot_sdk/generated/event_specs.clj | 258 +- 6 files changed, 3580 insertions(+), 1035 deletions(-) diff --git a/.copilot-schema-version b/.copilot-schema-version index 32c4ece..7b8d6b7 100644 --- a/.copilot-schema-version +++ b/.copilot-schema-version @@ -1 +1 @@ -1.0.63 +1.0.65 diff --git a/schemas/README.md b/schemas/README.md index 5f8fbcf..7f254b4 100644 --- a/schemas/README.md +++ b/schemas/README.md @@ -1,7 +1,7 @@ # Upstream Copilot CLI JSON Schemas -These files are fetched verbatim from the `@github/copilot` npm package at the version pinned in `.copilot-schema-version`. +These files are fetched verbatim from the `@github/copilot-linux-x64` npm package at the version pinned in `.copilot-schema-version`. **Do not edit by hand.** To update, run `bb schemas:fetch` after bumping `.copilot-schema-version`. -Currently pinned version: `1.0.63` +Currently pinned version: `1.0.65` diff --git a/schemas/api.schema.json b/schemas/api.schema.json index 182a58a..675597b 100644 --- a/schemas/api.schema.json +++ b/schemas/api.schema.json @@ -70,6 +70,51 @@ "$ref": "#/definitions/AccountGetQuotaResult", "description": "Quota usage snapshots for the resolved user, keyed by quota type." } + }, + "getCurrentAuth": { + "rpcMethod": "account.getCurrentAuth", + "description": "Gets the currently active authentication credentials from the global auth manager.", + "params": null, + "result": { + "$ref": "#/definitions/AccountGetCurrentAuthResult", + "description": "Current authentication state" + } + }, + "getAllUsers": { + "rpcMethod": "account.getAllUsers", + "description": "Gets all authenticated users available for account switching.", + "params": null, + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountAllUsers" + }, + "description": "List of all authenticated users" + } + }, + "login": { + "rpcMethod": "account.login", + "description": "Stores authentication credentials after successful login (e.g., device code flow).", + "params": { + "$ref": "#/definitions/AccountLoginRequest", + "description": "Credentials to store after successful authentication" + }, + "result": { + "$ref": "#/definitions/AccountLoginResult", + "description": "Result of a successful login; throws on failure" + } + }, + "logout": { + "rpcMethod": "account.logout", + "description": "Removes user authentication from keychain and persisted state.", + "params": { + "$ref": "#/definitions/AccountLogoutRequest", + "description": "User to log out" + }, + "result": { + "$ref": "#/definitions/AccountLogoutResult", + "description": "Logout result indicating if more users remain" + } } }, "secrets": { @@ -347,6 +392,19 @@ "$ref": "#/definitions/ServerSkillList", "description": "Skills discovered across global and project sources." } + }, + "getDiscoveryPaths": { + "rpcMethod": "skills.getDiscoveryPaths", + "description": "Returns the canonical directories where a client may create skills that the runtime will recognize, including ones that do not exist yet. Project directories become active once created.", + "params": { + "$ref": "#/definitions/SkillsGetDiscoveryPathsRequest", + "description": "Optional project paths to enumerate." + }, + "result": { + "$ref": "#/definitions/SkillDiscoveryPathList", + "description": "Canonical locations where skills can be created so the runtime will recognize them." + }, + "stability": "experimental" } }, "agents": { @@ -362,6 +420,19 @@ "description": "Agents discovered across user, project, plugin, and remote sources." }, "stability": "experimental" + }, + "getDiscoveryPaths": { + "rpcMethod": "agents.getDiscoveryPaths", + "description": "Returns the canonical directories where a client may create custom agents that the runtime will recognize, including ones that do not exist yet. Project directories become active once created.", + "params": { + "$ref": "#/definitions/AgentsGetDiscoveryPathsRequest", + "description": "Optional project paths to include when enumerating agent discovery directories." + }, + "result": { + "$ref": "#/definitions/AgentDiscoveryPathList", + "description": "Canonical locations where custom agents can be created so the runtime will recognize them." + }, + "stability": "experimental" } }, "instructions": { @@ -377,6 +448,19 @@ "description": "Instruction sources discovered across user, repository, and plugin sources." }, "stability": "experimental" + }, + "getDiscoveryPaths": { + "rpcMethod": "instructions.getDiscoveryPaths", + "description": "Returns the canonical files and directories where a client may create custom instructions that the runtime will recognize, including ones that do not exist yet. Repository targets become active once created.", + "params": { + "$ref": "#/definitions/InstructionsGetDiscoveryPathsRequest", + "description": "Optional project paths to include when enumerating instruction discovery targets." + }, + "result": { + "$ref": "#/definitions/InstructionDiscoveryPathList", + "description": "Canonical files and directories where custom instructions can be created so the runtime will recognize them." + }, + "stability": "experimental" } }, "user": { @@ -415,6 +499,44 @@ } } }, + "llmInference": { + "setProvider": { + "rpcMethod": "llmInference.setProvider", + "description": "Registers an SDK client as the LLM inference callback provider.", + "params": null, + "result": { + "$ref": "#/definitions/LlmInferenceSetProviderResult", + "description": "Indicates whether the calling client was registered as the LLM inference provider." + }, + "stability": "experimental" + }, + "httpResponseStart": { + "rpcMethod": "llmInference.httpResponseStart", + "description": "Delivers the response head (status + headers) for an in-flight request, correlated by the requestId the runtime supplied in httpRequestStart. Must be called exactly once per request before any httpResponseChunk frames.", + "params": { + "$ref": "#/definitions/LlmInferenceHttpResponseStartRequest", + "description": "Response head." + }, + "result": { + "$ref": "#/definitions/LlmInferenceHttpResponseStartResult", + "description": "Whether the start frame was accepted." + }, + "stability": "experimental" + }, + "httpResponseChunk": { + "rpcMethod": "llmInference.httpResponseChunk", + "description": "Delivers a body byte range (or a terminal transport error) for an in-flight response, correlated by requestId. Set `end` true on the last chunk. When `error` is set the response terminates with a transport-level failure and the runtime raises an APIConnectionError.", + "params": { + "$ref": "#/definitions/LlmInferenceHttpResponseChunkRequest", + "description": "A response body chunk or terminal error." + }, + "result": { + "$ref": "#/definitions/LlmInferenceHttpResponseChunkResult", + "description": "Whether the chunk was accepted." + }, + "stability": "experimental" + } + }, "sessions": { "open": { "rpcMethod": "sessions.open", @@ -818,7 +940,6 @@ "description": "Suspends the session while preserving persisted state for later resume.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -828,7 +949,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "type": "null" @@ -936,12 +1058,12 @@ "description": "Finite reason code describing why the current turn was aborted" } }, - "additionalProperties": false, - "description": "Parameters for aborting the current turn", - "title": "AbortRequest", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "Parameters for aborting the current turn", + "title": "AbortRequest" }, "result": { "$ref": "#/definitions/AbortResult", @@ -968,12 +1090,12 @@ "description": "Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'." } }, - "additionalProperties": false, - "description": "Parameters for shutting down the session", - "title": "ShutdownRequest", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "Parameters for shutting down the session", + "title": "ShutdownRequest" }, "result": { "type": "null" @@ -986,7 +1108,6 @@ "description": "Gets authentication status and account metadata for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -996,7 +1117,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/SessionAuthStatus", @@ -1019,12 +1141,12 @@ "description": "The new auth credentials to install on the session. When omitted or `undefined`, the call is a no-op and the session's existing credentials are preserved. The runtime stores the value verbatim and uses it for outbound model/API requests; it does NOT re-validate or re-fetch the associated Copilot user response. Several variants carry secret material; treat this method's params as containing secrets at rest and in transit." } }, - "additionalProperties": false, - "description": "New auth credentials to install on the session. Omit to leave credentials unchanged.", - "title": "SessionSetCredentialsParams", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "New auth credentials to install on the session. Omit to leave credentials unchanged.", + "title": "SessionSetCredentialsParams" }, "result": { "$ref": "#/definitions/SessionSetCredentialsResult", @@ -1039,7 +1161,6 @@ "description": "Lists canvases declared for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1049,7 +1170,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/CanvasList", @@ -1062,7 +1184,6 @@ "description": "Lists currently open canvas instances for the live session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1072,7 +1193,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/CanvasListOpenResult", @@ -1114,7 +1236,8 @@ ], "additionalProperties": false, "description": "Canvas open parameters.", - "title": "CanvasOpenRequest" + "title": "CanvasOpenRequest", + "stability": "experimental" }, "result": { "$ref": "#/definitions/OpenCanvasInstance", @@ -1143,7 +1266,8 @@ ], "additionalProperties": false, "description": "Canvas close parameters.", - "title": "CanvasCloseRequest" + "title": "CanvasCloseRequest", + "stability": "experimental" }, "result": { "type": "null" @@ -1181,7 +1305,8 @@ ], "additionalProperties": false, "description": "Canvas action invocation parameters.", - "title": "CanvasActionInvokeRequest" + "title": "CanvasActionInvokeRequest", + "stability": "experimental" }, "result": { "$ref": "#/definitions/CanvasActionInvokeResult", @@ -1197,7 +1322,6 @@ "description": "Gets the currently selected model for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1207,7 +1331,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/CurrentModel", @@ -1227,7 +1352,7 @@ }, "modelId": { "type": "string", - "description": "Model identifier to switch to" + "description": "Model selection id to switch to, as returned by `list`. A bare id (e.g. `claude-sonnet-4.6`) names a Copilot (CAPI) model; a provider-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a registry BYOK model." }, "reasoningEffort": { "type": "string", @@ -1308,8 +1433,6 @@ "additionalProperties": false } ], - "description": "Optional listing options.", - "title": "ModelListRequest", "properties": { "sessionId": { "type": "string", @@ -1318,7 +1441,9 @@ }, "required": [ "sessionId" - ] + ], + "description": "Optional listing options.", + "title": "ModelListRequest" }, "result": { "$ref": "#/definitions/SessionModelList", @@ -1333,7 +1458,6 @@ "description": "Gets the current agent interaction mode.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1343,7 +1467,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/SessionMode", @@ -1386,7 +1511,6 @@ "description": "Gets the session's friendly name.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1396,7 +1520,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/NameGetResult", @@ -1470,7 +1595,6 @@ "description": "Reads the session plan file from the workspace.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1480,7 +1604,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/PlanReadResult", @@ -1521,7 +1646,6 @@ "description": "Deletes the session plan file from the workspace.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1531,7 +1655,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "type": "null" @@ -1543,7 +1668,6 @@ "description": "Reads todo rows from the session SQL database for plan rendering.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1553,7 +1677,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/PlanReadSqlTodosResult", @@ -1566,7 +1691,6 @@ "description": "Reads todo rows AND dependency edges from the session SQL database for structured progress UI. Same defensive behavior as readSqlTodos — returns empty arrays when the database, tables, or columns aren't available. Clients should call this on session start and after every `session.todos_changed` event to refresh structured-UI rendering.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1576,7 +1700,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/PlanReadSqlTodosWithDependenciesResult", @@ -1591,7 +1716,6 @@ "description": "Gets current workspace metadata for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1601,7 +1725,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/WorkspacesGetWorkspaceResult", @@ -1614,7 +1739,6 @@ "description": "Lists files stored in the session workspace files directory.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1624,7 +1748,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/WorkspacesListFilesResult", @@ -1699,7 +1824,6 @@ "description": "Lists workspace checkpoints in chronological order.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1709,7 +1833,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/WorkspacesListCheckpointsResult", @@ -1816,7 +1941,6 @@ "description": "Gets instruction sources loaded for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1826,7 +1950,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/InstructionsGetSourcesResult", @@ -1851,12 +1976,12 @@ "description": "Optional user prompt to combine with fleet instructions" } }, - "additionalProperties": false, - "description": "Optional user prompt to combine with the fleet orchestration instructions.", - "title": "FleetStartRequest", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "Optional user prompt to combine with the fleet orchestration instructions.", + "title": "FleetStartRequest" }, "result": { "$ref": "#/definitions/FleetStartResult", @@ -1871,7 +1996,6 @@ "description": "Lists custom agents available to the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1881,7 +2005,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/AgentList", @@ -1894,7 +2019,6 @@ "description": "Gets the currently selected custom agent for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1904,7 +2028,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/AgentGetCurrentResult", @@ -1946,7 +2071,6 @@ "description": "Clears the selected custom agent and returns the session to the default agent.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1956,7 +2080,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "type": "null" @@ -1968,7 +2093,6 @@ "description": "Reloads custom agent definitions and returns the refreshed list.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -1978,7 +2102,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/AgentReloadResult", @@ -2040,7 +2165,6 @@ "description": "Lists background tasks tracked by the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2050,7 +2174,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/TaskList", @@ -2063,7 +2188,6 @@ "description": "Refreshes metadata for any detached background shells the runtime knows about.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2073,7 +2197,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/TasksRefreshResult", @@ -2086,7 +2211,6 @@ "description": "Waits for all in-flight background tasks and any follow-up turns to settle.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2096,7 +2220,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/TasksWaitForPendingResult", @@ -2138,7 +2263,6 @@ "description": "Returns the first sync-waiting task that can currently be promoted to background mode.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2148,7 +2272,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/TasksGetCurrentPromotableResult", @@ -2190,7 +2315,6 @@ "description": "Atomically promotes the first promotable sync-waiting task to background mode and returns it.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2200,7 +2324,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/TasksPromoteCurrentToBackgroundResult", @@ -2311,7 +2436,6 @@ "description": "Lists skills available to the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2321,7 +2445,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/SkillList", @@ -2334,7 +2459,6 @@ "description": "Returns the skills that have been invoked during this session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2344,7 +2468,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/SkillsGetInvokedResult", @@ -2413,7 +2538,6 @@ "description": "Reloads skill definitions for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2423,7 +2547,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/SkillsLoadDiagnostics", @@ -2436,7 +2561,6 @@ "description": "Ensures the session's skill definitions have been loaded from disk.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2446,7 +2570,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "type": "null" @@ -2460,7 +2585,6 @@ "description": "Lists MCP servers configured for the session, their connection status, and host-level state. The host-level state (disabled/filtered servers, failed/needs-auth/pending connections, mcp3p policy, full config) is empty/zero when no MCP host has been initialized for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2470,7 +2594,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/McpServerList", @@ -2574,7 +2699,6 @@ "description": "Reloads MCP server connections for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2584,7 +2708,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "type": "null" @@ -2603,8 +2728,8 @@ }, "config": { "description": "Opaque runtime MCP reload configuration. Marked internal: an in-process runtime shape (reloadMcpServers throws over the wire).", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -2642,10 +2767,6 @@ "description": "Name of the MCP server that initiated the sampling request" }, "mcpRequestId": { - "type": [ - "string", - "number" - ], "description": "The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle).", "x-opaque-json": true }, @@ -2734,7 +2855,6 @@ "description": "Removes the auto-managed `github` MCP server when present.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -2744,7 +2864,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/McpRemoveGitHubResult", @@ -2764,8 +2885,8 @@ }, "authInfo": { "description": "Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire).", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -2800,8 +2921,8 @@ }, "config": { "description": "Opaque server configuration (MCPServerConfig). Marked internal: an in-process runtime shape supplied only by in-process CLI callers.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -2836,8 +2957,8 @@ }, "config": { "description": "Opaque server configuration (MCPServerConfig). Marked internal: an in-process runtime shape supplied only by in-process CLI callers.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -2900,18 +3021,18 @@ }, "client": { "description": "In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" }, "transport": { "description": "In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" }, "config": { "description": "In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -2994,7 +3115,7 @@ "oauth": { "respond": { "rpcMethod": "session.mcp.oauth.respond", - "description": "Responds to a pending MCP OAuth provider request. Marked internal because the `provider` argument is an in-process OAuthClientProvider instance that cannot be carried over the wire; the public OAuth surface will route the response through a wire-clean handshake once the CLI moves on top of the SDK.", + "description": "Responds to a pending MCP OAuth request with an in-process provider. This internal CLI-only API accepts a live OAuthClientProvider instance and cannot be used over the SDK JSON-RPC boundary. Use session.mcp.oauth.handlePendingRequest instead for the public SDK-safe response path.", "params": { "type": "object", "properties": { @@ -3008,8 +3129,8 @@ }, "provider": { "description": "In-process OAuthClientProvider instance, or omitted to deny. Marked internal: cannot be serialized across the JSON-RPC boundary.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -3028,6 +3149,40 @@ "stability": "experimental", "visibility": "internal" }, + "handlePendingRequest": { + "rpcMethod": "session.mcp.oauth.handlePendingRequest", + "description": "Resolves a pending MCP OAuth request with a host-provided token or cancellation. The pending request is emitted as mcp.oauth_required with the data necessary to authorize the request.", + "params": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Target session identifier" + }, + "requestId": { + "type": "string", + "description": "OAuth request identifier from the mcp.oauth_required event" + }, + "result": { + "$ref": "#/definitions/McpOauthPendingRequestResponse", + "description": "Host response to the pending OAuth request." + } + }, + "required": [ + "sessionId", + "requestId", + "result" + ], + "additionalProperties": false, + "description": "Pending MCP OAuth request ID and host-provided token or cancellation response.", + "title": "McpOauthHandlePendingRequest" + }, + "result": { + "$ref": "#/definitions/McpOauthHandlePendingResult", + "description": "Indicates whether the pending MCP OAuth response was accepted." + }, + "stability": "experimental" + }, "login": { "rpcMethod": "session.mcp.oauth.login", "description": "Starts OAuth authentication for a remote MCP server.", @@ -3055,6 +3210,22 @@ "callbackSuccessMessage": { "type": "string", "description": "Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return." + }, + "clientId": { + "type": "string", + "description": "Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration." + }, + "clientSecret": { + "type": "string", + "description": "Optional OAuth client secret override for this login. The runtime treats this as an ephemeral host-owned secret, uses it for this authentication attempt and does not persist it." + }, + "publicClient": { + "type": "boolean", + "description": "Optional override indicating whether the static OAuth client is public. When false, the runtime treats it as confidential and uses the per-login clientSecret if provided, otherwise retrieving the client secret from the MCP OAuth secret store." + }, + "grantType": { + "$ref": "#/definitions/McpOauthLoginGrantType", + "description": "Optional OAuth grant type override for this login. Defaults to the server configuration, or authorization_code when no grant type is specified." } }, "required": [ @@ -3062,7 +3233,7 @@ "serverName" ], "additionalProperties": false, - "description": "Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy.", + "description": "Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.", "title": "McpOauthLoginRequest" }, "result": { @@ -3233,7 +3404,6 @@ "description": "Read the current host context advertised to MCP App guests.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -3243,7 +3413,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/McpAppsHostContext", @@ -3290,7 +3461,6 @@ "description": "Lists plugins installed for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -3300,7 +3470,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/PluginList", @@ -3339,8 +3510,6 @@ "additionalProperties": false } ], - "description": "Optional flags controlling which side effects the reload performs.", - "title": "PluginsReloadRequest", "properties": { "sessionId": { "type": "string", @@ -3349,7 +3518,9 @@ }, "required": [ "sessionId" - ] + ], + "description": "Optional flags controlling which side effects the reload performs.", + "title": "PluginsReloadRequest" }, "result": { "type": "null" @@ -3377,8 +3548,6 @@ "additionalProperties": false } ], - "description": "Optional model identifier to scope the endpoint snapshot to.", - "title": "ProviderGetEndpointRequest", "properties": { "sessionId": { "type": "string", @@ -3387,13 +3556,56 @@ }, "required": [ "sessionId" - ] + ], + "description": "Optional model identifier to scope the endpoint snapshot to.", + "title": "ProviderGetEndpointRequest" }, "result": { "$ref": "#/definitions/ProviderEndpoint", "description": "A snapshot of the provider endpoint the session is currently configured to talk to." }, "stability": "experimental" + }, + "add": { + "rpcMethod": "session.provider.add", + "description": "Adds BYOK providers and/or models to the session's registry at runtime, extending the additive registry built from the session's `providers`/`models` options. Both fields are optional, so a call may add providers only, models only, or both. Within a single call providers are registered before models, so a model may reference a provider added in the same call; across calls a model may reference any provider already registered (from session creation or a prior add). A model whose referenced provider is not registered by the end of the call is rejected. Newly added models become selectable via `model.list` / `model.switchTo` and are inherited by sub-agents spawned afterwards.", + "params": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Target session identifier" + }, + "providers": { + "type": "array", + "items": { + "$ref": "#/definitions/NamedProviderConfig", + "description": "A named BYOK provider connection (transport + credentials)." + }, + "description": "Named BYOK provider connections to register, additive to any providers already in the registry. Each name must be unique across the registry and must not contain '/'." + }, + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ProviderModelConfig", + "description": "A BYOK model definition referencing a named provider." + }, + "description": "BYOK model definitions to register. Each must reference a provider that is already registered or included in this same call. Selection ids (`provider/id`) must be unique across the registry." + } + }, + "required": [ + "sessionId" + ], + "additionalProperties": false, + "description": "BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both.", + "title": "ProviderAddRequest", + "stability": "experimental" + }, + "result": { + "$ref": "#/definitions/ProviderAddResult", + "description": "The selectable model entries synthesized for the models added by this call." + }, + "stability": "experimental" } }, "options": { @@ -3450,6 +3662,10 @@ "$ref": "#/definitions/ProviderConfig", "description": "Custom model-provider configuration (BYOK)." }, + "capi": { + "$ref": "#/definitions/CapiSessionOptions", + "description": "Options scoped to the built-in CAPI (Copilot API) provider." + }, "workingDirectory": { "type": "string", "description": "Absolute working-directory path for shell tools." @@ -3517,6 +3733,11 @@ "type": "boolean", "description": "Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag." }, + "maxInlineBinaryBytes": { + "type": "integer", + "minimum": 0, + "description": "Maximum decoded byte size of a single model-facing binary tool result (e.g. an image) persisted inline in session events and re-presented to the model on later turns / resume. Larger results are persisted as a metadata-only marker and shown to the model as a short text note. Defaults to 10 MB." + }, "installedPlugins": { "type": "array", "items": { @@ -3632,12 +3853,12 @@ "description": "Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier." } }, - "additionalProperties": false, - "description": "Patch of mutable session options to apply to the running session.", - "title": "SessionUpdateOptionsParams", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "Patch of mutable session options to apply to the running session.", + "title": "SessionUpdateOptionsParams" }, "result": { "$ref": "#/definitions/SessionUpdateOptionsResult", @@ -3670,12 +3891,12 @@ "description": "Force re-initialization even when LSP configs were already loaded for the working directory." } }, - "additionalProperties": false, - "description": "Parameters for (re)loading the merged LSP configuration set.", - "title": "LspInitializeRequest", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "Parameters for (re)loading the merged LSP configuration set.", + "title": "LspInitializeRequest" }, "result": { "type": "null" @@ -3689,7 +3910,6 @@ "description": "Lists extensions discovered for the session and their current status.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -3699,7 +3919,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/ExtensionList", @@ -3768,7 +3989,6 @@ "description": "Reloads extension definitions and processes for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -3778,7 +3998,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "type": "null" @@ -3864,7 +4085,6 @@ "description": "Resolves, builds, and validates the runtime tool list for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -3874,7 +4094,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/ToolsInitializeAndValidateResult", @@ -3887,7 +4108,6 @@ "description": "Returns lightweight metadata for the session's currently initialized tools.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -3897,7 +4117,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/ToolsGetCurrentMetadataResult", @@ -3963,8 +4184,6 @@ "additionalProperties": false } ], - "description": "Optional filters controlling which command sources to include in the listing.", - "title": "CommandsListRequest", "properties": { "sessionId": { "type": "string", @@ -3973,7 +4192,9 @@ }, "required": [ "sessionId" - ] + ], + "description": "Optional filters controlling which command sources to include in the listing.", + "title": "CommandsListRequest" }, "result": { "$ref": "#/definitions/CommandList", @@ -4151,7 +4372,6 @@ "description": "Gets the telemetry engagement ID currently associated with the session, when available.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -4161,7 +4381,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/SessionTelemetryEngagement", @@ -4218,13 +4439,13 @@ }, "onChunk": { "description": "In-process streaming callback `(text) => void` invoked with each token as the model emits it. Marked internal: excluded from the public SDK surface. In a process-separated SDK this is replaced by a streaming RPC that yields chunks and a final answer.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" }, "abortSignal": { "description": "In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Marked internal: excluded from the public SDK surface. Replaced by an explicit cancellation token + cancel RPC in the SDK migration.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -4449,7 +4670,6 @@ "description": "Registers an in-process handler for auto-mode-switch requests so the server bridge skips dispatch.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -4459,7 +4679,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/UIRegisterDirectAutoModeSwitchHandlerResult", @@ -4536,12 +4757,12 @@ "description": "If specified, replaces the host-supplied GitHub Content Exclusion policies on the session (combined with natively-discovered policies when evaluating tool/file access). Omit to leave the current policies unchanged." } }, - "additionalProperties": false, - "description": "Patch of permission policy fields to apply (omit a field to leave it unchanged).", - "title": "PermissionsConfigureParams", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "Patch of permission policy fields to apply (omit a field to leave it unchanged).", + "title": "PermissionsConfigureParams" }, "result": { "$ref": "#/definitions/PermissionsConfigureResult", @@ -4594,12 +4815,12 @@ "description": "Target session identifier" } }, - "additionalProperties": false, - "description": "No parameters; returns currently-pending permission requests for the session.", - "title": "PermissionsPendingRequestsRequest", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "No parameters; returns currently-pending permission requests for the session.", + "title": "PermissionsPendingRequestsRequest" }, "result": { "$ref": "#/definitions/PendingPermissionRequestList", @@ -4684,12 +4905,12 @@ "description": "Target session identifier" } }, - "additionalProperties": false, - "description": "No parameters.", - "title": "PermissionsGetAllowAllRequest", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "No parameters.", + "title": "PermissionsGetAllowAllRequest" }, "result": { "$ref": "#/definitions/AllowAllPermissionState", @@ -4784,12 +5005,12 @@ "description": "Target session identifier" } }, - "additionalProperties": false, - "description": "No parameters; clears all session-scoped tool permission approvals.", - "title": "PermissionsResetSessionApprovalsRequest", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "No parameters; clears all session-scoped tool permission approvals.", + "title": "PermissionsResetSessionApprovalsRequest" }, "result": { "$ref": "#/definitions/PermissionsResetSessionApprovalsResult", @@ -4838,12 +5059,12 @@ "description": "Target session identifier" } }, - "additionalProperties": false, - "description": "No parameters; returns the session's allow-listed directories.", - "title": "PermissionsPathsListRequest", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "No parameters; returns the session's allow-listed directories.", + "title": "PermissionsPathsListRequest" }, "result": { "$ref": "#/definitions/PermissionPathsList", @@ -5210,7 +5431,6 @@ "description": "Returns a snapshot of the session's identifying metadata, mode, agent, and remote info.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5220,7 +5440,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/SessionMetadataSnapshot", @@ -5233,7 +5454,6 @@ "description": "Reports whether the local session is currently processing user/agent messages.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5243,7 +5463,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/MetadataIsProcessingResult", @@ -5256,7 +5477,6 @@ "description": "Returns a snapshot of activity flags for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5266,7 +5486,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/SessionActivity", @@ -5424,8 +5645,8 @@ "timeout": { "type": "integer", "minimum": 0, - "description": "Timeout in milliseconds (default: 30000)", - "format": "duration" + "format": "duration", + "description": "Timeout in milliseconds (default: 30000)" } }, "required": [ @@ -5560,8 +5781,6 @@ "additionalProperties": false } ], - "description": "Optional compaction parameters.", - "title": "HistoryCompactRequest", "properties": { "sessionId": { "type": "string", @@ -5570,7 +5789,9 @@ }, "required": [ "sessionId" - ] + ], + "description": "Optional compaction parameters.", + "title": "HistoryCompactRequest" }, "result": { "$ref": "#/definitions/HistoryCompactResult", @@ -5612,7 +5833,6 @@ "description": "Cancels any in-progress background compaction on a local session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5622,7 +5842,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/HistoryCancelBackgroundCompactionResult", @@ -5635,7 +5856,6 @@ "description": "Aborts any in-progress manual compaction on a local session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5645,7 +5865,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/HistoryAbortManualCompactionResult", @@ -5658,7 +5879,6 @@ "description": "Produces a markdown summary of the session's conversation context for hand-off scenarios.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5668,7 +5888,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/HistorySummarizeForHandoffResult", @@ -5683,7 +5904,6 @@ "description": "Returns the local session's pending user-facing queued items and steering messages.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5693,7 +5913,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/QueuePendingItemsResult", @@ -5706,7 +5927,6 @@ "description": "Removes the most recently queued user-facing item (LIFO).", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5716,7 +5936,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/QueueRemoveMostRecentResult", @@ -5729,7 +5950,6 @@ "description": "Clears all pending queued items on the local session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5739,7 +5959,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "type": "null" @@ -5772,8 +5993,8 @@ "type": "integer", "minimum": 0, "maximum": 30000, - "description": "Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen).", - "format": "duration" + "format": "duration", + "description": "Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen)." }, "types": { "$ref": "#/definitions/EventLogTypes", @@ -5784,12 +6005,12 @@ "description": "Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers." } }, - "additionalProperties": false, - "description": "Cursor, batch size, and optional long-poll/filter parameters for reading session events.", - "title": "EventLogReadRequest", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "Cursor, batch size, and optional long-poll/filter parameters for reading session events.", + "title": "EventLogReadRequest" }, "result": { "$ref": "#/definitions/EventsReadResult", @@ -5802,7 +6023,6 @@ "description": "Returns a snapshot of the current tail cursor without consuming events.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5812,7 +6032,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/EventLogTailResult", @@ -5885,7 +6106,6 @@ "description": "Gets accumulated usage metrics for the session.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5895,7 +6115,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/UsageGetMetricsResult", @@ -5920,12 +6141,12 @@ "description": "Per-session remote mode. \"off\" disables remote, \"export\" exports session events to GitHub without enabling remote steering, \"on\" enables both export and remote steering." } }, - "additionalProperties": false, - "description": "Optional remote session mode (\"off\", \"export\", or \"on\"); defaults to enabling both export and remote steering.", - "title": "RemoteEnableRequest", "required": [ "sessionId" - ] + ], + "additionalProperties": false, + "description": "Optional remote session mode (\"off\", \"export\", or \"on\"); defaults to enabling both export and remote steering.", + "title": "RemoteEnableRequest" }, "result": { "$ref": "#/definitions/RemoteEnableResult", @@ -5938,7 +6159,6 @@ "description": "Disables remote session export and steering.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -5948,7 +6168,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "type": "null" @@ -5991,7 +6212,6 @@ "description": "Lists the session's currently active scheduled prompts.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -6001,7 +6221,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/ScheduleList", @@ -6042,6 +6263,37 @@ } }, "clientSession": { + "providerToken": { + "getToken": { + "rpcMethod": "providerToken.getToken", + "description": "Asks the SDK client to get a bearer token for a BYOK provider whose config set `hasBearerTokenProvider: true`. Session-scoped: the runtime calls it back on the connection that most recently supplied that provider's config for the session (the creating connection, or a resuming connection if the session was resumed — distinct providers may be owned by different connections), passing the provider name, and uses the returned token as the Authorization header for the outbound model request. The runtime does no caching — it calls this once per outbound request; the SDK consumer owns token acquisition, caching, and refresh.", + "params": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Target session identifier" + }, + "providerName": { + "type": "string", + "description": "Name of the BYOK provider needing a token. For the legacy whole-session `provider` this is the implicit provider name; for named providers it is `NamedProviderConfig.name`." + } + }, + "required": [ + "sessionId", + "providerName" + ], + "additionalProperties": false, + "description": "Asks the SDK client to acquire a bearer token for a BYOK provider whose config set `hasBearerTokenProvider: true`. Issued by the runtime before each outbound model request; the runtime does no caching, so this is sent once per request.", + "title": "ProviderTokenAcquireRequest" + }, + "result": { + "$ref": "#/definitions/ProviderTokenAcquireResult", + "description": "A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer ` on the outbound request and does no caching; the SDK consumer owns token caching and refresh." + }, + "stability": "experimental" + } + }, "sessionFs": { "readFile": { "rpcMethod": "sessionFs.readFile", @@ -6436,11 +6688,6 @@ "params": { "type": "object", "additionalProperties": { - "type": [ - "string", - "number", - "null" - ], "x-opaque-json": true }, "description": "Optional named bind parameters" @@ -6466,7 +6713,6 @@ "description": "Checks whether the per-session SQLite database already exists, without creating it.", "params": { "type": "object", - "description": "Identifies the target session.", "properties": { "sessionId": { "type": "string", @@ -6476,7 +6722,8 @@ "required": [ "sessionId" ], - "additionalProperties": false + "additionalProperties": false, + "description": "Identifies the target session." }, "result": { "$ref": "#/definitions/SessionFsSqliteExistsResult", @@ -6529,7 +6776,8 @@ ], "additionalProperties": false, "description": "Canvas open parameters sent to the provider.", - "title": "CanvasProviderOpenRequest" + "title": "CanvasProviderOpenRequest", + "stability": "experimental" }, "result": { "$ref": "#/definitions/CanvasProviderOpenResult", @@ -6576,7 +6824,8 @@ ], "additionalProperties": false, "description": "Canvas close parameters sent to the provider.", - "title": "CanvasProviderCloseRequest" + "title": "CanvasProviderCloseRequest", + "stability": "experimental" }, "result": { "type": "null" @@ -6632,7 +6881,8 @@ ], "additionalProperties": false, "description": "Canvas action invocation parameters sent to the provider.", - "title": "CanvasProviderInvokeActionRequest" + "title": "CanvasProviderInvokeActionRequest", + "stability": "experimental" }, "result": { "description": "Provider-supplied action result.", @@ -6643,6 +6893,36 @@ } } }, + "clientGlobal": { + "llmInference": { + "httpRequestStart": { + "rpcMethod": "llmInference.httpRequestStart", + "description": "Announces an outbound model-layer HTTP request the runtime wants the SDK client to service. Carries the request head only; the body always follows as one or more httpRequestChunk frames keyed by the same requestId, even when the body is empty (a single chunk with end=true).", + "params": { + "$ref": "#/definitions/LlmInferenceHttpRequestStartRequest", + "description": "The head of an outbound model-layer HTTP request." + }, + "result": { + "$ref": "#/definitions/LlmInferenceHttpRequestStartResult", + "description": "Acknowledgement. Returning successfully simply means the SDK accepted the start frame; it does not imply the request will succeed." + }, + "stability": "experimental" + }, + "httpRequestChunk": { + "rpcMethod": "llmInference.httpRequestChunk", + "description": "Delivers a body byte range (or a cancellation signal) for a request previously announced via httpRequestStart, correlated by requestId. The runtime fires at least one chunk per request — when there is no body, a single chunk with empty data and end=true. Mid-stream the runtime may send a chunk with cancel=true to abort the request; the SDK then stops issuing httpResponseChunk frames and may emit a terminal httpResponseChunk with error set.", + "params": { + "$ref": "#/definitions/LlmInferenceHttpRequestChunkRequest", + "description": "A request body chunk or cancellation signal." + }, + "result": { + "$ref": "#/definitions/LlmInferenceHttpRequestChunkResult", + "description": "Acknowledgement. The SDK is free to ignore the ack and treat chunk delivery as fire-and-forget." + }, + "stability": "experimental" + } + } + }, "definitions": { "AbortReason": { "type": "string", @@ -6690,6 +6970,44 @@ "description": "Result of aborting the current turn", "title": "AbortResult" }, + "AccountAllUsers": { + "type": "object", + "properties": { + "authInfo": { + "$ref": "#/definitions/AuthInfo", + "description": "Authentication information for this user" + }, + "token": { + "type": "string", + "description": "Associated token, if available" + } + }, + "required": [ + "authInfo" + ], + "additionalProperties": false, + "description": "Schema for the `AccountAllUsers` type.", + "title": "AccountAllUsers" + }, + "AccountGetCurrentAuthResult": { + "type": "object", + "properties": { + "authInfo": { + "$ref": "#/definitions/AuthInfo", + "description": "Current authentication information, if authenticated" + }, + "authErrors": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Authentication errors from the last auth attempt, if any" + } + }, + "additionalProperties": false, + "description": "Current authentication state", + "title": "AccountGetCurrentAuthResult" + }, "AccountGetQuotaRequest": { "anyOf": [ { @@ -6727,6 +7045,76 @@ "description": "Quota usage snapshots for the resolved user, keyed by quota type.", "title": "AccountGetQuotaResult" }, + "AccountLoginRequest": { + "type": "object", + "properties": { + "host": { + "type": "string", + "description": "GitHub host URL" + }, + "login": { + "type": "string", + "description": "User login/username" + }, + "token": { + "type": "string", + "description": "GitHub authentication token" + } + }, + "required": [ + "host", + "login", + "token" + ], + "additionalProperties": false, + "description": "Credentials to store after successful authentication", + "title": "AccountLoginRequest" + }, + "AccountLoginResult": { + "type": "object", + "properties": { + "storedInVault": { + "type": "boolean", + "description": "Whether the credential was persisted to a secure store (system keychain, or the config file when plaintext storage is enabled). False when no secure store was available and the token was not saved, so the consumer can decide how to proceed." + } + }, + "required": [ + "storedInVault" + ], + "additionalProperties": false, + "description": "Result of a successful login; throws on failure", + "title": "AccountLoginResult" + }, + "AccountLogoutRequest": { + "type": "object", + "properties": { + "authInfo": { + "$ref": "#/definitions/AuthInfo", + "description": "Authentication information for the user to log out" + } + }, + "required": [ + "authInfo" + ], + "additionalProperties": false, + "description": "User to log out", + "title": "AccountLogoutRequest" + }, + "AccountLogoutResult": { + "type": "object", + "properties": { + "hasMoreUsers": { + "type": "boolean", + "description": "Whether other authenticated users remain after logout" + } + }, + "required": [ + "hasMoreUsers" + ], + "additionalProperties": false, + "description": "Logout result indicating if more users remain", + "title": "AccountLogoutResult" + }, "AccountQuotaSnapshot": { "type": "object", "properties": { @@ -6777,8 +7165,68 @@ "overageAllowedWithExhaustedQuota" ], "additionalProperties": false, - "title": "AccountQuotaSnapshot", - "description": "Schema for the `AccountQuotaSnapshot` type." + "description": "Schema for the `AccountQuotaSnapshot` type.", + "title": "AccountQuotaSnapshot" + }, + "AgentDiscoveryPath": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "Absolute path of the search/create directory (may not exist on disk yet)" + }, + "scope": { + "$ref": "#/definitions/AgentDiscoveryPathScope", + "description": "Which tier this directory belongs to" + }, + "preferredForCreation": { + "type": "boolean", + "description": "Whether this is the canonical directory to create a new agent in its tier. At most one entry per tier is preferred." + }, + "projectPath": { + "type": "string", + "description": "The input project path this directory was derived from (only for project scope)" + } + }, + "required": [ + "path", + "scope", + "preferredForCreation" + ], + "additionalProperties": false, + "description": "Schema for the `AgentDiscoveryPath` type.", + "title": "AgentDiscoveryPath" + }, + "AgentDiscoveryPathList": { + "type": "object", + "properties": { + "paths": { + "type": "array", + "items": { + "$ref": "#/definitions/AgentDiscoveryPath" + }, + "description": "Canonical agent create/discovery directories, in priority order" + } + }, + "required": [ + "paths" + ], + "additionalProperties": false, + "description": "Canonical locations where custom agents can be created so the runtime will recognize them.", + "title": "AgentDiscoveryPathList" + }, + "AgentDiscoveryPathScope": { + "type": "string", + "enum": [ + "user", + "project" + ], + "description": "Which tier this directory belongs to", + "title": "AgentDiscoveryPathScope", + "x-enumDescriptions": { + "user": "The user's personal agent configuration directory.", + "project": "A project's repository agent directory." + } }, "AgentGetCurrentResult": { "type": "object", @@ -6860,8 +7308,8 @@ "id" ], "additionalProperties": false, - "title": "AgentInfo", - "description": "Schema for the `AgentInfo` type." + "description": "Schema for the `AgentInfo` type.", + "title": "AgentInfo" }, "AgentInfoSource": { "type": "string", @@ -7354,7 +7802,7 @@ }, "excludeHostAgents": { "type": "boolean", - "description": "When true, omit the host's agents (the `/agents` directory and all plugin agents), leaving only project and remote agents. For multitenant deployments." + "description": "When true, omit the host's agents (the user-level agent directory and all plugin agents), leaving only project and remote agents. For multitenant deployments." } }, "additionalProperties": false, @@ -7391,6 +7839,25 @@ "description": "The newly selected custom agent.", "title": "AgentSelectResult" }, + "AgentsGetDiscoveryPathsRequest": { + "type": "object", + "properties": { + "projectPaths": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional list of project directory paths. When omitted or empty, only the user-level directory is returned." + }, + "excludeHostAgents": { + "type": "boolean", + "description": "When true, omit the host's user-level agent directory, leaving only project directories. For multitenant deployments (mirrors `discover`'s `excludeHostAgents`)." + } + }, + "additionalProperties": false, + "description": "Optional project paths to include when enumerating agent discovery directories.", + "title": "AgentsGetDiscoveryPathsRequest" + }, "AllowAllPermissionSetResult": { "type": "object", "properties": { @@ -7453,8 +7920,8 @@ "host" ], "additionalProperties": false, - "title": "ApiKeyAuthInfo", - "description": "Schema for the `ApiKeyAuthInfo` type." + "description": "Schema for the `ApiKeyAuthInfo` type.", + "title": "ApiKeyAuthInfo" }, "Attachment": { "anyOf": [ @@ -7496,7 +7963,7 @@ }, "data": { "type": "string", - "description": "Base64-encoded content", + "description": "Base64-encoded content. Present on input and for external consumers; replaced by an internal `assetId` reference in persisted events when interned to a content-addressed asset.", "contentEncoding": "base64" }, "mimeType": { @@ -7506,11 +7973,23 @@ "displayName": { "type": "string", "description": "User-facing display name for the attachment" + }, + "assetId": { + "type": "string", + "description": "Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. \"sha256:...\"). Absent externally." + }, + "byteLength": { + "type": "integer", + "minimum": 0, + "description": "Internal: decoded byte length of the attachment's model-facing bytes. Absent externally." + }, + "omittedReason": { + "$ref": "#/definitions/OmittedBinaryOmittedReason", + "description": "Internal: why model-facing bytes are absent from persistence. Absent externally." } }, "required": [ "type", - "data", "mimeType" ], "additionalProperties": false, @@ -7532,6 +8011,10 @@ "displayName": { "type": "string", "description": "User-facing display name for the attachment" + }, + "taggedFilesEntry": { + "type": "string", + "description": "Frozen rendered line this attachment contributed to the prompt block (e.g. \"* /path (12 items)\"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes." } }, "required": [ @@ -7607,15 +8090,36 @@ "lineRange": { "$ref": "#/definitions/AttachmentFileLineRange", "description": "Optional line range to scope the attachment to a specific section of the file" - } - }, - "required": [ - "type", - "path", - "displayName" - ], - "additionalProperties": false, - "description": "File attachment", + }, + "mimeType": { + "type": "string", + "description": "Internal: MIME type of the file's model-facing bytes (post-resize for images). Set when the file's bytes are interned to an asset. Absent externally." + }, + "assetId": { + "type": "string", + "description": "Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. \"sha256:...\"). Absent externally." + }, + "byteLength": { + "type": "integer", + "minimum": 0, + "description": "Internal: decoded byte length of the attachment's model-facing bytes. Absent externally." + }, + "omittedReason": { + "$ref": "#/definitions/OmittedBinaryOmittedReason", + "description": "Internal: why model-facing bytes are absent from persistence. Absent externally." + }, + "taggedFilesEntry": { + "type": "string", + "description": "Frozen rendered line this attachment contributed to the prompt block (e.g. \"* /path (123 lines)\"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. Present only for attachments routed to (mutually exclusive with assetId, which marks bytes sent natively)." + } + }, + "required": [ + "type", + "path", + "displayName" + ], + "additionalProperties": false, + "description": "File attachment", "title": "AttachmentFile" }, "AttachmentFileLineRange": { @@ -7883,7 +8387,8 @@ ], "additionalProperties": false, "description": "Canvas action that the agent or host can invoke. To discover the input schema for a particular action, call the list_canvas_capabilities tool.", - "title": "CanvasAction" + "title": "CanvasAction", + "stability": "experimental" }, "CanvasActionInvokeRequest": { "type": "object", @@ -7907,7 +8412,8 @@ ], "additionalProperties": false, "description": "Canvas action invocation parameters.", - "title": "CanvasActionInvokeRequest" + "title": "CanvasActionInvokeRequest", + "stability": "experimental" }, "CanvasActionInvokeResult": { "type": "object", @@ -7919,7 +8425,8 @@ }, "additionalProperties": false, "description": "Canvas action invocation result.", - "title": "CanvasActionInvokeResult" + "title": "CanvasActionInvokeResult", + "stability": "experimental" }, "CanvasCloseRequest": { "type": "object", @@ -7934,7 +8441,8 @@ ], "additionalProperties": false, "description": "Canvas close parameters.", - "title": "CanvasCloseRequest" + "title": "CanvasCloseRequest", + "stability": "experimental" }, "CanvasHostContext": { "type": "object", @@ -7946,7 +8454,8 @@ }, "additionalProperties": false, "description": "Host context supplied by the runtime.", - "title": "CanvasHostContext" + "title": "CanvasHostContext", + "stability": "experimental" }, "CanvasHostContextCapabilities": { "type": "object", @@ -7958,25 +8467,14 @@ }, "additionalProperties": false, "description": "Host capabilities", - "title": "CanvasHostContextCapabilities" - }, - "CanvasInstanceAvailability": { - "type": "string", - "enum": [ - "ready", - "stale" - ], - "description": "Runtime-controlled routing state for an open canvas instance.", - "title": "CanvasInstanceAvailability", - "x-enumDescriptions": { - "ready": "The owning provider is currently connected and routing calls will be dispatched normally.", - "stale": "The owning provider is not currently connected. Routing calls fail with canvas_provider_unavailable until the agent re-issues open_canvas (which rehydrates via a fresh canvas.open) or the provider reconnects." - } + "title": "CanvasHostContextCapabilities", + "stability": "experimental" }, "CanvasJsonSchema": { "description": "JSON Schema for canvas open input", "title": "CanvasJsonSchema", - "x-opaque-json": true + "x-opaque-json": true, + "stability": "experimental" }, "CanvasList": { "type": "object", @@ -7995,7 +8493,8 @@ ], "additionalProperties": false, "description": "Declared canvases available in this session.", - "title": "CanvasList" + "title": "CanvasList", + "stability": "experimental" }, "CanvasListOpenResult": { "type": "object", @@ -8014,7 +8513,8 @@ ], "additionalProperties": false, "description": "Live open-canvas snapshot.", - "title": "CanvasListOpenResult" + "title": "CanvasListOpenResult", + "stability": "experimental" }, "CanvasOpenRequest": { "type": "object", @@ -8042,7 +8542,8 @@ ], "additionalProperties": false, "description": "Canvas open parameters.", - "title": "CanvasOpenRequest" + "title": "CanvasOpenRequest", + "stability": "experimental" }, "CanvasProviderCloseRequest": { "type": "object", @@ -8075,7 +8576,8 @@ ], "additionalProperties": false, "description": "Canvas close parameters sent to the provider.", - "title": "CanvasProviderCloseRequest" + "title": "CanvasProviderCloseRequest", + "stability": "experimental" }, "CanvasProviderInvokeActionRequest": { "type": "object", @@ -8117,7 +8619,8 @@ ], "additionalProperties": false, "description": "Canvas action invocation parameters sent to the provider.", - "title": "CanvasProviderInvokeActionRequest" + "title": "CanvasProviderInvokeActionRequest", + "stability": "experimental" }, "CanvasProviderOpenRequest": { "type": "object", @@ -8154,7 +8657,8 @@ ], "additionalProperties": false, "description": "Canvas open parameters sent to the provider.", - "title": "CanvasProviderOpenRequest" + "title": "CanvasProviderOpenRequest", + "stability": "experimental" }, "CanvasProviderOpenResult": { "type": "object", @@ -8174,7 +8678,8 @@ }, "additionalProperties": false, "description": "Canvas open result returned by the provider.", - "title": "CanvasProviderOpenResult" + "title": "CanvasProviderOpenResult", + "stability": "experimental" }, "CanvasSessionContext": { "type": "object", @@ -8186,7 +8691,20 @@ }, "additionalProperties": false, "description": "Session context supplied by the runtime.", - "title": "CanvasSessionContext" + "title": "CanvasSessionContext", + "stability": "experimental" + }, + "CapiSessionOptions": { + "type": "object", + "properties": { + "enableWebSocketResponses": { + "type": "boolean", + "description": "Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable." + } + }, + "additionalProperties": false, + "description": "Options scoped to the built-in CAPI (Copilot API) provider.", + "title": "CapiSessionOptions" }, "CommandList": { "type": "object", @@ -8330,8 +8848,8 @@ }, "controller": { "description": "In-process ExtensionController delegate (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. The post-SDK extension surface exposes list/enable/disable/reload via dedicated RPCs served by the runtime.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -8550,8 +9068,8 @@ "host" ], "additionalProperties": false, - "title": "CopilotApiTokenAuthInfo", - "description": "Schema for the `CopilotApiTokenAuthInfo` type." + "description": "Schema for the `CopilotApiTokenAuthInfo` type.", + "title": "CopilotApiTokenAuthInfo" }, "CopilotUserResponse": { "type": "object", @@ -8698,6 +9216,9 @@ "restricted_telemetry": { "type": "boolean" }, + "is_staff": { + "type": "boolean" + }, "token_based_billing": { "type": "boolean" }, @@ -8750,8 +9271,8 @@ } }, "additionalProperties": false, - "title": "CopilotUserResponseEndpoints", - "description": "Schema for the `CopilotUserResponseEndpoints` type." + "description": "Schema for the `CopilotUserResponseEndpoints` type.", + "title": "CopilotUserResponseEndpoints" }, "CopilotUserResponseQuotaSnapshots": { "type": "object", @@ -8818,9 +9339,9 @@ } ] }, + "description": "Schema for the `CopilotUserResponseQuotaSnapshots` type.", "title": "CopilotUserResponseQuotaSnapshots", - "x-opaque-json": true, - "description": "Schema for the `CopilotUserResponseQuotaSnapshots` type." + "x-opaque-json": true }, "CopilotUserResponseQuotaSnapshotsChat": { "type": "object", @@ -8863,8 +9384,8 @@ } }, "additionalProperties": false, - "title": "CopilotUserResponseQuotaSnapshotsChat", - "description": "Schema for the `CopilotUserResponseQuotaSnapshotsChat` type." + "description": "Schema for the `CopilotUserResponseQuotaSnapshotsChat` type.", + "title": "CopilotUserResponseQuotaSnapshotsChat" }, "CopilotUserResponseQuotaSnapshotsCompletions": { "type": "object", @@ -8907,8 +9428,8 @@ } }, "additionalProperties": false, - "title": "CopilotUserResponseQuotaSnapshotsCompletions", - "description": "Schema for the `CopilotUserResponseQuotaSnapshotsCompletions` type." + "description": "Schema for the `CopilotUserResponseQuotaSnapshotsCompletions` type.", + "title": "CopilotUserResponseQuotaSnapshotsCompletions" }, "CopilotUserResponseQuotaSnapshotsPremiumInteractions": { "type": "object", @@ -8951,8 +9472,8 @@ } }, "additionalProperties": false, - "title": "CopilotUserResponseQuotaSnapshotsPremiumInteractions", - "description": "Schema for the `CopilotUserResponseQuotaSnapshotsPremiumInteractions` type." + "description": "Schema for the `CopilotUserResponseQuotaSnapshotsPremiumInteractions` type.", + "title": "CopilotUserResponseQuotaSnapshotsPremiumInteractions" }, "CurrentModel": { "type": "object", @@ -9062,7 +9583,8 @@ ], "additionalProperties": false, "description": "Canvas available in the current session.", - "title": "DiscoveredCanvas" + "title": "DiscoveredCanvas", + "stability": "experimental" }, "DiscoveredMcpServer": { "type": "object", @@ -9081,6 +9603,14 @@ "$ref": "#/definitions/McpServerSource", "description": "Configuration source: user, workspace, plugin, or builtin" }, + "sourcePlugin": { + "type": "string", + "description": "Plugin name that provided this server, when source is plugin." + }, + "sourcePluginVersion": { + "type": "string", + "description": "Plugin version that provided this server, when source is plugin." + }, "enabled": { "type": "boolean", "description": "Whether the server is enabled (not in the disabled list)" @@ -9092,8 +9622,8 @@ "enabled" ], "additionalProperties": false, - "title": "DiscoveredMcpServer", - "description": "Schema for the `DiscoveredMcpServer` type." + "description": "Schema for the `DiscoveredMcpServer` type.", + "title": "DiscoveredMcpServer" }, "DiscoveredMcpServerType": { "type": "string", @@ -9134,8 +9664,8 @@ "blob" ], "additionalProperties": false, - "title": "EmbeddedBlobResourceContents", - "description": "Schema for the `EmbeddedBlobResourceContents` type." + "description": "Schema for the `EmbeddedBlobResourceContents` type.", + "title": "EmbeddedBlobResourceContents" }, "EmbeddedTextResourceContents": { "type": "object", @@ -9158,8 +9688,8 @@ "text" ], "additionalProperties": false, - "title": "EmbeddedTextResourceContents", - "description": "Schema for the `EmbeddedTextResourceContents` type." + "description": "Schema for the `EmbeddedTextResourceContents` type.", + "title": "EmbeddedTextResourceContents" }, "EnqueueCommandParams": { "type": "object", @@ -9227,8 +9757,8 @@ "envVar" ], "additionalProperties": false, - "title": "EnvAuthInfo", - "description": "Schema for the `EnvAuthInfo` type." + "description": "Schema for the `EnvAuthInfo` type.", + "title": "EnvAuthInfo" }, "EventLogReadRequest": { "type": "object", @@ -9247,8 +9777,8 @@ "type": "integer", "minimum": 0, "maximum": 30000, - "description": "Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen).", - "format": "duration" + "format": "duration", + "description": "Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen)." }, "types": { "$ref": "#/definitions/EventLogTypes", @@ -9435,8 +9965,8 @@ "status" ], "additionalProperties": false, - "title": "Extension", - "description": "Schema for the `Extension` type." + "description": "Schema for the `Extension` type.", + "title": "Extension" }, "ExtensionContextPushInput": { "type": "object", @@ -9608,7 +10138,6 @@ "required": [ "textResultForLlm" ], - "additionalProperties": true, "description": "Expanded external tool result payload", "title": "ExternalToolTextResultForLlm" }, @@ -10045,8 +10574,8 @@ "token" ], "additionalProperties": false, - "title": "GhCliAuthInfo", - "description": "Schema for the `GhCliAuthInfo` type." + "description": "Schema for the `GhCliAuthInfo` type.", + "title": "GhCliAuthInfo" }, "HandlePendingToolCallRequest": { "type": "object", @@ -10288,8 +10817,8 @@ "hmac" ], "additionalProperties": false, - "title": "HMACAuthInfo", - "description": "Schema for the `HMACAuthInfo` type." + "description": "Schema for the `HMACAuthInfo` type.", + "title": "HMACAuthInfo" }, "InstalledPlugin": { "type": "object", @@ -10330,8 +10859,8 @@ "enabled" ], "additionalProperties": false, - "title": "InstalledPlugin", - "description": "Schema for the `InstalledPlugin` type." + "description": "Schema for the `InstalledPlugin` type.", + "title": "InstalledPlugin" }, "InstalledPluginInfo": { "type": "object", @@ -10407,8 +10936,8 @@ "repo" ], "additionalProperties": false, - "title": "InstalledPluginSourceGitHub", - "description": "Schema for the `InstalledPluginSourceGitHub` type." + "description": "Schema for the `InstalledPluginSourceGitHub` type.", + "title": "InstalledPluginSourceGitHub" }, "InstalledPluginSourceLocal": { "type": "object", @@ -10427,8 +10956,8 @@ "path" ], "additionalProperties": false, - "title": "InstalledPluginSourceLocal", - "description": "Schema for the `InstalledPluginSourceLocal` type." + "description": "Schema for the `InstalledPluginSourceLocal` type.", + "title": "InstalledPluginSourceLocal" }, "InstalledPluginSourceUrl": { "type": "object", @@ -10454,8 +10983,90 @@ "url" ], "additionalProperties": false, - "title": "InstalledPluginSourceUrl", - "description": "Schema for the `InstalledPluginSourceUrl` type." + "description": "Schema for the `InstalledPluginSourceUrl` type.", + "title": "InstalledPluginSourceUrl" + }, + "InstructionDiscoveryPath": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "Absolute path of the file or directory (may not exist on disk yet)" + }, + "location": { + "$ref": "#/definitions/InstructionDiscoveryPathLocation", + "description": "Which tier this target belongs to" + }, + "kind": { + "$ref": "#/definitions/InstructionDiscoveryPathKind", + "description": "Whether the target is a single file or a directory of instruction files" + }, + "preferredForCreation": { + "type": "boolean", + "description": "Whether this is the canonical target to create new instructions in its tier. At most one entry per tier is preferred." + }, + "projectPath": { + "type": "string", + "description": "The input project path this target was derived from (only for repository targets)" + } + }, + "required": [ + "path", + "location", + "kind", + "preferredForCreation" + ], + "additionalProperties": false, + "description": "Schema for the `InstructionDiscoveryPath` type.", + "title": "InstructionDiscoveryPath" + }, + "InstructionDiscoveryPathKind": { + "type": "string", + "enum": [ + "file", + "directory" + ], + "description": "Whether the target is a single file or a directory of instruction files", + "title": "InstructionDiscoveryPathKind", + "x-enumDescriptions": { + "file": "The target is a single instruction file.", + "directory": "The target is a directory that holds instruction files." + } + }, + "InstructionDiscoveryPathList": { + "type": "object", + "properties": { + "paths": { + "type": "array", + "items": { + "$ref": "#/definitions/InstructionDiscoveryPath" + }, + "description": "Canonical instruction create/discovery files and directories, in priority order" + } + }, + "required": [ + "paths" + ], + "additionalProperties": false, + "description": "Canonical files and directories where custom instructions can be created so the runtime will recognize them.", + "title": "InstructionDiscoveryPathList" + }, + "InstructionDiscoveryPathLocation": { + "type": "string", + "enum": [ + "user", + "repository", + "working-directory", + "plugin" + ], + "description": "Which tier this target belongs to", + "title": "InstructionDiscoveryPathLocation", + "x-enumDescriptions": { + "user": "Instructions live in user-level configuration.", + "repository": "Instructions live in repository-level configuration.", + "working-directory": "Instructions live under the current working directory.", + "plugin": "Instructions live in plugin-provided configuration." + } }, "InstructionsDiscoverRequest": { "type": "object", @@ -10476,6 +11087,25 @@ "description": "Optional project paths to include in instruction discovery.", "title": "InstructionsDiscoverRequest" }, + "InstructionsGetDiscoveryPathsRequest": { + "type": "object", + "properties": { + "projectPaths": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional list of project directory paths. When omitted or empty, only the user-level targets are returned." + }, + "excludeHostInstructions": { + "type": "boolean", + "description": "When true, omit the host's user-level instruction targets, leaving only repository targets. For multitenant deployments (mirrors `discover`'s `excludeHostInstructions`)." + } + }, + "additionalProperties": false, + "description": "Optional project paths to include when enumerating instruction discovery targets.", + "title": "InstructionsGetDiscoveryPathsRequest" + }, "InstructionsGetSourcesResult": { "type": "object", "properties": { @@ -10550,8 +11180,8 @@ "location" ], "additionalProperties": false, - "title": "InstructionSource", - "description": "Schema for the `InstructionSource` type." + "description": "Schema for the `InstructionSource` type.", + "title": "InstructionSource" }, "InstructionSourceLocation": { "type": "string", @@ -10593,6 +11223,241 @@ "plugin": "Instructions supplied by an installed plugin." } }, + "LlmInferenceHeaders": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "HTTP headers as a map from lowercased header name to a list of values. Multi-valued headers (e.g. Set-Cookie) preserve all values.", + "title": "LlmInferenceHeaders" + }, + "LlmInferenceHttpRequestChunkRequest": { + "type": "object", + "properties": { + "requestId": { + "type": "string", + "description": "Matches the requestId from the originating httpRequestStart frame." + }, + "data": { + "type": "string", + "description": "Body byte range. UTF-8 text when `binary` is absent or false; base64-encoded bytes when `binary` is true. May be empty." + }, + "binary": { + "type": "boolean", + "description": "When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text." + }, + "end": { + "type": "boolean", + "description": "When true, this is the final body chunk for the request. The SDK may rely on having received an end-marked chunk before treating the request body as complete." + }, + "cancel": { + "type": "boolean", + "description": "When true, the runtime is cancelling the in-flight request (e.g. upstream consumer aborted). `data` is ignored. Implies end-of-request." + }, + "cancelReason": { + "type": "string", + "description": "Optional human-readable reason for the cancellation, propagated for logging." + } + }, + "required": [ + "requestId", + "data" + ], + "additionalProperties": false, + "description": "A request body chunk or cancellation signal.", + "title": "LlmInferenceHttpRequestChunkRequest" + }, + "LlmInferenceHttpRequestChunkResult": { + "type": "object", + "properties": {}, + "additionalProperties": false, + "description": "Acknowledgement. The SDK is free to ignore the ack and treat chunk delivery as fire-and-forget.", + "title": "LlmInferenceHttpRequestChunkResult" + }, + "LlmInferenceHttpRequestStartRequest": { + "type": "object", + "properties": { + "requestId": { + "type": "string", + "description": "Opaque runtime-minted id, unique per in-flight request. The SDK uses this to correlate httpRequestChunk frames and to address its httpResponseStart / httpResponseChunk replies back to the runtime." + }, + "sessionId": { + "type": "string", + "description": "Id of the runtime session that triggered this request, when one is in scope. Absent for requests issued outside any session (e.g. startup model-catalog or capability resolution). This is a payload field — not a dispatch key — because the client-global API is registered process-wide rather than per session." + }, + "method": { + "type": "string", + "description": "HTTP method, e.g. GET, POST." + }, + "url": { + "type": "string", + "description": "Absolute request URL." + }, + "headers": { + "$ref": "#/definitions/LlmInferenceHeaders" + }, + "transport": { + "$ref": "#/definitions/LlmInferenceHttpRequestStartTransport", + "description": "Transport the runtime would otherwise use for this request. `http` (the default when absent) covers plain HTTP and SSE responses; `websocket` indicates a full-duplex message channel where each body chunk maps to one WebSocket message and the `binary` flag distinguishes text from binary frames. The SDK consumer uses this to decide whether to service the request with an HTTP client or a WebSocket client. It is the one piece of request metadata the consumer cannot reliably infer from the URL or headers alone." + } + }, + "required": [ + "requestId", + "method", + "url", + "headers" + ], + "additionalProperties": false, + "description": "The head of an outbound model-layer HTTP request.", + "title": "LlmInferenceHttpRequestStartRequest" + }, + "LlmInferenceHttpRequestStartResult": { + "type": "object", + "properties": {}, + "additionalProperties": false, + "description": "Acknowledgement. Returning successfully simply means the SDK accepted the start frame; it does not imply the request will succeed.", + "title": "LlmInferenceHttpRequestStartResult" + }, + "LlmInferenceHttpRequestStartTransport": { + "type": "string", + "enum": [ + "http", + "websocket" + ], + "description": "Transport the runtime would otherwise use for this request. `http` (the default when absent) covers plain HTTP and SSE responses; `websocket` indicates a full-duplex message channel where each body chunk maps to one WebSocket message and the `binary` flag distinguishes text from binary frames. The SDK consumer uses this to decide whether to service the request with an HTTP client or a WebSocket client. It is the one piece of request metadata the consumer cannot reliably infer from the URL or headers alone.", + "title": "LlmInferenceHttpRequestStartTransport", + "x-enumDescriptions": { + "http": "Plain HTTP or SSE response. Each body chunk is an opaque byte range; the response is a status line, headers, and a (possibly streamed) body.", + "websocket": "Full-duplex WebSocket channel. Each body chunk maps to exactly one WebSocket message and the `binary` flag distinguishes text from binary frames; request and response chunks flow concurrently." + } + }, + "LlmInferenceHttpResponseChunkError": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable failure description." + }, + "code": { + "type": "string", + "description": "Optional machine-readable error code." + } + }, + "required": [ + "message" + ], + "additionalProperties": false, + "description": "Set to terminate the response with a transport-level failure. Implies end-of-stream; any further chunks for this requestId are ignored.", + "title": "LlmInferenceHttpResponseChunkError" + }, + "LlmInferenceHttpResponseChunkRequest": { + "type": "object", + "properties": { + "requestId": { + "type": "string", + "description": "Matches the requestId from the originating httpRequestStart frame." + }, + "data": { + "type": "string", + "description": "Body byte range. UTF-8 text when `binary` is absent or false; base64-encoded bytes when `binary` is true. May be empty (e.g. when the response body is empty: send a single chunk with empty data and end=true)." + }, + "binary": { + "type": "boolean", + "description": "When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text." + }, + "end": { + "type": "boolean", + "description": "When true, this is the final body chunk for the response. The runtime treats the response body as complete after receiving an end-marked chunk." + }, + "error": { + "$ref": "#/definitions/LlmInferenceHttpResponseChunkError", + "description": "Set to terminate the response with a transport-level failure. Implies end-of-stream; any further chunks for this requestId are ignored." + } + }, + "required": [ + "requestId", + "data" + ], + "additionalProperties": false, + "description": "A response body chunk or terminal error.", + "title": "LlmInferenceHttpResponseChunkRequest" + }, + "LlmInferenceHttpResponseChunkResult": { + "type": "object", + "properties": { + "accepted": { + "type": "boolean", + "description": "True when the chunk was matched to a pending request; false when unknown." + } + }, + "required": [ + "accepted" + ], + "additionalProperties": false, + "description": "Whether the chunk was accepted.", + "title": "LlmInferenceHttpResponseChunkResult" + }, + "LlmInferenceHttpResponseStartRequest": { + "type": "object", + "properties": { + "requestId": { + "type": "string", + "description": "Matches the requestId from the originating httpRequestStart frame." + }, + "status": { + "type": "integer", + "description": "HTTP status code." + }, + "statusText": { + "type": "string", + "description": "Optional HTTP status reason phrase." + }, + "headers": { + "$ref": "#/definitions/LlmInferenceHeaders" + } + }, + "required": [ + "requestId", + "status", + "headers" + ], + "additionalProperties": false, + "description": "Response head.", + "title": "LlmInferenceHttpResponseStartRequest" + }, + "LlmInferenceHttpResponseStartResult": { + "type": "object", + "properties": { + "accepted": { + "type": "boolean", + "description": "True when the response start was matched to a pending request; false when unknown." + } + }, + "required": [ + "accepted" + ], + "additionalProperties": false, + "description": "Whether the start frame was accepted.", + "title": "LlmInferenceHttpResponseStartResult" + }, + "LlmInferenceSetProviderResult": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the provider was set successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Indicates whether the calling client was registered as the LLM inference provider.", + "title": "LlmInferenceSetProviderResult" + }, "LocalSessionMetadataValue": { "type": "object", "properties": { @@ -10645,8 +11510,8 @@ "isRemote" ], "additionalProperties": false, - "title": "LocalSessionMetadataValue", - "description": "Schema for the `LocalSessionMetadataValue` type." + "description": "Schema for the `LocalSessionMetadataValue` type.", + "title": "LocalSessionMetadataValue" }, "LogRequest": { "type": "object", @@ -10837,8 +11702,8 @@ "success" ], "additionalProperties": false, - "title": "MarketplaceRefreshEntry", - "description": "Schema for the `MarketplaceRefreshEntry` type." + "description": "Schema for the `MarketplaceRefreshEntry` type.", + "title": "MarketplaceRefreshEntry" }, "MarketplaceRefreshResult": { "type": "object", @@ -10896,8 +11761,8 @@ "name" ], "additionalProperties": false, - "title": "McpAllowedServer", - "description": "Schema for the `McpAllowedServer` type." + "description": "Schema for the `McpAllowedServer` type.", + "title": "McpAllowedServer" }, "McpAppsCallToolRequest": { "type": "object", @@ -11091,13 +11956,13 @@ "fullscreen", "pip" ], + "description": "Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration.", "title": "McpAppsHostContextDetailsAvailableDisplayMode", "x-enumDescriptions": { "inline": "Rendered inline within the host conversation surface", "fullscreen": "Rendered as a fullscreen overlay", "pip": "Rendered as a picture-in-picture floating panel" - }, - "description": "Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration." + } }, "McpAppsHostContextDetailsDisplayMode": { "type": "string", @@ -11258,8 +12123,8 @@ "uri" ], "additionalProperties": false, - "title": "McpAppsResourceContent", - "description": "Schema for the `McpAppsResourceContent` type." + "description": "Schema for the `McpAppsResourceContent` type.", + "title": "McpAppsResourceContent" }, "McpAppsSetHostContextDetails": { "type": "object", @@ -11307,13 +12172,13 @@ "fullscreen", "pip" ], + "description": "Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration.", "title": "McpAppsSetHostContextDetailsAvailableDisplayMode", "x-enumDescriptions": { "inline": "Rendered inline within the host conversation surface", "fullscreen": "Rendered as a fullscreen overlay", "pip": "Rendered as a picture-in-picture floating panel" - }, - "description": "Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration." + } }, "McpAppsSetHostContextDetailsDisplayMode": { "type": "string", @@ -11534,8 +12399,8 @@ "properties": { "authInfo": { "description": "Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire).", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -11637,10 +12502,6 @@ "description": "Name of the MCP server that initiated the sampling request" }, "mcpRequestId": { - "type": [ - "string", - "number" - ], "description": "The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle).", "x-opaque-json": true }, @@ -11701,8 +12562,8 @@ "reason" ], "additionalProperties": false, - "title": "McpFilteredServer", - "description": "Schema for the `McpFilteredServer` type." + "description": "Schema for the `McpFilteredServer` type.", + "title": "McpFilteredServer" }, "McpHostState": { "type": "object", @@ -11834,6 +12695,54 @@ "description": "Tools exposed by the connected MCP server. Throws when the server is not connected.", "title": "McpListToolsResult" }, + "McpOauthHandlePendingRequest": { + "type": "object", + "properties": { + "requestId": { + "type": "string", + "description": "OAuth request identifier from the mcp.oauth_required event" + }, + "result": { + "$ref": "#/definitions/McpOauthPendingRequestResponse", + "description": "Host response to the pending OAuth request." + } + }, + "required": [ + "requestId", + "result" + ], + "additionalProperties": false, + "description": "Pending MCP OAuth request ID and host-provided token or cancellation response.", + "title": "McpOauthHandlePendingRequest" + }, + "McpOauthHandlePendingResult": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the response was accepted. False if the request was unknown, timed out, or already resolved." + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Indicates whether the pending MCP OAuth response was accepted.", + "title": "McpOauthHandlePendingResult" + }, + "McpOauthLoginGrantType": { + "type": "string", + "enum": [ + "authorization_code", + "client_credentials" + ], + "description": "OAuth grant type override for this login.", + "title": "McpOauthLoginGrantType", + "x-enumDescriptions": { + "authorization_code": "Interactive browser-based OAuth flow using an authorization code, typically with PKCE.", + "client_credentials": "Headless OAuth flow where a confidential client authenticates directly with a client secret." + } + }, "McpOauthLoginRequest": { "type": "object", "properties": { @@ -11854,13 +12763,29 @@ "callbackSuccessMessage": { "type": "string", "description": "Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return." + }, + "clientId": { + "type": "string", + "description": "Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration." + }, + "clientSecret": { + "type": "string", + "description": "Optional OAuth client secret override for this login. The runtime treats this as an ephemeral host-owned secret, uses it for this authentication attempt and does not persist it." + }, + "publicClient": { + "type": "boolean", + "description": "Optional override indicating whether the static OAuth client is public. When false, the runtime treats it as confidential and uses the per-login clientSecret if provided, otherwise retrieving the client secret from the MCP OAuth secret store." + }, + "grantType": { + "$ref": "#/definitions/McpOauthLoginGrantType", + "description": "Optional OAuth grant type override for this login. Defaults to the server configuration, or authorization_code when no grant type is specified." } }, "required": [ "serverName" ], "additionalProperties": false, - "description": "Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy.", + "description": "Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.", "title": "McpOauthLoginRequest" }, "McpOauthLoginResult": { @@ -11876,6 +12801,54 @@ "description": "OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.", "title": "McpOauthLoginResult" }, + "McpOauthPendingRequestResponse": { + "anyOf": [ + { + "type": "object", + "properties": { + "accessToken": { + "type": "string", + "description": "Access token acquired by the SDK host" + }, + "tokenType": { + "type": "string", + "description": "OAuth token type. Defaults to Bearer when omitted." + }, + "refreshToken": { + "type": "string", + "description": "Refresh token supplied by the host, if available." + }, + "expiresIn": { + "type": "integer", + "minimum": 1, + "description": "Token lifetime in seconds, if known." + }, + "kind": { + "type": "string", + "const": "token" + } + }, + "required": [ + "kind", + "accessToken" + ] + }, + { + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "cancelled" + } + }, + "required": [ + "kind" + ] + } + ], + "description": "Host response to the pending OAuth request.", + "title": "McpOauthPendingRequestResponse" + }, "McpOauthRespondRequest": { "type": "object", "properties": { @@ -11885,8 +12858,8 @@ }, "provider": { "description": "In-process OAuthClientProvider instance, or omitted to deny. Marked internal: cannot be serialized across the JSON-RPC boundary.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -11913,18 +12886,18 @@ }, "client": { "description": "In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" }, "transport": { "description": "In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" }, "config": { "description": "In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -11943,8 +12916,8 @@ "properties": { "config": { "description": "Opaque runtime MCP reload configuration. Marked internal: an in-process runtime shape (reloadMcpServers throws over the wire).", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -11979,8 +12952,8 @@ }, "config": { "description": "Opaque server configuration (MCPServerConfig). Marked internal: an in-process runtime shape supplied only by in-process CLI callers.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -12047,6 +13020,14 @@ "$ref": "#/definitions/McpServerSource", "description": "Configuration source: user, workspace, plugin, or builtin" }, + "sourcePlugin": { + "type": "string", + "description": "Plugin name that provided this server, when source is plugin." + }, + "sourcePluginVersion": { + "type": "string", + "description": "Plugin version that provided this server, when source is plugin." + }, "error": { "type": "string", "description": "Error message if the server failed to connect" @@ -12057,8 +13038,8 @@ "status" ], "additionalProperties": false, - "title": "McpServer", - "description": "Schema for the `McpServer` type." + "description": "Schema for the `McpServer` type.", + "title": "McpServer" }, "McpServerAuthConfig": { "anyOf": [ @@ -12084,7 +13065,6 @@ "description": "Fixed port for the OAuth redirect callback server." } }, - "additionalProperties": true, "description": "Authentication settings with optional redirect port configuration.", "title": "McpServerAuthConfigRedirectPort" }, @@ -12141,8 +13121,8 @@ "timeout": { "type": "integer", "exclusiveMinimum": 0, - "description": "Timeout in milliseconds for tool calls to this server.", - "format": "duration" + "format": "duration", + "description": "Timeout in milliseconds for tool calls to this server." }, "oidc": { "$ref": "#/definitions/McpServerAuthConfig", @@ -12236,8 +13216,8 @@ "timeout": { "type": "integer", "exclusiveMinimum": 0, - "description": "Timeout in milliseconds for tool calls to this server.", - "format": "duration" + "format": "duration", + "description": "Timeout in milliseconds for tool calls to this server." }, "oidc": { "$ref": "#/definitions/McpServerAuthConfig", @@ -12431,8 +13411,8 @@ }, "config": { "description": "Opaque server configuration (MCPServerConfig). Marked internal: an in-process runtime shape supplied only by in-process CLI callers.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -12500,8 +13480,8 @@ "name" ], "additionalProperties": false, - "title": "McpTools", - "description": "Schema for the `McpTools` type." + "description": "Schema for the `McpTools` type.", + "title": "McpTools" }, "McpUnregisterExternalClientRequest": { "type": "object", @@ -12815,8 +13795,8 @@ "capabilities" ], "additionalProperties": false, - "title": "Model", - "description": "Schema for the `Model` type." + "description": "Schema for the `Model` type.", + "title": "Model" }, "ModelBilling": { "type": "object", @@ -12850,7 +13830,18 @@ "cachePrice": { "type": "number", "minimum": 0, - "description": "AI Credits cost per billing batch of cached tokens" + "description": "Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens", + "deprecated": true + }, + "cacheReadPrice": { + "type": "number", + "minimum": 0, + "description": "AI Credits cost per billing batch of cached (read) tokens" + }, + "cacheWritePrice": { + "type": "number", + "minimum": 0, + "description": "AI Credits cost per billing batch of cache-write (cache creation) tokens." }, "batchSize": { "type": "integer", @@ -12859,7 +13850,12 @@ }, "contextMax": { "type": "integer", - "description": "Prompt token budget (max_prompt_tokens) for the default tier. The total context window is this value plus the model's max_output_tokens." + "description": "Use maxPromptTokens instead. Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens.", + "deprecated": true + }, + "maxPromptTokens": { + "type": "integer", + "description": "Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens." }, "longContext": { "$ref": "#/definitions/ModelBillingTokenPricesLongContext", @@ -12886,11 +13882,27 @@ "cachePrice": { "type": "number", "minimum": 0, - "description": "AI Credits cost per billing batch of cached tokens" + "description": "Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens", + "deprecated": true + }, + "cacheReadPrice": { + "type": "number", + "minimum": 0, + "description": "AI Credits cost per billing batch of cached (read) tokens" + }, + "cacheWritePrice": { + "type": "number", + "minimum": 0, + "description": "AI Credits cost per billing batch of cache-write (cache creation) tokens." }, "contextMax": { "type": "integer", - "description": "Prompt token budget (max_prompt_tokens) for the long context tier. The total context window is this value plus the model's max_output_tokens." + "description": "Use maxPromptTokens instead. Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens.", + "deprecated": true + }, + "maxPromptTokens": { + "type": "integer", + "description": "Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens." } }, "additionalProperties": false, @@ -12983,7 +13995,7 @@ } }, "additionalProperties": false, - "description": "Initial model capability overrides.", + "description": "Optional capability overrides (vision, tool_calls, reasoning, etc.).", "title": "ModelCapabilitiesOverride" }, "ModelCapabilitiesOverrideLimits": { @@ -13227,7 +14239,7 @@ "properties": { "modelId": { "type": "string", - "description": "Model identifier to switch to" + "description": "Model selection id to switch to, as returned by `list`. A bare id (e.g. `claude-sonnet-4.6`) names a Copilot (CAPI) model; a provider-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a registry BYOK model." }, "reasoningEffort": { "type": "string", @@ -13280,6 +14292,61 @@ "description": "Agent interaction mode to apply to the session.", "title": "ModeSetRequest" }, + "NamedProviderConfig": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Stable identifier referenced by BYOK model definitions. Must not contain '/'." + }, + "type": { + "$ref": "#/definitions/ProviderConfigType", + "description": "Provider type. Defaults to \"openai\" for generic OpenAI-compatible APIs." + }, + "wireApi": { + "$ref": "#/definitions/ProviderConfigWireApi", + "description": "Wire API format (openai/azure only). Defaults to \"completions\"." + }, + "transport": { + "$ref": "#/definitions/ProviderConfigTransport", + "description": "Provider transport. Defaults to \"http\"." + }, + "baseUrl": { + "type": "string", + "description": "API endpoint URL." + }, + "apiKey": { + "type": "string", + "description": "API key. Optional for local providers like Ollama." + }, + "bearerToken": { + "type": "string", + "description": "Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set." + }, + "azure": { + "$ref": "#/definitions/ProviderConfigAzure", + "description": "Azure-specific provider options." + }, + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Custom HTTP headers to include in all outbound requests to the provider." + }, + "hasBearerTokenProvider": { + "type": "boolean", + "description": "When true, the SDK client supplies bearer tokens on demand: the runtime calls the client-session `providerToken.getToken` callback before each request and applies the returned token as an `Authorization: Bearer ` header. This is the bearer/OAuth scheme used by Azure AD / managed-identity tokens and provider OAuth access tokens (including Anthropic's), not a provider-specific API-key header such as Anthropic's `x-api-key`. The token-acquiring function itself stays on the SDK side and is never serialized; only this flag crosses the wire. When set alongside `apiKey`/`bearerToken`, the callback takes precedence: the runtime applies the token returned by `providerToken.getToken` as the `Authorization: Bearer` header for each request and does not send the static credential." + } + }, + "required": [ + "name", + "baseUrl" + ], + "additionalProperties": false, + "description": "A named BYOK provider connection (transport + credentials).", + "title": "NamedProviderConfig" + }, "NameGetResult": { "type": "object", "properties": { @@ -13345,6 +14412,19 @@ "description": "New friendly name to apply to the session.", "title": "NameSetRequest" }, + "OmittedBinaryOmittedReason": { + "type": "string", + "enum": [ + "too_large", + "asset_unavailable" + ], + "description": "Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable", + "title": "OmittedBinaryOmittedReason", + "x-enumDescriptions": { + "too_large": "Bytes exceeded the session's inline size limit.", + "asset_unavailable": "The referenced binary asset could not be found (e.g. a truncated log)." + } + }, "OpenCanvasInstance": { "type": "object", "properties": { @@ -13379,26 +14459,17 @@ "input": { "description": "Input supplied when the instance was opened", "x-opaque-json": true - }, - "reopen": { - "type": "boolean", - "description": "Whether this snapshot came from an idempotent reopen" - }, - "availability": { - "$ref": "#/definitions/CanvasInstanceAvailability", - "description": "Runtime-controlled routing state for an open canvas instance." } }, "required": [ "instanceId", "extensionId", - "canvasId", - "reopen", - "availability" + "canvasId" ], "additionalProperties": false, "description": "Open canvas instance snapshot.", - "title": "OpenCanvasInstance" + "title": "OpenCanvasInstance", + "stability": "experimental" }, "OptionsUpdateAdditionalContentExclusionPolicy": { "type": "object", @@ -13410,10 +14481,6 @@ } }, "last_updated_at": { - "type": [ - "string", - "number" - ], "x-opaque-json": true }, "scope": { @@ -13426,9 +14493,8 @@ "last_updated_at", "scope" ], - "additionalProperties": true, - "title": "OptionsUpdateAdditionalContentExclusionPolicy", - "description": "Schema for the `OptionsUpdateAdditionalContentExclusionPolicy` type." + "description": "Schema for the `OptionsUpdateAdditionalContentExclusionPolicy` type.", + "title": "OptionsUpdateAdditionalContentExclusionPolicy" }, "OptionsUpdateAdditionalContentExclusionPolicyRule": { "type": "object", @@ -13460,9 +14526,8 @@ "paths", "source" ], - "additionalProperties": true, - "title": "OptionsUpdateAdditionalContentExclusionPolicyRule", - "description": "Schema for the `OptionsUpdateAdditionalContentExclusionPolicyRule` type." + "description": "Schema for the `OptionsUpdateAdditionalContentExclusionPolicyRule` type.", + "title": "OptionsUpdateAdditionalContentExclusionPolicyRule" }, "OptionsUpdateAdditionalContentExclusionPolicyRuleSource": { "type": "object", @@ -13479,8 +14544,8 @@ "type" ], "additionalProperties": false, - "title": "OptionsUpdateAdditionalContentExclusionPolicyRuleSource", - "description": "Schema for the `OptionsUpdateAdditionalContentExclusionPolicyRuleSource` type." + "description": "Schema for the `OptionsUpdateAdditionalContentExclusionPolicyRuleSource` type.", + "title": "OptionsUpdateAdditionalContentExclusionPolicyRuleSource" }, "OptionsUpdateAdditionalContentExclusionPolicyScope": { "type": "string", @@ -13488,12 +14553,12 @@ "repo", "all" ], + "description": "Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration.", "title": "OptionsUpdateAdditionalContentExclusionPolicyScope", "x-enumDescriptions": { "repo": "The content exclusion policy applies to the current repository.", "all": "The content exclusion policy applies across all repositories." - }, - "description": "Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration." + } }, "OptionsUpdateContextTier": { "type": "string", @@ -13566,8 +14631,8 @@ "request" ], "additionalProperties": false, - "title": "PendingPermissionRequest", - "description": "Schema for the `PendingPermissionRequest` type." + "description": "Schema for the `PendingPermissionRequest` type.", + "title": "PendingPermissionRequest" }, "PendingPermissionRequestList": { "type": "object", @@ -13651,8 +14716,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproved", - "description": "Schema for the `PermissionDecisionApproved` type." + "description": "Schema for the `PermissionDecisionApproved` type.", + "title": "PermissionDecisionApproved" }, "PermissionDecisionApprovedForLocation": { "type": "object", @@ -13677,8 +14742,8 @@ "locationKey" ], "additionalProperties": false, - "title": "PermissionDecisionApprovedForLocation", - "description": "Schema for the `PermissionDecisionApprovedForLocation` type." + "description": "Schema for the `PermissionDecisionApprovedForLocation` type.", + "title": "PermissionDecisionApprovedForLocation" }, "PermissionDecisionApprovedForSession": { "type": "object", @@ -13698,8 +14763,8 @@ "approval" ], "additionalProperties": false, - "title": "PermissionDecisionApprovedForSession", - "description": "Schema for the `PermissionDecisionApprovedForSession` type." + "description": "Schema for the `PermissionDecisionApprovedForSession` type.", + "title": "PermissionDecisionApprovedForSession" }, "PermissionDecisionApproveForLocation": { "type": "object", @@ -13724,8 +14789,8 @@ "locationKey" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForLocation", - "description": "Schema for the `PermissionDecisionApproveForLocation` type." + "description": "Schema for the `PermissionDecisionApproveForLocation` type.", + "title": "PermissionDecisionApproveForLocation" }, "PermissionDecisionApproveForLocationApproval": { "anyOf": [ @@ -13781,8 +14846,8 @@ "commandIdentifiers" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForLocationApprovalCommands", - "description": "Schema for the `PermissionDecisionApproveForLocationApprovalCommands` type." + "description": "Schema for the `PermissionDecisionApproveForLocationApprovalCommands` type.", + "title": "PermissionDecisionApproveForLocationApprovalCommands" }, "PermissionDecisionApproveForLocationApprovalCustomTool": { "type": "object", @@ -13802,8 +14867,8 @@ "toolName" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForLocationApprovalCustomTool", - "description": "Schema for the `PermissionDecisionApproveForLocationApprovalCustomTool` type." + "description": "Schema for the `PermissionDecisionApproveForLocationApprovalCustomTool` type.", + "title": "PermissionDecisionApproveForLocationApprovalCustomTool" }, "PermissionDecisionApproveForLocationApprovalExtensionManagement": { "type": "object", @@ -13822,8 +14887,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForLocationApprovalExtensionManagement", - "description": "Schema for the `PermissionDecisionApproveForLocationApprovalExtensionManagement` type." + "description": "Schema for the `PermissionDecisionApproveForLocationApprovalExtensionManagement` type.", + "title": "PermissionDecisionApproveForLocationApprovalExtensionManagement" }, "PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess": { "type": "object", @@ -13843,8 +14908,8 @@ "extensionName" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess", - "description": "Schema for the `PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess` type." + "description": "Schema for the `PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess` type.", + "title": "PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess" }, "PermissionDecisionApproveForLocationApprovalMcp": { "type": "object", @@ -13872,8 +14937,8 @@ "toolName" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForLocationApprovalMcp", - "description": "Schema for the `PermissionDecisionApproveForLocationApprovalMcp` type." + "description": "Schema for the `PermissionDecisionApproveForLocationApprovalMcp` type.", + "title": "PermissionDecisionApproveForLocationApprovalMcp" }, "PermissionDecisionApproveForLocationApprovalMcpSampling": { "type": "object", @@ -13893,8 +14958,8 @@ "serverName" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForLocationApprovalMcpSampling", - "description": "Schema for the `PermissionDecisionApproveForLocationApprovalMcpSampling` type." + "description": "Schema for the `PermissionDecisionApproveForLocationApprovalMcpSampling` type.", + "title": "PermissionDecisionApproveForLocationApprovalMcpSampling" }, "PermissionDecisionApproveForLocationApprovalMemory": { "type": "object", @@ -13909,8 +14974,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForLocationApprovalMemory", - "description": "Schema for the `PermissionDecisionApproveForLocationApprovalMemory` type." + "description": "Schema for the `PermissionDecisionApproveForLocationApprovalMemory` type.", + "title": "PermissionDecisionApproveForLocationApprovalMemory" }, "PermissionDecisionApproveForLocationApprovalRead": { "type": "object", @@ -13925,8 +14990,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForLocationApprovalRead", - "description": "Schema for the `PermissionDecisionApproveForLocationApprovalRead` type." + "description": "Schema for the `PermissionDecisionApproveForLocationApprovalRead` type.", + "title": "PermissionDecisionApproveForLocationApprovalRead" }, "PermissionDecisionApproveForLocationApprovalWrite": { "type": "object", @@ -13941,8 +15006,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForLocationApprovalWrite", - "description": "Schema for the `PermissionDecisionApproveForLocationApprovalWrite` type." + "description": "Schema for the `PermissionDecisionApproveForLocationApprovalWrite` type.", + "title": "PermissionDecisionApproveForLocationApprovalWrite" }, "PermissionDecisionApproveForSession": { "type": "object", @@ -13965,8 +15030,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForSession", - "description": "Schema for the `PermissionDecisionApproveForSession` type." + "description": "Schema for the `PermissionDecisionApproveForSession` type.", + "title": "PermissionDecisionApproveForSession" }, "PermissionDecisionApproveForSessionApproval": { "anyOf": [ @@ -14022,8 +15087,8 @@ "commandIdentifiers" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForSessionApprovalCommands", - "description": "Schema for the `PermissionDecisionApproveForSessionApprovalCommands` type." + "description": "Schema for the `PermissionDecisionApproveForSessionApprovalCommands` type.", + "title": "PermissionDecisionApproveForSessionApprovalCommands" }, "PermissionDecisionApproveForSessionApprovalCustomTool": { "type": "object", @@ -14043,8 +15108,8 @@ "toolName" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForSessionApprovalCustomTool", - "description": "Schema for the `PermissionDecisionApproveForSessionApprovalCustomTool` type." + "description": "Schema for the `PermissionDecisionApproveForSessionApprovalCustomTool` type.", + "title": "PermissionDecisionApproveForSessionApprovalCustomTool" }, "PermissionDecisionApproveForSessionApprovalExtensionManagement": { "type": "object", @@ -14063,8 +15128,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForSessionApprovalExtensionManagement", - "description": "Schema for the `PermissionDecisionApproveForSessionApprovalExtensionManagement` type." + "description": "Schema for the `PermissionDecisionApproveForSessionApprovalExtensionManagement` type.", + "title": "PermissionDecisionApproveForSessionApprovalExtensionManagement" }, "PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess": { "type": "object", @@ -14084,8 +15149,8 @@ "extensionName" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess", - "description": "Schema for the `PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess` type." + "description": "Schema for the `PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess` type.", + "title": "PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess" }, "PermissionDecisionApproveForSessionApprovalMcp": { "type": "object", @@ -14113,8 +15178,8 @@ "toolName" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForSessionApprovalMcp", - "description": "Schema for the `PermissionDecisionApproveForSessionApprovalMcp` type." + "description": "Schema for the `PermissionDecisionApproveForSessionApprovalMcp` type.", + "title": "PermissionDecisionApproveForSessionApprovalMcp" }, "PermissionDecisionApproveForSessionApprovalMcpSampling": { "type": "object", @@ -14134,8 +15199,8 @@ "serverName" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForSessionApprovalMcpSampling", - "description": "Schema for the `PermissionDecisionApproveForSessionApprovalMcpSampling` type." + "description": "Schema for the `PermissionDecisionApproveForSessionApprovalMcpSampling` type.", + "title": "PermissionDecisionApproveForSessionApprovalMcpSampling" }, "PermissionDecisionApproveForSessionApprovalMemory": { "type": "object", @@ -14150,8 +15215,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForSessionApprovalMemory", - "description": "Schema for the `PermissionDecisionApproveForSessionApprovalMemory` type." + "description": "Schema for the `PermissionDecisionApproveForSessionApprovalMemory` type.", + "title": "PermissionDecisionApproveForSessionApprovalMemory" }, "PermissionDecisionApproveForSessionApprovalRead": { "type": "object", @@ -14166,8 +15231,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForSessionApprovalRead", - "description": "Schema for the `PermissionDecisionApproveForSessionApprovalRead` type." + "description": "Schema for the `PermissionDecisionApproveForSessionApprovalRead` type.", + "title": "PermissionDecisionApproveForSessionApprovalRead" }, "PermissionDecisionApproveForSessionApprovalWrite": { "type": "object", @@ -14182,8 +15247,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproveForSessionApprovalWrite", - "description": "Schema for the `PermissionDecisionApproveForSessionApprovalWrite` type." + "description": "Schema for the `PermissionDecisionApproveForSessionApprovalWrite` type.", + "title": "PermissionDecisionApproveForSessionApprovalWrite" }, "PermissionDecisionApproveOnce": { "type": "object", @@ -14198,8 +15263,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionApproveOnce", - "description": "Schema for the `PermissionDecisionApproveOnce` type." + "description": "Schema for the `PermissionDecisionApproveOnce` type.", + "title": "PermissionDecisionApproveOnce" }, "PermissionDecisionApprovePermanently": { "type": "object", @@ -14219,8 +15284,8 @@ "domain" ], "additionalProperties": false, - "title": "PermissionDecisionApprovePermanently", - "description": "Schema for the `PermissionDecisionApprovePermanently` type." + "description": "Schema for the `PermissionDecisionApprovePermanently` type.", + "title": "PermissionDecisionApprovePermanently" }, "PermissionDecisionCancelled": { "type": "object", @@ -14239,8 +15304,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionCancelled", - "description": "Schema for the `PermissionDecisionCancelled` type." + "description": "Schema for the `PermissionDecisionCancelled` type.", + "title": "PermissionDecisionCancelled" }, "PermissionDecisionDeniedByContentExclusionPolicy": { "type": "object", @@ -14265,8 +15330,8 @@ "message" ], "additionalProperties": false, - "title": "PermissionDecisionDeniedByContentExclusionPolicy", - "description": "Schema for the `PermissionDecisionDeniedByContentExclusionPolicy` type." + "description": "Schema for the `PermissionDecisionDeniedByContentExclusionPolicy` type.", + "title": "PermissionDecisionDeniedByContentExclusionPolicy" }, "PermissionDecisionDeniedByPermissionRequestHook": { "type": "object", @@ -14289,8 +15354,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionDeniedByPermissionRequestHook", - "description": "Schema for the `PermissionDecisionDeniedByPermissionRequestHook` type." + "description": "Schema for the `PermissionDecisionDeniedByPermissionRequestHook` type.", + "title": "PermissionDecisionDeniedByPermissionRequestHook" }, "PermissionDecisionDeniedByRules": { "type": "object", @@ -14313,8 +15378,8 @@ "rules" ], "additionalProperties": false, - "title": "PermissionDecisionDeniedByRules", - "description": "Schema for the `PermissionDecisionDeniedByRules` type." + "description": "Schema for the `PermissionDecisionDeniedByRules` type.", + "title": "PermissionDecisionDeniedByRules" }, "PermissionDecisionDeniedInteractivelyByUser": { "type": "object", @@ -14337,8 +15402,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionDeniedInteractivelyByUser", - "description": "Schema for the `PermissionDecisionDeniedInteractivelyByUser` type." + "description": "Schema for the `PermissionDecisionDeniedInteractivelyByUser` type.", + "title": "PermissionDecisionDeniedInteractivelyByUser" }, "PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser": { "type": "object", @@ -14353,8 +15418,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser", - "description": "Schema for the `PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type." + "description": "Schema for the `PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type.", + "title": "PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser" }, "PermissionDecisionReject": { "type": "object", @@ -14373,8 +15438,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionReject", - "description": "Schema for the `PermissionDecisionReject` type." + "description": "Schema for the `PermissionDecisionReject` type.", + "title": "PermissionDecisionReject" }, "PermissionDecisionRequest": { "type": "object", @@ -14409,8 +15474,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDecisionUserNotAvailable", - "description": "Schema for the `PermissionDecisionUserNotAvailable` type." + "description": "Schema for the `PermissionDecisionUserNotAvailable` type.", + "title": "PermissionDecisionUserNotAvailable" }, "PermissionLocationAddToolApprovalParams": { "type": "object", @@ -14730,8 +15795,8 @@ "argument" ], "additionalProperties": false, - "title": "PermissionRule", - "description": "Schema for the `PermissionRule` type." + "description": "Schema for the `PermissionRule` type.", + "title": "PermissionRule" }, "PermissionRulesSet": { "type": "object", @@ -14769,10 +15834,6 @@ } }, "last_updated_at": { - "type": [ - "string", - "number" - ], "x-opaque-json": true }, "scope": { @@ -14785,9 +15846,8 @@ "last_updated_at", "scope" ], - "additionalProperties": true, - "title": "PermissionsConfigureAdditionalContentExclusionPolicy", - "description": "Schema for the `PermissionsConfigureAdditionalContentExclusionPolicy` type." + "description": "Schema for the `PermissionsConfigureAdditionalContentExclusionPolicy` type.", + "title": "PermissionsConfigureAdditionalContentExclusionPolicy" }, "PermissionsConfigureAdditionalContentExclusionPolicyRule": { "type": "object", @@ -14819,9 +15879,8 @@ "paths", "source" ], - "additionalProperties": true, - "title": "PermissionsConfigureAdditionalContentExclusionPolicyRule", - "description": "Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRule` type." + "description": "Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRule` type.", + "title": "PermissionsConfigureAdditionalContentExclusionPolicyRule" }, "PermissionsConfigureAdditionalContentExclusionPolicyRuleSource": { "type": "object", @@ -14838,8 +15897,8 @@ "type" ], "additionalProperties": false, - "title": "PermissionsConfigureAdditionalContentExclusionPolicyRuleSource", - "description": "Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRuleSource` type." + "description": "Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRuleSource` type.", + "title": "PermissionsConfigureAdditionalContentExclusionPolicyRuleSource" }, "PermissionsConfigureAdditionalContentExclusionPolicyScope": { "type": "string", @@ -14847,12 +15906,12 @@ "repo", "all" ], + "description": "Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration.", "title": "PermissionsConfigureAdditionalContentExclusionPolicyScope", "x-enumDescriptions": { "repo": "The content exclusion policy applies to the current repository.", "all": "The content exclusion policy applies across all repositories." - }, - "description": "Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration." + } }, "PermissionsConfigureParams": { "type": "object", @@ -14980,8 +16039,8 @@ "commandIdentifiers" ], "additionalProperties": false, - "title": "PermissionsLocationsAddToolApprovalDetailsCommands", - "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsCommands` type." + "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsCommands` type.", + "title": "PermissionsLocationsAddToolApprovalDetailsCommands" }, "PermissionsLocationsAddToolApprovalDetailsCustomTool": { "type": "object", @@ -15001,8 +16060,8 @@ "toolName" ], "additionalProperties": false, - "title": "PermissionsLocationsAddToolApprovalDetailsCustomTool", - "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsCustomTool` type." + "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsCustomTool` type.", + "title": "PermissionsLocationsAddToolApprovalDetailsCustomTool" }, "PermissionsLocationsAddToolApprovalDetailsExtensionManagement": { "type": "object", @@ -15021,8 +16080,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionsLocationsAddToolApprovalDetailsExtensionManagement", - "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsExtensionManagement` type." + "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsExtensionManagement` type.", + "title": "PermissionsLocationsAddToolApprovalDetailsExtensionManagement" }, "PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess": { "type": "object", @@ -15042,8 +16101,8 @@ "extensionName" ], "additionalProperties": false, - "title": "PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess", - "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess` type." + "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess` type.", + "title": "PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess" }, "PermissionsLocationsAddToolApprovalDetailsMcp": { "type": "object", @@ -15071,8 +16130,8 @@ "toolName" ], "additionalProperties": false, - "title": "PermissionsLocationsAddToolApprovalDetailsMcp", - "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsMcp` type." + "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsMcp` type.", + "title": "PermissionsLocationsAddToolApprovalDetailsMcp" }, "PermissionsLocationsAddToolApprovalDetailsMcpSampling": { "type": "object", @@ -15092,8 +16151,8 @@ "serverName" ], "additionalProperties": false, - "title": "PermissionsLocationsAddToolApprovalDetailsMcpSampling", - "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsMcpSampling` type." + "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsMcpSampling` type.", + "title": "PermissionsLocationsAddToolApprovalDetailsMcpSampling" }, "PermissionsLocationsAddToolApprovalDetailsMemory": { "type": "object", @@ -15108,8 +16167,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionsLocationsAddToolApprovalDetailsMemory", - "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsMemory` type." + "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsMemory` type.", + "title": "PermissionsLocationsAddToolApprovalDetailsMemory" }, "PermissionsLocationsAddToolApprovalDetailsRead": { "type": "object", @@ -15124,8 +16183,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionsLocationsAddToolApprovalDetailsRead", - "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsRead` type." + "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsRead` type.", + "title": "PermissionsLocationsAddToolApprovalDetailsRead" }, "PermissionsLocationsAddToolApprovalDetailsWrite": { "type": "object", @@ -15140,8 +16199,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionsLocationsAddToolApprovalDetailsWrite", - "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsWrite` type." + "description": "Schema for the `PermissionsLocationsAddToolApprovalDetailsWrite` type.", + "title": "PermissionsLocationsAddToolApprovalDetailsWrite" }, "PermissionsLocationsAddToolApprovalResult": { "type": "object", @@ -15668,8 +16727,8 @@ "enabled" ], "additionalProperties": false, - "title": "Plugin", - "description": "Schema for the `Plugin` type." + "description": "Schema for the `Plugin` type.", + "title": "Plugin" }, "PluginInstallResult": { "type": "object", @@ -15958,8 +17017,8 @@ "success" ], "additionalProperties": false, - "title": "PluginUpdateAllEntry", - "description": "Schema for the `PluginUpdateAllEntry` type." + "description": "Schema for the `PluginUpdateAllEntry` type.", + "title": "PluginUpdateAllEntry" }, "PluginUpdateAllResult": { "type": "object", @@ -16025,6 +17084,50 @@ "description": "Batch of spawn events plus a cursor for follow-up polls.", "title": "PollSpawnedSessionsResult" }, + "ProviderAddRequest": { + "type": "object", + "properties": { + "providers": { + "type": "array", + "items": { + "$ref": "#/definitions/NamedProviderConfig", + "description": "A named BYOK provider connection (transport + credentials)." + }, + "description": "Named BYOK provider connections to register, additive to any providers already in the registry. Each name must be unique across the registry and must not contain '/'." + }, + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ProviderModelConfig", + "description": "A BYOK model definition referencing a named provider." + }, + "description": "BYOK model definitions to register. Each must reference a provider that is already registered or included in this same call. Selection ids (`provider/id`) must be unique across the registry." + } + }, + "additionalProperties": false, + "description": "BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both.", + "title": "ProviderAddRequest", + "stability": "experimental" + }, + "ProviderAddResult": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "x-opaque-json": true + }, + "description": "Synthesized selectable model entries for the newly added BYOK models, each under its provider-qualified selection id (`provider/id`). Empty when only providers were added." + } + }, + "required": [ + "models" + ], + "additionalProperties": false, + "description": "The selectable model entries synthesized for the models added by this call.", + "title": "ProviderAddResult", + "stability": "experimental" + }, "ProviderConfig": { "type": "object", "properties": { @@ -16036,6 +17139,10 @@ "$ref": "#/definitions/ProviderConfigWireApi", "description": "Wire API format (openai/azure only). Defaults to \"completions\"." }, + "transport": { + "$ref": "#/definitions/ProviderConfigTransport", + "description": "Provider transport. Defaults to \"http\"." + }, "baseUrl": { "type": "string", "description": "API endpoint URL." @@ -16078,6 +17185,10 @@ "type": "string" }, "description": "Custom HTTP headers to include in all outbound requests to the provider." + }, + "hasBearerTokenProvider": { + "type": "boolean", + "description": "When true, the SDK client supplies bearer tokens on demand: the runtime calls the client-session `providerToken.getToken` callback before each request and applies the returned token as an `Authorization: Bearer ` header. This is the bearer/OAuth scheme used by Azure AD / managed-identity tokens and provider OAuth access tokens (including Anthropic's), not a provider-specific API-key header such as Anthropic's `x-api-key`. The token-acquiring function itself stays on the SDK side and is never serialized; only this flag crosses the wire. When set alongside `apiKey`/`bearerToken`, the callback takes precedence: the runtime applies the token returned by `providerToken.getToken` as the `Authorization: Bearer` header for each request and does not send the static credential." } }, "required": [ @@ -16100,6 +17211,19 @@ "description": "Azure-specific provider options.", "title": "ProviderConfigAzure" }, + "ProviderConfigTransport": { + "type": "string", + "enum": [ + "http", + "websockets" + ], + "description": "Provider transport. Defaults to \"http\".", + "title": "ProviderConfigTransport", + "x-enumDescriptions": { + "http": "HTTP request/streaming transport.", + "websockets": "WebSocket transport." + } + }, "ProviderConfigType": { "type": "string", "enum": [ @@ -16139,6 +17263,10 @@ "$ref": "#/definitions/ProviderEndpointWireApi", "description": "Wire API to be used, when required for the provider type." }, + "transport": { + "$ref": "#/definitions/ProviderEndpointTransport", + "description": "Transport to be used for provider requests." + }, "baseUrl": { "type": "string", "format": "uri", @@ -16169,6 +17297,19 @@ "description": "A snapshot of the provider endpoint the session is currently configured to talk to.", "title": "ProviderEndpoint" }, + "ProviderEndpointTransport": { + "type": "string", + "enum": [ + "http", + "websockets" + ], + "description": "Transport to be used for provider requests.", + "title": "ProviderEndpointTransport", + "x-enumDescriptions": { + "http": "HTTP request/streaming transport.", + "websockets": "WebSocket transport." + } + }, "ProviderEndpointType": { "type": "string", "enum": [ @@ -16216,6 +17357,54 @@ "description": "Optional model identifier to scope the endpoint snapshot to.", "title": "ProviderGetEndpointRequest" }, + "ProviderModelConfig": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Provider-local model id, unique within its provider. The session-wide selection id (shown in the model list and passed to switchTo) is the provider-qualified `provider/id`." + }, + "provider": { + "type": "string", + "description": "Name of the NamedProviderConfig that serves this model." + }, + "wireModel": { + "type": "string", + "description": "The model name sent to the provider API for inference. Defaults to `id`." + }, + "modelId": { + "type": "string", + "description": "Well-known base model id used for behavior/capability/config lookup. Defaults to `id`." + }, + "name": { + "type": "string", + "description": "Display name for model pickers. Defaults to the provider-qualified selection id (`provider/id`)." + }, + "maxPromptTokens": { + "type": "number", + "description": "Maximum prompt/input tokens for the model." + }, + "maxContextWindowTokens": { + "type": "number", + "description": "Maximum context window tokens for the model." + }, + "maxOutputTokens": { + "type": "number", + "description": "Maximum output tokens for the model." + }, + "capabilities": { + "$ref": "#/definitions/ModelCapabilitiesOverride", + "description": "Optional capability overrides (vision, tool_calls, reasoning, etc.)." + } + }, + "required": [ + "id", + "provider" + ], + "additionalProperties": false, + "description": "A BYOK model definition referencing a named provider.", + "title": "ProviderModelConfig" + }, "ProviderSessionToken": { "type": "object", "properties": { @@ -16245,6 +17434,36 @@ "description": "Short-lived, rotating credential the caller must send on every request, in addition to `apiKey` if one is present. Omitted when the endpoint does not require one.", "title": "ProviderSessionToken" }, + "ProviderTokenAcquireRequest": { + "type": "object", + "properties": { + "providerName": { + "type": "string", + "description": "Name of the BYOK provider needing a token. For the legacy whole-session `provider` this is the implicit provider name; for named providers it is `NamedProviderConfig.name`." + } + }, + "required": [ + "providerName" + ], + "additionalProperties": false, + "description": "Asks the SDK client to acquire a bearer token for a BYOK provider whose config set `hasBearerTokenProvider: true`. Issued by the runtime before each outbound model request; the runtime does no caching, so this is sent once per request.", + "title": "ProviderTokenAcquireRequest" + }, + "ProviderTokenAcquireResult": { + "type": "object", + "properties": { + "token": { + "type": "string", + "description": "The bearer token value (without the `Bearer ` prefix)." + } + }, + "required": [ + "token" + ], + "additionalProperties": false, + "description": "A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer ` on the outbound request and does no caching; the SDK consumer owns token caching and refresh.", + "title": "ProviderTokenAcquireResult" + }, "PushAttachment": { "anyOf": [ { @@ -16272,8 +17491,8 @@ "description": "Slim input shape for extension_context attachments; identity fields are runtime-derived." } ], - "title": "PushAttachment", - "description": "Schema for the `PushAttachment` type." + "description": "Schema for the `PushAttachment` type.", + "title": "PushAttachment" }, "PushAttachmentBlob": { "type": "object", @@ -16558,8 +17777,8 @@ "handled" ], "additionalProperties": false, - "title": "QueuedCommandHandled", - "description": "Schema for the `QueuedCommandHandled` type." + "description": "Schema for the `QueuedCommandHandled` type.", + "title": "QueuedCommandHandled" }, "QueuedCommandNotHandled": { "type": "object", @@ -16574,8 +17793,8 @@ "handled" ], "additionalProperties": false, - "title": "QueuedCommandNotHandled", - "description": "Schema for the `QueuedCommandNotHandled` type." + "description": "Schema for the `QueuedCommandNotHandled` type.", + "title": "QueuedCommandNotHandled" }, "QueuedCommandResult": { "anyOf": [ @@ -16606,8 +17825,8 @@ "displayText" ], "additionalProperties": false, - "title": "QueuePendingItems", - "description": "Schema for the `QueuePendingItems` type." + "description": "Schema for the `QueuePendingItems` type.", + "title": "QueuePendingItems" }, "QueuePendingItemsKind": { "type": "string", @@ -16717,8 +17936,8 @@ }, "loader": { "description": "In-process ExtensionLoader handle (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. When the CLI migrates to a process-separated SDK, extension discovery/launch moves entirely into the runtime — the CLI passes pure config (search paths, disabled ids) via SessionOptions instead.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" }, "options": { "$ref": "#/definitions/SessionsRegisterExtensionToolsOnSessionOptions", @@ -16739,8 +17958,8 @@ "properties": { "unsubscribe": { "description": "In-process unsubscribe function (CLI-only optimization). Marked internal: replaced by an explicit `extensions.unregister` RPC in the SDK migration.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -16868,8 +18087,8 @@ }, "promptManager": { "description": "In-process prompt-manager handle (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. When the CLI migrates to a process-separated SDK, the same bidirectional prompt-routing handshake is expressed via dedicated remote-control RPCs (register/resolve) rather than a shared in-process object.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -17237,12 +18456,6 @@ "$ref": "#/definitions/SandboxConfigUserPolicy", "description": "User-managed sandbox policy fragment merged into the auto-discovered base policy." }, - "config": { - "type": "object", - "additionalProperties": {}, - "description": "Raw `ContainerConfig` (per `@microsoft/mxc-sdk`) passed directly to `spawnSandboxFromConfig`, bypassing policy merging.", - "x-opaque-json": true - }, "addCurrentWorkingDirectory": { "type": "boolean", "description": "Whether to auto-add the current working directory to readwritePaths. Default: true." @@ -17267,9 +18480,13 @@ "$ref": "#/definitions/SandboxConfigUserPolicyNetwork", "description": "Network rules to merge into the base policy." }, + "seatbelt": { + "$ref": "#/definitions/SandboxConfigUserPolicySeatbelt", + "description": "macOS seatbelt options to merge into the base policy." + }, "experimental": { "$ref": "#/definitions/SandboxConfigUserPolicyExperimental", - "description": "Platform-specific experimental policy fields." + "description": "Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is absent." } }, "additionalProperties": false, @@ -17363,6 +18580,18 @@ "description": "Network rules to merge into the base policy.", "title": "SandboxConfigUserPolicyNetwork" }, + "SandboxConfigUserPolicySeatbelt": { + "type": "object", + "properties": { + "keychainAccess": { + "type": "boolean", + "description": "Whether the macOS seatbelt profile may access the keychain." + } + }, + "additionalProperties": false, + "description": "macOS seatbelt-specific options.", + "title": "SandboxConfigUserPolicySeatbelt" + }, "ScheduleEntry": { "type": "object", "properties": { @@ -17374,8 +18603,8 @@ "intervalMs": { "type": "integer", "exclusiveMinimum": 0, - "description": "Interval between scheduled ticks, in milliseconds (relative-interval schedules).", - "format": "duration" + "format": "duration", + "description": "Interval between scheduled ticks, in milliseconds (relative-interval schedules)." }, "cron": { "type": "string", @@ -17398,6 +18627,10 @@ "type": "boolean", "description": "Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`)." }, + "selfPaced": { + "type": "boolean", + "description": "True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled." + }, "displayPrompt": { "type": "string", "description": "Display-only label for the prompt as shown in the UI (e.g. `/skill-name` for a skill-invocation schedule). The actual enqueued prompt is `prompt`." @@ -17415,8 +18648,8 @@ "nextRunAt" ], "additionalProperties": false, - "title": "ScheduleEntry", - "description": "Schema for the `ScheduleEntry` type." + "description": "Schema for the `ScheduleEntry` type.", + "title": "ScheduleEntry" }, "ScheduleList": { "type": "object", @@ -17703,6 +18936,10 @@ "projectPath": { "type": "string", "description": "The project path this skill belongs to (only for project/inherited skills)" + }, + "argumentHint": { + "type": "string", + "description": "Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field" } }, "required": [ @@ -17713,8 +18950,8 @@ "enabled" ], "additionalProperties": false, - "title": "ServerSkill", - "description": "Schema for the `ServerSkill` type." + "description": "Schema for the `ServerSkill` type.", + "title": "ServerSkill" }, "ServerSkillList": { "type": "object", @@ -18144,8 +19381,8 @@ "type" ], "additionalProperties": false, - "title": "SessionFsReaddirWithTypesEntry", - "description": "Schema for the `SessionFsReaddirWithTypesEntry` type." + "description": "Schema for the `SessionFsReaddirWithTypesEntry` type.", + "title": "SessionFsReaddirWithTypesEntry" }, "SessionFsReaddirWithTypesEntryType": { "type": "string", @@ -18372,11 +19609,6 @@ "params": { "type": "object", "additionalProperties": { - "type": [ - "string", - "number", - "null" - ], "x-opaque-json": true }, "description": "Optional named bind parameters" @@ -18569,8 +19801,8 @@ "enabled" ], "additionalProperties": false, - "title": "SessionInstalledPlugin", - "description": "Schema for the `SessionInstalledPlugin` type." + "description": "Schema for the `SessionInstalledPlugin` type.", + "title": "SessionInstalledPlugin" }, "SessionInstalledPluginSource": { "anyOf": [ @@ -18617,8 +19849,8 @@ "repo" ], "additionalProperties": false, - "title": "SessionInstalledPluginSourceGitHub", - "description": "Schema for the `SessionInstalledPluginSourceGitHub` type." + "description": "Schema for the `SessionInstalledPluginSourceGitHub` type.", + "title": "SessionInstalledPluginSourceGitHub" }, "SessionInstalledPluginSourceLocal": { "type": "object", @@ -18637,8 +19869,8 @@ "path" ], "additionalProperties": false, - "title": "SessionInstalledPluginSourceLocal", - "description": "Schema for the `SessionInstalledPluginSourceLocal` type." + "description": "Schema for the `SessionInstalledPluginSourceLocal` type.", + "title": "SessionInstalledPluginSourceLocal" }, "SessionInstalledPluginSourceUrl": { "type": "object", @@ -18664,8 +19896,8 @@ "url" ], "additionalProperties": false, - "title": "SessionInstalledPluginSourceUrl", - "description": "Schema for the `SessionInstalledPluginSourceUrl` type." + "description": "Schema for the `SessionInstalledPluginSourceUrl` type.", + "title": "SessionInstalledPluginSourceUrl" }, "SessionList": { "type": "object", @@ -18865,7 +20097,7 @@ "items": { "x-opaque-json": true }, - "description": "Available models, ordered with the most preferred default first." + "description": "Available models, ordered with the most preferred default first. Includes both Copilot (CAPI) models and any registry BYOK models; a BYOK model appears under its provider-qualified selection id (`provider/id`)." }, "quotaSnapshots": { "type": "object", @@ -18923,8 +20155,8 @@ }, "expAssignments": { "description": "ExP assignment ('flight') data injected by an SDK integrator, in the same JSON shape the Copilot CLI fetches from the experimentation service (CopilotExpAssignmentResponse). When supplied this is fed into the FeatureFlagService exactly like CLI-fetched assignments and ExP-backed flags wait for it. When absent the session does not block on ExP.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" }, "featureFlags": { "type": "object", @@ -18945,6 +20177,28 @@ "$ref": "#/definitions/ProviderConfig", "description": "Custom model-provider configuration (BYOK)." }, + "capi": { + "$ref": "#/definitions/CapiSessionOptions", + "description": "Options scoped to the built-in CAPI (Copilot API) provider." + }, + "providers": { + "type": "array", + "items": { + "$ref": "#/definitions/NamedProviderConfig", + "description": "A named BYOK provider connection (transport + credentials)." + }, + "description": "Named BYOK provider connections, additive to CAPI auth. Combining with `provider` is rejected.", + "stability": "experimental" + }, + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ProviderModelConfig", + "description": "A BYOK model definition referencing a named provider." + }, + "description": "BYOK model definitions added to the selectable model list, each referencing a provider name.", + "stability": "experimental" + }, "workingDirectory": { "type": "string", "description": "Working directory to anchor the session." @@ -19062,6 +20316,11 @@ "type": "boolean", "description": "Whether model responses stream as delta events." }, + "enableCitations": { + "type": "boolean", + "description": "Experimental: enable native model citations (Anthropic models today), normalized onto the `assistant.message` event. Off by default; may change or be removed while the citations surface is experimental.", + "stability": "experimental" + }, "copilotUrl": { "type": "string", "description": "Override URL for the Copilot API endpoint." @@ -19082,6 +20341,11 @@ "type": "boolean", "description": "Whether on-demand custom instruction discovery is enabled." }, + "maxInlineBinaryBytes": { + "type": "integer", + "minimum": 0, + "description": "Maximum decoded byte size of a single inline model-facing binary tool result persisted in session events (default 10 MB)." + }, "modelCapabilitiesOverrides": { "$ref": "#/definitions/ModelCapabilitiesOverride", "description": "Initial model capability overrides." @@ -19133,10 +20397,6 @@ } }, "last_updated_at": { - "type": [ - "string", - "number" - ], "x-opaque-json": true }, "scope": { @@ -19149,9 +20409,8 @@ "last_updated_at", "scope" ], - "additionalProperties": true, - "title": "SessionOpenOptionsAdditionalContentExclusionPolicy", - "description": "Schema for the `SessionOpenOptionsAdditionalContentExclusionPolicy` type." + "description": "Schema for the `SessionOpenOptionsAdditionalContentExclusionPolicy` type.", + "title": "SessionOpenOptionsAdditionalContentExclusionPolicy" }, "SessionOpenOptionsAdditionalContentExclusionPolicyRule": { "type": "object", @@ -19183,9 +20442,8 @@ "paths", "source" ], - "additionalProperties": true, - "title": "SessionOpenOptionsAdditionalContentExclusionPolicyRule", - "description": "Schema for the `SessionOpenOptionsAdditionalContentExclusionPolicyRule` type." + "description": "Schema for the `SessionOpenOptionsAdditionalContentExclusionPolicyRule` type.", + "title": "SessionOpenOptionsAdditionalContentExclusionPolicyRule" }, "SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource": { "type": "object", @@ -19202,8 +20460,8 @@ "type" ], "additionalProperties": false, - "title": "SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource", - "description": "Schema for the `SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource` type." + "description": "Schema for the `SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource` type.", + "title": "SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource" }, "SessionOpenOptionsAdditionalContentExclusionPolicyScope": { "type": "string", @@ -19211,12 +20469,12 @@ "repo", "all" ], + "description": "Allowed values for the `SessionOpenOptionsAdditionalContentExclusionPolicyScope` enumeration.", "title": "SessionOpenOptionsAdditionalContentExclusionPolicyScope", "x-enumDescriptions": { "repo": "The content exclusion policy applies to the current repository.", "all": "The content exclusion policy applies across all repositories." - }, - "description": "Allowed values for the `SessionOpenOptionsAdditionalContentExclusionPolicyScope` enumeration." + } }, "SessionOpenOptionsEnvValueMode": { "type": "string", @@ -19293,8 +20551,8 @@ }, "sessionApi": { "description": "In-process SessionClientApi handle for the opened session, returned to CLI callers as a transitional shortcut. Marked internal so the public SDK surface does not expose it; SDK consumers should construct per-session clients from `sessionId` instead.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" }, "startupPrompts": { "type": "array", @@ -19811,8 +21069,8 @@ }, "onTaskCreated": { "description": "In-process callback invoked when the cloud task is created (before connection). Marked internal because a function reference cannot cross the JSON-RPC boundary. Disappears in the SDK migration: the field is purely cosmetic (it flips a single CLI phase label from 'creating' to 'connecting') and the wire-clean version just drops the intermediate phase.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -19868,8 +21126,8 @@ }, "onProgress": { "description": "In-process progress callback `(update) => void` invoked for each handoff step. Marked internal because a function reference cannot cross the JSON-RPC boundary. The host-side `handoffSession` is already declared as `AsyncGenerator`; the schema layer flattens it because it does not yet support streaming methods. The wire-clean replacement is to expose the AsyncGenerator directly (or use vscode-jsonrpc `$/progress` notifications) once the schema/transport layer supports it.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -19914,8 +21172,8 @@ "status" ], "additionalProperties": false, - "title": "SessionsOpenProgress", - "description": "Schema for the `SessionsOpenProgress` type." + "description": "Schema for the `SessionsOpenProgress` type.", + "title": "SessionsOpenProgress" }, "SessionsOpenProgressStatus": { "type": "string", @@ -20087,8 +21345,8 @@ "sessionId" ], "additionalProperties": false, - "title": "SessionsPollSpawnedSessionsEvent", - "description": "Schema for the `SessionsPollSpawnedSessionsEvent` type." + "description": "Schema for the `SessionsPollSpawnedSessionsEvent` type.", + "title": "SessionsPollSpawnedSessionsEvent" }, "SessionsPollSpawnedSessionsRequest": { "anyOf": [ @@ -20106,8 +21364,8 @@ "type": "integer", "minimum": 0, "maximum": 60000, - "description": "Milliseconds to wait for new spawn events when the cursor is at the tail. 0 (default) returns immediately even if no events are buffered. Capped at 60000ms.", - "format": "duration" + "format": "duration", + "description": "Milliseconds to wait for new spawn events when the cursor is at the tail. 0 (default) returns immediately even if no events are buffered. Capped at 60000ms." } }, "additionalProperties": false @@ -20152,8 +21410,8 @@ "properties": { "enabled": { "description": "In-process `() => boolean` gating callback (CLI-only optimization). Marked internal: replaced by runtime-side enable/disable RPCs in the SDK migration.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "additionalProperties": false, @@ -20390,6 +21648,10 @@ "$ref": "#/definitions/ProviderConfig", "description": "Custom model-provider configuration (BYOK)." }, + "capi": { + "$ref": "#/definitions/CapiSessionOptions", + "description": "Options scoped to the built-in CAPI (Copilot API) provider." + }, "workingDirectory": { "type": "string", "description": "Absolute working-directory path for shell tools." @@ -20457,6 +21719,11 @@ "type": "boolean", "description": "Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag." }, + "maxInlineBinaryBytes": { + "type": "integer", + "minimum": 0, + "description": "Maximum decoded byte size of a single model-facing binary tool result (e.g. an image) persisted inline in session events and re-presented to the model on later turns / resume. Larger results are persisted as a metadata-only marker and shown to the model as a short text note. Defaults to 10 MB." + }, "installedPlugins": { "type": "array", "items": { @@ -20676,8 +21943,8 @@ "timeout": { "type": "integer", "minimum": 0, - "description": "Timeout in milliseconds (default: 30000)", - "format": "duration" + "format": "duration", + "description": "Timeout in milliseconds (default: 30000)" } }, "required": [ @@ -20830,6 +22097,10 @@ "pluginName": { "type": "string", "description": "Name of the plugin that provides the skill, when source is 'plugin'" + }, + "argumentHint": { + "type": "string", + "description": "Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field" } }, "required": [ @@ -20840,8 +22111,72 @@ "enabled" ], "additionalProperties": false, - "title": "Skill", - "description": "Schema for the `Skill` type." + "description": "Schema for the `Skill` type.", + "title": "Skill" + }, + "SkillDiscoveryPath": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "Absolute path of the create/discovery target (may not exist on disk yet)" + }, + "scope": { + "$ref": "#/definitions/SkillDiscoveryScope", + "description": "Which tier this directory belongs to" + }, + "preferredForCreation": { + "type": "boolean", + "description": "Whether this is the canonical directory to create a new skill in its tier. At most one entry per tier is preferred; the `personal-agents` and `custom` scopes are never preferred." + }, + "projectPath": { + "type": "string", + "description": "The input project path this directory was derived from (only for project scope)" + } + }, + "required": [ + "path", + "scope", + "preferredForCreation" + ], + "additionalProperties": false, + "description": "Schema for the `SkillDiscoveryPath` type.", + "title": "SkillDiscoveryPath" + }, + "SkillDiscoveryPathList": { + "type": "object", + "properties": { + "paths": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillDiscoveryPath" + }, + "description": "Canonical skill create/discovery directories, in priority order" + } + }, + "required": [ + "paths" + ], + "additionalProperties": false, + "description": "Canonical locations where skills can be created so the runtime will recognize them.", + "title": "SkillDiscoveryPathList" + }, + "SkillDiscoveryScope": { + "type": "string", + "enum": [ + "project", + "personal-copilot", + "personal-agents", + "custom" + ], + "description": "Which tier this directory belongs to", + "title": "SkillDiscoveryScope", + "x-enumDescriptions": { + "project": "A project's repository skill directory.", + "personal-copilot": "The user's personal Copilot skill directory.", + "personal-agents": "The user's personal agents skill directory.", + "custom": "A configured custom skill directory." + } }, "SkillList": { "type": "object", @@ -20910,6 +22245,10 @@ "type": "string" }, "description": "Optional list of additional skill directory paths to include" + }, + "excludeHostSkills": { + "type": "boolean", + "description": "When true, omit skills from the host's global sources (personal, custom, plugin, and built-in), returning only project-scoped skills. For multitenant deployments." } }, "additionalProperties": false, @@ -20931,6 +22270,25 @@ "description": "Name of the skill to enable for the session.", "title": "SkillsEnableRequest" }, + "SkillsGetDiscoveryPathsRequest": { + "type": "object", + "properties": { + "projectPaths": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional list of project directory paths. When omitted or empty, only personal and custom directories are returned." + }, + "excludeHostSkills": { + "type": "boolean", + "description": "When true, omit the host's personal and custom skill directories, leaving only project directories. For multitenant deployments." + } + }, + "additionalProperties": false, + "description": "Optional project paths to enumerate.", + "title": "SkillsGetDiscoveryPathsRequest" + }, "SkillsGetInvokedResult": { "type": "object", "properties": { @@ -20984,8 +22342,8 @@ "invokedAtTurn" ], "additionalProperties": false, - "title": "SkillsInvokedSkill", - "description": "Schema for the `SkillsInvokedSkill` type." + "description": "Schema for the `SkillsInvokedSkill` type.", + "title": "SkillsInvokedSkill" }, "SkillsLoadDiagnostics": { "type": "object", @@ -21067,8 +22425,8 @@ "displayPrompt" ], "additionalProperties": false, - "title": "SlashCommandAgentPromptResult", - "description": "Schema for the `SlashCommandAgentPromptResult` type." + "description": "Schema for the `SlashCommandAgentPromptResult` type.", + "title": "SlashCommandAgentPromptResult" }, "SlashCommandCompletedResult": { "type": "object", @@ -21091,8 +22449,8 @@ "kind" ], "additionalProperties": false, - "title": "SlashCommandCompletedResult", - "description": "Schema for the `SlashCommandCompletedResult` type." + "description": "Schema for the `SlashCommandCompletedResult` type.", + "title": "SlashCommandCompletedResult" }, "SlashCommandInfo": { "type": "object", @@ -21140,8 +22498,8 @@ "allowDuringAgentExecution" ], "additionalProperties": false, - "title": "SlashCommandInfo", - "description": "Schema for the `SlashCommandInfo` type." + "description": "Schema for the `SlashCommandInfo` type.", + "title": "SlashCommandInfo" }, "SlashCommandInput": { "type": "object", @@ -21235,8 +22593,8 @@ "description" ], "additionalProperties": false, - "title": "SlashCommandSelectSubcommandOption", - "description": "Schema for the `SlashCommandSelectSubcommandOption` type." + "description": "Schema for the `SlashCommandSelectSubcommandOption` type.", + "title": "SlashCommandSelectSubcommandOption" }, "SlashCommandSelectSubcommandResult": { "type": "object", @@ -21273,8 +22631,8 @@ "options" ], "additionalProperties": false, - "title": "SlashCommandSelectSubcommandResult", - "description": "Schema for the `SlashCommandSelectSubcommandResult` type." + "description": "Schema for the `SlashCommandSelectSubcommandResult` type.", + "title": "SlashCommandSelectSubcommandResult" }, "SlashCommandTextResult": { "type": "object", @@ -21306,8 +22664,8 @@ "text" ], "additionalProperties": false, - "title": "SlashCommandTextResult", - "description": "Schema for the `SlashCommandTextResult` type." + "description": "Schema for the `SlashCommandTextResult` type.", + "title": "SlashCommandTextResult" }, "SubagentSettings": { "anyOf": [ @@ -21412,8 +22770,8 @@ "activeTimeMs": { "type": "integer", "minimum": 0, - "description": "Accumulated active execution time in milliseconds", - "format": "duration" + "format": "duration", + "description": "Accumulated active execution time in milliseconds" }, "activeStartedAt": { "type": "string", @@ -21473,8 +22831,8 @@ "prompt" ], "additionalProperties": false, - "title": "TaskAgentInfo", - "description": "Schema for the `TaskAgentInfo` type." + "description": "Schema for the `TaskAgentInfo` type.", + "title": "TaskAgentInfo" }, "TaskAgentProgress": { "type": "object", @@ -21501,8 +22859,8 @@ "recentActivity" ], "additionalProperties": false, - "title": "TaskAgentProgress", - "description": "Schema for the `TaskAgentProgress` type." + "description": "Schema for the `TaskAgentProgress` type.", + "title": "TaskAgentProgress" }, "TaskExecutionMode": { "type": "string", @@ -21526,8 +22884,8 @@ "$ref": "#/definitions/TaskShellInfo" } ], - "title": "TaskInfo", - "description": "Schema for the `TaskInfo` type." + "description": "Schema for the `TaskInfo` type.", + "title": "TaskInfo" }, "TaskList": { "type": "object", @@ -21584,8 +22942,8 @@ "timestamp" ], "additionalProperties": false, - "title": "TaskProgressLine", - "description": "Schema for the `TaskProgressLine` type." + "description": "Schema for the `TaskProgressLine` type.", + "title": "TaskProgressLine" }, "TasksCancelRequest": { "type": "object", @@ -21726,8 +23084,8 @@ "attachmentMode" ], "additionalProperties": false, - "title": "TaskShellInfo", - "description": "Schema for the `TaskShellInfo` type." + "description": "Schema for the `TaskShellInfo` type.", + "title": "TaskShellInfo" }, "TaskShellInfoAttachmentMode": { "type": "string", @@ -21766,8 +23124,8 @@ "recentOutput" ], "additionalProperties": false, - "title": "TaskShellProgress", - "description": "Schema for the `TaskShellProgress` type." + "description": "Schema for the `TaskShellProgress` type.", + "title": "TaskShellProgress" }, "TasksPromoteCurrentToBackgroundResult": { "type": "object", @@ -22010,8 +23368,8 @@ "token" ], "additionalProperties": false, - "title": "TokenAuthInfo", - "description": "Schema for the `TokenAuthInfo` type." + "description": "Schema for the `TokenAuthInfo` type.", + "title": "TokenAuthInfo" }, "Tool": { "type": "object", @@ -22045,8 +23403,8 @@ "description" ], "additionalProperties": false, - "title": "Tool", - "description": "Schema for the `Tool` type." + "description": "Schema for the `Tool` type.", + "title": "Tool" }, "ToolList": { "type": "object", @@ -22214,8 +23572,8 @@ "title" ], "additionalProperties": false, - "title": "UIElicitationArrayAnyOfFieldItemsAnyOf", - "description": "Schema for the `UIElicitationArrayAnyOfFieldItemsAnyOf` type." + "description": "Schema for the `UIElicitationArrayAnyOfFieldItemsAnyOf` type.", + "title": "UIElicitationArrayAnyOfFieldItemsAnyOf" }, "UIElicitationArrayEnumField": { "type": "object", @@ -22305,9 +23663,9 @@ } } ], + "description": "Schema for the `UIElicitationFieldValue` type.", "title": "UIElicitationFieldValue", - "x-opaque-json": true, - "description": "Schema for the `UIElicitationFieldValue` type." + "x-opaque-json": true }, "UIElicitationRequest": { "type": "object", @@ -22684,8 +24042,8 @@ "title" ], "additionalProperties": false, - "title": "UIElicitationStringOneOfFieldOneOf", - "description": "Schema for the `UIElicitationStringOneOfFieldOneOf` type." + "description": "Schema for the `UIElicitationStringOneOfFieldOneOf` type.", + "title": "UIElicitationStringOneOfFieldOneOf" }, "UIEphemeralQueryRequest": { "type": "object", @@ -22696,13 +24054,13 @@ }, "onChunk": { "description": "In-process streaming callback `(text) => void` invoked with each token as the model emits it. Marked internal: excluded from the public SDK surface. In a process-separated SDK this is replaced by a streaming RPC that yields chunks and a final answer.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" }, "abortSignal": { "description": "In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Marked internal: excluded from the public SDK surface. Replaced by an explicit cancellation token + cancel RPC in the SDK migration.", - "visibility": "internal", - "x-opaque-json": true + "x-opaque-json": true, + "visibility": "internal" } }, "required": [ @@ -22768,8 +24126,8 @@ "approved" ], "additionalProperties": false, - "title": "UIExitPlanModeResponse", - "description": "Schema for the `UIExitPlanModeResponse` type." + "description": "Schema for the `UIExitPlanModeResponse` type.", + "title": "UIExitPlanModeResponse" }, "UIHandlePendingAutoModeSwitchRequest": { "type": "object", @@ -22955,8 +24313,8 @@ "wasFreeform" ], "additionalProperties": false, - "title": "UIUserInputResponse", - "description": "Schema for the `UIUserInputResponse` type." + "description": "Schema for the `UIUserInputResponse` type.", + "title": "UIUserInputResponse" }, "UpdateSubagentSettingsRequest": { "type": "object", @@ -23000,8 +24358,8 @@ "totalApiDurationMs": { "type": "integer", "minimum": 0, - "description": "Total time spent in model API calls (milliseconds)", - "format": "duration" + "format": "duration", + "description": "Total time spent in model API calls (milliseconds)" }, "sessionStartTime": { "type": "string", @@ -23113,8 +24471,8 @@ "usage" ], "additionalProperties": false, - "title": "UsageMetricsModelMetric", - "description": "Schema for the `UsageMetricsModelMetric` type." + "description": "Schema for the `UsageMetricsModelMetric` type.", + "title": "UsageMetricsModelMetric" }, "UsageMetricsModelMetricRequests": { "type": "object", @@ -23150,8 +24508,8 @@ "tokenCount" ], "additionalProperties": false, - "title": "UsageMetricsModelMetricTokenDetail", - "description": "Schema for the `UsageMetricsModelMetricTokenDetail` type." + "description": "Schema for the `UsageMetricsModelMetricTokenDetail` type.", + "title": "UsageMetricsModelMetricTokenDetail" }, "UsageMetricsModelMetricUsage": { "type": "object", @@ -23205,8 +24563,8 @@ "tokenCount" ], "additionalProperties": false, - "title": "UsageMetricsTokenDetail", - "description": "Schema for the `UsageMetricsTokenDetail` type." + "description": "Schema for the `UsageMetricsTokenDetail` type.", + "title": "UsageMetricsTokenDetail" }, "UserAuthInfo": { "type": "object", @@ -23235,8 +24593,8 @@ "login" ], "additionalProperties": false, - "title": "UserAuthInfo", - "description": "Schema for the `UserAuthInfo` type." + "description": "Schema for the `UserAuthInfo` type.", + "title": "UserAuthInfo" }, "UserRequestedShellCommandResult": { "type": "object", @@ -23329,8 +24687,8 @@ "commandIdentifiers" ], "additionalProperties": false, - "title": "UserToolSessionApprovalCommands", - "description": "Schema for the `UserToolSessionApprovalCommands` type." + "description": "Schema for the `UserToolSessionApprovalCommands` type.", + "title": "UserToolSessionApprovalCommands" }, "UserToolSessionApprovalCustomTool": { "type": "object", @@ -23350,8 +24708,8 @@ "toolName" ], "additionalProperties": false, - "title": "UserToolSessionApprovalCustomTool", - "description": "Schema for the `UserToolSessionApprovalCustomTool` type." + "description": "Schema for the `UserToolSessionApprovalCustomTool` type.", + "title": "UserToolSessionApprovalCustomTool" }, "UserToolSessionApprovalExtensionManagement": { "type": "object", @@ -23370,8 +24728,8 @@ "kind" ], "additionalProperties": false, - "title": "UserToolSessionApprovalExtensionManagement", - "description": "Schema for the `UserToolSessionApprovalExtensionManagement` type." + "description": "Schema for the `UserToolSessionApprovalExtensionManagement` type.", + "title": "UserToolSessionApprovalExtensionManagement" }, "UserToolSessionApprovalExtensionPermissionAccess": { "type": "object", @@ -23391,8 +24749,8 @@ "extensionName" ], "additionalProperties": false, - "title": "UserToolSessionApprovalExtensionPermissionAccess", - "description": "Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type." + "description": "Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type.", + "title": "UserToolSessionApprovalExtensionPermissionAccess" }, "UserToolSessionApprovalMcp": { "type": "object", @@ -23420,8 +24778,8 @@ "toolName" ], "additionalProperties": false, - "title": "UserToolSessionApprovalMcp", - "description": "Schema for the `UserToolSessionApprovalMcp` type." + "description": "Schema for the `UserToolSessionApprovalMcp` type.", + "title": "UserToolSessionApprovalMcp" }, "UserToolSessionApprovalMemory": { "type": "object", @@ -23436,8 +24794,8 @@ "kind" ], "additionalProperties": false, - "title": "UserToolSessionApprovalMemory", - "description": "Schema for the `UserToolSessionApprovalMemory` type." + "description": "Schema for the `UserToolSessionApprovalMemory` type.", + "title": "UserToolSessionApprovalMemory" }, "UserToolSessionApprovalRead": { "type": "object", @@ -23452,8 +24810,8 @@ "kind" ], "additionalProperties": false, - "title": "UserToolSessionApprovalRead", - "description": "Schema for the `UserToolSessionApprovalRead` type." + "description": "Schema for the `UserToolSessionApprovalRead` type.", + "title": "UserToolSessionApprovalRead" }, "UserToolSessionApprovalWrite": { "type": "object", @@ -23468,8 +24826,8 @@ "kind" ], "additionalProperties": false, - "title": "UserToolSessionApprovalWrite", - "description": "Schema for the `UserToolSessionApprovalWrite` type." + "description": "Schema for the `UserToolSessionApprovalWrite` type.", + "title": "UserToolSessionApprovalWrite" }, "WorkspaceDiffFileChange": { "type": "object", @@ -23525,13 +24883,15 @@ "type": "string", "enum": [ "unstaged", - "branch" + "branch", + "session" ], "description": "Diff mode requested by the client.", "title": "WorkspaceDiffMode", "x-enumDescriptions": { "unstaged": "Return staged, unstaged, and untracked working tree changes.", - "branch": "Return changes compared with the default branch." + "branch": "Return changes compared with the default branch.", + "session": "Return the cumulative diff of files Copilot changed this session (used in non-git workspaces)." } }, "WorkspaceDiffResult": { @@ -23595,8 +24955,8 @@ "filename" ], "additionalProperties": false, - "title": "WorkspacesCheckpoints", - "description": "Schema for the `WorkspacesCheckpoints` type." + "description": "Schema for the `WorkspacesCheckpoints` type.", + "title": "WorkspacesCheckpoints" }, "WorkspacesCreateFileRequest": { "type": "object", @@ -23965,12 +25325,12 @@ "github", "ado" ], + "description": "Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration.", "title": "WorkspacesWorkspaceDetailsHostType", "x-enumDescriptions": { "github": "Workspace repository is hosted on GitHub.", "ado": "Workspace repository is hosted on Azure DevOps." - }, - "description": "Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration." + } } } } diff --git a/schemas/session-events.schema.json b/schemas/session-events.schema.json index 649519b..231007a 100644 --- a/schemas/session-events.schema.json +++ b/schemas/session-events.schema.json @@ -228,6 +228,11 @@ "type": "string", "description": "Tool call ID of the parent tool invocation when this event originates from a sub-agent", "deprecated": true + }, + "citations": { + "$ref": "#/definitions/Citations", + "description": "Provider-agnostic citations linking spans of this message's content to the sources that support them. Experimental; only populated when citation emission is enabled.", + "stability": "experimental" } }, "required": [ @@ -934,7 +939,8 @@ "$ref": "#/definitions/AssistantUsageCopilotUsageTokenDetail", "description": "Token usage detail for a single billing category" }, - "description": "Itemized token usage breakdown" + "description": "Itemized token usage breakdown", + "visibility": "internal" }, "totalNanoAiu": { "type": "number", @@ -943,13 +949,11 @@ } }, "required": [ - "tokenDetails", "totalNanoAiu" ], "additionalProperties": false, "description": "Per-request cost and usage data from the CAPI copilot_usage response field", - "title": "AssistantUsageCopilotUsage", - "visibility": "internal" + "title": "AssistantUsageCopilotUsage" }, "AssistantUsageCopilotUsageTokenDetail": { "type": "object", @@ -1024,20 +1028,20 @@ "duration": { "type": "integer", "minimum": 0, - "description": "Duration of the API call in milliseconds", - "format": "duration" + "format": "duration", + "description": "Duration of the API call in milliseconds" }, "timeToFirstTokenMs": { "type": "integer", "minimum": 0, - "description": "Time to first token in milliseconds. Only available for streaming requests", - "format": "duration" + "format": "duration", + "description": "Time to first token in milliseconds. Only available for streaming requests" }, "interTokenLatencyMs": { "type": "number", "minimum": 0, - "description": "Average inter-token latency in milliseconds. Only available for streaming requests", - "format": "duration" + "format": "duration", + "description": "Average inter-token latency in milliseconds. Only available for streaming requests" }, "initiator": { "type": "string", @@ -1075,8 +1079,7 @@ }, "copilotUsage": { "$ref": "#/definitions/AssistantUsageCopilotUsage", - "description": "Per-request cost and usage data from the CAPI copilot_usage response field", - "visibility": "internal" + "description": "Per-request cost and usage data from the CAPI copilot_usage response field" }, "reasoningEffort": { "type": "string", @@ -1202,6 +1205,22 @@ "format": "date-time", "description": "Date when the quota resets", "visibility": "internal" + }, + "hasQuota": { + "type": "boolean", + "description": "Whether the user currently has quota available for use", + "visibility": "internal" + }, + "tokenBasedBilling": { + "type": "boolean", + "description": "Whether this snapshot uses token-based billing (AI-credits allocation)", + "visibility": "internal" + }, + "overageEntitlement": { + "type": "number", + "minimum": 0, + "description": "Pay-as-you-go additional-usage budget cap in AI credits (1 credit = $0.01); present only when CAPI emits a finite value", + "visibility": "internal" } }, "required": [ @@ -1214,9 +1233,9 @@ "remainingPercentage" ], "additionalProperties": false, + "description": "Schema for the `AssistantUsageQuotaSnapshot` type.", "title": "AssistantUsageQuotaSnapshot", - "visibility": "internal", - "description": "Schema for the `AssistantUsageQuotaSnapshot` type." + "visibility": "internal" }, "Attachment": { "anyOf": [ @@ -1258,7 +1277,7 @@ }, "data": { "type": "string", - "description": "Base64-encoded content", + "description": "Base64-encoded content. Present on input and for external consumers; replaced by an internal `assetId` reference in persisted events when interned to a content-addressed asset.", "contentEncoding": "base64" }, "mimeType": { @@ -1268,11 +1287,23 @@ "displayName": { "type": "string", "description": "User-facing display name for the attachment" + }, + "assetId": { + "type": "string", + "description": "Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. \"sha256:...\"). Absent externally." + }, + "byteLength": { + "type": "integer", + "minimum": 0, + "description": "Internal: decoded byte length of the attachment's model-facing bytes. Absent externally." + }, + "omittedReason": { + "$ref": "#/definitions/OmittedBinaryOmittedReason", + "description": "Internal: why model-facing bytes are absent from persistence. Absent externally." } }, "required": [ "type", - "data", "mimeType" ], "additionalProperties": false, @@ -1294,6 +1325,10 @@ "displayName": { "type": "string", "description": "User-facing display name for the attachment" + }, + "taggedFilesEntry": { + "type": "string", + "description": "Frozen rendered line this attachment contributed to the prompt block (e.g. \"* /path (12 items)\"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes." } }, "required": [ @@ -1369,6 +1404,27 @@ "lineRange": { "$ref": "#/definitions/AttachmentFileLineRange", "description": "Optional line range to scope the attachment to a specific section of the file" + }, + "mimeType": { + "type": "string", + "description": "Internal: MIME type of the file's model-facing bytes (post-resize for images). Set when the file's bytes are interned to an asset. Absent externally." + }, + "assetId": { + "type": "string", + "description": "Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. \"sha256:...\"). Absent externally." + }, + "byteLength": { + "type": "integer", + "minimum": 0, + "description": "Internal: decoded byte length of the attachment's model-facing bytes. Absent externally." + }, + "omittedReason": { + "$ref": "#/definitions/OmittedBinaryOmittedReason", + "description": "Internal: why model-facing bytes are absent from persistence. Absent externally." + }, + "taggedFilesEntry": { + "type": "string", + "description": "Frozen rendered line this attachment contributed to the prompt block (e.g. \"* /path (123 lines)\"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. Present only for attachments routed to (mutually exclusive with assetId, which marks bytes sent natively)." } }, "required": [ @@ -1649,8 +1705,8 @@ "retryAfterSeconds": { "type": "integer", "minimum": 0, - "description": "Seconds until the rate limit resets, when known. Lets clients render a humanized reset time alongside the prompt.", - "format": "duration" + "format": "duration", + "description": "Seconds until the rate limit resets, when known. Lets clients render a humanized reset time alongside the prompt." } }, "required": [ @@ -1845,8 +1901,8 @@ "type": "object", "properties": {}, "additionalProperties": false, - "title": "BackgroundTasksChangedData", - "description": "Schema for the `BackgroundTasksChangedData` type." + "description": "Schema for the `BackgroundTasksChangedData` type.", + "title": "BackgroundTasksChangedData" }, "BackgroundTasksChangedEvent": { "type": "object", @@ -1904,6 +1960,178 @@ "description": "Session event \"session.background_tasks_changed\".", "title": "BackgroundTasksChangedEvent" }, + "BinaryAssetData": { + "type": "object", + "properties": { + "assetId": { + "type": "string", + "description": "Content-addressed id for this binary asset (e.g. \"sha256:...\")." + }, + "type": { + "$ref": "#/definitions/BinaryAssetType", + "description": "Binary asset type discriminator. Use \"image\" for images and \"resource\" otherwise." + }, + "mimeType": { + "type": "string", + "description": "MIME type of the binary asset" + }, + "byteLength": { + "type": "integer", + "minimum": 0, + "description": "Decoded byte length of the binary asset" + }, + "data": { + "type": "string", + "description": "Base64-encoded binary data", + "contentEncoding": "base64" + }, + "description": { + "type": "string", + "description": "Human-readable description of the binary data" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "x-opaque-json": true + }, + "description": "Optional metadata from the producing tool." + } + }, + "required": [ + "assetId", + "type", + "mimeType", + "byteLength", + "data" + ], + "additionalProperties": false, + "description": "Canonical bytes for a content-addressed binary asset shared by reference across events", + "title": "BinaryAssetData" + }, + "BinaryAssetEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique event identifier (UUID v4), generated when the event is emitted" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp when the event was created" + }, + "parentId": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event." + }, + "ephemeral": { + "type": "boolean", + "description": "When true, the event is transient and not persisted to the session event log on disk" + }, + "agentId": { + "type": "string", + "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events." + }, + "type": { + "type": "string", + "const": "session.binary_asset", + "description": "Type discriminator. Always \"session.binary_asset\"." + }, + "data": { + "$ref": "#/definitions/BinaryAssetData", + "description": "Canonical bytes for a content-addressed binary asset shared by reference across events" + } + }, + "required": [ + "id", + "timestamp", + "parentId", + "type", + "data" + ], + "additionalProperties": false, + "description": "Session event \"session.binary_asset\". Canonical bytes for a content-addressed binary asset shared by reference across events", + "title": "BinaryAssetEvent", + "stability": "experimental" + }, + "BinaryAssetReference": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/BinaryAssetReferenceType", + "description": "Binary result type discriminator. Use \"image\" for images and \"resource\" for other binary data." + }, + "assetId": { + "type": "string", + "description": "Content-addressed id of the session.binary_asset event that holds this binary's bytes (e.g. \"sha256:...\")." + }, + "mimeType": { + "type": "string", + "description": "MIME type of the referenced binary data" + }, + "byteLength": { + "type": "integer", + "minimum": 0, + "description": "Decoded byte length of the referenced binary data" + }, + "description": { + "type": "string", + "description": "Human-readable description of the binary data" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "x-opaque-json": true + }, + "description": "Optional metadata from the producing tool." + } + }, + "required": [ + "type", + "assetId", + "mimeType", + "byteLength" + ], + "additionalProperties": false, + "description": "A reference to binary data persisted once on a session.binary_asset event and shared by id", + "title": "BinaryAssetReference", + "stability": "experimental" + }, + "BinaryAssetReferenceType": { + "type": "string", + "enum": [ + "image", + "resource" + ], + "description": "Binary result type discriminator. Use \"image\" for images and \"resource\" for other binary data.", + "title": "BinaryAssetReferenceType", + "x-enumDescriptions": { + "image": "Binary image data.", + "resource": "Other binary resource data." + } + }, + "BinaryAssetType": { + "type": "string", + "enum": [ + "image", + "resource" + ], + "description": "Binary asset type discriminator. Use \"image\" for images and \"resource\" otherwise.", + "title": "BinaryAssetType", + "x-enumDescriptions": { + "image": "Binary image data.", + "resource": "Other binary resource data." + } + }, "CanvasClosedData": { "type": "object", "properties": { @@ -1927,8 +2155,9 @@ "canvasId" ], "additionalProperties": false, + "description": "Schema for the `CanvasClosedData` type.", "title": "CanvasClosedData", - "description": "Schema for the `CanvasClosedData` type." + "stability": "experimental" }, "CanvasClosedEvent": { "type": "object", @@ -1984,20 +2213,8 @@ ], "additionalProperties": false, "description": "Session event \"session.canvas.closed\".", - "title": "CanvasClosedEvent" - }, - "CanvasOpenedAvailability": { - "type": "string", - "enum": [ - "ready", - "stale" - ], - "description": "Runtime-controlled routing state for the instance. \"ready\" when the provider connection is live; \"stale\" when the provider has gone away and the instance is awaiting rebinding.", - "title": "CanvasOpenedAvailability", - "x-enumDescriptions": { - "ready": "Provider connection is live; actions can be invoked.", - "stale": "Provider has gone away; the instance is awaiting rebinding." - } + "title": "CanvasClosedEvent", + "stability": "experimental" }, "CanvasOpenedData": { "type": "object", @@ -2033,26 +2250,17 @@ "input": { "description": "Input supplied when the instance was opened", "x-opaque-json": true - }, - "reopen": { - "type": "boolean", - "description": "Whether this notification represents an idempotent reopen" - }, - "availability": { - "$ref": "#/definitions/CanvasOpenedAvailability", - "description": "Runtime-controlled routing state for the instance. \"ready\" when the provider connection is live; \"stale\" when the provider has gone away and the instance is awaiting rebinding." } }, "required": [ "instanceId", "extensionId", - "canvasId", - "reopen", - "availability" + "canvasId" ], "additionalProperties": false, + "description": "Schema for the `CanvasOpenedData` type.", "title": "CanvasOpenedData", - "description": "Schema for the `CanvasOpenedData` type." + "stability": "experimental" }, "CanvasOpenedEvent": { "type": "object", @@ -2108,7 +2316,98 @@ ], "additionalProperties": false, "description": "Session event \"session.canvas.opened\".", - "title": "CanvasOpenedEvent" + "title": "CanvasOpenedEvent", + "stability": "experimental" + }, + "CanvasRecordedData": { + "type": "object", + "properties": { + "instanceId": { + "type": "string", + "minLength": 1, + "description": "Stable caller-supplied canvas instance identifier" + }, + "extensionId": { + "type": "string", + "description": "Owning provider identifier" + }, + "canvasId": { + "type": "string", + "description": "Provider-local canvas identifier" + }, + "title": { + "type": "string", + "description": "Rendered title" + }, + "input": { + "description": "Input supplied when the instance was opened", + "x-opaque-json": true + } + }, + "required": [ + "instanceId", + "extensionId", + "canvasId" + ], + "additionalProperties": false, + "description": "Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability.", + "title": "CanvasRecordedData", + "stability": "experimental" + }, + "CanvasRecordedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique event identifier (UUID v4), generated when the event is emitted" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp when the event was created" + }, + "parentId": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event." + }, + "ephemeral": { + "type": "boolean", + "description": "When true, the event is transient and not persisted to the session event log on disk" + }, + "agentId": { + "type": "string", + "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events." + }, + "type": { + "type": "string", + "const": "session.canvas.recorded", + "description": "Type discriminator. Always \"session.canvas.recorded\"." + }, + "data": { + "$ref": "#/definitions/CanvasRecordedData", + "description": "Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability." + } + }, + "required": [ + "id", + "timestamp", + "parentId", + "type", + "data" + ], + "additionalProperties": false, + "description": "Session event \"session.canvas.recorded\". Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability.", + "title": "CanvasRecordedEvent", + "stability": "experimental" }, "CanvasRegistryChangedCanvas": { "type": "object", @@ -2135,8 +2434,6 @@ "description": "Short, single-sentence description shown to the agent in canvas catalogs." }, "inputSchema": { - "type": "object", - "additionalProperties": {}, "description": "JSON Schema for canvas open input", "x-opaque-json": true }, @@ -2155,8 +2452,9 @@ "description" ], "additionalProperties": false, + "description": "Schema for the `CanvasRegistryChangedCanvas` type.", "title": "CanvasRegistryChangedCanvas", - "description": "Schema for the `CanvasRegistryChangedCanvas` type." + "stability": "experimental" }, "CanvasRegistryChangedCanvasAction": { "type": "object", @@ -2170,8 +2468,6 @@ "description": "Action description" }, "inputSchema": { - "type": "object", - "additionalProperties": {}, "description": "JSON Schema for action input", "x-opaque-json": true } @@ -2180,28 +2476,196 @@ "name" ], "additionalProperties": false, - "title": "CanvasRegistryChangedCanvasAction", - "description": "Schema for the `CanvasRegistryChangedCanvasAction` type." + "description": "Schema for the `CanvasRegistryChangedCanvasAction` type.", + "title": "CanvasRegistryChangedCanvasAction", + "stability": "experimental" + }, + "CanvasRegistryChangedData": { + "type": "object", + "properties": { + "canvases": { + "type": "array", + "items": { + "$ref": "#/definitions/CanvasRegistryChangedCanvas" + }, + "description": "Canvas declarations currently available" + } + }, + "required": [ + "canvases" + ], + "additionalProperties": false, + "description": "Schema for the `CanvasRegistryChangedData` type.", + "title": "CanvasRegistryChangedData", + "stability": "experimental" + }, + "CanvasRegistryChangedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique event identifier (UUID v4), generated when the event is emitted" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp when the event was created" + }, + "parentId": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event." + }, + "ephemeral": { + "type": "boolean", + "const": true, + "description": "Always true for events that are transient and not persisted to the session event log on disk." + }, + "agentId": { + "type": "string", + "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events." + }, + "type": { + "type": "string", + "const": "session.canvas.registry_changed", + "description": "Type discriminator. Always \"session.canvas.registry_changed\"." + }, + "data": { + "$ref": "#/definitions/CanvasRegistryChangedData", + "description": "Schema for the `CanvasRegistryChangedData` type." + } + }, + "required": [ + "id", + "timestamp", + "parentId", + "ephemeral", + "type", + "data" + ], + "additionalProperties": false, + "description": "Session event \"session.canvas.registry_changed\".", + "title": "CanvasRegistryChangedEvent", + "stability": "experimental" + }, + "CanvasRemovedData": { + "type": "object", + "properties": { + "instanceId": { + "type": "string", + "minLength": 1, + "description": "Stable caller-supplied identifier of the canvas instance that was closed" + }, + "extensionId": { + "type": "string", + "description": "Owning provider identifier" + }, + "canvasId": { + "type": "string", + "description": "Provider-local canvas identifier" + } + }, + "required": [ + "instanceId", + "extensionId", + "canvasId" + ], + "additionalProperties": false, + "description": "Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay.", + "title": "CanvasRemovedData", + "stability": "experimental" + }, + "CanvasRemovedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique event identifier (UUID v4), generated when the event is emitted" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp when the event was created" + }, + "parentId": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event." + }, + "ephemeral": { + "type": "boolean", + "description": "When true, the event is transient and not persisted to the session event log on disk" + }, + "agentId": { + "type": "string", + "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events." + }, + "type": { + "type": "string", + "const": "session.canvas.removed", + "description": "Type discriminator. Always \"session.canvas.removed\"." + }, + "data": { + "$ref": "#/definitions/CanvasRemovedData", + "description": "Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay." + } + }, + "required": [ + "id", + "timestamp", + "parentId", + "type", + "data" + ], + "additionalProperties": false, + "description": "Session event \"session.canvas.removed\". Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay.", + "title": "CanvasRemovedEvent", + "stability": "experimental" }, - "CanvasRegistryChangedData": { + "CanvasUnavailableData": { "type": "object", "properties": { - "canvases": { - "type": "array", - "items": { - "$ref": "#/definitions/CanvasRegistryChangedCanvas" - }, - "description": "Canvas declarations currently available" + "instanceId": { + "type": "string", + "minLength": 1, + "description": "Stable caller-supplied identifier of the canvas instance whose provider became unavailable" + }, + "extensionId": { + "type": "string", + "description": "Owning provider identifier" + }, + "canvasId": { + "type": "string", + "description": "Provider-local canvas identifier" } }, "required": [ - "canvases" + "instanceId", + "extensionId", + "canvasId" ], "additionalProperties": false, - "title": "CanvasRegistryChangedData", - "description": "Schema for the `CanvasRegistryChangedData` type." + "description": "Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume.", + "title": "CanvasUnavailableData", + "stability": "experimental" }, - "CanvasRegistryChangedEvent": { + "CanvasUnavailableEvent": { "type": "object", "properties": { "id": { @@ -2237,12 +2701,12 @@ }, "type": { "type": "string", - "const": "session.canvas.registry_changed", - "description": "Type discriminator. Always \"session.canvas.registry_changed\"." + "const": "session.canvas.unavailable", + "description": "Type discriminator. Always \"session.canvas.unavailable\"." }, "data": { - "$ref": "#/definitions/CanvasRegistryChangedData", - "description": "Schema for the `CanvasRegistryChangedData` type." + "$ref": "#/definitions/CanvasUnavailableData", + "description": "Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume." } }, "required": [ @@ -2254,8 +2718,9 @@ "data" ], "additionalProperties": false, - "description": "Session event \"session.canvas.registry_changed\".", - "title": "CanvasRegistryChangedEvent" + "description": "Session event \"session.canvas.unavailable\". Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume.", + "title": "CanvasUnavailableEvent", + "stability": "experimental" }, "CapabilitiesChangedData": { "type": "object", @@ -2345,6 +2810,283 @@ "description": "UI capability changes", "title": "CapabilitiesChangedUI" }, + "CitableSource": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable identifier for this source within the tool result. Used for deduplication and may be used by future provider integrations to correlate response citations back to the originating source." + }, + "title": { + "type": "string", + "description": "Human-readable title of the source." + }, + "content": { + "type": "string", + "description": "The source text made available to the model as citable content." + }, + "url": { + "type": "string", + "description": "URL of the source, when it is a web resource." + }, + "path": { + "type": "string", + "description": "File path relative to the agent's workspace root, when the source is a file." + } + }, + "required": [ + "id", + "content" + ], + "additionalProperties": false, + "description": "A source supplied by a tool that should be made available to the model as citable content.", + "title": "CitableSource", + "stability": "experimental" + }, + "CitationLocation": { + "anyOf": [ + { + "$ref": "#/definitions/CitationLocationChar", + "description": "A character range within the source's text content." + }, + { + "$ref": "#/definitions/CitationLocationPage", + "description": "A page range within a paginated source document." + }, + { + "$ref": "#/definitions/CitationLocationBlock", + "description": "A content-block range within a structured source document." + } + ], + "description": "Location within a cited source (character, page, or content-block range) that supports a span.", + "title": "CitationLocation", + "stability": "experimental" + }, + "CitationLocationBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "block", + "description": "Citation location type discriminator" + }, + "startBlock": { + "type": "integer", + "minimum": 0, + "description": "Index of the first content block of the cited range (zero-based, inclusive)." + }, + "endBlock": { + "type": "integer", + "minimum": 0, + "description": "Index of the last content block of the cited range (zero-based, exclusive)." + } + }, + "required": [ + "type", + "startBlock", + "endBlock" + ], + "additionalProperties": false, + "description": "A content-block range within a structured source document.", + "title": "CitationLocationBlock", + "stability": "experimental" + }, + "CitationLocationChar": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "char", + "description": "Citation location type discriminator" + }, + "startIndex": { + "type": "integer", + "minimum": 0, + "description": "Start character offset within the source text (zero-based, inclusive)." + }, + "endIndex": { + "type": "integer", + "minimum": 0, + "description": "End character offset within the source text (zero-based, exclusive)." + } + }, + "required": [ + "type", + "startIndex", + "endIndex" + ], + "additionalProperties": false, + "description": "A character range within the source's text content.", + "title": "CitationLocationChar", + "stability": "experimental" + }, + "CitationLocationPage": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "page", + "description": "Citation location type discriminator" + }, + "startPage": { + "type": "integer", + "minimum": 0, + "description": "First page number of the cited range." + }, + "endPage": { + "type": "integer", + "minimum": 0, + "description": "Last page number of the cited range (inclusive)." + } + }, + "required": [ + "type", + "startPage", + "endPage" + ], + "additionalProperties": false, + "description": "A page range within a paginated source document.", + "title": "CitationLocationPage", + "stability": "experimental" + }, + "CitationProvider": { + "type": "string", + "enum": [ + "anthropic", + "openai", + "client" + ], + "description": "The system that produced a citation.", + "title": "CitationProvider", + "x-enumDescriptions": { + "anthropic": "Citation produced by an Anthropic (Claude) model response.", + "openai": "Citation produced by an OpenAI model response.", + "client": "Citation synthesized client-side by the runtime from tool output." + }, + "stability": "experimental" + }, + "CitationReference": { + "type": "object", + "properties": { + "sourceId": { + "type": "string", + "description": "Identifier of the CitationSource this reference points to (CitationSource.id)." + }, + "citedText": { + "type": "string", + "description": "The exact text from the source that supports the cited span, when provided by the model." + }, + "location": { + "$ref": "#/definitions/CitationLocation", + "description": "Location within the source that supports the cited span, when the provider reports one." + }, + "providerMetadata": { + "description": "Provider-native citation correlation data (e.g. Anthropic search_result_index / document_index), passed through opaquely for debugging and forward compatibility.", + "x-opaque-json": true + } + }, + "required": [ + "sourceId" + ], + "additionalProperties": false, + "description": "A single citation occurrence linking a span of generated text to a supporting source.", + "title": "CitationReference", + "stability": "experimental" + }, + "Citations": { + "type": "object", + "properties": { + "sources": { + "type": "array", + "items": { + "$ref": "#/definitions/CitationSource", + "description": "A source that backs one or more cited spans in the assistant's response." + }, + "description": "Deduplicated set of sources referenced by the citation spans." + }, + "spans": { + "type": "array", + "items": { + "$ref": "#/definitions/CitationSpan", + "description": "A contiguous span of generated assistant text and the source references that support it." + }, + "description": "Spans of generated text annotated with the sources that support them." + } + }, + "required": [ + "sources", + "spans" + ], + "additionalProperties": false, + "description": "Provider-agnostic citations linking spans of the assistant's response to their supporting sources.", + "title": "Citations", + "stability": "experimental" + }, + "CitationSource": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Stable, turn-scoped identifier for this source, referenced by CitationReference.sourceId." + }, + "provider": { + "$ref": "#/definitions/CitationProvider", + "description": "The system that produced this citation." + }, + "title": { + "type": "string", + "description": "Human-readable title of the source." + }, + "url": { + "type": "string", + "description": "URL of the source, when it is a web resource." + }, + "path": { + "type": "string", + "description": "File path relative to the agent's workspace root, when the source is a file." + } + }, + "required": [ + "id", + "provider" + ], + "additionalProperties": false, + "description": "A source that backs one or more cited spans in the assistant's response.", + "title": "CitationSource", + "stability": "experimental" + }, + "CitationSpan": { + "type": "object", + "properties": { + "startIndex": { + "type": "integer", + "minimum": 0, + "description": "Start offset of the cited span within the final assistant message content (UTF-16 code units, zero-based, inclusive)." + }, + "endIndex": { + "type": "integer", + "minimum": 0, + "description": "End offset of the cited span within the final assistant message content (UTF-16 code units, zero-based, exclusive)." + }, + "references": { + "type": "array", + "items": { + "$ref": "#/definitions/CitationReference", + "description": "A single citation occurrence linking a span of generated text to a supporting source." + }, + "description": "The sources that support this span of generated text." + } + }, + "required": [ + "startIndex", + "endIndex", + "references" + ], + "additionalProperties": false, + "description": "A contiguous span of generated assistant text and the source references that support it.", + "title": "CitationSpan", + "stability": "experimental" + }, "CommandCompletedData": { "type": "object", "properties": { @@ -2594,8 +3336,8 @@ "name" ], "additionalProperties": false, - "title": "CommandsChangedCommand", - "description": "Schema for the `CommandsChangedCommand` type." + "description": "Schema for the `CommandsChangedCommand` type.", + "title": "CommandsChangedCommand" }, "CommandsChangedData": { "type": "object", @@ -2702,8 +3444,8 @@ "duration": { "type": "integer", "minimum": 0, - "description": "Duration of the compaction LLM call in milliseconds", - "format": "duration" + "format": "duration", + "description": "Duration of the compaction LLM call in milliseconds" }, "model": { "type": "string", @@ -2723,7 +3465,8 @@ "$ref": "#/definitions/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail", "description": "Token usage detail for a single billing category" }, - "description": "Itemized token usage breakdown" + "description": "Itemized token usage breakdown", + "visibility": "internal" }, "totalNanoAiu": { "type": "number", @@ -2732,7 +3475,6 @@ } }, "required": [ - "tokenDetails", "totalNanoAiu" ], "additionalProperties": false, @@ -2852,6 +3594,11 @@ "type": "integer", "minimum": 0, "description": "Token count from tool definitions after compaction" + }, + "statusCode": { + "type": "integer", + "minimum": 0, + "description": "For failed compaction only: the HTTP status code of the compaction LLM call failure, when it carried one. Absent for successful compaction and for failures without an HTTP status (e.g. an empty model response or a transport error)." } }, "required": [ @@ -3052,12 +3799,12 @@ "default", "long_context" ], + "description": "Allowed values for the `ContextTier` enumeration.", "title": "ContextTier", "x-enumDescriptions": { "default": "Default context tier with standard context window size.", "long_context": "Extended context tier with a larger context window." - }, - "description": "Allowed values for the `ContextTier` enumeration." + } }, "CustomAgentsUpdatedAgent": { "type": "object", @@ -3115,8 +3862,8 @@ "userInvocable" ], "additionalProperties": false, - "title": "CustomAgentsUpdatedAgent", - "description": "Schema for the `CustomAgentsUpdatedAgent` type." + "description": "Schema for the `CustomAgentsUpdatedAgent` type.", + "title": "CustomAgentsUpdatedAgent" }, "CustomAgentsUpdatedData": { "type": "object", @@ -3149,8 +3896,8 @@ "errors" ], "additionalProperties": false, - "title": "CustomAgentsUpdatedData", - "description": "Schema for the `CustomAgentsUpdatedData` type." + "description": "Schema for the `CustomAgentsUpdatedData` type.", + "title": "CustomAgentsUpdatedData" }, "CustomAgentsUpdatedEvent": { "type": "object", @@ -3301,28 +4048,6 @@ "title": "CustomNotificationEvent" }, "CustomNotificationPayload": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "null" - }, - { - "type": "array", - "items": {} - }, - { - "type": "object", - "additionalProperties": {} - } - ], "description": "Source-defined JSON payload for the custom notification", "title": "CustomNotificationPayload", "x-opaque-json": true @@ -3351,26 +4076,9 @@ } }, "ElicitationCompletedContent": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ], + "description": "Schema for the `ElicitationCompletedContent` type.", "title": "ElicitationCompletedContent", - "x-opaque-json": true, - "description": "Schema for the `ElicitationCompletedContent` type." + "x-opaque-json": true }, "ElicitationCompletedData": { "type": "object", @@ -3490,7 +4198,6 @@ "requestId", "message" ], - "additionalProperties": true, "description": "Elicitation request; may be form-based (structured input) or URL-based (browser redirect)", "title": "ElicitationRequestedData" }, @@ -3616,8 +4323,8 @@ "blob" ], "additionalProperties": false, - "title": "EmbeddedBlobResourceContents", - "description": "Schema for the `EmbeddedBlobResourceContents` type." + "description": "Schema for the `EmbeddedBlobResourceContents` type.", + "title": "EmbeddedBlobResourceContents" }, "EmbeddedTextResourceContents": { "type": "object", @@ -3640,8 +4347,8 @@ "text" ], "additionalProperties": false, - "title": "EmbeddedTextResourceContents", - "description": "Schema for the `EmbeddedTextResourceContents` type." + "description": "Schema for the `EmbeddedTextResourceContents` type.", + "title": "EmbeddedTextResourceContents" }, "ErrorData": { "type": "object", @@ -3962,8 +4669,8 @@ "attachments" ], "additionalProperties": false, - "title": "ExtensionsAttachmentsPushedData", - "description": "Schema for the `ExtensionsAttachmentsPushedData` type." + "description": "Schema for the `ExtensionsAttachmentsPushedData` type.", + "title": "ExtensionsAttachmentsPushedData" }, "ExtensionsAttachmentsPushedEvent": { "type": "object", @@ -4036,8 +4743,8 @@ "extensions" ], "additionalProperties": false, - "title": "ExtensionsLoadedData", - "description": "Schema for the `ExtensionsLoadedData` type." + "description": "Schema for the `ExtensionsLoadedData` type.", + "title": "ExtensionsLoadedData" }, "ExtensionsLoadedEvent": { "type": "object", @@ -4122,8 +4829,8 @@ "status" ], "additionalProperties": false, - "title": "ExtensionsLoadedExtension", - "description": "Schema for the `ExtensionsLoadedExtension` type." + "description": "Schema for the `ExtensionsLoadedExtension` type.", + "title": "ExtensionsLoadedExtension" }, "ExtensionsLoadedExtensionSource": { "type": "string", @@ -5005,7 +5712,6 @@ "description": "Schema for the `McpAppToolCallCompleteToolMetaUI` type." } }, - "additionalProperties": true, "description": "The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools.", "title": "McpAppToolCallCompleteToolMeta" }, @@ -5024,9 +5730,8 @@ "description": "Tool visibility per SEP-1865 (typically a subset of `[\"model\",\"app\"]`)" } }, - "additionalProperties": true, - "title": "McpAppToolCallCompleteToolMetaUI", - "description": "Schema for the `McpAppToolCallCompleteToolMetaUI` type." + "description": "Schema for the `McpAppToolCallCompleteToolMetaUI` type.", + "title": "McpAppToolCallCompleteToolMetaUI" }, "McpOauthCompletedData": { "type": "object", @@ -5034,10 +5739,15 @@ "requestId": { "type": "string", "description": "Request ID of the resolved OAuth request" + }, + "outcome": { + "$ref": "#/definitions/McpOauthCompletionOutcome", + "description": "How the pending OAuth request was completed" } }, "required": [ - "requestId" + "requestId", + "outcome" ], "additionalProperties": false, "description": "MCP OAuth request completion notification", @@ -5099,12 +5809,25 @@ "description": "Session event \"mcp.oauth_completed\". MCP OAuth request completion notification", "title": "McpOauthCompletedEvent" }, + "McpOauthCompletionOutcome": { + "type": "string", + "enum": [ + "token", + "cancelled" + ], + "description": "How the pending MCP OAuth request was completed", + "title": "McpOauthCompletionOutcome", + "x-enumDescriptions": { + "token": "The request completed with a token-backed OAuth provider.", + "cancelled": "The request completed without an OAuth provider." + } + }, "McpOauthRequiredData": { "type": "object", "properties": { "requestId": { "type": "string", - "description": "Unique identifier for this OAuth request; used to respond via session.respondToMcpOAuth()" + "description": "Unique identifier for this OAuth request; used to respond via session.mcp.oauth.handlePendingRequest" }, "serverName": { "type": "string", @@ -5117,6 +5840,14 @@ "staticClientConfig": { "$ref": "#/definitions/McpOauthRequiredStaticClientConfig", "description": "Static OAuth client configuration, if the server specifies one" + }, + "wwwAuthenticateParams": { + "$ref": "#/definitions/McpOauthWWWAuthenticateParams", + "description": "OAuth WWW-Authenticate parameters parsed from the auth challenge, if available" + }, + "resourceMetadata": { + "type": "string", + "description": "Raw OAuth protected-resource metadata document fetched for the MCP server, if available" } }, "required": [ @@ -5208,6 +5939,29 @@ "description": "Static OAuth client configuration, if the server specifies one", "title": "McpOauthRequiredStaticClientConfig" }, + "McpOauthWWWAuthenticateParams": { + "type": "object", + "properties": { + "resourceMetadataUrl": { + "type": "string", + "description": "Protected resource metadata URL from the WWW-Authenticate resource_metadata parameter" + }, + "scope": { + "type": "string", + "description": "Requested OAuth scopes from the WWW-Authenticate scope parameter, if present" + }, + "error": { + "type": "string", + "description": "OAuth error from the WWW-Authenticate error parameter, if present" + } + }, + "required": [ + "resourceMetadataUrl" + ], + "additionalProperties": false, + "description": "OAuth WWW-Authenticate parameters parsed from an MCP auth challenge", + "title": "McpOauthWWWAuthenticateParams" + }, "McpServersLoadedData": { "type": "object", "properties": { @@ -5223,8 +5977,8 @@ "servers" ], "additionalProperties": false, - "title": "McpServersLoadedData", - "description": "Schema for the `McpServersLoadedData` type." + "description": "Schema for the `McpServersLoadedData` type.", + "title": "McpServersLoadedData" }, "McpServersLoadedEvent": { "type": "object", @@ -5319,8 +6073,8 @@ "status" ], "additionalProperties": false, - "title": "McpServersLoadedServer", - "description": "Schema for the `McpServersLoadedServer` type." + "description": "Schema for the `McpServersLoadedServer` type.", + "title": "McpServersLoadedServer" }, "McpServerSource": { "type": "string", @@ -5381,8 +6135,8 @@ "status" ], "additionalProperties": false, - "title": "McpServerStatusChangedData", - "description": "Schema for the `McpServerStatusChangedData` type." + "description": "Schema for the `McpServerStatusChangedData` type.", + "title": "McpServerStatusChangedData" }, "McpServerStatusChangedEvent": { "type": "object", @@ -5531,6 +6285,19 @@ "description": "Session event \"session.mode_changed\". Agent mode change details including previous and new modes", "title": "ModeChangedEvent" }, + "ModelCallFailureBadRequestKind": { + "type": "string", + "enum": [ + "bodyless", + "structured_error" + ], + "description": "For HTTP 400 failures only: whether the response carried a structured CAPI error envelope (structured_error, a deterministic validation failure) or no error body (bodyless, the transient gateway/proxy signature). Absent for non-400 failures.", + "title": "ModelCallFailureBadRequestKind", + "x-enumDescriptions": { + "bodyless": "The 400 response carried no error body (transient gateway/proxy signature).", + "structured_error": "The 400 response carried a structured CAPI error envelope (deterministic validation failure)." + } + }, "ModelCallFailureData": { "type": "object", "properties": { @@ -5563,8 +6330,8 @@ "durationMs": { "type": "integer", "minimum": 0, - "description": "Duration of the failed API call in milliseconds", - "format": "duration" + "format": "duration", + "description": "Duration of the failed API call in milliseconds" }, "source": { "$ref": "#/definitions/ModelCallFailureSource", @@ -5573,6 +6340,31 @@ "errorMessage": { "type": "string", "description": "Raw provider/runtime error message for restricted telemetry" + }, + "badRequestKind": { + "$ref": "#/definitions/ModelCallFailureBadRequestKind", + "description": "For HTTP 400 failures only: whether the response carried a structured CAPI error envelope (structured_error, a deterministic validation failure) or no error body (bodyless, the transient gateway/proxy signature). Absent for non-400 failures." + }, + "errorCode": { + "type": "string", + "description": "For HTTP 400 failures only: the `code` from the CAPI error envelope (e.g. 'model_max_prompt_tokens_exceeded') identifying which deterministic validation failure occurred. Raw server-controlled string, emitted only through restricted telemetry. Absent for bodyless or non-400 failures." + }, + "errorType": { + "type": "string", + "description": "For HTTP 400 failures only: the `type` from the CAPI error envelope (e.g. 'websocket_error'), a coarser companion to errorCode for envelopes that carry no code. Raw server-controlled string, emitted only through restricted telemetry. Absent for bodyless or non-400 failures." + }, + "quotaSnapshots": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AssistantUsageQuotaSnapshot", + "visibility": "internal" + }, + "description": "Per-quota usage snapshots parsed from the failed response's quota headers, keyed by quota identifier. Present when the error response carried quota headers (e.g. a 402 once the additional spend limit is reached) so the UI can refresh the quota display on failure.", + "visibility": "internal" + }, + "requestFingerprint": { + "$ref": "#/definitions/ModelCallFailureRequestFingerprint", + "description": "Content-free structural summary of the failing request. Contains only counts and shape flags (no prompt content), so it is safe for unrestricted telemetry. Populated only for client-error (4xx) failures." } }, "required": [ @@ -5638,6 +6430,56 @@ "description": "Session event \"model.call_failure\". Failed LLM API call metadata for telemetry", "title": "ModelCallFailureEvent" }, + "ModelCallFailureRequestFingerprint": { + "type": "object", + "properties": { + "messageCount": { + "type": "integer", + "minimum": 0, + "description": "Total number of messages in the request" + }, + "toolResultMessageCount": { + "type": "integer", + "minimum": 0, + "description": "Number of \"tool\" result messages in the request" + }, + "toolCallCount": { + "type": "integer", + "minimum": 0, + "description": "Total number of tool calls across assistant messages" + }, + "namelessToolCallCount": { + "type": "integer", + "minimum": 0, + "description": "Tool calls whose name is missing or empty (rejected by strict providers)" + }, + "imagePartCount": { + "type": "integer", + "minimum": 0, + "description": "Total number of image content parts" + }, + "imagePartsMissingMediaType": { + "type": "integer", + "minimum": 0, + "description": "Image parts whose media type cannot be determined (rejected by strict providers)" + }, + "lastMessageRole": { + "type": "string", + "description": "Role of the final message in the request" + } + }, + "required": [ + "messageCount", + "toolResultMessageCount", + "toolCallCount", + "namelessToolCallCount", + "imagePartCount", + "imagePartsMissingMediaType" + ], + "additionalProperties": false, + "description": "Content-free structural summary of the failing request for diagnosing malformed 4xx calls", + "title": "ModelCallFailureRequestFingerprint" + }, "ModelCallFailureSource": { "type": "string", "enum": [ @@ -5760,6 +6602,75 @@ "description": "Session event \"session.model_change\". Model change details including previous and new model identifiers", "title": "ModelChangeEvent" }, + "OmittedBinaryOmittedReason": { + "type": "string", + "enum": [ + "too_large", + "asset_unavailable" + ], + "description": "Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable", + "title": "OmittedBinaryOmittedReason", + "x-enumDescriptions": { + "too_large": "Bytes exceeded the session's inline size limit.", + "asset_unavailable": "The referenced binary asset could not be found (e.g. a truncated log)." + } + }, + "OmittedBinaryResult": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/OmittedBinaryType", + "description": "Binary result type discriminator. Use \"image\" for images and \"resource\" for other binary data." + }, + "mimeType": { + "type": "string", + "description": "MIME type of the omitted binary data" + }, + "byteLength": { + "type": "integer", + "minimum": 0, + "description": "Decoded byte length of the omitted binary data" + }, + "omittedReason": { + "$ref": "#/definitions/OmittedBinaryOmittedReason", + "description": "Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable" + }, + "description": { + "type": "string", + "description": "Human-readable description of the binary data" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "x-opaque-json": true + }, + "description": "Optional metadata from the producing tool." + } + }, + "required": [ + "type", + "mimeType", + "byteLength", + "omittedReason" + ], + "additionalProperties": false, + "description": "A binary result whose data was omitted from persistence due to the inline size limit", + "title": "OmittedBinaryResult", + "stability": "experimental" + }, + "OmittedBinaryType": { + "type": "string", + "enum": [ + "image", + "resource" + ], + "description": "Binary result type discriminator. Use \"image\" for images and \"resource\" for other binary data.", + "title": "OmittedBinaryType", + "x-enumDescriptions": { + "image": "Binary image data.", + "resource": "Other binary resource data." + } + }, "PendingMessagesModifiedData": { "type": "object", "properties": {}, @@ -5836,8 +6747,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionApproved", - "description": "Schema for the `PermissionApproved` type." + "description": "Schema for the `PermissionApproved` type.", + "title": "PermissionApproved" }, "PermissionApprovedForLocation": { "type": "object", @@ -5862,8 +6773,8 @@ "locationKey" ], "additionalProperties": false, - "title": "PermissionApprovedForLocation", - "description": "Schema for the `PermissionApprovedForLocation` type." + "description": "Schema for the `PermissionApprovedForLocation` type.", + "title": "PermissionApprovedForLocation" }, "PermissionApprovedForSession": { "type": "object", @@ -5883,8 +6794,8 @@ "approval" ], "additionalProperties": false, - "title": "PermissionApprovedForSession", - "description": "Schema for the `PermissionApprovedForSession` type." + "description": "Schema for the `PermissionApprovedForSession` type.", + "title": "PermissionApprovedForSession" }, "PermissionCancelled": { "type": "object", @@ -5903,8 +6814,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionCancelled", - "description": "Schema for the `PermissionCancelled` type." + "description": "Schema for the `PermissionCancelled` type.", + "title": "PermissionCancelled" }, "PermissionCompletedData": { "type": "object", @@ -6007,8 +6918,8 @@ "message" ], "additionalProperties": false, - "title": "PermissionDeniedByContentExclusionPolicy", - "description": "Schema for the `PermissionDeniedByContentExclusionPolicy` type." + "description": "Schema for the `PermissionDeniedByContentExclusionPolicy` type.", + "title": "PermissionDeniedByContentExclusionPolicy" }, "PermissionDeniedByPermissionRequestHook": { "type": "object", @@ -6031,8 +6942,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDeniedByPermissionRequestHook", - "description": "Schema for the `PermissionDeniedByPermissionRequestHook` type." + "description": "Schema for the `PermissionDeniedByPermissionRequestHook` type.", + "title": "PermissionDeniedByPermissionRequestHook" }, "PermissionDeniedByRules": { "type": "object", @@ -6055,8 +6966,8 @@ "rules" ], "additionalProperties": false, - "title": "PermissionDeniedByRules", - "description": "Schema for the `PermissionDeniedByRules` type." + "description": "Schema for the `PermissionDeniedByRules` type.", + "title": "PermissionDeniedByRules" }, "PermissionDeniedInteractivelyByUser": { "type": "object", @@ -6079,8 +6990,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDeniedInteractivelyByUser", - "description": "Schema for the `PermissionDeniedInteractivelyByUser` type." + "description": "Schema for the `PermissionDeniedInteractivelyByUser` type.", + "title": "PermissionDeniedInteractivelyByUser" }, "PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser": { "type": "object", @@ -6095,8 +7006,8 @@ "kind" ], "additionalProperties": false, - "title": "PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser", - "description": "Schema for the `PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type." + "description": "Schema for the `PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type.", + "title": "PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser" }, "PermissionPromptRequest": { "anyOf": [ @@ -6349,12 +7260,6 @@ "description": "Human-readable title of the MCP tool" }, "args": { - "anyOf": [ - {}, - { - "type": "null" - } - ], "description": "Arguments to pass to the MCP tool", "x-opaque-json": true } @@ -6918,8 +7823,8 @@ "store", "vote" ], - "description": "Whether this is a store or vote memory operation", "default": "store", + "description": "Whether this is a store or vote memory operation", "title": "PermissionRequestMemoryAction", "x-enumDescriptions": { "store": "Store a new memory.", @@ -7021,6 +7926,14 @@ "warning": { "type": "string", "description": "Optional warning message about risks of running this command" + }, + "requestSandboxBypass": { + "type": "boolean", + "description": "True when the model has requested to run this command outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the command runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI." + }, + "requestSandboxBypassReason": { + "type": "string", + "description": "Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true." } }, "required": [ @@ -7054,8 +7967,8 @@ "readOnly" ], "additionalProperties": false, - "title": "PermissionRequestShellCommand", - "description": "Schema for the `PermissionRequestShellCommand` type." + "description": "Schema for the `PermissionRequestShellCommand` type.", + "title": "PermissionRequestShellCommand" }, "PermissionRequestShellPossibleUrl": { "type": "object", @@ -7069,8 +7982,8 @@ "url" ], "additionalProperties": false, - "title": "PermissionRequestShellPossibleUrl", - "description": "Schema for the `PermissionRequestShellPossibleUrl` type." + "description": "Schema for the `PermissionRequestShellPossibleUrl` type.", + "title": "PermissionRequestShellPossibleUrl" }, "PermissionRequestUrl": { "type": "object", @@ -7199,8 +8112,8 @@ "argument" ], "additionalProperties": false, - "title": "PermissionRule", - "description": "Schema for the `PermissionRule` type." + "description": "Schema for the `PermissionRule` type.", + "title": "PermissionRule" }, "PermissionsChangedData": { "type": "object", @@ -7276,6 +8189,75 @@ "description": "Session event \"session.permissions_changed\". Permissions change details carrying the aggregate allow-all boolean transition.", "title": "PermissionsChangedEvent" }, + "PersistedBinaryImage": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/PersistedBinaryImageType", + "description": "Binary result type discriminator. Use \"image\" for images and \"resource\" for other binary data." + }, + "data": { + "type": "string", + "description": "Base64-encoded binary data", + "contentEncoding": "base64" + }, + "mimeType": { + "type": "string", + "description": "MIME type of the binary data" + }, + "description": { + "type": "string", + "description": "Human-readable description of the binary data" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "x-opaque-json": true + }, + "description": "Optional metadata from the producing tool." + } + }, + "required": [ + "type", + "data", + "mimeType" + ], + "additionalProperties": false, + "description": "Binary result returned by a tool for the model", + "title": "PersistedBinaryImage" + }, + "PersistedBinaryImageType": { + "type": "string", + "enum": [ + "image", + "resource" + ], + "description": "Binary result type discriminator. Use \"image\" for images and \"resource\" for other binary data.", + "title": "PersistedBinaryImageType", + "x-enumDescriptions": { + "image": "Binary image data.", + "resource": "Other binary resource data." + } + }, + "PersistedBinaryResult": { + "anyOf": [ + { + "$ref": "#/definitions/PersistedBinaryImage", + "description": "Binary result returned by a tool for the model" + }, + { + "$ref": "#/definitions/OmittedBinaryResult", + "description": "A binary result whose data was omitted from persistence due to the inline size limit" + }, + { + "$ref": "#/definitions/BinaryAssetReference", + "description": "A reference to binary data persisted once on a session.binary_asset event and shared by id" + } + ], + "description": "A model-facing binary result as persisted: full inline data, a size-omitted marker, or a deduplicated asset reference", + "title": "PersistedBinaryResult", + "stability": "experimental" + }, "PlanChangedData": { "type": "object", "properties": { @@ -7651,10 +8633,6 @@ "description": "Name of the MCP server that initiated the sampling request" }, "mcpRequestId": { - "type": [ - "string", - "number" - ], "description": "The JSON-RPC request ID from the MCP protocol", "x-opaque-json": true } @@ -7664,7 +8642,6 @@ "serverName", "mcpRequestId" ], - "additionalProperties": true, "description": "Sampling request from an MCP server; contains the server name and a requestId for correlation", "title": "SamplingRequestedData" }, @@ -7805,8 +8782,8 @@ "intervalMs": { "type": "integer", "exclusiveMinimum": 0, - "description": "Interval between ticks in milliseconds (relative-interval schedules)", - "format": "duration" + "format": "duration", + "description": "Interval between ticks in milliseconds (relative-interval schedules)" }, "cron": { "type": "string", @@ -7829,6 +8806,10 @@ "type": "boolean", "description": "Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`)" }, + "selfPaced": { + "type": "boolean", + "description": "True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled rather than auto-computed." + }, "displayPrompt": { "type": "string", "description": "Optional user-facing label shown in the timeline instead of the actual prompt (e.g. `/skill-name args` when the prompt is a skill invocation expansion)" @@ -7896,6 +8877,82 @@ "description": "Session event \"session.schedule_created\". Scheduled prompt registered via /every or /after", "title": "ScheduleCreatedEvent" }, + "ScheduleRearmedData": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Id of the self-paced schedule that was re-armed" + }, + "nextRunAt": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Absolute time (epoch milliseconds) the model armed the next run to fire" + } + }, + "required": [ + "id", + "nextRunAt" + ], + "additionalProperties": false, + "description": "Self-paced schedule re-armed for its next run", + "title": "ScheduleRearmedData" + }, + "ScheduleRearmedEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique event identifier (UUID v4), generated when the event is emitted" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "ISO 8601 timestamp when the event was created" + }, + "parentId": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event." + }, + "ephemeral": { + "type": "boolean", + "description": "When true, the event is transient and not persisted to the session event log on disk" + }, + "agentId": { + "type": "string", + "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events." + }, + "type": { + "type": "string", + "const": "session.schedule_rearmed", + "description": "Type discriminator. Always \"session.schedule_rearmed\"." + }, + "data": { + "$ref": "#/definitions/ScheduleRearmedData", + "description": "Self-paced schedule re-armed for its next run" + } + }, + "required": [ + "id", + "timestamp", + "parentId", + "type", + "data" + ], + "additionalProperties": false, + "description": "Session event \"session.schedule_rearmed\". Self-paced schedule re-armed for its next run", + "title": "ScheduleRearmedEvent" + }, "SessionEvent": { "anyOf": [ { @@ -7930,6 +8987,10 @@ "$ref": "#/definitions/ScheduleCancelledEvent", "description": "Session event \"session.schedule_cancelled\". Scheduled prompt cancelled from the schedule manager dialog" }, + { + "$ref": "#/definitions/ScheduleRearmedEvent", + "description": "Session event \"session.schedule_rearmed\". Self-paced schedule re-armed for its next run" + }, { "$ref": "#/definitions/AutopilotObjectiveChangedEvent", "description": "Session event \"session.autopilot_objective_changed\". Autopilot objective state file operation details indicating what changed" @@ -8114,6 +9175,10 @@ "$ref": "#/definitions/HookProgressEvent", "description": "Session event \"hook.progress\". Ephemeral progress update from a running hook process" }, + { + "$ref": "#/definitions/BinaryAssetEvent", + "description": "Session event \"session.binary_asset\". Canonical bytes for a content-addressed binary asset shared by reference across events" + }, { "$ref": "#/definitions/SystemMessageEvent", "description": "Session event \"system.message\". System/developer instruction content with role and optional template metadata" @@ -8250,6 +9315,18 @@ "$ref": "#/definitions/CanvasClosedEvent", "description": "Session event \"session.canvas.closed\"." }, + { + "$ref": "#/definitions/CanvasUnavailableEvent", + "description": "Session event \"session.canvas.unavailable\". Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume." + }, + { + "$ref": "#/definitions/CanvasRecordedEvent", + "description": "Session event \"session.canvas.recorded\". Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability." + }, + { + "$ref": "#/definitions/CanvasRemovedEvent", + "description": "Session event \"session.canvas.removed\". Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay." + }, { "$ref": "#/definitions/ExtensionsAttachmentsPushedEvent", "description": "Session event \"session.extensions.attachments_pushed\"." @@ -8339,8 +9416,8 @@ "totalApiDurationMs": { "type": "integer", "minimum": 0, - "description": "Cumulative time spent in API calls during the session, in milliseconds", - "format": "duration" + "format": "duration", + "description": "Cumulative time spent in API calls during the session, in milliseconds" }, "sessionStartTime": { "type": "integer", @@ -8483,8 +9560,8 @@ "usage" ], "additionalProperties": false, - "title": "ShutdownModelMetric", - "description": "Schema for the `ShutdownModelMetric` type." + "description": "Schema for the `ShutdownModelMetric` type.", + "title": "ShutdownModelMetric" }, "ShutdownModelMetricRequests": { "type": "object", @@ -8518,8 +9595,8 @@ "tokenCount" ], "additionalProperties": false, - "title": "ShutdownModelMetricTokenDetail", - "description": "Schema for the `ShutdownModelMetricTokenDetail` type." + "description": "Schema for the `ShutdownModelMetricTokenDetail` type.", + "title": "ShutdownModelMetricTokenDetail" }, "ShutdownModelMetricUsage": { "type": "object", @@ -8573,8 +9650,8 @@ "tokenCount" ], "additionalProperties": false, - "title": "ShutdownTokenDetail", - "description": "Schema for the `ShutdownTokenDetail` type." + "description": "Schema for the `ShutdownTokenDetail` type.", + "title": "ShutdownTokenDetail" }, "ShutdownType": { "type": "string", @@ -8725,8 +9802,8 @@ "skills" ], "additionalProperties": false, - "title": "SkillsLoadedData", - "description": "Schema for the `SkillsLoadedData` type." + "description": "Schema for the `SkillsLoadedData` type.", + "title": "SkillsLoadedData" }, "SkillsLoadedEvent": { "type": "object", @@ -8810,6 +9887,10 @@ "path": { "type": "string", "description": "Absolute path to the skill file, if available" + }, + "argumentHint": { + "type": "string", + "description": "Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field" } }, "required": [ @@ -8820,8 +9901,8 @@ "enabled" ], "additionalProperties": false, - "title": "SkillsLoadedSkill", - "description": "Schema for the `SkillsLoadedSkill` type." + "description": "Schema for the `SkillsLoadedSkill` type.", + "title": "SkillsLoadedSkill" }, "SkillSource": { "type": "string", @@ -9085,8 +10166,8 @@ "durationMs": { "type": "integer", "minimum": 0, - "description": "Wall-clock duration of the sub-agent execution in milliseconds", - "format": "duration" + "format": "duration", + "description": "Wall-clock duration of the sub-agent execution in milliseconds" } }, "required": [ @@ -9249,8 +10330,8 @@ "durationMs": { "type": "integer", "minimum": 0, - "description": "Wall-clock duration of the sub-agent execution in milliseconds", - "format": "duration" + "format": "duration", + "description": "Wall-clock duration of the sub-agent execution in milliseconds" } }, "required": [ @@ -9668,8 +10749,8 @@ "status" ], "additionalProperties": false, - "title": "SystemNotificationAgentCompleted", - "description": "Schema for the `SystemNotificationAgentCompleted` type." + "description": "Schema for the `SystemNotificationAgentCompleted` type.", + "title": "SystemNotificationAgentCompleted" }, "SystemNotificationAgentCompletedStatus": { "type": "string", @@ -9711,8 +10792,8 @@ "agentType" ], "additionalProperties": false, - "title": "SystemNotificationAgentIdle", - "description": "Schema for the `SystemNotificationAgentIdle` type." + "description": "Schema for the `SystemNotificationAgentIdle` type.", + "title": "SystemNotificationAgentIdle" }, "SystemNotificationData": { "type": "object", @@ -9820,8 +10901,8 @@ "triggerTool" ], "additionalProperties": false, - "title": "SystemNotificationInstructionDiscovered", - "description": "Schema for the `SystemNotificationInstructionDiscovered` type." + "description": "Schema for the `SystemNotificationInstructionDiscovered` type.", + "title": "SystemNotificationInstructionDiscovered" }, "SystemNotificationNewInboxMessage": { "type": "object", @@ -9856,8 +10937,8 @@ "summary" ], "additionalProperties": false, - "title": "SystemNotificationNewInboxMessage", - "description": "Schema for the `SystemNotificationNewInboxMessage` type." + "description": "Schema for the `SystemNotificationNewInboxMessage` type.", + "title": "SystemNotificationNewInboxMessage" }, "SystemNotificationShellCompleted": { "type": "object", @@ -9885,8 +10966,8 @@ "shellId" ], "additionalProperties": false, - "title": "SystemNotificationShellCompleted", - "description": "Schema for the `SystemNotificationShellCompleted` type." + "description": "Schema for the `SystemNotificationShellCompleted` type.", + "title": "SystemNotificationShellCompleted" }, "SystemNotificationShellDetachedCompleted": { "type": "object", @@ -9910,8 +10991,8 @@ "shellId" ], "additionalProperties": false, - "title": "SystemNotificationShellDetachedCompleted", - "description": "Schema for the `SystemNotificationShellDetachedCompleted` type." + "description": "Schema for the `SystemNotificationShellDetachedCompleted` type.", + "title": "SystemNotificationShellDetachedCompleted" }, "TaskCompleteData": { "type": "object", @@ -10535,6 +11616,15 @@ }, "description": "Structured content blocks (text, images, audio, resources) returned by the tool in their native format" }, + "binaryResultsForLlm": { + "type": "array", + "items": { + "$ref": "#/definitions/PersistedBinaryResult", + "description": "A model-facing binary result as persisted: full inline data, a size-omitted marker, or a deduplicated asset reference" + }, + "description": "Model-facing binary results (base64 inline or size-omitted markers) sent to the LLM for this tool call", + "stability": "experimental" + }, "uiResource": { "$ref": "#/definitions/ToolExecutionCompleteUIResource", "description": "MCP Apps UI resource content for rendering in a sandboxed iframe" @@ -10542,6 +11632,15 @@ "structuredContent": { "description": "Structured content (arbitrary JSON) returned verbatim by the MCP tool", "x-opaque-json": true + }, + "citableSources": { + "type": "array", + "items": { + "$ref": "#/definitions/CitableSource", + "description": "A source supplied by a tool that should be made available to the model as citable content." + }, + "description": "Provider-neutral source material this tool makes available to the model as citable content. Persisted so it survives session resume. Experimental.", + "stability": "experimental" } }, "required": [ @@ -10602,8 +11701,8 @@ } }, "additionalProperties": false, - "title": "ToolExecutionCompleteToolDescriptionMetaUI", - "description": "Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type." + "description": "Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type.", + "title": "ToolExecutionCompleteToolDescriptionMetaUI" }, "ToolExecutionCompleteToolDescriptionMetaUIVisibility": { "type": "string", @@ -10611,12 +11710,12 @@ "model", "app" ], + "description": "Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration.", "title": "ToolExecutionCompleteToolDescriptionMetaUIVisibility", "x-enumDescriptions": { "model": "Tool is callable by the model (LLM tool surface)", "app": "Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool" - }, - "description": "Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration." + } }, "ToolExecutionCompleteUIResource": { "type": "object", @@ -10681,8 +11780,8 @@ } }, "additionalProperties": false, - "title": "ToolExecutionCompleteUIResourceMetaUI", - "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUI` type." + "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUI` type.", + "title": "ToolExecutionCompleteUIResourceMetaUI" }, "ToolExecutionCompleteUIResourceMetaUICsp": { "type": "object", @@ -10713,8 +11812,8 @@ } }, "additionalProperties": false, - "title": "ToolExecutionCompleteUIResourceMetaUICsp", - "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type." + "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type.", + "title": "ToolExecutionCompleteUIResourceMetaUICsp" }, "ToolExecutionCompleteUIResourceMetaUIPermissions": { "type": "object", @@ -10737,36 +11836,32 @@ } }, "additionalProperties": false, - "title": "ToolExecutionCompleteUIResourceMetaUIPermissions", - "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type." + "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type.", + "title": "ToolExecutionCompleteUIResourceMetaUIPermissions" }, "ToolExecutionCompleteUIResourceMetaUIPermissionsCamera": { "type": "object", "properties": {}, - "additionalProperties": true, - "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsCamera", - "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type." + "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type.", + "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsCamera" }, "ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite": { "type": "object", "properties": {}, - "additionalProperties": true, - "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite", - "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type." + "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type.", + "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite" }, "ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation": { "type": "object", "properties": {}, - "additionalProperties": true, - "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation", - "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type." + "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type.", + "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation" }, "ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone": { "type": "object", "properties": {}, - "additionalProperties": true, - "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone", - "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type." + "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type.", + "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone" }, "ToolExecutionPartialData": { "type": "object", @@ -11078,8 +12173,8 @@ } }, "additionalProperties": false, - "title": "ToolExecutionStartToolDescriptionMetaUI", - "description": "Schema for the `ToolExecutionStartToolDescriptionMetaUI` type." + "description": "Schema for the `ToolExecutionStartToolDescriptionMetaUI` type.", + "title": "ToolExecutionStartToolDescriptionMetaUI" }, "ToolExecutionStartToolDescriptionMetaUIVisibility": { "type": "string", @@ -11087,12 +12182,12 @@ "model", "app" ], + "description": "Allowed values for the `ToolExecutionStartToolDescriptionMetaUIVisibility` enumeration.", "title": "ToolExecutionStartToolDescriptionMetaUIVisibility", "x-enumDescriptions": { "model": "Tool is callable by the model (LLM tool surface)", "app": "Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool" - }, - "description": "Allowed values for the `ToolExecutionStartToolDescriptionMetaUIVisibility` enumeration." + } }, "ToolsUpdatedData": { "type": "object", @@ -11106,8 +12201,8 @@ "model" ], "additionalProperties": false, - "title": "ToolsUpdatedData", - "description": "Schema for the `ToolsUpdatedData` type." + "description": "Schema for the `ToolsUpdatedData` type.", + "title": "ToolsUpdatedData" }, "ToolsUpdatedEvent": { "type": "object", @@ -11702,8 +12797,8 @@ "content" ], "additionalProperties": false, - "title": "UserMessageData", - "description": "Schema for the `UserMessageData` type." + "description": "Schema for the `UserMessageData` type.", + "title": "UserMessageData" }, "UserMessageEvent": { "type": "object", @@ -11810,8 +12905,8 @@ "commandIdentifiers" ], "additionalProperties": false, - "title": "UserToolSessionApprovalCommands", - "description": "Schema for the `UserToolSessionApprovalCommands` type." + "description": "Schema for the `UserToolSessionApprovalCommands` type.", + "title": "UserToolSessionApprovalCommands" }, "UserToolSessionApprovalCustomTool": { "type": "object", @@ -11831,8 +12926,8 @@ "toolName" ], "additionalProperties": false, - "title": "UserToolSessionApprovalCustomTool", - "description": "Schema for the `UserToolSessionApprovalCustomTool` type." + "description": "Schema for the `UserToolSessionApprovalCustomTool` type.", + "title": "UserToolSessionApprovalCustomTool" }, "UserToolSessionApprovalExtensionManagement": { "type": "object", @@ -11851,8 +12946,8 @@ "kind" ], "additionalProperties": false, - "title": "UserToolSessionApprovalExtensionManagement", - "description": "Schema for the `UserToolSessionApprovalExtensionManagement` type." + "description": "Schema for the `UserToolSessionApprovalExtensionManagement` type.", + "title": "UserToolSessionApprovalExtensionManagement" }, "UserToolSessionApprovalExtensionPermissionAccess": { "type": "object", @@ -11872,8 +12967,8 @@ "extensionName" ], "additionalProperties": false, - "title": "UserToolSessionApprovalExtensionPermissionAccess", - "description": "Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type." + "description": "Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type.", + "title": "UserToolSessionApprovalExtensionPermissionAccess" }, "UserToolSessionApprovalMcp": { "type": "object", @@ -11901,8 +12996,8 @@ "toolName" ], "additionalProperties": false, - "title": "UserToolSessionApprovalMcp", - "description": "Schema for the `UserToolSessionApprovalMcp` type." + "description": "Schema for the `UserToolSessionApprovalMcp` type.", + "title": "UserToolSessionApprovalMcp" }, "UserToolSessionApprovalMemory": { "type": "object", @@ -11917,8 +13012,8 @@ "kind" ], "additionalProperties": false, - "title": "UserToolSessionApprovalMemory", - "description": "Schema for the `UserToolSessionApprovalMemory` type." + "description": "Schema for the `UserToolSessionApprovalMemory` type.", + "title": "UserToolSessionApprovalMemory" }, "UserToolSessionApprovalRead": { "type": "object", @@ -11933,8 +13028,8 @@ "kind" ], "additionalProperties": false, - "title": "UserToolSessionApprovalRead", - "description": "Schema for the `UserToolSessionApprovalRead` type." + "description": "Schema for the `UserToolSessionApprovalRead` type.", + "title": "UserToolSessionApprovalRead" }, "UserToolSessionApprovalWrite": { "type": "object", @@ -11949,8 +13044,8 @@ "kind" ], "additionalProperties": false, - "title": "UserToolSessionApprovalWrite", - "description": "Schema for the `UserToolSessionApprovalWrite` type." + "description": "Schema for the `UserToolSessionApprovalWrite` type.", + "title": "UserToolSessionApprovalWrite" }, "WarningData": { "type": "object", diff --git a/script/codegen/fetch_schemas.clj b/script/codegen/fetch_schemas.clj index 5e5868f..4f38e7b 100644 --- a/script/codegen/fetch_schemas.clj +++ b/script/codegen/fetch_schemas.clj @@ -44,10 +44,21 @@ (println "Usage: bb schemas:fetch [--version VERSION]") (System/exit 2))))) -(defn fetch-tarball! [version dest-dir] - (let [url (format "https://registry.npmjs.org/@github/copilot/-/copilot-%s.tgz" - version) - tgz (str (fs/path dest-dir (format "copilot-%s.tgz" version)))] +;; Canonical platform package to source schemas from when the main +;; `@github/copilot` package no longer bundles them (see `-main`). Schemas are +;; platform-independent JSON, so any platform package yields byte-identical +;; files; we pin one deterministically for reproducible offline builds. +(def schema-platform-package "@github/copilot-linux-x64") + +(defn- unscoped-name [pkg] + ;; "@github/copilot-linux-x64" -> "copilot-linux-x64"; "@github/copilot" -> "copilot". + (last (str/split pkg #"/"))) + +(defn fetch-tarball! [pkg version dest-dir] + (let [unscoped (unscoped-name pkg) + url (format "https://registry.npmjs.org/%s/-/%s-%s.tgz" + pkg unscoped version) + tgz (str (fs/path dest-dir (format "%s-%s.tgz" unscoped version)))] (println (format "Fetching %s" url)) (let [{:keys [exit err]} @(p/process ["curl" "-fsSL" "-o" tgz url] {:err :string})] @@ -60,21 +71,23 @@ ;; Tarball layout: package/schemas/*.json (npm convention prepends `package/`). ;; Extract into a dedicated `schemas` subdir so we can copy from a ;; clean directory (avoids accidentally picking up package.json or - ;; other extracted files). + ;; other extracted files). Returns true on success, false if the tarball + ;; carries no `package/schemas` directory (newer split-package layout). (println (format "Extracting schemas from %s" tgz)) - (let [{:keys [exit err]} + (fs/create-dirs dest-dir) + (let [{:keys [exit]} @(p/process ["tar" "-xzf" tgz "-C" dest-dir "--strip-components=1" "package/schemas"] - {:err :string})] - (when-not (zero? exit) - (println "tar failed:" err) - (System/exit exit)))) + {:err :string :out :string})] + (zero? exit))) (defn extract-package-json! [tgz dest-dir] - ;; Extract package/package.json so we can verify its declared version - ;; matches the URL-pinned version (defends against mirror caches / - ;; redirected tags / corrupted artifacts). + ;; Extract package/package.json into dest-dir so we can verify its declared + ;; version matches the URL-pinned version (defends against mirror caches / + ;; redirected tags / corrupted artifacts). dest-dir is per-package so a + ;; second tarball's package.json does not clobber the first. + (fs/create-dirs dest-dir) (let [{:keys [exit err]} @(p/process ["tar" "-xzf" tgz "-C" dest-dir "--strip-components=1" @@ -93,21 +106,50 @@ (System/exit 1)) (println (format "Verified tarball package.json version: %s" actual)))) +(defn fetch-verified-tarball! [pkg version tmp] + ;; Fetch a package tarball and confirm its package.json version matches the + ;; pinned version. Returns the tarball path. + (let [tgz (fetch-tarball! pkg version tmp) + meta-dir (str (fs/path tmp (str (unscoped-name pkg) "-meta")))] + (extract-package-json! tgz meta-dir) + (verify-tarball-version! (str (fs/path meta-dir "package.json")) version) + tgz)) + (defn -main [& args] (let [opts (parse-args args) version (or (:version opts) (read-pinned-version)) tmp (str (fs/create-temp-dir {:prefix "copilot-schemas-"}))] (try (println (format "Pinned schema version: %s" version)) - (let [tgz (fetch-tarball! version tmp) - schemas-extract-dir (str (fs/path tmp "schemas"))] - (fs/create-dirs tmp) - (extract-package-json! tgz tmp) - (verify-tarball-version! (str (fs/path tmp "package.json")) version) - (extract-schemas! tgz tmp) + (fs/create-dirs tmp) + (let [schemas-extract-dir (str (fs/path tmp "schemas")) + ;; Schemas used to ship in the main `@github/copilot` package, but + ;; from CLI 1.0.64 onward that package is a thin platform-loader + ;; stub and the schemas live in the per-platform packages + ;; (e.g. `@github/copilot-linux-x64`). Try the main package first + ;; for backward compatibility with older pins, then fall back to a + ;; canonical platform package. + main-tgz (fetch-verified-tarball! "@github/copilot" version tmp) + schema-source + (if (extract-schemas! main-tgz tmp) + "@github/copilot" + (do + (println + (format + (str "Main package carries no schemas (split-package layout); " + "falling back to %s.") + schema-platform-package)) + (let [plat-tgz (fetch-verified-tarball! + schema-platform-package version tmp)] + (when-not (extract-schemas! plat-tgz tmp) + (println + (format "ERROR: %s carries no package/schemas directory." + schema-platform-package)) + (System/exit 1)) + schema-platform-package)))] + (println (format "Schemas sourced from: %s" schema-source)) ;; Wipe destination to avoid stale schemas, then copy fresh ones from - ;; the extracted `schemas/` subdir (NOT the temp root, which also - ;; contains the extracted package.json). + ;; the extracted `schemas/` subdir. (when (fs/exists? schemas-dir) (fs/delete-tree schemas-dir)) (fs/create-dirs schemas-dir) @@ -121,12 +163,12 @@ (spit (str (fs/path schemas-dir "README.md")) (format (str "# Upstream Copilot CLI JSON Schemas\n\n" - "These files are fetched verbatim from the `@github/copilot` " + "These files are fetched verbatim from the `%s` " "npm package at the version pinned in `.copilot-schema-version`.\n\n" "**Do not edit by hand.** To update, run `bb schemas:fetch` after " "bumping `.copilot-schema-version`.\n\n" "Currently pinned version: `%s`\n") - version))) + schema-source version))) (println "Schemas updated successfully.") (finally (fs/delete-tree tmp))))) diff --git a/src/github/copilot_sdk/generated/event_specs.clj b/src/github/copilot_sdk/generated/event_specs.clj index 4740db7..c50cdc3 100644 --- a/src/github/copilot_sdk/generated/event_specs.clj +++ b/src/github/copilot_sdk/generated/event_specs.clj @@ -41,18 +41,22 @@ (s/def :github.copilot-sdk.generated.event-specs/arguments (s/spec (fn [v950] (or (s/valid? clojure.core/any? v950) (s/valid? clojure.core/map? v950))))) +(s/def :github.copilot-sdk.generated.event-specs/asset-id clojure.core/string?) + (s/def :github.copilot-sdk.generated.event-specs/at clojure.core/integer?) (s/def :github.copilot-sdk.generated.event-specs/attachments (s/coll-of (s/or :branch-0 clojure.core/map? :branch-1 clojure.core/map? :branch-2 clojure.core/map? :branch-3 clojure.core/map? :branch-4 clojure.core/map? :branch-5 clojure.core/map?))) (s/def :github.copilot-sdk.generated.event-specs/auto-approve-edits clojure.core/boolean?) -(s/def :github.copilot-sdk.generated.event-specs/availability #{"ready" "stale"}) +(s/def :github.copilot-sdk.generated.event-specs/bad-request-kind #{"bodyless" "structured_error"}) (s/def :github.copilot-sdk.generated.event-specs/base-commit clojure.core/string?) (s/def :github.copilot-sdk.generated.event-specs/branch clojure.core/string?) +(s/def :github.copilot-sdk.generated.event-specs/byte-length clojure.core/integer?) + (s/def :github.copilot-sdk.generated.event-specs/cache-read-tokens clojure.core/integer?) (s/def :github.copilot-sdk.generated.event-specs/cache-write-tokens clojure.core/integer?) @@ -69,6 +73,8 @@ (s/def :github.copilot-sdk.generated.event-specs/choices (s/coll-of clojure.core/string?)) +(s/def :github.copilot-sdk.generated.event-specs/citations clojure.core/map?) + (s/def :github.copilot-sdk.generated.event-specs/code-changes clojure.core/map?) (s/def :github.copilot-sdk.generated.event-specs/command clojure.core/string?) @@ -107,7 +113,7 @@ (s/def :github.copilot-sdk.generated.event-specs/cwd clojure.core/string?) -(s/def :github.copilot-sdk.generated.event-specs/data clojure.core/map?) +(s/def :github.copilot-sdk.generated.event-specs/data (s/spec (fn [v951] (or (s/valid? clojure.core/map? v951) (s/valid? clojure.core/string? v951))))) (s/def :github.copilot-sdk.generated.event-specs/delta-content clojure.core/string?) @@ -219,6 +225,8 @@ (s/def :github.copilot-sdk.generated.event-specs/metadata clojure.core/map?) +(s/def :github.copilot-sdk.generated.event-specs/mime-type clojure.core/string?) + (s/def :github.copilot-sdk.generated.event-specs/mode #{"url" "form"}) (s/def :github.copilot-sdk.generated.event-specs/model clojure.core/string?) @@ -233,8 +241,12 @@ (s/def :github.copilot-sdk.generated.event-specs/new-model clojure.core/string?) +(s/def :github.copilot-sdk.generated.event-specs/next-run-at clojure.core/integer?) + (s/def :github.copilot-sdk.generated.event-specs/operation (s/spec (fn [v946] (or (s/valid? #{"delete" "update" "create"} v946) (s/valid? #{"update" "create"} v946))))) +(s/def :github.copilot-sdk.generated.event-specs/outcome #{"token" "cancelled"}) + (s/def :github.copilot-sdk.generated.event-specs/output clojure.core/any?) (s/def :github.copilot-sdk.generated.event-specs/output-tokens clojure.core/integer?) @@ -249,7 +261,7 @@ (s/def :github.copilot-sdk.generated.event-specs/path clojure.core/string?) -(s/def :github.copilot-sdk.generated.event-specs/payload (s/nilable (s/or :branch-0 clojure.core/string? :branch-1 clojure.core/number? :branch-2 clojure.core/boolean? :branch-3 (s/coll-of clojure.core/any?) :branch-4 clojure.core/map?))) +(s/def :github.copilot-sdk.generated.event-specs/payload clojure.core/any?) (s/def :github.copilot-sdk.generated.event-specs/performed-by clojure.core/string?) @@ -323,21 +335,23 @@ (s/def :github.copilot-sdk.generated.event-specs/remote-steerable clojure.core/boolean?) -(s/def :github.copilot-sdk.generated.event-specs/reopen clojure.core/boolean?) - (s/def :github.copilot-sdk.generated.event-specs/repository (s/spec (fn [v940] (or (s/valid? clojure.core/map? v940) (s/valid? clojure.core/string? v940))))) (s/def :github.copilot-sdk.generated.event-specs/repository-host clojure.core/string?) +(s/def :github.copilot-sdk.generated.event-specs/request-fingerprint clojure.core/map?) + (s/def :github.copilot-sdk.generated.event-specs/request-id clojure.core/string?) (s/def :github.copilot-sdk.generated.event-specs/requested-schema clojure.core/map?) (s/def :github.copilot-sdk.generated.event-specs/resolved-by-hook clojure.core/boolean?) +(s/def :github.copilot-sdk.generated.event-specs/resource-metadata clojure.core/string?) + (s/def :github.copilot-sdk.generated.event-specs/response #{"yes_always" "yes" "no"}) -(s/def :github.copilot-sdk.generated.event-specs/result (s/spec (fn [v951] (or (s/valid? clojure.core/map? v951) (s/valid? (s/or :branch-0 clojure.core/map? :branch-1 clojure.core/map? :branch-2 clojure.core/map? :branch-3 clojure.core/map? :branch-4 clojure.core/map? :branch-5 clojure.core/map? :branch-6 clojure.core/map? :branch-7 clojure.core/map? :branch-8 clojure.core/map?) v951))))) +(s/def :github.copilot-sdk.generated.event-specs/result (s/spec (fn [v952] (or (s/valid? clojure.core/map? v952) (s/valid? (s/or :branch-0 clojure.core/map? :branch-1 clojure.core/map? :branch-2 clojure.core/map? :branch-3 clojure.core/map? :branch-4 clojure.core/map? :branch-5 clojure.core/map? :branch-6 clojure.core/map? :branch-7 clojure.core/map? :branch-8 clojure.core/map?) v952))))) (s/def :github.copilot-sdk.generated.event-specs/resume-time clojure.core/string?) @@ -351,6 +365,8 @@ (s/def :github.copilot-sdk.generated.event-specs/selected-model clojure.core/string?) +(s/def :github.copilot-sdk.generated.event-specs/self-paced clojure.core/boolean?) + (s/def :github.copilot-sdk.generated.event-specs/server-name clojure.core/string?) (s/def :github.copilot-sdk.generated.event-specs/server-tools clojure.core/map?) @@ -453,7 +469,7 @@ (s/def :github.copilot-sdk.generated.event-specs/turn-id clojure.core/string?) -(s/def :github.copilot-sdk.generated.event-specs/type (s/spec (fn [v949] (or (s/valid? #{"session.start"} v949) (s/valid? #{"session.resume"} v949) (s/valid? #{"session.remote_steerable_changed"} v949) (s/valid? #{"session.error"} v949) (s/valid? #{"session.idle"} v949) (s/valid? #{"session.title_changed"} v949) (s/valid? #{"session.schedule_created"} v949) (s/valid? #{"session.schedule_cancelled"} v949) (s/valid? #{"session.autopilot_objective_changed"} v949) (s/valid? #{"session.info"} v949) (s/valid? #{"session.warning"} v949) (s/valid? #{"session.model_change"} v949) (s/valid? #{"session.mode_changed"} v949) (s/valid? #{"session.permissions_changed"} v949) (s/valid? #{"session.plan_changed"} v949) (s/valid? #{"session.todos_changed"} v949) (s/valid? #{"session.workspace_file_changed"} v949) (s/valid? #{"session.handoff"} v949) (s/valid? #{"session.truncation"} v949) (s/valid? #{"session.snapshot_rewind"} v949) (s/valid? #{"session.shutdown"} v949) (s/valid? #{"session.context_changed"} v949) (s/valid? #{"session.usage_info"} v949) (s/valid? #{"session.compaction_start"} v949) (s/valid? #{"session.compaction_complete"} v949) (s/valid? #{"session.task_complete"} v949) (s/valid? #{"user.message"} v949) (s/valid? #{"pending_messages.modified"} v949) (s/valid? #{"assistant.turn_start"} v949) (s/valid? #{"assistant.intent"} v949) (s/valid? #{"assistant.reasoning"} v949) (s/valid? #{"assistant.reasoning_delta"} v949) (s/valid? #{"assistant.streaming_delta"} v949) (s/valid? #{"assistant.message"} v949) (s/valid? #{"assistant.message_start"} v949) (s/valid? #{"assistant.message_delta"} v949) (s/valid? #{"assistant.turn_end"} v949) (s/valid? #{"assistant.usage"} v949) (s/valid? #{"model.call_failure"} v949) (s/valid? #{"abort"} v949) (s/valid? #{"tool.user_requested"} v949) (s/valid? #{"tool.execution_start"} v949) (s/valid? #{"tool.execution_partial_result"} v949) (s/valid? #{"tool.execution_progress"} v949) (s/valid? #{"tool.execution_complete"} v949) (s/valid? #{"skill.invoked"} v949) (s/valid? #{"subagent.started"} v949) (s/valid? #{"subagent.completed"} v949) (s/valid? #{"subagent.failed"} v949) (s/valid? #{"subagent.selected"} v949) (s/valid? #{"subagent.deselected"} v949) (s/valid? #{"hook.start"} v949) (s/valid? #{"hook.end"} v949) (s/valid? #{"hook.progress"} v949) (s/valid? #{"system.message"} v949) (s/valid? #{"system.notification"} v949) (s/valid? #{"permission.requested"} v949) (s/valid? #{"permission.completed"} v949) (s/valid? #{"user_input.requested"} v949) (s/valid? #{"user_input.completed"} v949) (s/valid? #{"elicitation.requested"} v949) (s/valid? #{"elicitation.completed"} v949) (s/valid? #{"sampling.requested"} v949) (s/valid? #{"sampling.completed"} v949) (s/valid? #{"mcp.oauth_required"} v949) (s/valid? #{"mcp.oauth_completed"} v949) (s/valid? #{"session.custom_notification"} v949) (s/valid? #{"external_tool.requested"} v949) (s/valid? #{"external_tool.completed"} v949) (s/valid? #{"command.queued"} v949) (s/valid? #{"command.execute"} v949) (s/valid? #{"command.completed"} v949) (s/valid? #{"auto_mode_switch.requested"} v949) (s/valid? #{"auto_mode_switch.completed"} v949) (s/valid? #{"commands.changed"} v949) (s/valid? #{"capabilities.changed"} v949) (s/valid? #{"exit_plan_mode.requested"} v949) (s/valid? #{"exit_plan_mode.completed"} v949) (s/valid? #{"session.tools_updated"} v949) (s/valid? #{"session.background_tasks_changed"} v949) (s/valid? #{"session.skills_loaded"} v949) (s/valid? #{"session.custom_agents_updated"} v949) (s/valid? #{"session.mcp_servers_loaded"} v949) (s/valid? #{"session.mcp_server_status_changed"} v949) (s/valid? #{"session.extensions_loaded"} v949) (s/valid? #{"session.canvas.opened"} v949) (s/valid? #{"session.canvas.registry_changed"} v949) (s/valid? #{"session.canvas.closed"} v949) (s/valid? #{"session.extensions.attachments_pushed"} v949) (s/valid? #{"mcp_app.tool_call_complete"} v949))))) +(s/def :github.copilot-sdk.generated.event-specs/type (s/spec (fn [v949] (or (s/valid? #{"session.start"} v949) (s/valid? #{"session.resume"} v949) (s/valid? #{"session.remote_steerable_changed"} v949) (s/valid? #{"session.error"} v949) (s/valid? #{"session.idle"} v949) (s/valid? #{"session.title_changed"} v949) (s/valid? #{"session.schedule_created"} v949) (s/valid? #{"session.schedule_cancelled"} v949) (s/valid? #{"session.schedule_rearmed"} v949) (s/valid? #{"session.autopilot_objective_changed"} v949) (s/valid? #{"session.info"} v949) (s/valid? #{"session.warning"} v949) (s/valid? #{"session.model_change"} v949) (s/valid? #{"session.mode_changed"} v949) (s/valid? #{"session.permissions_changed"} v949) (s/valid? #{"session.plan_changed"} v949) (s/valid? #{"session.todos_changed"} v949) (s/valid? #{"session.workspace_file_changed"} v949) (s/valid? #{"session.handoff"} v949) (s/valid? #{"session.truncation"} v949) (s/valid? #{"session.snapshot_rewind"} v949) (s/valid? #{"session.shutdown"} v949) (s/valid? #{"session.context_changed"} v949) (s/valid? #{"session.usage_info"} v949) (s/valid? #{"session.compaction_start"} v949) (s/valid? #{"session.compaction_complete"} v949) (s/valid? #{"session.task_complete"} v949) (s/valid? #{"user.message"} v949) (s/valid? #{"pending_messages.modified"} v949) (s/valid? #{"assistant.turn_start"} v949) (s/valid? #{"assistant.intent"} v949) (s/valid? #{"assistant.reasoning"} v949) (s/valid? #{"assistant.reasoning_delta"} v949) (s/valid? #{"assistant.streaming_delta"} v949) (s/valid? #{"assistant.message"} v949) (s/valid? #{"assistant.message_start"} v949) (s/valid? #{"assistant.message_delta"} v949) (s/valid? #{"assistant.turn_end"} v949) (s/valid? #{"assistant.usage"} v949) (s/valid? #{"model.call_failure"} v949) (s/valid? #{"abort"} v949) (s/valid? #{"tool.user_requested"} v949) (s/valid? #{"tool.execution_start"} v949) (s/valid? #{"tool.execution_partial_result"} v949) (s/valid? #{"tool.execution_progress"} v949) (s/valid? #{"tool.execution_complete"} v949) (s/valid? #{"skill.invoked"} v949) (s/valid? #{"subagent.started"} v949) (s/valid? #{"subagent.completed"} v949) (s/valid? #{"subagent.failed"} v949) (s/valid? #{"subagent.selected"} v949) (s/valid? #{"subagent.deselected"} v949) (s/valid? #{"hook.start"} v949) (s/valid? #{"hook.end"} v949) (s/valid? #{"hook.progress"} v949) (s/valid? #{"session.binary_asset"} v949) (s/valid? #{"system.message"} v949) (s/valid? #{"system.notification"} v949) (s/valid? #{"permission.requested"} v949) (s/valid? #{"permission.completed"} v949) (s/valid? #{"user_input.requested"} v949) (s/valid? #{"user_input.completed"} v949) (s/valid? #{"elicitation.requested"} v949) (s/valid? #{"elicitation.completed"} v949) (s/valid? #{"sampling.requested"} v949) (s/valid? #{"sampling.completed"} v949) (s/valid? #{"mcp.oauth_required"} v949) (s/valid? #{"mcp.oauth_completed"} v949) (s/valid? #{"session.custom_notification"} v949) (s/valid? #{"external_tool.requested"} v949) (s/valid? #{"external_tool.completed"} v949) (s/valid? #{"command.queued"} v949) (s/valid? #{"command.execute"} v949) (s/valid? #{"command.completed"} v949) (s/valid? #{"auto_mode_switch.requested"} v949) (s/valid? #{"auto_mode_switch.completed"} v949) (s/valid? #{"commands.changed"} v949) (s/valid? #{"capabilities.changed"} v949) (s/valid? #{"exit_plan_mode.requested"} v949) (s/valid? #{"exit_plan_mode.completed"} v949) (s/valid? #{"session.tools_updated"} v949) (s/valid? #{"session.background_tasks_changed"} v949) (s/valid? #{"session.skills_loaded"} v949) (s/valid? #{"session.custom_agents_updated"} v949) (s/valid? #{"session.mcp_servers_loaded"} v949) (s/valid? #{"session.mcp_server_status_changed"} v949) (s/valid? #{"session.extensions_loaded"} v949) (s/valid? #{"session.canvas.opened"} v949) (s/valid? #{"session.canvas.registry_changed"} v949) (s/valid? #{"session.canvas.closed"} v949) (s/valid? #{"session.canvas.unavailable"} v949) (s/valid? #{"session.canvas.recorded"} v949) (s/valid? #{"session.canvas.removed"} v949) (s/valid? #{"session.extensions.attachments_pushed"} v949) (s/valid? #{"mcp_app.tool_call_complete"} v949) (s/valid? #{"resource" "image"} v949))))) (s/def :github.copilot-sdk.generated.event-specs/tz clojure.core/string?) @@ -473,11 +489,13 @@ (s/def :github.copilot-sdk.generated.event-specs/working-directory clojure.core/string?) +(s/def :github.copilot-sdk.generated.event-specs/www-authenticate-params clojure.core/map?) + (s/def :github.copilot-sdk.generated.event-specs/abort-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/reason])) (s/def :github.copilot-sdk.generated.event-specs/assistant.intent-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/intent])) -(s/def :github.copilot-sdk.generated.event-specs/assistant.message-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/content :github.copilot-sdk.generated.event-specs/message-id] :opt-un [:github.copilot-sdk.generated.event-specs/api-call-id :github.copilot-sdk.generated.event-specs/encrypted-content :github.copilot-sdk.generated.event-specs/interaction-id :github.copilot-sdk.generated.event-specs/model :github.copilot-sdk.generated.event-specs/output-tokens :github.copilot-sdk.generated.event-specs/parent-tool-call-id :github.copilot-sdk.generated.event-specs/phase :github.copilot-sdk.generated.event-specs/reasoning-opaque :github.copilot-sdk.generated.event-specs/reasoning-text :github.copilot-sdk.generated.event-specs/request-id :github.copilot-sdk.generated.event-specs/server-tools :github.copilot-sdk.generated.event-specs/service-request-id :github.copilot-sdk.generated.event-specs/tool-requests :github.copilot-sdk.generated.event-specs/turn-id])) +(s/def :github.copilot-sdk.generated.event-specs/assistant.message-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/content :github.copilot-sdk.generated.event-specs/message-id] :opt-un [:github.copilot-sdk.generated.event-specs/api-call-id :github.copilot-sdk.generated.event-specs/citations :github.copilot-sdk.generated.event-specs/encrypted-content :github.copilot-sdk.generated.event-specs/interaction-id :github.copilot-sdk.generated.event-specs/model :github.copilot-sdk.generated.event-specs/output-tokens :github.copilot-sdk.generated.event-specs/parent-tool-call-id :github.copilot-sdk.generated.event-specs/phase :github.copilot-sdk.generated.event-specs/reasoning-opaque :github.copilot-sdk.generated.event-specs/reasoning-text :github.copilot-sdk.generated.event-specs/request-id :github.copilot-sdk.generated.event-specs/server-tools :github.copilot-sdk.generated.event-specs/service-request-id :github.copilot-sdk.generated.event-specs/tool-requests :github.copilot-sdk.generated.event-specs/turn-id])) (s/def :github.copilot-sdk.generated.event-specs/assistant.message_delta-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/delta-content :github.copilot-sdk.generated.event-specs/message-id] :opt-un [:github.copilot-sdk.generated.event-specs/parent-tool-call-id])) @@ -527,13 +545,13 @@ (s/def :github.copilot-sdk.generated.event-specs/hook.start-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/hook-invocation-id :github.copilot-sdk.generated.event-specs/hook-type] :opt-un [:github.copilot-sdk.generated.event-specs/input])) -(s/def :github.copilot-sdk.generated.event-specs/mcp.oauth_completed-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/request-id])) +(s/def :github.copilot-sdk.generated.event-specs/mcp.oauth_completed-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/outcome :github.copilot-sdk.generated.event-specs/request-id])) -(s/def :github.copilot-sdk.generated.event-specs/mcp.oauth_required-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/request-id :github.copilot-sdk.generated.event-specs/server-name :github.copilot-sdk.generated.event-specs/server-url] :opt-un [:github.copilot-sdk.generated.event-specs/static-client-config])) +(s/def :github.copilot-sdk.generated.event-specs/mcp.oauth_required-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/request-id :github.copilot-sdk.generated.event-specs/server-name :github.copilot-sdk.generated.event-specs/server-url] :opt-un [:github.copilot-sdk.generated.event-specs/resource-metadata :github.copilot-sdk.generated.event-specs/static-client-config :github.copilot-sdk.generated.event-specs/www-authenticate-params])) (s/def :github.copilot-sdk.generated.event-specs/mcp_app.tool_call_complete-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/duration-ms :github.copilot-sdk.generated.event-specs/server-name :github.copilot-sdk.generated.event-specs/success :github.copilot-sdk.generated.event-specs/tool-name] :opt-un [:github.copilot-sdk.generated.event-specs/arguments :github.copilot-sdk.generated.event-specs/error :github.copilot-sdk.generated.event-specs/result :github.copilot-sdk.generated.event-specs/tool-meta])) -(s/def :github.copilot-sdk.generated.event-specs/model.call_failure-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/source] :opt-un [:github.copilot-sdk.generated.event-specs/api-call-id :github.copilot-sdk.generated.event-specs/duration-ms :github.copilot-sdk.generated.event-specs/error-message :github.copilot-sdk.generated.event-specs/initiator :github.copilot-sdk.generated.event-specs/model :github.copilot-sdk.generated.event-specs/provider-call-id :github.copilot-sdk.generated.event-specs/service-request-id :github.copilot-sdk.generated.event-specs/status-code])) +(s/def :github.copilot-sdk.generated.event-specs/model.call_failure-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/source] :opt-un [:github.copilot-sdk.generated.event-specs/api-call-id :github.copilot-sdk.generated.event-specs/bad-request-kind :github.copilot-sdk.generated.event-specs/duration-ms :github.copilot-sdk.generated.event-specs/error-code :github.copilot-sdk.generated.event-specs/error-message :github.copilot-sdk.generated.event-specs/error-type :github.copilot-sdk.generated.event-specs/initiator :github.copilot-sdk.generated.event-specs/model :github.copilot-sdk.generated.event-specs/provider-call-id :github.copilot-sdk.generated.event-specs/quota-snapshots :github.copilot-sdk.generated.event-specs/request-fingerprint :github.copilot-sdk.generated.event-specs/service-request-id :github.copilot-sdk.generated.event-specs/status-code])) (s/def :github.copilot-sdk.generated.event-specs/pending_messages.modified-data (s/keys)) @@ -549,13 +567,21 @@ (s/def :github.copilot-sdk.generated.event-specs/session.background_tasks_changed-data (s/keys)) +(s/def :github.copilot-sdk.generated.event-specs/session.binary_asset-data (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/asset-id :github.copilot-sdk.generated.event-specs/byte-length :github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/mime-type :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/description :github.copilot-sdk.generated.event-specs/metadata]) (fn [data] (s/valid? clojure.core/string? (:data data))) (fn [data] (s/valid? #{"resource" "image"} (:type data))))) + (s/def :github.copilot-sdk.generated.event-specs/session.canvas.closed-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/canvas-id :github.copilot-sdk.generated.event-specs/extension-id :github.copilot-sdk.generated.event-specs/instance-id])) -(s/def :github.copilot-sdk.generated.event-specs/session.canvas.opened-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/availability :github.copilot-sdk.generated.event-specs/canvas-id :github.copilot-sdk.generated.event-specs/extension-id :github.copilot-sdk.generated.event-specs/instance-id :github.copilot-sdk.generated.event-specs/reopen] :opt-un [:github.copilot-sdk.generated.event-specs/extension-name :github.copilot-sdk.generated.event-specs/input :github.copilot-sdk.generated.event-specs/status :github.copilot-sdk.generated.event-specs/title :github.copilot-sdk.generated.event-specs/url])) +(s/def :github.copilot-sdk.generated.event-specs/session.canvas.opened-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/canvas-id :github.copilot-sdk.generated.event-specs/extension-id :github.copilot-sdk.generated.event-specs/instance-id] :opt-un [:github.copilot-sdk.generated.event-specs/extension-name :github.copilot-sdk.generated.event-specs/input :github.copilot-sdk.generated.event-specs/status :github.copilot-sdk.generated.event-specs/title :github.copilot-sdk.generated.event-specs/url])) + +(s/def :github.copilot-sdk.generated.event-specs/session.canvas.recorded-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/canvas-id :github.copilot-sdk.generated.event-specs/extension-id :github.copilot-sdk.generated.event-specs/instance-id] :opt-un [:github.copilot-sdk.generated.event-specs/input :github.copilot-sdk.generated.event-specs/title])) (s/def :github.copilot-sdk.generated.event-specs/session.canvas.registry_changed-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/canvases])) -(s/def :github.copilot-sdk.generated.event-specs/session.compaction_complete-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/success] :opt-un [:github.copilot-sdk.generated.event-specs/checkpoint-number :github.copilot-sdk.generated.event-specs/checkpoint-path :github.copilot-sdk.generated.event-specs/compaction-tokens-used :github.copilot-sdk.generated.event-specs/conversation-tokens :github.copilot-sdk.generated.event-specs/custom-instructions :github.copilot-sdk.generated.event-specs/error :github.copilot-sdk.generated.event-specs/messages-removed :github.copilot-sdk.generated.event-specs/post-compaction-tokens :github.copilot-sdk.generated.event-specs/pre-compaction-messages-length :github.copilot-sdk.generated.event-specs/pre-compaction-tokens :github.copilot-sdk.generated.event-specs/request-id :github.copilot-sdk.generated.event-specs/service-request-id :github.copilot-sdk.generated.event-specs/summary-content :github.copilot-sdk.generated.event-specs/system-tokens :github.copilot-sdk.generated.event-specs/tokens-removed :github.copilot-sdk.generated.event-specs/tool-definitions-tokens])) +(s/def :github.copilot-sdk.generated.event-specs/session.canvas.removed-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/canvas-id :github.copilot-sdk.generated.event-specs/extension-id :github.copilot-sdk.generated.event-specs/instance-id])) + +(s/def :github.copilot-sdk.generated.event-specs/session.canvas.unavailable-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/canvas-id :github.copilot-sdk.generated.event-specs/extension-id :github.copilot-sdk.generated.event-specs/instance-id])) + +(s/def :github.copilot-sdk.generated.event-specs/session.compaction_complete-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/success] :opt-un [:github.copilot-sdk.generated.event-specs/checkpoint-number :github.copilot-sdk.generated.event-specs/checkpoint-path :github.copilot-sdk.generated.event-specs/compaction-tokens-used :github.copilot-sdk.generated.event-specs/conversation-tokens :github.copilot-sdk.generated.event-specs/custom-instructions :github.copilot-sdk.generated.event-specs/error :github.copilot-sdk.generated.event-specs/messages-removed :github.copilot-sdk.generated.event-specs/post-compaction-tokens :github.copilot-sdk.generated.event-specs/pre-compaction-messages-length :github.copilot-sdk.generated.event-specs/pre-compaction-tokens :github.copilot-sdk.generated.event-specs/request-id :github.copilot-sdk.generated.event-specs/service-request-id :github.copilot-sdk.generated.event-specs/status-code :github.copilot-sdk.generated.event-specs/summary-content :github.copilot-sdk.generated.event-specs/system-tokens :github.copilot-sdk.generated.event-specs/tokens-removed :github.copilot-sdk.generated.event-specs/tool-definitions-tokens])) (s/def :github.copilot-sdk.generated.event-specs/session.compaction_start-data (s/keys :opt-un [:github.copilot-sdk.generated.event-specs/conversation-tokens :github.copilot-sdk.generated.event-specs/system-tokens :github.copilot-sdk.generated.event-specs/tool-definitions-tokens])) @@ -595,7 +621,9 @@ (s/def :github.copilot-sdk.generated.event-specs/session.schedule_cancelled-data (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/id]) (fn [data] (s/valid? clojure.core/integer? (:id data))))) -(s/def :github.copilot-sdk.generated.event-specs/session.schedule_created-data (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/prompt] :opt-un [:github.copilot-sdk.generated.event-specs/at :github.copilot-sdk.generated.event-specs/cron :github.copilot-sdk.generated.event-specs/display-prompt :github.copilot-sdk.generated.event-specs/interval-ms :github.copilot-sdk.generated.event-specs/recurring :github.copilot-sdk.generated.event-specs/tz]) (fn [data] (s/valid? clojure.core/integer? (:id data))))) +(s/def :github.copilot-sdk.generated.event-specs/session.schedule_created-data (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/prompt] :opt-un [:github.copilot-sdk.generated.event-specs/at :github.copilot-sdk.generated.event-specs/cron :github.copilot-sdk.generated.event-specs/display-prompt :github.copilot-sdk.generated.event-specs/interval-ms :github.copilot-sdk.generated.event-specs/recurring :github.copilot-sdk.generated.event-specs/self-paced :github.copilot-sdk.generated.event-specs/tz]) (fn [data] (s/valid? clojure.core/integer? (:id data))))) + +(s/def :github.copilot-sdk.generated.event-specs/session.schedule_rearmed-data (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/next-run-at]) (fn [data] (s/valid? clojure.core/integer? (:id data))))) (s/def :github.copilot-sdk.generated.event-specs/session.shutdown-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/code-changes :github.copilot-sdk.generated.event-specs/model-metrics :github.copilot-sdk.generated.event-specs/session-start-time :github.copilot-sdk.generated.event-specs/shutdown-type :github.copilot-sdk.generated.event-specs/total-api-duration-ms] :opt-un [:github.copilot-sdk.generated.event-specs/conversation-tokens :github.copilot-sdk.generated.event-specs/current-model :github.copilot-sdk.generated.event-specs/current-tokens :github.copilot-sdk.generated.event-specs/error-reason :github.copilot-sdk.generated.event-specs/events-file-size-bytes :github.copilot-sdk.generated.event-specs/system-tokens :github.copilot-sdk.generated.event-specs/token-details :github.copilot-sdk.generated.event-specs/tool-definitions-tokens :github.copilot-sdk.generated.event-specs/total-nano-aiu :github.copilot-sdk.generated.event-specs/total-premium-requests])) @@ -653,187 +681,197 @@ (s/def :github.copilot-sdk.generated.event-specs/user_input.requested-data (s/keys :req-un [:github.copilot-sdk.generated.event-specs/question :github.copilot-sdk.generated.event-specs/request-id] :opt-un [:github.copilot-sdk.generated.event-specs/allow-freeform :github.copilot-sdk.generated.event-specs/choices :github.copilot-sdk.generated.event-specs/tool-call-id])) -(s/def :github.copilot-sdk.generated.event-specs/abort (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "abort" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/abort-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/abort (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "abort" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/abort-data (:data event))))) + +(s/def :github.copilot-sdk.generated.event-specs/assistant.intent (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.intent" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.intent-data (:data event))))) + +(s/def :github.copilot-sdk.generated.event-specs/assistant.message (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "assistant.message" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.message-data (:data event))))) + +(s/def :github.copilot-sdk.generated.event-specs/assistant.message_delta (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.message_delta" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.message_delta-data (:data event))))) + +(s/def :github.copilot-sdk.generated.event-specs/assistant.message_start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.message_start" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.message_start-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/assistant.intent (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.intent" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.intent-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/assistant.reasoning (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "assistant.reasoning" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.reasoning-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/assistant.message (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "assistant.message" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.message-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/assistant.reasoning_delta (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.reasoning_delta" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.reasoning_delta-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/assistant.message_delta (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.message_delta" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.message_delta-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/assistant.streaming_delta (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.streaming_delta" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.streaming_delta-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/assistant.message_start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.message_start" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.message_start-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/assistant.turn_end (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "assistant.turn_end" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.turn_end-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/assistant.reasoning (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "assistant.reasoning" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.reasoning-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/assistant.turn_start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "assistant.turn_start" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.turn_start-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/assistant.reasoning_delta (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.reasoning_delta" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.reasoning_delta-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/assistant.usage (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.usage" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.usage-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/assistant.streaming_delta (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.streaming_delta" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.streaming_delta-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/auto_mode_switch.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "auto_mode_switch.completed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/auto_mode_switch.completed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/assistant.turn_end (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "assistant.turn_end" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.turn_end-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/auto_mode_switch.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "auto_mode_switch.requested" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/auto_mode_switch.requested-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/assistant.turn_start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "assistant.turn_start" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.turn_start-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/capabilities.changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "capabilities.changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/capabilities.changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/assistant.usage (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "assistant.usage" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/assistant.usage-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/command.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "command.completed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/command.completed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/auto_mode_switch.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "auto_mode_switch.completed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/auto_mode_switch.completed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/command.execute (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "command.execute" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/command.execute-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/auto_mode_switch.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "auto_mode_switch.requested" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/auto_mode_switch.requested-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/command.queued (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "command.queued" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/command.queued-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/capabilities.changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "capabilities.changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/capabilities.changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/commands.changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "commands.changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/commands.changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/command.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "command.completed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/command.completed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/elicitation.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "elicitation.completed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/elicitation.completed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/command.execute (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "command.execute" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/command.execute-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/elicitation.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "elicitation.requested" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/elicitation.requested-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/command.queued (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "command.queued" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/command.queued-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/exit_plan_mode.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "exit_plan_mode.completed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/exit_plan_mode.completed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/commands.changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "commands.changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/commands.changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/exit_plan_mode.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "exit_plan_mode.requested" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/exit_plan_mode.requested-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/elicitation.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "elicitation.completed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/elicitation.completed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/external_tool.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "external_tool.completed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/external_tool.completed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/elicitation.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "elicitation.requested" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/elicitation.requested-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/external_tool.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "external_tool.requested" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/external_tool.requested-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/exit_plan_mode.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "exit_plan_mode.completed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/exit_plan_mode.completed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/hook.end (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "hook.end" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/hook.end-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/exit_plan_mode.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "exit_plan_mode.requested" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/exit_plan_mode.requested-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/hook.progress (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "hook.progress" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/hook.progress-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/external_tool.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "external_tool.completed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/external_tool.completed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/hook.start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "hook.start" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/hook.start-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/external_tool.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "external_tool.requested" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/external_tool.requested-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/mcp.oauth_completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "mcp.oauth_completed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/mcp.oauth_completed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/hook.end (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "hook.end" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/hook.end-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/mcp.oauth_required (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "mcp.oauth_required" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/mcp.oauth_required-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/hook.progress (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "hook.progress" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/hook.progress-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/mcp_app.tool_call_complete (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "mcp_app.tool_call_complete" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/mcp_app.tool_call_complete-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/hook.start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "hook.start" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/hook.start-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/model.call_failure (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "model.call_failure" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/model.call_failure-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/mcp.oauth_completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "mcp.oauth_completed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/mcp.oauth_completed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/pending_messages.modified (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "pending_messages.modified" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/pending_messages.modified-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/mcp.oauth_required (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "mcp.oauth_required" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/mcp.oauth_required-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/permission.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "permission.completed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/permission.completed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/mcp_app.tool_call_complete (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "mcp_app.tool_call_complete" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/mcp_app.tool_call_complete-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/permission.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "permission.requested" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/permission.requested-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/model.call_failure (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "model.call_failure" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/model.call_failure-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/sampling.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "sampling.completed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/sampling.completed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/pending_messages.modified (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "pending_messages.modified" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/pending_messages.modified-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/sampling.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "sampling.requested" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/sampling.requested-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/permission.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "permission.completed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/permission.completed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.autopilot_objective_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.autopilot_objective_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.autopilot_objective_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/permission.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "permission.requested" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/permission.requested-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.background_tasks_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.background_tasks_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.background_tasks_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/sampling.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "sampling.completed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/sampling.completed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.binary_asset (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.binary_asset" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.binary_asset-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/sampling.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "sampling.requested" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/sampling.requested-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.canvas.closed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.canvas.closed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.canvas.closed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.autopilot_objective_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.autopilot_objective_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.autopilot_objective_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.canvas.opened (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.canvas.opened" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.canvas.opened-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.background_tasks_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.background_tasks_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.background_tasks_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.canvas.recorded (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.canvas.recorded" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.canvas.recorded-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.canvas.closed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.canvas.closed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.canvas.closed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.canvas.registry_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.canvas.registry_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.canvas.registry_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.canvas.opened (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.canvas.opened" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.canvas.opened-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.canvas.removed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.canvas.removed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.canvas.removed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.canvas.registry_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.canvas.registry_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.canvas.registry_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.canvas.unavailable (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.canvas.unavailable" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.canvas.unavailable-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.compaction_complete (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.compaction_complete" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.compaction_complete-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.compaction_complete (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.compaction_complete" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.compaction_complete-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.compaction_start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.compaction_start" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.compaction_start-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.compaction_start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.compaction_start" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.compaction_start-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.context_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.context_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.context_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.context_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.context_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.context_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.custom_agents_updated (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.custom_agents_updated" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.custom_agents_updated-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.custom_agents_updated (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.custom_agents_updated" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.custom_agents_updated-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.custom_notification (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.custom_notification" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.custom_notification-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.custom_notification (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.custom_notification" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.custom_notification-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.error (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.error" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.error-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.error (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.error" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.error-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.extensions.attachments_pushed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.extensions.attachments_pushed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.extensions.attachments_pushed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.extensions.attachments_pushed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.extensions.attachments_pushed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.extensions.attachments_pushed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.extensions_loaded (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.extensions_loaded" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.extensions_loaded-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.extensions_loaded (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.extensions_loaded" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.extensions_loaded-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.handoff (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.handoff" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.handoff-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.handoff (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.handoff" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.handoff-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.idle (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.idle" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.idle-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.idle (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.idle" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.idle-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.info (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.info" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.info-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.info (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.info" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.info-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.mcp_server_status_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.mcp_server_status_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.mcp_server_status_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.mcp_server_status_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.mcp_server_status_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.mcp_server_status_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.mcp_servers_loaded (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.mcp_servers_loaded" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.mcp_servers_loaded-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.mcp_servers_loaded (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.mcp_servers_loaded" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.mcp_servers_loaded-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.mode_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.mode_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.mode_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.mode_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.mode_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.mode_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.model_change (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.model_change" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.model_change-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.model_change (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.model_change" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.model_change-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.permissions_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.permissions_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.permissions_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.permissions_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.permissions_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.permissions_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.plan_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.plan_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.plan_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.plan_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.plan_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.plan_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.remote_steerable_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.remote_steerable_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.remote_steerable_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.remote_steerable_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.remote_steerable_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.remote_steerable_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.resume (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.resume" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.resume-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.resume (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.resume" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.resume-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.schedule_cancelled (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.schedule_cancelled" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.schedule_cancelled-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.schedule_cancelled (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.schedule_cancelled" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.schedule_cancelled-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.schedule_created (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.schedule_created" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.schedule_created-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.schedule_created (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.schedule_created" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.schedule_created-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.shutdown (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.shutdown" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.shutdown-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.schedule_rearmed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.schedule_rearmed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.schedule_rearmed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.skills_loaded (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.skills_loaded" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.skills_loaded-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.shutdown (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.shutdown" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.shutdown-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.snapshot_rewind (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.snapshot_rewind" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.snapshot_rewind-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.skills_loaded (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.skills_loaded" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.skills_loaded-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.start" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.start-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.snapshot_rewind (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.snapshot_rewind" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.snapshot_rewind-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.task_complete (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.task_complete" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.task_complete-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.start" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.start-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.title_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.title_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.title_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.task_complete (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.task_complete" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.task_complete-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.todos_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.todos_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.todos_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.title_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.title_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.title_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.tools_updated (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.tools_updated" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.tools_updated-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.todos_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.todos_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.todos_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.truncation (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.truncation" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.truncation-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.tools_updated (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.tools_updated" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.tools_updated-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.usage_info (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.usage_info" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.usage_info-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.truncation (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.truncation" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.truncation-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.warning (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.warning" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.warning-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.usage_info (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "session.usage_info" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.usage_info-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/session.workspace_file_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.workspace_file_changed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.workspace_file_changed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.warning (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.warning" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.warning-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/skill.invoked (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "skill.invoked" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/skill.invoked-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/session.workspace_file_changed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "session.workspace_file_changed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/session.workspace_file_changed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/subagent.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "subagent.completed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/subagent.completed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/skill.invoked (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "skill.invoked" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/skill.invoked-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/subagent.deselected (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "subagent.deselected" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/subagent.deselected-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/subagent.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "subagent.completed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/subagent.completed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/subagent.failed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "subagent.failed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/subagent.failed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/subagent.deselected (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "subagent.deselected" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/subagent.deselected-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/subagent.selected (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "subagent.selected" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/subagent.selected-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/subagent.failed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "subagent.failed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/subagent.failed-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/subagent.started (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "subagent.started" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/subagent.started-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/subagent.selected (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "subagent.selected" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/subagent.selected-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/system.message (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "system.message" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/system.message-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/subagent.started (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "subagent.started" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/subagent.started-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/system.notification (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "system.notification" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/system.notification-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/system.message (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "system.message" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/system.message-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/tool.execution_complete (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "tool.execution_complete" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/tool.execution_complete-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/system.notification (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "system.notification" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/system.notification-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/tool.execution_partial_result (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "tool.execution_partial_result" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/tool.execution_partial_result-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/tool.execution_complete (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "tool.execution_complete" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/tool.execution_complete-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/tool.execution_progress (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "tool.execution_progress" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/tool.execution_progress-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/tool.execution_partial_result (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "tool.execution_partial_result" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/tool.execution_partial_result-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/tool.execution_start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "tool.execution_start" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/tool.execution_start-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/tool.execution_progress (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "tool.execution_progress" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/tool.execution_progress-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/tool.user_requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "tool.user_requested" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/tool.user_requested-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/tool.execution_start (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "tool.execution_start" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/tool.execution_start-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/user.message (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "user.message" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/user.message-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/tool.user_requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "tool.user_requested" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/tool.user_requested-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/user_input.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "user_input.completed" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/user_input.completed-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/user.message (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id :github.copilot-sdk.generated.event-specs/ephemeral]) (fn [event] (clojure.core/= "user.message" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/user.message-data (:data event))))) -(s/def :github.copilot-sdk.generated.event-specs/user_input.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "user_input.requested" (:type event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/user_input.requested-data (:data event))))) +(s/def :github.copilot-sdk.generated.event-specs/user_input.completed (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "user_input.completed" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/user_input.completed-data (:data event))))) -(def event-types "Set of all event-type strings known to the schema." #{"abort" "assistant.intent" "assistant.message" "assistant.message_delta" "assistant.message_start" "assistant.reasoning" "assistant.reasoning_delta" "assistant.streaming_delta" "assistant.turn_end" "assistant.turn_start" "assistant.usage" "auto_mode_switch.completed" "auto_mode_switch.requested" "capabilities.changed" "command.completed" "command.execute" "command.queued" "commands.changed" "elicitation.completed" "elicitation.requested" "exit_plan_mode.completed" "exit_plan_mode.requested" "external_tool.completed" "external_tool.requested" "hook.end" "hook.progress" "hook.start" "mcp.oauth_completed" "mcp.oauth_required" "mcp_app.tool_call_complete" "model.call_failure" "pending_messages.modified" "permission.completed" "permission.requested" "sampling.completed" "sampling.requested" "session.autopilot_objective_changed" "session.background_tasks_changed" "session.canvas.closed" "session.canvas.opened" "session.canvas.registry_changed" "session.compaction_complete" "session.compaction_start" "session.context_changed" "session.custom_agents_updated" "session.custom_notification" "session.error" "session.extensions.attachments_pushed" "session.extensions_loaded" "session.handoff" "session.idle" "session.info" "session.mcp_server_status_changed" "session.mcp_servers_loaded" "session.mode_changed" "session.model_change" "session.permissions_changed" "session.plan_changed" "session.remote_steerable_changed" "session.resume" "session.schedule_cancelled" "session.schedule_created" "session.shutdown" "session.skills_loaded" "session.snapshot_rewind" "session.start" "session.task_complete" "session.title_changed" "session.todos_changed" "session.tools_updated" "session.truncation" "session.usage_info" "session.warning" "session.workspace_file_changed" "skill.invoked" "subagent.completed" "subagent.deselected" "subagent.failed" "subagent.selected" "subagent.started" "system.message" "system.notification" "tool.execution_complete" "tool.execution_partial_result" "tool.execution_progress" "tool.execution_start" "tool.user_requested" "user.message" "user_input.completed" "user_input.requested"}) +(s/def :github.copilot-sdk.generated.event-specs/user_input.requested (s/and (s/keys :req-un [:github.copilot-sdk.generated.event-specs/data :github.copilot-sdk.generated.event-specs/ephemeral :github.copilot-sdk.generated.event-specs/id :github.copilot-sdk.generated.event-specs/parent-id :github.copilot-sdk.generated.event-specs/timestamp :github.copilot-sdk.generated.event-specs/type] :opt-un [:github.copilot-sdk.generated.event-specs/agent-id]) (fn [event] (clojure.core/= true (:ephemeral event))) (fn [event] (clojure.core/= "user_input.requested" (:type event))) (fn [event] (s/valid? clojure.core/map? (:data event))) (fn [event] (s/valid? clojure.core/string? (:id event))) (fn [event] (s/valid? (s/spec (fn [v927] (or (s/valid? #{"session.start"} v927) (s/valid? #{"session.resume"} v927) (s/valid? #{"session.remote_steerable_changed"} v927) (s/valid? #{"session.error"} v927) (s/valid? #{"session.idle"} v927) (s/valid? #{"session.title_changed"} v927) (s/valid? #{"session.schedule_created"} v927) (s/valid? #{"session.schedule_cancelled"} v927) (s/valid? #{"session.schedule_rearmed"} v927) (s/valid? #{"session.autopilot_objective_changed"} v927) (s/valid? #{"session.info"} v927) (s/valid? #{"session.warning"} v927) (s/valid? #{"session.model_change"} v927) (s/valid? #{"session.mode_changed"} v927) (s/valid? #{"session.permissions_changed"} v927) (s/valid? #{"session.plan_changed"} v927) (s/valid? #{"session.todos_changed"} v927) (s/valid? #{"session.workspace_file_changed"} v927) (s/valid? #{"session.handoff"} v927) (s/valid? #{"session.truncation"} v927) (s/valid? #{"session.snapshot_rewind"} v927) (s/valid? #{"session.shutdown"} v927) (s/valid? #{"session.context_changed"} v927) (s/valid? #{"session.usage_info"} v927) (s/valid? #{"session.compaction_start"} v927) (s/valid? #{"session.compaction_complete"} v927) (s/valid? #{"session.task_complete"} v927) (s/valid? #{"user.message"} v927) (s/valid? #{"pending_messages.modified"} v927) (s/valid? #{"assistant.turn_start"} v927) (s/valid? #{"assistant.intent"} v927) (s/valid? #{"assistant.reasoning"} v927) (s/valid? #{"assistant.reasoning_delta"} v927) (s/valid? #{"assistant.streaming_delta"} v927) (s/valid? #{"assistant.message"} v927) (s/valid? #{"assistant.message_start"} v927) (s/valid? #{"assistant.message_delta"} v927) (s/valid? #{"assistant.turn_end"} v927) (s/valid? #{"assistant.usage"} v927) (s/valid? #{"model.call_failure"} v927) (s/valid? #{"abort"} v927) (s/valid? #{"tool.user_requested"} v927) (s/valid? #{"tool.execution_start"} v927) (s/valid? #{"tool.execution_partial_result"} v927) (s/valid? #{"tool.execution_progress"} v927) (s/valid? #{"tool.execution_complete"} v927) (s/valid? #{"skill.invoked"} v927) (s/valid? #{"subagent.started"} v927) (s/valid? #{"subagent.completed"} v927) (s/valid? #{"subagent.failed"} v927) (s/valid? #{"subagent.selected"} v927) (s/valid? #{"subagent.deselected"} v927) (s/valid? #{"hook.start"} v927) (s/valid? #{"hook.end"} v927) (s/valid? #{"hook.progress"} v927) (s/valid? #{"session.binary_asset"} v927) (s/valid? #{"system.message"} v927) (s/valid? #{"system.notification"} v927) (s/valid? #{"permission.requested"} v927) (s/valid? #{"permission.completed"} v927) (s/valid? #{"user_input.requested"} v927) (s/valid? #{"user_input.completed"} v927) (s/valid? #{"elicitation.requested"} v927) (s/valid? #{"elicitation.completed"} v927) (s/valid? #{"sampling.requested"} v927) (s/valid? #{"sampling.completed"} v927) (s/valid? #{"mcp.oauth_required"} v927) (s/valid? #{"mcp.oauth_completed"} v927) (s/valid? #{"session.custom_notification"} v927) (s/valid? #{"external_tool.requested"} v927) (s/valid? #{"external_tool.completed"} v927) (s/valid? #{"command.queued"} v927) (s/valid? #{"command.execute"} v927) (s/valid? #{"command.completed"} v927) (s/valid? #{"auto_mode_switch.requested"} v927) (s/valid? #{"auto_mode_switch.completed"} v927) (s/valid? #{"commands.changed"} v927) (s/valid? #{"capabilities.changed"} v927) (s/valid? #{"exit_plan_mode.requested"} v927) (s/valid? #{"exit_plan_mode.completed"} v927) (s/valid? #{"session.tools_updated"} v927) (s/valid? #{"session.background_tasks_changed"} v927) (s/valid? #{"session.skills_loaded"} v927) (s/valid? #{"session.custom_agents_updated"} v927) (s/valid? #{"session.mcp_servers_loaded"} v927) (s/valid? #{"session.mcp_server_status_changed"} v927) (s/valid? #{"session.extensions_loaded"} v927) (s/valid? #{"session.canvas.opened"} v927) (s/valid? #{"session.canvas.registry_changed"} v927) (s/valid? #{"session.canvas.closed"} v927) (s/valid? #{"session.canvas.unavailable"} v927) (s/valid? #{"session.canvas.recorded"} v927) (s/valid? #{"session.canvas.removed"} v927) (s/valid? #{"session.extensions.attachments_pushed"} v927) (s/valid? #{"mcp_app.tool_call_complete"} v927)))) (:type event))) (fn [event] (s/valid? :github.copilot-sdk.generated.event-specs/user_input.requested-data (:data event))))) + +(def event-types "Set of all event-type strings known to the schema." #{"abort" "assistant.intent" "assistant.message" "assistant.message_delta" "assistant.message_start" "assistant.reasoning" "assistant.reasoning_delta" "assistant.streaming_delta" "assistant.turn_end" "assistant.turn_start" "assistant.usage" "auto_mode_switch.completed" "auto_mode_switch.requested" "capabilities.changed" "command.completed" "command.execute" "command.queued" "commands.changed" "elicitation.completed" "elicitation.requested" "exit_plan_mode.completed" "exit_plan_mode.requested" "external_tool.completed" "external_tool.requested" "hook.end" "hook.progress" "hook.start" "mcp.oauth_completed" "mcp.oauth_required" "mcp_app.tool_call_complete" "model.call_failure" "pending_messages.modified" "permission.completed" "permission.requested" "sampling.completed" "sampling.requested" "session.autopilot_objective_changed" "session.background_tasks_changed" "session.binary_asset" "session.canvas.closed" "session.canvas.opened" "session.canvas.recorded" "session.canvas.registry_changed" "session.canvas.removed" "session.canvas.unavailable" "session.compaction_complete" "session.compaction_start" "session.context_changed" "session.custom_agents_updated" "session.custom_notification" "session.error" "session.extensions.attachments_pushed" "session.extensions_loaded" "session.handoff" "session.idle" "session.info" "session.mcp_server_status_changed" "session.mcp_servers_loaded" "session.mode_changed" "session.model_change" "session.permissions_changed" "session.plan_changed" "session.remote_steerable_changed" "session.resume" "session.schedule_cancelled" "session.schedule_created" "session.schedule_rearmed" "session.shutdown" "session.skills_loaded" "session.snapshot_rewind" "session.start" "session.task_complete" "session.title_changed" "session.todos_changed" "session.tools_updated" "session.truncation" "session.usage_info" "session.warning" "session.workspace_file_changed" "skill.invoked" "subagent.completed" "subagent.deselected" "subagent.failed" "subagent.selected" "subagent.started" "system.message" "system.notification" "tool.execution_complete" "tool.execution_partial_result" "tool.execution_progress" "tool.execution_start" "tool.user_requested" "user.message" "user_input.completed" "user_input.requested"}) (defmulti event-mm :type) @@ -913,12 +951,20 @@ (defmethod event-mm "session.background_tasks_changed" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.background_tasks_changed)) +(defmethod event-mm "session.binary_asset" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.binary_asset)) + (defmethod event-mm "session.canvas.closed" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.canvas.closed)) (defmethod event-mm "session.canvas.opened" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.canvas.opened)) +(defmethod event-mm "session.canvas.recorded" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.canvas.recorded)) + (defmethod event-mm "session.canvas.registry_changed" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.canvas.registry_changed)) +(defmethod event-mm "session.canvas.removed" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.canvas.removed)) + +(defmethod event-mm "session.canvas.unavailable" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.canvas.unavailable)) + (defmethod event-mm "session.compaction_complete" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.compaction_complete)) (defmethod event-mm "session.compaction_start" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.compaction_start)) @@ -961,6 +1007,8 @@ (defmethod event-mm "session.schedule_created" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.schedule_created)) +(defmethod event-mm "session.schedule_rearmed" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.schedule_rearmed)) + (defmethod event-mm "session.shutdown" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.shutdown)) (defmethod event-mm "session.skills_loaded" [_] (s/get-spec :github.copilot-sdk.generated.event-specs/session.skills_loaded)) From d2d08d3171d0c8e83cd3e5f0433d3f7583a703bb Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 11:02:39 +0200 Subject: [PATCH 02/15] feat: port v1.0.4 session options (preamble, capi, BYOK registry, bearer-token, exp-assignments) Port the upstream github/copilot-sdk v1.0.1 -> v1.0.4 SDK surface, maintaining strict API parity with @github/copilot. Each item is RED/GREEN tested in integration_test.clj. - System message: add `:preamble` section and `:preserve` action (upstream PR #1713). `:identity` becomes a section group; `:preserve` opts an addressable section out of a group-level `:remove`. Exposed via `system-prompt-sections` and its `system-message-sections` alias. - `:capi` session option `{:enable-web-socket-responses boolean}`, wire `capi.enableWebSocketResponses` (upstream PR #1711). - Provider `:transport` (`:http` | `:websockets`), wire `transport` (upstream PR #1711). - Multi-provider BYOK registry `:providers` / `:models` (upstream PR #1718, @experimental). Model selection id is `providerName/id`; combining singular `:provider` with `:providers` is rejected. Adds `::named-provider` / `::provider-model` specs. - `:bearer-token-provider` callback for dynamic per-request tokens (upstream PR #1748, @experimental). The fn is stripped before serialization (`hasBearerTokenProvider true`); a new inbound `providerToken.getToken` RPC is dispatched to the registered callback. Non-string results are rejected and never logged. - `:exp-assignments` opaque experiment map forwarded verbatim as `expAssignments` (upstream PR #1750, @internal). - Relax `open-canvases` validation to require only `:extension-id` + `:canvas-id`, matching upstream session.ts. Security hardening surfaced during review: - `redact-secrets` masks credentials across the `:providers` registry via a shared `mask-provider` helper. - The bearer-token RPC handler logs only the result type, never the value. Fields are added to both `build-create-session-params` and `build-resume-session-params`; new public fns get fdefs in instrument.clj. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/github/copilot_sdk.clj | 23 +- src/github/copilot_sdk/client.clj | 109 ++++- src/github/copilot_sdk/protocol.clj | 2 +- src/github/copilot_sdk/session.clj | 80 +++- src/github/copilot_sdk/specs.clj | 113 ++++- src/github/copilot_sdk/util.clj | 3 +- test/github/copilot_sdk/integration_test.clj | 478 +++++++++++++++++-- 7 files changed, 709 insertions(+), 99 deletions(-) diff --git a/src/github/copilot_sdk.clj b/src/github/copilot_sdk.clj index 022b4ec..be1f181 100644 --- a/src/github/copilot_sdk.clj +++ b/src/github/copilot_sdk.clj @@ -141,7 +141,17 @@ :copilot/session.extensions.attachments_pushed :copilot/session.canvas.opened :copilot/session.canvas.closed - :copilot/session.canvas.registry_changed}) + :copilot/session.canvas.registry_changed + ;; v1.0.4 sync (pinned schema 1.0.65). binary_asset carries persisted / + ;; omitted binary attachment references; the three new canvas events extend + ;; the canvas lifecycle (recorded/removed/unavailable) and schedule_rearmed + ;; fires when a recurring schedule re-arms after a tick. Delivered so + ;; consumers can observe them even where the authoring API is out of scope. + :copilot/session.binary_asset + :copilot/session.canvas.recorded + :copilot/session.canvas.removed + :copilot/session.canvas.unavailable + :copilot/session.schedule_rearmed}) (def session-events "Session lifecycle and state management events." @@ -180,7 +190,9 @@ :copilot/capabilities.changed ;; Round 6 additions (upstream schema 1.0.56-1). :copilot/session.autopilot_objective_changed - :copilot/session.permissions_changed}) + :copilot/session.permissions_changed + ;; v1.0.4 sync (pinned schema 1.0.65): recurring schedule re-arm event. + :copilot/session.schedule_rearmed}) (def assistant-events "Assistant response events." @@ -993,15 +1005,14 @@ updated by `:copilot/session.canvas.opened` / `:copilot/session.canvas.closed` events. `session.create` does NOT populate it (matches upstream Node.js). - Each entry has required keys `:instance-id`, `:extension-id`, `:canvas-id`, - `:reopen`, `:availability` and optional `:extension-name`, `:title`, - `:status`, `:url`, `:input`. + Each entry has required keys `:instance-id`, `:extension-id`, `:canvas-id` + and optional `:extension-name`, `:title`, `:status`, `:url`, `:input`. Example: ```clojure (copilot/open-canvases session) ;; => [{:instance-id \"i1\" :canvas-id \"diff\" :extension-id \"ext.x\" - ;; :reopen false :availability \"ready\"}] + ;; :title \"Diff\"}] ```" [session] (session/open-canvases session)) diff --git a/src/github/copilot_sdk/client.clj b/src/github/copilot_sdk/client.clj index 33298cb..155be08 100644 --- a/src/github/copilot_sdk/client.clj +++ b/src/github/copilot_sdk/client.clj @@ -94,13 +94,25 @@ server)])) servers))) +(defn- mask-provider + "Mask the secret-bearing fields of a single BYOK provider map: the `:api-key` + and `:bearer-token` auth fields, plus every value in a custom request + `:headers` map. Non-map inputs pass through unchanged." + [p] + (if-not (map? p) + p + (-> p + (mask-present [:api-key :bearer-token]) + (cond-> (map? (:headers p)) (update :headers mask-all-values))))) + (defn- redact-secrets "Mask secret values in a caller-supplied options/config map so it can be embedded in exception data and messages without leaking credentials. Masks the top-level auth tokens, the `:env` map (merged into the spawned CLI environment, so it - can carry credentials), the nested BYOK `:provider` credentials (api/bearer - keys and any custom request `:headers`), and any `:mcp-servers` header/env - values. Non-map inputs pass through unchanged." + can carry credentials), the nested BYOK `:provider` credentials and every + entry of the `:providers` registry (api/bearer keys and any custom request + `:headers`), and any `:mcp-servers` header/env values. Non-map inputs pass + through unchanged." [m] (if-not (map? m) m @@ -109,11 +121,11 @@ (update :env mask-all-values) (map? (:provider m)) - (update :provider (fn [p] - (-> p - (mask-present [:api-key :bearer-token]) - (cond-> (map? (:headers p)) - (update :headers mask-all-values))))) + (update :provider mask-provider) + + (sequential? (:providers m)) + (update :providers (fn [ps] (mapv mask-provider ps))) + (contains? m :mcp-servers) (update :mcp-servers redact-mcp-servers)))) @@ -773,6 +785,14 @@ :choices choices :allow-freeform allow-freeform})))) + ;; Bearer-token provider request (PR #1748) + "providerToken.getToken" + (let [{:keys [session-id provider-name]} params] + (if-not (get-in @(:state client) [:sessions session-id]) + {:error {:code -32001 :message (str "Unknown session: " session-id)}} + (`type`, `azureOptions`->`azure`, `maxInputTokens`->`maxPromptTokens`, and the nested `azureApiVersion`->`apiVersion`. - Mirrors the `ProviderConfig` shape in nodejs/src/types.ts." + Mirrors the `ProviderConfig` shape in nodejs/src/types.ts. + + `:bearer-token-provider` (upstream PR #1748) is an on-demand token callback, + not wire data: the fn is stripped and replaced with a boolean + `:hasBearerTokenProvider` flag so the runtime knows to issue + `providerToken.getToken` requests instead of reading a static credential." [provider] - (let [wire (rename-keys-present (util/clj->wire provider) + (let [has-btp (some? (:bearer-token-provider provider)) + wire (rename-keys-present (util/clj->wire (dissoc provider :bearer-token-provider)) {:providerType :type :azureOptions :azure :maxInputTokens :maxPromptTokens})] (cond-> wire (contains? wire :azure) - (update :azure rename-keys-present {:azureApiVersion :apiVersion})))) + (update :azure rename-keys-present {:azureApiVersion :apiVersion}) + has-btp (assoc :hasBearerTokenProvider true)))) + +(defn- named-provider->wire + "Convert a Clojure NamedProviderConfig map to its JSON-RPC wire shape + (upstream PR #1718). Like `provider->wire` for the shared provider fields + (`providerType`->`type`, `azureOptions`->`azure`, nested + `azureApiVersion`->`apiVersion`), but a named provider carries no transport + or inline model-override fields: `name`, `baseUrl`, `apiKey`, `bearerToken`, + `wireApi`, `azure`, and `headers` all camelCase cleanly. Mirrors the + `NamedProviderConfig` shape in nodejs/src/types.ts. + + `:bearer-token-provider` (upstream PR #1748) is stripped and replaced with a + boolean `:hasBearerTokenProvider` flag, exactly as in `provider->wire`." + [np] + (let [has-btp (some? (:bearer-token-provider np)) + wire (rename-keys-present (util/clj->wire (dissoc np :bearer-token-provider)) + {:providerType :type + :azureOptions :azure})] + (cond-> wire + (contains? wire :azure) + (update :azure rename-keys-present {:azureApiVersion :apiVersion}) + has-btp (assoc :hasBearerTokenProvider true)))) + +(defn- provider-model->wire + "Convert a Clojure ProviderModelConfig map to its JSON-RPC wire shape + (upstream PR #1718). `id`, `provider`, `wireModel`, `modelId`, `name`, + `maxContextWindowTokens`, and `maxOutputTokens` camelCase cleanly; only + `maxInputTokens`->`maxPromptTokens` needs a rename (mirroring + `provider->wire`). `:capabilities` is an opaque ModelCapabilitiesOverride + forwarded verbatim — it is pulled aside before `clj->wire` and re-attached + so its source-defined string keys (a mix of camelCase and snake_case) are + never run through kebab->camel conversion. Mirrors the `ProviderModelConfig` + shape in nodejs/src/types.ts." + [pm] + (let [capabilities (:capabilities pm) + wire (rename-keys-present (util/clj->wire (dissoc pm :capabilities)) + {:maxInputTokens :maxPromptTokens})] + (cond-> wire + (some? capabilities) (assoc :capabilities capabilities)))) (defn- large-output->wire "Convert a :large-output config map to wire shape, accepting both the @@ -1859,7 +1924,11 @@ config-dir (or (:config-directory config) (:config-dir config)) wire-large-output (some-> (:large-output config) large-output->wire) wire-memory (when-let [m (:memory config)] - (util/clj->wire m))] + (util/clj->wire m)) + wire-providers (when-let [ps (:providers config)] + (mapv named-provider->wire ps)) + wire-models (when-let [ms (:models config)] + (mapv provider-model->wire ms))] (cond-> {} (:session-id config) (assoc :session-id (:session-id config)) (:client-name config) (assoc :client-name (:client-name config)) @@ -1877,7 +1946,11 @@ ;; on the SDK boundary by design (mirrors upstream `resolveToolFilterOptions`). true (assoc :tool-filter-precedence "excluded") wire-provider (assoc :provider wire-provider) + wire-providers (assoc :providers wire-providers) + wire-models (assoc :models wire-models) + (:exp-assignments config) (assoc :exp-assignments (:exp-assignments config)) true (assoc :request-permission true) + (:capi config) (assoc :capi (util/clj->wire (:capi config))) (:streaming? config) (assoc :streaming (:streaming? config)) wire-mcp-servers (assoc :mcp-servers wire-mcp-servers) wire-custom-agents (assoc :custom-agents wire-custom-agents) @@ -1975,8 +2048,6 @@ (some? (:instance-id canvas)) (assoc :instance-id (:instance-id canvas)) (some? (:extension-id canvas)) (assoc :extension-id (:extension-id canvas)) (some? (:canvas-id canvas)) (assoc :canvas-id (:canvas-id canvas)) - (some? (:reopen canvas)) (assoc :reopen (:reopen canvas)) - (some? (:availability canvas)) (assoc :availability (:availability canvas)) (some? (:extension-name canvas)) (assoc :extension-name (:extension-name canvas)) (some? (:title canvas)) (assoc :title (:title canvas)) (some? (:status canvas)) (assoc :status (:status canvas)) @@ -2012,7 +2083,11 @@ config-dir (or (:config-directory config) (:config-dir config)) wire-large-output (some-> (:large-output config) large-output->wire) wire-memory (when-let [m (:memory config)] - (util/clj->wire m))] + (util/clj->wire m)) + wire-providers (when-let [ps (:providers config)] + (mapv named-provider->wire ps)) + wire-models (when-let [ms (:models config)] + (mapv provider-model->wire ms))] (cond-> {:session-id session-id} (:client-name config) (assoc :client-name (:client-name config)) (:model config) (assoc :model (:model config)) @@ -2026,9 +2101,13 @@ ;; See `build-create-session-params` for rationale. true (assoc :tool-filter-precedence "excluded") wire-provider (assoc :provider wire-provider) + wire-providers (assoc :providers wire-providers) + wire-models (assoc :models wire-models) + (:exp-assignments config) (assoc :exp-assignments (:exp-assignments config)) true (assoc :request-permission (not (identical? (:on-permission-request config) default-join-session-permission-handler))) + (:capi config) (assoc :capi (util/clj->wire (:capi config))) (:streaming? config) (assoc :streaming (:streaming? config)) wire-mcp-servers (assoc :mcp-servers wire-mcp-servers) wire-custom-agents (assoc :custom-agents wire-custom-agents) diff --git a/src/github/copilot_sdk/protocol.clj b/src/github/copilot_sdk/protocol.clj index 71f9565..09ef130 100644 --- a/src/github/copilot_sdk/protocol.clj +++ b/src/github/copilot_sdk/protocol.clj @@ -381,7 +381,7 @@ (sequential? (get-in msg [:result :openCanvases]))) (assoc-in converted [:result :open-canvases] (mapv (fn [raw conv] - (if (contains? raw :input) + (if (and (map? raw) (contains? raw :input)) (assoc conv :input (:input raw)) conv)) (get-in msg [:result :openCanvases]) diff --git a/src/github/copilot_sdk/session.clj b/src/github/copilot_sdk/session.clj index 6f842ff..c494ae4 100644 --- a/src/github/copilot_sdk/session.clj +++ b/src/github/copilot_sdk/session.clj @@ -133,21 +133,20 @@ ;; client.ts behavior) and mutated by `session.canvas.opened` / ;; `session.canvas.closed` events. Each entry's keys go through `wire->clj` ;; kebab-case conversion (`:instance-id`, `:extension-id`, `:canvas-id`, -;; `:reopen`, `:availability`, optional `:extension-name`, `:title`, `:status`, -;; `:url`, `:input`). The opaque `:input` map (caller-defined keys) is preserved -;; verbatim by the protocol layer so source-supplied keys are not kebab-cased. +;; optional `:extension-name`, `:title`, `:status`, `:url`, `:input`). The +;; opaque `:input` map (caller-defined keys) is preserved verbatim by the +;; protocol layer so source-supplied keys are not kebab-cased. (defn- valid-open-canvas-instance? - "Mirrors upstream `isOpenCanvasInstance` (nodejs/src/session.ts). All five - required fields must be present and well-typed before an entry is admitted - to the snapshot." + "Mirrors upstream `isOpenCanvasInstance` (nodejs/src/session.ts). Requires the + three id fields (`:instance-id`, `:extension-id`, `:canvas-id`) to be present + and non-blank strings before an entry is admitted to the snapshot. As of + upstream v1.0.4 the `OpenCanvasInstance` shape dropped `reopen`/`availability`." [data] (and (map? data) (string? (:instance-id data)) (not (str/blank? (:instance-id data))) (string? (:extension-id data)) (not (str/blank? (:extension-id data))) - (string? (:canvas-id data)) (not (str/blank? (:canvas-id data))) - (boolean? (:reopen data)) - (#{"ready" "stale"} (:availability data)))) + (string? (:canvas-id data)) (not (str/blank? (:canvas-id data))))) (defn set-open-canvases! "Replace the open-canvases snapshot for `session-id`. Called once after @@ -172,8 +171,8 @@ "Apply a `session.canvas.opened` event payload to the snapshot. If an entry with the same `:instance-id` exists, replace it in place (preserves order); otherwise append. Logs a warning and no-ops on payloads missing any of the - required fields (`:instance-id`, `:extension-id`, `:canvas-id`, `:reopen`, - `:availability`), matching upstream `isOpenCanvasInstance` validation." + required id fields (`:instance-id`, `:extension-id`, `:canvas-id`), matching + upstream `isOpenCanvasInstance` validation." [client session-id data] (if-not (valid-open-canvas-instance? data) (log/warn "failed to deserialize session.canvas.opened payload" @@ -760,6 +759,56 @@ {:error {:code -32001 :message (str "User input handler error: " (ex-message e))}}))))) :io)) +(defn- extract-bearer-token-providers + "Build a `{provider-name -> callback}` map from session config (upstream PR #1748). + The singular whole-session `:provider` callback is keyed under the implicit + provider name `\"default\"` (upstream `DEFAULT_PROVIDER_NAME`); each named + provider in `:providers` is keyed by its `:name`." + [config] + (let [singular (when-let [f (get-in config [:provider :bearer-token-provider])] + {"default" f}) + named (into {} (keep (fn [p] + (when-let [f (:bearer-token-provider p)] + [(:name p) f])) + (:providers config)))] + (merge singular named))) + +(defn handle-provider-token-request! + "Handle an incoming providerToken.getToken request (upstream PR #1748). + Returns a channel with the result. + + The runtime issues this session-scoped request when a BYOK provider configured + with a `:bearer-token-provider` callback needs a fresh token. The matching + callback (looked up by `provider-name`) is invoked with the idiomatic + `ProviderTokenArgs` map `{:provider-name }` and must return the raw token + string (without the `Bearer ` prefix); a channel yielding the string is also + accepted. The runtime performs no caching, so the callback owns refresh." + [client session-id provider-name] + (async/thread-call + (fn [] + (let [config (:config (session-state client session-id)) + callback (get (extract-bearer-token-providers config) provider-name)] + (if-not callback + {:error {:code -32001 + :message (str "No bearer-token provider registered for provider \"" + provider-name "\"")}} + (try + (let [result (callback {:provider-name provider-name}) + result (if (channel? result) ( result class .getName) ")") + {:error {:code -32001 + :message "Bearer-token provider returned a non-string token"}}))) + (catch Exception e + (log/error "Bearer-token provider error for session " session-id ": " (ex-message e)) + {:error {:code -32001 + :message (str "Bearer-token provider error: " (ex-message e))}}))))) + :io)) + (defn handle-hooks-invoke! "Handle an incoming hooks invocation. Returns a channel with the result. PR #269 feature." @@ -2200,11 +2249,10 @@ (defn open-canvases "Get the current open-canvases snapshot for `session`. Returns a vector of canvas-instance maps (each with `:instance-id`, `:extension-id`, `:canvas-id`, - `:reopen`, `:availability`, plus optional `:extension-name`, `:title`, - `:status`, `:url`, `:input`). The snapshot is initialized from - `session.resume` and updated by `session.canvas.opened` / - `session.canvas.closed` events. `session.create` does NOT populate it - (matches upstream Node.js behavior)." + plus optional `:extension-name`, `:title`, `:status`, `:url`, `:input`). The + snapshot is initialized from `session.resume` and updated by + `session.canvas.opened` / `session.canvas.closed` events. `session.create` + does NOT populate it (matches upstream Node.js behavior)." [session] (let [{:keys [session-id client]} session] (vec (:open-canvases (session-state client session-id))))) diff --git a/src/github/copilot_sdk/specs.clj b/src/github/copilot_sdk/specs.clj index 52d20e0..ae99052 100644 --- a/src/github/copilot_sdk/specs.clj +++ b/src/github/copilot_sdk/specs.clj @@ -270,7 +270,8 @@ "Known system message section identifiers for the customize mode. Each section corresponds to a distinct part of the system message. Upstream alias: `SystemMessageSection`." - {:identity {:description "Agent identity preamble and mode statement"} + {:preamble {:description "Agent identity preamble and mode statement"} + :identity {:description "Section group covering the identity preamble and its sibling sub-sections (tone, tool efficiency, etc.)"} :tone {:description "Response style, conciseness rules, output formatting preferences"} :tool-efficiency {:description "Tool usage patterns, parallel calling, batching guidelines"} :environment-context {:description "CWD, OS, git root, directory listing, available tools"} @@ -290,9 +291,12 @@ (s/def ::system-prompt-section (set (keys system-prompt-sections))) (s/def ::system-message-section ::system-prompt-section) -;; Section override: action can be a keyword for static overrides, or a fn for transforms +;; Section override: action can be a keyword for static overrides, or a fn for transforms. +;; `:preserve` (upstream PR #1713) is a no-op marker that opts an individually-addressable +;; section out of a group-level `:remove` (e.g. keep `:tone` when removing the `:identity` +;; group). It carries no content. (s/def ::section-action - (s/or :static #{:replace :remove :append :prepend} + (s/or :static #{:replace :remove :append :prepend :preserve} :transform fn?)) (s/def ::section-override @@ -395,6 +399,21 @@ (s/def ::bearer-token string?) (s/def ::azure-api-version string?) +;; Provider :transport — selects the request transport for OpenAI-compatible +;; providers running `:wire-api :responses` (upstream PR #1711). Defaults to +;; `:http` runtime-side when omitted; `:websockets` opts into the WebSocket +;; Responses transport. Upstream attaches `transport` to the singular +;; `ProviderConfig` only — the multi-provider `NamedProviderConfig` has no +;; transport field — so this applies to ::provider, not ::named-provider. +(s/def ::transport #{:http :websockets}) + +;; On-demand bearer-token callback (upstream PR #1748, @experimental). A 1-arg +;; function receiving an idiomatic `ProviderTokenArgs` map `{:provider-name }` +;; and returning the raw token string (a channel yielding the string is also +;; accepted). Applies to both ::provider and ::named-provider. The fn is never +;; serialized — provider->wire strips it and emits `hasBearerTokenProvider: true`. +(s/def ::bearer-token-provider fn?) + (s/def ::azure-options (s/keys :opt-un [::azure-api-version])) @@ -418,7 +437,7 @@ (s/and (s/keys :req-un [::base-url] :opt-un [::provider-type ::wire-api ::api-key ::bearer-token ::azure-options - ::headers + ::headers ::transport ::bearer-token-provider ;; ProviderConfig overrides (upstream PR #966). ;; ::model-id ↦ wire `modelId` (well-known model name for ;; agent config + token-limit lookup; default wire model @@ -444,6 +463,60 @@ #(or (not (contains? % :max-output-tokens)) (pos-int? (:max-output-tokens %))))) +;; ----------------------------------------------------------------------------- +;; Multi-provider BYOK registry (upstream PR #1718, @experimental) +;; ----------------------------------------------------------------------------- +;; The singular ::provider above configures one OpenAI-compatible endpoint. +;; The registry lets a session declare several named providers (::providers) +;; plus a model catalog (::models) that references them by name. A model is +;; addressed as "/"; provider names therefore must not +;; contain "/". Upstream's `NamedProviderConfig` has no `transport` and no +;; inline model-override fields (those live on ::provider-model instead). + +;; A named provider entry. Like ::provider but `:name` is required (the +;; registry key, no "/") and there are no transport / model-override fields. +(s/def ::named-provider + (s/and + (s/keys :req-un [::name ::base-url] + :opt-un [::provider-type ::wire-api ::api-key ::bearer-token + ::azure-options ::headers ::bearer-token-provider]) + #(s/valid? ::non-blank-string (:name %)) + #(not (str/includes? (:name %) "/")))) + +;; ModelCapabilitiesOverride — opaque to the SDK. Forwarded verbatim, so keys +;; must be strings (upstream uses a mix of camelCase and snake_case wire keys +;; that kebab->camel conversion would otherwise mangle). +(s/def ::capabilities (s/map-of string? any?)) + +;; A model in the registry catalog. `:id` is the provider-local model id and +;; `:provider` is a non-blank string referencing a ::named-provider `:name`. +;; `:provider` is enforced via predicate rather than `:req-un [::provider]` +;; because `::provider` is the singular-provider *map* spec, not a string. +(s/def ::provider-model + (s/and + (s/keys :req-un [::id] + :opt-un [::name ::model-id ::wire-model ::capabilities + ::max-input-tokens ::max-context-window-tokens + ::max-output-tokens]) + #(s/valid? ::non-blank-string (:id %)) + #(s/valid? ::non-blank-string (:provider %)) + #(or (not (contains? % :model-id)) + (s/valid? ::non-blank-string (:model-id %))) + #(or (not (contains? % :max-input-tokens)) + (pos-int? (:max-input-tokens %))) + #(or (not (contains? % :max-context-window-tokens)) + (pos-int? (:max-context-window-tokens %))) + #(or (not (contains? % :max-output-tokens)) + (pos-int? (:max-output-tokens %))))) + +(s/def ::providers (s/coll-of ::named-provider)) +(s/def ::models (s/coll-of ::provider-model)) + +;; expAssignments (upstream PR #1750, @internal) — opaque experiment flight +;; assignments. Keys are source-defined flight ids; forwarded verbatim, so +;; they must be strings (bypassing kebab->camel key conversion). +(s/def ::exp-assignments (s/map-of string? any?)) + ;; ----------------------------------------------------------------------------- ;; Session configuration ;; ----------------------------------------------------------------------------- @@ -662,6 +735,14 @@ ;; nil clears the previous explicit choice; missing leaves it untouched. (s/def ::context-tier (s/nilable #{:default :long-context})) +;; CapiSessionOptions (upstream PR #1711). Per-session transport choices for the +;; built-in Copilot API provider. `:enable-web-socket-responses` controls whether +;; the WebSocket transport is used for the CAPI Responses API (default true on the +;; runtime side); set false to force the HTTP Responses transport. Sent verbatim +;; under the `capi` wire key. +(s/def ::enable-web-socket-responses boolean?) +(s/def ::capi (s/keys :opt-un [::enable-web-socket-responses])) + (def session-config-keys #{:session-id :client-name :model :tools :commands :system-message :available-tools :excluded-tools :provider @@ -696,6 +777,8 @@ :custom-agents-local-only :coauthor-enabled :manage-schedule-enabled + :capi + :providers :models :exp-assignments :include-sub-agent-streaming-events?}) (s/def ::session-config @@ -735,6 +818,8 @@ ::custom-agents-local-only ::coauthor-enabled ::manage-schedule-enabled + ::capi + ::providers ::models ::exp-assignments ::include-sub-agent-streaming-events?]) session-config-keys)) @@ -768,6 +853,8 @@ :custom-agents-local-only :coauthor-enabled :manage-schedule-enabled + :capi + :providers :models :exp-assignments :include-sub-agent-streaming-events? ;; Upstream PR #1604: resume/join may seed the open-canvases snapshot. :open-canvases}) @@ -806,6 +893,8 @@ ::custom-agents-local-only ::coauthor-enabled ::manage-schedule-enabled + ::capi + ::providers ::models ::exp-assignments ::include-sub-agent-streaming-events? ::open-canvases]) resume-session-config-keys)) @@ -845,6 +934,8 @@ ::custom-agents-local-only ::coauthor-enabled ::manage-schedule-enabled + ::capi + ::providers ::models ::exp-assignments ::include-sub-agent-streaming-events? ::open-canvases]) resume-session-config-keys)) @@ -1437,21 +1528,19 @@ #(contains? % :id) #(pos-int? (:id %)))) -;; Canvas event data and snapshot entries (upstream PR #1604). -;; Wire fields: instanceId, extensionId, canvasId, extensionName, reopen, -;; availability, status, title, url, input. csk converts to kebab-case; -;; booleans (`reopen`) keep no trailing `?`. `:input` is opaque caller-supplied -;; data — open map per upstream `{ [k: string]: unknown }`. +;; Canvas event data and snapshot entries (upstream PR #1604; v1.0.4 dropped +;; reopen/availability). Wire fields: instanceId, extensionId, canvasId, +;; extensionName, status, title, url, input. csk converts to kebab-case. +;; `:input` is opaque caller-supplied data — open map per upstream +;; `{ [k: string]: unknown }`. (s/def ::instance-id ::non-blank-string) (s/def ::extension-id ::non-blank-string) (s/def ::canvas-id ::non-blank-string) (s/def ::extension-name string?) -(s/def ::reopen boolean?) -(s/def ::availability #{"ready" "stale"}) (s/def ::input map?) (s/def ::open-canvas-instance - (s/keys :req-un [::instance-id ::extension-id ::canvas-id ::reopen ::availability] + (s/keys :req-un [::instance-id ::extension-id ::canvas-id] :opt-un [::extension-name ::title ::status ::url ::input])) (s/def ::open-canvases (s/coll-of ::open-canvas-instance :kind sequential? :into [])) diff --git a/src/github/copilot_sdk/util.clj b/src/github/copilot_sdk/util.clj index 445e6e3..8bcbb58 100644 --- a/src/github/copilot_sdk/util.clj +++ b/src/github/copilot_sdk/util.clj @@ -55,7 +55,8 @@ (def section-key->wire "Map from Clojure keyword to wire string for system message sections." - {:identity "identity" + {:preamble "preamble" + :identity "identity" :tone "tone" :tool-efficiency "tool_efficiency" :environment-context "environment_context" diff --git a/test/github/copilot_sdk/integration_test.clj b/test/github/copilot_sdk/integration_test.clj index eca89ca..f79a9f8 100644 --- a/test/github/copilot_sdk/integration_test.clj +++ b/test/github/copilot_sdk/integration_test.clj @@ -3,7 +3,9 @@ (:require [clojure.test :refer [deftest testing is use-fixtures]] [clojure.core.async :as async :refer [!! chan close! go timeout alts!!]] [clojure.spec.alpha :as s] + [clojure.string :as str] [clojure.tools.logging :as log] + [clojure.tools.logging.test :as log-test] [github.copilot-sdk :as sdk] [github.copilot-sdk.client :as client] [github.copilot-sdk.protocol :as protocol] @@ -2046,6 +2048,387 @@ (is (= "replace" (get-in wire [:runtime_instructions :action]))) (is (= "runtime ctx" (get-in wire [:runtime_instructions :content])))))) +(deftest test-v1-0-4-preamble-section + (testing ":preamble is a known system message section (upstream PR #1683)" + (is (contains? (set (keys specs/system-prompt-sections)) :preamble)) + (is (= "preamble" (util/section-kw->wire-id :preamble)) + ":preamble converts to the wire string \"preamble\"") + (is (= :preamble (util/wire-id->section-kw "preamble")) + "\"preamble\" round-trips back to :preamble") + (is (s/valid? :github.copilot-sdk.specs/system-prompt-section :preamble)) + (is (s/valid? :github.copilot-sdk.specs/system-message-section :preamble) + "::system-message-section alias also accepts it"))) + +(deftest test-v1-0-4-preamble-section-wire-roundtrip + (testing ":preamble section survives the create-session wire conversion" + (let [seen (atom {}) + _ (mock/set-request-hook! *mock-server* + (fn [method params] + (when (#{"session.create"} method) + (swap! seen assoc method params)))) + _ (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :system-message {:mode :customize + :sections + {:preamble + {:action :replace + :content "you are an agent"}}}}) + wire (get-in @seen ["session.create" :systemMessage :sections])] + (is (contains? wire :preamble) + ":preamble must be sent as wire key :preamble") + (is (= "replace" (get-in wire [:preamble :action]))) + (is (= "you are an agent" (get-in wire [:preamble :content])))))) + +(deftest test-v1-0-4-preserve-section-action + (testing ":preserve is a valid static section action (upstream PR #1713)" + (is (s/valid? :github.copilot-sdk.specs/section-action :preserve) + ":preserve must validate as a static section action") + ;; :preserve is a no-op marker — content is NOT required (unlike replace/append/prepend) + (is (s/valid? :github.copilot-sdk.specs/section-override {:action :preserve}) + ":preserve override needs no :content")) + (testing ":preserve action survives the create-session wire conversion" + (let [seen (atom {}) + _ (mock/set-request-hook! *mock-server* + (fn [method params] + (when (#{"session.create"} method) + (swap! seen assoc method params)))) + _ (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :system-message {:mode :customize + :sections + {:identity {:action :remove} + :tone {:action :preserve}}}}) + wire (get-in @seen ["session.create" :systemMessage :sections])] + (is (= "preserve" (get-in wire [:tone :action])) + ":preserve must be sent as the wire action string \"preserve\"") + (is (not (contains? (get wire :tone) :content)) + ":preserve emits no :content key")))) + +(deftest test-v1-0-4-capi-enable-websocket-responses-wire + (testing ":capi {:enable-web-socket-responses ...} forwards on both session.create and session.resume (upstream PR #1711)" + (let [seen (atom {}) + _ (mock/set-request-hook! *mock-server* + (fn [method params] + (when (#{"session.create" "session.resume"} method) + (swap! seen assoc method params)))) + _ (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :capi {:enable-web-socket-responses false}}) + session-id (sdk/get-last-session-id *test-client*) + _ (sdk/resume-session *test-client* session-id + {:on-permission-request sdk/approve-all + :capi {:enable-web-socket-responses false}}) + create-params (get @seen "session.create") + resume-params (get @seen "session.resume")] + (is (= {:enableWebSocketResponses false} (:capi create-params)) + ":capi must be sent verbatim under wire key :capi with camelCase :enableWebSocketResponses on create") + (is (= {:enableWebSocketResponses false} (:capi resume-params)) + ":capi must also forward on resume"))) + (testing ":capi is accepted by the session-config spec" + (is (s/valid? :github.copilot-sdk.specs/capi {:enable-web-socket-responses true})) + (is (s/valid? :github.copilot-sdk.specs/capi {}) + "empty :capi map is valid (field is optional)"))) + +(deftest test-v1-0-4-provider-transport-wire + (testing ":provider :transport forwards on both session.create and session.resume (upstream PR #1711)" + (let [seen (atom {}) + _ (mock/set-request-hook! *mock-server* + (fn [method params] + (when (#{"session.create" "session.resume"} method) + (swap! seen assoc method params)))) + provider {:provider-type :openai + :wire-api :responses + :base-url "https://example.test" + :api-key "key" + :transport :websockets} + _ (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :model "fallback-model" + :provider provider}) + session-id (sdk/get-last-session-id *test-client*) + _ (sdk/resume-session *test-client* session-id + {:on-permission-request sdk/approve-all + :model "fallback-model" + :provider provider})] + (doseq [method ["session.create" "session.resume"]] + (let [p (get-in @seen [method :provider])] + (testing method + (is (= "websockets" (:transport p)) + ":transport keyword value must serialize to its wire string")))))) + (testing "::transport enum is enforced on ::provider" + (is (s/valid? :github.copilot-sdk.specs/transport :http)) + (is (s/valid? :github.copilot-sdk.specs/transport :websockets)) + (is (false? (s/valid? :github.copilot-sdk.specs/transport :bogus))) + (is (s/valid? :github.copilot-sdk.specs/provider + {:base-url "https://example.test" :transport :http})) + (is (false? (s/valid? :github.copilot-sdk.specs/provider + {:base-url "https://example.test" :transport :bogus})) + "an invalid :transport value must fail provider validation"))) + +(deftest test-v1-0-4-multi-provider-byok-registry-wire + (testing ":providers/:models forward on both session.create and session.resume (upstream PR #1718)" + (let [seen (atom {}) + _ (mock/set-request-hook! *mock-server* + (fn [method params] + (when (#{"session.create" "session.resume"} method) + (swap! seen assoc method params)))) + providers [{:name "my-openai" + :provider-type :openai + :wire-api :responses + :base-url "https://oai.test" + :api-key "k1" + :headers {"X-Org" "acme"}} + {:name "my-azure" + :provider-type :azure + :base-url "https://azure.test" + :api-key "k2" + :azure-options {:azure-api-version "2024-06-01"}}] + models [{:id "gpt-4o" + :provider "my-openai" + :model-id "gpt-4o" + :name "GPT-4o" + :wire-model "gpt-4o-2024" + :max-input-tokens 128000 + :max-context-window-tokens 200000 + :max-output-tokens 16000 + :capabilities {"reasoningEffort" "high" + "max_prompt_tokens" 120000 + "supported_media_types" ["image/png"]}}] + cfg {:on-permission-request sdk/approve-all + :model "fallback-model" + :providers providers + :models models} + _ (sdk/create-session *test-client* cfg) + session-id (sdk/get-last-session-id *test-client*) + _ (sdk/resume-session *test-client* session-id cfg)] + (doseq [method ["session.create" "session.resume"]] + (testing method + (let [params (get @seen method) + wprov (:providers params) + wmodels (:models params) + oai (first wprov) + azure (second wprov) + m (first wmodels)] + (is (= 2 (count wprov)) "both named providers are forwarded") + ;; named provider wire shape + (is (= "my-openai" (:name oai))) + (is (= "openai" (:type oai)) ":provider-type renames to wire :type") + (is (= "responses" (:wireApi oai))) + (is (= "https://oai.test" (:baseUrl oai))) + (is (= "k1" (:apiKey oai))) + (is (= {:X-Org "acme"} (:headers oai))) + (is (not (contains? oai :providerType)) "no :providerType leaks onto the wire") + ;; azure nested rename + (is (= "azure" (:type azure))) + (is (= {:apiVersion "2024-06-01"} (:azure azure)) + ":azure-options -> :azure with nested :azure-api-version -> :apiVersion") + ;; provider-model wire shape + (is (= "gpt-4o" (:id m))) + (is (= "my-openai" (:provider m))) + (is (= "gpt-4o" (:modelId m))) + (is (= "GPT-4o" (:name m))) + (is (= "gpt-4o-2024" (:wireModel m))) + (is (= 128000 (:maxPromptTokens m)) ":max-input-tokens -> wire :maxPromptTokens") + (is (= 200000 (:maxContextWindowTokens m))) + (is (= 16000 (:maxOutputTokens m))) + (is (not (contains? m :maxInputTokens)) "no :maxInputTokens leaks onto the wire") + ;; capabilities passthrough: opaque string keys survive unmangled + (is (= "high" (get-in m [:capabilities :reasoningEffort]))) + (is (= 120000 (get-in m [:capabilities :max_prompt_tokens])) + ":capabilities is opaque — snake_case keys must NOT be camelCased") + (is (= ["image/png"] (get-in m [:capabilities :supported_media_types])))))))) + (testing "specs accept the multi-provider registry shapes" + (is (s/valid? :github.copilot-sdk.specs/named-provider + {:name "p" :base-url "https://x.test"})) + (is (false? (s/valid? :github.copilot-sdk.specs/named-provider + {:base-url "https://x.test"})) + ":name is required on a named provider") + (is (false? (s/valid? :github.copilot-sdk.specs/named-provider + {:name "has/slash" :base-url "https://x.test"})) + "named provider :name must not contain '/'") + (is (s/valid? :github.copilot-sdk.specs/provider-model + {:id "m" :provider "p"})) + (is (false? (s/valid? :github.copilot-sdk.specs/provider-model + {:provider "p"})) + ":id is required on a provider model") + (is (false? (s/valid? :github.copilot-sdk.specs/provider-model + {:id "m"})) + ":provider is required on a provider model") + (is (false? (s/valid? :github.copilot-sdk.specs/provider-model + {:id "m" :provider "p" :max-input-tokens 0})) + "token overrides must be positive") + (is (s/valid? :github.copilot-sdk.specs/providers + [{:name "p" :base-url "https://x.test"}])) + (is (s/valid? :github.copilot-sdk.specs/models + [{:id "m" :provider "p"}])) + (is (s/valid? :github.copilot-sdk.specs/session-config + {:providers [{:name "p" :base-url "https://x.test"}] + :models [{:id "m" :provider "p"}]})))) + +(deftest test-v1-0-4-exp-assignments-wire + (testing ":exp-assignments forwards verbatim on both session.create and session.resume (upstream PR #1750)" + (let [seen (atom {}) + _ (mock/set-request-hook! *mock-server* + (fn [method params] + (when (#{"session.create" "session.resume"} method) + (swap! seen assoc method params)))) + exp {"flight-abc" "treatment" "feature_x" {"enabled" true}} + cfg {:on-permission-request sdk/approve-all + :exp-assignments exp} + _ (sdk/create-session *test-client* cfg) + session-id (sdk/get-last-session-id *test-client*) + _ (sdk/resume-session *test-client* session-id cfg)] + (doseq [method ["session.create" "session.resume"]] + (testing method + (let [p (get @seen method)] + (is (= {:flight-abc "treatment" :feature_x {:enabled true}} + (:expAssignments p)) + ":exp-assignments forwards under wire key :expAssignments with keys preserved verbatim (no kebab->camel)")))))) + (testing "::exp-assignments accepts an opaque string-keyed map" + (is (s/valid? :github.copilot-sdk.specs/exp-assignments {"a" 1 "b" {"c" 2}})) + (is (false? (s/valid? :github.copilot-sdk.specs/exp-assignments {:a 1})) + "keys must be strings (source-defined flight ids), not keywords") + (is (s/valid? :github.copilot-sdk.specs/session-config + {:exp-assignments {"a" 1}})))) + +(deftest test-v1-0-4-bearer-token-provider-wire + (testing ":bearer-token-provider strips the fn and emits :hasBearerTokenProvider on both builders (upstream PR #1748)" + (let [seen (atom {}) + _ (mock/set-request-hook! *mock-server* + (fn [method params] + (when (#{"session.create" "session.resume"} method) + (swap! seen assoc method params)))) + token-fn (fn [_args] "secret-token") + provider {:provider-type :openai + :wire-api :responses + :base-url "https://oai.test" + :bearer-token-provider token-fn} + named [{:name "my-azure" + :provider-type :azure + :base-url "https://azure.test" + :bearer-token-provider token-fn}] + cfg {:on-permission-request sdk/approve-all + :model "fallback-model" + :provider provider + :providers named} + _ (sdk/create-session *test-client* cfg) + session-id (sdk/get-last-session-id *test-client*) + _ (sdk/resume-session *test-client* session-id cfg)] + (doseq [method ["session.create" "session.resume"]] + (testing method + (let [params (get @seen method) + wprov (:provider params) + wnamed (first (:providers params))] + ;; singular provider + (is (true? (:hasBearerTokenProvider wprov)) + "singular provider with a callback emits :hasBearerTokenProvider true") + (is (not (contains? wprov :bearerTokenProvider)) + "the callback fn must NOT be serialized onto the wire") + (is (not (contains? wprov :bearer-token-provider)) + "the kebab-case callback key must NOT leak onto the wire") + ;; named provider + (is (true? (:hasBearerTokenProvider wnamed)) + "named provider with a callback emits :hasBearerTokenProvider true") + (is (not (contains? wnamed :bearerTokenProvider)) + "the named-provider callback fn must NOT be serialized onto the wire")))))) + (testing "a provider without a callback omits :hasBearerTokenProvider" + (let [seen (atom {}) + _ (mock/set-request-hook! *mock-server* + (fn [method params] + (when (= "session.create" method) + (reset! seen params)))) + _ (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :model "fallback-model" + :provider {:base-url "https://oai.test" :api-key "k"}})] + (is (not (contains? (:provider @seen) :hasBearerTokenProvider)) + "no callback => no :hasBearerTokenProvider flag"))) + (testing "::bearer-token-provider is accepted on provider and named-provider specs" + (is (s/valid? :github.copilot-sdk.specs/provider + {:base-url "https://x.test" :bearer-token-provider (fn [_] "t")})) + (is (s/valid? :github.copilot-sdk.specs/named-provider + {:name "p" :base-url "https://x.test" :bearer-token-provider (fn [_] "t")})) + (is (false? (s/valid? :github.copilot-sdk.specs/provider + {:base-url "https://x.test" :bearer-token-provider "not-a-fn"})) + ":bearer-token-provider must be a function"))) + +(deftest test-v1-0-4-provider-token-get-token-callback + (testing "providerToken.getToken routes to the singular provider callback (DEFAULT_PROVIDER_NAME)" + (let [called (atom nil) + session (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :model "fallback-model" + :provider {:base-url "https://oai.test" + :bearer-token-provider + (fn [args] + (reset! called args) + "singular-token")}}) + session-id (sdk/session-id session) + response (mock/send-rpc-request! *mock-server* + "providerToken.getToken" + {:sessionId session-id + :providerName "default"})] + (is (= {:provider-name "default"} @called) + "callback receives idiomatic ProviderTokenArgs with :provider-name") + (is (= "singular-token" (get-in response [:result :token])) + "the resolved token is returned under wire key :token"))) + (testing "providerToken.getToken routes to a named provider callback by name" + (let [session (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :model "fallback-model" + :providers [{:name "my-azure" + :base-url "https://azure.test" + :bearer-token-provider + (fn [_] "azure-token")}]}) + session-id (sdk/session-id session) + response (mock/send-rpc-request! *mock-server* + "providerToken.getToken" + {:sessionId session-id + :providerName "my-azure"})] + (is (= "azure-token" (get-in response [:result :token]))))) + (testing "providerToken.getToken with no matching callback returns an error" + (let [session (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :model "fallback-model" + :provider {:base-url "https://oai.test" + :bearer-token-provider (fn [_] "tok")}}) + session-id (sdk/session-id session)] + (is (thrown-with-msg? clojure.lang.ExceptionInfo + #"(?i)no bearer-token provider" + (mock/send-rpc-request! *mock-server* + "providerToken.getToken" + {:sessionId session-id + :providerName "nonexistent"})))))) + +(deftest test-v1-0-4-bearer-token-non-string-result-not-logged + (testing "a non-string bearer-token callback result value never reaches the logs (SEC)" + ;; The callback is credential-related; a mistaken non-string return (e.g. a + ;; map carrying the token) must not have its value interpolated into a log + ;; message. The JSON-RPC error returned to the runtime is generic; this + ;; guards the log side-channel. The handler is invoked directly on the test + ;; thread so core.async `thread-call` conveys the `with-log` binding frame + ;; to the io thread (the server-dispatch path runs on a reader thread that + ;; predates this binding, so it cannot be captured via the mock RPC route). + (let [secret "tok_LEAKED_IN_MAP_VALUE_123" + session (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :model "fallback-model" + :provider {:base-url "https://oai.test" + :bearer-token-provider + (fn [_] {:access-token secret})}}) + session-id (sdk/session-id session)] + (log-test/with-log + (let [resp ( Date: Sat, 27 Jun 2026 11:02:56 +0200 Subject: [PATCH 03/15] chore(release): sync version to upstream 1.0.4 (1.0.1.1 -> 1.0.4.0) Run `clj -T:build sync-version :upstream "1.0.4"`, advancing the UPSTREAM.CLJ_PATCH version to 1.0.4.0 and updating the dependency coordinates in build.clj, README.md, and doc/getting-started.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- build.clj | 2 +- doc/getting-started.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c8c3c14..25ca606 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Add to your `deps.edn`: ```clojure ;; From Maven Central -io.github.copilot-community-sdk/copilot-sdk-clojure {:mvn/version "1.0.1.1"} +io.github.copilot-community-sdk/copilot-sdk-clojure {:mvn/version "1.0.4.0"} ;; Or git dependency io.github.copilot-community-sdk/copilot-sdk-clojure {:git/url "https://github.com/copilot-community-sdk/copilot-sdk-clojure.git" diff --git a/build.clj b/build.clj index 5eb03e3..47bdfb5 100644 --- a/build.clj +++ b/build.clj @@ -7,7 +7,7 @@ (:import [java.io File])) (def lib 'io.github.copilot-community-sdk/copilot-sdk-clojure) -(def version "1.0.1.1") +(def version "1.0.4.0") (def class-dir "target/classes") (defn- try-sh diff --git a/doc/getting-started.md b/doc/getting-started.md index 3eb12f7..1186573 100644 --- a/doc/getting-started.md +++ b/doc/getting-started.md @@ -34,7 +34,7 @@ copilot --version Add to your `deps.edn`: ```clojure -{:deps {io.github.copilot-community-sdk/copilot-sdk-clojure {:mvn/version "1.0.1.1"}}} +{:deps {io.github.copilot-community-sdk/copilot-sdk-clojure {:mvn/version "1.0.4.0"}}} ``` Or use as a Git dependency: From 254e0f698d45a6422bd28ffcd01de9f6a581a7aa Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 11:03:05 +0200 Subject: [PATCH 04/15] docs: document v1.0.4 session options and regenerate API HTML - CHANGELOG: new `### Added (v1.0.4 sync)` and `### Changed (v1.0.4 sync)` subsections under `[Unreleased]`, citing the upstream PRs. - API.md: expand the `:provider` session row (`:transport`, `:bearer-token-provider`); add `:providers`, `:models`, `:capi`, and `:exp-assignments` rows; rework the Customize Mode section for the 12-section catalog (`:preamble` first) and the `:preserve` action. - byok.md: add `:transport` / `:bearer-token-provider` provider fields and new "Dynamic Bearer Tokens" and "Multi-Provider Registry" sections. - Regenerate Codox HTML (`bb docs`) for the updated docstrings and markdown. `bb validate-docs` clean (17 files, 0 warnings). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 55 +++ doc/api/API.html | 384 ++++++++++++++++-- doc/api/azure-managed-identity.html | 2 +- doc/api/byok.html | 46 ++- doc/api/codegen.html | 2 +- doc/api/custom-agents.html | 2 +- doc/api/debugging.html | 2 +- doc/api/getting-started.html | 10 +- doc/api/github.copilot-sdk.client.html | 38 +- .../github.copilot-sdk.generated.coerce.html | 2 +- ...hub.copilot-sdk.generated.event-specs.html | 2 +- doc/api/github.copilot-sdk.helpers.html | 2 +- doc/api/github.copilot-sdk.html | 55 ++- doc/api/github.copilot-sdk.instrument.html | 2 +- doc/api/github.copilot-sdk.logging.html | 2 +- doc/api/github.copilot-sdk.process.html | 11 +- doc/api/github.copilot-sdk.protocol.html | 8 +- doc/api/github.copilot-sdk.session.html | 58 ++- doc/api/github.copilot-sdk.specs.html | 5 +- doc/api/github.copilot-sdk.tool-set.html | 17 + doc/api/github.copilot-sdk.tools.html | 31 +- doc/api/github.copilot-sdk.util.html | 7 +- doc/api/index.html | 21 +- doc/api/overview.html | 7 +- doc/api/style.html | 2 +- doc/api/upstream-doc-gap-matrix.html | 122 ++++++ doc/auth/byok.md | 63 +++ doc/reference/API.md | 24 +- 28 files changed, 883 insertions(+), 99 deletions(-) create mode 100644 doc/api/github.copilot-sdk.tool-set.html create mode 100644 doc/api/upstream-doc-gap-matrix.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 0247196..26b9326 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,61 @@ All notable changes to this project will be documented in this file. This change ## [Unreleased] +### Added (v1.0.4 sync) +Ported from upstream `github/copilot-sdk` v1.0.1 → v1.0.4 (`@github/copilot` +1.0.63 → 1.0.65). Schema bumped to 1.0.65. +- **`:preamble` system-message section + `:preserve` action** — port of upstream + [PR #1713](https://github.com/github/copilot-sdk/pull/1713). The customize-mode + section catalog gains `:preamble` (the agent identity preamble, split out from + the `:identity` group, which is now a section group). The static section + actions gain `:preserve`, a no-op marker that opts an individually-addressable + section out of a group-level `:remove`. Both `system-prompt-sections` and its + `system-message-sections` alias expose `:preamble`. +- **`:capi` session option** — port of upstream + [PR #1711](https://github.com/github/copilot-sdk/pull/1711). `create-session` + and `resume-session` accept an optional `:capi` map (`{:enable-web-socket-responses + boolean}`), wire-encoded as `capi.enableWebSocketResponses`. Added `::capi` and + `::enable-web-socket-responses` specs. +- **Provider `:transport`** — port of upstream + [PR #1711](https://github.com/github/copilot-sdk/pull/1711). The BYOK `:provider` + (and registry named providers) accept an optional `:transport` (`:http` or + `:websockets`), emitted as wire `transport`. Added `::transport` spec. +- **Multi-provider BYOK registry (`:providers` / `:models`)** — port of upstream + [PR #1718](https://github.com/github/copilot-sdk/pull/1718) (`@experimental`). + `create-session` and `resume-session` accept `:providers` (a vector of named + providers) and `:models` (a model catalog referencing them by `:name`). A model + selection id is `"providerName/id"`. Combining the singular `:provider` with + `:providers` is rejected. Added `::named-provider`, `::provider-model`, + `::providers`, and `::models` specs. +- **`:bearer-token-provider` callback** — port of upstream + [PR #1748](https://github.com/github/copilot-sdk/pull/1748) (`@experimental`). + Providers accept a `:bearer-token-provider` function for dynamic, per-request + bearer tokens. The fn is stripped before serialization (sending + `hasBearerTokenProvider true`); the runtime requests a token via a new inbound + `providerToken.getToken` RPC, dispatched to the registered callback. Non-string + callback results are rejected and never logged. Added `::bearer-token-provider` + spec. +- **`:exp-assignments` session option** — port of upstream + [PR #1750](https://github.com/github/copilot-sdk/pull/1750) (`@internal`). + An opaque experiment-flight assignment map forwarded verbatim (string keys + bypass kebab→camel conversion) as `expAssignments`. Added `::exp-assignments` + spec. +- **New session-event types** (schema 1.0.65) — schema-driven event types added to + the generated wire specs: citations, binary assets (PersistedBinary / + OmittedBinary / BinaryAssetReference), additional canvas events + (CanvasUnavailable / Recorded / Removed), ScheduleRearmed, and MCP OAuth events. + Public `event-types` / `session-events` entries added where upstream exposes a + public SDK event. +- **`open-canvases` validation relaxed** — parity with upstream `session.ts`: + an open-canvas instance now requires only `:extension-id` + `:canvas-id` + (dropped the `:reopen` / `:availability` requirements). + +### Changed (v1.0.4 sync) +- **`redact-secrets` masks the `:providers` registry** — the validation-error + redactor now masks `:api-key`, `:bearer-token`, and `:headers` on every entry + in the multi-provider `:providers` registry, matching the existing singular + `:provider` masking. + ### Added (post-v1.0.1 sync) - **`:memory` session configuration** — port of upstream [PR #1617](https://github.com/github/copilot-sdk/pull/1617). `create-session` diff --git a/doc/api/API.html b/doc/api/API.html index 39efdf7..e007a3a 100644 --- a/doc/api/API.html +++ b/doc/api/API.html @@ -1,6 +1,6 @@ -API Reference

API Reference

+API Reference

API Reference

Helpers API

The helpers namespace provides simple, stateless query functions with automatic client management.

(require '[github.copilot-sdk.helpers :as h])
@@ -88,9 +88,16 @@ 

Constructor

:env map nil Environment variables :github-token string nil GitHub token for authentication. Sets COPILOT_SDK_AUTH_TOKEN env var and passes --auth-token-env flag :use-logged-in-user? boolean true Use logged-in user auth. Defaults to false when :github-token is provided. Cannot be used with :cli-url + :copilot-home string nil Base directory for Copilot data files. Sets COPILOT_HOME env var on the spawned CLI. (upstream PR #1191) + :tcp-connection-token string nil Connection token for the headless CLI server (TCP only). When the SDK spawns its own CLI in TCP mode and this is omitted, a UUID is generated automatically so the loopback listener is safe by default. The token is sent to the CLI via COPILOT_CONNECTION_TOKEN and forwarded over the wire on the new connect handshake. Rejected when combined with :use-stdio? true. (upstream PR #1176) + :remote? boolean false When true, append --remote to the spawned CLI args so the CLI exposes the session over a GitHub-hosted remote endpoint. Ignored when :cli-url is set. (upstream PR #1192) + :session-idle-timeout-seconds integer 0 (disabled) Server-wide session idle timeout in seconds. When > 0, append --session-idle-timeout <n> to the spawned CLI so idle sessions are cleaned up after the given duration. :on-list-models fn nil Zero-arg function returning model info maps. Bypasses models.list RPC; does not require start!. Results are cached the same way as RPC results + :telemetry map nil OpenTelemetry export config, applied as environment variables to the spawned CLI (ignored when connecting to an existing server via :cli-url or a parent process via :is-child-process?, since no CLI is spawned). When present, enables OTel. Keys (all optional): :otlp-endpoint (OTLP HTTP endpoint), :otlp-protocol ("http/json" or "http/protobuf" — sets OTEL_EXPORTER_OTLP_PROTOCOL), :file-path (write spans to a file), :exporter-type (exporter selection), :source-name (service/source name), :capture-content? (boolean — capture prompt/response content; off by default for privacy). See Observability. (upstream PR #785, PR #1648) + :on-get-trace-context fn nil Zero-arg function returning {:traceparent "..." :tracestate "..."}, called per request (session create/resume and each message send) to propagate a distributed-trace context. Only :traceparent and :tracestate are forwarded. See Observability :is-child-process? boolean false When true, connect via own stdio to a parent Copilot CLI process (no process spawning). Requires :use-stdio? true; mutually exclusive with :cli-url :session-fs map nil Session filesystem provider config. Keys: :initial-cwd (string, required), :session-state-path (string, required), :conventions ("windows" or "posix", required). When set, the client calls sessionFs.setProvider on connect and routes filesystem operations through per-session handlers. See Session Filesystem + :mode keyword :copilot-cli Client multitenancy mode: :copilot-cli (default — preserve historical CLI behavior) or :empty (multi-tenant SaaS hosts that must isolate sessions from local machine state). In :empty mode the SDK requires at least one tenant-scoped storage root (:copilot-home, :session-fs, :cli-url, or :is-child-process?), sets COPILOT_DISABLE_KEYTAR=1 on the spawned CLI, spreads 10 safe defaults under caller session config, forces installedPlugins [], and normalizes :system-message to strip environment_context. See Client Mode. (upstream PR #1428)

Methods

@@ -108,6 +115,7 @@

stop!

(copilot/stop! client)
 

Stop the server and close all sessions gracefully.

+

For SDK-spawned processes (not :external-server?), stop! issues a runtime.shutdown RPC before closing the connection, giving the CLI a chance to flush state and exit cleanly. The call is bounded by a 10-second timeout; on timeout or error the SDK falls back to terminating the process (SIGTERM, then SIGKILL). Connecting to an external server (:cli-url) skips the shutdown RPC and the process is left running. (upstream PR #1667)

force-stop!

(copilot/force-stop! client)
 
@@ -167,15 +175,20 @@

with-clien :system-message map System message customization (see below) :available-tools vector List of allowed tool names :excluded-tools vector List of excluded tool names - :provider map Provider config for BYOK (see BYOK docs). Required key: :base-url. Optional: :provider-type (:openai/:azure/:anthropic), :wire-api (:completions/:responses), :api-key, :bearer-token, :azure-options, :headers (map of HTTP header name→value, sent with each provider request — upstream PR #1094) + :provider map Provider config for BYOK (see BYOK docs). Required key: :base-url. Optional: :provider-type (:openai/:azure/:anthropic), :wire-api (:completions/:responses), :api-key, :bearer-token, :azure-options, :headers (map of HTTP header name→value, sent with each provider request — upstream PR #1094), :model-id (string — the model identifier to send to the provider; overrides session :model), :wire-model (string — model name as sent on the provider wire when it differs from :model-id), :max-input-tokens (integer — input/prompt token cap; serialized as wire maxPromptTokens), :max-output-tokens (integer — output token cap), :transport (:http/:websockets — provider transport; serialized as wire transport — upstream PR #1711), :bearer-token-provider (fn — dynamic bearer-token callback, see BYOK docs — upstream PR #1748). The four override fields were added in upstream PR #966 + :providers vector (Experimental) Multi-provider BYOK registry — a vector of named providers. Each entry has the same fields as :provider plus a required :name (the registry key, no /) and a :bearer-token-provider callback. Pairs with :models to declare a model catalog. Cannot be combined with the singular :provider. (upstream PR #1718) + :models vector (Experimental) Model catalog referencing the :providers registry. Each entry: :id (required, provider-local model id), :provider (required, a :name in :providers), and optional override fields (:model-id, :wire-model, :capabilities, :max-input-tokens, :max-context-window-tokens, :max-output-tokens). The full model selection id is "providerName/id". (upstream PR #1718) + :capi map CAPI (Copilot API) session options. {:enable-web-socket-responses boolean} — serialized as wire capi.enableWebSocketResponses. (upstream PR #1711) + :exp-assignments map (Internal) Opaque experiment flight assignments. Keys are source-defined flight ids and are forwarded verbatim (string keys bypass kebab→camel conversion). Serialized as expAssignments. (upstream PR #1750) :mcp-servers map MCP server configs keyed by server ID (see MCP docs). Local (stdio) servers: :mcp-command, :mcp-args, :mcp-tools. Remote (HTTP/SSE) servers: :mcp-server-type (:http/:sse), :mcp-url, :mcp-tools. Spec aliases: ::mcp-stdio-server = ::mcp-local-server, ::mcp-http-server = ::mcp-remote-server :commands vector Command definitions (slash commands). See Commands - :custom-agents vector Custom agent configs. Each agent map: :agent-name (required), :agent-prompt (required), :agent-display-name, :agent-description, :agent-tools, :agent-infer?, :agent-skills (vector of strings), :mcp-servers + :custom-agents vector Custom agent configs. Each agent map: :agent-name (required), :agent-prompt (required), :agent-display-name, :agent-description, :agent-tools, :agent-infer?, :agent-skills (vector of strings), :agent-model (string, e.g. "claude-haiku-4.5"; when set the runtime tries this model for the agent, falling back to the parent session model — upstream PR #1309), :mcp-servers :default-agent map Built-in/default agent config. Use {:excluded-tools [...]} to hide tools from the default agent while leaving them available to custom agents - :on-permission-request fn Required. Permission handler function. Use copilot/approve-all to approve everything. + :on-permission-request fn Permission handler function. Optional (upstream PR #1308). When omitted, permission requests are not auto-resolved; resolve them manually via handle-pending-permission-request!. Use copilot/approve-all to approve everything. :streaming? boolean Enable streaming deltas :config-dir string Override config directory for CLI :skill-directories vector Additional skill directories to load + :instruction-directories vector Additional directories to search for custom instruction files. Forwarded as instructionDirectories on session.create and session.resume. (upstream PR #1190) :disabled-skills vector Disable specific skills by name :large-output map (Experimental) Tool output handling config. CLI protocol feature, not in official SDK. :working-directory string Working directory for the session (tool operations relative to this) @@ -187,10 +200,33 @@

with-clien :agent string Name of a custom agent to activate at session start. Must match a name in :custom-agents. Equivalent to calling agent.select after creation. :on-event fn Event handler (1-arg fn receiving event maps). Registered before the RPC call, guaranteeing early events like session.start are not missed. :on-elicitation-request fn Handler for elicitation requests from the agent. When provided, advertises requestElicitation=true and handles elicitation.requested broadcast events. Single-arg handler receives an ElicitationContext map with :session-id, :message, :requested-schema, :mode, :elicitation-source, :url. Returns an ElicitationResult map {:action "accept"/"decline"/"cancel" :content {...}}. See Elicitation Provider + :on-exit-plan-mode fn Handler for exitPlanMode.request RPCs — invoked when the agent asks to leave plan mode. When provided, advertises requestExitPlanMode=true. Receives the request map; returns the approval result. (upstream PR #1228) + :on-auto-mode-switch fn Handler for autoModeSwitch.request RPCs — invoked when the agent asks to switch autonomy mode. When provided, advertises requestAutoModeSwitch=true. Receives the request map; returns the approval result. (upstream PR #1228) + :enable-session-telemetry? boolean Enable/disable the CLI’s internal session telemetry (distinct from the client :telemetry OpenTelemetry export). Defaults to enabled for GitHub-authenticated sessions; always disabled when a BYOK :provider is set; defaulted to false in :mode :empty (caller can override). Wire-encoded as enableSessionTelemetry. See Observability. (upstream PR #1224) :create-session-fs-handler fn Factory for session filesystem providers. Required when :session-fs is set on the client. Called as (factory session), returns a provider-style map or a low-level handler map. See Session Filesystem :enable-config-discovery boolean Auto-discover .mcp.json, .vscode/mcp.json, skills, etc. Instruction files always load regardless. (upstream PR #1044) :model-capabilities map Model capabilities override. DeepPartial of model capabilities, e.g. {:model-supports {:supports-vision true}}. (upstream PR #1029) :include-sub-agent-streaming-events? boolean Forward streaming events from sub-agents to the parent session’s event stream. Defaults to true on the wire. (upstream PR #1108) + :remote-session keyword Per-session Mission Control mode: :off, :export, or :on. When omitted, the CLI applies its default. :off disables remote, :export exports session events to Mission Control without enabling remote steering, :on enables both. Forwarded as remoteSession. (upstream PR #1295, CLI 1.0.48) + :cloud map (create-session only) Creates a remote cloud session. Shape: {:repository {:owner "octocat" :name "hello-world" :branch "main"}}:owner and :name are required non-blank strings; :branch is optional. Forwarded as cloud.repository.* on session.create. Not accepted on resume-session (matches upstream ResumeSessionConfig). When :cloud is set and :session-id is omitted, the SDK defers id assignment to the server and registers the session under the server-returned id (upstream PR #1479). (upstream PR #1306) + :mcp-oauth-token-storage keyword Controls where MCP OAuth tokens are persisted. #{:persistent :in-memory}. Default is server-side (persistent). Set to :in-memory in multi-tenant hosts that must not leak tokens to disk. Wire-encoded as mcpOAuthTokenStorage. (upstream PR #1326) + :embedding-cache-storage keyword #{:persistent :in-memory}. Controls where the embedding cache lives. Wire-encoded as embeddingCacheStorage. (upstream PR #1474) + :skip-embedding-retrieval boolean Skip embedding-based context retrieval. (upstream PR #1474) + :organization-custom-instructions string Organization-wide instructions injected by the host. (upstream PR #1474) + :enable-on-demand-instruction-discovery boolean Auto-discover instruction files on demand. (upstream PR #1474) + :enable-file-hooks boolean Enable file-watcher-style lifecycle hooks. (upstream PR #1474) + :enable-host-git-operations boolean Allow the CLI to run git operations through the host. (upstream PR #1474) + :enable-session-store boolean Enable the disk-backed session store. (upstream PR #1474) + :enable-skills boolean Enable skills discovery and loading. (upstream PR #1474) + :plugin-directories vector Extra plugin directories loaded even when :enable-config-discovery is false. Wire-encoded as pluginDirectories. (upstream PR #1482) + :reasoning-summary string "none" / "concise" / "detailed". Controls inclusion/granularity of reasoning summaries on assistant turns. Wire-encoded as reasoningSummary. String-valued for consistency with :reasoning-effort. + :context-tier keyword | nil #{:default :long-context} selects the long-context model variant; nil explicitly clears any prior tier (wire-encoded as JSON null). Omit the key entirely to leave the current setting untouched. Wire-encoded as contextTier with values "default" / "long_context". + :skip-custom-instructions boolean Skip loading user-level custom instruction files. Forwarded via session.options.update (NOT session.create). Defaulted to true in :empty mode. (upstream PR #1428) + :custom-agents-local-only boolean Restrict custom-agent loading to caller-supplied configs only (no on-disk discovery). Forwarded via session.options.update. Defaulted to true in :empty mode. (upstream PR #1428) + :coauthor-enabled boolean Add a Copilot Co-authored-by trailer to commits made by the CLI. Forwarded via session.options.update. Defaulted to false in :empty mode. (upstream PR #1428) + :manage-schedule-enabled boolean Enable the built-in schedule-management tools. Forwarded via session.options.update. Defaulted to false in :empty mode. (upstream PR #1428) + :open-canvases vector (resume-session / join-session only) Seed the open-canvases snapshot when reconnecting. Each entry: {:instance-id ... :extension-id ... :canvas-id ... :reopen bool :availability "ready"\|"stale" :extension-name? ... :title? ... :status? ... :url? ... :input? {...}}. Caller-defined :input keys are preserved verbatim through wire conversion (no kebab→camel re-casing). See open-canvases. (upstream PR #1604) + :memory map Persistent-memory configuration. Shape: {:enabled boolean}. Sent on both session.create and session.resume; omitted entirely when the key is absent (never wire null). Wire-encoded as memory. In :mode :empty it is defaulted to {:enabled false} (caller can override). (upstream PR #1617)

resume-session

@@ -203,6 +239,8 @@

resume-session :disable-resume? boolean When true, skip emitting the session.resume event (default: false) + :continue-pending-work? boolean When true, the runtime re-emits any pending permission.requested and external tool calls so handlers can re-respond on resume; default false treats pending work as interrupted. Forwarded as continuePendingWork on session.resume. + :large-output map (Experimental) Tool output handling config. Now also forwarded on session.resume (matching upstream client.ts:1308).

When :on-permission-request is set to default-join-session-permission-handler, the SDK sends requestPermission: false on the wire, telling the CLI that this client does not handle permission requests. Any other handler sends requestPermission: true.

@@ -295,7 +333,17 @@

list-models

:max-prompt-image-size 20971520}}} :model-policy {:policy-state "enabled" :terms "..."} - :model-billing {:multiplier 1.0} + :model-billing {:multiplier 1.0 + ;; Per-token prices (upstream PR #1633), present when the + ;; model reports them; keys are optional: + :token-prices {:input-price 0.00000125 + :output-price 0.00001 + :cache-price 0.0000003125 + :long-context {:input-price 0.0000025 + :output-price 0.00002}}} + ;; Model picker categorization (CLI 1.0.46+): + :model-picker-category "powerful" ;; "lightweight" | "versatile" | "powerful" + :model-picker-price-category "very_high" ;; "low" | "medium" | "high" | "very_high" ;; For models supporting reasoning: :supported-reasoning-efforts ["low" "medium" "high" "xhigh"] :default-reasoning-effort "medium"} @@ -508,6 +556,8 @@

send!

:prompt string The message/prompt to send :attachments vector File attachments (see below) :mode keyword :enqueue or :immediate + :agent-mode keyword #{:interactive :plan :autopilot :shell}. Per-message agent mode. Wire-encoded as agentMode. (upstream PR #1438) + :display-prompt string Alternate prompt shown in the timeline UI instead of :prompt. Useful when the model-facing prompt contains machinery or context that should not be surfaced to the end user. Wire-encoded as displayPrompt. (upstream PR #1470) :request-headers map Extra HTTP headers (string→string) forwarded to the model provider for this request. Merged with provider-level :headers. (upstream PR #1094) @@ -565,6 +615,17 @@

<send!

answer (<! (copilot/<send! session {:prompt "Explain monads"}))] (println answer)))

+

<send-and-wait!

+
(copilot/<send-and-wait! session options)
+
+

Async equivalent of send-and-wait! for use inside go blocks. Returns a channel that yields the final assistant message event — the same shape as send-and-wait!’s successful return value (content lives under [:data :content]), or closes with nothing if no assistant message was received. Supports :timeout-ms in options (default: 300000, set to nil to disable).

+

Error semantics differ from send-and-wait!: where send-and-wait! throws on :copilot/session.error or timeout, this variant never surfaces those — the channel closes (delivering the last assistant message if one arrived, otherwise nothing), consistent with <send!.

+
(go
+  (let [session (<! (copilot/<create-session client {:on-permission-request copilot/approve-all}))
+        event   (<! (copilot/<send-and-wait! session {:prompt "Explain monads"}))]
+    (println (get-in event [:data :content]))))
+
+

Use <send! when you only need the content string; use <send-and-wait! when you need the full event (metadata, id, etc.).

events

(copilot/events session)
 
@@ -584,13 +645,13 @@

events->chan

subscribe-events
(copilot/subscribe-events session)
 
-

Subscribe to session events. Returns a channel (buffer size 1024) that receives events. This is a convenience wrapper around (tap (copilot/events session) ch).

+

Subscribe to session events. Returns a channel (sliding buffer, size 1024) that receives events. This is a convenience wrapper around (tap (copilot/events session) ch).

Event Drop Behavior
-

Session events are delivered via core.async mult. When mult receives an event, it attempts to put! to each subscriber’s channel. If a subscriber’s buffer is full at that moment, that specific event is silently dropped for that subscriber only.

-

Key points: - Per-subscriber: Each subscriber is independent. If subscriber A’s buffer is full but B has space, only A misses the event. - Per-event: Only the event that arrived when the buffer was full is dropped. Earlier events already in the buffer are not affected. - Silent: No error, warning, or indication that a drop occurred. - Not recoverable: The dropped event is gone for that subscriber.

+

Session events are delivered via core.async mult to a per-subscriber sliding-buffer channel. Because a sliding buffer never blocks on put!, mult is never stalled by a slow subscriber. If a subscriber falls behind and its buffer fills, the oldest buffered events are dropped for that subscriber only to make room for new ones.

+

Key points: - Per-subscriber: Each subscriber is independent. A slow subscriber drops its own oldest events without affecting delivery to other subscribers. - Oldest-first: When the buffer is full, the oldest buffered events are dropped, not the newest — subscribers always see the most recent events. - Silent: No error, warning, or indication that a drop occurred. - Not recoverable: Dropped events are gone for that subscriber.

With the default 1024 buffer, drops are unlikely unless a subscriber completely stops reading. For most use cases, this is not a concern.

-

unsubscribe-events

-
(copilot/unsubscribe-events session ch)
+

unsubscribe-events!

+
(copilot/unsubscribe-events! session ch)
 

Unsubscribe a channel from session events.

abort!

@@ -601,6 +662,21 @@

get-messages

(copilot/get-messages session)
 

Get all events/messages from this session.

+

handle-pending-tool-call! / <handle-pending-tool-call!

+
(copilot/handle-pending-tool-call! session
+                                   {:request-id "tool-req-7"
+                                    :result "STATUS_OK"})
+;; or async:
+(copilot/<handle-pending-tool-call! session {:request-id "tool-req-7"
+                                             :error "lookup failed"})
+
+

Resolve a tool call that was not auto-handled (because :handler was omitted from define-tool). The args map accepts :request-id plus either :result (string or full result map) or :error (string). Sent on the wire as session.tools.handlePendingToolCall. (upstream PR #1308)

+

handle-pending-permission-request! / <handle-pending-permission-request!

+
(copilot/handle-pending-permission-request! session
+                                            {:request-id "perm-req-3"
+                                             :result {:kind :approve-once}})
+
+

Resolve a permission request that was not auto-handled (because :on-permission-request was omitted from the session config). The result map must contain a :kind other than :no-result. Sent on the wire as session.permissions.handlePendingPermissionRequest. (upstream PR #1308)

get-current-model

(copilot/get-current-model session)
 ;; => "gpt-5.4"
@@ -615,7 +691,7 @@ 

switch-model!

Switch the model for this session mid-conversation. Returns the new model ID string, or nil.

-

Optional opts map: - :reasoning-effort — Reasoning effort level (“low”, “medium”, “high”, “xhigh”) - :model-capabilities — Model capabilities override map, e.g. {:model-supports {:supports-vision true}}

+

Optional opts map: - :reasoning-effort — Reasoning effort level (“low”, “medium”, “high”, “xhigh”) - :reasoning-summary — Reasoning summary mode (“none”, “concise”, “detailed”). Wire-encoded as reasoningSummary. - :context-tier — Context window tier for models that support it: :default or :long-context (upstream PR #1522). Wire-encoded as contextTier with values "default" / "long_context". - :model-capabilities — Model capabilities override map, e.g. {:model-supports {:supports-vision true}}

set-model!

(copilot/set-model! session "claude-sonnet-4.5")
 ;; => "claude-sonnet-4.5"
@@ -724,6 +800,27 @@ 

Experi session/skills-reload! Reload all skills. +

Queued commands

+

The CLI emits :copilot/command.queued events when a slash-command is dispatched for client-side execution. Each event carries a :request-id and :command. Clients respond via respond-to-queued-command!:

+
;; Inside an event handler that observes :copilot/command.queued
+(session/respond-to-queued-command! session
+                                    {:request-id (:request-id event-data)
+                                     :handled? true
+                                     :stop-processing-queue? false})
+
+;; Or, to let the CLI fall back to default handling:
+(session/respond-to-queued-command! session
+                                    {:request-id (:request-id event-data)
+                                     :handled? false})
+
+ + + + + + + +
Function Description
session/respond-to-queued-command! Acknowledge a command.queued event (experimental).

MCP Servers

@@ -867,6 +964,29 @@

Experi

(session/usage-get-metrics my-session)
 
+

Remote Sessions (experimental, upstream PR #1192)

+ + + + + + + + +
Function Description
session/remote-enable Enable remote steerability for the session. Returns {:url <string?> :remote-steerable <boolean>}. Optional 2-arity opts map accepts :mode set to :off, :export, or :on (upstream CLI 1.0.48-1).
session/remote-disable Disable remote steerability for the session. Returns nil.
+
(session/remote-enable my-session)
+;; => {:url "https://copilot-remote.test/abc" :remote-steerable true}
+
+;; Optional per-session mode (upstream CLI 1.0.48-1):
+;; - :off    — disable remote
+;; - :export — export session events to Mission Control without remote steering
+;; - :on     — export + enable remote steering
+(session/remote-enable my-session {:mode :export})
+;; => {:remote-steerable false}
+
+(session/remote-disable my-session)
+;; => nil
+

UI Elicitation

Request structured user input via interactive dialogs. Check host support before calling.

@@ -877,6 +997,22 @@

capabilities

;; => {:ui {:elicitation true}}

Get the host capabilities map reported when the session was created or resumed.

+

open-canvases

+
(copilot/open-canvases session)
+;; => [{:instance-id "i1" :canvas-id "diff" :extension-id "ext.x"
+;;      :reopen false :availability "ready"}]
+
+

Get the current open-canvases snapshot for session. Returns a vector of canvas-instance maps. The snapshot is initialized from session.resume and updated by :copilot/session.canvas.opened / :copilot/session.canvas.closed events. session.create does NOT populate it (matches upstream Node.js).

+

Each entry has required keys :instance-id, :extension-id, :canvas-id, :reopen, :availability and optional :extension-name, :title, :status, :url, :input. Closing an instance that’s not in the snapshot is a silent no-op (idempotent); malformed payloads (missing required field, wrong type, or invalid :availability) log a warning and leave the snapshot unchanged — matches upstream isOpenCanvasInstance strictness.

+

The :input map (caller-defined opaque data on each canvas) is preserved verbatim through wire conversion. Keys you receive (e.g. via the canvas opened event or after a resume) round-trip back to the CLI without camelCasing — including snake_case and nested keys.

+

Seeding open-canvases on resume

+

To restore canvases after reconnecting, pass :open-canvases to resume-session or join-session. The shape mirrors what (open-canvases session) returned previously:

+
(let [snap (copilot/open-canvases old-session)]
+  (copilot/resume-session client session-id
+                          {:on-permission-request copilot/approve-all
+                           :open-canvases snap}))
+
+

The SDK preserves caller-defined :input keys verbatim on the wire (they are sent as JSON object fields with the original key names, unchanged by Clojure’s kebab-case conversion).

elicitation-supported?

(copilot/elicitation-supported? session)
 ;; => true
@@ -995,6 +1131,11 @@ 

Event Reference

:copilot/session.plan_changed Session plan created/updated/deleted; data: {:operation "create"/"update"/"delete"} :copilot/session.workspace_file_changed Workspace file created or updated; data: {:path "...", :operation "create"/"update"} :copilot/session.task_complete Task completed by the session agent; data: {:summary "..." :aborted? false} (both optional) + :copilot/session.todos_changed Signal-only: the agent’s todos / todo-deps table was written. No payload. Events arrive in order; debounce on arrival if needed (upstream schema 1.0.63) + :copilot/session.schedule_created Scheduled prompt registered via /every; data: {:id <pos-int> :interval-ms <pos-int> :prompt "..."} (upstream schema 1.0.42) + :copilot/session.schedule_cancelled Scheduled prompt cancelled from the schedule manager dialog; data: {:id <pos-int>} (upstream schema 1.0.42) + :copilot/session.autopilot_objective_changed Autopilot objective lifecycle events; data: {:operation #{"create" "update" "delete"}} (required) with optional :id (integer) and :status (upstream schema 1.0.56). The :status enum is widened to include "active", "paused", "cap_reached", "completed". + :copilot/session.permissions_changed Per-session permission flags changed; data: {:allow-all-permissions boolean :previous-allow-all-permissions boolean} (upstream schema 1.0.56). :copilot/skill.invoked Skill invocation triggered; data includes :name, :path, :content, optional :description, :plugin-name, :plugin-version :copilot/user.message User message added :copilot/pending_messages.modified Pending message queue updated @@ -1006,19 +1147,20 @@

Event Reference

:copilot/assistant.message_delta Streaming response chunk :copilot/assistant.streaming_delta Response size update during streaming; data: {:total-response-size-bytes N} :copilot/assistant.turn_end Assistant turn completed - :copilot/assistant.usage Token usage for this turn + :copilot/assistant.usage Token usage for this turn; data may include optional :content-filter-triggered (boolean) and :finish-reason (string) (upstream schema 1.0.63) :copilot/abort Current message aborted :copilot/tool.user_requested Tool execution requested by user - :copilot/tool.execution_start Tool execution started; data includes :tool-call-id, :tool-name, optional :arguments, :parent-tool-call-id, :mcp-server-name, :mcp-tool-name + :copilot/tool.execution_start Tool execution started; data includes :tool-call-id, :tool-name, optional :arguments, :parent-tool-call-id, :mcp-server-name, :mcp-tool-name, :model :copilot/tool.execution_progress Tool execution progress update :copilot/tool.execution_partial_result Tool execution partial result - :copilot/tool.execution_complete Tool execution completed + :copilot/tool.execution_complete Tool execution completed; data may include optional :structured-content (arbitrary structured tool result) (upstream schema 1.0.63) :copilot/subagent.started Subagent started; data includes :tool-call-id, :agent-name, :agent-display-name, :agent-description :copilot/subagent.completed Subagent completed; data includes :tool-call-id, :agent-name, :agent-display-name, optional :model, :total-tool-calls, :total-tokens, :duration-ms :copilot/subagent.failed Subagent failed; data includes :tool-call-id, :agent-name, :agent-display-name, :error, optional :model, :total-tool-calls, :total-tokens, :duration-ms :copilot/subagent.selected Subagent selected :copilot/subagent.deselected Subagent deselected :copilot/hook.start Hook invocation started + :copilot/hook.progress Ephemeral progress update from a long-running hook; data: {:message "..."} (upstream schema 1.0.56). :copilot/hook.end Hook invocation finished :copilot/system.message System message emitted :copilot/system.notification System notification with structured :kind discriminator (e.g. agent_completed, shell_completed, shell_detached_completed) @@ -1045,10 +1187,15 @@

Event Reference

:copilot/session.mcp_server_status_changed MCP server status changed :copilot/session.extensions_loaded Extensions loaded for the session :copilot/session.custom_agents_updated Custom agents list updated + :copilot/session.custom_notification Custom Skill notification (Notify block); ephemeral. Data: {:source "<ext-id>" :name "<event>" :payload <any> :subject {<k> <v>} :version <pos-int>} (:subject and :version are optional; :subject keys are preserved verbatim — see PR #1292, CLI 1.0.48) :copilot/sampling.requested MCP sampling request initiated; ephemeral :copilot/sampling.completed MCP sampling request completed; ephemeral :copilot/session.remote_steerable_changed Session remote steering capability changed; data: {:remote-steerable true/false} :copilot/capabilities.changed Session capabilities dynamically changed (e.g., elicitation support); ephemeral. Data: {:ui {:elicitation true/false}} + :copilot/mcp_app.tool_call_complete An MCP App tool call completed (upstream schema 1.0.52-4, SEP-1865); ephemeral. Data: {:server-name ... :tool-name ... :duration-ms ... :success bool :arguments {...} :result {...}}:arguments and :result are opaque source-defined maps whose keys are preserved verbatim (not kebab-cased). + :copilot/session.canvas.opened A canvas (auxiliary UI surface) was opened in the session; ephemeral. Data: {:instance-id ... :canvas-id ... :extension-id ... :reopen bool :availability "ready"|"stale" :extension-name? ... :title? ... :status? ... :url? ... :input? {...}}. The SDK upserts the entry into the open-canvases snapshot before publishing. + :copilot/session.canvas.closed A canvas was closed; ephemeral. Data: {:instance-id ... :canvas-id ... :extension-id ...}. The SDK removes the matching entry from the open-canvases snapshot before publishing. (upstream PR #1604) + :copilot/session.canvas.registry_changed The set of canvases the host can offer changed; ephemeral.

Example: Handling Events

@@ -1111,6 +1258,48 @@

Streaming

When :streaming? true: - :copilot/assistant.message_delta events contain incremental text in :delta-content - :copilot/assistant.reasoning_delta events contain incremental reasoning in :delta-content (model-dependent) - Accumulate delta values to build the full response progressively - The final :copilot/assistant.message event always contains the complete content


+

Observability

+

The SDK supports two independent telemetry mechanisms.

+

OpenTelemetry export (client :telemetry)

+

Pass a :telemetry map in the client options to enable OpenTelemetry export on the spawned CLI. Presence of the map enables OTel; all sub-keys are optional:

+
(def client
+  (copilot/client
+    {:telemetry {:otlp-endpoint "http://localhost:4318"
+                 :exporter-type "otlp"
+                 :source-name   "my-app"
+                 :capture-content? false}}))
+
+ + + + + + + + + + + + +
Key Type Description CLI env var
:otlp-endpoint string OTLP HTTP endpoint to export spans to OTEL_EXPORTER_OTLP_ENDPOINT
:otlp-protocol string OTLP wire protocol: "http/json" or "http/protobuf" OTEL_EXPORTER_OTLP_PROTOCOL
:file-path string Write spans to a local file instead of/alongside OTLP COPILOT_OTEL_FILE_EXPORTER_PATH
:exporter-type string Exporter selection COPILOT_OTEL_EXPORTER_TYPE
:source-name string Service / source name attached to spans COPILOT_OTEL_SOURCE_NAME
:capture-content? boolean Capture prompt/response content in spans. Defaults to off — only enable in trusted environments, as it records message content OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT
+

When :telemetry is present the SDK sets COPILOT_OTEL_ENABLED=true on the CLI process. (upstream PR #785, PR #1648)

+

Distributed trace propagation (:on-get-trace-context)

+

To stitch CLI spans into a caller-managed distributed trace, provide a zero-arg :on-get-trace-context function in the client options. The SDK calls it per request to capture a fresh trace context — on session create, session resume, and every message send — forwarding only :traceparent and :tracestate:

+
(def client
+  (copilot/client
+    {:on-get-trace-context
+     (fn [] {:traceparent "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
+             :tracestate  "rojo=00f067aa0ba902b7"})}))
+
+

Internal session telemetry (:enable-session-telemetry?)

+

:enable-session-telemetry? is a session config flag that controls the CLI’s own internal usage telemetry — independent of the OpenTelemetry export above. It defaults to enabled for GitHub-authenticated sessions and is always disabled when a BYOK :provider is configured. In :mode :empty it is defaulted to false as one of the multi-tenant hardening defaults (the caller can still set it explicitly). Set it to false to opt out:

+
(def session
+  (copilot/create-session client
+    {:enable-session-telemetry? false
+     :on-permission-request copilot/approve-all}))
+
+

(upstream PR #1224)

+

Advanced Usage

Manual Server Control

(def client (copilot/client {:auto-start? false}))
@@ -1123,6 +1312,61 @@ 

Manual Serve ;; Stop manually (copilot/stop! client)

+

Client Mode (Empty)

+

:mode :empty configures the client for multi-tenant SaaS hosts that must isolate sessions from the local machine — no on-disk state from a specific user account leaks into a session. The default :copilot-cli mode preserves historical CLI behavior. (upstream PR #1428)

+
(require '[github.copilot-sdk :as copilot]
+         '[github.copilot-sdk.tool-set :as tool-set])
+
+(def client
+  (copilot/client
+    {:mode :empty
+     ;; At least ONE of :copilot-home / :session-fs / :cli-url /
+     ;; :is-child-process? is required so the CLI has a tenant-scoped
+     ;; storage root. Using both is fine and common:
+     :copilot-home "/srv/tenants/acme/copilot-home"
+     :session-fs   {:initial-cwd "/srv/tenants/acme/cwd"
+                    :session-state-path "/srv/tenants/acme/state"
+                    :conventions "posix"}}))
+
+(def session
+  (copilot/create-session client
+    {:on-permission-request copilot/approve-all
+     ;; Required in :empty mode (use [] to allow nothing — the key must
+     ;; be present so silently-empty filters can't happen):
+     :available-tools tool-set/isolated
+     ;; Required when client has :session-fs:
+     :create-session-fs-handler (fn [_session] my-fs-handler)}))
+
+

What :empty mode enforces (vs :copilot-cli):

+
    +
  • Constructor validation: at least one of :copilot-home, :session-fs, :cli-url, or :is-child-process? must be supplied (so the CLI never falls back to the user’s home directory). The SDK also forces COPILOT_DISABLE_KEYTAR=1 on the spawned CLI.
  • +
  • Session validation: every create-session / resume-session call must provide :available-tools (an empty vector is legitimate). When the client has :session-fs, :create-session-fs-handler is also required (this applies to both modes).
  • +
  • Safe session defaults (spread UNDER caller config — caller always wins): :enable-session-telemetry? false, :mcp-oauth-token-storage :in-memory, :skip-embedding-retrieval true, :embedding-cache-storage :in-memory, :enable-on-demand-instruction-discovery false, :enable-file-hooks false, :enable-host-git-operations false, :enable-session-store false, :enable-skills false, :memory {:enabled false}.
  • +
  • System message normalization: the SDK strips the environment_context section from the system message (or promotes :append to :customize) so no host-environment context leaks. If the caller already provides their own environment_context override in :customize mode, it is preserved verbatim.
  • +
  • Post-create options: a follow-up session.options.update RPC sets :skip-custom-instructions true, :custom-agents-local-only true, :coauthor-enabled false, :manage-schedule-enabled false, and forces :installed-plugins []. On failure, the SDK cleans up the half-configured session before propagating the error.
  • +
+

Both modes always emit :tool-filter-precedence "excluded" on session.create and session.resume, and reject bare "*" in :available-tools / :excluded-tools at the SDK boundary.

+

Tool Sets

+

Use github.copilot-sdk.tool-set to construct :available-tools / :excluded-tools lists with built-in helpers. Mirrors the upstream BuiltInTools constants. (upstream PR #1428)

+
(require '[github.copilot-sdk.tool-set :as tool-set])
+
+;; Source-qualified single tool — patterns are "<source>:<name>",
+;; source is one of "builtin", "mcp", or "custom":
+(tool-set/builtin "ask_user")     ; => "builtin:ask_user"
+(tool-set/builtin "*")            ; => "builtin:*"   (all built-ins)
+(tool-set/mcp "*")                ; => "mcp:*"      (all MCP tools)
+(tool-set/custom "my_tool")       ; => "custom:my_tool"
+
+;; Vector of patterns:
+(tool-set/builtins ["task" "skill"])
+;; => ["builtin:task" "builtin:skill"]
+
+;; The "Isolated" preset matches BuiltInTools.Isolated upstream —
+;; every built-in that is safely session-bounded (no host I/O):
+tool-set/isolated
+;; => ["builtin:ask_user" "builtin:task_complete" "builtin:exit_plan_mode" ...]
+
+

The constructors enforce well-formed entries: a bare "*" is rejected (the SDK also rejects it in :available-tools / :excluded-tools at the session boundary — apps must explicitly opt into a source so an absent source can never silently grant access to unexpected tools). The runtime always receives :tool-filter-precedence "excluded" on session.create / session.resume so the ordering between allow and deny lists is deterministic.

Tools

Let the CLI call back into your process when the model needs capabilities you provide:

(def lookup-tool
@@ -1142,6 +1386,19 @@ 

Tools

:on-permission-request copilot/approve-all}))

When Copilot invokes lookup_issue, the SDK automatically runs your handler and responds to the CLI.

+

Declaration-only tools (manual resolution):

+

The :handler key is optional (upstream PR #1308). When omitted, the SDK does not auto-respond to tool calls — the call surfaces as a :copilot/external_tool.requested event with a pending request id, and the application resolves it later via handle-pending-tool-call!. Useful for human-in-the-loop UIs or out-of-process tool execution.

+
(def manual-tool
+  (copilot/define-tool "manual_lookup"
+    {:description "Look up status manually"
+     :parameters {:type "object"
+                  :properties {:id {:type "string"}}
+                  :required ["id"]}}))
+;; …later, after a human reviews the request:
+(copilot/handle-pending-tool-call! session
+                                   {:request-id "tool-req-7"
+                                    :result "STATUS_OK"})
+

Overriding built-in tools:

Set :overrides-built-in-tool true to override a built-in tool (e.g., grep, edit_file). Without this flag, defining a tool whose name clashes with a built-in tool causes an error.

(def custom-grep
@@ -1155,6 +1412,16 @@ 

Tools

:handler (fn [{:keys [pattern]} _invocation] (copilot/result-success (my-custom-grep pattern)))}))
+

Deferring tools:

+

Set :defer to :auto or :never (upstream PR #1632) to control whether a tool may be deferred — loaded lazily via tool search rather than always pre-loaded into the model’s context. :auto (the default) lets the runtime defer the tool; :never forces it to be pre-loaded. Deferring large tool sets keeps the active context smaller.

+
(def always-loaded
+  (copilot/define-tool "critical_action"
+    {:description "A tool that must always be available"
+     :defer :never
+     :parameters {:type "object" :properties {}}
+     :handler (fn [_ _] (copilot/result-success "done"))}))
+
+

The keyword is converted to the wire string (:auto -> "auto", :never -> "never"); when :defer is omitted the field is not sent and the runtime applies its default.

Handler return values:

@@ -1270,13 +1537,14 @@

Customize Mode

-

The :customize mode enables section-level overrides of the system prompt. Ten sections are configurable:

+

The :customize mode enables section-level overrides of the system prompt. Twelve sections are configurable:

- + + @@ -1285,10 +1553,11 @@

Customize Mode

+
Section Description
:identity Agent identity preamble and mode statement
:preamble Agent identity preamble and mode statement (upstream PR #1713)
:identity Section group covering the identity preamble and its sibling sub-sections (tone, tool efficiency, etc.)
:tone Response style, conciseness rules, output formatting
:tool-efficiency Tool usage patterns, parallel calling, batching
:environment-context CWD, OS, git root, directory listing, available tools
:safety Environment limitations, prohibited actions, security
:tool-instructions Per-tool usage instructions
:custom-instructions Repository and organization custom instructions
:runtime-instructions Runtime-provided context (system notifications, memories, mode-specific instructions, content-exclusion policy) — added in upstream PR #1377
:last-instructions End-of-prompt instructions
-

Each section supports static actions (:replace, :remove, :append, :prepend) and transform callbacks (1-arity functions).

+

Each section supports static actions (:replace, :remove, :append, :prepend, :preserve) and transform callbacks (1-arity functions). :preserve is a no-op marker that opts an individually-addressable section out of a group-level :remove — e.g. keep :tone when removing the :identity group (upstream PR #1713).

(require '[github.copilot-sdk :as copilot])
 
 (def session
@@ -1315,9 +1584,15 @@ 

Customize Mode

Inspect available sections with the system-prompt-sections constant:

copilot/system-prompt-sections
-;; => {:identity {:description "Agent identity preamble and mode statement"}
-;;     :tone {:description "Response style, conciseness rules, ..."} ...}
+;; => {:preamble {:description "Agent identity preamble and mode statement"}
+;;     :identity {:description "Section group covering the identity preamble ..."}
+;;     :tone {:description "Response style, conciseness rules, ..."}
+;;     :runtime-instructions {:description "Runtime instructions injected ..."} ...}
 
+

Available section keys: :preamble (added in upstream PR #1713), :identity, :tone, :tool-efficiency, :environment-context, :code-change-rules, :guidelines, :safety, :tool-instructions, :custom-instructions, :runtime-instructions (added in upstream PR #1377), :last-instructions.

+
+

Naming note — Upstream renamed SystemPromptSectionSystemMessageSection in the TypeScript SDK. The Clojure SDK keeps system-prompt-sections as the canonical name (for back-compat) and exposes system-message-sections as an alias.

+

Unknown section keywords are allowed — they gracefully fall back to appending content to additional instructions.

Default Agent Tool Exclusions

Hide tools from the built-in/default agent while keeping them available to custom agents with :default-agent.

@@ -1428,7 +1703,7 @@

Infinite Sessions

Permission Handling

-

The SDK uses a deny-by-default permission model. All permission requests (file writes, shell commands, URL fetches, custom tool execution, etc.) are denied unless your session config provides an :on-permission-request handler (required for create-session and resume-session; optional for join-session which defaults to {:kind :no-result}).

+

The SDK uses a deny-by-default permission model. All permission requests (file writes, shell commands, URL fetches, custom tool execution, etc.) are denied unless your session config provides an :on-permission-request handler. The handler is optional on create-session, resume-session, and join-session (upstream PR #1308): when omitted, permission requests are not auto-resolved and applications must resolve them via handle-pending-permission-request!. join-session historically defaulted to {:kind :no-result} and continues to behave that way.

Use approve-all to opt into approving everything:

(def session (copilot/create-session client
                {:on-permission-request copilot/approve-all}))
@@ -1626,7 +1901,7 @@ 

Session Filesystem (def handler (copilot/create-session-fs-adapter provider))

-

The low-level handler map requires all 10 operations:

+

The low-level handler map requires the 10 core FS operations below. The two :sqlite-* keys are optional and only required when the client advertises :capabilities {:sqlite true} on its :session-fs config (see SQLite support).

@@ -1642,9 +1917,38 @@

Session Filesystem

+ +
Key Params Returns
:readdir-with-types {:session-id :path} {:entries [...]}
:rm {:session-id :path :recursive :force} nil
:rename {:session-id :src :dest} nil
:sqlite-query (optional) {:session-id :query-type :query :params} {:rows [...] :columns [...] :rows-affected n}
:sqlite-exists (optional) {:session-id} {:exists true/false}

Handler functions may return values directly or via core.async channels.

+

SQLite support (optional)

+

To handle sessionFs.sqliteQuery and sessionFs.sqliteExists (upstream PR #1299), add a nested :sqlite map to the provider and advertise the capability on the client config:

+
(def client
+  (copilot/client {:session-fs {:initial-cwd "/home/user/project"
+                                :session-state-path "/sessions"
+                                :conventions "posix"
+                                :capabilities {:sqlite true}}}))
+
+(def session
+  (copilot/create-session client
+    {:on-permission-request copilot/approve-all
+     :create-session-fs-handler
+     (fn [_session]
+       {;; ... all 10 fs operations above ...
+        :sqlite {:query (fn [query-type sql params]
+                          ;; query-type is one of :exec, :query, :run
+                          ;; params is the raw bind-parameter map (keys preserved verbatim, e.g. :$userId)
+                          {:rows [{:n 1}] :columns ["n"] :rows-affected 0})
+                 :exists (fn [] true)}})}))
+
+

Notes:

+
    +
  • :capabilities {:sqlite true} is required when sqlite is advertised; declaring it without supplying :sqlite in the provider throws at session creation.
  • +
  • SQL bind-parameter map keys (e.g. $userId) bypass kebab-case conversion and arrive at the handler verbatim.
  • +
  • Result row column-name keys (e.g. :user_id, :created_at) round-trip verbatim on the outgoing wire path — they are not converted to camelCase, matching upstream Node.js semantics where provider rows are forwarded untouched.
  • +
  • SQLite handler exceptions propagate as JSON-RPC errors (not wrapped as SessionFsError).
  • +

Session Hooks

Lifecycle hooks allow custom logic at various points during the session:

(def session (copilot/create-session client
@@ -1661,11 +1965,45 @@ 

Session Hooks

:on-post-tool-use (fn [input invocation] - ;; Called after each tool execution - ;; input contains {:tool-name "..." :result {...}} + ;; Called after each *successful* tool execution + ;; input contains {:tool-name "..." :tool-args {...} :tool-result {...}} + ;; For failed tool calls, register :on-post-tool-use-failure below. (println "Tool completed:" (:tool-name input)) nil) + :on-post-tool-use-failure + (fn [input invocation] + ;; Called after a tool execution whose result was `"failure"` + ;; (upstream PR #1421). :on-post-tool-use only fires for + ;; successful results, so register this handler to observe + ;; failed tool outcomes. Note: `"rejected"`, `"denied"`, and + ;; `"timeout"` results do NOT currently trigger this hook — + ;; only `"failure"` does. + ;; input contains {:tool-name "..." :tool-args {...} + ;; :error "failure message string" + ;; :session-id "..." :timestamp 12345} + ;; Optional return: {:additional-context "..."} is appended as + ;; hidden guidance to the model alongside the failed result. + ;; Other fields (e.g. :modified-result, :suppress-output) are + ;; not honored for failure hooks. + (println "Tool failed:" (:tool-name input) (:error input)) + {:additional-context "Tip: try `ls` first to see available files."}) + + :on-pre-mcp-tool-call + (fn [input invocation] + ;; Called before each MCP tool call is dispatched (upstream PR #1366). + ;; input contains + ;; {:server-name "..." :tool-name "..." :arguments {...} + ;; :tool-call-id "..." :_meta {...} :session-id "..." + ;; :timestamp 12345} + ;; :arguments and :_meta are opaque MCP payloads and are + ;; passed through verbatim (NOT kebab-cased recursively). + ;; Return nil/{} to preserve the existing _meta on the + ;; outgoing MCP request, {:meta-to-use {...}} to replace + ;; it, or {:meta-to-use nil} to remove it. + (println "Pre-MCP call:" (:server-name input) (:tool-name input)) + {:meta-to-use {:traceId "my-trace-id"}}) + :on-user-prompt-submitted (fn [input invocation] ;; Called when user sends a prompt diff --git a/doc/api/azure-managed-identity.html b/doc/api/azure-managed-identity.html index b12c055..c4d19e4 100644 --- a/doc/api/azure-managed-identity.html +++ b/doc/api/azure-managed-identity.html @@ -1,6 +1,6 @@ -Azure Managed Identity with BYOK

Azure Managed Identity with BYOK

+Azure Managed Identity with BYOK

Azure Managed Identity with BYOK

The Copilot SDK’s BYOK mode accepts static API keys, but Azure deployments often use Managed Identity (Entra ID) instead of long-lived keys. Since the SDK does not natively support Entra ID authentication, you can obtain a short-lived bearer token and pass it via the :bearer-token provider config field.

This guide shows how to use DefaultAzureCredential from the Azure Identity SDK to authenticate with Azure AI Foundry models through the Copilot SDK.

How It Works

diff --git a/doc/api/byok.html b/doc/api/byok.html index 914f6ac..4e0f2cc 100644 --- a/doc/api/byok.html +++ b/doc/api/byok.html @@ -1,6 +1,6 @@ -BYOK (Bring Your Own Key)

BYOK (Bring Your Own Key)

+BYOK (Bring Your Own Key)

BYOK (Bring Your Own Key)

BYOK allows you to use the Copilot SDK with your own API keys from model providers, bypassing GitHub Copilot authentication. This is useful for enterprise deployments, custom model hosting, or when you want direct billing with your model provider.

Supported Providers

@@ -94,6 +94,8 @@

:provider F

+ +
:wire-api keyword No :completions or :responses (default: :completions)
:api-key string No API key (optional for local providers like Ollama)
:bearer-token string No Bearer token auth (takes precedence over :api-key)
:bearer-token-provider fn No Dynamic bearer-token callback. See Dynamic Bearer Tokens. (upstream PR #1748)
:transport keyword No :http or :websockets — provider transport. (upstream PR #1711)
:azure-options map No Azure-specific options (see below)
@@ -140,6 +142,48 @@

:base-url "https://my-custom-endpoint.example.com/v1" :bearer-token (System/getenv "MY_BEARER_TOKEN")}}

+

Dynamic Bearer Tokens

+
+

Experimental (upstream PR #1748) — not part of the stable SDK API.

+
+

When a provider needs a token that rotates or is minted per-request, supply a :bearer-token-provider callback instead of a static :bearer-token. The SDK strips the function before serializing (sending hasBearerTokenProvider true on the wire) and invokes it on demand when the runtime requests a token.

+

The callback receives a map with :provider-name and :session-id and must return a token string:

+
(require '[github.copilot-sdk :as copilot])
+
+(def session
+  (copilot/create-session client
+    {:model "my-model"
+     :on-permission-request copilot/approve-all
+     :provider {:provider-type :openai
+                :base-url "https://my-custom-endpoint.example.com/v1"
+                :bearer-token-provider
+                (fn [{:keys [provider-name session-id]}]
+                  (mint-fresh-token! provider-name))}}))
+
+

The callback must return a string. A non-string return is rejected and the token value is never logged.

+

Multi-Provider Registry

+
+

Experimental (upstream PR #1718) — not part of the stable SDK API.

+
+

To declare several named providers and a catalog of models that reference them, use :providers (a vector of named providers) with :models (a vector of model entries). Each named provider takes the same fields as :provider plus a required :name (the registry key, which must not contain /). Each model entry has a required :id (provider-local model id) and :provider (a name in :providers); the full model selection id is "providerName/id".

+
(require '[github.copilot-sdk :as copilot])
+
+(def session
+  (copilot/create-session client
+    {:on-permission-request copilot/approve-all
+     :providers [{:name "openai"
+                  :provider-type :openai
+                  :base-url "https://api.openai.com/v1"
+                  :api-key (System/getenv "OPENAI_API_KEY")}
+                 {:name "anthropic"
+                  :provider-type :anthropic
+                  :base-url "https://api.anthropic.com"
+                  :api-key (System/getenv "ANTHROPIC_API_KEY")}]
+     :models [{:id "gpt-5.4" :provider "openai"}
+              {:id "claude-sonnet-4.5" :provider "anthropic"}]
+     :model "openai/gpt-5.4"}))
+
+

:providers cannot be combined with the singular :provider.

Limitations

Identity Limitations

BYOK authentication uses static credentials that you supply (API keys or bearer tokens); it does not natively perform Entra ID, OIDC, or managed identity flows. However, you can use DefaultAzureCredential to obtain a short-lived bearer token and pass it via :bearer-token. See the Azure Managed Identity workaround for details.

diff --git a/doc/api/codegen.html b/doc/api/codegen.html index cd6e54e..53f97d9 100644 --- a/doc/api/codegen.html +++ b/doc/api/codegen.html @@ -1,6 +1,6 @@ -Schema-Driven Code Generation

Schema-Driven Code Generation

+Schema-Driven Code Generation

Schema-Driven Code Generation

The Clojure SDK generates portions of its clojure.spec registry from the upstream @github/copilot JSON Schemas instead of maintaining them by hand. This guarantees the SDK’s view of the wire protocol cannot drift from what the Copilot CLI actually emits.

What is generated

Source files under src/github/copilot_sdk/generated/ are produced by the generator in script/codegen/. Currently:

diff --git a/doc/api/custom-agents.html b/doc/api/custom-agents.html index 9ea95c7..531a298 100644 --- a/doc/api/custom-agents.html +++ b/doc/api/custom-agents.html @@ -1,6 +1,6 @@ -Custom Agents & Sub-Agent Orchestration

Custom Agents & Sub-Agent Orchestration

+Custom Agents & Sub-Agent Orchestration

Custom Agents & Sub-Agent Orchestration

Define specialized agents with scoped tools and prompts, then let Copilot orchestrate them as sub-agents within a single session.

Overview

Custom agents are lightweight agent definitions attached to a session. Each agent has its own system prompt, tool restrictions, and optional MCP servers. When a user’s request matches an agent’s expertise, the Copilot runtime automatically delegates to that agent as a sub-agent — running it in an isolated context while streaming lifecycle events back to the parent session.

diff --git a/doc/api/debugging.html b/doc/api/debugging.html index f9d52e3..2a5bd11 100644 --- a/doc/api/debugging.html +++ b/doc/api/debugging.html @@ -1,6 +1,6 @@ -MCP Server Debugging Guide

MCP Server Debugging Guide

+MCP Server Debugging Guide

MCP Server Debugging Guide

This guide covers debugging techniques specific to MCP (Model Context Protocol) servers when using the Copilot SDK for Clojure.

Quick Diagnostics

Checklist

diff --git a/doc/api/getting-started.html b/doc/api/getting-started.html index 57cfd6b..f475c05 100644 --- a/doc/api/getting-started.html +++ b/doc/api/getting-started.html @@ -1,8 +1,8 @@ -Getting Started with the Copilot SDK for Clojure

Getting Started with the Copilot SDK for Clojure

+Getting Started with the Copilot SDK for Clojure

Getting Started with the Copilot SDK for Clojure

-

Note: This SDK is in public preview and may change in breaking ways.

+

Note: Version 1.0.0.0 is the first generally available (GA) release (tracking upstream github/copilot-sdk v1.0.0). The public API is stable. Subsequent releases follow the upstream versioning scheme (see Versioning); any breaking changes are called out in the CHANGELOG.

In this tutorial, you’ll use the Copilot SDK for Clojure to build a command-line assistant. You’ll start with the basics, add streaming responses, then add custom tools — giving Copilot the ability to call your code.

What you’ll build:

@@ -25,12 +25,12 @@

Prerequisites

Step 1: Add the SDK Dependency

Add to your deps.edn:

-
{:deps {io.github.copilot-community-sdk/copilot-sdk-clojure {:mvn/version "0.2.1.1-SNAPSHOT"}}}
+
{:deps {io.github.copilot-community-sdk/copilot-sdk-clojure {:mvn/version "1.0.4.0"}}}
 

Or use as a Git dependency:

{:deps {io.github.copilot-community-sdk/copilot-sdk-clojure
         {:git/url "https://github.com/copilot-community-sdk/copilot-sdk-clojure"
-         :git/sha "7a30402b9bd843494752c46a18ff7f2fec27a620"}}}
+         :git/sha "169015a303443713a733b84a1d69623d83d20688"}}}
 

Step 2: Send Your First Message

The simplest way to use the SDK — about 3 lines of code:

@@ -119,7 +119,7 @@

Ev (copilot/events session) Get the core.async mult for all events (copilot/subscribe-events session) Get a tapped channel (convenience) - (copilot/unsubscribe-events session ch) Untap a channel + (copilot/unsubscribe-events! session ch) Untap a channel (copilot/events->chan session opts) Advanced: custom buffer, transducer diff --git a/doc/api/github.copilot-sdk.client.html b/doc/api/github.copilot-sdk.client.html index a61e64e..6482c0c 100644 --- a/doc/api/github.copilot-sdk.client.html +++ b/doc/api/github.copilot-sdk.client.html @@ -1,13 +1,14 @@ -github.copilot-sdk.client documentation

github.copilot-sdk.client

CopilotClient - manages connection to the Copilot CLI server.

+github.copilot-sdk.client documentation

github.copilot-sdk.client

CopilotClient - manages connection to the Copilot CLI server.

<create-session

(<create-session client config)

Async version of create-session. Returns a channel that delivers a CopilotSession.

-

Same config options as create-session (:on-permission-request is required). Validation is performed synchronously (throws immediately on invalid config). The RPC call parks instead of blocking, making this safe to use inside go blocks.

+

Same config options as create-session (:on-permission-request is optional since upstream PR #1308). Validation is performed synchronously (throws immediately on invalid config). The RPC call parks instead of blocking, making this safe to use inside go blocks.

On RPC error, delivers an ExceptionInfo to the channel (not nil). Callers should check the result with (instance? Throwable result).

+

Note: the sessionFs + cloud-no-id constraint described on create-session applies symmetrically here — when :cloud is set without a :session-id and the client has :session-fs enabled, the :create-session-fs-handler factory runs on the reader thread inside an inline-response callback and must be non-blocking (no further RPCs / no session-event waits).

Usage: (go (let result (<! (<create-session client {:on-permission-request copilot/approve-all :model “gpt-5.4”})) (if (instance? Throwable result) (println “Error:” (ex-message result)) ;; use result as session )))

<resume-session

(<resume-session client session-id config)

Async version of resume-session. Returns a channel that delivers a CopilotSession.

-

Same config options as resume-session (:on-permission-request is required). Validation is performed synchronously (throws immediately on invalid config). The RPC call parks instead of blocking, making this safe to use inside go blocks.

+

Same config options as resume-session (:on-permission-request is optional since upstream PR #1308). Validation is performed synchronously (throws immediately on invalid config). The RPC call parks instead of blocking, making this safe to use inside go blocks.

On RPC error, delivers an ExceptionInfo to the channel (not nil). Callers should check the result with (instance? Throwable result).

Usage: (go (let

client

Create a new CopilotClient.

-

Options: - :cli-path - Path to CLI executable (default: “copilot”) - :cli-args - Extra arguments for CLI - :cli-url - URL of existing server (e.g., “localhost:8080”) - :cwd - Working directory for CLI process - :port - TCP port (default: 0 for random) - :use-stdio? - Use stdio transport (default: true) - :log-level - :none :error :warning :info :debug :all - :auto-start? - Auto-start on first use (default: true) - :auto-restart? - DEPRECATED: This option has no effect and will be removed in a future release. - :notification-queue-size - Max queued protocol notifications (default: 4096) - :router-queue-size - Max queued non-session notifications (default: 4096) - :tool-timeout-ms - Timeout for tool calls that return a channel (default: 120000) - :env - Environment variables map - :github-token - GitHub token for authentication (sets COPILOT_SDK_AUTH_TOKEN env var) - :use-logged-in-user? - Whether to use logged-in user auth (default: true, false when github-token provided) - :is-child-process? - When true, SDK is a child of an existing Copilot CLI process and uses stdio to communicate with it (no process spawning) - :on-list-models - Zero-arg fn returning a seq of model info maps; bypasses the RPC call and does not require start! - :telemetry - OpenTelemetry config map with optional keys :otlp-endpoint, :file-path, :exporter-type, :source-name, :capture-content? - :on-get-trace-context - Zero-arg fn returning {:traceparent … :tracestate …} for distributed trace propagation

+

Options: - :cli-path - Path to CLI executable (default: “copilot”) - :cli-args - Extra arguments for CLI - :cli-url - URL of existing server (e.g., “localhost:8080”) - :cwd - Working directory for CLI process - :port - TCP port (default: 0 for random) - :use-stdio? - Use stdio transport (default: true) - :log-level - :none :error :warning :info :debug :all - :auto-start? - Auto-start on first use (default: true) - :auto-restart? - DEPRECATED: This option has no effect and will be removed in a future release. - :notification-queue-size - Max queued protocol notifications (default: 4096) - :router-queue-size - Max queued non-session notifications (default: 4096) - :tool-timeout-ms - Timeout for tool calls that return a channel (default: 120000) - :env - Environment variables map - :github-token - GitHub token for authentication (sets COPILOT_SDK_AUTH_TOKEN env var) - :use-logged-in-user? - Whether to use logged-in user auth (default: true, false when github-token provided) - :is-child-process? - When true, SDK is a child of an existing Copilot CLI process and uses stdio to communicate with it (no process spawning) - :on-list-models - Zero-arg fn returning a seq of model info maps; bypasses the RPC call and does not require start! - :telemetry - OpenTelemetry config map with optional keys :otlp-endpoint, :otlp-protocol, :file-path, :exporter-type, :source-name, :capture-content?. :otlp-protocol is “http/json” or “http/protobuf” and sets OTEL_EXPORTER_OTLP_PROTOCOL. - :on-get-trace-context - Zero-arg fn returning {:traceparent … :tracestate …} for distributed trace propagation - :session-idle-timeout-seconds - Server-wide session idle timeout in seconds. When > 0, the SDK appends --session-idle-timeout <n> to the spawned CLI so idle sessions are cleaned up after the given duration. Default: disabled. - :remote? - Experimental. Enable remote session support (Mission Control). When true, the SDK appends --remote to the spawned CLI; sessions in a GitHub repository working directory become accessible from GitHub web and mobile. Ignored when :cli-url is set. (upstream PR #1192) - :mode - Client mode (upstream PR #1428). One of: - :copilot-cli (default) — preserves historical CLI behavior. - :empty — multitenancy hardening for hosts running sessions on behalf of multiple users. Empty mode REQUIRES one of :copilot-home, :session-fs, :cli-url, or :is-child-process? so the runtime has a tenant-scoped storage root. It also forces COPILOT_DISABLE_KEYTAR=1 on the spawned CLI, spreads safe defaults under each session’s config (telemetry off, host-git operations disabled, …), strips the :environment-context section from system messages unless the caller already controls it, and requires every session to specify :available-tools.

create-session

Create a new conversation session.

-

Config options (:on-permission-request is required): - :on-permission-request - Permission handler function (required, e.g. approve-all) - :session-id - Custom session ID - :client-name - Client name to identify the application (included in User-Agent header) - :model - Model to use (e.g., “gpt-5.4”) - :tools - Vector of tool definitions - :commands - Vector of command definitions (slash commands for TUI) - :system-message - System message config - :available-tools - List of allowed tool names - :excluded-tools - List of excluded tool names - :provider - Custom provider config (BYOK) - :streaming? - Enable streaming - :mcp-servers - MCP server configs map - :custom-agents - Custom agent configs - :default-agent - Built-in agent config, e.g. {:excluded-tools “private_tool”} - :config-dir - Override config directory for CLI (configDir) - :skill-directories - Additional skill directories to load - :disabled-skills - Disable specific skills by name - :large-output - (Experimental) Tool output handling config {:enabled :max-size-bytes :output-dir} Note: CLI protocol feature, not in official SDK. outputDir may be ignored. - :working-directory - Working directory for the session (tool operations relative to this) - :infinite-sessions - Infinite session config for automatic context compaction {:enabled (default true) :background-compaction-threshold (0.0-1.0, default 0.80) :buffer-exhaustion-threshold (0.0-1.0, default 0.95)} - :reasoning-effort - Reasoning effort level: “low”, “medium”, “high”, or “xhigh” (PR #302) - :github-token - GitHub token for this session (sent as gitHubToken) - :on-user-input-request - Handler for ask_user requests (PR #269) - :on-elicitation-request - Handler for elicitation requests from the agent (upstream PRs #908, #960). When provided, sends requestElicitation=true and enables the elicitation capability. Single-arg handler receives an ElicitationContext map with :session-id, :message, :requested-schema, :mode, :elicitation-source, :url. Returns an ElicitationResult map. - :hooks - Lifecycle hooks map (PR #269): {:on-pre-tool-use, :on-post-tool-use, :on-user-prompt-submitted, :on-session-start, :on-session-end, :on-error-occurred} - :on-event - Event handler (1-arg fn) registered before the RPC call. Guarantees early events like session.start are not missed. - :enable-config-discovery - Boolean. Auto-discover .mcp.json, .vscode/mcp.json, skills, etc. Instruction files are always loaded regardless. (upstream PR #1044) - :model-capabilities - Model capabilities override map (upstream PR #1029). DeepPartial of model capabilities, e.g. {:model-supports {:supports-vision true}} - :include-sub-agent-streaming-events? - Boolean. When true (default), streaming events from sub-agents are forwarded to this session’s event stream. (upstream PR #1108)

+

Config options (:on-permission-request is optional since upstream PR #1308 — omit it to leave permission requests pending for manual resolution via copilot/handle-pending-permission-request!): - :on-permission-request - Permission handler function (optional, e.g. approve-all). When omitted, permission requests are surfaced as :copilot/permission.requested events and remain pending until resolved by the application. - :session-id - Custom session ID - :client-name - Client name to identify the application (included in User-Agent header) - :model - Model to use (e.g., “gpt-5.4”) - :tools - Vector of tool definitions - :commands - Vector of command definitions (slash commands for TUI) - :system-message - System message config - :available-tools - List of allowed tool names - :excluded-tools - List of excluded tool names - :provider - Custom provider config (BYOK) - :streaming? - Enable streaming - :mcp-servers - MCP server configs map - :custom-agents - Custom agent configs - :default-agent - Built-in agent config, e.g. {:excluded-tools “private_tool”} - :config-dir - Override config directory for CLI (configDir) - :skill-directories - Additional skill directories to load - :disabled-skills - Disable specific skills by name - :large-output - (Experimental) Tool output handling config {:enabled :max-size-bytes :output-dir} Note: CLI protocol feature, not in official SDK. outputDir may be ignored. - :working-directory - Working directory for the session (tool operations relative to this) - :infinite-sessions - Infinite session config for automatic context compaction {:enabled (default true) :background-compaction-threshold (0.0-1.0, default 0.80) :buffer-exhaustion-threshold (0.0-1.0, default 0.95)} - :memory - Persistent memory config {:enabled boolean} (upstream PR #1617). Sent on both create and resume; omitted when unset. - :reasoning-effort - Reasoning effort level: “low”, “medium”, “high”, or “xhigh” (PR #302) - :github-token - GitHub token for this session (sent as gitHubToken) - :on-user-input-request - Handler for ask_user requests (PR #269) - :on-elicitation-request - Handler for elicitation requests from the agent (upstream PRs #908, #960). When provided, sends requestElicitation=true and enables the elicitation capability. Single-arg handler receives an ElicitationContext map with :session-id, :message, :requested-schema, :mode, :elicitation-source, :url. Returns an ElicitationResult map. - :hooks - Lifecycle hooks map (PR #269): {:on-pre-tool-use, :on-pre-mcp-tool-call, :on-post-tool-use, :on-post-tool-use-failure, :on-user-prompt-submitted, :on-session-start, :on-session-end, :on-error-occurred} See doc/reference/API.md for hook input/output shapes. :on-pre-mcp-tool-call (upstream PR #1366) fires before an MCP tool call is dispatched; handler returning {:meta-to-use {...}} replaces the request _meta, {:meta-to-use nil} removes it, and an empty / missing :meta-to-use preserves the existing _meta. :on-post-tool-use-failure (upstream PR #1421) fires after a tool execution whose :result-type was "failure"; :on-post-tool-use only fires for successful results. Handler input has :tool-name, :tool-args, :error (string), plus base hook fields. Optional output: {:additional-context "..."}. - :on-event - Event handler (1-arg fn) registered before the RPC call. Guarantees early events like session.start are not missed. - :enable-config-discovery - Boolean. Auto-discover .mcp.json, .vscode/mcp.json, skills, etc. Instruction files are always loaded regardless. (upstream PR #1044) - :model-capabilities - Model capabilities override map (upstream PR #1029). DeepPartial of model capabilities, e.g. {:model-supports {:supports-vision true}} - :include-sub-agent-streaming-events? - Boolean. When true (default), streaming events from sub-agents are forwarded to this session’s event stream. (upstream PR #1108) - :remote-session - Keyword. Per-session Mission Control remote mode: :off, :export, or :on. Forwarded as remoteSession on session.create. When omitted, the CLI applies its default. (upstream PR #1295, CLI 1.0.48) - :cloud - Map. Creates a remote session in the cloud instead of a local session. Optional :repository associates the cloud session with a GitHub repository: {:repository {:owner "..." :name "..." :branch "..."}}. :branch is optional. Forwarded as cloud on session.create. (upstream PR #1306)

+
                    When `:cloud` is set and no `:session-id` is provided, the server
+                    assigns a sessionId and the SDK registers the session under that
+                    id; the session is registered synchronously before any subsequent
+                    server-initiated requests can be dispatched (upstream PR #1479).
+
+                    **Important — sessionFs + cloud-no-id contract:** when the client
+                    is constructed with `:session-fs` enabled AND this call defers the
+                    session id to the server (cloud + no `:session-id`), the
+                    `:create-session-fs-handler` factory is invoked **on the JSON-RPC
+                    reader thread** inside an inline-response callback (so the session
+                    is registered before subsequent notifications). The factory MUST be
+                    a fast, non-blocking constructor and MUST NOT call back into the
+                    SDK (no further RPCs, no waiting on session events) — doing so
+                    deadlocks the reader thread. The factory call is unconstrained on
+                    every other path (standard local sessions, cloud-with-caller-id,
+                    and resume), where it runs on the caller's thread.
+

Returns a CopilotSession.

default-join-session-permission-handler

(default-join-session-permission-handler _request _ctx)

Default permission handler for resuming sessions.

Returns {:kind :no-result} — the CLI handles permission decisions itself. When used with resume-session, tells the CLI that this client does NOT want to handle permission requests (requestPermission: false on the wire).

@@ -35,6 +53,7 @@

get-foreground-session-id

(get-foreground-session-id client)

Get the foreground session ID (TUI+server mode). Returns the session ID or nil if none.

get-last-session-id

(get-last-session-id client)

Get the ID of the most recently updated session.

get-quota

(get-quota client)

Get account quota information. Returns a map of quota type (string) to quota snapshot maps: {:entitlement-requests :used-requests :remaining-percentage :overage :overage-allowed-with-exhausted-quota? :reset-date}

+

Experimental: not part of the official Copilot SDK API; the wire RPC (account.getQuota) is exposed for convenience and may change.

get-session-metadata

(get-session-metadata client session-id)

Gets metadata for a specific session by ID.

Provides an efficient O(1) lookup of a single session’s metadata instead of listing all sessions and filtering client-side.

Returns the session metadata map if found, or nil if not found.

@@ -45,9 +64,10 @@

Config is the same as resume-session. :on-permission-request is optional; when omitted, a default handler is used that returns {:kind :no-result}, leaving any pending permission request unanswered (appropriate for most extensions that use :skip-permission? on their tools or do not require permission handling). The :disable-resume? option defaults to true.

Returns a map with :client and :session keys. The caller is responsible for stopping the client when done.

Throws if SESSION_ID is not set in the environment.

-

list-models

(list-models client)

List available models with their metadata. Results are cached per client connection to prevent rate limiting under concurrency. Cache is cleared on stop!/force-stop!. When :on-list-models handler is provided in client options, calls the handler instead of the RPC method. The handler does not require a CLI connection. Requires authentication (unless :on-list-models handler is provided). Returns a vector of model info maps with keys: :id :name :vendor :family :version :max-input-tokens :max-output-tokens :preview? :default-temperature :model-picker-priority :model-capabilities {:model-supports {:supports-vision :supports-reasoning-effort} :model-limits {:max-prompt-tokens :max-context-window-tokens :vision-capabilities {:supported-media-types :max-prompt-images :max-prompt-image-size}}} :model-policy {:policy-state :terms} :model-billing {:multiplier} :supported-reasoning-efforts :default-reasoning-effort :supports-reasoning-effort (legacy flat key) :vision-limits {:supported-media-types :max-prompt-images :max-prompt-image-size} (legacy)

+

list-models

(list-models client)

List available models with their metadata. Results are cached per client connection to prevent rate limiting under concurrency. Cache is cleared on stop!/force-stop!. When :on-list-models handler is provided in client options, calls the handler instead of the RPC method. The handler does not require a CLI connection. Requires authentication (unless :on-list-models handler is provided). Returns a vector of model info maps with keys: :id :name :vendor :family :version :max-input-tokens :max-output-tokens :preview? :default-temperature :model-picker-priority :model-picker-category :model-picker-price-category :model-capabilities {:model-supports {:supports-vision :supports-reasoning-effort} :model-limits {:max-prompt-tokens :max-context-window-tokens :vision-capabilities {:supported-media-types :max-prompt-images :max-prompt-image-size}}} :model-policy {:policy-state :terms} :model-billing {:multiplier :token-prices {:input-price :output-price :cache-price :batch-size :context-max :long-context {:input-price :output-price :cache-price :context-max}}} :supported-reasoning-efforts :default-reasoning-effort :supports-reasoning-effort (legacy flat key) :vision-limits {:supported-media-types :max-prompt-images :max-prompt-image-size} (legacy)

list-sessions

(list-sessions client)(list-sessions client filter-opts)

List all available sessions. Returns a vector of session metadata maps. Optional filter map narrows results by context fields: {:cwd :git-root :repository :branch}

list-tools

(list-tools client)(list-tools client model)

List available tools with their metadata. Optional :model param returns model-specific tool overrides. Returns a vector of tool info maps with keys: :name :namespaced-name :description :parameters :instructions

+

Experimental: not part of the official Copilot SDK API; the wire RPC (tools.list) is exposed for convenience and may change.

mcp-config-add!

(mcp-config-add! client params)

Add an MCP server configuration. params is a map with server config using plain keys (:name, :command, :args, :tools, etc.) — NOT the :mcp-prefixed keys used in session config :mcp-servers.

mcp-config-list

(mcp-config-list client)

List all MCP server configurations. Returns a map with :servers (vector of server config maps).

mcp-config-remove!

(mcp-config-remove! client params)

Remove an MCP server configuration. params is a map identifying the server using plain keys (see mcp-config-add!).

@@ -59,13 +79,15 @@

Returns an unsubscribe function (call with no args to remove the handler).

options

(options client)

Get the client options that were used to create this client. Returns the user-provided options merged with defaults. Note: This reflects SDK configuration, not necessarily server state.

ping

(ping client)(ping client message)

Ping the server to check connectivity. Returns {:message :timestamp :protocol-version}.

+

:timestamp is either an ISO 8601 date-time string (e.g. “2026-05-21T08:00:00Z”; CLI ≥ 1.0.51, upstream PR #1340) or a numeric epoch-millis value, depending on the CLI version; the SDK forwards whatever the server sends.

resume-session

(resume-session client session-id config)

Resume an existing session by ID.

-

Config options (:on-permission-request is required): - :on-permission-request - Permission handler function (required, e.g. approve-all) - :client-name - Client name to identify the application (included in User-Agent header) - :model - Change the model for the resumed session - :tools - Tools exposed to the CLI server - :system-message - System message configuration {:mode :content} - :available-tools - List of tool names to allow - :excluded-tools - List of tool names to disable - :provider - Custom provider configuration (BYOK) - :streaming? - Enable streaming responses - :mcp-servers - MCP server configurations - :custom-agents - Custom agent configurations - :default-agent - Built-in agent config, e.g. {:excluded-tools “private_tool”} - :config-dir - Override configuration directory - :skill-directories - Directories to load skills from - :disabled-skills - Skills to disable - :infinite-sessions - Infinite session configuration - :reasoning-effort - Reasoning effort level: “low”, “medium”, “high”, or “xhigh” - :github-token - GitHub token for this session (sent as gitHubToken) - :on-user-input-request - Handler for ask_user requests - :on-elicitation-request - Handler for elicitation requests (upstream PRs #908, #960). Single-arg handler receives an ElicitationContext map with :session-id, :message, :requested-schema, :mode, :elicitation-source, :url. Returns an ElicitationResult map. - :hooks - Lifecycle hooks map - :on-event - Event handler (1-arg fn) registered before the RPC call. Guarantees early events like session.start are not missed. - :enable-config-discovery - Boolean. Auto-discover .mcp.json, skills, etc. (upstream PR #1044) - :model-capabilities - Model capabilities override map (upstream PR #1029). - :include-sub-agent-streaming-events? - Boolean. When true (default), streaming events from sub-agents are forwarded to this session’s event stream. (upstream PR #1108)

+

Config options (:on-permission-request is optional since upstream PR #1308 — omit it to leave permission requests pending for manual resolution via copilot/handle-pending-permission-request!): - :on-permission-request - Permission handler function (optional, e.g. approve-all). When omitted, permission requests are surfaced as :copilot/permission.requested events and remain pending until resolved by the application. - :client-name - Client name to identify the application (included in User-Agent header) - :model - Change the model for the resumed session - :tools - Tools exposed to the CLI server - :system-message - System message configuration {:mode :content} - :available-tools - List of tool names to allow - :excluded-tools - List of tool names to disable - :provider - Custom provider configuration (BYOK) - :streaming? - Enable streaming responses - :mcp-servers - MCP server configurations - :custom-agents - Custom agent configurations - :default-agent - Built-in agent config, e.g. {:excluded-tools “private_tool”} - :config-dir - Override configuration directory - :skill-directories - Directories to load skills from - :disabled-skills - Skills to disable - :infinite-sessions - Infinite session configuration - :memory - Persistent memory config {:enabled boolean} (upstream PR #1617). Parity with create-session; omitted when unset. - :reasoning-effort - Reasoning effort level: “low”, “medium”, “high”, or “xhigh” - :github-token - GitHub token for this session (sent as gitHubToken) - :on-user-input-request - Handler for ask_user requests - :on-elicitation-request - Handler for elicitation requests (upstream PRs #908, #960). Single-arg handler receives an ElicitationContext map with :session-id, :message, :requested-schema, :mode, :elicitation-source, :url. Returns an ElicitationResult map. - :hooks - Lifecycle hooks map - :on-event - Event handler (1-arg fn) registered before the RPC call. Guarantees early events like session.start are not missed. - :enable-config-discovery - Boolean. Auto-discover .mcp.json, skills, etc. (upstream PR #1044) - :model-capabilities - Model capabilities override map (upstream PR #1029). - :include-sub-agent-streaming-events? - Boolean. When true (default), streaming events from sub-agents are forwarded to this session’s event stream. (upstream PR #1108) - :enable-session-telemetry? - Boolean. See create-session (upstream PR #1224). - :on-exit-plan-mode - Handler for exitPlanMode.request RPCs. See create-session (upstream PR #1228). - :on-auto-mode-switch - Handler for autoModeSwitch.request RPCs. See create-session (upstream PR #1228).

Returns a CopilotSession.

set-foreground-session-id!

(set-foreground-session-id! client session-id)

Set the foreground session (TUI+server mode). Requests the TUI to switch to displaying the specified session.

start!

(start! client)

Start the CLI server and establish connection. Blocks until connected or throws on error.

-

Thread safety: do not call start! and stop! concurrently from different threads. The :stopping? flag guards against concurrent calls, but explicit concurrent calls are unsupported.

+

Thread safety: concurrent start! calls are safe — an atomic compare-and-set on :status ensures only one caller spawns the process; the others no-op. Do not, however, call start! and stop! concurrently from different threads.

state

(state client)

Get the current connection state.

stop!

(stop! client)

Stop the CLI server and close all sessions. Returns a vector of any errors encountered during cleanup.

+

Performs graceful cleanup in order: disconnect sessions, request runtime.shutdown for SDK-owned CLI processes (bounded by a 10s timeout), close the connection and socket, then terminate the process. When the runtime.shutdown request succeeds, the child is given up to 10s to exit on its own before being force-killed. External runtimes (:external-server?) are never asked to shut down — only the connection to them is closed. Use force-stop! to skip graceful shutdown.

Thread safety: do not call start! and stop! concurrently from different threads. Auto-restart is suppressed via the :stopping? flag, but explicit concurrent calls are unsupported.

\ No newline at end of file diff --git a/doc/api/github.copilot-sdk.generated.coerce.html b/doc/api/github.copilot-sdk.generated.coerce.html index 45d8beb..7785210 100644 --- a/doc/api/github.copilot-sdk.generated.coerce.html +++ b/doc/api/github.copilot-sdk.generated.coerce.html @@ -1,6 +1,6 @@ -github.copilot-sdk.generated.coerce documentation

github.copilot-sdk.generated.coerce

AUTO-GENERATED — do not edit. Run bb codegen.

+github.copilot-sdk.generated.coerce documentation

github.copilot-sdk.generated.coerce

AUTO-GENERATED — do not edit. Run bb codegen.

Per-event-type coercion between the upstream wire shape and the Clojure-idiomatic public API. Source: script/codegen/coercions.edn

coerce-data

(coerce-data event-type data direction)

Apply coercions to a data map for the given event-type and direction (:wire->idiom or :idiom->wire). Unknown event types and unknown fields pass through unchanged. Each converter is nil-safe and idempotent so the same coercion can be applied twice without corruption.

If a converter throws (e.g. malformed wire payload), the exception is re-thrown as ex-info with :event-type, :field, and :direction added to ex-data so callers can diagnose without inspecting the converter source.

diff --git a/doc/api/github.copilot-sdk.generated.event-specs.html b/doc/api/github.copilot-sdk.generated.event-specs.html index 9dd5785..e2c3fd5 100644 --- a/doc/api/github.copilot-sdk.generated.event-specs.html +++ b/doc/api/github.copilot-sdk.generated.event-specs.html @@ -1,6 +1,6 @@ -github.copilot-sdk.generated.event-specs documentation

github.copilot-sdk.generated.event-specs

AUTO-GENERATED. clojure.spec definitions for upstream session events.

+github.copilot-sdk.generated.event-specs documentation

github.copilot-sdk.generated.event-specs

AUTO-GENERATED. clojure.spec definitions for upstream session events.

Each event variant’s data payload is registered under ::<event-type>-data (e.g. ::session.start-data). The envelope (id/timestamp/parentId/type/data) is registered under ::<event-type> (e.g. ::session.start).

Source: schemas/session-events.schema.json

event-mm

multimethod

event-types

Set of all event-type strings known to the schema.

diff --git a/doc/api/github.copilot-sdk.helpers.html b/doc/api/github.copilot-sdk.helpers.html index 5068d15..7f37eba 100644 --- a/doc/api/github.copilot-sdk.helpers.html +++ b/doc/api/github.copilot-sdk.helpers.html @@ -1,6 +1,6 @@ -github.copilot-sdk.helpers documentation

github.copilot-sdk.helpers

Convenience functions for simple, stateless queries to Copilot.

+github.copilot-sdk.helpers documentation

github.copilot-sdk.helpers

Convenience functions for simple, stateless queries to Copilot.

This namespace provides a higher-level API inspired by Claude Agent SDK’s query() function. It manages a shared client internally to avoid CLI startup overhead across multiple queries.

Quick Start

(require '[github.copilot-sdk.helpers :as h])
diff --git a/doc/api/github.copilot-sdk.html b/doc/api/github.copilot-sdk.html
index d247158..46f14e2 100644
--- a/doc/api/github.copilot-sdk.html
+++ b/doc/api/github.copilot-sdk.html
@@ -1,6 +1,6 @@
 
-github.copilot-sdk documentation

github.copilot-sdk

Clojure SDK for programmatic control of GitHub Copilot CLI via JSON-RPC.

+github.copilot-sdk documentation

github.copilot-sdk

Clojure SDK for programmatic control of GitHub Copilot CLI via JSON-RPC.

Quick Start:

(require '[github.copilot-sdk :as copilot])
 
@@ -30,6 +30,8 @@
       (let [answer (<! (copilot/<send! result {:prompt "Hello"}))]
         (println answer)))))
 
+

<handle-pending-permission-request!

(<handle-pending-permission-request! session opts)

core.async variant of handle-pending-permission-request!. Returns a channel.

+

<handle-pending-tool-call!

(<handle-pending-tool-call! session opts)

core.async variant of handle-pending-tool-call!. Returns a channel.

<resume-session

(<resume-session client session-id config)

Async version of resume-session. Returns a channel that delivers a CopilotSession.

Validation is synchronous (throws immediately on invalid config). The RPC call parks instead of blocking, making this safe inside go blocks. On RPC error, delivers an ExceptionInfo (check with (instance? Throwable result)).

Example:

@@ -46,6 +48,14 @@ (let [answer (<! (copilot/<send! session {:prompt "What is 2+2?"}))] (println answer)))
+

<send-and-wait!

(<send-and-wait! session opts)

Send a message and return a channel that delivers the final assistant message event - the channel-based equivalent of send-and-wait!. Use it inside go blocks instead of blocking a dispatch thread. Unlike <send! (which delivers the final content string), this delivers the full assistant message event.

+

Options: same as send!, plus: - :timeout-ms - Timeout in milliseconds (default: 300000, set to nil to disable)

+

The returned channel delivers a single value (the final assistant message event, or nothing if none was received) then closes.

+

Example:

+
(go
+  (let [event (<! (copilot/<send-and-wait! session {:prompt "What is 2+2?"}))]
+    (println (get-in event [:data :content]))))
+

abort!

(abort! session)

Abort the currently processing message in this session.

approve-all

Permission handler that approves all requests with {:kind :approve-once}. See github.copilot-sdk.client/approve-all.

assistant-events

Assistant response events.

@@ -55,7 +65,7 @@ ;; => {:ui {:elicitation true}}

client

(client)(client opts)

Create a new CopilotClient.

-

Options: - :cli-path - Path to CLI executable (default: “copilot”) - :cli-args - Extra arguments for CLI - :cli-url - URL of existing server (e.g., “localhost:8080”) - :cwd - Working directory for CLI process - :port - TCP port (default: 0 for random) - :use-stdio? - Use stdio transport (default: true) - :log-level - :none :error :warning :info :debug :all - :auto-start? - Auto-start on first use (default: true) - :auto-restart? - DEPRECATED: This option has no effect and will be removed in a future release. - :env - Environment variables map - :telemetry - OpenTelemetry config map with :otlp-endpoint, :file-path, :exporter-type, :source-name, :capture-content? - :on-get-trace-context - Zero-arg fn returning {:traceparent … :tracestate …}

+

Options: - :cli-path - Path to CLI executable (default: “copilot”) - :cli-args - Extra arguments for CLI - :cli-url - URL of existing server (e.g., “localhost:8080”) - :cwd - Working directory for CLI process - :port - TCP port (default: 0 for random) - :use-stdio? - Use stdio transport (default: true) - :log-level - :none :error :warning :info :debug :all - :auto-start? - Auto-start on first use (default: true) - :auto-restart? - DEPRECATED: This option has no effect and will be removed in a future release. - :env - Environment variables map - :telemetry - OpenTelemetry config map with :otlp-endpoint, :file-path, :exporter-type, :source-name, :capture-content? - :on-get-trace-context - Zero-arg fn returning {:traceparent … :tracestate …} - :remote? - Experimental. Enable remote session support (Mission Control). (upstream PR #1192)

Example:

(def client (copilot/client {:log-level :debug}))
 
@@ -70,9 +80,10 @@
(when (copilot/confirm! session "Deploy to production?")
   (println "Deploying..."))
 
-

convert-mcp-call-tool-result

Convert an MCP CallToolResult into the SDK’s ToolResultObject format. See github.copilot-sdk.tools/convert-mcp-call-tool-result.

+

convert-mcp-call-tool-result

(convert-mcp-call-tool-result result)

Convert an MCP CallToolResult into the SDK’s ToolResultObject format. See github.copilot-sdk.tools/convert-mcp-call-tool-result.

create-session

(create-session client config)

Create a new conversation session.

-

Config options (:on-permission-request is required): - :on-permission-request - Permission handler function (required, e.g. approve-all) - :session-id - Custom session ID - :model - Model to use (e.g., “gpt-5.4”, “claude-sonnet-4.5”) - :tools - Vector of tool definitions (use define-tool) - :system-message - {:mode :append/:replace :content “…”} - :available-tools - List of allowed tool names - :excluded-tools - List of excluded tool names - :provider - Custom provider config (BYOK) - :streaming? - Enable streaming deltas - :mcp-servers - MCP server configs map (keyed by server ID) - :custom-agents - Custom agent configs - :default-agent - Built-in agent config, e.g. {:excluded-tools “private_tool”} - :config-dir - Override config directory for CLI (configDir) - :skill-directories - Additional skill directories to load - :disabled-skills - Disable specific skills by name - :large-output - (Experimental) Tool output handling config {:enabled :max-size-bytes :output-dir} Note: CLI protocol feature, not in official SDK. outputDir may be ignored. - :working-directory - Working directory for the session (tool operations relative to this)

+

:on-permission-request is optional (since upstream PR #1308) — omit it to leave permission requests pending for manual resolution via handle-pending-permission-request!. Commonly-used config options: - :on-permission-request - Permission handler function (optional, e.g. approve-all). When omitted, permission requests surface as :copilot/permission.requested events and stay pending. - :session-id - Custom session ID - :model - Model to use (e.g., “gpt-5.4”, “claude-sonnet-4.5”) - :tools - Vector of tool definitions (use define-tool) - :system-message - {:mode :append/:replace :content “…”} - :available-tools - List of allowed tool names - :excluded-tools - List of excluded tool names - :provider - Custom provider config (BYOK) - :streaming? - Enable streaming deltas - :mcp-servers - MCP server configs map (keyed by server ID) - :custom-agents - Custom agent configs - :default-agent - Built-in agent config, e.g. {:excluded-tools “private_tool”} - :skill-directories - Additional skill directories to load - :disabled-skills - Disable specific skills by name - :working-directory - Working directory for the session (tool operations relative to this)

+

See the API reference (doc/reference/API.md in this repository) for the complete, current option list (including observability/telemetry, trace context, exit-plan-mode / auto-mode-switch handlers, skills, plugins, remote, and cloud session options).

Example:

(def session (copilot/create-session client {:on-permission-request copilot/approve-all
                                              :model "gpt-5.4"}))
@@ -88,7 +99,7 @@
 

default-join-session-permission-handler

Default permission handler for resuming sessions. Returns {:kind :no-result} — the CLI handles permissions itself. When used with resume-session, sends requestPermission: false on the wire. See github.copilot-sdk.client/default-join-session-permission-handler.

define-tool

(define-tool name opts)

Define a tool with a handler function.

-

Arguments: - name - Tool name (string) - opts map: - :description - Tool description - :parameters - JSON schema for parameters - :handler - Function (fn args invocation -> result) - :overrides-built-in-tool - When true, overrides a built-in tool of the same name

+

Arguments: - name - Tool name (string) - opts map: - :description - Tool description - :parameters - JSON schema for parameters - :handler - Function (fn args invocation -> result) - :overrides-built-in-tool - When true, overrides a built-in tool of the same name - :defer - :auto or :never (upstream PR #1632). When :auto the tool may be deferred (loaded lazily via tool search); :never forces pre-loading. Defaults to :auto.

The handler receives: - args - The parsed arguments from the LLM - invocation - Map with :session-id, :tool-call-id, :tool-name, :arguments

Returns: a tool definition map

Example:

@@ -153,6 +164,7 @@ (println "Not authenticated")))

get-current-model

(get-current-model session)

Get the current model for this session. Returns the model ID string, or nil if none set.

+

Experimental: not part of the official Copilot SDK API.

Example:

(println "Current model:" (copilot/get-current-model session))
 
@@ -160,6 +172,7 @@

get-last-session-id

(get-last-session-id client)

Get the ID of the most recently updated session.

get-messages

(get-messages session)

Get all events/messages from this session’s history.

get-quota

(get-quota client)

Get account quota information. Returns a map of quota type (string) to quota snapshot maps: {:entitlement-requests :used-requests :remaining-percentage :overage :overage-allowed-with-exhausted-quota? :reset-date}

+

Experimental: not part of the official Copilot SDK API.

Example:

(let [quotas (copilot/get-quota client)]
   (doseq [[type snapshot] quotas]
@@ -179,6 +192,12 @@
 
(let [{:keys [version protocol-version]} (copilot/get-status client)]
   (println "CLI version:" version "protocol:" protocol-version))
 
+

handle-pending-permission-request!

(handle-pending-permission-request! session opts)

Manually resolve a pending permission request (upstream PR #1308).

+

Use this when no :on-permission-request handler was registered and the runtime emitted a :copilot/permission.requested event. Read the :request-id from (:data event) and supply a decision in :result.

+

Options: - :request-id - String request id from the event (required) - :result - Permission decision map {:kind k ...}. :no-result is not allowed for the pending RPC — to decline answering, simply don’t call this function.

+

handle-pending-tool-call!

(handle-pending-tool-call! session opts)

Manually resolve a pending external tool call (upstream PR #1308).

+

Use this when a tool was declared without a :handler and the runtime emitted a :copilot/external_tool.requested event. Read the :request-id from (:data event) and supply either :result or :error.

+

Options: - :request-id - String request id from the event (required) - :result - Tool result (string, map, or other; normalized for the wire) - :error - Error message (string). Mutually exclusive with :result.

input!

(input! session message)(input! session message opts)

Show a text input dialog. Returns the entered text, or nil if the user declines/cancels. opts is an optional map with :title, :description, :min-length, :max-length, :format, and :default keys. Throws if the host does not support elicitation.

Example:

(when-let [name (copilot/input! session "Enter your name")]
@@ -187,7 +206,7 @@
 

interaction-events

Events related to permission, user input, elicitation, sampling, and external tool flows.

join-session

(join-session config)

Join the current foreground session from an extension running as a child process.

Reads the SESSION_ID environment variable and connects to the parent CLI process via stdio. Intended for extensions spawned by the Copilot CLI.

-

Config is the same as resume-session (:on-permission-request is required). The :disable-resume? option defaults to true.

+

Config is the same as resume-session. :on-permission-request is optional; when omitted, join-session uses default-join-session-permission-handler. The :disable-resume? option defaults to true.

Returns a map with :client and :session keys. The caller is responsible for stopping the client when done.

Throws if SESSION_ID is not set in the environment.

Example:

@@ -216,6 +235,7 @@

list-tools

(list-tools client)(list-tools client model)

List available tools with their metadata. Optional model param returns model-specific tool overrides.

Returns a vector of tool info maps with keys: :name :namespaced-name :description :parameters :instructions

+

Experimental: not part of the official Copilot SDK API.

Example:

(doseq [tool (copilot/list-tools client)]
   (println (:name tool) "-" (:description tool)))
@@ -245,9 +265,21 @@
 ;; Unsubscribe
 (unsub)
 
-

ping

(ping client)(ping client message)

Ping the server to check connectivity. Returns {:message :timestamp :protocol-version}

-

result-denied

result-failure

result-rejected

result-success

resume-session

(resume-session client session-id config)

Resume an existing session by ID. Accepts the same config options as create-session (except :session-id), plus: - :disable-resume? - When true, skip emitting the session.resume event (default: false)

-

:on-permission-request is required.

+

open-canvases

(open-canvases session)

Get the current open-canvases snapshot for session. Returns a vector of canvas-instance maps. The snapshot is initialized from session.resume and updated by :copilot/session.canvas.opened / :copilot/session.canvas.closed events. session.create does NOT populate it (matches upstream Node.js).

+

Each entry has required keys :instance-id, :extension-id, :canvas-id and optional :extension-name, :title, :status, :url, :input.

+

Example:

+
(copilot/open-canvases session)
+;; => [{:instance-id "i1" :canvas-id "diff" :extension-id "ext.x"
+;;      :title "Diff"}]
+
+

ping

(ping client)(ping client message)

Ping the server to check connectivity. Returns {:message :timestamp :protocol-version}.

+

:timestamp is either an ISO 8601 date-time string (CLI ≥ 1.0.51, upstream PR #1340) or a numeric epoch-millis value, depending on the CLI version; the SDK forwards whatever the server sends.

+

result-denied

(result-denied text)(result-denied text telemetry)

Create a denied tool result (permission denied).

+

result-failure

(result-failure text)(result-failure text error)(result-failure text error telemetry)

Create a failed tool result.

+

result-rejected

(result-rejected text)(result-rejected text telemetry)

Create a rejected tool result (user rejected).

+

result-success

(result-success text)(result-success text telemetry)

Create a successful tool result.

+

resume-session

(resume-session client session-id config)

Resume an existing session by ID. Accepts the same config options as create-session (except :session-id), plus: - :disable-resume? - When true, skip emitting the session.resume event (default: false)

+

:on-permission-request is optional (since upstream PR #1308) — omit it to leave permission requests pending for manual resolution.

Example:

(def session (copilot/resume-session client "session-123"
                {:on-permission-request copilot/approve-all}))
@@ -308,7 +340,7 @@
   (when (seq errors)
     (println "Cleanup errors:" errors)))
 
-

subscribe-events

(subscribe-events session)

Subscribe to session events. Returns a channel (buffer 1024) that receives events. The channel receives nil (close) when the session is disconnected. For explicit cleanup, call unsubscribe-events.

+

subscribe-events

(subscribe-events session)

Subscribe to session events. Returns a channel (buffer 1024) that receives events. The channel receives nil (close) when the session is disconnected. For explicit cleanup, call unsubscribe-events!.

This is a convenience wrapper around (tap (copilot/events session) ch).

Drop behavior: Events are delivered via core.async mult. If this subscriber’s buffer is full when mult delivers an event, that specific event is silently dropped for this subscriber only. Other subscribers with available buffer space still receive the event. With 1024 buffer, drops are unlikely unless the subscriber stops reading entirely.

Example:

@@ -333,7 +365,8 @@ :properties {"env" {:type "string" :enum ["staging" "production"]}} :required ["env"]}})
-

unsubscribe-events

(unsubscribe-events session ch)

Unsubscribe a channel from session events.

+

unsubscribe-events!

(unsubscribe-events! session ch)

Unsubscribe a channel from session events.

+

Side effects: untaps ch from the session’s event mult and closes ch. The caller must not use ch after calling this.

with-client

macro

(with-client [client-sym & [opts]] & body)

Create a client, start it, and ensure stop! on exit.

Usage: (with-client c {:log-level :info} …)

with-client-session

macro

(with-client-session [a b & more] & body)

Create a client + session and ensure cleanup on exit. Automatically calls disconnect! on session and stop! on client.

diff --git a/doc/api/github.copilot-sdk.instrument.html b/doc/api/github.copilot-sdk.instrument.html index 989fd7f..70dc373 100644 --- a/doc/api/github.copilot-sdk.instrument.html +++ b/doc/api/github.copilot-sdk.instrument.html @@ -1,6 +1,6 @@ -github.copilot-sdk.instrument documentation

github.copilot-sdk.instrument

Spec instrumentation for development/testing.

+github.copilot-sdk.instrument documentation

github.copilot-sdk.instrument

Spec instrumentation for development/testing.

Require this namespace to enable spec checking on public API functions. This adds runtime validation which is useful during development but may impact performance in production.

Usage: (require ’github.copilot-sdk.instrument) ;; Now all public API calls are spec-checked

To disable: (require ’clojure.spec.test.alpha :as stest) (stest/unstrument)

diff --git a/doc/api/github.copilot-sdk.logging.html b/doc/api/github.copilot-sdk.logging.html index 76151a0..2bf2cd1 100644 --- a/doc/api/github.copilot-sdk.logging.html +++ b/doc/api/github.copilot-sdk.logging.html @@ -1,6 +1,6 @@ -github.copilot-sdk.logging documentation

github.copilot-sdk.logging

Logging facade for the Copilot SDK using clojure.tools.logging.

+github.copilot-sdk.logging documentation

github.copilot-sdk.logging

Logging facade for the Copilot SDK using clojure.tools.logging.

This wraps clojure.tools.logging to provide SDK-specific defaults. Configure logging via your preferred SLF4J backend (logback, log4j2, etc.).

debug

macro

(debug & args)

Log a debug message.

error

macro

(error & args)

Log an error message.

diff --git a/doc/api/github.copilot-sdk.process.html b/doc/api/github.copilot-sdk.process.html index 184ed55..5b1ddb3 100644 --- a/doc/api/github.copilot-sdk.process.html +++ b/doc/api/github.copilot-sdk.process.html @@ -1,13 +1,18 @@ -github.copilot-sdk.process documentation

github.copilot-sdk.process

Process management for spawning and managing the Copilot CLI.

+github.copilot-sdk.process documentation

github.copilot-sdk.process

Process management for spawning and managing the Copilot CLI.

alive?

(alive? mp)

Check if process is still running.

+

cli-env-overrides

(cli-env-overrides {:keys [github-token telemetry copilot-home tcp-connection-token mode], :as _opts})

Compute the environment variable contract the SDK applies to the spawned CLI.

+

Returns a map with two entries: - :defaults — env-var → value-or-nil applied before user-provided :env so the user can override them. Currently just {"NODE_DEBUG" nil} (default: strip NODE_DEBUG to avoid polluting stdout, but a user can re-enable it via :env). - :overrides — env-var → value-or-nil applied after user-provided :env so explicit SDK options win over stale env (e.g. an explicit :github-token must beat a COPILOT_SDK_AUTH_TOKEN coming from :env).

+

This is a pure helper extracted so we can unit-test the env contract without spawning a real process.

connect-tcp

(connect-tcp host port timeout-ms)

Connect to a TCP server. Returns a socket.

destroy!

(destroy! mp)(destroy! mp timeout-ms)

Destroy the process gracefully with timeout.

destroy-forcibly!

(destroy-forcibly! mp)

Force destroy the process.

-

spawn-cli

(spawn-cli {:keys [cli-path cwd env use-stdio? github-token], :or {cli-path "copilot", use-stdio? true}, :as opts})

Spawn the Copilot CLI process.

-

Options: - :cli-path - Path to CLI executable (default: “copilot”) - :cli-args - Extra args to prepend - :cwd - Working directory - :env - Environment variables map - :log-level - Log level (:none :error :warning :info :debug :all) - :use-stdio? - Use stdio transport (default: true) - :port - TCP port (when not using stdio) - :github-token - GitHub token for authentication (PR #237) - :use-logged-in-user? - Whether to use logged-in user auth (PR #237)

+

spawn-cli

(spawn-cli {:keys [cli-path cwd env use-stdio?], :or {cli-path "copilot", use-stdio? true}, :as opts})

Spawn the Copilot CLI process.

+

Options: - :cli-path - Path to CLI executable (default: “copilot”) - :cli-args - Extra args to prepend - :cwd - Working directory - :env - Environment variables map - :log-level - Log level (:none :error :warning :info :debug :all) - :use-stdio? - Use stdio transport (default: true) - :port - TCP port (when not using stdio) - :github-token - GitHub token for authentication (PR #237) - :use-logged-in-user? - Whether to use logged-in user auth (PR #237) - :copilot-home - Base directory for Copilot data (sets COPILOT_HOME) (upstream PR #1191) - :tcp-connection-token - Connection token sent via COPILOT_CONNECTION_TOKEN (upstream PR #1176) - :remote? - When true, append --remote so the CLI exposes its session over a GitHub-hosted remote endpoint (upstream PR #1192) - :mode - Client mode :empty or :copilot-cli (default). When :empty, COPILOT_DISABLE_KEYTAR=1 is forced into the spawned env so the child CLI cannot reach the host keychain (upstream PR #1428).

Returns a ManagedProcess record.

stderr-reader

(stderr-reader mp)

Returns a channel that receives lines from stderr.

+

wait-for-exit!

(wait-for-exit! mp timeout-ms)

Block until the process exits or timeout-ms elapses. Returns true if the process exited, false on timeout.

+

Uses Process.waitFor, which is safe to call concurrently with the exit-chan monitor thread (and any other waiters) on the same process. When there is no underlying process, returns true (nothing to wait for).

wait-for-port

(wait-for-port mp timeout-ms)

Wait for TCP server to announce its port on stdout. Returns the port number or throws on timeout.

\ No newline at end of file diff --git a/doc/api/github.copilot-sdk.protocol.html b/doc/api/github.copilot-sdk.protocol.html index e0136d4..9294120 100644 --- a/doc/api/github.copilot-sdk.protocol.html +++ b/doc/api/github.copilot-sdk.protocol.html @@ -1,6 +1,6 @@ -github.copilot-sdk.protocol documentation

github.copilot-sdk.protocol

JSON-RPC 2.0 protocol implementation using java.nio channels.

+github.copilot-sdk.protocol documentation

github.copilot-sdk.protocol

JSON-RPC 2.0 protocol implementation using java.nio channels.

Architecture: - NIO channels for interruptible I/O (clean shutdown) - core.async channels for message flow - Single reader thread puts to incoming-ch - Writer go-loop takes from outgoing-ch - State is managed externally (passed in as atom)

This design allows clean shutdown: closing NIO channels causes reader to throw AsynchronousCloseException and exit gracefully.

connect

(connect in out state-atom)

Create a JSON-RPC connection from input/output streams. Uses NIO channels for interruptible I/O.

@@ -10,7 +10,9 @@

initial-connection-state

(initial-connection-state)

Return initial connection state to be stored in client’s atom under :connection key.

notifications

(notifications conn)

Returns the channel that receives incoming notifications.

send-notification

(send-notification conn method params)

Send a JSON-RPC notification (no response expected).

-

send-request

(send-request conn method params)

Send a JSON-RPC request and return a channel for the response. The channel delivers a single {:result …} or {:error …} map, then closes.

-

send-request!

(send-request! conn method params)(send-request! conn method params timeout-ms)

Send a JSON-RPC request and block for the response. Returns result or throws on error.

+

send-request

(send-request conn method params)(send-request conn method params {:keys [on-response-inline], :as _opts})

Send a JSON-RPC request and return a channel for the response. The channel delivers a single {:result …} or {:error …} map, then closes.

+

Optional opts map: - :on-response-inline — 1-arg fn (fn [result]) invoked synchronously in the read thread, before the result is delivered to the response channel, on success only. Use this when you need to mutate shared state (e.g. register a session under a server-assigned id) before any later inbound message can be dispatched. See upstream PR #1479.

+

send-request!

(send-request! conn method params)(send-request! conn method params timeout-ms)(send-request! conn method params timeout-ms opts)

Send a JSON-RPC request and block for the response. Returns result or throws on error.

+

The 5-arity form accepts an opts map forwarded to send-request (see its docstring for supported keys, e.g. :on-response-inline). The 3- and 4-arity forms apply the default empty opts.

set-request-handler!

(set-request-handler! conn handler)

Set handler for incoming requests. Handler is (fn method params -> channel with {:result …} or {:error …})

\ No newline at end of file diff --git a/doc/api/github.copilot-sdk.session.html b/doc/api/github.copilot-sdk.session.html index f7cdbb6..07fa566 100644 --- a/doc/api/github.copilot-sdk.session.html +++ b/doc/api/github.copilot-sdk.session.html @@ -1,12 +1,19 @@ -github.copilot-sdk.session documentation

github.copilot-sdk.session

CopilotSession - session operations using centralized client state.

+github.copilot-sdk.session documentation

github.copilot-sdk.session

CopilotSession - session operations using centralized client state.

All session state is stored in the client’s :state atom under: - :sessions session-id -> {:tool-handlers {} :permission-handler nil :destroyed? false :workspace-path nil} - :session-io session-id -> {:event-chan :event-mult}

Functions take client + session-id, accessing state through the client.

-

<send!

(<send! session opts)

Send a message and return a channel that delivers the final content string. This is the async equivalent of send-and-wait! - use inside go blocks.

+

<handle-pending-permission-request!

(<handle-pending-permission-request! session opts)

core.async variant of handle-pending-permission-request!. Returns a channel.

+

<handle-pending-tool-call!

(<handle-pending-tool-call! session opts)

core.async variant of handle-pending-tool-call!. Returns a channel.

+

<send!

(<send! session opts)

Send a message and return a channel that delivers the final content string. This is the async equivalent of send-and-wait! - use inside go blocks.

Options: same as send! (including :request-headers).

Additional options: - :timeout-ms - Timeout in milliseconds (default: 300000, set to nil to disable)

The returned channel delivers a single value (the response content) then closes.

+

<send-and-wait!

(<send-and-wait! session opts)

Send a message and return a channel that delivers the final assistant message event. This is the channel-based equivalent of send-and-wait!; use it inside go blocks instead of blocking a dispatch thread.

+

The delivered event has the same shape as send-and-wait!’s successful return value (an :copilot/assistant.message event - content lives under [:data :content]). Error semantics differ: unlike send-and-wait!, which throws on :copilot/session.error or timeout, this variant never surfaces those - on error or timeout the channel simply closes (delivering the last assistant message if one had already arrived, otherwise nothing). This matches <send!.

+

Options: same as send!.

+

Additional options: - :timeout-ms - Timeout in milliseconds (default: 300000, set to nil to disable)

+

The returned channel delivers at most one value then closes.

abort!

(abort! session)

Abort the currently processing message in this session.

adapt-session-fs-handler

(adapt-session-fs-handler handler-or-provider)

Return an RPC-shaped sessionFs handler for either supported factory contract.

Upstream SDKs expect :create-session-fs-handler to return a provider-style implementation, which this function wraps with create-session-fs-adapter. Existing Clojure callers may already return the low-level one-arg handler map; those maps are preserved.

@@ -21,7 +28,7 @@

compaction-compact!

(compaction-compact! session)

Trigger manual compaction of the session context. Note: renamed from session.compaction.compact to session.history.compact in upstream #1039.

config

(config session)

Get the session configuration that was used to create this session. Returns the user-provided config. Note: This reflects what was requested, not necessarily what the server is using. The session.start event contains the actual selectedModel if validation is needed.

confirm!

(confirm! session message)

Show a confirmation dialog and return the user’s boolean answer. Returns false if the user declines or cancels. Throws if the host does not support elicitation.

-

create-session

(create-session client session-id {:keys [tools on-permission-request on-user-input-request on-elicitation-request hooks workspace-path on-event config commands]})

Create a new session. Internal use - called by client. Initializes session state in client’s atom and returns a CopilotSession handle. If :on-event is provided, taps a subscriber that forwards events to the handler on a dedicated thread. Uses a sliding buffer, so events may be dropped under extreme backpressure if the handler cannot keep up with the event rate.

+

create-session

(create-session client session-id {:keys [tools on-permission-request on-user-input-request on-elicitation-request on-exit-plan-mode on-auto-mode-switch hooks workspace-path on-event config commands]})

Create a new session. Internal use - called by client. Initializes session state in client’s atom and returns a CopilotSession handle. If :on-event is provided, taps a subscriber that forwards events to the handler on a dedicated thread. Uses a sliding buffer, so events may be dropped under extreme backpressure if the handler cannot keep up with the event rate.

create-session-fs-adapter

(create-session-fs-adapter provider)

Adapt a provider-style session filesystem implementation to a sessionFs handler map.

Provider functions use direct arguments and throw on errors: - :read-file (fn path content) - :write-file (fn path content mode) - :append-file (fn path content mode) - :exists (fn path boolean) - :stat (fn path file-info-map) - :mkdir (fn path recursive mode) - :readdir (fn path entries) - :readdir-with-types (fn path typed-entries) - :rm (fn path recursive force) - :rename (fn src dest) Provider functions may return values directly, core.async channels, futures, or promises.

The returned handler map has the low-level RPC contract: each function receives a params map and returns RPC-shaped result maps or structured SessionFsError maps. create-session/resume-session automatically adapt provider-style factory returns, so call this directly only when you need the low-level handler map yourself.

@@ -35,19 +42,35 @@

Remember to untap and close your channel when done.

events->chan

(events->chan session)(events->chan session {:keys [buffer xf], :or {buffer 1024}})

Subscribe to session events with options.

Options: - :buffer - Channel buffer size (default 1024) - :xf - Transducer applied to events

-

Drop behavior: If this subscriber’s channel buffer is full when mult tries to deliver an event, that specific event is silently dropped for this subscriber only. Other subscribers with available buffer space still receive the event.

+

Drop behavior: the returned channel uses a sliding buffer of :buffer events. If this subscriber falls behind and its buffer fills, the oldest buffered events are dropped for this subscriber only — delivery to other subscribers is never blocked.

extensions-disable!

(extensions-disable! session extension-id)

Disable an extension by its source-qualified ID.

extensions-enable!

(extensions-enable! session extension-id)

Enable an extension by its source-qualified ID.

extensions-list

(extensions-list session)

List all extensions for the session. Returns a map with :extensions (vector of extension info maps).

extensions-reload!

(extensions-reload! session)

Reload all extensions.

fleet-start!

(fleet-start! session params)

Start a fleet of parallel sub-sessions. params is a map forwarded to the session.fleet.start RPC.

get-current-model

(get-current-model session)

Get the current model for this session. Returns the model ID string, or nil if none set.

+

Experimental: not part of the official Copilot SDK API; the wire RPC (session.model.getCurrent) is exposed for convenience and may change.

get-messages

(get-messages session)

Get all events/messages from this session’s history.

+

handle-auto-mode-switch-request!

(handle-auto-mode-switch-request! client session-id request)

Handle an incoming autoModeSwitch.request RPC (upstream PR #1228). The server asks the client whether to switch the agent to auto mode after a rate-limit event. Calls the session’s :auto-mode-switch-handler with (request, {:session-id ...}). If the handler returns a channel, awaits it.

+

Default behavior (no handler): {:result {:response “no”}}. Handler may return :yes / :yes-always / :no (or matching string), or a map {:response …} with the same value.

handle-command-execute!

(handle-command-execute! client session-id {:keys [command-name command args]})

Handle an incoming command.execute event. Returns a channel with the result. Looks up the command handler by name and calls it with a context map. Returns {:result nil} on success or {:error message} on failure.

handle-elicitation-request!

(handle-elicitation-request! client session-id context)

Handle an incoming elicitation.requested broadcast event. Calls the session’s elicitation handler with a single ElicitationContext arg (includes :session-id alongside request fields). Returns a channel with the result. If the handler fails, returns {:action “cancel”} to avoid hanging requests.

+

handle-exit-plan-mode-request!

(handle-exit-plan-mode-request! client session-id request)

Handle an incoming exitPlanMode.request RPC (upstream PR #1228). The server asks the client whether to exit plan mode. Calls the session’s :exit-plan-mode-handler with (request, {:session-id ...}). If the handler returns a channel, awaits its value. Returns a channel with a wire-shaped response wrapped in {:result …} or {:error …}.

+

Default behavior (no handler): {:result {:approved true}}. Handler must return an idiomatic map containing :approved? (required boolean), optional :selected-action (string), :feedback (string). If the handler result is malformed (non-map, missing :approved?, or :approved? is not a boolean), a warning is logged and the response falls back to {:result {:approved true}} (matching the no-handler default). Exceptions thrown by the handler are converted to {:error {:code -32603 :message …}}.

handle-hooks-invoke!

(handle-hooks-invoke! client session-id hook-type input)

Handle an incoming hooks invocation. Returns a channel with the result. PR #269 feature.

+

handle-pending-permission-request!

(handle-pending-permission-request! session {:keys [request-id result], :as opts})

Manually resolve a pending permission request (upstream PR #1308).

+

Use this when no :on-permission-request handler was registered and the runtime has emitted a :copilot/permission.requested event. The consumer reads the :request-id from (:data event) and supplies a permission decision in :result.

+

Options map keys: - :request-id - The :request-id from the permission.requested event (required) - :result - Permission decision map with :kind, matching the upstream PermissionDecision union. Allowed kinds: :approve-once, :approve-for-session, :approve-for-location, :approve-permanently, :reject, :user-not-available. :no-result is not supported here — to decline answering, simply don’t call this function.

+

Returns the RPC result map (sync). Use copilot/<handle-pending-permission-request! for the core.async variant.

+

handle-pending-tool-call!

(handle-pending-tool-call! session {:keys [request-id result error], :as opts})

Manually resolve a pending external tool call (upstream PR #1308).

+

Use this when a tool was declared without a :handler and the runtime has emitted a :copilot/external_tool.requested event. The consumer reads the :request-id from (:data event) and supplies either :result (the tool result string or map) or :error (a string message).

+

Options map keys: - :request-id - The :request-id from the external_tool.requested event (required) - :result - Tool result (string, map, or anything normalize-tool-result accepts) - :error - Error message (string). Mutually exclusive with :result.

+

Returns the RPC result map (sync). Use <handle-pending-tool-call! for the core.async variant.

handle-permission-request!

(handle-permission-request! client session-id request)

Handle an incoming permission request. Returns a channel with the result. When the handler returns {:kind :no-result}, the result is {:result :no-result} — callers must check for this sentinel: - v3 (broadcast path): skip the handlePendingPermissionRequest RPC entirely so the extension does not answer this permission request. - v2 (request-handler path): propagate as a JSON-RPC internal error (code -32603) so the CLI knows the request was not handled.

+

handle-provider-token-request!

(handle-provider-token-request! client session-id provider-name)

Handle an incoming providerToken.getToken request (upstream PR #1748). Returns a channel with the result.

+

The runtime issues this session-scoped request when a BYOK provider configured with a :bearer-token-provider callback needs a fresh token. The matching callback (looked up by provider-name) is invoked with the idiomatic ProviderTokenArgs map {:provider-name <name>} and must return the raw token string (without the Bearer prefix); a channel yielding the string is also accepted. The runtime performs no caching, so the callback owns refresh.

handle-session-fs-request!

(handle-session-fs-request! client session-id method params)

Handle an incoming sessionFs.* RPC request. Dispatches to the session’s FS handler and returns a channel with {:result …} or {:error …}.

+

For sessionFs.sqliteQuery / sqliteExists (upstream PR #1299), exceptions from the provider propagate as JSON-RPC errors rather than being wrapped in a SessionFsError result map, matching upstream Node behavior.

handle-system-message-transform

(handle-system-message-transform client session-id sections)

Handle a systemMessage.transform RPC request from the CLI runtime. Dispatches each section to its registered transform callback. On callback error, returns the original content (graceful fallback).

Uses string keys in the response to preserve the original wire-format section IDs (e.g. “tool_efficiency”, not “tool-efficiency”).

handle-tool-call!

(handle-tool-call! client session-id tool-call-id tool-name arguments & {:keys [traceparent tracestate]})

Handle an incoming tool call request. Returns a channel with the result wrapper.

@@ -63,15 +86,28 @@

mcp-reload!

(mcp-reload! session)

Reload all MCP servers.

mode-get

(mode-get session)

Get the current agent mode for the session. Returns a map with :mode (“interactive”, “plan”, or “autopilot”).

mode-set!

(mode-set! session mode)

Set the agent mode for the session. mode should be “interactive”, “plan”, or “autopilot”.

+

open-canvases

(open-canvases session)

Get the current open-canvases snapshot for session. Returns a vector of canvas-instance maps (each with :instance-id, :extension-id, :canvas-id, plus optional :extension-name, :title, :status, :url, :input). The snapshot is initialized from session.resume and updated by session.canvas.opened / session.canvas.closed events. session.create does NOT populate it (matches upstream Node.js behavior).

plan-delete!

(plan-delete! session)

Delete the plan file for the session.

plan-read

(plan-read session)

Read the plan file for the session. Returns a map with :exists? (boolean), :content (string or nil), and :file-path (string or nil).

plan-update!

(plan-update! session content)

Update the plan file content for the session.

plugins-list

(plugins-list session)

List all plugins for the session. Returns a map with :plugins (vector of plugin info maps).

register-transform-callbacks!

(register-transform-callbacks! client session-id callbacks)

Store system message transform callbacks on a session. Callbacks is a map of wire section ID strings to 1-arity functions that receive current content and return transformed content.

+

remote-disable

(remote-disable session)

Disable remote steering for this session. Returns nil.

+

Experimental — corresponds to the session.remote.disable JSON-RPC method introduced upstream in PR #1192.

+

remote-enable

(remote-enable session)(remote-enable session opts)

Enable remote steering for this session, exposing it to GitHub Mission Control web/mobile clients.

+

Optional opts: - :mode — keyword, one of :off, :export, or :on. Per-session remote mode. :off disables remote, :export exports session events to Mission Control without enabling remote steering, :on enables both export and remote steering. When omitted, the CLI applies its default. (Upstream CLI 1.0.48-1, PR #1288.)

+

Returns a map: - :url — Mission Control frontend URL (may be absent). - :remote-steerable — boolean; whether remote steering is enabled.

+

Experimental — corresponds to the session.remote.enable JSON-RPC method introduced upstream in PR #1192. The shape of the result and guarantees may change.

+

remove-open-canvas!

(remove-open-canvas! client session-id data)

Apply a session.canvas.closed event payload to the snapshot — removes the entry with matching :instance-id. Logs a warning and no-ops when :instance-id is not a non-blank string. Closing an absent instance is a silent no-op (idempotent), matching upstream removeOpenCanvas.

remove-session!

(remove-session! client session-id)

Remove a session from client state. Called on RPC failure during pre-registration.

+

respond-to-queued-command!

(respond-to-queued-command! session {:keys [request-id handled? stop-processing-queue?], :as params})

Respond to a :copilot/command.queued event from the CLI.

+

The CLI emits command.queued events when a slash-command is dispatched for client-side execution. Each event carries a :request-id (and :command). Clients should respond with either:

+

{:request-id :handled? true ;; consumed by client :stop-processing-queue? false} ;; optional {:request-id :handled? false} ;; fall through

+

When :handled? is true, the CLI marks the queued command done; when :stop-processing-queue? is also true, the CLI stops processing the remainder of the queue. When :handled? is false, the CLI re-routes the command to its default handling. The CLI accepts the response via the session.commands.respondToQueuedCommand RPC.

+

Marked experimental — the upstream Node SDK exposes this only via the generated low-level commands.respondToQueuedCommand RPC (no high-level helper).

select!

(select! session message options)

Show a selection dialog with the given options. Returns the selected value as a string, or nil if the user declines/cancels. Throws if the host does not support elicitation.

send!

(send! session opts)

Send a message to the session. Returns the message ID immediately (fire-and-forget).

-

Options: - :prompt - The message text (required) - :attachments - Vector of attachments (file/directory/selection) - :mode - :enqueue (default) or :immediate - :request-headers - Optional map of HTTP headers forwarded to the upstream LLM on this send (upstream PR #1094). Keys and values must both be strings (do not use Clojure keywords — they would be camelized by the wire-conversion layer).

+

Options: - :prompt - The message text (required) - :attachments - Vector of attachments (file/directory/selection) - :mode - :enqueue (default) or :immediate - :agent-mode - Optional. One of :interactive (default), :plan, :autopilot, or :shell. Selects the agent mode for this turn (upstream PR #1438). - :display-prompt - Optional. String shown in the session timeline instead of the model :prompt (e.g., when the model prompt is augmented with internal context that should not be shown to end users). (upstream PR #1470) - :request-headers - Optional map of HTTP headers forwarded to the upstream LLM on this send (upstream PR #1094). Keys and values must both be strings (do not use Clojure keywords — they would be camelized by the wire-conversion layer).

send-and-wait!

(send-and-wait! session opts)(send-and-wait! session opts timeout-ms)

Send a message and wait until the session becomes idle. Returns the final assistant message event, or nil if none received. Serialized per session to avoid mixing concurrent sends.

Options: same as send!

Additional options: - :timeout-ms - Timeout in milliseconds (default: 300000)

@@ -85,7 +121,9 @@

sessions-fork!

(sessions-fork! session)

Fork the current session (upstream #1039). This is a server-scoped RPC.

set-capabilities!

(set-capabilities! client session-id capabilities)

Store host capabilities in session state. Called after session.create/session.resume RPC.

set-model!

(set-model! session model-id)(set-model! session model-id opts)

Alias for switch-model!. Matches the upstream SDK’s setModel() API. See switch-model! for details.

+

set-open-canvases!

(set-open-canvases! client session-id canvases)

Replace the open-canvases snapshot for session-id. Called once after session.resume succeeds. Sanitizes the input the same way live session.canvas.opened upserts do — non-sequential values are treated as empty, and entries failing valid-open-canvas-instance? are dropped with a warning so the snapshot invariant holds for callers (and instrumentation).

set-session-fs-handler!

(set-session-fs-handler! client session-id handler)

Store a sessionFs handler map on a session. Called by client during create/resume when :session-fs is enabled. Handler is a map of keyword→fn for FS operations.

+

Upstream PR #1299: when the client’s :session-fs config declares :capabilities {:sqlite true} the per-session handler must expose BOTH :sqlite-query and :sqlite-exists. Otherwise the runtime would route sessionFs.sqliteExists (or sessionFs.sqliteQuery) to a missing handler key and surface an opaque “Unknown sessionFs method” error at runtime.

set-workspace-path!

(set-workspace-path! client session-id workspace-path)

Update the workspace path in session state. Called after RPC response.

shell-exec!

(shell-exec! session command)

Execute a shell command in the session. Returns the execution result.

shell-kill!

(shell-kill! session process-id)

Kill a running shell process by process ID.

@@ -94,15 +132,17 @@

skills-list

(skills-list session)

List all skills available to the session. Returns a map with :skills (vector of skill info maps).

skills-reload!

(skills-reload! session)

Reload all skills.

subscribe-events

(subscribe-events session)

Subscribe to session events. Returns a channel that receives events.

-

The channel will receive nil (close) when the session is disconnected. For explicit cleanup before session disconnection, call unsubscribe-events.

-

Drop behavior: If this subscriber’s channel buffer is full when mult tries to deliver an event, that specific event is silently dropped for this subscriber only. Other subscribers with available buffer space still receive the event. The returned channel has a buffer of 1024 events which should be sufficient for most use cases.

+

The channel will receive nil (close) when the session is disconnected. For explicit cleanup before session disconnection, call unsubscribe-events!.

+

Drop behavior: the returned channel uses a sliding buffer of 1024 events. If this subscriber falls behind and its buffer fills, the oldest buffered events are dropped for this subscriber only — delivery to other subscribers is never blocked. 1024 is sufficient for most use cases.

This is a convenience wrapper around (tap (events session) ch).

switch-model!

(switch-model! session model-id)(switch-model! session model-id opts)

Switch the model for this session. The new model takes effect for the next message. Conversation history is preserved.

-

Optional opts map: - :reasoning-effort - Reasoning effort level for the new model (“low”, “medium”, “high”, “xhigh”) - :model-capabilities - Model capabilities override map (upstream PR #1029) e.g. {:model-supports {:supports-vision true}}

+

Optional opts map: - :reasoning-effort - Reasoning effort level for the new model (“low”, “medium”, “high”, “xhigh”) - :reasoning-summary - Reasoning summary mode for the new model (“none”, “concise”, “detailed”) - :context-tier - Context window tier for models that support it (:default or :long-context, upstream PR #1522) - :model-capabilities - Model capabilities override map (upstream PR #1029) e.g. {:model-supports {:supports-vision true}}

Returns the new model ID string, or nil.

ui-elicitation!

(ui-elicitation! session params)

Request structured user input via an elicitation prompt. params is a map with :message and :requested-schema keys. Throws if the host does not support elicitation.

-

unsubscribe-events

(unsubscribe-events session ch)

Unsubscribe a channel from session events.

+

unsubscribe-events!

(unsubscribe-events! session ch)

Unsubscribe a channel from session events.

+

Side effects: untaps ch from the session’s event mult and closes ch. The caller must not use ch after calling this.

update-capabilities!

(update-capabilities! client session-id capability-changes)

Deep-merge capability changes into the session’s capabilities map. Called when a capabilities.changed broadcast event is received.

+

upsert-open-canvas!

(upsert-open-canvas! client session-id data)

Apply a session.canvas.opened event payload to the snapshot. If an entry with the same :instance-id exists, replace it in place (preserves order); otherwise append. Logs a warning and no-ops on payloads missing any of the required id fields (:instance-id, :extension-id, :canvas-id), matching upstream isOpenCanvasInstance validation.

usage-get-metrics

(usage-get-metrics session)

Get usage metrics for the session.

workspace-create-file!

(workspace-create-file! session path content)

Create a file in the session workspace. path is relative to the workspace files directory.

workspace-get-workspace

(workspace-get-workspace session)

Get current workspace metadata. Returns a map with :workspace (map or nil).

diff --git a/doc/api/github.copilot-sdk.specs.html b/doc/api/github.copilot-sdk.specs.html index 34785aa..d65a585 100644 --- a/doc/api/github.copilot-sdk.specs.html +++ b/doc/api/github.copilot-sdk.specs.html @@ -1,6 +1,7 @@ -github.copilot-sdk.specs documentation

github.copilot-sdk.specs

Clojure specs for Copilot SDK data structures.

-

client-options-keys

session-config-keys

system-prompt-sections

Known system prompt section identifiers for the customize mode. Each section corresponds to a distinct part of the system prompt.

+github.copilot-sdk.specs documentation

github.copilot-sdk.specs

Clojure specs for Copilot SDK data structures.

+

client-options-keys

session-config-keys

system-message-sections

Alias for system-prompt-sections matching the upstream SYSTEM_MESSAGE_SECTIONS name (upstream PR #1377).

+

system-prompt-sections

Known system message section identifiers for the customize mode. Each section corresponds to a distinct part of the system message. Upstream alias: SystemMessageSection.

unknown-keys

(unknown-keys m allowed-keys)

Returns the set of unknown keys in a map, given the allowed keys.

\ No newline at end of file diff --git a/doc/api/github.copilot-sdk.tool-set.html b/doc/api/github.copilot-sdk.tool-set.html new file mode 100644 index 0000000..4abf5f0 --- /dev/null +++ b/doc/api/github.copilot-sdk.tool-set.html @@ -0,0 +1,17 @@ + +github.copilot-sdk.tool-set documentation

github.copilot-sdk.tool-set

Helpers for building source-qualified tool filter patterns used by :available-tools and :excluded-tools in session configs.

+

The runtime matches each tool reference against patterns of the form "<source>:<name>" where source is one of builtin, mcp, or custom and name is either a literal tool name or the wildcard "*". The bare wildcard "*" (no source) is intentionally rejected by the SDK — apps must explicitly opt into a source so an absent source can never silently grant access to unexpected tools.

+

Mirrors upstream ToolSet and BuiltInTools from nodejs/src/toolSet.ts (upstream PR #1428).

+

Examples:

+

(tool-set/builtin “ask_user”) ;; => “builtin:ask_user” (tool-set/builtin “*”) ;; => “builtin:*” (tool-set/mcp “*”) ;; => “mcp:*” (tool-set/builtins “task” “skill”) ;; => “builtin:task” “builtin:skill”

+

;; Ready-to-use: every built-in that is safely session-bounded. tool-set/isolated ;; => “builtin:ask_user” “builtin:task_complete” …

+

builtin

(builtin name)

Returns the filter pattern "builtin:<name>". name may be the wildcard "*". Throws on invalid names.

+

builtins

(builtins names)

Returns a vector of "builtin:<name>" patterns, one per entry in names. Throws on the first invalid name.

+

custom

(custom name)

Returns the filter pattern "custom:<name>". name may be the wildcard "*". Throws on invalid names.

+

isolated

Source-qualified "builtin:<name>" patterns for every tool in isolated-builtins. Drop directly into :available-tools:

+

(copilot/create-session client {:available-tools tool-set/isolated})

+

isolated-builtins

Names of the built-in tools that are safely session-bounded (no host I/O). Mirrors upstream BuiltInTools.Isolated. Use isolated for the source-qualified form ready to drop into :available-tools.

+

mcp

(mcp name)

Returns the filter pattern "mcp:<name>". name may be the wildcard "*". Throws on invalid names.

+

valid-name?

(valid-name? name)

True when name is a valid tool-name segment — alphanumeric plus _ and -, or the literal wildcard "*". Returns false for any non-string input.

+
\ No newline at end of file diff --git a/doc/api/github.copilot-sdk.tools.html b/doc/api/github.copilot-sdk.tools.html index dfecf4d..4275c3a 100644 --- a/doc/api/github.copilot-sdk.tools.html +++ b/doc/api/github.copilot-sdk.tools.html @@ -1,15 +1,15 @@ -github.copilot-sdk.tools documentation

github.copilot-sdk.tools

Helper functions for defining tools.

+github.copilot-sdk.tools documentation

github.copilot-sdk.tools

Helper functions for defining tools.

convert-mcp-call-tool-result

(convert-mcp-call-tool-result {:keys [content is-error]})

Convert an MCP CallToolResult into the SDK’s ToolResultObject format.

The input map should have Clojure-idiomatic keys: - :content - vector of content blocks, each with :type and type-specific fields - :is-error - optional boolean, when true the result-type is “failure”

Content block types: - {:type “text” :text “…”} - {:type “image” :data “base64…” :mime-type “image/png”} - {:type “resource” :resource {:uri “…” :text “…” :blob “…” :mime-type “…”}}

Returns a ToolResultObject map with :text-result-for-llm, :result-type, and optionally :binary-results-for-llm.

-

define-tool

(define-tool name {:keys [description parameters handler overrides-built-in-tool]})

Define a tool with a handler function.

-

Arguments: - name - Tool name (string) - opts map: - :description - Tool description - :parameters - JSON schema for parameters (or nil) - :handler - Function (fn args invocation -> result) - :overrides-built-in-tool - When true, explicitly overrides a built-in tool of the same name. Without this flag, name clashes with built-in tools cause an error.

-

The handler receives: - args - The parsed arguments from the LLM (no key conversion) - invocation - Map with :session-id, :tool-call-id, :tool-name, :arguments

+

define-tool

(define-tool name {:keys [description parameters handler overrides-built-in-tool defer]})

Define a tool the CLI server can call during a session.

+

Arguments: - name - Tool name (string) - opts map: - :description - Tool description - :parameters - JSON schema for parameters (or nil) - :handler - Function (fn args invocation -> result). Optional since upstream PR #1308: when omitted, the tool is declaration-only and the runtime emits a :copilot/external_tool.requested event whenever the LLM calls it. Applications resolve the pending call by reading the :request-id from the event data and calling copilot/handle-pending-tool-call! (or the async copilot/<handle-pending-tool-call!). - :overrides-built-in-tool - When true, explicitly overrides a built-in tool of the same name. Without this flag, name clashes with built-in tools cause an error. - :defer - :auto or :never (upstream PR #1632). Controls whether the tool may be deferred (loaded lazily via tool search) rather than always pre-loaded. :auto allows deferral; :never forces pre-loading. Defaults to :auto.

+

The handler (when provided) receives: - args - The parsed arguments from the LLM (no key conversion) - invocation - Map with :session-id, :tool-call-id, :tool-name, :arguments

The handler should return one of: - A string (treated as success) - A map with :text-result-for-llm and :result-type - Any other value (JSON-encoded as success) - A core.async channel that will yield one of the above

-

Example:

+

Example (with handler):

(define-tool "get_weather"
   {:description "Get weather for a location"
    :parameters {:type "object"
@@ -18,10 +18,18 @@
    :handler (fn [args _]
               (str "Weather in " (:location args) ": Sunny, 72°F"))})
 
-

define-tool-from-spec

(define-tool-from-spec name {:keys [description spec handler overrides-built-in-tool]})

Define a tool using a clojure.spec for parameter validation.

+

Example (declaration-only, manual resolution):

+
(define-tool "get_weather"
+  {:description "Get weather for a location"
+   :parameters {:type "object"
+                :properties {:location {:type "string"}}}})
+;; Listen for :copilot/external_tool.requested events and resolve via
+;; (copilot/handle-pending-tool-call! session {:request-id ... :result ...})
+
+

define-tool-from-spec

(define-tool-from-spec name {:keys [description spec handler overrides-built-in-tool defer]})

Define a tool using a clojure.spec for parameter validation.

Parameters are validated against the spec at invocation time. Note: the spec is NOT auto-converted to JSON schema, so this tool has no parameter schema advertised to the model. For tools that need a parameter schema, use define-tool with an explicit JSON schema.

-

Arguments: - name - Tool name (string) - opts map: - :description - Tool description - :spec - A clojure.spec for the arguments - :handler - Function (fn args invocation -> result) - :overrides-built-in-tool - When true, overrides a built-in tool of the same name

-

Example:

+

Arguments: - name - Tool name (string) - opts map: - :description - Tool description - :spec - A clojure.spec for the arguments - :handler - Function (fn args invocation -> result). Optional since upstream PR #1308: when omitted, no :tool-handler is installed and the tool is declaration-only. The runtime emits a :copilot/external_tool.requested event on call; applications resolve it via copilot/handle-pending-tool-call! (or copilot/<handle-pending-tool-call!). Note: when :handler is omitted, the :spec is also not used (no automatic validation occurs in the declaration-only path). - :overrides-built-in-tool - When true, overrides a built-in tool of the same name - :defer - :auto or :never (upstream PR #1632). When :auto the tool may be deferred (loaded lazily via tool search); :never forces pre-loading. Defaults to :auto.

+

Example (with handler):

(s/def ::location string?)
 (s/def ::get-weather-args (s/keys :req-un [::location]))
 
@@ -34,6 +42,13 @@
                 {:text-result-for-llm (str "Invalid args: " (s/explain-str ::get-weather-args args))
                  :result-type "failure"}))})
 
+

Example (declaration-only, manual resolution):

+
(define-tool-from-spec "get_weather"
+  {:description "Get weather for a location"
+   :spec ::get-weather-args})
+;; Resolve pending calls via
+;; (copilot/handle-pending-tool-call! session {:request-id ... :result ...})
+

result-denied

(result-denied text)(result-denied text telemetry)

Create a denied tool result (permission denied).

result-failure

(result-failure text)(result-failure text error)(result-failure text error telemetry)

Create a failed tool result.

result-rejected

(result-rejected text)(result-rejected text telemetry)

Create a rejected tool result (user rejected).

diff --git a/doc/api/github.copilot-sdk.util.html b/doc/api/github.copilot-sdk.util.html index 1b409be..7361832 100644 --- a/doc/api/github.copilot-sdk.util.html +++ b/doc/api/github.copilot-sdk.util.html @@ -1,15 +1,16 @@ -github.copilot-sdk.util documentation

github.copilot-sdk.util

Utility functions for the Copilot SDK.

+github.copilot-sdk.util documentation

github.copilot-sdk.util

Utility functions for the Copilot SDK.

->clj-keys

(->clj-keys m)

Convert map keys from camelCase to kebab-case for Clojure idiom. Works recursively on nested maps. Non-keyword keys are preserved.

->wire-keys

(->wire-keys m)

Convert map keys from kebab-case to camelCase for wire format. Works recursively on nested maps. Non-keyword keys are preserved.

attachment->wire

(attachment->wire att)

Convert an attachment from Clojure format to wire format. Handles the special mapping for selection attachments where :file-path -> filePath and :selection-range -> selection.

attachments->wire

(attachments->wire attachments)

Convert a vector of attachments to wire format.

clj->wire

(clj->wire m)

Convert a Clojure idiom map to wire format. Alias for ->wire-keys.

+

context-tier->wire

(context-tier->wire tier)

Convert a Clojure :context-tier keyword to the wire string value. The CLI expects “default” / “long_context” (underscore), so csk camelCasing would produce the wrong value — we map explicitly.

event-type->keyword

(event-type->keyword event-type)

Normalize event :type values to namespaced keywords. Example: “assistant.message_delta” -> :copilot/assistant.message_delta.

-

mcp-server->wire

(mcp-server->wire m)

Convert a single MCP server config from Clojure idiom to wire format. Strips the :mcp- prefix from MCP-specific keys, then converts remaining keys to camelCase. Keyword values for :type are converted to strings. Example: {:mcp-command “node” :mcp-args [“x”] :mcp-server-type :http} becomes {“command” “node” “args” [“x”] “type” “http”}.

+

mcp-server->wire

(mcp-server->wire m)

Convert a single MCP server config from Clojure idiom to wire format. Strips the :mcp- prefix from MCP-specific keys, then converts remaining keys to camelCase. Keyword values for :type and :defer-tools are converted to strings. Example: {:mcp-command “node” :mcp-args [“x”] :mcp-server-type :http} becomes {:command “node” :args [“x”] :type “http”} (camelCase keyword keys, with :type / :defer-tools values stringified).

mcp-servers->wire

(mcp-servers->wire servers)

Convert MCP servers map from Clojure idiom to wire format. Each server value has :mcp-* prefixed keys stripped before camelCase conversion.

-

section-key->wire

Map from Clojure keyword to wire string for system prompt sections.

+

section-key->wire

Map from Clojure keyword to wire string for system message sections.

section-kw->wire-id

(section-kw->wire-id kw)

Convert a section keyword to its wire string ID. Known sections use the explicit mapping; unknown sections fall back to (name kw) for extensibility.

wire->clj

(wire->clj m)

Convert a wire-format map to Clojure idiom. Alias for ->clj-keys.

wire->section-key

Map from wire string to Clojure keyword for system prompt sections.

diff --git a/doc/api/index.html b/doc/api/index.html index 450ac58..ea3b3db 100644 --- a/doc/api/index.html +++ b/doc/api/index.html @@ -1,11 +1,11 @@ -Documentation

Documentation

+Documentation

Documentation

Clojure SDK for programmatic control of the GitHub Copilot CLI via JSON-RPC.

Getting Started

  • Getting Started — Step-by-step tutorial building a weather assistant
  • -
  • Examples — 19 working examples with walkthroughs
  • +
  • Examples — 20 working examples with walkthroughs

Guides

    @@ -16,6 +16,22 @@

    Guides

  • MCP Debugging — Troubleshooting MCP connections
  • Custom Agents — Define specialized agents with scoped tools for sub-agent orchestration
+

Features

+

Quick links to the major SDK capabilities (see the API Reference for full detail):

+
    +
  • Streaming events — incremental assistant/reasoning deltas
  • +
  • Tools and Tool Sets — expose and filter callable tools
  • +
  • Session Hooks — pre/post tool-use and lifecycle interception
  • +
  • UI Elicitationask_user / structured elicitation handlers
  • +
  • File & Blob Attachments — image and binary input
  • +
  • Custom Agents — specialized sub-agents with scoped tools
  • +
  • BYOK Providers — OpenAI, Azure, Anthropic, Ollama
  • +
  • MCP Servers — Model Context Protocol integration
  • +
  • Observability — OpenTelemetry export and session telemetry. Privacy note: :capture-content? records prompt/response content and is off by default — enable only in trusted environments.
  • +
  • Client Mode :empty — multi-tenant SaaS isolation. Security note: hardens sessions against local machine state; intended for hosts serving multiple users.
  • +
  • Session Filesystem — route filesystem operations through host-provided handlers. Security note: the host fully controls session file access.
  • +
  • Remote / cloud sessions (:remote-session, :cloud) and fleet modeexperimental; not covered by GA semver guarantees.
  • +

Reference

  • API Reference — Complete API: helpers, client, session, events, tools
  • @@ -25,6 +41,7 @@

    Contributing

    • Style Guide — Documentation authoring conventions
    • Code Generation — Schema-driven generation of clojure.spec definitions
    • +
    • Upstream Doc Gap Matrix — Per-topic coverage vs the upstream SDK docs
    • AGENTS.md — Guidelines for AI agents working on this codebase
    • PUBLISHING.md — Versioning, CI/CD workflows, release process, build attestation
    • CHANGELOG — Version history
    • diff --git a/doc/api/overview.html b/doc/api/overview.html index 702b6d9..e933189 100644 --- a/doc/api/overview.html +++ b/doc/api/overview.html @@ -1,6 +1,6 @@ -Using MCP Servers with the Copilot SDK for Clojure

      Using MCP Servers with the Copilot SDK for Clojure

      +Using MCP Servers with the Copilot SDK for Clojure

      Using MCP Servers with the Copilot SDK for Clojure

      The Copilot SDK can integrate with MCP servers (Model Context Protocol) to extend the assistant’s capabilities with external tools. MCP servers run as separate processes and expose tools (functions) that Copilot can invoke during conversations.

      What is MCP?

      Model Context Protocol (MCP) is an open standard for connecting AI assistants to external tools and data sources. MCP servers can:

      @@ -95,10 +95,11 @@

      Local/Stdio Server :mcp-command string Yes Command to execute - :mcp-args vector Yes Command arguments + :mcp-args vector No Command arguments (optional since CLI 1.0.51; omit for argument-less commands) :mcp-tools vector Yes Tools to enable (["*"] for all, [] for none, or specific tool names) :mcp-server-type keyword No :local or :stdio (defaults to local) :mcp-timeout number No Timeout in milliseconds + :mcp-defer-tools keyword No Tool-deferral policy: :auto (defer tool registration until needed) or :never. Wire-encoded as deferTools (upstream schema 1.0.63) :env map No Environment variables for the subprocess :cwd string No Working directory for the subprocess @@ -113,11 +114,13 @@

      Remote Serve :mcp-url string Yes Server URL :mcp-tools vector Yes Tools to enable (["*"] for all) :mcp-timeout number No Timeout in milliseconds + :mcp-defer-tools keyword No Tool-deferral policy: :auto or :never. Wire-encoded as deferTools (upstream schema 1.0.63) :mcp-headers map No HTTP headers (e.g., for authentication)

      Key Naming Convention

      MCP server config keys use an :mcp- prefix in Clojure (e.g., :mcp-command, :mcp-args, :mcp-tools) to distinguish them from other configuration options. On the wire, the SDK automatically strips this prefix to match the upstream protocol (e.g., command, args, tools).

      +

      Some prefixed keys map to a camelCase wire key rather than a bare strip: :mcp-defer-tools becomes deferTools, and its keyword value (:auto/:never) is stringified.

      The non-prefixed keys :env and :cwd are shared with other config types and do not have an :mcp- prefix.

      Tool Filtering

      Control which tools from an MCP server are available to the model:

      diff --git a/doc/api/style.html b/doc/api/style.html index 1c9cf72..4448b69 100644 --- a/doc/api/style.html +++ b/doc/api/style.html @@ -1,6 +1,6 @@ -Documentation Style Guide

      Documentation Style Guide

      +Documentation Style Guide

      Documentation Style Guide

      Conventions for writing and maintaining documentation in the copilot-sdk-clojure project.

      Principles

        diff --git a/doc/api/upstream-doc-gap-matrix.html b/doc/api/upstream-doc-gap-matrix.html new file mode 100644 index 0000000..cba5703 --- /dev/null +++ b/doc/api/upstream-doc-gap-matrix.html @@ -0,0 +1,122 @@ + +Upstream Documentation Gap Matrix

        Upstream Documentation Gap Matrix

        +

        This matrix maps every page in the upstream github/copilot-sdk docs/** tree to its coverage in this Clojure SDK, with a per-topic decision. It exists so GA reviewers (and future maintainers) can see, at a glance, which upstream topics are ported, adapted, intentionally folded into the API reference, deferred, or not applicable.

        +

        Decision legend

        +
          +
        • Adapted — covered by a dedicated Clojure doc page (Clojure-idiomatic rewrite, not a copy).
        • +
        • Folded — the capability is documented, but inside reference/API.md (config-table rows or a topical section) rather than a standalone page. The stable API is documented; a separate narrative page is post-GA polish.
        • +
        • Deferred (post-GA) — host-architecture / conceptual guidance that does not document a stable SDK API surface. No GA blocker; tracked for a later docs pass.
        • +
        • N-A — not applicable to the Clojure SDK (index pages, or other-language integrations).
        • +
        +

        GA gate: every stable public API is documented (Adapted or Folded). Deferred items are narrative/architecture guidance only — none gates a stable API.

        +

        auth/

        + + + + + + + + + +
        Upstream page Decision Clojure coverage
        auth/index.md Adapted auth/index.md
        auth/authenticate.md Adapted auth/index.md (auth methods + priority order)
        auth/byok.md Adapted auth/byok.md
        +

        features/

        + + + + + + + + + + + + + + + + + + + + +
        Upstream page Decision Clojure coverage
        features/index.md N-A Index — see index.md Features section
        features/agent-loop.md Folded Conceptual; reflected in API.md Event Types + Streaming
        features/streaming-events.md Folded API.md Streaming
        features/hooks.md Folded API.md Session Hooks
        features/mcp.md Adapted mcp/overview.md
        features/custom-agents.md Adapted guides/custom-agents.md
        features/skills.md Folded API.md Config Directory and Skills + :skill-directories/:enable-skills/:disabled-skills
        features/image-input.md Folded API.md File Attachments / Blob Attachments
        features/session-persistence.md Folded API.md resume-session, list-sessions, get-session-metadata
        features/steering-and-queueing.md Folded API.md send! :mode (:enqueue/:immediate)
        features/plugin-directories.md Folded API.md :plugin-directories config row
        features/remote-sessions.md Folded (experimental) API.md :remote? / :remote-session config rows
        features/cloud-sessions.md Folded (experimental) API.md :cloud config row
        features/fleet-mode.md Folded (experimental) API.md Experimental RPC Methods (session/fleet-start!)
        +

        hooks/

        +

        Upstream splits hooks across six pages; the Clojure SDK consolidates them into a single API.md section. The stable hook API (registration, pre/post-tool-use, lifecycle, user-prompt-submitted, short-circuit semantics) is documented; per-hook narrative pages are post-GA polish.

        + + + + + + + + + + + + + +
        Upstream page Decision Clojure coverage
        hooks/index.md N-A Index
        hooks/hooks-overview.md Folded API.md Session Hooks
        hooks/pre-tool-use.md Folded API.md Session Hooks
        hooks/post-tool-use.md Folded API.md Session Hooks
        hooks/user-prompt-submitted.md Folded API.md Session Hooks
        hooks/session-lifecycle.md Folded API.md Session Hooks + on-lifecycle-event
        hooks/error-handling.md Folded API.md Session Hooks + Error Handling
        +

        observability/

        + + + + + + + + +
        Upstream page Decision Clojure coverage
        observability/index.md Folded API.md Observability
        observability/opentelemetry.md Folded API.md Observability (client :telemetry, :on-get-trace-context, session :enable-session-telemetry?)
        +

        setup/

        +

        Upstream setup pages are largely Node/host-deployment architecture guidance. The Clojure SDK documents the stable setup surface (client options, auth) in the API reference and getting-started; deep host-architecture guides are deferred.

        + + + + + + + + + + + + + + + +
        Upstream page Decision Clojure coverage
        setup/index.md N-A Index
        setup/local-cli.md Folded getting-started.md + API.md :cli-path
        setup/bundled-cli.md N-A Node-specific CLI bundling; the Clojure SDK uses an external CLI via :cli-path
        setup/github-oauth.md Adapted auth/index.md
        setup/azure-managed-identity.md Adapted auth/azure-managed-identity.md
        setup/multi-tenancy.md Folded API.md Client Mode (Empty)
        setup/choosing-a-setup-path.md Deferred (post-GA) Conceptual setup-selection guide
        setup/backend-services.md Deferred (post-GA) Host-architecture guidance, not an SDK API
        setup/scaling.md Deferred (post-GA) Host-architecture guidance, not an SDK API
        +

        troubleshooting/

        + + + + + + + + + + +
        Upstream page Decision Clojure coverage
        troubleshooting/index.md N-A Index
        troubleshooting/mcp-debugging.md Adapted mcp/debugging.md
        troubleshooting/debugging.md Folded mcp/debugging.md + :log-level client option
        troubleshooting/compatibility.md Deferred (post-GA) CLI/JVM/Clojure compatibility matrix (Phase 0.75 follow-up)
        +

        integrations/

        + + + + + + + + +
        Upstream page Decision Clojure coverage
        integrations/index.md N-A Index
        integrations/microsoft-agent-framework.md N-A .NET / Python Microsoft Agent Framework integration; not applicable to the Clojure SDK
        +

        Top-level

        + + + + + + + + +
        Upstream page Decision Clojure coverage
        index.md Adapted index.md
        getting-started.md Adapted getting-started.md
        +
        \ No newline at end of file diff --git a/doc/auth/byok.md b/doc/auth/byok.md index d6e5d87..a32b3b8 100644 --- a/doc/auth/byok.md +++ b/doc/auth/byok.md @@ -108,6 +108,8 @@ foundry service status | `:wire-api` | keyword | No | `:completions` or `:responses` (default: `:completions`) | | `:api-key` | string | No | API key (optional for local providers like Ollama) | | `:bearer-token` | string | No | Bearer token auth (takes precedence over `:api-key`) | +| `:bearer-token-provider` | fn | No | Dynamic bearer-token callback. See [Dynamic Bearer Tokens](#dynamic-bearer-tokens). (upstream PR #1748) | +| `:transport` | keyword | No | `:http` or `:websockets` — provider transport. (upstream PR #1711) | | `:azure-options` | map | No | Azure-specific options (see below) | ### Azure Options @@ -168,6 +170,67 @@ Some providers require bearer token authentication instead of API keys: :bearer-token (System/getenv "MY_BEARER_TOKEN")}} ``` +### Dynamic Bearer Tokens + +> **Experimental** (upstream PR #1748) — not part of the stable SDK API. + +When a provider needs a token that rotates or is minted per-request, supply a +`:bearer-token-provider` callback instead of a static `:bearer-token`. The SDK +strips the function before serializing (sending `hasBearerTokenProvider true` on +the wire) and invokes it on demand when the runtime requests a token. + +The callback receives a map with `:provider-name` and `:session-id` and must +return a token string: + +```clojure +(require '[github.copilot-sdk :as copilot]) + +(def session + (copilot/create-session client + {:model "my-model" + :on-permission-request copilot/approve-all + :provider {:provider-type :openai + :base-url "https://my-custom-endpoint.example.com/v1" + :bearer-token-provider + (fn [{:keys [provider-name session-id]}] + (mint-fresh-token! provider-name))}})) +``` + +The callback must return a string. A non-string return is rejected and the token +value is never logged. + +### Multi-Provider Registry + +> **Experimental** (upstream PR #1718) — not part of the stable SDK API. + +To declare several named providers and a catalog of models that reference them, +use `:providers` (a vector of named providers) with `:models` (a vector of model +entries). Each named provider takes the same fields as `:provider` plus a +required `:name` (the registry key, which must not contain `/`). Each model entry +has a required `:id` (provider-local model id) and `:provider` (a name in +`:providers`); the full model selection id is `"providerName/id"`. + +```clojure +(require '[github.copilot-sdk :as copilot]) + +(def session + (copilot/create-session client + {:on-permission-request copilot/approve-all + :providers [{:name "openai" + :provider-type :openai + :base-url "https://api.openai.com/v1" + :api-key (System/getenv "OPENAI_API_KEY")} + {:name "anthropic" + :provider-type :anthropic + :base-url "https://api.anthropic.com" + :api-key (System/getenv "ANTHROPIC_API_KEY")}] + :models [{:id "gpt-5.4" :provider "openai"} + {:id "claude-sonnet-4.5" :provider "anthropic"}] + :model "openai/gpt-5.4"})) +``` + +`:providers` cannot be combined with the singular `:provider`. + ## Limitations ### Identity Limitations diff --git a/doc/reference/API.md b/doc/reference/API.md index 4f71890..b8b9e3c 100644 --- a/doc/reference/API.md +++ b/doc/reference/API.md @@ -251,7 +251,11 @@ Create a client and session together, ensuring both are cleaned up on exit. | `:system-message` | map | System message customization (see below) | | `:available-tools` | vector | List of allowed tool names | | `:excluded-tools` | vector | List of excluded tool names | -| `:provider` | map | Provider config for BYOK (see [BYOK docs](../auth/byok.md)). Required key: `:base-url`. Optional: `:provider-type` (`:openai`/`:azure`/`:anthropic`), `:wire-api` (`:completions`/`:responses`), `:api-key`, `:bearer-token`, `:azure-options`, `:headers` (map of HTTP header name→value, sent with each provider request — upstream PR #1094), `:model-id` (string — the model identifier to send to the provider; overrides session `:model`), `:wire-model` (string — model name as sent on the provider wire when it differs from `:model-id`), `:max-input-tokens` (integer — input/prompt token cap; serialized as wire `maxPromptTokens`), `:max-output-tokens` (integer — output token cap). The four override fields were added in upstream PR #966 | +| `:provider` | map | Provider config for BYOK (see [BYOK docs](../auth/byok.md)). Required key: `:base-url`. Optional: `:provider-type` (`:openai`/`:azure`/`:anthropic`), `:wire-api` (`:completions`/`:responses`), `:api-key`, `:bearer-token`, `:azure-options`, `:headers` (map of HTTP header name→value, sent with each provider request — upstream PR #1094), `:model-id` (string — the model identifier to send to the provider; overrides session `:model`), `:wire-model` (string — model name as sent on the provider wire when it differs from `:model-id`), `:max-input-tokens` (integer — input/prompt token cap; serialized as wire `maxPromptTokens`), `:max-output-tokens` (integer — output token cap), `:transport` (`:http`/`:websockets` — provider transport; serialized as wire `transport` — upstream PR #1711), `:bearer-token-provider` (fn — dynamic bearer-token callback, see [BYOK docs](../auth/byok.md#dynamic-bearer-tokens) — upstream PR #1748). The four override fields were added in upstream PR #966 | +| `:providers` | vector | (Experimental) Multi-provider BYOK registry — a vector of named providers. Each entry has the same fields as `:provider` plus a required `:name` (the registry key, no `/`) and a `:bearer-token-provider` callback. Pairs with `:models` to declare a model catalog. Cannot be combined with the singular `:provider`. (upstream PR #1718) | +| `:models` | vector | (Experimental) Model catalog referencing the `:providers` registry. Each entry: `:id` (required, provider-local model id), `:provider` (required, a `:name` in `:providers`), and optional override fields (`:model-id`, `:wire-model`, `:capabilities`, `:max-input-tokens`, `:max-context-window-tokens`, `:max-output-tokens`). The full model selection id is `"providerName/id"`. (upstream PR #1718) | +| `:capi` | map | CAPI (Copilot API) session options. `{:enable-web-socket-responses boolean}` — serialized as wire `capi.enableWebSocketResponses`. (upstream PR #1711) | +| `:exp-assignments` | map | (Internal) Opaque experiment flight assignments. Keys are source-defined flight ids and are forwarded verbatim (string keys bypass kebab→camel conversion). Serialized as `expAssignments`. (upstream PR #1750) | | `:mcp-servers` | map | MCP server configs keyed by server ID (see [MCP docs](../mcp/overview.md)). Local (stdio) servers: `:mcp-command`, `:mcp-args`, `:mcp-tools`. Remote (HTTP/SSE) servers: `:mcp-server-type` (`:http`/`:sse`), `:mcp-url`, `:mcp-tools`. Spec aliases: `::mcp-stdio-server` = `::mcp-local-server`, `::mcp-http-server` = `::mcp-remote-server` | | `:commands` | vector | Command definitions (slash commands). See [Commands](#commands) | | `:custom-agents` | vector | Custom agent configs. Each agent map: `:agent-name` (required), `:agent-prompt` (required), `:agent-display-name`, `:agent-description`, `:agent-tools`, `:agent-infer?`, `:agent-skills` (vector of strings), `:agent-model` (string, e.g. `"claude-haiku-4.5"`; when set the runtime tries this model for the agent, falling back to the parent session model — upstream PR #1309), `:mcp-servers` | @@ -1995,11 +1999,12 @@ For full control (removes all guardrails), use `:mode :replace`: #### Customize Mode -The `:customize` mode enables section-level overrides of the system prompt. Eleven sections are configurable: +The `:customize` mode enables section-level overrides of the system prompt. Twelve sections are configurable: | Section | Description | |---------|-------------| -| `:identity` | Agent identity preamble and mode statement | +| `:preamble` | Agent identity preamble and mode statement (upstream PR #1713) | +| `:identity` | Section group covering the identity preamble and its sibling sub-sections (tone, tool efficiency, etc.) | | `:tone` | Response style, conciseness rules, output formatting | | `:tool-efficiency` | Tool usage patterns, parallel calling, batching | | `:environment-context` | CWD, OS, git root, directory listing, available tools | @@ -2011,7 +2016,7 @@ The `:customize` mode enables section-level overrides of the system prompt. Elev | `:runtime-instructions` | Runtime-provided context (system notifications, memories, mode-specific instructions, content-exclusion policy) — added in upstream PR #1377 | | `:last-instructions` | End-of-prompt instructions | -Each section supports static actions (`:replace`, `:remove`, `:append`, `:prepend`) and transform callbacks (1-arity functions). +Each section supports static actions (`:replace`, `:remove`, `:append`, `:prepend`, `:preserve`) and transform callbacks (1-arity functions). `:preserve` is a no-op marker that opts an individually-addressable section out of a group-level `:remove` — e.g. keep `:tone` when removing the `:identity` group (upstream PR #1713). ```clojure (require '[github.copilot-sdk :as copilot]) @@ -2046,15 +2051,16 @@ Inspect available sections with the `system-prompt-sections` constant: ```clojure copilot/system-prompt-sections -;; => {:identity {:description "Agent identity preamble and mode statement"} +;; => {:preamble {:description "Agent identity preamble and mode statement"} +;; :identity {:description "Section group covering the identity preamble ..."} ;; :tone {:description "Response style, conciseness rules, ..."} ;; :runtime-instructions {:description "Runtime instructions injected ..."} ...} ``` -Available section keys: `:identity`, `:tone`, `:tool-efficiency`, -`:environment-context`, `:code-change-rules`, `:guidelines`, `:safety`, -`:tool-instructions`, `:custom-instructions`, `:runtime-instructions` -(added in upstream PR #1377), `:last-instructions`. +Available section keys: `:preamble` (added in upstream PR #1713), `:identity`, +`:tone`, `:tool-efficiency`, `:environment-context`, `:code-change-rules`, +`:guidelines`, `:safety`, `:tool-instructions`, `:custom-instructions`, +`:runtime-instructions` (added in upstream PR #1377), `:last-instructions`. > **Naming note** — Upstream renamed `SystemPromptSection` → > `SystemMessageSection` in the TypeScript SDK. The Clojure SDK keeps From c6f63d87985841e13e09dae65f2efacdfd17a815 Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 14:04:43 +0200 Subject: [PATCH 05/15] fix(byok): pass :session-id to callback, reject :provider+:providers, harden errors Addresses the round-1 Copilot Code Review on PR #141: - C3/C4: the bearer-token callback now receives the full ProviderTokenArgs map {:provider-name :session-id }, matching the already-correct byok.md docs and upstream `ProviderTokenArgs` (types.ts). It previously dropped :session-id. - C1/C2: extract `validate-provider-config!`, shared by create and both resume paths, which now also rejects combining the singular :provider with the :providers registry (upstream documents the combination as rejected). - C5: the bearer-token error path no longer logs or returns the provider exception message, only the exception class name, so a secret carried in an exception cannot leak into logs or the JSON-RPC error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/github/copilot_sdk/client.clj | 25 ++++-- src/github/copilot_sdk/session.clj | 14 +-- test/github/copilot_sdk/integration_test.clj | 92 ++++++++++++++++---- 3 files changed, 98 insertions(+), 33 deletions(-) diff --git a/src/github/copilot_sdk/client.clj b/src/github/copilot_sdk/client.clj index 155be08..4f3f8cd 100644 --- a/src/github/copilot_sdk/client.clj +++ b/src/github/copilot_sdk/client.clj @@ -1531,6 +1531,19 @@ (util/wire->clj (proto/send-request! conn "mcp.config.remove" params)))) +(defn- validate-provider-config! + "Validate singular-`:provider` BYOK constraints shared by create and resume: + `:model` is required when `:provider` is set, and `:provider` cannot be + combined with the multi-provider `:providers` registry (upstream documents + the combination as rejected)." + [config] + (when (and (:provider config) (not (:model config))) + (throw (ex-info "Invalid session config: :model is required when :provider (BYOK) is specified" + {:config (redact-secrets config)}))) + (when (and (:provider config) (:providers config)) + (throw (ex-info "Invalid session config: :provider cannot be combined with the :providers registry (use one or the other)" + {:config (redact-secrets config)})))) + (defn- validate-session-config! "Validate session config, throwing on invalid input." [config] @@ -1545,9 +1558,7 @@ (format "Invalid session config: %s" (with-out-str (s/explain ::specs/session-config safe-config))))] (throw (ex-info msg {:config safe-config :unknown-keys unknown :explain explain})))) - (when (and (:provider config) (not (:model config))) - (throw (ex-info "Invalid session config: :model is required when :provider (BYOK) is specified" - {:config (redact-secrets config)})))) + (validate-provider-config! config)) (defn- validate-tool-filter-list! "Reject bare `\"*\"` in a tool filter list (mirrors upstream @@ -2482,9 +2493,7 @@ (throw (ex-info "Invalid resume session config" {:config safe-config :explain (s/explain-data ::specs/resume-session-config safe-config)})))) - (when (and (:provider config) (not (:model config))) - (throw (ex-info "Invalid session config: :model is required when :provider (BYOK) is specified" - {:config (redact-secrets config)}))) + (validate-provider-config! config) (validate-tool-filters! config) (validate-empty-mode-session-requirements! client config) (ensure-connected! client) @@ -2662,9 +2671,7 @@ (throw (ex-info "Invalid resume session config" {:config safe-config :explain (s/explain-data ::specs/resume-session-config safe-config)})))) - (when (and (:provider config) (not (:model config))) - (throw (ex-info "Invalid session config: :model is required when :provider (BYOK) is specified" - {:config (redact-secrets config)}))) + (validate-provider-config! config) (validate-tool-filters! config) (validate-empty-mode-session-requirements! client config) (ensure-connected! client) diff --git a/src/github/copilot_sdk/session.clj b/src/github/copilot_sdk/session.clj index c494ae4..fd8d221 100644 --- a/src/github/copilot_sdk/session.clj +++ b/src/github/copilot_sdk/session.clj @@ -780,9 +780,10 @@ The runtime issues this session-scoped request when a BYOK provider configured with a `:bearer-token-provider` callback needs a fresh token. The matching callback (looked up by `provider-name`) is invoked with the idiomatic - `ProviderTokenArgs` map `{:provider-name }` and must return the raw token - string (without the `Bearer ` prefix); a channel yielding the string is also - accepted. The runtime performs no caching, so the callback owns refresh." + `ProviderTokenArgs` map `{:provider-name :session-id }` and must + return the raw token string (without the `Bearer ` prefix); a channel yielding + the string is also accepted. The runtime performs no caching, so the callback + owns refresh." [client session-id provider-name] (async/thread-call (fn [] @@ -793,7 +794,7 @@ :message (str "No bearer-token provider registered for provider \"" provider-name "\"")}} (try - (let [result (callback {:provider-name provider-name}) + (let [result (callback {:provider-name provider-name :session-id session-id}) result (if (channel? result) ( e class .getName) ")") {:error {:code -32001 - :message (str "Bearer-token provider error: " (ex-message e))}}))))) + :message "Bearer-token provider error"}}))))) :io)) (defn handle-hooks-invoke! diff --git a/test/github/copilot_sdk/integration_test.clj b/test/github/copilot_sdk/integration_test.clj index f79a9f8..bed25c6 100644 --- a/test/github/copilot_sdk/integration_test.clj +++ b/test/github/copilot_sdk/integration_test.clj @@ -2291,14 +2291,60 @@ (is (s/valid? :github.copilot-sdk.specs/session-config {:exp-assignments {"a" 1}})))) +(deftest test-v1-0-4-provider-and-providers-mutually-exclusive + (testing "combining singular :provider with the :providers registry is rejected on both create and resume (upstream ProviderTokenArgs/SessionConfig contract, PR #1718)" + ;; Upstream documents that combining `providers`/`models` with the singular + ;; `provider` is rejected; the SDK forwards both to the runtime which rejects + ;; the combination. We fail fast client-side with a clear message — a + ;; Clojure-only convenience that never alters the wire for any valid config + ;; (the combination is invalid everywhere). + (let [cfg {:on-permission-request sdk/approve-all + :model "m" + :provider {:base-url "https://single.test"} + :providers [{:name "p" :base-url "https://registry.test"}]}] + (is (thrown-with-msg? clojure.lang.ExceptionInfo + #"(?i):provider.*cannot be combined.*:providers" + (sdk/create-session *test-client* cfg)) + "create-session rejects :provider + :providers") + (let [ok-session (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :model "m"}) + session-id (sdk/session-id ok-session)] + (is (thrown-with-msg? clojure.lang.ExceptionInfo + #"(?i):provider.*cannot be combined.*:providers" + (sdk/resume-session *test-client* session-id cfg)) + "resume-session rejects :provider + :providers"))))) + +(deftest test-v1-0-4-bearer-token-exception-message-not-leaked + (testing "an exception thrown by a bearer-token callback never leaks its message to logs or the runtime (SEC)" + ;; The callback mints credentials; an exception it raises can easily carry + ;; sensitive material in its message (e.g. a token echoed in an auth error). + ;; The JSON-RPC error returned to the runtime must be generic and the log + ;; must record only the exception class, never `ex-message`. Handler invoked + ;; directly so `thread-call` conveys the `with-log` binding to the io thread. + (let [secret "tok_LEAKED_IN_EXCEPTION_MESSAGE_456" + session (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :model "fallback-model" + :provider {:base-url "https://oai.test" + :bearer-token-provider + (fn [_] (throw (ex-info secret {})))}}) + session-id (sdk/session-id session)] + (log-test/with-log + (let [resp ( Date: Sat, 27 Jun 2026 14:04:46 +0200 Subject: [PATCH 06/15] docs: correct open-canvases changelog wording The open-canvas instance requires all three id fields (:instance-id, :extension-id, :canvas-id); the changelog entry omitted :instance-id. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26b9326..dab60d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,8 +49,9 @@ Ported from upstream `github/copilot-sdk` v1.0.1 → v1.0.4 (`@github/copilot` Public `event-types` / `session-events` entries added where upstream exposes a public SDK event. - **`open-canvases` validation relaxed** — parity with upstream `session.ts`: - an open-canvas instance now requires only `:extension-id` + `:canvas-id` - (dropped the `:reopen` / `:availability` requirements). + an open-canvas instance now requires only the three id fields `:instance-id` + + `:extension-id` + `:canvas-id` (dropped the `:reopen` / `:availability` + requirements). ### Changed (v1.0.4 sync) - **`redact-secrets` masks the `:providers` registry** — the validation-error From c463d2b57dcf2a9a0f2e725d1018ac3b8b6a2d43 Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 14:12:08 +0200 Subject: [PATCH 07/15] fix(codegen): fail loudly on real tar errors in extract-schemas! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses round-2 Copilot Code Review on PR #141. `extract-schemas!` treated any non-zero `tar` exit as "no schemas in this package" and returned false, silently routing genuine failures (corrupt download, missing `tar`, permission errors) into the split-package fallback. Now only the expected split-package case — tar reporting "Not found in archive" for the `package/schemas` member, emitted by both GNU and BSD tar — returns false. Any other tar failure prints stderr and exits non-zero so it can't be masked. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- script/codegen/fetch_schemas.clj | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/script/codegen/fetch_schemas.clj b/script/codegen/fetch_schemas.clj index 4f38e7b..14cd8ac 100644 --- a/script/codegen/fetch_schemas.clj +++ b/script/codegen/fetch_schemas.clj @@ -71,16 +71,25 @@ ;; Tarball layout: package/schemas/*.json (npm convention prepends `package/`). ;; Extract into a dedicated `schemas` subdir so we can copy from a ;; clean directory (avoids accidentally picking up package.json or - ;; other extracted files). Returns true on success, false if the tarball - ;; carries no `package/schemas` directory (newer split-package layout). + ;; other extracted files). Returns true on success, false only when the + ;; tarball legitimately carries no `package/schemas` directory (newer + ;; split-package layout — both GNU and BSD tar report "Not found in + ;; archive"). Any other tar failure (corrupt download, missing `tar`, + ;; permissions) is fatal, so a real error can't be silently masked as a + ;; split-package fallback. (println (format "Extracting schemas from %s" tgz)) (fs/create-dirs dest-dir) - (let [{:keys [exit]} + (let [{:keys [exit err]} @(p/process ["tar" "-xzf" tgz "-C" dest-dir "--strip-components=1" "package/schemas"] {:err :string :out :string})] - (zero? exit))) + (cond + (zero? exit) true + (str/includes? (str/lower-case (or err "")) "not found in archive") false + :else (do + (println "tar (schemas) failed:" err) + (System/exit exit))))) (defn extract-package-json! [tgz dest-dir] ;; Extract package/package.json into dest-dir so we can verify its declared From 7904a64b1ffc753bfd8038c1e6f296c5496ca420 Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 14:26:53 +0200 Subject: [PATCH 08/15] fix(client): redact :providers registry regardless of collection type redact-secrets runs on the already-invalid config in the error path of validate-session-config!, so it cannot assume the spec has constrained :providers to a sequential collection. A set-valued (or any non-sequential) :providers registry previously bypassed masking and leaked api-key / bearer-token / header secrets into the thrown ex-data. Mask any non-map collection instead of only sequential ones. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/github/copilot_sdk/client.clj | 5 ++++- test/github/copilot_sdk/integration_test.clj | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/github/copilot_sdk/client.clj b/src/github/copilot_sdk/client.clj index 4f3f8cd..baa10d1 100644 --- a/src/github/copilot_sdk/client.clj +++ b/src/github/copilot_sdk/client.clj @@ -123,7 +123,10 @@ (map? (:provider m)) (update :provider mask-provider) - (sequential? (:providers m)) + ;; ::providers is a `coll-of` — it accepts any collection (vector, list, + ;; set), and redact-secrets runs on *already-invalid* configs in the error + ;; path, so masking must not depend on the collection being sequential. + (and (coll? (:providers m)) (not (map? (:providers m)))) (update :providers (fn [ps] (mapv mask-provider ps))) (contains? m :mcp-servers) diff --git a/test/github/copilot_sdk/integration_test.clj b/test/github/copilot_sdk/integration_test.clj index bed25c6..4a10075 100644 --- a/test/github/copilot_sdk/integration_test.clj +++ b/test/github/copilot_sdk/integration_test.clj @@ -6137,6 +6137,19 @@ (is (not (leaked? e named-key)) "named provider :api-key must be redacted") (is (not (leaked? e named-bearer)) "named provider :bearer-token must be redacted") (is (not (leaked? e named-hdr)) "named provider :headers value must be redacted"))) + (testing "session-config BYOK :providers as a non-sequential collection (set)" + ;; redact-secrets runs on the *already-invalid* config in the error path, + ;; so it must not rely on ::providers being sequential. A set of providers + ;; (still a valid ::coll-of) must have its secrets masked too. + (let [c (sdk/client {:auto-start? false}) + set-key "sk-setSECRET111"] + (let [e (capture #(sdk/create-session + c {:providers #{{:name "openai" :base-url "https://o.test" + :api-key set-key}} + :totally-unknown-key 1}))] + (is (some? e) "an unknown key should fail validation") + (is (not (leaked? e set-key)) + "set-valued :providers entry :api-key must still be redacted")))) (testing "resume-config BYOK provider api-key" (let [c (sdk/client {:auto-start? false}) e (capture #(sdk/resume-session c "sid" {:provider {:provider-type "azure" :api-key azure-key}}))] From 7136059e2709e5b400a21d081cba5fe58db44265 Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 14:27:09 +0200 Subject: [PATCH 09/15] fix(specs): reject transport/model-override keys on named providers ::named-provider used an open s/keys, so a registry entry carrying singular- provider-only fields (:transport, :model-id, :wire-model, :max-input-tokens, :max-output-tokens) validated and was then forwarded on the wire, contradicting the upstream NamedProviderConfig contract. Reject those keys at the spec so the mistake fails fast at validate-session-config! rather than silently shipping unsupported fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/github/copilot_sdk/specs.clj | 8 +++++++- test/github/copilot_sdk/integration_test.clj | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/github/copilot_sdk/specs.clj b/src/github/copilot_sdk/specs.clj index ae99052..8b74343 100644 --- a/src/github/copilot_sdk/specs.clj +++ b/src/github/copilot_sdk/specs.clj @@ -481,7 +481,13 @@ :opt-un [::provider-type ::wire-api ::api-key ::bearer-token ::azure-options ::headers ::bearer-token-provider]) #(s/valid? ::non-blank-string (:name %)) - #(not (str/includes? (:name %) "/")))) + #(not (str/includes? (:name %) "/")) + ;; `s/keys` is open, so reject the singular-provider-only transport / + ;; model-override keys explicitly — otherwise they would pass validation and + ;; silently forward on the wire, contradicting the NamedProviderConfig + ;; contract (those fields live on ::provider / ::provider-model). + #(empty? (select-keys % [:transport :model-id :wire-model + :max-input-tokens :max-output-tokens])))) ;; ModelCapabilitiesOverride — opaque to the SDK. Forwarded verbatim, so keys ;; must be strings (upstream uses a mix of camelCase and snake_case wire keys diff --git a/test/github/copilot_sdk/integration_test.clj b/test/github/copilot_sdk/integration_test.clj index 4a10075..51f4e3e 100644 --- a/test/github/copilot_sdk/integration_test.clj +++ b/test/github/copilot_sdk/integration_test.clj @@ -2246,6 +2246,19 @@ (is (false? (s/valid? :github.copilot-sdk.specs/named-provider {:name "has/slash" :base-url "https://x.test"})) "named provider :name must not contain '/'") + ;; A named provider carries no transport or inline model-override fields + ;; (upstream NamedProviderConfig, PR #1718) — those belong on the singular + ;; ::provider / ::provider-model. The spec must reject them so misuse fails + ;; fast at validate-session-config! instead of silently forwarding on the wire. + (is (false? (s/valid? :github.copilot-sdk.specs/named-provider + {:name "p" :base-url "https://x.test" :transport :http})) + ":transport is not a named-provider field") + (is (false? (s/valid? :github.copilot-sdk.specs/named-provider + {:name "p" :base-url "https://x.test" :model-id "gpt-4o"})) + ":model-id is not a named-provider field") + (is (false? (s/valid? :github.copilot-sdk.specs/named-provider + {:name "p" :base-url "https://x.test" :max-input-tokens 1000})) + "model-override token limits are not named-provider fields") (is (s/valid? :github.copilot-sdk.specs/provider-model {:id "m" :provider "p"})) (is (false? (s/valid? :github.copilot-sdk.specs/provider-model From aa9fd382dc23feb6dcb7e1eb50ce2fc9cb5c2cea Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 14:27:24 +0200 Subject: [PATCH 10/15] docs(specs): correct ::bearer-token-provider callback args The callback receives the full ProviderTokenArgs map {:provider-name :session-id }, matching the session.clj dispatch and the byok.md documentation. The doc comment previously omitted :session-id. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/github/copilot_sdk/specs.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/github/copilot_sdk/specs.clj b/src/github/copilot_sdk/specs.clj index 8b74343..47fa606 100644 --- a/src/github/copilot_sdk/specs.clj +++ b/src/github/copilot_sdk/specs.clj @@ -408,7 +408,8 @@ (s/def ::transport #{:http :websockets}) ;; On-demand bearer-token callback (upstream PR #1748, @experimental). A 1-arg -;; function receiving an idiomatic `ProviderTokenArgs` map `{:provider-name }` +;; function receiving an idiomatic `ProviderTokenArgs` map +;; `{:provider-name :session-id }` ;; and returning the raw token string (a channel yielding the string is also ;; accepted). Applies to both ::provider and ::named-provider. The fn is never ;; serialized — provider->wire strips it and emits `hasBearerTokenProvider: true`. From 87abf3a2fb2c8f972d4a208aa55fd8e097d71178 Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 14:27:35 +0200 Subject: [PATCH 11/15] fix(specs): reject content on :remove/:preserve section overrides :remove and :preserve are no-op markers that carry no content payload (upstream PR #1713). ::section-override previously accepted a :content string for them, so a caller mistake was silently dropped rather than rejected. Add a predicate that fails fast when :content accompanies either action. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/github/copilot_sdk/specs.clj | 5 +++++ test/github/copilot_sdk/integration_test.clj | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/github/copilot_sdk/specs.clj b/src/github/copilot_sdk/specs.clj index 47fa606..a2cf9ec 100644 --- a/src/github/copilot_sdk/specs.clj +++ b/src/github/copilot_sdk/specs.clj @@ -309,6 +309,11 @@ #(if (and (keyword? (:action %)) (#{:replace :append :prepend} (:action %))) (string? (:content %)) + true) + ;; The no-op markers carry no payload — reject stray :content so a + ;; caller mistake fails fast instead of being silently dropped. + #(if (#{:remove :preserve} (:action %)) + (not (contains? % :content)) true))) ;; Customize config: mode :customize with optional sections map and content diff --git a/test/github/copilot_sdk/integration_test.clj b/test/github/copilot_sdk/integration_test.clj index 51f4e3e..3455090 100644 --- a/test/github/copilot_sdk/integration_test.clj +++ b/test/github/copilot_sdk/integration_test.clj @@ -2085,7 +2085,16 @@ ":preserve must validate as a static section action") ;; :preserve is a no-op marker — content is NOT required (unlike replace/append/prepend) (is (s/valid? :github.copilot-sdk.specs/section-override {:action :preserve}) - ":preserve override needs no :content")) + ":preserve override needs no :content") + ;; ...and it carries no content: a content-bearing :preserve/:remove is a + ;; caller mistake the spec must reject (upstream PR #1713 — these actions + ;; have no content payload). + (is (false? (s/valid? :github.copilot-sdk.specs/section-override + {:action :preserve :content "x"})) + ":preserve must reject :content") + (is (false? (s/valid? :github.copilot-sdk.specs/section-override + {:action :remove :content "x"})) + ":remove must reject :content")) (testing ":preserve action survives the create-session wire conversion" (let [seen (atom {}) _ (mock/set-request-hook! *mock-server* From 20779872c6a5c3933c3c41a89e634cb2496a3db3 Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 14:35:48 +0200 Subject: [PATCH 12/15] fix(client): redact map-valued :providers registry in error path redact-secrets runs on already-invalid configs, so a caller mistake of passing :providers as a map (name->provider-config) instead of a sequential collection must still have its secret-bearing values masked. The previous guard explicitly skipped maps, leaking :api-key/:bearer-token/:headers into thrown ex-data. Extract a mask-providers helper that dispatches on shape (map vs other coll). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/github/copilot_sdk/client.clj | 23 +++++++++++++++----- test/github/copilot_sdk/integration_test.clj | 21 ++++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/github/copilot_sdk/client.clj b/src/github/copilot_sdk/client.clj index baa10d1..94486ce 100644 --- a/src/github/copilot_sdk/client.clj +++ b/src/github/copilot_sdk/client.clj @@ -105,6 +105,18 @@ (mask-present [:api-key :bearer-token]) (cond-> (map? (:headers p)) (update :headers mask-all-values))))) +(defn- mask-providers + "Mask every provider in a `:providers` registry value. The valid shape is a + sequential collection of provider maps, but redact-secrets runs on + already-invalid configs, so a caller may have supplied a map (name->config) + or any other collection — mask the secret-bearing fields in every case so + nothing leaks into thrown ex-data." + [ps] + (cond + (map? ps) (reduce-kv (fn [acc k v] (assoc acc k (mask-provider v))) (empty ps) ps) + (coll? ps) (mapv mask-provider ps) + :else ps)) + (defn- redact-secrets "Mask secret values in a caller-supplied options/config map so it can be embedded in exception data and messages without leaking credentials. Masks the top-level @@ -123,11 +135,12 @@ (map? (:provider m)) (update :provider mask-provider) - ;; ::providers is a `coll-of` — it accepts any collection (vector, list, - ;; set), and redact-secrets runs on *already-invalid* configs in the error - ;; path, so masking must not depend on the collection being sequential. - (and (coll? (:providers m)) (not (map? (:providers m)))) - (update :providers (fn [ps] (mapv mask-provider ps))) + ;; ::providers is a `coll-of` — the valid shape is sequential, but + ;; redact-secrets runs on *already-invalid* configs in the error path, so + ;; masking must cover any collection (vector, list, set) AND an erroneous + ;; map-valued registry. mask-providers dispatches on the shape. + (coll? (:providers m)) + (update :providers mask-providers) (contains? m :mcp-servers) (update :mcp-servers redact-mcp-servers)))) diff --git a/test/github/copilot_sdk/integration_test.clj b/test/github/copilot_sdk/integration_test.clj index 3455090..66ca423 100644 --- a/test/github/copilot_sdk/integration_test.clj +++ b/test/github/copilot_sdk/integration_test.clj @@ -6172,6 +6172,27 @@ (is (some? e) "an unknown key should fail validation") (is (not (leaked? e set-key)) "set-valued :providers entry :api-key must still be redacted")))) + (testing "session-config BYOK :providers as an (invalid) map of name->config" + ;; The valid ::providers shape is a sequential collection, but + ;; redact-secrets runs on the *already-invalid* config in the error + ;; path. A caller mistake of passing a map (name->provider-config) must + ;; still have its secret-bearing values masked, not leaked verbatim. + (let [c (sdk/client {:auto-start? false}) + map-key "sk-mapSECRET222" + map-bearer "mapBearerSECRET333" + map-hdr "Bearer mapHdrSECRET444"] + (let [e (capture #(sdk/create-session + c {:providers {:openai {:base-url "https://o.test" + :api-key map-key + :bearer-token map-bearer + :headers {"Authorization" map-hdr}}}}))] + (is (some? e) "a map-valued :providers should fail validation") + (is (not (leaked? e map-key)) + "map-valued :providers entry :api-key must still be redacted") + (is (not (leaked? e map-bearer)) + "map-valued :providers entry :bearer-token must still be redacted") + (is (not (leaked? e map-hdr)) + "map-valued :providers entry :headers value must still be redacted")))) (testing "resume-config BYOK provider api-key" (let [c (sdk/client {:auto-start? false}) e (capture #(sdk/resume-session c "sid" {:provider {:provider-type "azure" :api-key azure-key}}))] From 85a99830134359e74b6e99fc6c0d47d6ab2d83fe Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 14:44:11 +0200 Subject: [PATCH 13/15] docs: clarify named providers reject :transport and inline model overrides Copilot Code Review (round 5) flagged that both the API.md `:providers` row and the CHANGELOG `:transport` entry implied registry named providers accept `:transport` and inline model-override fields. They do not: `::named-provider` explicitly rejects `:transport`, `:model-id`, `:wire-model`, `:max-input-tokens`, and `:max-output-tokens` (those live on the singular `:provider` / on `:models`), matching upstream's `NamedProviderConfig`. - API.md `:providers` row now enumerates the exact connection fields a named provider accepts and states it does not take `:transport`/inline overrides. - CHANGELOG `:transport` entry now scopes the field to the singular `:provider`. - Regenerated doc/api HTML (also picks up the committed `:session-id` ProviderTokenArgs docstring fix in session.html). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 7 ++++--- doc/api/API.html | 2 +- doc/api/github.copilot-sdk.session.html | 2 +- doc/reference/API.md | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dab60d5..9535252 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,9 +19,10 @@ Ported from upstream `github/copilot-sdk` v1.0.1 → v1.0.4 (`@github/copilot` boolean}`), wire-encoded as `capi.enableWebSocketResponses`. Added `::capi` and `::enable-web-socket-responses` specs. - **Provider `:transport`** — port of upstream - [PR #1711](https://github.com/github/copilot-sdk/pull/1711). The BYOK `:provider` - (and registry named providers) accept an optional `:transport` (`:http` or - `:websockets`), emitted as wire `transport`. Added `::transport` spec. + [PR #1711](https://github.com/github/copilot-sdk/pull/1711). The singular BYOK + `:provider` accepts an optional `:transport` (`:http` or `:websockets`), emitted + as wire `transport`. Registry named providers (in `:providers`) do **not** accept + `:transport`, matching upstream's `NamedProviderConfig`. Added `::transport` spec. - **Multi-provider BYOK registry (`:providers` / `:models`)** — port of upstream [PR #1718](https://github.com/github/copilot-sdk/pull/1718) (`@experimental`). `create-session` and `resume-session` accept `:providers` (a vector of named diff --git a/doc/api/API.html b/doc/api/API.html index e007a3a..f61e87d 100644 --- a/doc/api/API.html +++ b/doc/api/API.html @@ -176,7 +176,7 @@

        with-clien :available-tools vector List of allowed tool names :excluded-tools vector List of excluded tool names :provider map Provider config for BYOK (see BYOK docs). Required key: :base-url. Optional: :provider-type (:openai/:azure/:anthropic), :wire-api (:completions/:responses), :api-key, :bearer-token, :azure-options, :headers (map of HTTP header name→value, sent with each provider request — upstream PR #1094), :model-id (string — the model identifier to send to the provider; overrides session :model), :wire-model (string — model name as sent on the provider wire when it differs from :model-id), :max-input-tokens (integer — input/prompt token cap; serialized as wire maxPromptTokens), :max-output-tokens (integer — output token cap), :transport (:http/:websockets — provider transport; serialized as wire transport — upstream PR #1711), :bearer-token-provider (fn — dynamic bearer-token callback, see BYOK docs — upstream PR #1748). The four override fields were added in upstream PR #966 - :providers vector (Experimental) Multi-provider BYOK registry — a vector of named providers. Each entry has the same fields as :provider plus a required :name (the registry key, no /) and a :bearer-token-provider callback. Pairs with :models to declare a model catalog. Cannot be combined with the singular :provider. (upstream PR #1718) + :providers vector (Experimental) Multi-provider BYOK registry — a vector of named providers. Each entry takes the connection fields of :provider:base-url (required), :provider-type, :wire-api, :api-key, :bearer-token, :azure-options, :headers, :bearer-token-provider — plus a required :name (the registry key, no /). Unlike the singular :provider, a named provider does not accept :transport or the inline model-override fields (:model-id, :wire-model, :max-input-tokens, :max-output-tokens); model overrides are declared in :models instead. Pairs with :models to declare a model catalog. Cannot be combined with the singular :provider. (upstream PR #1718) :models vector (Experimental) Model catalog referencing the :providers registry. Each entry: :id (required, provider-local model id), :provider (required, a :name in :providers), and optional override fields (:model-id, :wire-model, :capabilities, :max-input-tokens, :max-context-window-tokens, :max-output-tokens). The full model selection id is "providerName/id". (upstream PR #1718) :capi map CAPI (Copilot API) session options. {:enable-web-socket-responses boolean} — serialized as wire capi.enableWebSocketResponses. (upstream PR #1711) :exp-assignments map (Internal) Opaque experiment flight assignments. Keys are source-defined flight ids and are forwarded verbatim (string keys bypass kebab→camel conversion). Serialized as expAssignments. (upstream PR #1750) diff --git a/doc/api/github.copilot-sdk.session.html b/doc/api/github.copilot-sdk.session.html index 07fa566..32edaba 100644 --- a/doc/api/github.copilot-sdk.session.html +++ b/doc/api/github.copilot-sdk.session.html @@ -68,7 +68,7 @@

        Returns the RPC result map (sync). Use <handle-pending-tool-call! for the core.async variant.

      handle-permission-request!

      (handle-permission-request! client session-id request)

      Handle an incoming permission request. Returns a channel with the result. When the handler returns {:kind :no-result}, the result is {:result :no-result} — callers must check for this sentinel: - v3 (broadcast path): skip the handlePendingPermissionRequest RPC entirely so the extension does not answer this permission request. - v2 (request-handler path): propagate as a JSON-RPC internal error (code -32603) so the CLI knows the request was not handled.

      handle-provider-token-request!

      (handle-provider-token-request! client session-id provider-name)

      Handle an incoming providerToken.getToken request (upstream PR #1748). Returns a channel with the result.

      -

      The runtime issues this session-scoped request when a BYOK provider configured with a :bearer-token-provider callback needs a fresh token. The matching callback (looked up by provider-name) is invoked with the idiomatic ProviderTokenArgs map {:provider-name <name>} and must return the raw token string (without the Bearer prefix); a channel yielding the string is also accepted. The runtime performs no caching, so the callback owns refresh.

      +

      The runtime issues this session-scoped request when a BYOK provider configured with a :bearer-token-provider callback needs a fresh token. The matching callback (looked up by provider-name) is invoked with the idiomatic ProviderTokenArgs map {:provider-name <name> :session-id <id>} and must return the raw token string (without the Bearer prefix); a channel yielding the string is also accepted. The runtime performs no caching, so the callback owns refresh.

      handle-session-fs-request!

      (handle-session-fs-request! client session-id method params)

      Handle an incoming sessionFs.* RPC request. Dispatches to the session’s FS handler and returns a channel with {:result …} or {:error …}.

      For sessionFs.sqliteQuery / sqliteExists (upstream PR #1299), exceptions from the provider propagate as JSON-RPC errors rather than being wrapped in a SessionFsError result map, matching upstream Node behavior.

      handle-system-message-transform

      (handle-system-message-transform client session-id sections)

      Handle a systemMessage.transform RPC request from the CLI runtime. Dispatches each section to its registered transform callback. On callback error, returns the original content (graceful fallback).

      diff --git a/doc/reference/API.md b/doc/reference/API.md index b8b9e3c..c121884 100644 --- a/doc/reference/API.md +++ b/doc/reference/API.md @@ -252,7 +252,7 @@ Create a client and session together, ensuring both are cleaned up on exit. | `:available-tools` | vector | List of allowed tool names | | `:excluded-tools` | vector | List of excluded tool names | | `:provider` | map | Provider config for BYOK (see [BYOK docs](../auth/byok.md)). Required key: `:base-url`. Optional: `:provider-type` (`:openai`/`:azure`/`:anthropic`), `:wire-api` (`:completions`/`:responses`), `:api-key`, `:bearer-token`, `:azure-options`, `:headers` (map of HTTP header name→value, sent with each provider request — upstream PR #1094), `:model-id` (string — the model identifier to send to the provider; overrides session `:model`), `:wire-model` (string — model name as sent on the provider wire when it differs from `:model-id`), `:max-input-tokens` (integer — input/prompt token cap; serialized as wire `maxPromptTokens`), `:max-output-tokens` (integer — output token cap), `:transport` (`:http`/`:websockets` — provider transport; serialized as wire `transport` — upstream PR #1711), `:bearer-token-provider` (fn — dynamic bearer-token callback, see [BYOK docs](../auth/byok.md#dynamic-bearer-tokens) — upstream PR #1748). The four override fields were added in upstream PR #966 | -| `:providers` | vector | (Experimental) Multi-provider BYOK registry — a vector of named providers. Each entry has the same fields as `:provider` plus a required `:name` (the registry key, no `/`) and a `:bearer-token-provider` callback. Pairs with `:models` to declare a model catalog. Cannot be combined with the singular `:provider`. (upstream PR #1718) | +| `:providers` | vector | (Experimental) Multi-provider BYOK registry — a vector of named providers. Each entry takes the connection fields of `:provider` — `:base-url` (required), `:provider-type`, `:wire-api`, `:api-key`, `:bearer-token`, `:azure-options`, `:headers`, `:bearer-token-provider` — plus a required `:name` (the registry key, no `/`). Unlike the singular `:provider`, a named provider does **not** accept `:transport` or the inline model-override fields (`:model-id`, `:wire-model`, `:max-input-tokens`, `:max-output-tokens`); model overrides are declared in `:models` instead. Pairs with `:models` to declare a model catalog. Cannot be combined with the singular `:provider`. (upstream PR #1718) | | `:models` | vector | (Experimental) Model catalog referencing the `:providers` registry. Each entry: `:id` (required, provider-local model id), `:provider` (required, a `:name` in `:providers`), and optional override fields (`:model-id`, `:wire-model`, `:capabilities`, `:max-input-tokens`, `:max-context-window-tokens`, `:max-output-tokens`). The full model selection id is `"providerName/id"`. (upstream PR #1718) | | `:capi` | map | CAPI (Copilot API) session options. `{:enable-web-socket-responses boolean}` — serialized as wire `capi.enableWebSocketResponses`. (upstream PR #1711) | | `:exp-assignments` | map | (Internal) Opaque experiment flight assignments. Keys are source-defined flight ids and are forwarded verbatim (string keys bypass kebab→camel conversion). Serialized as `expAssignments`. (upstream PR #1750) | From fbaafa1a64a32cd6cdc453a605aee433888b60ed Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 14:53:51 +0200 Subject: [PATCH 14/15] docs: fence tool-set namespace docstring examples as a clojure code block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copilot Code Review (round 6) flagged that the generated github.copilot-sdk.tool-set HTML rendered the docstring examples with typographic smart quotes and even wrapped quoted strings in autolinks, making the Clojure snippets invalid and non-copyable. Root cause: codox strips the docstring's common 3-space prose indent, which left the example lines at only 2 spaces — below markdown's 4-space code-block threshold — so they were processed as prose (smartypants + autolinking). Wrap the examples in a fenced ```clojure block so they render in a
       block with straight quotes and no
      autolinks. Regenerated the namespace HTML.
      
      Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
      ---
       doc/api/github.copilot-sdk.tool-set.html | 10 ++++++++--
       src/github/copilot_sdk/tool_set.clj      | 14 ++++++++------
       2 files changed, 16 insertions(+), 8 deletions(-)
      
      diff --git a/doc/api/github.copilot-sdk.tool-set.html b/doc/api/github.copilot-sdk.tool-set.html
      index 4abf5f0..63d000d 100644
      --- a/doc/api/github.copilot-sdk.tool-set.html
      +++ b/doc/api/github.copilot-sdk.tool-set.html
      @@ -4,8 +4,14 @@
       

      The runtime matches each tool reference against patterns of the form "<source>:<name>" where source is one of builtin, mcp, or custom and name is either a literal tool name or the wildcard "*". The bare wildcard "*" (no source) is intentionally rejected by the SDK — apps must explicitly opt into a source so an absent source can never silently grant access to unexpected tools.

      Mirrors upstream ToolSet and BuiltInTools from nodejs/src/toolSet.ts (upstream PR #1428).

      Examples:

      -

      (tool-set/builtin “ask_user”) ;; => “builtin:ask_user” (tool-set/builtin “*”) ;; => “builtin:*” (tool-set/mcp “*”) ;; => “mcp:*” (tool-set/builtins “task” “skill”) ;; => “builtin:task” “builtin:skill”

      -

      ;; Ready-to-use: every built-in that is safely session-bounded. tool-set/isolated ;; => “builtin:ask_user” “builtin:task_complete” …

      +
      (tool-set/builtin "ask_user")  ;; => "builtin:ask_user"
      +(tool-set/builtin "*")          ;; => "builtin:*"
      +(tool-set/mcp "*")              ;; => "mcp:*"
      +(tool-set/builtins ["task" "skill"]) ;; => ["builtin:task" "builtin:skill"]
      +
      +;; Ready-to-use: every built-in that is safely session-bounded.
      +tool-set/isolated  ;; => ["builtin:ask_user" "builtin:task_complete" ...]
      +

      builtin

      (builtin name)

      Returns the filter pattern "builtin:<name>". name may be the wildcard "*". Throws on invalid names.

      builtins

      (builtins names)

      Returns a vector of "builtin:<name>" patterns, one per entry in names. Throws on the first invalid name.

      custom

      (custom name)

      Returns the filter pattern "custom:<name>". name may be the wildcard "*". Throws on invalid names.

      diff --git a/src/github/copilot_sdk/tool_set.clj b/src/github/copilot_sdk/tool_set.clj index bb4c037..594a319 100644 --- a/src/github/copilot_sdk/tool_set.clj +++ b/src/github/copilot_sdk/tool_set.clj @@ -14,13 +14,15 @@ Examples: - (tool-set/builtin \"ask_user\") ;; => \"builtin:ask_user\" - (tool-set/builtin \"*\") ;; => \"builtin:*\" - (tool-set/mcp \"*\") ;; => \"mcp:*\" - (tool-set/builtins [\"task\" \"skill\"]) ;; => [\"builtin:task\" \"builtin:skill\"] + ```clojure + (tool-set/builtin \"ask_user\") ;; => \"builtin:ask_user\" + (tool-set/builtin \"*\") ;; => \"builtin:*\" + (tool-set/mcp \"*\") ;; => \"mcp:*\" + (tool-set/builtins [\"task\" \"skill\"]) ;; => [\"builtin:task\" \"builtin:skill\"] - ;; Ready-to-use: every built-in that is safely session-bounded. - tool-set/isolated ;; => [\"builtin:ask_user\" \"builtin:task_complete\" ...]") + ;; Ready-to-use: every built-in that is safely session-bounded. + tool-set/isolated ;; => [\"builtin:ask_user\" \"builtin:task_complete\" ...] + ```") (def ^:private valid-name-regex "Allowed characters in a tool name segment (mirrors upstream `nameRe`)." From dc69ab2e16058702bc99d999cc8ff5e4d4c2bef3 Mon Sep 17 00:00:00 2001 From: Karl Krukow Date: Sat, 27 Jun 2026 15:01:46 +0200 Subject: [PATCH 15/15] fix(byok): reject :provider combined with :models, not just :providers validate-provider-config! enforced mutual exclusion of the singular :provider only against :providers. A config with :provider + :models (no :providers) slipped through the guard and serialized a contradictory wire payload. Upstream documents combining EITHER providers or models with the singular provider as rejected (nodejs/src/types.ts:1829), so generalize the second guard to fire on :provider + (:providers OR :models). Docs (API.md :models row, byok.md) and CHANGELOG updated to state the exclusion covers both registry keys. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 4 ++-- doc/auth/byok.md | 2 +- doc/reference/API.md | 2 +- src/github/copilot_sdk/client.clj | 9 +++---- test/github/copilot_sdk/integration_test.clj | 25 ++++++++++++++++++++ 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9535252..5e93edb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,8 +28,8 @@ Ported from upstream `github/copilot-sdk` v1.0.1 → v1.0.4 (`@github/copilot` `create-session` and `resume-session` accept `:providers` (a vector of named providers) and `:models` (a model catalog referencing them by `:name`). A model selection id is `"providerName/id"`. Combining the singular `:provider` with - `:providers` is rejected. Added `::named-provider`, `::provider-model`, - `::providers`, and `::models` specs. + either `:providers` or `:models` is rejected. Added `::named-provider`, + `::provider-model`, `::providers`, and `::models` specs. - **`:bearer-token-provider` callback** — port of upstream [PR #1748](https://github.com/github/copilot-sdk/pull/1748) (`@experimental`). Providers accept a `:bearer-token-provider` function for dynamic, per-request diff --git a/doc/auth/byok.md b/doc/auth/byok.md index a32b3b8..3723297 100644 --- a/doc/auth/byok.md +++ b/doc/auth/byok.md @@ -229,7 +229,7 @@ has a required `:id` (provider-local model id) and `:provider` (a name in :model "openai/gpt-5.4"})) ``` -`:providers` cannot be combined with the singular `:provider`. +`:providers` and `:models` cannot be combined with the singular `:provider` — use the multi-provider registry or the whole-session `:provider`, not both. ## Limitations diff --git a/doc/reference/API.md b/doc/reference/API.md index c121884..1aad239 100644 --- a/doc/reference/API.md +++ b/doc/reference/API.md @@ -253,7 +253,7 @@ Create a client and session together, ensuring both are cleaned up on exit. | `:excluded-tools` | vector | List of excluded tool names | | `:provider` | map | Provider config for BYOK (see [BYOK docs](../auth/byok.md)). Required key: `:base-url`. Optional: `:provider-type` (`:openai`/`:azure`/`:anthropic`), `:wire-api` (`:completions`/`:responses`), `:api-key`, `:bearer-token`, `:azure-options`, `:headers` (map of HTTP header name→value, sent with each provider request — upstream PR #1094), `:model-id` (string — the model identifier to send to the provider; overrides session `:model`), `:wire-model` (string — model name as sent on the provider wire when it differs from `:model-id`), `:max-input-tokens` (integer — input/prompt token cap; serialized as wire `maxPromptTokens`), `:max-output-tokens` (integer — output token cap), `:transport` (`:http`/`:websockets` — provider transport; serialized as wire `transport` — upstream PR #1711), `:bearer-token-provider` (fn — dynamic bearer-token callback, see [BYOK docs](../auth/byok.md#dynamic-bearer-tokens) — upstream PR #1748). The four override fields were added in upstream PR #966 | | `:providers` | vector | (Experimental) Multi-provider BYOK registry — a vector of named providers. Each entry takes the connection fields of `:provider` — `:base-url` (required), `:provider-type`, `:wire-api`, `:api-key`, `:bearer-token`, `:azure-options`, `:headers`, `:bearer-token-provider` — plus a required `:name` (the registry key, no `/`). Unlike the singular `:provider`, a named provider does **not** accept `:transport` or the inline model-override fields (`:model-id`, `:wire-model`, `:max-input-tokens`, `:max-output-tokens`); model overrides are declared in `:models` instead. Pairs with `:models` to declare a model catalog. Cannot be combined with the singular `:provider`. (upstream PR #1718) | -| `:models` | vector | (Experimental) Model catalog referencing the `:providers` registry. Each entry: `:id` (required, provider-local model id), `:provider` (required, a `:name` in `:providers`), and optional override fields (`:model-id`, `:wire-model`, `:capabilities`, `:max-input-tokens`, `:max-context-window-tokens`, `:max-output-tokens`). The full model selection id is `"providerName/id"`. (upstream PR #1718) | +| `:models` | vector | (Experimental) Model catalog referencing the `:providers` registry. Each entry: `:id` (required, provider-local model id), `:provider` (required, a `:name` in `:providers`), and optional override fields (`:model-id`, `:wire-model`, `:capabilities`, `:max-input-tokens`, `:max-context-window-tokens`, `:max-output-tokens`). The full model selection id is `"providerName/id"`. Cannot be combined with the singular `:provider`. (upstream PR #1718) | | `:capi` | map | CAPI (Copilot API) session options. `{:enable-web-socket-responses boolean}` — serialized as wire `capi.enableWebSocketResponses`. (upstream PR #1711) | | `:exp-assignments` | map | (Internal) Opaque experiment flight assignments. Keys are source-defined flight ids and are forwarded verbatim (string keys bypass kebab→camel conversion). Serialized as `expAssignments`. (upstream PR #1750) | | `:mcp-servers` | map | MCP server configs keyed by server ID (see [MCP docs](../mcp/overview.md)). Local (stdio) servers: `:mcp-command`, `:mcp-args`, `:mcp-tools`. Remote (HTTP/SSE) servers: `:mcp-server-type` (`:http`/`:sse`), `:mcp-url`, `:mcp-tools`. Spec aliases: `::mcp-stdio-server` = `::mcp-local-server`, `::mcp-http-server` = `::mcp-remote-server` | diff --git a/src/github/copilot_sdk/client.clj b/src/github/copilot_sdk/client.clj index 94486ce..6b12f2b 100644 --- a/src/github/copilot_sdk/client.clj +++ b/src/github/copilot_sdk/client.clj @@ -1550,14 +1550,15 @@ (defn- validate-provider-config! "Validate singular-`:provider` BYOK constraints shared by create and resume: `:model` is required when `:provider` is set, and `:provider` cannot be - combined with the multi-provider `:providers` registry (upstream documents - the combination as rejected)." + combined with the multi-provider registry — neither `:providers` nor + `:models` (upstream documents combining either with the singular `provider` + as rejected)." [config] (when (and (:provider config) (not (:model config))) (throw (ex-info "Invalid session config: :model is required when :provider (BYOK) is specified" {:config (redact-secrets config)}))) - (when (and (:provider config) (:providers config)) - (throw (ex-info "Invalid session config: :provider cannot be combined with the :providers registry (use one or the other)" + (when (and (:provider config) (or (:providers config) (:models config))) + (throw (ex-info "Invalid session config: :provider cannot be combined with the :providers/:models registry (use one or the other)" {:config (redact-secrets config)})))) (defn- validate-session-config! diff --git a/test/github/copilot_sdk/integration_test.clj b/test/github/copilot_sdk/integration_test.clj index 66ca423..b553d02 100644 --- a/test/github/copilot_sdk/integration_test.clj +++ b/test/github/copilot_sdk/integration_test.clj @@ -2337,6 +2337,31 @@ (sdk/resume-session *test-client* session-id cfg)) "resume-session rejects :provider + :providers"))))) +(deftest test-v1-0-4-provider-and-models-mutually-exclusive + (testing "combining singular :provider with the :models registry is rejected on both create and resume (upstream SessionConfig contract, PR #1718)" + ;; Upstream documents (types.ts SessionConfig.providers/models JSDoc) that + ;; combining *either* `providers` *or* `models` with the singular `provider` + ;; is rejected — `:models` is part of the same multi-provider registry + ;; surface. A config with `:provider` + `:models` (no `:providers`) must fail + ;; the same client-side guard, otherwise it serializes a wire payload that + ;; contradicts the documented "provider vs multi-provider registry" contract. + (let [cfg {:on-permission-request sdk/approve-all + :model "m" + :provider {:base-url "https://single.test"} + :models [{:provider "p" :id "m"}]}] + (is (thrown-with-msg? clojure.lang.ExceptionInfo + #"(?i):provider.*cannot be combined.*:models" + (sdk/create-session *test-client* cfg)) + "create-session rejects :provider + :models") + (let [ok-session (sdk/create-session *test-client* + {:on-permission-request sdk/approve-all + :model "m"}) + session-id (sdk/session-id ok-session)] + (is (thrown-with-msg? clojure.lang.ExceptionInfo + #"(?i):provider.*cannot be combined.*:models" + (sdk/resume-session *test-client* session-id cfg)) + "resume-session rejects :provider + :models"))))) + (deftest test-v1-0-4-bearer-token-exception-message-not-leaked (testing "an exception thrown by a bearer-token callback never leaks its message to logs or the runtime (SEC)" ;; The callback mints credentials; an exception it raises can easily carry