From f57dc91a19a5f423aa0d971ffbd75e50471296dd Mon Sep 17 00:00:00 2001 From: joshspicer Date: Fri, 28 Aug 2026 19:55:07 +0000 Subject: [PATCH 01/14] Regenerate RPC bindings for managedSettings.clearCache Adds the `managedSettings.clearCache` server RPC method across all generated language clients (TypeScript, C#, Python, Go, Rust, Java). `managedSettings.clearCache` wipes the persistent enterprise managed-settings cache for every account and drops the runtime process's in-memory retained server policy, so the next managed-settings read re-fetches from the network. It is the primitive behind a host "force refresh account policy" action (e.g. VS Code's `Developer: Sync Account Policy`). Consumers call it via the autogenerated RPC wrapper, e.g. in Node.js: await client.rpc.managedSettings.clearCache(); These files were produced by the standard codegen pipeline (`scripts/codegen` + `java/scripts/codegen`) run against the current pinned `@github/copilot` schema baseline with the new method added, so they match what a post-publish regen will produce. The runtime side lives in github/copilot-agent-runtime; once that ships and the `@github/copilot` dependency is bumped to a version exposing `managedSettings.clearCache`, `codegen-check` reproduces these files exactly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/src/Generated/Rpc.cs | 7 +++++ go/rpc/zrpc.go | 27 +++++++++++++++++++ .../rpc/ServerManagedSettingsApi.java | 11 ++++++++ nodejs/src/generated/rpc.ts | 5 ++++ python/copilot/generated/rpc.py | 4 +++ rust/src/generated/api_types.rs | 2 ++ rust/src/generated/rpc.rs | 20 ++++++++++++++ 7 files changed, 76 insertions(+) diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index f3c1a57e6e..f13c3871bb 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -30424,6 +30424,13 @@ public async Task ReadAsync(CancellationToken cancell { return await CopilotClient.InvokeRpcAsync(_rpc, "managedSettings.read", [], cancellationToken); } + + /// Wipes the persistent enterprise managed-settings cache for every account (the whole `<cacheHome>/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host "sync account policy" / "force refresh policy" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op. + /// The to monitor for cancellation requests. The default is . + public async Task ClearCacheAsync(CancellationToken cancellationToken = default) + { + await CopilotClient.InvokeRpcAsync(_rpc, "managedSettings.clearCache", [], cancellationToken); + } } /// Provides server-scoped Runtime APIs. diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index edd5f925fe..4c2d535d21 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -4679,6 +4679,11 @@ type LspInitializeRequest struct { WorkingDirectory *string `json:"workingDirectory,omitempty"` } +// Experimental: ManagedSettingsClearCacheResult is part of an experimental API and may +// change or be removed. +type ManagedSettingsClearCacheResult struct { +} + // Validated device-managed settings discovered before a session exists. // Experimental: ManagedSettingsReadResult is part of an experimental API and may change or // be removed. @@ -19401,6 +19406,28 @@ func (a *ServerLlmInferenceAPI) SetProvider(ctx context.Context) (*LlmInferenceS // removed. type ServerManagedSettingsAPI serverAPI +// ClearCache wipes the persistent enterprise managed-settings cache for every account (the +// whole `/managed-settings` directory) and drops this runtime process's +// in-memory retained server policy, so the next managed-settings read for any account +// re-fetches from the network instead of serving a cached response. Mirrors the cache +// invalidation a sign-out performs, but across all accounts rather than just the one +// signing out — the primitive behind a host "sync account policy" / "force refresh policy" +// action. Device/MDM-scoped layers describe the machine, not the account, so they are left +// untouched. Best-effort: a disabled or already-absent cache is a no-op. +// +// RPC method: managedSettings.clearCache. +func (a *ServerManagedSettingsAPI) ClearCache(ctx context.Context) (*ManagedSettingsClearCacheResult, error) { + raw, err := a.client.Request(ctx, "managedSettings.clearCache", nil) + if err != nil { + return nil, err + } + var result ManagedSettingsClearCacheResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Read discovers device-managed settings from production MDM and managed-file sources, // validates them against the runtime-owned managed-settings schema, and returns the // canonical JSON without requiring a session. diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e85b7b987a..e6013c870d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,4 +37,15 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } + /** + * Invokes {@code managedSettings.clearCache}. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture clearCache() { + return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); + } + } diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index db0ea63dcc..5428b38769 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -23231,6 +23231,11 @@ export function createServerRpc(connection: MessageConnection) { */ read: async (): Promise => connection.sendRequest("managedSettings.read", {}), + /** + * Wipes the persistent enterprise managed-settings cache for every account (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host "sync account policy" / "force refresh policy" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op. + */ + clearCache: async (): Promise => + connection.sendRequest("managedSettings.clearCache", {}), }, /** @experimental */ runtime: { diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 1d59a55f4a..d40ec8e523 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -39399,6 +39399,10 @@ async def read(self, *, timeout: float | None = None) -> ManagedSettingsReadResu "Discovers device-managed settings from production MDM and managed-file sources, validates them against the runtime-owned managed-settings schema, and returns the canonical JSON without requiring a session.\n\nReturns:\n Validated device-managed settings discovered before a session exists." return ManagedSettingsReadResult.from_dict(await self._client.request("managedSettings.read", {}, **_timeout_kwargs(timeout))) + async def clear_cache(self, *, timeout: float | None = None) -> None: + "Wipes the persistent enterprise managed-settings cache for every account (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host \"sync account policy\" / \"force refresh policy\" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op." + await self._client.request("managedSettings.clearCache", {}, **_timeout_kwargs(timeout)) + # Experimental: this API group is experimental and may change or be removed. class ServerRuntimeApi: diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index e22c888f23..740634883d 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -121,6 +121,8 @@ pub mod rpc_methods { pub const USER_SETTINGS_SET: &str = "user.settings.set"; /// `managedSettings.read` pub const MANAGEDSETTINGS_READ: &str = "managedSettings.read"; + /// `managedSettings.clearCache` + pub const MANAGEDSETTINGS_CLEARCACHE: &str = "managedSettings.clearCache"; /// `runtime.shutdown` pub const RUNTIME_SHUTDOWN: &str = "runtime.shutdown"; /// `sessionFs.setProvider` diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 4d5b7f1538..01ad6bd910 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -859,6 +859,26 @@ impl<'a> ClientRpcManagedSettings<'a> { .await?; Ok(serde_json::from_value(_value)?) } + + /// Wipes the persistent enterprise managed-settings cache for every account (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host "sync account policy" / "force refresh policy" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op. + /// + /// Wire method: `managedSettings.clearCache`. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn clear_cache(&self) -> Result<(), Error> { + let wire_params = serde_json::json!({}); + let _value = self + .client + .call(rpc_methods::MANAGEDSETTINGS_CLEARCACHE, Some(wire_params)) + .await?; + Ok(()) + } } /// `mcp.*` RPCs. From 7947421ae281659550d2bec4fefc569cd7cc49d4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Aug 2026 19:55:56 +0000 Subject: [PATCH 02/14] Regenerate Java codegen output Auto-committed by java-codegen-check workflow. --- .../generated/rpc/ServerManagedSettingsApi.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e6013c870d..e85b7b987a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,15 +37,4 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } - /** - * Invokes {@code managedSettings.clearCache}. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - @CopilotExperimental - public CompletableFuture clearCache() { - return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); - } - } From 3e2059ca7faecbf8006076bb636104f07e7f6374 Mon Sep 17 00:00:00 2001 From: Josh Spicer <23246594+joshspicer@users.noreply.github.com> Date: Tue, 1 Sep 2026 16:05:03 -0700 Subject: [PATCH 03/14] Regenerate Java managed settings clear-cache binding Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../generated/rpc/ServerManagedSettingsApi.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e85b7b987a..e6013c870d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,4 +37,15 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } + /** + * Invokes {@code managedSettings.clearCache}. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture clearCache() { + return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); + } + } From 52bbe781d1d6ebf4a43cc35dc5cb1e2edb84adfc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 23:05:30 +0000 Subject: [PATCH 04/14] Regenerate Java codegen output Auto-committed by java-codegen-check workflow. --- .../generated/rpc/ServerManagedSettingsApi.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e6013c870d..e85b7b987a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,15 +37,4 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } - /** - * Invokes {@code managedSettings.clearCache}. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - @CopilotExperimental - public CompletableFuture clearCache() { - return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); - } - } From ddaaf2da7e42dbd48530a16211e9fd7e18d89502 Mon Sep 17 00:00:00 2001 From: Josh Spicer <23246594+joshspicer@users.noreply.github.com> Date: Wed, 2 Sep 2026 11:36:49 -0700 Subject: [PATCH 05/14] Regenerate clear-cache bindings from runtime schema Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/src/Generated/Rpc.cs | 2 +- go/rpc/zrpc.go | 20 +++++++++++-------- .../rpc/ServerManagedSettingsApi.java | 11 ++++++++++ nodejs/src/generated/rpc.ts | 2 +- python/copilot/generated/rpc.py | 2 +- rust/src/generated/rpc.rs | 2 +- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index d3f48cc321..d03dd910d6 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -30510,7 +30510,7 @@ public async Task ReadAsync(CancellationToken cancell return await CopilotClient.InvokeRpcAsync(_rpc, "managedSettings.read", [], cancellationToken); } - /// Wipes the persistent enterprise managed-settings cache for every account (the whole `<cacheHome>/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host "sync account policy" / "force refresh policy" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op. + /// Force-refreshes enterprise managed settings for every account: wipes the persistent server-policy cache (the whole `<cacheHome>/managed-settings` directory) and drops this runtime process's in-memory retained server policy. It does not itself fetch policy — the effect is that the next time a session resolves managed settings for an account, that resolution re-fetches the account's org policy from the network instead of serving a cached response. Note that `managedSettings.read` returns only device/MDM settings and never triggers the account server-policy fetch, so a host implementing "sync account policy" should start a fresh session resolution rather than treat a subsequent `managedSettings.read` as the refreshed org policy. Mirrors the invalidation a sign-out performs, broadened from the one signing-out account to all of them; device/MDM layers describe the machine, not the account, and are left untouched. Rejects if the on-disk cache cannot be removed. /// The to monitor for cancellation requests. The default is . public async Task ClearCacheAsync(CancellationToken cancellationToken = default) { diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index ad298986ea..50baf0451a 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -19468,14 +19468,18 @@ func (a *ServerLlmInferenceAPI) SetProvider(ctx context.Context) (*LlmInferenceS // removed. type ServerManagedSettingsAPI serverAPI -// ClearCache wipes the persistent enterprise managed-settings cache for every account (the -// whole `/managed-settings` directory) and drops this runtime process's -// in-memory retained server policy, so the next managed-settings read for any account -// re-fetches from the network instead of serving a cached response. Mirrors the cache -// invalidation a sign-out performs, but across all accounts rather than just the one -// signing out — the primitive behind a host "sync account policy" / "force refresh policy" -// action. Device/MDM-scoped layers describe the machine, not the account, so they are left -// untouched. Best-effort: a disabled or already-absent cache is a no-op. +// ClearCache force-refreshes enterprise managed settings for every account: wipes the +// persistent server-policy cache (the whole `/managed-settings` directory) and +// drops this runtime process's in-memory retained server policy. It does not itself fetch +// policy — the effect is that the next time a session resolves managed settings for an +// account, that resolution re-fetches the account's org policy from the network instead of +// serving a cached response. Note that `managedSettings.read` returns only device/MDM +// settings and never triggers the account server-policy fetch, so a host implementing "sync +// account policy" should start a fresh session resolution rather than treat a subsequent +// `managedSettings.read` as the refreshed org policy. Mirrors the invalidation a sign-out +// performs, broadened from the one signing-out account to all of them; device/MDM layers +// describe the machine, not the account, and are left untouched. Rejects if the on-disk +// cache cannot be removed. // // RPC method: managedSettings.clearCache. func (a *ServerManagedSettingsAPI) ClearCache(ctx context.Context) (*ManagedSettingsClearCacheResult, error) { diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e85b7b987a..e6013c870d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,4 +37,15 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } + /** + * Invokes {@code managedSettings.clearCache}. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture clearCache() { + return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); + } + } diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 758500b464..5674db30de 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -23291,7 +23291,7 @@ export function createServerRpc(connection: MessageConnection) { read: async (): Promise => connection.sendRequest("managedSettings.read", {}), /** - * Wipes the persistent enterprise managed-settings cache for every account (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host "sync account policy" / "force refresh policy" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op. + * Force-refreshes enterprise managed settings for every account: wipes the persistent server-policy cache (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy. It does not itself fetch policy — the effect is that the next time a session resolves managed settings for an account, that resolution re-fetches the account's org policy from the network instead of serving a cached response. Note that `managedSettings.read` returns only device/MDM settings and never triggers the account server-policy fetch, so a host implementing "sync account policy" should start a fresh session resolution rather than treat a subsequent `managedSettings.read` as the refreshed org policy. Mirrors the invalidation a sign-out performs, broadened from the one signing-out account to all of them; device/MDM layers describe the machine, not the account, and are left untouched. Rejects if the on-disk cache cannot be removed. */ clearCache: async (): Promise => connection.sendRequest("managedSettings.clearCache", {}), diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 78527e445e..b971571d79 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -39467,7 +39467,7 @@ async def read(self, *, timeout: float | None = None) -> ManagedSettingsReadResu return ManagedSettingsReadResult.from_dict(await self._client.request("managedSettings.read", {}, **_timeout_kwargs(timeout))) async def clear_cache(self, *, timeout: float | None = None) -> None: - "Wipes the persistent enterprise managed-settings cache for every account (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host \"sync account policy\" / \"force refresh policy\" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op." + "Force-refreshes enterprise managed settings for every account: wipes the persistent server-policy cache (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy. It does not itself fetch policy — the effect is that the next time a session resolves managed settings for an account, that resolution re-fetches the account's org policy from the network instead of serving a cached response. Note that `managedSettings.read` returns only device/MDM settings and never triggers the account server-policy fetch, so a host implementing \"sync account policy\" should start a fresh session resolution rather than treat a subsequent `managedSettings.read` as the refreshed org policy. Mirrors the invalidation a sign-out performs, broadened from the one signing-out account to all of them; device/MDM layers describe the machine, not the account, and are left untouched. Rejects if the on-disk cache cannot be removed." await self._client.request("managedSettings.clearCache", {}, **_timeout_kwargs(timeout)) diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 2c01285713..d80a572910 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -860,7 +860,7 @@ impl<'a> ClientRpcManagedSettings<'a> { Ok(serde_json::from_value(_value)?) } - /// Wipes the persistent enterprise managed-settings cache for every account (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy, so the next managed-settings read for any account re-fetches from the network instead of serving a cached response. Mirrors the cache invalidation a sign-out performs, but across all accounts rather than just the one signing out — the primitive behind a host "sync account policy" / "force refresh policy" action. Device/MDM-scoped layers describe the machine, not the account, so they are left untouched. Best-effort: a disabled or already-absent cache is a no-op. + /// Force-refreshes enterprise managed settings for every account: wipes the persistent server-policy cache (the whole `/managed-settings` directory) and drops this runtime process's in-memory retained server policy. It does not itself fetch policy — the effect is that the next time a session resolves managed settings for an account, that resolution re-fetches the account's org policy from the network instead of serving a cached response. Note that `managedSettings.read` returns only device/MDM settings and never triggers the account server-policy fetch, so a host implementing "sync account policy" should start a fresh session resolution rather than treat a subsequent `managedSettings.read` as the refreshed org policy. Mirrors the invalidation a sign-out performs, broadened from the one signing-out account to all of them; device/MDM layers describe the machine, not the account, and are left untouched. Rejects if the on-disk cache cannot be removed. /// /// Wire method: `managedSettings.clearCache`. /// From de4bc72f19bb7c8a459c37291ec92bb41aee4e64 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Sep 2026 18:43:55 +0000 Subject: [PATCH 06/14] Regenerate Java codegen output Auto-committed by java-codegen-check workflow. --- .../generated/rpc/ServerManagedSettingsApi.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e6013c870d..e85b7b987a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,15 +37,4 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } - /** - * Invokes {@code managedSettings.clearCache}. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - @CopilotExperimental - public CompletableFuture clearCache() { - return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); - } - } From 21c0885adbaa8cb66eac405b184a1f584f7fc5cb Mon Sep 17 00:00:00 2001 From: Josh Spicer <23246594+joshspicer@users.noreply.github.com> Date: Thu, 3 Sep 2026 09:02:20 -0700 Subject: [PATCH 07/14] Regenerate Java managed settings clear-cache binding Generate the missing Java RPC wrapper from the merged runtime schema while retaining the pinned CLI schema baseline for unrelated APIs.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../generated/rpc/ServerManagedSettingsApi.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e85b7b987a..e6013c870d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,4 +37,15 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } + /** + * Invokes {@code managedSettings.clearCache}. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture clearCache() { + return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); + } + } From 497aa9e0cf5cdb7e950834efcc62b54ceff0de66 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:03:09 +0000 Subject: [PATCH 08/14] Regenerate Java codegen output Auto-committed by java-codegen-check workflow. --- .../generated/rpc/ServerManagedSettingsApi.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e6013c870d..e85b7b987a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,15 +37,4 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } - /** - * Invokes {@code managedSettings.clearCache}. - * - * @apiNote This method is experimental and may change in a future version. - * @since 1.0.0 - */ - @CopilotExperimental - public CompletableFuture clearCache() { - return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); - } - } From e53c1fe9427fd0c52cd2d09e25d68e4332e7ea57 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 3 Sep 2026 17:00:11 +0000 Subject: [PATCH 09/14] Update Copilot CLI to 1.0.83-4 - Updated the Node.js CLI release pin - Re-ran code generators - Formatted generated code --- dotnet/src/Generated/Rpc.cs | 1312 ++++++++++++++++- dotnet/src/Generated/SessionEvents.cs | 158 ++ go/rpc/zrpc.go | 630 +++++++- go/rpc/zrpc_encoding.go | 155 ++ go/rpc/zsession_encoding.go | 18 + go/rpc/zsession_events.go | 58 + go/zsession_events.go | 11 + java/pom.xml | 2 +- java/scripts/codegen/package-lock.json | 92 +- java/scripts/codegen/package.json | 2 +- .../AutoTierSwitchFailureReason.java | 39 + .../SessionAutoTierSwitchFailedEvent.java | 45 + .../copilot/generated/SessionEvent.java | 6 + .../SessionMcpServerNeedsReconnectEvent.java | 41 + .../SessionMcpServerRemovedEvent.java | 41 + .../generated/SessionModelChangeEvent.java | 6 +- .../generated/rpc/CapiSessionOptions.java | 2 +- .../generated/rpc/ClientTaskCancelReason.java | 35 + .../copilot/generated/rpc/ConnectParams.java | 3 + .../copilot/generated/rpc/ConnectResult.java | 5 +- .../copilot/generated/rpc/CurrentModel.java | 37 + .../generated/rpc/McpConfigRemoveParams.java | 4 +- .../github/copilot/generated/rpc/Model.java | 3 + .../rpc/ModelSwitchAutoTierStatus.java | 35 + .../copilot/generated/rpc/SandboxConfig.java | 10 + .../rpc/ServerManagedSettingsApi.java | 11 + .../generated/rpc/SessionModelApi.java | 16 + ...SessionModelApplyStartupOverlayResult.java | 4 +- .../rpc/SessionModelGetCurrentResult.java | 10 +- .../rpc/SessionModelSwitchAutoTierParams.java | 34 + .../rpc/SessionModelSwitchAutoTierResult.java | 38 + .../rpc/SessionModelSwitchToParams.java | 2 + .../rpc/SessionModelSwitchToResult.java | 4 +- .../generated/rpc/SessionOpenOptions.java | 2 + .../generated/rpc/SessionTasksApi.java | 32 + .../rpc/SessionTasksRegisterParams.java | 42 + .../rpc/SessionTasksRegisterResult.java | 34 + .../rpc/SessionTasksUpdateParams.java | 36 + .../rpc/SessionTasksUpdateResult.java | 34 + .../rpc/TaskClientExecutionMode.java | 33 + .../copilot/generated/rpc/TaskClientInfo.java | 70 + .../generated/rpc/TaskClientOwner.java | 40 + .../generated/rpc/TaskClientOwnerKind.java | 35 + .../rpc/TaskClientOwnerPresence.java | 35 + .../generated/rpc/TaskClientStatus.java | 43 + .../copilot/generated/rpc/TaskClientType.java | 33 + .../copilot/generated/rpc/TaskKind.java | 37 + .../generated/rpc/TasksCancelParams.java | 38 + .../generated/rpc/TasksCancelResult.java | 30 + nodejs/package.json | 2 +- nodejs/src/cliVersion.ts | 2 +- nodejs/src/generated/rpc.ts | 612 +++++++- nodejs/src/generated/session-events.ts | 139 ++ python/copilot/generated/rpc.py | 1078 +++++++++++++- python/copilot/generated/session_events.py | 100 +- rust/src/generated/api_types.rs | 759 +++++++++- rust/src/generated/rpc.rs | 100 +- rust/src/generated/session_events.rs | 68 + 58 files changed, 6123 insertions(+), 180 deletions(-) create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/AutoTierSwitchFailureReason.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierSwitchFailedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerNeedsReconnectEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerRemovedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientTaskCancelReason.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/CurrentModel.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/ModelSwitchAutoTierStatus.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientExecutionMode.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientInfo.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwner.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerKind.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerPresence.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientStatus.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientType.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskKind.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelResult.java diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index c05bada39e..d65aa4f1b8 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -56,6 +56,10 @@ internal sealed class ConnectResult [JsonPropertyName("protocolVersion")] public long ProtocolVersion { get; set; } + /// Task kinds the server may return to this connection. + [JsonPropertyName("taskKinds")] + public IList? TaskKinds { get; set; } + /// Server package version. [JsonPropertyName("version")] public string Version { get; set; } = string.Empty; @@ -94,6 +98,10 @@ internal sealed class ConnectRequest [JsonPropertyName("enableGitHubTelemetryForwarding")] public bool? EnableGitHubTelemetryForwarding { get; set; } + /// Task kinds this connection can decode when observing session tasks. Omit to retain agent and shell compatibility. + [JsonPropertyName("supportedTaskKinds")] + public IList? SupportedTaskKinds { get; set; } + /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN. [JsonPropertyName("token")] public string? Token { get; set; } @@ -433,6 +441,10 @@ public sealed class Model [JsonPropertyName("infoMessages")] public IList? InfoMessages { get; set; } + /// Provider-supplied model metadata. Keys and JSON-compatible values are preserved unchanged. This is factual metadata published by the model provider; it carries no picker or UX semantics. + [JsonPropertyName("metadata")] + public IDictionary? Metadata { get; set; } + /// Model capability category for grouping in the model picker. [JsonPropertyName("modelPickerCategory")] public ModelPickerCategory? ModelPickerCategory { get; set; } @@ -2231,6 +2243,10 @@ internal sealed class McpConfigUpdateRequest [Experimental(Diagnostics.Experimental)] internal sealed class McpConfigRemoveRequest { + /// OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. + [JsonPropertyName("authClientIdMetadataUrl")] + public string? AuthClientIdMetadataUrl { get; set; } + /// Name of the MCP server to remove. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] @@ -7357,10 +7373,18 @@ internal sealed class FactoryJournalPutRequest public string SessionId { get; set; } = string.Empty; } -/// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. +/// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. [Experimental(Diagnostics.Experimental)] public sealed class CurrentModel { + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + [JsonPropertyName("activatingAutoTier")] + public AutoTier? ActivatingAutoTier { get; set; } + + /// Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it. + [JsonPropertyName("autoTier")] + public AutoTier? AutoTier { get; set; } + /// Context tier for models that support multiple context-window sizes. [JsonPropertyName("contextTier")] public ContextTier? ContextTier { get; set; } @@ -7369,6 +7393,10 @@ public sealed class CurrentModel [JsonPropertyName("modelId")] public string? ModelId { get; set; } + /// Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. + [JsonPropertyName("pendingAutoTier")] + public AutoTier? PendingAutoTier { get; set; } + /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. [JsonPropertyName("reasoningEffort")] public string? ReasoningEffort { get; set; } @@ -7424,6 +7452,10 @@ public sealed class ModelSwitchToResult [JsonPropertyName("modelId")] public string? ModelId { get; set; } + /// Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. + [JsonPropertyName("modelState")] + public CurrentModel? ModelState { get; set; } + /// Persistence failure encountered after applying the model switch. [JsonPropertyName("persistenceError")] public string? PersistenceError { get; set; } @@ -7548,6 +7580,10 @@ public sealed class ModelPickerPersistenceRequest [Experimental(Diagnostics.Experimental)] internal sealed class ModelSwitchToRequest { + /// Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`. + [JsonPropertyName("autoTier")] + public AutoTier? AutoTier { get; set; } + /// Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary. [JsonPropertyName("compactionDecision")] public string? CompactionDecision { get; set; } @@ -7609,6 +7645,48 @@ internal sealed class ModelSwitchToRequest public Verbosity? Verbosity { get; set; } } +/// Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. +[Experimental(Diagnostics.Experimental)] +public sealed class ModelSwitchAutoTierResult +{ + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + [JsonPropertyName("activatingAutoTier")] + public AutoTier? ActivatingAutoTier { get; set; } + + /// Auto preference currently committed for the session. + [JsonPropertyName("effectiveAutoTier")] + public AutoTier? EffectiveAutoTier { get; set; } + + /// Latest unclaimed Auto preference waiting for a future user turn. + [JsonPropertyName("pendingAutoTier")] + public AutoTier? PendingAutoTier { get; set; } + + /// Immediate request status. `pending` means accepted but not committed. + [JsonPropertyName("status")] + public ModelSwitchAutoTierStatus Status { get; set; } + + /// Earlier unclaimed preference replaced by this request. This can be present with either status, including when selecting the effective preference cancels pending work. + [JsonPropertyName("supersededAutoTier")] + public AutoTier? SupersededAutoTier { get; set; } +} + +/// An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. +[Experimental(Diagnostics.Experimental)] +internal sealed class ModelSwitchAutoTierRequest +{ + /// Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. + [JsonPropertyName("autoTier")] + public AutoTier? AutoTier { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. + [JsonPropertyName("source")] + public ModelChangeSource? Source { get; set; } +} + /// Managed, repository, and CLI model overrides to overlay onto the session at startup. [Experimental(Diagnostics.Experimental)] internal sealed class ModelApplyStartupOverlayRequest @@ -8753,13 +8831,14 @@ internal sealed class TasksStartAgentRequest public string SessionId { get; set; } = string.Empty; } -/// Tracked task union returned by task APIs, containing either an agent task or a shell task. +/// Tracked task union returned by task APIs, containing an agent, client, or shell task. /// Polymorphic base type discriminated by type. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(TaskInfoAgent), "agent")] +[JsonDerivedType(typeof(TaskInfoClient), "client")] [JsonDerivedType(typeof(TaskInfoShell), "shell")] public partial class TaskInfo { @@ -8868,6 +8947,143 @@ public partial class TaskInfoAgent : TaskInfo public required string ToolCallId { get; set; } } +/// Public owner attribution for a client-owned task. Identifiers are opaque and never authorize requests. +[Experimental(Diagnostics.Experimental)] +public sealed class TaskClientOwner +{ + /// ISO 8601 timestamp when the bound join disconnected. + [JsonPropertyName("disconnectedAt")] + public DateTimeOffset? DisconnectedAt { get; set; } + + /// Display-only owner name. + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// Opaque identity of the currently or most recently bound session join. + [JsonPropertyName("joinId")] + public string JoinId { get; set; } = string.Empty; + + /// Class of the task owner. + [JsonPropertyName("kind")] + public TaskClientOwnerKind Kind { get; set; } + + /// Opaque session-scoped participant identity. + [JsonPropertyName("participantId")] + public string ParticipantId { get; set; } = string.Empty; + + /// Whether this task's bound join is currently connected. + [JsonPropertyName("presence")] + public TaskClientOwnerPresence Presence { get; set; } + + /// Display-only owner source. + [JsonPropertyName("source")] + public string? Source { get; set; } +} + +/// Tracked client-owned task metadata. +/// The client variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskInfoClient : TaskInfo +{ + /// + [JsonIgnore] + public override string Type => "client"; + + /// ISO 8601 timestamp when the current active segment started. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("activeStartedAt")] + public DateTimeOffset? ActiveStartedAt { get; set; } + + /// Accumulated active execution time in milliseconds. + [JsonPropertyName("activeTimeMs")] + public required long ActiveTimeMs { get; set; } + + /// Whether the currently bound owner can receive a cancellation request. + [JsonPropertyName("canCancel")] + public required bool CanCancel { get; set; } + + /// Human-readable reason for terminal cancellation. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("cancellationReason")] + public string? CancellationReason { get; set; } + + /// Owner-scoped registration and reclaim key. + [JsonPropertyName("clientTaskId")] + public required string ClientTaskId { get; set; } + + /// ISO 8601 timestamp when the task reached a terminal status. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("completedAt")] + public DateTimeOffset? CompletedAt { get; set; } + + /// Task description. + [JsonPropertyName("description")] + public required string Description { get; set; } + + /// Optional task display name. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// Human-readable terminal failure message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("error")] + public string? Error { get; set; } + + /// Optional owner-supplied terminal failure code. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("errorCode")] + public string? ErrorCode { get; set; } + + /// Execution mode, which is always background for client-owned tasks. + [JsonPropertyName("executionMode")] + public required TaskClientExecutionMode ExecutionMode { get; set; } + + /// Canonical runtime-generated task identifier. + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// ISO 8601 timestamp when the connected owner entered idle status. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("idleSince")] + public DateTimeOffset? IdleSince { get; set; } + + /// ISO 8601 timestamp of the most recent orphan transition. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("orphanedAt")] + public DateTimeOffset? OrphanedAt { get; set; } + + /// Public attribution and presence for the task owner. + [JsonPropertyName("owner")] + public required TaskClientOwner Owner { get; set; } + + /// ISO 8601 timestamp of the most recent successful reclaim. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("reclaimedAt")] + public DateTimeOffset? ReclaimedAt { get; set; } + + /// Opaque successful terminal result supplied by the task owner. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("result")] + public JsonElement? Result { get; set; } + + /// Sequence number of the latest accepted owner update. + [JsonPropertyName("sequence")] + public required long Sequence { get; set; } + + /// ISO 8601 timestamp when the task started. + [JsonPropertyName("startedAt")] + public required DateTimeOffset StartedAt { get; set; } + + /// Client task lifecycle status. + [JsonPropertyName("status")] + public required TaskClientStatus Status { get; set; } + + /// ISO 8601 timestamp of the latest accepted lifecycle change. + [JsonPropertyName("updatedAt")] + public required DateTimeOffset UpdatedAt { get; set; } +} + /// Tracked shell task metadata, including ID, command, status, timing, attachment/execution mode, log path, and PID. /// The shell variant of . [Experimental(Diagnostics.Experimental)] @@ -8945,6 +9161,299 @@ internal sealed class SessionTasksListRequest public string SessionId { get; set; } = string.Empty; } +/// Tracked client-owned task metadata. +[Experimental(Diagnostics.Experimental)] +public sealed class TaskClientInfo +{ + /// ISO 8601 timestamp when the current active segment started. + [JsonPropertyName("activeStartedAt")] + public DateTimeOffset? ActiveStartedAt { get; set; } + + /// Accumulated active execution time in milliseconds. + [JsonPropertyName("activeTimeMs")] + public long ActiveTimeMs { get; set; } + + /// Whether the currently bound owner can receive a cancellation request. + [JsonPropertyName("canCancel")] + public bool CanCancel { get; set; } + + /// Human-readable reason for terminal cancellation. + [JsonPropertyName("cancellationReason")] + public string? CancellationReason { get; set; } + + /// Owner-scoped registration and reclaim key. + [JsonPropertyName("clientTaskId")] + public string ClientTaskId { get; set; } = string.Empty; + + /// ISO 8601 timestamp when the task reached a terminal status. + [JsonPropertyName("completedAt")] + public DateTimeOffset? CompletedAt { get; set; } + + /// Task description. + [JsonPropertyName("description")] + public string Description { get; set; } = string.Empty; + + /// Optional task display name. + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// Human-readable terminal failure message. + [JsonPropertyName("error")] + public string? Error { get; set; } + + /// Optional owner-supplied terminal failure code. + [JsonPropertyName("errorCode")] + public string? ErrorCode { get; set; } + + /// Execution mode, which is always background for client-owned tasks. + [JsonPropertyName("executionMode")] + public TaskClientExecutionMode ExecutionMode { get; set; } + + /// Canonical runtime-generated task identifier. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; + + /// ISO 8601 timestamp when the connected owner entered idle status. + [JsonPropertyName("idleSince")] + public DateTimeOffset? IdleSince { get; set; } + + /// ISO 8601 timestamp of the most recent orphan transition. + [JsonPropertyName("orphanedAt")] + public DateTimeOffset? OrphanedAt { get; set; } + + /// Public attribution and presence for the task owner. + [JsonPropertyName("owner")] + public TaskClientOwner Owner { get => field ??= new(); set; } + + /// ISO 8601 timestamp of the most recent successful reclaim. + [JsonPropertyName("reclaimedAt")] + public DateTimeOffset? ReclaimedAt { get; set; } + + /// Opaque successful terminal result supplied by the task owner. + [JsonPropertyName("result")] + public JsonElement? Result { get; set; } + + /// Sequence number of the latest accepted owner update. + [JsonPropertyName("sequence")] + public long Sequence { get; set; } + + /// ISO 8601 timestamp when the task started. + [JsonPropertyName("startedAt")] + public DateTimeOffset StartedAt { get; set; } + + /// Client task lifecycle status. + [JsonPropertyName("status")] + public TaskClientStatus Status { get; set; } + + /// Task kind. + [JsonPropertyName("type")] + public TaskClientType Type { get; set; } + + /// ISO 8601 timestamp of the latest accepted lifecycle change. + [JsonPropertyName("updatedAt")] + public DateTimeOffset UpdatedAt { get; set; } +} + +/// Result of registering or reclaiming a client-owned task. +[Experimental(Diagnostics.Experimental)] +public sealed class TasksRegisterResult +{ + /// True only when this invocation created a new task. + [JsonPropertyName("created")] + public bool Created { get; set; } + + /// True only when this invocation reclaimed an orphaned task. + [JsonPropertyName("reclaimed")] + public bool Reclaimed { get; set; } + + /// Authoritative registered or reclaimed task. + [JsonPropertyName("task")] + public TaskClientInfo Task { get => field ??= new(); set; } +} + +/// Registers or reclaims a client-owned task. +[Experimental(Diagnostics.Experimental)] +internal sealed class TasksRegisterRequest +{ + /// Whether the owner supports runtime cancellation requests. + [JsonPropertyName("cancellable")] + public bool Cancellable { get; set; } + + /// Owner-scoped idempotency key used for registration and reclaim. + [JsonPropertyName("clientTaskId")] + public string ClientTaskId { get; set; } = string.Empty; + + /// Human-readable description of the external work. + [JsonPropertyName("description")] + public string Description { get; set; } = string.Empty; + + /// Optional short display name for the external work. + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// Expected current sequence for idempotent registration or orphan reclaim. + [JsonPropertyName("expectedSequence")] + public long? ExpectedSequence { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// Task kind. + [JsonPropertyName("type")] + public TaskClientType Type { get; set; } +} + +/// Result of publishing a client-owned task update. +[Experimental(Diagnostics.Experimental)] +public sealed class TasksUpdateResult +{ + /// Whether this invocation changed task state. + [JsonPropertyName("applied")] + public bool Applied { get; set; } + + /// Whether this invocation repeated the latest accepted update. + [JsonPropertyName("duplicate")] + public bool Duplicate { get; set; } + + /// Authoritative task after processing the update. + [JsonPropertyName("task")] + public TaskClientInfo Task { get => field ??= new(); set; } +} + +/// Progress or terminal update for a client-owned task. +/// Polymorphic base type discriminated by kind. +[Experimental(Diagnostics.Experimental)] +[JsonPolymorphic( + TypeDiscriminatorPropertyName = "kind", + UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] +[JsonDerivedType(typeof(TaskClientUpdateProgress), "progress")] +[JsonDerivedType(typeof(TaskClientUpdateCompleted), "completed")] +[JsonDerivedType(typeof(TaskClientUpdateFailed), "failed")] +[JsonDerivedType(typeof(TaskClientUpdateCancelled), "cancelled")] +public partial class TaskClientUpdate +{ + /// The type discriminator. + [JsonPropertyName("kind")] + public virtual string Kind { get; set; } = string.Empty; +} + + +/// Publishes nonterminal progress for a running or idle client task. +/// The progress variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskClientUpdateProgress : TaskClientUpdate +{ + /// + [JsonIgnore] + public override string Kind => "progress"; + + /// Optional progress message appended to recent activity when nonempty. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Optional completion percentage; null clears the current percentage. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("percentage")] + public double? Percentage { get; set; } + + /// Optional progress phase; null clears the current phase. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("phase")] + public string? Phase { get; set; } + + /// Optional active status transition. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("status")] + public TaskClientActiveStatus? Status { get; set; } +} + +/// Reports successful terminal completion. +/// The completed variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskClientUpdateCompleted : TaskClientUpdate +{ + /// + [JsonIgnore] + public override string Kind => "completed"; + + /// Optional final progress message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Optional opaque successful terminal result. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("result")] + public JsonElement? Result { get; set; } +} + +/// Reports terminal failure. +/// The failed variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskClientUpdateFailed : TaskClientUpdate +{ + /// + [JsonIgnore] + public override string Kind => "failed"; + + /// Optional owner-supplied terminal failure code. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("code")] + public string? Code { get; set; } + + /// Human-readable terminal failure message. + [JsonPropertyName("error")] + public required string Error { get; set; } + + /// Optional final progress message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("message")] + public string? Message { get; set; } +} + +/// Reports terminal cancellation after external work stopped. +/// The cancelled variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskClientUpdateCancelled : TaskClientUpdate +{ + /// + [JsonIgnore] + public override string Kind => "cancelled"; + + /// Optional final progress message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Optional human-readable cancellation reason. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("reason")] + public string? Reason { get; set; } +} + +/// Updates a client-owned task. +[Experimental(Diagnostics.Experimental)] +internal sealed class TasksUpdateRequest +{ + /// Canonical runtime-generated task identifier. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; + + /// Owner update sequence to apply. + [JsonPropertyName("sequence")] + public long Sequence { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// Progress or terminal update payload. + [JsonPropertyName("update")] + public TaskClientUpdate Update { get => field ??= new(); set; } +} + /// Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop. [Experimental(Diagnostics.Experimental)] public sealed class TasksRefreshResult @@ -8975,13 +9484,16 @@ internal sealed class SessionTasksWaitForPendingRequest public string SessionId { get; set; } = string.Empty; } -/// Polymorphic base type discriminated by type. +/// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. +/// Polymorphic base type discriminated by type. +[Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] -[JsonDerivedType(typeof(TasksGetProgressResultProgressAgent), "agent")] -[JsonDerivedType(typeof(TasksGetProgressResultProgressShell), "shell")] -public partial class TasksGetProgressResultProgress +[JsonDerivedType(typeof(TaskProgressAgent), "agent")] +[JsonDerivedType(typeof(TaskProgressClient), "client")] +[JsonDerivedType(typeof(TaskProgressShell), "shell")] +public partial class TaskProgress { /// The type discriminator. [JsonPropertyName("type")] @@ -9003,8 +9515,9 @@ public sealed class TaskProgressLine } /// Progress snapshot for an agent task, with recent activity lines and optional latest intent. -/// The agent variant of . -public partial class TasksGetProgressResultProgressAgent : TasksGetProgressResultProgress +/// The agent variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskProgressAgent : TaskProgress { /// [JsonIgnore] @@ -9020,9 +9533,51 @@ public partial class TasksGetProgressResultProgressAgent : TasksGetProgressResul public required IList RecentActivity { get; set; } } +/// Generic progress for a client-owned task. +/// The client variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskProgressClient : TaskProgress +{ + /// + [JsonIgnore] + public override string Type => "client"; + + /// Most recent nonempty progress message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("lastMessage")] + public string? LastMessage { get; set; } + + /// Current completion percentage from zero through one hundred. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("percentage")] + public double? Percentage { get; set; } + + /// Current owner-defined progress phase. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("phase")] + public string? Phase { get; set; } + + /// Recent server-timestamped progress messages. + [JsonPropertyName("recentActivity")] + public required IList RecentActivity { get; set; } + + /// Sequence number of the latest accepted owner update. + [JsonPropertyName("sequence")] + public required long Sequence { get; set; } + + /// Current client task lifecycle status. + [JsonPropertyName("status")] + public required TaskClientStatus Status { get; set; } + + /// ISO 8601 timestamp of the latest accepted lifecycle change. + [JsonPropertyName("updatedAt")] + public required DateTimeOffset UpdatedAt { get; set; } +} + /// Progress snapshot for a shell task, with recent stdout/stderr output and optional process ID. -/// The shell variant of . -public partial class TasksGetProgressResultProgressShell : TasksGetProgressResultProgress +/// The shell variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskProgressShell : TaskProgress { /// [JsonIgnore] @@ -9044,7 +9599,7 @@ public sealed class TasksGetProgressResult { /// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. [JsonPropertyName("progress")] - public TasksGetProgressResultProgress? Progress { get; set; } + public TaskProgress? Progress { get; set; } } /// Identifier of the background task to fetch progress for. @@ -11113,7 +11668,7 @@ public sealed class OptionsUpdateAdditionalContentExclusionPolicy [Experimental(Diagnostics.Experimental)] public sealed class CapiSessionOptions { - /// Routing preference used when the session model is `auto`. The runtime persists the preference across cold resume. When omitted, the default routing behavior is used. Resuming an already-resident session cannot change its preference. + /// Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. [JsonPropertyName("autoTier")] public AutoTier? AutoTier { get; set; } @@ -11356,6 +11911,10 @@ public sealed class SandboxConfig [JsonPropertyName("addCurrentWorkingDirectory")] public bool? AddCurrentWorkingDirectory { get; set; } + /// Whether the agent may request that an individual command run outside the sandbox, which the host then approves or denies through the usual permission flow. A host capability flag rather than part of the policy: it is stripped from the effective spawn policy and only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this object: omitting it offers no bypass. Default: false (opt-in). + [JsonPropertyName("allowBypass")] + public bool? AllowBypass { get; set; } + /// Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out). [JsonPropertyName("allowDevToolAccess")] public bool? AllowDevToolAccess { get; set; } @@ -11368,6 +11927,24 @@ public sealed class SandboxConfig [JsonPropertyName("enabled")] public bool Enabled { get; set; } + /// The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`. + [JsonInclude] + [JsonPropertyName("managedLspRoutingLocked")] + internal bool? ManagedLspRoutingLocked { get; set; } + + /// Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at the administrator instead of a setting the next managed merge would override, and it is ignored when comparing two configs for change. Only the managed merge may set it; a caller-supplied value is stripped. + [JsonInclude] + [JsonPropertyName("managedMcpRoutingLocked")] + internal bool? ManagedMcpRoutingLocked { get; set; } + + /// Whether language servers the session launches are confined by the sandbox. Only an explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + [JsonPropertyName("sandboxLspServers")] + public bool? SandboxLspServers { get; set; } + + /// Whether MCP servers the session launches are confined by the sandbox. Only an explicit `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and `enabled` are always read together. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + [JsonPropertyName("sandboxMcpServers")] + public bool? SandboxMcpServers { get; set; } + /// User-managed sandbox policy fragment merged into the auto-discovered base policy. [JsonPropertyName("userPolicy")] public SandboxConfigUserPolicy? UserPolicy { get; set; } @@ -18088,6 +18665,40 @@ public sealed class FactoryAbortRequest public string SessionId { get; set; } = string.Empty; } +/// Whether the client authoritatively confirmed its external work stopped. +[Experimental(Diagnostics.Experimental)] +public sealed class ClientTaskCancelResult +{ + /// True only when the owner confirms that external work stopped before responding. + [JsonPropertyName("cancelled")] + public bool Cancelled { get; set; } +} + +/// Runtime-to-owner cancellation request for a client-owned task. +[Experimental(Diagnostics.Experimental)] +public sealed class ClientTaskCancelRequest +{ + /// Opaque identifier shared by coalesced cancellation callers. + [JsonPropertyName("cancellationId")] + public string CancellationId { get; set; } = string.Empty; + + /// Owner-scoped task key included for correlation. + [JsonPropertyName("clientTaskId")] + public string ClientTaskId { get; set; } = string.Empty; + + /// Canonical runtime-generated task identifier. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; + + /// Reason the runtime requests cancellation. + [JsonPropertyName("reason")] + public ClientTaskCancelReason Reason { get; set; } + + /// Session that owns the client task. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Describes a filesystem error. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsError @@ -18941,6 +19552,72 @@ public sealed class GitHubTokenAcquireRequest public string? SessionId { get; set; } } +/// Closed set of public task kinds a connection can negotiate. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskKind : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskKind(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Runtime-owned background agent task. + public static TaskKind Agent { get; } = new("agent"); + + /// Runtime-owned shell task. + public static TaskKind Shell { get; } = new("shell"); + + /// Client-owned externally executed task. + public static TaskKind Client { get; } = new("client"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskKind left, TaskKind right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskKind left, TaskKind right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskKind other && Equals(other); + + /// + public bool Equals(TaskKind other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskKind value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskKind)); + } + } +} + + /// Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -24179,6 +24856,69 @@ public override void Write(Utf8JsonWriter writer, FactoryLogLineKind value, Json } +/// Whether the requested preference was already effective or was accepted for later transactional activation. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ModelSwitchAutoTierStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ModelSwitchAutoTierStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The requested preference is already effective. No activation is pending for it, although this request may have cancelled an earlier unclaimed preference reported in `supersededAutoTier`. + public static ModelSwitchAutoTierStatus Unchanged { get; } = new("unchanged"); + + /// The request was accepted but has not committed. A later user turn using the `auto` model must mint and validate the replacement before it becomes effective. + public static ModelSwitchAutoTierStatus Pending { get; } = new("pending"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ModelSwitchAutoTierStatus left, ModelSwitchAutoTierStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ModelSwitchAutoTierStatus left, ModelSwitchAutoTierStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is ModelSwitchAutoTierStatus other && Equals(other); + + /// + public bool Equals(ModelSwitchAutoTierStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override ModelSwitchAutoTierStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, ModelSwitchAutoTierStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelSwitchAutoTierStatus)); + } + } +} + + /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -24578,6 +25318,267 @@ public override void Write(Utf8JsonWriter writer, TaskStatus value, JsonSerializ } +/// Client-owned tasks always execute outside the runtime in background mode. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientExecutionMode : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientExecutionMode(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Gets the background value. + public static TaskClientExecutionMode Background { get; } = new("background"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientExecutionMode left, TaskClientExecutionMode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientExecutionMode left, TaskClientExecutionMode right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientExecutionMode other && Equals(other); + + /// + public bool Equals(TaskClientExecutionMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientExecutionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientExecutionMode value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientExecutionMode)); + } + } +} + + +/// Connection class owning a client task. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientOwnerKind : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientOwnerKind(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// A discovered extension connection owns the task. + public static TaskClientOwnerKind Extension { get; } = new("extension"); + + /// A generic SDK connection owns the task. + public static TaskClientOwnerKind Sdk { get; } = new("sdk"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientOwnerKind left, TaskClientOwnerKind right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientOwnerKind left, TaskClientOwnerKind right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientOwnerKind other && Equals(other); + + /// + public bool Equals(TaskClientOwnerKind other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientOwnerKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientOwnerKind value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientOwnerKind)); + } + } +} + + +/// Presence of the task's bound join. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientOwnerPresence : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientOwnerPresence(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The bound session join is connected. + public static TaskClientOwnerPresence Connected { get; } = new("connected"); + + /// The bound session join is disconnected. + public static TaskClientOwnerPresence Disconnected { get; } = new("disconnected"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientOwnerPresence left, TaskClientOwnerPresence right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientOwnerPresence left, TaskClientOwnerPresence right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientOwnerPresence other && Equals(other); + + /// + public bool Equals(TaskClientOwnerPresence other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientOwnerPresence Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientOwnerPresence value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientOwnerPresence)); + } + } +} + + +/// Lifecycle status of a client-owned task. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The external owner is actively working. + public static TaskClientStatus Running { get; } = new("running"); + + /// The external owner is connected but waiting. + public static TaskClientStatus Idle { get; } = new("idle"); + + /// The owner reported successful completion. + public static TaskClientStatus Completed { get; } = new("completed"); + + /// The owner reported failure. + public static TaskClientStatus Failed { get; } = new("failed"); + + /// The owner reported or confirmed cancellation. + public static TaskClientStatus Cancelled { get; } = new("cancelled"); + + /// The bound owner join disappeared; external executor state is unknown. + public static TaskClientStatus Orphaned { get; } = new("orphaned"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientStatus left, TaskClientStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientStatus left, TaskClientStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientStatus other && Equals(other); + + /// + public bool Equals(TaskClientStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientStatus)); + } + } +} + + /// Whether the shell runs inside a managed PTY session or as an independent background process. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -24641,6 +25642,129 @@ public override void Write(Utf8JsonWriter writer, TaskShellInfoAttachmentMode va } +/// Discriminator for a client-owned task. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientType : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientType(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Gets the client value. + public static TaskClientType Client { get; } = new("client"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientType left, TaskClientType right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientType left, TaskClientType right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientType other && Equals(other); + + /// + public bool Equals(TaskClientType other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientType value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientType)); + } + } +} + + +/// Active status a client owner may publish with a progress update. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientActiveStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientActiveStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The external owner is actively working. + public static TaskClientActiveStatus Running { get; } = new("running"); + + /// The external owner is connected but waiting. + public static TaskClientActiveStatus Idle { get; } = new("idle"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientActiveStatus left, TaskClientActiveStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientActiveStatus left, TaskClientActiveStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientActiveStatus other && Equals(other); + + /// + public bool Equals(TaskClientActiveStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientActiveStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientActiveStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientActiveStatus)); + } + } +} + + /// Consumer allowed to call an MCP tool. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -29479,6 +30603,69 @@ public override void Write(Utf8JsonWriter writer, SessionVisibilityStatus value, } +/// Why the runtime requests client-task cancellation. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ClientTaskCancelReason : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ClientTaskCancelReason(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// A caller requested task cancellation. + public static ClientTaskCancelReason CancelRequested { get; } = new("cancel_requested"); + + /// The session is shutting down. + public static ClientTaskCancelReason SessionShutdown { get; } = new("session_shutdown"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ClientTaskCancelReason left, ClientTaskCancelReason right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ClientTaskCancelReason left, ClientTaskCancelReason right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is ClientTaskCancelReason other && Equals(other); + + /// + public bool Equals(ClientTaskCancelReason other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override ClientTaskCancelReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, ClientTaskCancelReason value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ClientTaskCancelReason)); + } + } +} + + /// Error classification. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -29887,13 +31074,14 @@ public async Task PingAsync(string? message = null, CancellationToke /// Performs the SDK server connection handshake and validates the optional connection token. Marked internal because this is JSON-RPC transport plumbing invoked automatically by an SDK client's own `connect()` wrapper, not a user-facing method. Stays internal as long as the SDK client owns the handshake; would only become public if the SDK ever exposed the raw schema surface to consumers without a connection wrapper. /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events. /// Identity of the integrating host. Optional; omit it to keep the default attribution. + /// Task kinds this connection can decode when observing session tasks. Omit to retain agent and shell compatibility. /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN. /// The to monitor for cancellation requests. The default is . /// Handshake result reporting the server's protocol version and package version on success. [Experimental(Diagnostics.Experimental)] - internal async Task ConnectAsync(bool? enableGitHubTelemetryForwarding = null, ConnectClientInfo? clientInfo = null, string? token = null, CancellationToken cancellationToken = default) + internal async Task ConnectAsync(bool? enableGitHubTelemetryForwarding = null, ConnectClientInfo? clientInfo = null, IList? supportedTaskKinds = null, string? token = null, CancellationToken cancellationToken = default) { - var request = new ConnectRequest { EnableGitHubTelemetryForwarding = enableGitHubTelemetryForwarding, ClientInfo = clientInfo, Token = token }; + var request = new ConnectRequest { EnableGitHubTelemetryForwarding = enableGitHubTelemetryForwarding, ClientInfo = clientInfo, SupportedTaskKinds = supportedTaskKinds, Token = token }; return await CopilotClient.InvokeRpcAsync(_rpc, "connect", [request], cancellationToken); } @@ -30281,12 +31469,13 @@ public async Task UpdateAsync(string name, object config, CancellationToken canc /// Removes an MCP server from user configuration. /// Name of the MCP server to remove. + /// OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. /// The to monitor for cancellation requests. The default is . - public async Task RemoveAsync(string name, CancellationToken cancellationToken = default) + public async Task RemoveAsync(string name, string? authClientIdMetadataUrl = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); - var request = new McpConfigRemoveRequest { Name = name }; + var request = new McpConfigRemoveRequest { Name = name, AuthClientIdMetadataUrl = authClientIdMetadataUrl }; await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.remove", [request], cancellationToken); } @@ -32310,9 +33499,9 @@ internal ModelApi(CopilotSession session) _session = session; } - /// Gets the currently selected model for the session. + /// Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn. /// The to monitor for cancellation requests. The default is . - /// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + /// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. public async Task GetCurrentAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); @@ -32323,6 +33512,7 @@ public async Task GetCurrentAsync(CancellationToken cancellationTo /// Switches the session to a model and optional reasoning configuration. /// 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. + /// Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`. /// Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. "none" disables reasoning. When omitted, no effort override is applied. /// Reasoning summary mode to request for supported model clients. /// Output verbosity level to request for supported models. @@ -32338,15 +33528,28 @@ public async Task GetCurrentAsync(CancellationToken cancellationTo /// Optional settings context and explicit-override flags used to persist a picker selection. /// The to monitor for cancellation requests. The default is . /// The model identifier active on the session after the switch. - public async Task SwitchToAsync(string modelId, string? reasoningEffort = null, ReasoningSummary? reasoningSummary = null, Verbosity? verbosity = null, ModelCapabilitiesOverride? modelCapabilities = null, ContextTier? contextTier = null, ModelChangeSource? source = null, bool? deferIfModelChangeQueued = null, string? compactionDecision = null, bool? runCompactionPreflight = null, string? repoScope = null, string? modelChangeScope = null, bool? requireAvailable = null, ModelPickerPersistenceRequest? pickerPersistence = null, CancellationToken cancellationToken = default) + public async Task SwitchToAsync(string modelId, AutoTier? autoTier = null, string? reasoningEffort = null, ReasoningSummary? reasoningSummary = null, Verbosity? verbosity = null, ModelCapabilitiesOverride? modelCapabilities = null, ContextTier? contextTier = null, ModelChangeSource? source = null, bool? deferIfModelChangeQueued = null, string? compactionDecision = null, bool? runCompactionPreflight = null, string? repoScope = null, string? modelChangeScope = null, bool? requireAvailable = null, ModelPickerPersistenceRequest? pickerPersistence = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(modelId); _session.ThrowIfDisposed(); - var request = new ModelSwitchToRequest { SessionId = _session.SessionId, ModelId = modelId, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, Verbosity = verbosity, ModelCapabilities = modelCapabilities, ContextTier = contextTier, Source = source, DeferIfModelChangeQueued = deferIfModelChangeQueued, CompactionDecision = compactionDecision, RunCompactionPreflight = runCompactionPreflight, RepoScope = repoScope, ModelChangeScope = modelChangeScope, RequireAvailable = requireAvailable, PickerPersistence = pickerPersistence }; + var request = new ModelSwitchToRequest { SessionId = _session.SessionId, ModelId = modelId, AutoTier = autoTier, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, Verbosity = verbosity, ModelCapabilities = modelCapabilities, ContextTier = contextTier, Source = source, DeferIfModelChangeQueued = deferIfModelChangeQueued, CompactionDecision = compactionDecision, RunCompactionPreflight = runCompactionPreflight, RepoScope = repoScope, ModelChangeScope = modelChangeScope, RequireAvailable = requireAvailable, PickerPersistence = pickerPersistence }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.switchTo", [request], cancellationToken); } + /// Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`. + /// Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. + /// Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. + /// The to monitor for cancellation requests. The default is . + /// Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. + public async Task SwitchAutoTierAsync(AutoTier? autoTier, ModelChangeSource? source = null, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new ModelSwitchAutoTierRequest { SessionId = _session.SessionId, AutoTier = autoTier, Source = source }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.switchAutoTier", [request], cancellationToken); + } + /// Resolves and applies organization-managed and repository model overlays. /// Model required by device-managed policy, when configured. /// Model required by server-managed policy, when configured. @@ -32968,6 +34171,41 @@ public async Task ListAsync(CancellationToken cancellationToken = defa return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.list", [request], cancellationToken); } + /// Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal. + /// Task kind. + /// Owner-scoped idempotency key used for registration and reclaim. + /// Human-readable description of the external work. + /// Whether the owner supports runtime cancellation requests. + /// Optional short display name for the external work. + /// Expected current sequence for idempotent registration or orphan reclaim. + /// The to monitor for cancellation requests. The default is . + /// Result of registering or reclaiming a client-owned task. + public async Task RegisterAsync(TaskClientType type, string clientTaskId, string description, bool cancellable, string? displayName = null, long? expectedSequence = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(clientTaskId); + ArgumentNullException.ThrowIfNull(description); + _session.ThrowIfDisposed(); + + var request = new TasksRegisterRequest { SessionId = _session.SessionId, Type = type, ClientTaskId = clientTaskId, Description = description, Cancellable = cancellable, DisplayName = displayName, ExpectedSequence = expectedSequence }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.register", [request], cancellationToken); + } + + /// Publishes generic progress or a terminal outcome for a client-owned task. + /// Canonical runtime-generated task identifier. + /// Owner update sequence to apply. + /// Progress or terminal update payload. + /// The to monitor for cancellation requests. The default is . + /// Result of publishing a client-owned task update. + public async Task UpdateAsync(string id, long sequence, TaskClientUpdate update, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(id); + ArgumentNullException.ThrowIfNull(update); + _session.ThrowIfDisposed(); + + var request = new TasksUpdateRequest { SessionId = _session.SessionId, Id = id, Sequence = sequence, Update = update }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.update", [request], cancellationToken); + } + /// Refreshes metadata for any detached background shells the runtime knows about. /// The to monitor for cancellation requests. The default is . /// Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop. @@ -35671,6 +36909,17 @@ public interface IFactoryHandler Task AbortAsync(FactoryAbortRequest request, CancellationToken cancellationToken = default); } +/// Handles `tasks` client session API methods. +[Experimental(Diagnostics.Experimental)] +public interface ITasksHandler +{ + /// Asks the client currently bound to a client-owned session task to confirm that its external work stopped. + /// Runtime-to-owner cancellation request for a client-owned task. + /// The to monitor for cancellation requests. The default is . + /// Whether the client authoritatively confirmed its external work stopped. + Task CancelAsync(ClientTaskCancelRequest request, CancellationToken cancellationToken = default); +} + /// Handles `sessionFs` client session API methods. [Experimental(Diagnostics.Experimental)] public interface ISessionFsHandler @@ -35771,6 +37020,9 @@ public sealed class ClientSessionApiHandlers /// Optional handler for Factory client session API methods. public IFactoryHandler? Factory { get; set; } + /// Optional handler for Tasks client session API methods. + public ITasksHandler? Tasks { get; set; } + /// Optional handler for SessionFs client session API methods. public ISessionFsHandler? SessionFs { get; set; } @@ -35806,6 +37058,12 @@ public static void RegisterClientSessionApiHandlers(JsonRpc rpc, Func>)(async (request, cancellationToken) => + { + var handler = getHandlers(request.SessionId).Tasks; + if (handler is null) throw new InvalidOperationException($"No tasks handler registered for session: {request.SessionId}"); + return await handler.CancelAsync(request, cancellationToken); + }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.readFile", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; @@ -36099,6 +37357,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchRequestedEvent), TypeInfoPropertyName = "SessionEventsAutoModeSwitchRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchResponse), TypeInfoPropertyName = "SessionEventsAutoModeSwitchResponse")] [JsonSerializable(typeof(GitHub.Copilot.AutoTier), TypeInfoPropertyName = "SessionEventsAutoTier")] +[JsonSerializable(typeof(GitHub.Copilot.AutoTierSwitchFailureReason), TypeInfoPropertyName = "SessionEventsAutoTierSwitchFailureReason")] [JsonSerializable(typeof(GitHub.Copilot.AutopilotObjectiveChangedOperation), TypeInfoPropertyName = "SessionEventsAutopilotObjectiveChangedOperation")] [JsonSerializable(typeof(GitHub.Copilot.AutopilotObjectiveChangedStatus), TypeInfoPropertyName = "SessionEventsAutopilotObjectiveChangedStatus")] [JsonSerializable(typeof(GitHub.Copilot.BinaryAssetReference), TypeInfoPropertyName = "SessionEventsBinaryAssetReference")] @@ -36476,6 +37735,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(CatalogNegotiatedContract))] [JsonSerializable(typeof(CatalogSearchRequest))] [JsonSerializable(typeof(CatalogSearchResult))] +[JsonSerializable(typeof(ClientTaskCancelRequest))] +[JsonSerializable(typeof(ClientTaskCancelResult))] [JsonSerializable(typeof(CommandList))] [JsonSerializable(typeof(CommandsFinalizeInvocationEffectRequest))] [JsonSerializable(typeof(CommandsFinalizeInvocationEffectRequestEffect))] @@ -36782,6 +38043,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(ModelPolicy))] [JsonSerializable(typeof(ModelSetReasoningEffortRequest))] [JsonSerializable(typeof(ModelSetReasoningEffortResult))] +[JsonSerializable(typeof(ModelSwitchAutoTierRequest))] +[JsonSerializable(typeof(ModelSwitchAutoTierResult))] [JsonSerializable(typeof(ModelSwitchConfirmation))] [JsonSerializable(typeof(ModelSwitchToRequest))] [JsonSerializable(typeof(ModelSwitchToResult))] @@ -37202,27 +38465,34 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SlashCommandSelectSubcommandOption))] [JsonSerializable(typeof(SlashCommandTimelineEntry))] [JsonSerializable(typeof(SubagentSettingsEntry))] +[JsonSerializable(typeof(TaskClientInfo))] +[JsonSerializable(typeof(TaskClientOwner))] +[JsonSerializable(typeof(TaskClientUpdate))] [JsonSerializable(typeof(TaskCompleteData))] [JsonSerializable(typeof(TaskCompletionDecision))] [JsonSerializable(typeof(TaskInfo))] [JsonSerializable(typeof(TaskList))] +[JsonSerializable(typeof(TaskProgress))] [JsonSerializable(typeof(TaskProgressLine))] [JsonSerializable(typeof(TasksCancelRequest))] [JsonSerializable(typeof(TasksCancelResult))] [JsonSerializable(typeof(TasksGetCurrentPromotableResult))] [JsonSerializable(typeof(TasksGetProgressRequest))] [JsonSerializable(typeof(TasksGetProgressResult))] -[JsonSerializable(typeof(TasksGetProgressResultProgress))] [JsonSerializable(typeof(TasksPromoteCurrentToBackgroundResult))] [JsonSerializable(typeof(TasksPromoteToBackgroundRequest))] [JsonSerializable(typeof(TasksPromoteToBackgroundResult))] [JsonSerializable(typeof(TasksRefreshResult))] +[JsonSerializable(typeof(TasksRegisterRequest))] +[JsonSerializable(typeof(TasksRegisterResult))] [JsonSerializable(typeof(TasksRemoveRequest))] [JsonSerializable(typeof(TasksRemoveResult))] [JsonSerializable(typeof(TasksSendMessageRequest))] [JsonSerializable(typeof(TasksSendMessageResult))] [JsonSerializable(typeof(TasksStartAgentRequest))] [JsonSerializable(typeof(TasksStartAgentResult))] +[JsonSerializable(typeof(TasksUpdateRequest))] +[JsonSerializable(typeof(TasksUpdateResult))] [JsonSerializable(typeof(TasksWaitForPendingResult))] [JsonSerializable(typeof(TelemetrySetFeatureOverridesRequest))] [JsonSerializable(typeof(Tool))] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index 147e08e458..e7890dee92 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -84,6 +84,7 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionLimitsExhaustedCompletedEvent), "session_limits_exhausted.completed")] [JsonDerivedType(typeof(SessionLimitsExhaustedRequestedEvent), "session_limits_exhausted.requested")] [JsonDerivedType(typeof(SessionAutoModeResolvedEvent), "session.auto_mode_resolved")] +[JsonDerivedType(typeof(SessionAutoTierSwitchFailedEvent), "session.auto_tier_switch_failed")] [JsonDerivedType(typeof(SessionAutopilotObjectiveChangedEvent), "session.autopilot_objective_changed")] [JsonDerivedType(typeof(SessionBackgroundTasksChangedEvent), "session.background_tasks_changed")] [JsonDerivedType(typeof(SessionBinaryAssetEvent), "session.binary_asset")] @@ -112,6 +113,8 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionInfoEvent), "session.info")] [JsonDerivedType(typeof(SessionManagedSettingsEnforcedEvent), "session.managed_settings_enforced")] [JsonDerivedType(typeof(SessionManagedSettingsResolvedEvent), "session.managed_settings_resolved")] +[JsonDerivedType(typeof(SessionMcpServerNeedsReconnectEvent), "session.mcp_server_needs_reconnect")] +[JsonDerivedType(typeof(SessionMcpServerRemovedEvent), "session.mcp_server_removed")] [JsonDerivedType(typeof(SessionMcpServerStatusChangedEvent), "session.mcp_server_status_changed")] [JsonDerivedType(typeof(SessionMcpServersLoadedEvent), "session.mcp_servers_loaded")] [JsonDerivedType(typeof(SessionModeChangedEvent), "session.mode_changed")] @@ -368,6 +371,19 @@ public sealed partial class SessionModelChangeEvent : SessionEvent public required SessionModelChangeData Data { get; set; } } +/// A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. +/// Represents the session.auto_tier_switch_failed event. +public sealed partial class SessionAutoTierSwitchFailedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.auto_tier_switch_failed"; + + /// The session.auto_tier_switch_failed event payload. + [JsonPropertyName("data")] + public required SessionAutoTierSwitchFailedData Data { get; set; } +} + /// Agent mode change details including previous and new modes. /// Represents the session.mode_changed event. public sealed partial class SessionModeChangedEvent : SessionEvent @@ -1790,6 +1806,32 @@ public sealed partial class SessionMcpServerStatusChangedEvent : SessionEvent public required SessionMcpServerStatusChangedData Data { get; set; } } +/// Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. +/// Represents the session.mcp_server_removed event. +public sealed partial class SessionMcpServerRemovedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.mcp_server_removed"; + + /// The session.mcp_server_removed event payload. + [JsonPropertyName("data")] + public required SessionMcpServerRemovedData Data { get; set; } +} + +/// Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. +/// Represents the session.mcp_server_needs_reconnect event. +public sealed partial class SessionMcpServerNeedsReconnectEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.mcp_server_needs_reconnect"; + + /// The session.mcp_server_needs_reconnect event payload. + [JsonPropertyName("data")] + public required SessionMcpServerNeedsReconnectData Data { get; set; } +} + /// Payload identifying the MCP server associated with a list change. /// Represents the mcp.tools.list_changed event. public sealed partial class McpToolsListChangedEvent : SessionEvent @@ -2323,6 +2365,11 @@ public sealed partial class SessionWarningData /// Model change details including previous and new model identifiers. public sealed partial class SessionModelChangeData { + /// Committed Auto preference after the model configuration change, when applicable. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("autoTier")] + public AutoTier? AutoTier { get; set; } + /// Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("cause")] @@ -2337,6 +2384,11 @@ public sealed partial class SessionModelChangeData [JsonPropertyName("newModel")] public required string NewModel { get; set; } + /// Previously committed Auto preference, when one was explicitly selected. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("previousAutoTier")] + public AutoTier? PreviousAutoTier { get; set; } + /// Model that was previously selected, if any. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("previousModel")] @@ -2378,6 +2430,23 @@ public sealed partial class SessionModelChangeData public Verbosity? Verbosity { get; set; } } +/// A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. +public sealed partial class SessionAutoTierSwitchFailedData +{ + /// Auto preference that remains effective after the failed request. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("effectiveAutoTier")] + public AutoTier? EffectiveAutoTier { get; set; } + + /// Low-cardinality failure outcome reported by Auto resolution. + [JsonPropertyName("reason")] + public required AutoTierSwitchFailureReason Reason { get; set; } + + /// Auto preference that failed to activate, or null when returning to provider-default routing failed. + [JsonPropertyName("requestedAutoTier")] + public AutoTier? RequestedAutoTier { get; set; } +} + /// Agent mode change details including previous and new modes. public sealed partial class SessionModeChangedData { @@ -5855,6 +5924,22 @@ public sealed partial class SessionMcpServerStatusChangedData public required McpServerStatus Status { get; set; } } +/// Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. +public sealed partial class SessionMcpServerRemovedData +{ + /// Name of the MCP server that was removed from the graph. + [JsonPropertyName("serverName")] + public required string ServerName { get; set; } +} + +/// Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. +public sealed partial class SessionMcpServerNeedsReconnectData +{ + /// Name of the MCP server that needs to reconnect. + [JsonPropertyName("serverName")] + public required string ServerName { get; set; } +} + /// Payload identifying the MCP server associated with a list change. public sealed partial class McpToolsListChangedData { @@ -11233,6 +11318,73 @@ public override void Write(Utf8JsonWriter writer, ModelChangeSource value, JsonS } } +/// Terminal reason an Auto preference activation failed. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct AutoTierSwitchFailureReason : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public AutoTierSwitchFailureReason(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The candidate model was rejected by model policy. + public static AutoTierSwitchFailureReason PolicyRejected { get; } = new("policy_rejected"); + + /// The Auto routing request failed or returned an unusable response. + public static AutoTierSwitchFailureReason RequestFailed { get; } = new("request_failed"); + + /// The runtime could not prepare the Auto routing request. + public static AutoTierSwitchFailureReason SetupFailed { get; } = new("setup_failed"); + + /// The provider does not support Auto routing. + public static AutoTierSwitchFailureReason Unsupported { get; } = new("unsupported"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(AutoTierSwitchFailureReason left, AutoTierSwitchFailureReason right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(AutoTierSwitchFailureReason left, AutoTierSwitchFailureReason right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is AutoTierSwitchFailureReason other && Equals(other); + + /// + public bool Equals(AutoTierSwitchFailureReason other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override AutoTierSwitchFailureReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, AutoTierSwitchFailureReason value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AutoTierSwitchFailureReason)); + } + } +} + /// Permission mode for the session. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -16307,6 +16459,8 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SandboxDecisionEvent))] [JsonSerializable(typeof(SessionAutoModeResolvedData))] [JsonSerializable(typeof(SessionAutoModeResolvedEvent))] +[JsonSerializable(typeof(SessionAutoTierSwitchFailedData))] +[JsonSerializable(typeof(SessionAutoTierSwitchFailedEvent))] [JsonSerializable(typeof(SessionAutopilotObjectiveChangedData))] [JsonSerializable(typeof(SessionAutopilotObjectiveChangedEvent))] [JsonSerializable(typeof(SessionBackgroundTasksChangedData))] @@ -16370,6 +16524,10 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SessionManagedSettingsEnforcedEvent))] [JsonSerializable(typeof(SessionManagedSettingsResolvedData))] [JsonSerializable(typeof(SessionManagedSettingsResolvedEvent))] +[JsonSerializable(typeof(SessionMcpServerNeedsReconnectData))] +[JsonSerializable(typeof(SessionMcpServerNeedsReconnectEvent))] +[JsonSerializable(typeof(SessionMcpServerRemovedData))] +[JsonSerializable(typeof(SessionMcpServerRemovedEvent))] [JsonSerializable(typeof(SessionMcpServerStatusChangedData))] [JsonSerializable(typeof(SessionMcpServerStatusChangedEvent))] [JsonSerializable(typeof(SessionMcpServersLoadedData))] diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index fea4796fae..cf7b8f4738 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -1366,9 +1366,12 @@ type CanvasSessionContext struct { // Experimental: CapiSessionOptions is part of an experimental API and may change or be // removed. type CapiSessionOptions struct { - // Routing preference used when the session model is `auto`. The runtime persists the - // preference across cold resume. When omitted, the default routing behavior is used. - // Resuming an already-resident session cannot change its preference. + // Routing preference for sessions whose model is `auto`. On create or cold resume, this + // establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold + // resume, the runtime restores the last committed preference. On resident resume, a + // different value requests a safe switch after resume succeeds and cannot change an + // in-flight turn. Successful switches are persisted for later cold resume. When no + // preference is supplied or restored, CAPI default routing is used. AutoTier *AutoTier `json:"autoTier,omitempty"` // 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 @@ -1850,6 +1853,30 @@ func (CatalogUnsupportedKindError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindUnsupportedKind } +// Runtime-to-owner cancellation request for a client-owned task. +// Experimental: ClientTaskCancelRequest is part of an experimental API and may change or be +// removed. +type ClientTaskCancelRequest struct { + // Opaque identifier shared by coalesced cancellation callers + CancellationID string `json:"cancellationId"` + // Owner-scoped task key included for correlation + ClientTaskID string `json:"clientTaskId"` + // Canonical runtime-generated task identifier + ID string `json:"id"` + // Reason the runtime requests cancellation + Reason ClientTaskCancelReason `json:"reason"` + // Session that owns the client task + SessionID string `json:"sessionId"` +} + +// Whether the client authoritatively confirmed its external work stopped. +// Experimental: ClientTaskCancelResult is part of an experimental API and may change or be +// removed. +type ClientTaskCancelResult struct { + // True only when the owner confirms that external work stopped before responding + Cancelled bool `json:"cancelled"` +} + // Slash commands available in the session, after applying any include/exclude filters. // Experimental: CommandList is part of an experimental API and may change or be removed. type CommandList struct { @@ -2073,6 +2100,9 @@ type ConnectRequest struct { // using the process-global gate for ordinary events and an explicit session-scoped decision // for host-only events. EnableGitHubTelemetryForwarding *bool `json:"enableGitHubTelemetryForwarding,omitempty"` + // Task kinds this connection can decode when observing session tasks. Omit to retain agent + // and shell compatibility. + SupportedTaskKinds []TaskKind `json:"supportedTaskKinds,omitzero"` // Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN Token *string `json:"token,omitempty"` } @@ -2085,6 +2115,8 @@ type ConnectResult struct { Ok bool `json:"ok"` // Server protocol version number ProtocolVersion int64 `json:"protocolVersion"` + // Task kinds the server may return to this connection. + TaskKinds []TaskKind `json:"taskKinds,omitzero"` // Server package version Version string `json:"version"` } @@ -2341,15 +2373,24 @@ type CopilotUserResponseQuotaSnapshotsPremiumInteractions struct { Unlimited *bool `json:"unlimited,omitempty"` } -// The currently selected model, reasoning effort, and context tier for the session. The -// context tier reflects `Session.getContextTier()`, restored from the session journal on -// resume. +// The session's authoritative model snapshot. Auto preference fields are configuration for +// the virtual `auto` model and do not change the selected model identifier. The context +// tier reflects `Session.getContextTier()`, restored from the session journal on resume. // Experimental: CurrentModel is part of an experimental API and may change or be removed. type CurrentModel struct { + // Auto preference currently claimed by an in-progress activation. Null means the activation + // is returning to provider-default routing. + ActivatingAutoTier *AutoTier `json:"activatingAutoTier,omitempty"` + // Auto preference currently committed for the session. This can remain available while + // another model is selected so a later switch to `auto` can reuse it. + AutoTier *AutoTier `json:"autoTier,omitempty"` // Context tier for models that support multiple context-window sizes. ContextTier *ContextTier `json:"contextTier,omitempty"` // Currently active model identifier ModelID *string `json:"modelId,omitempty"` + // Latest unclaimed Auto preference waiting for a future user turn. Null means the pending + // request is returning to provider-default routing. + PendingAutoTier *AutoTier `json:"pendingAutoTier,omitempty"` // Reasoning effort level currently applied to the active model, when one is set. Reads // `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the // two values are reported as a snapshot. @@ -5127,6 +5168,8 @@ type MCPConfigReloadResult struct { // Experimental: MCPConfigRemoveRequest is part of an experimental API and may change or be // removed. type MCPConfigRemoveRequest struct { + // OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. + AuthClientIDMetadataURL *string `json:"authClientIdMetadataUrl,omitempty"` // Name of the MCP server to remove Name string `json:"name"` } @@ -6938,6 +6981,10 @@ type Model struct { // a recommended alternative. Present only when the service published at least one notice. // Hosts should surface these without implying anything is wrong with the model. InfoMessages []ModelMessage `json:"infoMessages,omitzero"` + // Provider-supplied model metadata. Keys and JSON-compatible values are preserved + // unchanged. This is factual metadata published by the model provider; it carries no picker + // or UX semantics. + Metadata map[string]any `json:"metadata,omitzero"` // Model capability category for grouping in the model picker ModelPickerCategory *ModelPickerCategory `json:"modelPickerCategory,omitempty"` // Relative cost tier for token-based billing users @@ -7266,6 +7313,38 @@ type ModelsListRequest struct { SelectionID *string `json:"selectionId,omitempty"` } +// An Auto preference request for the session. This updates Auto configuration only; it does +// not change the selected model to `auto`. +// Experimental: ModelSwitchAutoTierRequest is part of an experimental API and may change or +// be removed. +type ModelSwitchAutoTierRequest struct { + // Auto preference to activate when a future user turn using the `auto` model safely mints a + // replacement model and token pair. Pass null to return to provider-default Auto routing. + AutoTier *AutoTier `json:"autoTier"` + // Origin to record on the effective `session.model_change` event. Defaults to `sdk` when + // omitted. + Source *ModelChangeSource `json:"source,omitempty"` +} + +// Immediate acknowledgement and Auto preference snapshot after a switch request. This +// result never implies that a pending preference committed. +// Experimental: ModelSwitchAutoTierResult is part of an experimental API and may change or +// be removed. +type ModelSwitchAutoTierResult struct { + // Auto preference currently claimed by an in-progress activation. Null means the activation + // is returning to provider-default routing. + ActivatingAutoTier *AutoTier `json:"activatingAutoTier,omitempty"` + // Auto preference currently committed for the session. + EffectiveAutoTier *AutoTier `json:"effectiveAutoTier,omitempty"` + // Latest unclaimed Auto preference waiting for a future user turn. + PendingAutoTier *AutoTier `json:"pendingAutoTier,omitempty"` + // Immediate request status. `pending` means accepted but not committed. + Status ModelSwitchAutoTierStatus `json:"status"` + // Earlier unclaimed preference replaced by this request. This can be present with either + // status, including when selecting the effective preference cancels pending work. + SupersededAutoTier *AutoTier `json:"supersededAutoTier,omitempty"` +} + // Experimental: ModelSwitchConfirmation is part of an experimental API and may change or be // removed. type ModelSwitchConfirmation struct { @@ -7282,6 +7361,10 @@ type ModelSwitchConfirmation struct { // Experimental: ModelSwitchToRequest is part of an experimental API and may change or be // removed. type ModelSwitchToRequest struct { + // Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to + // return to provider-default Auto routing. This field is rejected when `modelId` is not + // `auto`. + AutoTier *AutoTier `json:"autoTier,omitempty"` // Explicit response to a model-switch compaction preflight. Omit to request a confirmation // projection when compaction is necessary. CompactionDecision *string `json:"compactionDecision,omitempty"` @@ -7340,6 +7423,9 @@ type ModelSwitchToResult struct { Message *string `json:"message,omitempty"` // Currently active model identifier after the switch ModelID *string `json:"modelId,omitempty"` + // Authoritative model and Auto preference state after an immediate switch. For deferred + // switches this remains the current state until the queued change drains. + ModelState *CurrentModel `json:"modelState,omitempty"` // Persistence failure encountered after applying the model switch. PersistenceError *string `json:"persistenceError,omitempty"` // Lifecycle result for the requested switch @@ -10321,6 +10407,12 @@ type RuntimeShutdownResult struct { type SandboxConfig struct { // Whether to auto-add the current working directory to readwritePaths. Default: true. AddCurrentWorkingDirectory *bool `json:"addCurrentWorkingDirectory,omitempty"` + // Whether the agent may request that an individual command run outside the sandbox, which + // the host then approves or denies through the usual permission flow. A host capability + // flag rather than part of the policy: it is stripped from the effective spawn policy and + // only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this + // object: omitting it offers no bypass. Default: false (opt-in). + AllowBypass *bool `json:"allowBypass,omitempty"` // Whether to auto-grant read access to tool directories discovered on PATH and in toolchain // environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common // developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the @@ -10337,6 +10429,27 @@ type SandboxConfig struct { Auth *SandboxConfigAuth `json:"auth,omitempty"` // Whether sandboxing is enabled for the session. Enabled bool `json:"enabled"` + // The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`. + // Internal: ManagedLspRoutingLocked is part of the SDK's internal API surface and is not + // intended for external use. + ManagedLspRoutingLocked *bool `json:"managedLspRoutingLocked,omitempty"` + // Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local + // opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at + // the administrator instead of a setting the next managed merge would override, and it is + // ignored when comparing two configs for change. Only the managed merge may set it; a + // caller-supplied value is stripped. + // Internal: ManagedMCPRoutingLocked is part of the SDK's internal API surface and is not + // intended for external use. + ManagedMCPRoutingLocked *bool `json:"managedMcpRoutingLocked,omitempty"` + // Whether language servers the session launches are confined by the sandbox. Only an + // explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by + // default; set to false to opt out). + SandboxLspServers *bool `json:"sandboxLspServers,omitempty"` + // Whether MCP servers the session launches are confined by the sandbox. Only an explicit + // `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and + // `enabled` are always read together. Ignored while `enabled` is false. Default: true + // (enabled by default; set to false to opt out). + SandboxMCPServers *bool `json:"sandboxMcpServers,omitempty"` // User-managed sandbox policy fragment merged into the auto-discovered base policy. UserPolicy *SandboxConfigUserPolicy `json:"userPolicy,omitempty"` } @@ -11999,6 +12112,8 @@ type SessionOpenOptions struct { AllowAllMCPServerInstructions *bool `json:"allowAllMcpServerInstructions,omitempty"` // Whether ask_user is explicitly disabled. AskUserDisabled *bool `json:"askUserDisabled,omitempty"` + // OAuth Client ID Metadata Document URL used by this host for MCP authorization. + AuthClientIDMetadataURL *string `json:"authClientIdMetadataUrl,omitempty"` // Initial authentication info for the session. AuthInfo AuthInfo `json:"authInfo,omitempty"` // Allowlist of available tool names. @@ -14077,6 +14192,102 @@ type SubagentSettingsEntry struct { ModelPolicy *AgentModelPolicy `json:"modelPolicy,omitempty"` } +// Public owner attribution for a client-owned task. Identifiers are opaque and never +// authorize requests. +// Experimental: TaskClientOwner is part of an experimental API and may change or be removed. +type TaskClientOwner struct { + // ISO 8601 timestamp when the bound join disconnected + DisconnectedAt *time.Time `json:"disconnectedAt,omitempty"` + // Display-only owner name + DisplayName *string `json:"displayName,omitempty"` + // Opaque identity of the currently or most recently bound session join + JoinID string `json:"joinId"` + // Class of the task owner + Kind TaskClientOwnerKind `json:"kind"` + // Opaque session-scoped participant identity + ParticipantID string `json:"participantId"` + // Whether this task's bound join is currently connected + Presence TaskClientOwnerPresence `json:"presence"` + // Display-only owner source + Source *string `json:"source,omitempty"` +} + +// Progress or terminal update for a client-owned task. +// Experimental: TaskClientUpdate is part of an experimental API and may change or be +// removed. +type TaskClientUpdate interface { + taskClientUpdate() + Kind() TaskClientUpdateKind +} + +type RawTaskClientUpdateData struct { + Discriminator TaskClientUpdateKind + Raw json.RawMessage +} + +func (RawTaskClientUpdateData) taskClientUpdate() {} +func (r RawTaskClientUpdateData) Kind() TaskClientUpdateKind { + return r.Discriminator +} + +// Reports terminal cancellation after external work stopped. +type TaskClientUpdateCancelled struct { + // Optional final progress message + Message *string `json:"message,omitempty"` + // Optional human-readable cancellation reason + Reason *string `json:"reason,omitempty"` +} + +func (TaskClientUpdateCancelled) taskClientUpdate() {} +func (TaskClientUpdateCancelled) Kind() TaskClientUpdateKind { + return TaskClientUpdateKindCancelled +} + +// Reports successful terminal completion. +type TaskClientUpdateCompleted struct { + // Optional final progress message + Message *string `json:"message,omitempty"` + // Optional opaque successful terminal result + Result any `json:"result,omitempty"` +} + +func (TaskClientUpdateCompleted) taskClientUpdate() {} +func (TaskClientUpdateCompleted) Kind() TaskClientUpdateKind { + return TaskClientUpdateKindCompleted +} + +// Reports terminal failure. +type TaskClientUpdateFailed struct { + // Optional owner-supplied terminal failure code + Code *string `json:"code,omitempty"` + // Human-readable terminal failure message + Error string `json:"error"` + // Optional final progress message + Message *string `json:"message,omitempty"` +} + +func (TaskClientUpdateFailed) taskClientUpdate() {} +func (TaskClientUpdateFailed) Kind() TaskClientUpdateKind { + return TaskClientUpdateKindFailed +} + +// Publishes nonterminal progress for a running or idle client task. +type TaskClientUpdateProgress struct { + // Optional progress message appended to recent activity when nonempty + Message *string `json:"message,omitempty"` + // Optional completion percentage; null clears the current percentage + Percentage *float64 `json:"percentage,omitempty"` + // Optional progress phase; null clears the current phase + Phase *string `json:"phase,omitempty"` + // Optional active status transition + Status *TaskClientActiveStatus `json:"status,omitempty"` +} + +func (TaskClientUpdateProgress) taskClientUpdate() {} +func (TaskClientUpdateProgress) Kind() TaskClientUpdateKind { + return TaskClientUpdateKindProgress +} + // Task completion notification with summary from the agent // Experimental: TaskCompleteData is part of an experimental API and may change or be // removed. @@ -14116,7 +14327,7 @@ type TaskCompletionDecision struct { ReviewerResultMeta any `json:"reviewerResultMeta,omitempty"` } -// Tracked task union returned by task APIs, containing either an agent task or a shell task. +// Tracked task union returned by task APIs, containing an agent, client, or shell task. // Experimental: TaskInfo is part of an experimental API and may change or be removed. type TaskInfo interface { taskInfo() @@ -14185,6 +14396,58 @@ func (TaskAgentInfo) Type() TaskInfoType { return TaskInfoTypeAgent } +// Tracked client-owned task metadata. +// Experimental: TaskClientInfo is part of an experimental API and may change or be removed. +type TaskClientInfo struct { + // ISO 8601 timestamp when the current active segment started + ActiveStartedAt *time.Time `json:"activeStartedAt,omitempty"` + // Accumulated active execution time in milliseconds + ActiveTimeMs int64 `json:"activeTimeMs"` + // Whether the currently bound owner can receive a cancellation request + CanCancel bool `json:"canCancel"` + // Human-readable reason for terminal cancellation + CancellationReason *string `json:"cancellationReason,omitempty"` + // Owner-scoped registration and reclaim key + ClientTaskID string `json:"clientTaskId"` + // ISO 8601 timestamp when the task reached a terminal status + CompletedAt *time.Time `json:"completedAt,omitempty"` + // Task description + Description string `json:"description"` + // Optional task display name + DisplayName *string `json:"displayName,omitempty"` + // Human-readable terminal failure message + Error *string `json:"error,omitempty"` + // Optional owner-supplied terminal failure code + ErrorCode *string `json:"errorCode,omitempty"` + // Execution mode, which is always background for client-owned tasks + ExecutionMode TaskClientExecutionMode `json:"executionMode"` + // Canonical runtime-generated task identifier + ID string `json:"id"` + // ISO 8601 timestamp when the connected owner entered idle status + IdleSince *time.Time `json:"idleSince,omitempty"` + // ISO 8601 timestamp of the most recent orphan transition + OrphanedAt *time.Time `json:"orphanedAt,omitempty"` + // Public attribution and presence for the task owner + Owner TaskClientOwner `json:"owner"` + // ISO 8601 timestamp of the most recent successful reclaim + ReclaimedAt *time.Time `json:"reclaimedAt,omitempty"` + // Opaque successful terminal result supplied by the task owner + Result any `json:"result,omitempty"` + // Sequence number of the latest accepted owner update + Sequence int64 `json:"sequence"` + // ISO 8601 timestamp when the task started + StartedAt time.Time `json:"startedAt"` + // Client task lifecycle status + Status TaskClientStatus `json:"status"` + // ISO 8601 timestamp of the latest accepted lifecycle change + UpdatedAt time.Time `json:"updatedAt"` +} + +func (TaskClientInfo) taskInfo() {} +func (TaskClientInfo) Type() TaskInfoType { + return TaskInfoTypeClient +} + // Tracked shell task metadata, including ID, command, status, timing, attachment/execution // mode, log path, and PID. // Experimental: TaskShellInfo is part of an experimental API and may change or be removed. @@ -14226,6 +14489,8 @@ type TaskList struct { Tasks []TaskInfo `json:"tasks"` } +// Progress information for the task, discriminated by type. Returns null when no task with +// this ID is currently tracked. // Experimental: TaskProgress is part of an experimental API and may change or be removed. type TaskProgress interface { taskProgress() @@ -14258,6 +14523,31 @@ func (TaskAgentProgress) Type() TaskProgressType { return TaskProgressTypeAgent } +// Generic progress for a client-owned task. +// Experimental: TaskClientProgress is part of an experimental API and may change or be +// removed. +type TaskClientProgress struct { + // Most recent nonempty progress message + LastMessage *string `json:"lastMessage,omitempty"` + // Current completion percentage from zero through one hundred + Percentage *float64 `json:"percentage,omitempty"` + // Current owner-defined progress phase + Phase *string `json:"phase,omitempty"` + // Recent server-timestamped progress messages + RecentActivity []TaskProgressLine `json:"recentActivity"` + // Sequence number of the latest accepted owner update + Sequence int64 `json:"sequence"` + // Current client task lifecycle status + Status TaskClientStatus `json:"status"` + // ISO 8601 timestamp of the latest accepted lifecycle change + UpdatedAt time.Time `json:"updatedAt"` +} + +func (TaskClientProgress) taskProgress() {} +func (TaskClientProgress) Type() TaskProgressType { + return TaskProgressTypeClient +} + // Progress snapshot for a shell task, with recent stdout/stderr output and optional process // ID. // Experimental: TaskShellProgress is part of an experimental API and may change or be @@ -14361,6 +14651,36 @@ type TasksPromoteToBackgroundResult struct { type TasksRefreshResult struct { } +// Registers or reclaims a client-owned task. +// Experimental: TasksRegisterRequest is part of an experimental API and may change or be +// removed. +type TasksRegisterRequest struct { + // Whether the owner supports runtime cancellation requests + Cancellable bool `json:"cancellable"` + // Owner-scoped idempotency key used for registration and reclaim + ClientTaskID string `json:"clientTaskId"` + // Human-readable description of the external work + Description string `json:"description"` + // Optional short display name for the external work + DisplayName *string `json:"displayName,omitempty"` + // Expected current sequence for idempotent registration or orphan reclaim + ExpectedSequence *int64 `json:"expectedSequence,omitempty"` + // Task kind + Type TaskClientType `json:"type"` +} + +// Result of registering or reclaiming a client-owned task. +// Experimental: TasksRegisterResult is part of an experimental API and may change or be +// removed. +type TasksRegisterResult struct { + // True only when this invocation created a new task + Created bool `json:"created"` + // True only when this invocation reclaimed an orphaned task + Reclaimed bool `json:"reclaimed"` + // Authoritative registered or reclaimed task + Task TaskClientInfo `json:"task"` +} + // Identifier of the completed or cancelled task to remove from tracking. // Experimental: TasksRemoveRequest is part of an experimental API and may change or be // removed. @@ -14425,6 +14745,30 @@ type TasksStartAgentResult struct { AgentID string `json:"agentId"` } +// Updates a client-owned task. +// Experimental: TasksUpdateRequest is part of an experimental API and may change or be +// removed. +type TasksUpdateRequest struct { + // Canonical runtime-generated task identifier + ID string `json:"id"` + // Owner update sequence to apply + Sequence int64 `json:"sequence"` + // Progress or terminal update payload + Update TaskClientUpdate `json:"update"` +} + +// Result of publishing a client-owned task update. +// Experimental: TasksUpdateResult is part of an experimental API and may change or be +// removed. +type TasksUpdateResult struct { + // Whether this invocation changed task state + Applied bool `json:"applied"` + // Whether this invocation repeated the latest accepted update + Duplicate bool `json:"duplicate"` + // Authoritative task after processing the update + Task TaskClientInfo `json:"task"` +} + // Wait until all in-flight background tasks (agents + shells) and any follow-up turns // scheduled by their completions have settled. Returns when the runtime is fully drained or // after an internal timeout (default 10 minutes; configurable via @@ -16440,6 +16784,18 @@ const ( CatalogUnsafeRetrievalReasonRedirectToBlockedAddress CatalogUnsafeRetrievalReason = "redirect-to-blocked-address" ) +// Why the runtime requests client-task cancellation. +// Experimental: ClientTaskCancelReason is part of an experimental API and may change or be +// removed. +type ClientTaskCancelReason string + +const ( + // A caller requested task cancellation. + ClientTaskCancelReasonCancelRequested ClientTaskCancelReason = "cancel_requested" + // The session is shutting down. + ClientTaskCancelReasonSessionShutdown ClientTaskCancelReason = "session_shutdown" +) + // Whether a pending slash-command invocation effect was applied or cancelled by the host. // Experimental: CommandsInvocationEffectOutcome is part of an experimental API and may // change or be removed. @@ -17816,6 +18172,22 @@ const ( ModelPolicyStateUnconfigured ModelPolicyState = "unconfigured" ) +// Whether the requested preference was already effective or was accepted for later +// transactional activation. +// Experimental: ModelSwitchAutoTierStatus is part of an experimental API and may change or +// be removed. +type ModelSwitchAutoTierStatus string + +const ( + // The request was accepted but has not committed. A later user turn using the `auto` model + // must mint and validate the replacement before it becomes effective. + ModelSwitchAutoTierStatusPending ModelSwitchAutoTierStatus = "pending" + // The requested preference is already effective. No activation is pending for it, although + // this request may have cancelled an earlier unclaimed preference reported in + // `supersededAutoTier`. + ModelSwitchAutoTierStatusUnchanged ModelSwitchAutoTierStatus = "unchanged" +) + // Why the binary data is absent: it exceeded the inline size limit, or its asset was // unavailable // Experimental: OmittedBinaryOmittedReason is part of an experimental API and may change or @@ -18974,6 +19346,89 @@ const ( SubagentSettingsEntryContextTierLongContext SubagentSettingsEntryContextTier = "long_context" ) +// Active status a client owner may publish with a progress update. +// Experimental: TaskClientActiveStatus is part of an experimental API and may change or be +// removed. +type TaskClientActiveStatus string + +const ( + // The external owner is connected but waiting. + TaskClientActiveStatusIdle TaskClientActiveStatus = "idle" + // The external owner is actively working. + TaskClientActiveStatusRunning TaskClientActiveStatus = "running" +) + +// Client-owned tasks always execute outside the runtime in background mode. +// Experimental: TaskClientExecutionMode is part of an experimental API and may change or be +// removed. +type TaskClientExecutionMode string + +const ( + TaskClientExecutionModeBackground TaskClientExecutionMode = "background" +) + +// Connection class owning a client task. +// Experimental: TaskClientOwnerKind is part of an experimental API and may change or be +// removed. +type TaskClientOwnerKind string + +const ( + // A discovered extension connection owns the task. + TaskClientOwnerKindExtension TaskClientOwnerKind = "extension" + // A generic SDK connection owns the task. + TaskClientOwnerKindSDK TaskClientOwnerKind = "sdk" +) + +// Presence of the task's bound join. +// Experimental: TaskClientOwnerPresence is part of an experimental API and may change or be +// removed. +type TaskClientOwnerPresence string + +const ( + // The bound session join is connected. + TaskClientOwnerPresenceConnected TaskClientOwnerPresence = "connected" + // The bound session join is disconnected. + TaskClientOwnerPresenceDisconnected TaskClientOwnerPresence = "disconnected" +) + +// Lifecycle status of a client-owned task. +// Experimental: TaskClientStatus is part of an experimental API and may change or be +// removed. +type TaskClientStatus string + +const ( + // The owner reported or confirmed cancellation. + TaskClientStatusCancelled TaskClientStatus = "cancelled" + // The owner reported successful completion. + TaskClientStatusCompleted TaskClientStatus = "completed" + // The owner reported failure. + TaskClientStatusFailed TaskClientStatus = "failed" + // The external owner is connected but waiting. + TaskClientStatusIdle TaskClientStatus = "idle" + // The bound owner join disappeared; external executor state is unknown. + TaskClientStatusOrphaned TaskClientStatus = "orphaned" + // The external owner is actively working. + TaskClientStatusRunning TaskClientStatus = "running" +) + +// Discriminator for a client-owned task. +// Experimental: TaskClientType is part of an experimental API and may change or be removed. +type TaskClientType string + +const ( + TaskClientTypeClient TaskClientType = "client" +) + +// Kind discriminator for TaskClientUpdate. +type TaskClientUpdateKind string + +const ( + TaskClientUpdateKindCancelled TaskClientUpdateKind = "cancelled" + TaskClientUpdateKindCompleted TaskClientUpdateKind = "completed" + TaskClientUpdateKindFailed TaskClientUpdateKind = "failed" + TaskClientUpdateKindProgress TaskClientUpdateKind = "progress" +) + // Semantic result of evaluating a task completion request // Experimental: TaskCompletionOutcome is part of an experimental API and may change or be // removed. @@ -19005,16 +19460,31 @@ const ( type TaskInfoType string const ( - TaskInfoTypeAgent TaskInfoType = "agent" - TaskInfoTypeShell TaskInfoType = "shell" + TaskInfoTypeAgent TaskInfoType = "agent" + TaskInfoTypeClient TaskInfoType = "client" + TaskInfoTypeShell TaskInfoType = "shell" +) + +// Closed set of public task kinds a connection can negotiate. +// Experimental: TaskKind is part of an experimental API and may change or be removed. +type TaskKind string + +const ( + // Runtime-owned background agent task. + TaskKindAgent TaskKind = "agent" + // Client-owned externally executed task. + TaskKindClient TaskKind = "client" + // Runtime-owned shell task. + TaskKindShell TaskKind = "shell" ) // Type discriminator for TaskProgress. type TaskProgressType string const ( - TaskProgressTypeAgent TaskProgressType = "agent" - TaskProgressTypeShell TaskProgressType = "shell" + TaskProgressTypeAgent TaskProgressType = "agent" + TaskProgressTypeClient TaskProgressType = "client" + TaskProgressTypeShell TaskProgressType = "shell" ) // Whether the shell runs inside a managed PTY session or as an independent background @@ -23874,13 +24344,15 @@ func (a *ModeAPI) Set(ctx context.Context, params *ModeSetRequest) (*ModeSetResu // Experimental: ModelAPI contains experimental APIs that may change or be removed. type ModelAPI sessionAPI -// GetCurrent gets the currently selected model for the session. +// GetCurrent gets the session's authoritative model snapshot, including the committed Auto +// preference and any newer unclaimed Auto preference waiting for a future user turn. // // RPC method: session.model.getCurrent. // -// Returns: The currently selected model, reasoning effort, and context tier for the -// session. The context tier reflects `Session.getContextTier()`, restored from the session -// journal on resume. +// Returns: The session's authoritative model snapshot. Auto preference fields are +// configuration for the virtual `auto` model and do not change the selected model +// identifier. The context tier reflects `Session.getContextTier()`, restored from the +// session journal on resume. func (a *ModelAPI) GetCurrent(ctx context.Context) (*CurrentModel, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request(ctx, "session.model.getCurrent", req) @@ -23951,6 +24423,40 @@ func (a *ModelAPI) SetReasoningEffort(ctx context.Context, params *ModelSetReaso return &result, nil } +// SwitchAutoTier requests an Auto preference change without changing the session's selected +// model. The latest unclaimed request wins; the runtime commits it only after a later +// prompt using the `auto` model mints a usable model and token pair. A `pending` response +// confirms that the request was accepted, not that it committed. Observe eventual success +// through `session.model_change`, failure through the ephemeral +// `session.auto_tier_switch_failed` event, or current unclaimed state through +// `session.model.getCurrent`. +// +// RPC method: session.model.switchAutoTier. +// +// Parameters: An Auto preference request for the session. This updates Auto configuration +// only; it does not change the selected model to `auto`. +// +// Returns: Immediate acknowledgement and Auto preference snapshot after a switch request. +// This result never implies that a pending preference committed. +func (a *ModelAPI) SwitchAutoTier(ctx context.Context, params *ModelSwitchAutoTierRequest) (*ModelSwitchAutoTierResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["autoTier"] = params.AutoTier + if params.Source != nil { + req["source"] = *params.Source + } + } + raw, err := a.client.Request(ctx, "session.model.switchAutoTier", req) + if err != nil { + return nil, err + } + var result ModelSwitchAutoTierResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // SwitchTo switches the session to a model and optional reasoning configuration. // // RPC method: session.model.switchTo. @@ -23962,6 +24468,9 @@ func (a *ModelAPI) SetReasoningEffort(ctx context.Context, params *ModelSetReaso func (a *ModelAPI) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) (*ModelSwitchToResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { + if params.AutoTier != nil { + req["autoTier"] = *params.AutoTier + } if params.CompactionDecision != nil { req["compactionDecision"] = *params.CompactionDecision } @@ -25838,6 +26347,39 @@ func (a *TasksAPI) Refresh(ctx context.Context) (*TasksRefreshResult, error) { return &result, nil } +// Registers a client-owned task, or reclaims an orphaned task belonging to the same +// extension principal. +// +// RPC method: session.tasks.register. +// +// Parameters: Registers or reclaims a client-owned task. +// +// Returns: Result of registering or reclaiming a client-owned task. +func (a *TasksAPI) Register(ctx context.Context, params *TasksRegisterRequest) (*TasksRegisterResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["cancellable"] = params.Cancellable + req["clientTaskId"] = params.ClientTaskID + req["description"] = params.Description + if params.DisplayName != nil { + req["displayName"] = *params.DisplayName + } + if params.ExpectedSequence != nil { + req["expectedSequence"] = *params.ExpectedSequence + } + req["type"] = params.Type + } + raw, err := a.client.Request(ctx, "session.tasks.register", req) + if err != nil { + return nil, err + } + var result TasksRegisterResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Removes a completed or cancelled background task from tracking. // // RPC method: session.tasks.remove. @@ -25923,6 +26465,31 @@ func (a *TasksAPI) StartAgent(ctx context.Context, params *TasksStartAgentReques return &result, nil } +// Update publishes generic progress or a terminal outcome for a client-owned task. +// +// RPC method: session.tasks.update. +// +// Parameters: Updates a client-owned task. +// +// Returns: Result of publishing a client-owned task update. +func (a *TasksAPI) Update(ctx context.Context, params *TasksUpdateRequest) (*TasksUpdateResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["id"] = params.ID + req["sequence"] = params.Sequence + req["update"] = params.Update + } + raw, err := a.client.Request(ctx, "session.tasks.update", req) + if err != nil { + return nil, err + } + var result TasksUpdateResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // WaitForPending waits for all in-flight background tasks and any follow-up turns to settle. // // RPC method: session.tasks.waitForPending. @@ -28510,12 +29077,26 @@ type SessionFSHandler interface { WriteFile(request *SessionFSWriteFileRequest) (*SessionFSError, error) } +// Experimental: TasksHandler contains experimental APIs that may change or be removed. +type TasksHandler interface { + // Cancel asks the client currently bound to a client-owned session task to confirm that its + // external work stopped. + // + // RPC method: tasks.cancel. + // + // Parameters: Runtime-to-owner cancellation request for a client-owned task. + // + // Returns: Whether the client authoritatively confirmed its external work stopped. + Cancel(request *ClientTaskCancelRequest) (*ClientTaskCancelResult, error) +} + // ClientSessionAPIHandlers provides all client session API handler groups for a session. type ClientSessionAPIHandlers struct { Canvas CanvasHandler Factory FactoryHandler ProviderToken ProviderTokenHandler SessionFS SessionFSHandler + Tasks TasksHandler } func clientSessionHandlerError(err error) *jsonrpc2.Error { @@ -28893,6 +29474,25 @@ func RegisterClientSessionAPIHandlers(client *jsonrpc2.Client, getHandlers func( } return raw, nil }) + client.SetRequestHandler("tasks.cancel", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { + var request ClientTaskCancelRequest + if err := json.Unmarshal(params, &request); err != nil { + return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} + } + handlers := getHandlers(request.SessionID) + if handlers == nil || handlers.Tasks == nil { + return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No tasks handler registered for session: %s", request.SessionID)} + } + result, err := handlers.Tasks.Cancel(&request) + if err != nil { + return nil, clientSessionHandlerError(err) + } + raw, err := json.Marshal(result) + if err != nil { + return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("Failed to marshal response: %v", err)} + } + return raw, nil + }) } // Experimental: ExtensionLaunchProviderHandler contains experimental APIs that may change diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go index 9242a889a8..13d190be22 100644 --- a/go/rpc/zrpc_encoding.go +++ b/go/rpc/zrpc_encoding.go @@ -5381,6 +5381,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { AgentContext *string `json:"agentContext,omitempty"` AllowAllMCPServerInstructions *bool `json:"allowAllMcpServerInstructions,omitempty"` AskUserDisabled *bool `json:"askUserDisabled,omitempty"` + AuthClientIDMetadataURL *string `json:"authClientIdMetadataUrl,omitempty"` AuthInfo json.RawMessage `json:"authInfo,omitempty"` AvailableTools []string `json:"availableTools,omitzero"` Capi *CapiSessionOptions `json:"capi,omitempty"` @@ -5457,6 +5458,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { r.AgentContext = raw.AgentContext r.AllowAllMCPServerInstructions = raw.AllowAllMCPServerInstructions r.AskUserDisabled = raw.AskUserDisabled + r.AuthClientIDMetadataURL = raw.AuthClientIDMetadataURL if raw.AuthInfo != nil { value, err := unmarshalAuthInfo(raw.AuthInfo) if err != nil { @@ -5945,6 +5947,103 @@ func (r SlashCommandTextResult) MarshalJSON() ([]byte, error) { }) } +func unmarshalTaskClientUpdate(data []byte) (TaskClientUpdate, error) { + if string(data) == "null" { + return nil, nil + } + type rawUnion struct { + Kind TaskClientUpdateKind `json:"kind"` + } + var raw rawUnion + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + switch raw.Kind { + case TaskClientUpdateKindCancelled: + var d TaskClientUpdateCancelled + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case TaskClientUpdateKindCompleted: + var d TaskClientUpdateCompleted + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case TaskClientUpdateKindFailed: + var d TaskClientUpdateFailed + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case TaskClientUpdateKindProgress: + var d TaskClientUpdateProgress + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + default: + return &RawTaskClientUpdateData{Discriminator: raw.Kind, Raw: data}, nil + } +} + +func (r RawTaskClientUpdateData) MarshalJSON() ([]byte, error) { + if r.Raw != nil { + return r.Raw, nil + } + return json.Marshal(struct { + Kind TaskClientUpdateKind `json:"kind"` + }{ + Kind: r.Discriminator, + }) +} + +func (r TaskClientUpdateCancelled) MarshalJSON() ([]byte, error) { + type alias TaskClientUpdateCancelled + return json.Marshal(struct { + Kind TaskClientUpdateKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + +func (r TaskClientUpdateCompleted) MarshalJSON() ([]byte, error) { + type alias TaskClientUpdateCompleted + return json.Marshal(struct { + Kind TaskClientUpdateKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + +func (r TaskClientUpdateFailed) MarshalJSON() ([]byte, error) { + type alias TaskClientUpdateFailed + return json.Marshal(struct { + Kind TaskClientUpdateKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + +func (r TaskClientUpdateProgress) MarshalJSON() ([]byte, error) { + type alias TaskClientUpdateProgress + return json.Marshal(struct { + Kind TaskClientUpdateKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + func unmarshalTaskInfo(data []byte) (TaskInfo, error) { if string(data) == "null" { return nil, nil @@ -5964,6 +6063,12 @@ func unmarshalTaskInfo(data []byte) (TaskInfo, error) { return nil, err } return &d, nil + case TaskInfoTypeClient: + var d TaskClientInfo + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case TaskInfoTypeShell: var d TaskShellInfo if err := json.Unmarshal(data, &d); err != nil { @@ -5997,6 +6102,17 @@ func (r TaskAgentInfo) MarshalJSON() ([]byte, error) { }) } +func (r TaskClientInfo) MarshalJSON() ([]byte, error) { + type alias TaskClientInfo + return json.Marshal(struct { + Type TaskInfoType `json:"type"` + alias + }{ + Type: r.Type(), + alias: alias(r), + }) +} + func (r TaskShellInfo) MarshalJSON() ([]byte, error) { type alias TaskShellInfo return json.Marshal(struct { @@ -6048,6 +6164,12 @@ func unmarshalTaskProgress(data []byte) (TaskProgress, error) { return nil, err } return &d, nil + case TaskProgressTypeClient: + var d TaskClientProgress + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case TaskProgressTypeShell: var d TaskShellProgress if err := json.Unmarshal(data, &d); err != nil { @@ -6081,6 +6203,17 @@ func (r TaskAgentProgress) MarshalJSON() ([]byte, error) { }) } +func (r TaskClientProgress) MarshalJSON() ([]byte, error) { + type alias TaskClientProgress + return json.Marshal(struct { + Type TaskProgressType `json:"type"` + alias + }{ + Type: r.Type(), + alias: alias(r), + }) +} + func (r TaskShellProgress) MarshalJSON() ([]byte, error) { type alias TaskShellProgress return json.Marshal(struct { @@ -6146,6 +6279,28 @@ func (r *TasksPromoteCurrentToBackgroundResult) UnmarshalJSON(data []byte) error return nil } +func (r *TasksUpdateRequest) UnmarshalJSON(data []byte) error { + type rawTasksUpdateRequest struct { + ID string `json:"id"` + Sequence int64 `json:"sequence"` + Update json.RawMessage `json:"update"` + } + var raw rawTasksUpdateRequest + if err := json.Unmarshal(data, &raw); err != nil { + return err + } + r.ID = raw.ID + r.Sequence = raw.Sequence + if raw.Update != nil { + value, err := unmarshalTaskClientUpdate(raw.Update) + if err != nil { + return err + } + r.Update = value + } + return nil +} + func (r *ToolResultExpanded) UnmarshalJSON(data []byte) error { type rawToolResultExpanded struct { BinaryResultsForLlm []ExternalToolTextResultForLlmBinaryResultsForLlm `json:"binaryResultsForLlm,omitzero"` diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index bbe9fbc74b..a220b79ad5 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -389,6 +389,12 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionAutoTierSwitchFailed: + var d SessionAutoTierSwitchFailedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionBackgroundTasksChanged: var d SessionBackgroundTasksChangedData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -563,6 +569,18 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionMCPServerNeedsReconnect: + var d SessionMCPServerNeedsReconnectData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeSessionMCPServerRemoved: + var d SessionMCPServerRemovedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionMCPServersLoaded: var d SessionMCPServersLoadedData if err := json.Unmarshal(raw.Data, &d); err != nil { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 63709921d8..ccddffb360 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -128,6 +128,7 @@ const ( // that may change or be removed. SessionEventTypeSessionAutoModeResolved SessionEventType = "session.auto_mode_resolved" SessionEventTypeSessionAutopilotObjectiveChanged SessionEventType = "session.autopilot_objective_changed" + SessionEventTypeSessionAutoTierSwitchFailed SessionEventType = "session.auto_tier_switch_failed" SessionEventTypeSessionBackgroundTasksChanged SessionEventType = "session.background_tasks_changed" // Experimental: SessionEventTypeSessionBinaryAsset identifies an experimental event that // may change or be removed. @@ -185,6 +186,8 @@ const ( // Experimental: SessionEventTypeSessionManagedSettingsResolved identifies an experimental // event that may change or be removed. SessionEventTypeSessionManagedSettingsResolved SessionEventType = "session.managed_settings_resolved" + SessionEventTypeSessionMCPServerNeedsReconnect SessionEventType = "session.mcp_server_needs_reconnect" + SessionEventTypeSessionMCPServerRemoved SessionEventType = "session.mcp_server_removed" SessionEventTypeSessionMCPServersLoaded SessionEventType = "session.mcp_servers_loaded" SessionEventTypeSessionMCPServerStatusChanged SessionEventType = "session.mcp_server_status_changed" SessionEventTypeSessionModeChanged SessionEventType = "session.mode_changed" @@ -306,6 +309,21 @@ type PromptCacheBreakData struct { func (*PromptCacheBreakData) sessionEventData() {} func (*PromptCacheBreakData) Type() SessionEventType { return SessionEventTypePromptCacheBreak } +// A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. +type SessionAutoTierSwitchFailedData struct { + // Auto preference that remains effective after the failed request. + EffectiveAutoTier *AutoTier `json:"effectiveAutoTier,omitempty"` + // Low-cardinality failure outcome reported by Auto resolution. + Reason AutoTierSwitchFailureReason `json:"reason"` + // Auto preference that failed to activate, or null when returning to provider-default routing failed. + RequestedAutoTier *AutoTier `json:"requestedAutoTier"` +} + +func (*SessionAutoTierSwitchFailedData) sessionEventData() {} +func (*SessionAutoTierSwitchFailedData) Type() SessionEventType { + return SessionEventTypeSessionAutoTierSwitchFailed +} + // Agent intent description for current activity or plan type AssistantIntentData struct { // Short description of what the agent is currently doing or planning to do @@ -1577,12 +1595,16 @@ func (*ModelCallStartData) Type() SessionEventType { return SessionEventTypeMode // Model change details including previous and new model identifiers type SessionModelChangeData struct { + // Committed Auto preference after the model configuration change, when applicable. + AutoTier *AutoTier `json:"autoTier,omitempty"` // Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. Cause *string `json:"cause,omitempty"` // Context tier after the model change; null explicitly clears a previously selected tier ContextTier *ContextTier `json:"contextTier,omitempty"` // Newly selected model identifier NewModel string `json:"newModel"` + // Previously committed Auto preference, when one was explicitly selected. + PreviousAutoTier *AutoTier `json:"previousAutoTier,omitempty"` // Model that was previously selected, if any PreviousModel *string `json:"previousModel,omitempty"` // Reasoning effort level before the model change, if applicable @@ -1822,6 +1844,28 @@ func (*SessionExtensionsLoadedData) Type() SessionEventType { return SessionEventTypeSessionExtensionsLoaded } +// Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. +type SessionMCPServerNeedsReconnectData struct { + // Name of the MCP server that needs to reconnect + ServerName string `json:"serverName"` +} + +func (*SessionMCPServerNeedsReconnectData) sessionEventData() {} +func (*SessionMCPServerNeedsReconnectData) Type() SessionEventType { + return SessionEventTypeSessionMCPServerNeedsReconnect +} + +// Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. +type SessionMCPServerRemovedData struct { + // Name of the MCP server that was removed from the graph + ServerName string `json:"serverName"` +} + +func (*SessionMCPServerRemovedData) sessionEventData() {} +func (*SessionMCPServerRemovedData) Type() SessionEventType { + return SessionEventTypeSessionMCPServerRemoved +} + // Payload of `session.mcp_server_status_changed` for one MCP server's status and optional failure error. type SessionMCPServerStatusChangedData struct { // Error message if the server entered a failed state @@ -5119,6 +5163,20 @@ const ( AutopilotObjectiveChangedStatusPaused AutopilotObjectiveChangedStatus = "paused" ) +// Terminal reason an Auto preference activation failed. +type AutoTierSwitchFailureReason string + +const ( + // The candidate model was rejected by model policy. + AutoTierSwitchFailureReasonPolicyRejected AutoTierSwitchFailureReason = "policy_rejected" + // The Auto routing request failed or returned an unusable response. + AutoTierSwitchFailureReasonRequestFailed AutoTierSwitchFailureReason = "request_failed" + // The runtime could not prepare the Auto routing request. + AutoTierSwitchFailureReasonSetupFailed AutoTierSwitchFailureReason = "setup_failed" + // The provider does not support Auto routing. + AutoTierSwitchFailureReasonUnsupported AutoTierSwitchFailureReason = "unsupported" +) + // Binary result type discriminator. Use "image" for images and "resource" for other binary data. type BinaryAssetReferenceType string diff --git a/go/zsession_events.go b/go/zsession_events.go index b5f6fa34f0..8ac49affba 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -73,6 +73,7 @@ type ( AutoModeSwitchResponse = rpc.AutoModeSwitchResponse AutopilotObjectiveChangedOperation = rpc.AutopilotObjectiveChangedOperation AutopilotObjectiveChangedStatus = rpc.AutopilotObjectiveChangedStatus + AutoTierSwitchFailureReason = rpc.AutoTierSwitchFailureReason BinaryAssetReference = rpc.BinaryAssetReference BinaryAssetReferenceType = rpc.BinaryAssetReferenceType BinaryAssetType = rpc.BinaryAssetType @@ -263,6 +264,7 @@ type ( ScheduleOrigin = rpc.ScheduleOrigin SessionAutoModeResolvedData = rpc.SessionAutoModeResolvedData SessionAutopilotObjectiveChangedData = rpc.SessionAutopilotObjectiveChangedData + SessionAutoTierSwitchFailedData = rpc.SessionAutoTierSwitchFailedData SessionBackgroundTasksChangedData = rpc.SessionBackgroundTasksChangedData SessionBinaryAssetData = rpc.SessionBinaryAssetData SessionCanvasClosedData = rpc.SessionCanvasClosedData @@ -298,6 +300,8 @@ type ( SessionLimitsExhaustedResponseAction = rpc.SessionLimitsExhaustedResponseAction SessionManagedSettingsEnforcedData = rpc.SessionManagedSettingsEnforcedData SessionManagedSettingsResolvedData = rpc.SessionManagedSettingsResolvedData + SessionMCPServerNeedsReconnectData = rpc.SessionMCPServerNeedsReconnectData + SessionMCPServerRemovedData = rpc.SessionMCPServerRemovedData SessionMCPServersLoadedData = rpc.SessionMCPServersLoadedData SessionMCPServerStatusChangedData = rpc.SessionMCPServerStatusChangedData SessionMode = rpc.SessionMode @@ -487,6 +491,10 @@ const ( AutopilotObjectiveChangedStatusCapReached = rpc.AutopilotObjectiveChangedStatusCapReached AutopilotObjectiveChangedStatusCompleted = rpc.AutopilotObjectiveChangedStatusCompleted AutopilotObjectiveChangedStatusPaused = rpc.AutopilotObjectiveChangedStatusPaused + AutoTierSwitchFailureReasonPolicyRejected = rpc.AutoTierSwitchFailureReasonPolicyRejected + AutoTierSwitchFailureReasonRequestFailed = rpc.AutoTierSwitchFailureReasonRequestFailed + AutoTierSwitchFailureReasonSetupFailed = rpc.AutoTierSwitchFailureReasonSetupFailed + AutoTierSwitchFailureReasonUnsupported = rpc.AutoTierSwitchFailureReasonUnsupported BinaryAssetReferenceTypeImage = rpc.BinaryAssetReferenceTypeImage BinaryAssetReferenceTypeResource = rpc.BinaryAssetReferenceTypeResource BinaryAssetTypeImage = rpc.BinaryAssetTypeImage @@ -750,6 +758,7 @@ const ( SessionEventTypeSandboxDecision = rpc.SessionEventTypeSandboxDecision SessionEventTypeSessionAutoModeResolved = rpc.SessionEventTypeSessionAutoModeResolved SessionEventTypeSessionAutopilotObjectiveChanged = rpc.SessionEventTypeSessionAutopilotObjectiveChanged + SessionEventTypeSessionAutoTierSwitchFailed = rpc.SessionEventTypeSessionAutoTierSwitchFailed SessionEventTypeSessionBackgroundTasksChanged = rpc.SessionEventTypeSessionBackgroundTasksChanged SessionEventTypeSessionBinaryAsset = rpc.SessionEventTypeSessionBinaryAsset SessionEventTypeSessionCanvasClosed = rpc.SessionEventTypeSessionCanvasClosed @@ -779,6 +788,8 @@ const ( SessionEventTypeSessionLimitsExhaustedRequested = rpc.SessionEventTypeSessionLimitsExhaustedRequested SessionEventTypeSessionManagedSettingsEnforced = rpc.SessionEventTypeSessionManagedSettingsEnforced SessionEventTypeSessionManagedSettingsResolved = rpc.SessionEventTypeSessionManagedSettingsResolved + SessionEventTypeSessionMCPServerNeedsReconnect = rpc.SessionEventTypeSessionMCPServerNeedsReconnect + SessionEventTypeSessionMCPServerRemoved = rpc.SessionEventTypeSessionMCPServerRemoved SessionEventTypeSessionMCPServersLoaded = rpc.SessionEventTypeSessionMCPServersLoaded SessionEventTypeSessionMCPServerStatusChanged = rpc.SessionEventTypeSessionMCPServerStatusChanged SessionEventTypeSessionModeChanged = rpc.SessionEventTypeSessionModeChanged diff --git a/java/pom.xml b/java/pom.xml index 285cb7bb9a..bf21d05af4 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -63,7 +63,7 @@ DO NOT EDIT MANUALLY. Updated by the update-copilot-dependency workflow. --> - ^1.0.83-3 + ^1.0.83-4 true diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index 44a6d9fe9d..a394c2717f 100644 --- a/java/scripts/codegen/package-lock.json +++ b/java/scripts/codegen/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "copilot-sdk-java-codegen", "dependencies": { - "@github/copilot": "^1.0.83-3", + "@github/copilot": "^1.0.83-4", "json-schema": "^0.4.0", "tsx": "^4.23.13" } @@ -428,9 +428,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.83-3.tgz", - "integrity": "sha512-4+5wVGC2IvLYog3kdfmY6rg+NIGJesjENVrTONZr6uic6zR+8Ksgy+sCWO86n6AARs09MXktAZNHbbrXz+hl7A==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.83-4.tgz", + "integrity": "sha512-IiUDou0khxU8hu3Xjfq0uwp08qqZwJROizROC+ZMUZaUZGOMD64UXi4N/hauosTEnL/kI/WxzYKw4kO7W6LtpQ==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -439,20 +439,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.83-3", - "@github/copilot-darwin-x64": "1.0.83-3", - "@github/copilot-linux-arm64": "1.0.83-3", - "@github/copilot-linux-x64": "1.0.83-3", - "@github/copilot-linuxmusl-arm64": "1.0.83-3", - "@github/copilot-linuxmusl-x64": "1.0.83-3", - "@github/copilot-win32-arm64": "1.0.83-3", - "@github/copilot-win32-x64": "1.0.83-3" + "@github/copilot-darwin-arm64": "1.0.83-4", + "@github/copilot-darwin-x64": "1.0.83-4", + "@github/copilot-linux-arm64": "1.0.83-4", + "@github/copilot-linux-x64": "1.0.83-4", + "@github/copilot-linuxmusl-arm64": "1.0.83-4", + "@github/copilot-linuxmusl-x64": "1.0.83-4", + "@github/copilot-win32-arm64": "1.0.83-4", + "@github/copilot-win32-x64": "1.0.83-4" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.83-3.tgz", - "integrity": "sha512-pNI71CRL2WR6Wp+Nm+HOsSBcUIOoybcSZtMHqm2zwJGdzAjzv6MU2lLOFFeqhBh8UNQGltD4KtPU/pr+t6t4Uw==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.83-4.tgz", + "integrity": "sha512-rImrvW6dGC16Fu2MLPGNyxb1Nav9n+E5o4hKqyzC1NvK+9kknH8vPTosDEJt4+QEYPCGqyicTjfEoFvQjam6gg==", "cpu": [ "arm64" ], @@ -466,9 +466,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.83-3.tgz", - "integrity": "sha512-9LKUwR7em12mz76s2ytWl/xkHyF13t0TLScAUcnNNj171/Kvg0lWNemwsmPK4m0QbbcmRUs7FyFFF79TmKBAmA==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.83-4.tgz", + "integrity": "sha512-w7ZGwEwDutVLBfkO0WcJaHuNpv/OZxHbtj0cAzGFHYt6NiC7Pk/VQ9X+OAZBlVby/75yCC0Lf2SlIHM7/4Weqw==", "cpu": [ "x64" ], @@ -482,9 +482,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.83-3.tgz", - "integrity": "sha512-ouGA46t6flyUqUdutQL+94bnD+IwcCurR+5KS2JPHozbkeiR2BW4ed0ZZ5KT/6I13mTsjO9uu9LvWwfO5+PjiQ==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.83-4.tgz", + "integrity": "sha512-UksdtQRk+sYVNP+X0VhGDhmmOE1kW9Bmnkj+1zLspwRxuzAZwLY5LXzrZ0/HIw5s6xQKDTWJKGWPlRvipK3mrQ==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.83-3.tgz", - "integrity": "sha512-AiAf2yVrnP+Dw0M8RpacpOoK89sMFizPMuQfFPxAJUWS9hIw5mq4o4invKtUfiz0F7cjxaDJZz1JLUSuGEAQhw==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.83-4.tgz", + "integrity": "sha512-Pxc6f9ear0vt0oMkG1tMxxDKQBsazaUiU7fcWYlfA1qBog0Q+UYoFxAmENNVPREPZ71nwM7P6gW7iO/GdMfYug==", "cpu": [ "x64" ], @@ -513,26 +513,10 @@ "copilot-linux-x64": "copilot" } }, - "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.83-3.tgz", - "integrity": "sha512-TmXPXi65OX/Wfd7JnU8RZjZxzc5kFZU/3Gvr/N1Y+G+cJJyB0NBmWk2PP+yD381ASYOOgeNgWitlYMw8tU7Ddg==", - "cpu": [ - "arm64" - ], - "license": "SEE LICENSE IN LICENSE.md", - "optional": true, - "os": [ - "linux" - ], - "bin": { - "copilot-linuxmusl-arm64": "copilot" - } - }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.83-3.tgz", - "integrity": "sha512-Zlbya4anjkbI8LcbenwuBhxUUeVIrGJqeYh/6JUWwnisOiuuimqQ4zb2UU2pX3vxE03f2PbTcueOo/GkF6AS8A==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.83-4.tgz", + "integrity": "sha512-Gg6amLZ6M2kxVSCghLcFpT+T/mwIJLK/oV5XyHZW0wnsYaoaeTlAUpJJ+K4JwRxyxTeFGxRV7woUmY3iWRU1EQ==", "cpu": [ "x64" ], @@ -546,9 +530,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.83-3.tgz", - "integrity": "sha512-zNmVj3ZDmI3dFmBigfEMzEvMxyjBjL5+nTVxrt9fvTA+29jI0C6A+cdCqrad3fJ1RKgn2RbsZyhnpyViPNhNDw==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.83-4.tgz", + "integrity": "sha512-ZYqGCzJyQlw4DquuIJQAKEud9OpNizOgpTwoLTgf6ej3glqM+ISu8iVIQ9EQFhaI6m9KrXJ4iwCpFjUwv7zWDQ==", "cpu": [ "arm64" ], @@ -561,22 +545,6 @@ "copilot-win32-arm64": "copilot.exe" } }, - "node_modules/@github/copilot-win32-x64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.83-3.tgz", - "integrity": "sha512-pbw739Jdwjr4ovsjwpMI1hguZyOPwTy/fdVnrgBv1nazXxIFrwE3tq0FgzF0NnNcs4r5LXdbIBjKQP+HKFZagA==", - "cpu": [ - "x64" - ], - "license": "SEE LICENSE IN LICENSE.md", - "optional": true, - "os": [ - "win32" - ], - "bin": { - "copilot-win32-x64": "copilot.exe" - } - }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", diff --git a/java/scripts/codegen/package.json b/java/scripts/codegen/package.json index a9f84732a2..4010551edd 100644 --- a/java/scripts/codegen/package.json +++ b/java/scripts/codegen/package.json @@ -7,7 +7,7 @@ "generate:java": "tsx java.ts" }, "dependencies": { - "@github/copilot": "^1.0.83-3", + "@github/copilot": "^1.0.83-4", "json-schema": "^0.4.0", "tsx": "^4.23.13" } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AutoTierSwitchFailureReason.java b/java/sdk/src/generated/java/com/github/copilot/generated/AutoTierSwitchFailureReason.java new file mode 100644 index 0000000000..4180045ace --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AutoTierSwitchFailureReason.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Terminal reason an Auto preference activation failed. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AutoTierSwitchFailureReason { + /** The {@code policy_rejected} variant. */ + POLICY_REJECTED("policy_rejected"), + /** The {@code request_failed} variant. */ + REQUEST_FAILED("request_failed"), + /** The {@code setup_failed} variant. */ + SETUP_FAILED("setup_failed"), + /** The {@code unsupported} variant. */ + UNSUPPORTED("unsupported"); + + private final String value; + AutoTierSwitchFailureReason(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AutoTierSwitchFailureReason fromValue(String value) { + for (AutoTierSwitchFailureReason v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AutoTierSwitchFailureReason value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierSwitchFailedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierSwitchFailedEvent.java new file mode 100644 index 0000000000..7509bb678f --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierSwitchFailedEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.auto_tier_switch_failed". A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionAutoTierSwitchFailedEvent extends SessionEvent { + + @Override + public String getType() { return "session.auto_tier_switch_failed"; } + + @JsonProperty("data") + private SessionAutoTierSwitchFailedEventData data; + + public SessionAutoTierSwitchFailedEventData getData() { return data; } + public void setData(SessionAutoTierSwitchFailedEventData data) { this.data = data; } + + /** Data payload for {@link SessionAutoTierSwitchFailedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionAutoTierSwitchFailedEventData( + /** Auto preference that remains effective after the failed request. */ + @JsonProperty("effectiveAutoTier") AutoTier effectiveAutoTier, + /** Auto preference that failed to activate, or null when returning to provider-default routing failed. */ + @JsonProperty("requestedAutoTier") AutoTier requestedAutoTier, + /** Low-cardinality failure outcome reported by Auto resolution. */ + @JsonProperty("reason") AutoTierSwitchFailureReason reason + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java index 193aa56b8f..367fa120b5 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java @@ -38,6 +38,7 @@ @JsonSubTypes.Type(value = SessionInfoEvent.class, name = "session.info"), @JsonSubTypes.Type(value = SessionWarningEvent.class, name = "session.warning"), @JsonSubTypes.Type(value = SessionModelChangeEvent.class, name = "session.model_change"), + @JsonSubTypes.Type(value = SessionAutoTierSwitchFailedEvent.class, name = "session.auto_tier_switch_failed"), @JsonSubTypes.Type(value = SessionModeChangedEvent.class, name = "session.mode_changed"), @JsonSubTypes.Type(value = SessionModeNoticeDeliveredEvent.class, name = "session.mode_notice_delivered"), @JsonSubTypes.Type(value = SessionSessionLimitsChangedEvent.class, name = "session.session_limits_changed"), @@ -146,6 +147,8 @@ @JsonSubTypes.Type(value = SessionCustomAgentsUpdatedEvent.class, name = "session.custom_agents_updated"), @JsonSubTypes.Type(value = SessionMcpServersLoadedEvent.class, name = "session.mcp_servers_loaded"), @JsonSubTypes.Type(value = SessionMcpServerStatusChangedEvent.class, name = "session.mcp_server_status_changed"), + @JsonSubTypes.Type(value = SessionMcpServerRemovedEvent.class, name = "session.mcp_server_removed"), + @JsonSubTypes.Type(value = SessionMcpServerNeedsReconnectEvent.class, name = "session.mcp_server_needs_reconnect"), @JsonSubTypes.Type(value = McpToolsListChangedEvent.class, name = "mcp.tools.list_changed"), @JsonSubTypes.Type(value = McpResourcesListChangedEvent.class, name = "mcp.resources.list_changed"), @JsonSubTypes.Type(value = McpPromptsListChangedEvent.class, name = "mcp.prompts.list_changed"), @@ -174,6 +177,7 @@ public abstract sealed class SessionEvent permits SessionInfoEvent, SessionWarningEvent, SessionModelChangeEvent, + SessionAutoTierSwitchFailedEvent, SessionModeChangedEvent, SessionModeNoticeDeliveredEvent, SessionSessionLimitsChangedEvent, @@ -282,6 +286,8 @@ public abstract sealed class SessionEvent permits SessionCustomAgentsUpdatedEvent, SessionMcpServersLoadedEvent, SessionMcpServerStatusChangedEvent, + SessionMcpServerRemovedEvent, + SessionMcpServerNeedsReconnectEvent, McpToolsListChangedEvent, McpResourcesListChangedEvent, McpPromptsListChangedEvent, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerNeedsReconnectEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerNeedsReconnectEvent.java new file mode 100644 index 0000000000..9b03a66b94 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerNeedsReconnectEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.mcp_server_needs_reconnect". Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionMcpServerNeedsReconnectEvent extends SessionEvent { + + @Override + public String getType() { return "session.mcp_server_needs_reconnect"; } + + @JsonProperty("data") + private SessionMcpServerNeedsReconnectEventData data; + + public SessionMcpServerNeedsReconnectEventData getData() { return data; } + public void setData(SessionMcpServerNeedsReconnectEventData data) { this.data = data; } + + /** Data payload for {@link SessionMcpServerNeedsReconnectEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionMcpServerNeedsReconnectEventData( + /** Name of the MCP server that needs to reconnect */ + @JsonProperty("serverName") String serverName + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerRemovedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerRemovedEvent.java new file mode 100644 index 0000000000..68b5107118 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerRemovedEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.mcp_server_removed". Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionMcpServerRemovedEvent extends SessionEvent { + + @Override + public String getType() { return "session.mcp_server_removed"; } + + @JsonProperty("data") + private SessionMcpServerRemovedEventData data; + + public SessionMcpServerRemovedEventData getData() { return data; } + public void setData(SessionMcpServerRemovedEventData data) { this.data = data; } + + /** Data payload for {@link SessionMcpServerRemovedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionMcpServerRemovedEventData( + /** Name of the MCP server that was removed from the graph */ + @JsonProperty("serverName") String serverName + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java index 868d78fe0d..4ea1dbd46d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java @@ -55,7 +55,11 @@ public record SessionModelChangeEventData( /** Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. */ @JsonProperty("cause") String cause, /** Origin of the effective model change, when known. */ - @JsonProperty("source") ModelChangeSource source + @JsonProperty("source") ModelChangeSource source, + /** Previously committed Auto preference, when one was explicitly selected. */ + @JsonProperty("previousAutoTier") AutoTier previousAutoTier, + /** Committed Auto preference after the model configuration change, when applicable. */ + @JsonProperty("autoTier") AutoTier autoTier ) { } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java index e77117b2cb..4fd7a91ca2 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record CapiSessionOptions( - /** Routing preference used when the session model is `auto`. The runtime persists the preference across cold resume. When omitted, the default routing behavior is used. Resuming an already-resident session cannot change its preference. */ + /** Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. */ @JsonProperty("autoTier") AutoTier autoTier, /** 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. */ @JsonProperty("enableWebSocketResponses") Boolean enableWebSocketResponses diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientTaskCancelReason.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientTaskCancelReason.java new file mode 100644 index 0000000000..723e7e80b0 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientTaskCancelReason.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Why the runtime requests client-task cancellation. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ClientTaskCancelReason { + /** The {@code cancel_requested} variant. */ + CANCEL_REQUESTED("cancel_requested"), + /** The {@code session_shutdown} variant. */ + SESSION_SHUTDOWN("session_shutdown"); + + private final String value; + ClientTaskCancelReason(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ClientTaskCancelReason fromValue(String value) { + for (ClientTaskCancelReason v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ClientTaskCancelReason value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java index 05f2534970..0975b7bd87 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.github.copilot.CopilotExperimental; +import java.util.List; import javax.annotation.processing.Generated; /** @@ -28,6 +29,8 @@ public record ConnectParams( @JsonProperty("enableGitHubTelemetryForwarding") Boolean enableGitHubTelemetryForwarding, /** Identity of the integrating host. Optional; omit it to keep the default attribution. */ @JsonProperty("clientInfo") ConnectClientInfo clientInfo, + /** Task kinds this connection can decode when observing session tasks. Omit to retain agent and shell compatibility. */ + @JsonProperty("supportedTaskKinds") List supportedTaskKinds, /** Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN */ @JsonProperty("token") String token ) { diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java index 8c12b57a80..41a200ff4b 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.github.copilot.CopilotExperimental; +import java.util.List; import javax.annotation.processing.Generated; /** @@ -29,6 +30,8 @@ public record ConnectResult( /** Server protocol version number */ @JsonProperty("protocolVersion") Long protocolVersion, /** Server package version */ - @JsonProperty("version") String version + @JsonProperty("version") String version, + /** Task kinds the server may return to this connection. */ + @JsonProperty("taskKinds") List taskKinds ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CurrentModel.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CurrentModel.java new file mode 100644 index 0000000000..bf5f9a8b97 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CurrentModel.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CurrentModel( + /** Currently active model identifier */ + @JsonProperty("modelId") String modelId, + /** Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. */ + @JsonProperty("reasoningEffort") String reasoningEffort, + /** Context tier for models that support multiple context-window sizes. */ + @JsonProperty("contextTier") ContextTier contextTier, + /** Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it. */ + @JsonProperty("autoTier") AutoTier autoTier, + /** Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. */ + @JsonProperty("pendingAutoTier") AutoTier pendingAutoTier, + /** Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. */ + @JsonProperty("activatingAutoTier") AutoTier activatingAutoTier +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java index 81a0aa0e21..74258dcfc5 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java @@ -25,6 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record McpConfigRemoveParams( /** Name of the MCP server to remove */ - @JsonProperty("name") String name + @JsonProperty("name") String name, + /** OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. */ + @JsonProperty("authClientIdMetadataUrl") String authClientIdMetadataUrl ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/Model.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/Model.java index a652e8f4f6..3e9f0b6b87 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/Model.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/Model.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; import javax.annotation.processing.Generated; /** @@ -28,6 +29,8 @@ public record Model( @JsonProperty("name") String name, /** Model capabilities and limits */ @JsonProperty("capabilities") ModelCapabilities capabilities, + /** Provider-supplied model metadata. Keys and JSON-compatible values are preserved unchanged. This is factual metadata published by the model provider; it carries no picker or UX semantics. */ + @JsonProperty("metadata") Map metadata, /** Policy state (if applicable) */ @JsonProperty("policy") ModelPolicy policy, /** Billing information */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ModelSwitchAutoTierStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ModelSwitchAutoTierStatus.java new file mode 100644 index 0000000000..e4a1baed5e --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ModelSwitchAutoTierStatus.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Whether the requested preference was already effective or was accepted for later transactional activation. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ModelSwitchAutoTierStatus { + /** The {@code unchanged} variant. */ + UNCHANGED("unchanged"), + /** The {@code pending} variant. */ + PENDING("pending"); + + private final String value; + ModelSwitchAutoTierStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ModelSwitchAutoTierStatus fromValue(String value) { + for (ModelSwitchAutoTierStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ModelSwitchAutoTierStatus value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java index beda6b20a2..dd522f7a34 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java @@ -27,6 +27,16 @@ public record SandboxConfig( @JsonProperty("userPolicy") SandboxConfigUserPolicy userPolicy, /** Whether to auto-add the current working directory to readwritePaths. Default: true. */ @JsonProperty("addCurrentWorkingDirectory") Boolean addCurrentWorkingDirectory, + /** Whether MCP servers the session launches are confined by the sandbox. Only an explicit `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and `enabled` are always read together. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). */ + @JsonProperty("sandboxMcpServers") Boolean sandboxMcpServers, + /** Whether language servers the session launches are confined by the sandbox. Only an explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). */ + @JsonProperty("sandboxLspServers") Boolean sandboxLspServers, + /** Whether the agent may request that an individual command run outside the sandbox, which the host then approves or denies through the usual permission flow. A host capability flag rather than part of the policy: it is stripped from the effective spawn policy and only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this object: omitting it offers no bypass. Default: false (opt-in). */ + @JsonProperty("allowBypass") Boolean allowBypass, + /** Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at the administrator instead of a setting the next managed merge would override, and it is ignored when comparing two configs for change. Only the managed merge may set it; a caller-supplied value is stripped. */ + @JsonProperty("managedMcpRoutingLocked") Boolean managedMcpRoutingLocked, + /** The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`. */ + @JsonProperty("managedLspRoutingLocked") Boolean managedLspRoutingLocked, /** Credential-injection capability flags. */ @JsonProperty("auth") SandboxConfigAuth auth, /** Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out). */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e85b7b987a..e6013c870d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,4 +37,15 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } + /** + * Invokes {@code managedSettings.clearCache}. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture clearCache() { + return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); + } + } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java index 12777c9a1f..b9adc34484 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java @@ -57,6 +57,22 @@ public CompletableFuture switchTo(SessionModelSwitch return caller.invoke("session.model.switchTo", _p, SessionModelSwitchToResult.class); } + /** + * An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture switchAutoTier(SessionModelSwitchAutoTierParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.model.switchAutoTier", _p, SessionModelSwitchAutoTierResult.class); + } + /** * Managed, repository, and CLI model overrides to overlay onto the session at startup. *

diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApplyStartupOverlayResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApplyStartupOverlayResult.java index f29e249c32..53ce443e08 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApplyStartupOverlayResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApplyStartupOverlayResult.java @@ -40,6 +40,8 @@ public record SessionModelApplyStartupOverlayResult( /** User-facing warning produced while applying the model switch. */ @JsonProperty("warning") String warning, /** Deprecation warnings associated with the selected model or options. */ - @JsonProperty("deprecationWarnings") List deprecationWarnings + @JsonProperty("deprecationWarnings") List deprecationWarnings, + /** Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. */ + @JsonProperty("modelState") CurrentModel modelState ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java index 21afab2fa4..23a9788540 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + * The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -29,6 +29,12 @@ public record SessionModelGetCurrentResult( /** Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. */ @JsonProperty("reasoningEffort") String reasoningEffort, /** Context tier for models that support multiple context-window sizes. */ - @JsonProperty("contextTier") ContextTier contextTier + @JsonProperty("contextTier") ContextTier contextTier, + /** Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it. */ + @JsonProperty("autoTier") AutoTier autoTier, + /** Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. */ + @JsonProperty("pendingAutoTier") AutoTier pendingAutoTier, + /** Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. */ + @JsonProperty("activatingAutoTier") AutoTier activatingAutoTier ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java new file mode 100644 index 0000000000..576df55aa1 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelSwitchAutoTierParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. */ + @JsonProperty("autoTier") AutoTier autoTier, + /** Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. */ + @JsonProperty("source") ModelChangeSource source +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierResult.java new file mode 100644 index 0000000000..7e95695492 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierResult.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelSwitchAutoTierResult( + /** Immediate request status. `pending` means accepted but not committed. */ + @JsonProperty("status") ModelSwitchAutoTierStatus status, + /** Auto preference currently committed for the session. */ + @JsonProperty("effectiveAutoTier") AutoTier effectiveAutoTier, + /** Latest unclaimed Auto preference waiting for a future user turn. */ + @JsonProperty("pendingAutoTier") AutoTier pendingAutoTier, + /** Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. */ + @JsonProperty("activatingAutoTier") AutoTier activatingAutoTier, + /** Earlier unclaimed preference replaced by this request. This can be present with either status, including when selecting the effective preference cancels pending work. */ + @JsonProperty("supersededAutoTier") AutoTier supersededAutoTier +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java index d7e36cf3c9..cfd59bcf36 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java @@ -28,6 +28,8 @@ public record SessionModelSwitchToParams( @JsonProperty("sessionId") String sessionId, /** 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. */ @JsonProperty("modelId") String modelId, + /** Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`. */ + @JsonProperty("autoTier") AutoTier autoTier, /** Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. "none" disables reasoning. When omitted, no effort override is applied. */ @JsonProperty("reasoningEffort") String reasoningEffort, /** Reasoning summary mode to request for supported model clients */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java index fb143abc30..47099e42ea 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java @@ -40,6 +40,8 @@ public record SessionModelSwitchToResult( /** User-facing warning produced while applying the model switch. */ @JsonProperty("warning") String warning, /** Deprecation warnings associated with the selected model or options. */ - @JsonProperty("deprecationWarnings") List deprecationWarnings + @JsonProperty("deprecationWarnings") List deprecationWarnings, + /** Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. */ + @JsonProperty("modelState") CurrentModel modelState ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java index 5f4753b1ac..a1c234903e 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java @@ -37,6 +37,8 @@ public record SessionOpenOptions( @JsonProperty("verbosity") Verbosity verbosity, /** Identifier of the client driving the session. */ @JsonProperty("clientName") String clientName, + /** OAuth Client ID Metadata Document URL used by this host for MCP authorization. */ + @JsonProperty("authClientIdMetadataUrl") String authClientIdMetadataUrl, /** Structured client kind used for runtime behavior gates. */ @JsonProperty("clientKind") String clientKind, /** Identifier sent to LSP-style integrations. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java index 68f038eb4b..c6ca1335de 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java @@ -57,6 +57,38 @@ public CompletableFuture list() { return caller.invoke("session.tasks.list", java.util.Map.of("sessionId", this.sessionId), SessionTasksListResult.class); } + /** + * Registers or reclaims a client-owned task. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture register(SessionTasksRegisterParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.tasks.register", _p, SessionTasksRegisterResult.class); + } + + /** + * Updates a client-owned task. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture update(SessionTasksUpdateParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.tasks.update", _p, SessionTasksUpdateResult.class); + } + /** * Identifies the target session. * diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterParams.java new file mode 100644 index 0000000000..0b14af08fd --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterParams.java @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Registers or reclaims a client-owned task. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksRegisterParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Task kind */ + @JsonProperty("type") TaskClientType type, + /** Owner-scoped idempotency key used for registration and reclaim */ + @JsonProperty("clientTaskId") String clientTaskId, + /** Human-readable description of the external work */ + @JsonProperty("description") String description, + /** Optional short display name for the external work */ + @JsonProperty("displayName") String displayName, + /** Whether the owner supports runtime cancellation requests */ + @JsonProperty("cancellable") Boolean cancellable, + /** Expected current sequence for idempotent registration or orphan reclaim */ + @JsonProperty("expectedSequence") Long expectedSequence +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterResult.java new file mode 100644 index 0000000000..f7e25fe885 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterResult.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of registering or reclaiming a client-owned task. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksRegisterResult( + /** Authoritative registered or reclaimed task */ + @JsonProperty("task") TaskClientInfo task, + /** True only when this invocation created a new task */ + @JsonProperty("created") Boolean created, + /** True only when this invocation reclaimed an orphaned task */ + @JsonProperty("reclaimed") Boolean reclaimed +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateParams.java new file mode 100644 index 0000000000..ecd06a1b7e --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateParams.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Updates a client-owned task. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksUpdateParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Canonical runtime-generated task identifier */ + @JsonProperty("id") String id, + /** Owner update sequence to apply */ + @JsonProperty("sequence") Long sequence, + /** Progress or terminal update payload */ + @JsonProperty("update") Object update +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateResult.java new file mode 100644 index 0000000000..8a08e87859 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateResult.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of publishing a client-owned task update. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksUpdateResult( + /** Authoritative task after processing the update */ + @JsonProperty("task") TaskClientInfo task, + /** Whether this invocation changed task state */ + @JsonProperty("applied") Boolean applied, + /** Whether this invocation repeated the latest accepted update */ + @JsonProperty("duplicate") Boolean duplicate +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientExecutionMode.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientExecutionMode.java new file mode 100644 index 0000000000..6c948f86e0 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientExecutionMode.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Client-owned tasks always execute outside the runtime in background mode. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskClientExecutionMode { + /** The {@code background} variant. */ + BACKGROUND("background"); + + private final String value; + TaskClientExecutionMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskClientExecutionMode fromValue(String value) { + for (TaskClientExecutionMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskClientExecutionMode value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientInfo.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientInfo.java new file mode 100644 index 0000000000..6a221303eb --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientInfo.java @@ -0,0 +1,70 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * Tracked client-owned task metadata. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record TaskClientInfo( + /** Task kind */ + @JsonProperty("type") TaskClientType type, + /** Canonical runtime-generated task identifier */ + @JsonProperty("id") String id, + /** Owner-scoped registration and reclaim key */ + @JsonProperty("clientTaskId") String clientTaskId, + /** Optional task display name */ + @JsonProperty("displayName") String displayName, + /** Task description */ + @JsonProperty("description") String description, + /** Client task lifecycle status */ + @JsonProperty("status") TaskClientStatus status, + /** Public attribution and presence for the task owner */ + @JsonProperty("owner") TaskClientOwner owner, + /** ISO 8601 timestamp when the task started */ + @JsonProperty("startedAt") OffsetDateTime startedAt, + /** ISO 8601 timestamp of the latest accepted lifecycle change */ + @JsonProperty("updatedAt") OffsetDateTime updatedAt, + /** ISO 8601 timestamp when the task reached a terminal status */ + @JsonProperty("completedAt") OffsetDateTime completedAt, + /** Accumulated active execution time in milliseconds */ + @JsonProperty("activeTimeMs") Long activeTimeMs, + /** ISO 8601 timestamp when the current active segment started */ + @JsonProperty("activeStartedAt") OffsetDateTime activeStartedAt, + /** ISO 8601 timestamp when the connected owner entered idle status */ + @JsonProperty("idleSince") OffsetDateTime idleSince, + /** ISO 8601 timestamp of the most recent orphan transition */ + @JsonProperty("orphanedAt") OffsetDateTime orphanedAt, + /** ISO 8601 timestamp of the most recent successful reclaim */ + @JsonProperty("reclaimedAt") OffsetDateTime reclaimedAt, + /** Execution mode, which is always background for client-owned tasks */ + @JsonProperty("executionMode") TaskClientExecutionMode executionMode, + /** Whether the currently bound owner can receive a cancellation request */ + @JsonProperty("canCancel") Boolean canCancel, + /** Sequence number of the latest accepted owner update */ + @JsonProperty("sequence") Long sequence, + /** Opaque successful terminal result supplied by the task owner */ + @JsonProperty("result") Object result, + /** Human-readable terminal failure message */ + @JsonProperty("error") String error, + /** Optional owner-supplied terminal failure code */ + @JsonProperty("errorCode") String errorCode, + /** Human-readable reason for terminal cancellation */ + @JsonProperty("cancellationReason") String cancellationReason +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwner.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwner.java new file mode 100644 index 0000000000..e2ce54019b --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwner.java @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * Public owner attribution for a client-owned task. Identifiers are opaque and never authorize requests. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record TaskClientOwner( + /** Opaque session-scoped participant identity */ + @JsonProperty("participantId") String participantId, + /** Opaque identity of the currently or most recently bound session join */ + @JsonProperty("joinId") String joinId, + /** Class of the task owner */ + @JsonProperty("kind") TaskClientOwnerKind kind, + /** Display-only owner name */ + @JsonProperty("displayName") String displayName, + /** Display-only owner source */ + @JsonProperty("source") String source, + /** Whether this task's bound join is currently connected */ + @JsonProperty("presence") TaskClientOwnerPresence presence, + /** ISO 8601 timestamp when the bound join disconnected */ + @JsonProperty("disconnectedAt") OffsetDateTime disconnectedAt +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerKind.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerKind.java new file mode 100644 index 0000000000..92518264a5 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerKind.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Connection class owning a client task. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskClientOwnerKind { + /** The {@code extension} variant. */ + EXTENSION("extension"), + /** The {@code sdk} variant. */ + SDK("sdk"); + + private final String value; + TaskClientOwnerKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskClientOwnerKind fromValue(String value) { + for (TaskClientOwnerKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskClientOwnerKind value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerPresence.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerPresence.java new file mode 100644 index 0000000000..282cc69206 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerPresence.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Presence of the task's bound join. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskClientOwnerPresence { + /** The {@code connected} variant. */ + CONNECTED("connected"), + /** The {@code disconnected} variant. */ + DISCONNECTED("disconnected"); + + private final String value; + TaskClientOwnerPresence(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskClientOwnerPresence fromValue(String value) { + for (TaskClientOwnerPresence v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskClientOwnerPresence value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientStatus.java new file mode 100644 index 0000000000..a72daddc41 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientStatus.java @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Lifecycle status of a client-owned task. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskClientStatus { + /** The {@code running} variant. */ + RUNNING("running"), + /** The {@code idle} variant. */ + IDLE("idle"), + /** The {@code completed} variant. */ + COMPLETED("completed"), + /** The {@code failed} variant. */ + FAILED("failed"), + /** The {@code cancelled} variant. */ + CANCELLED("cancelled"), + /** The {@code orphaned} variant. */ + ORPHANED("orphaned"); + + private final String value; + TaskClientStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskClientStatus fromValue(String value) { + for (TaskClientStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskClientStatus value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientType.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientType.java new file mode 100644 index 0000000000..42f74cf3dd --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientType.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Discriminator for a client-owned task. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskClientType { + /** The {@code client} variant. */ + CLIENT("client"); + + private final String value; + TaskClientType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskClientType fromValue(String value) { + for (TaskClientType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskClientType value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskKind.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskKind.java new file mode 100644 index 0000000000..413859db20 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskKind.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Closed set of public task kinds a connection can negotiate. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskKind { + /** The {@code agent} variant. */ + AGENT("agent"), + /** The {@code shell} variant. */ + SHELL("shell"), + /** The {@code client} variant. */ + CLIENT("client"); + + private final String value; + TaskKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskKind fromValue(String value) { + for (TaskKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskKind value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelParams.java new file mode 100644 index 0000000000..57cbd5e6e0 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelParams.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Runtime-to-owner cancellation request for a client-owned task. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record TasksCancelParams( + /** Session that owns the client task */ + @JsonProperty("sessionId") String sessionId, + /** Canonical runtime-generated task identifier */ + @JsonProperty("id") String id, + /** Owner-scoped task key included for correlation */ + @JsonProperty("clientTaskId") String clientTaskId, + /** Opaque identifier shared by coalesced cancellation callers */ + @JsonProperty("cancellationId") String cancellationId, + /** Reason the runtime requests cancellation */ + @JsonProperty("reason") ClientTaskCancelReason reason +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelResult.java new file mode 100644 index 0000000000..bd549d1df4 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Whether the client authoritatively confirmed its external work stopped. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record TasksCancelResult( + /** True only when the owner confirms that external work stopped before responding */ + @JsonProperty("cancelled") Boolean cancelled +) { +} diff --git a/nodejs/package.json b/nodejs/package.json index c937d83bf7..f64c05897e 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -5,7 +5,7 @@ "url": "https://github.com/github/copilot-sdk.git" }, "version": "0.0.0-dev", - "copilotCliVersion": "1.0.83-3", + "copilotCliVersion": "1.0.83-4", "description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC", "main": "./dist/cjs/index.js", "types": "./dist/index.d.ts", diff --git a/nodejs/src/cliVersion.ts b/nodejs/src/cliVersion.ts index a0c4eb8558..c4ad7b3045 100644 --- a/nodejs/src/cliVersion.ts +++ b/nodejs/src/cliVersion.ts @@ -1,3 +1,3 @@ -export const COPILOT_CLI_VERSION = "1.0.83-3"; +export const COPILOT_CLI_VERSION = "1.0.83-4"; export const COPILOT_CLI_USE_NPM_PACKAGE = false; diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 5f2ff0c62d..322c13731b 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -663,6 +663,18 @@ export type CatalogUnavailableTransportReason = | "transport-not-supported" /** Eligible remotes could not be enumerated, so no explicit choice can be offered. */ | "remote-enumeration-unavailable"; +/** + * Why the runtime requests client-task cancellation. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ClientTaskCancelReason". + */ +/** @experimental */ +export type ClientTaskCancelReason = + /** A caller requested task cancellation. */ + | "cancel_requested" + /** The session is shutting down. */ + | "session_shutdown"; /** * Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command * @@ -745,6 +757,20 @@ export type ConnectedRemoteSessionMetadataKind = | "remote-session" /** GitHub Copilot coding agent session. */ | "coding-agent"; +/** + * Closed set of public task kinds a connection can negotiate. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskKind". + */ +/** @experimental */ +export type TaskKind = + /** Runtime-owned background agent task. */ + | "agent" + /** Runtime-owned shell task. */ + | "shell" + /** Client-owned externally executed task. */ + | "client"; /** * Controls how MCP tool result content is filtered: none leaves content unchanged, markdown sanitizes HTML while preserving Markdown-friendly output, and hidden_characters removes characters that can hide directives. * @@ -2374,6 +2400,18 @@ export type ModelListRequest = */ skipCache?: boolean; }; +/** + * Whether the requested preference was already effective or was accepted for later transactional activation. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelSwitchAutoTierStatus". + */ +/** @experimental */ +export type ModelSwitchAutoTierStatus = + /** The requested preference is already effective. No activation is pending for it, although this request may have cancelled an earlier unclaimed preference reported in `supersededAutoTier`. */ + | "unchanged" + /** The request was accepted but has not committed. A later user turn using the `auto` model must mint and validate the replacement before it becomes effective. */ + | "pending"; /** * Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. * @@ -3560,13 +3598,158 @@ export type TaskExecutionMode = /** The task is managed in the background. */ | "background"; /** - * Tracked task union returned by task APIs, containing either an agent task or a shell task. + * Active status a client owner may publish with a progress update. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientActiveStatus". + */ +/** @experimental */ +export type TaskClientActiveStatus = + /** The external owner is actively working. */ + | "running" + /** The external owner is connected but waiting. */ + | "idle"; +/** + * Client-owned tasks always execute outside the runtime in background mode. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientExecutionMode". + */ +/** @experimental */ +export type TaskClientExecutionMode = "background"; +/** + * Discriminator for a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientType". + */ +/** @experimental */ +export type TaskClientType = "client"; +/** + * Lifecycle status of a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientStatus". + */ +/** @experimental */ +export type TaskClientStatus = + /** The external owner is actively working. */ + | "running" + /** The external owner is connected but waiting. */ + | "idle" + /** The owner reported successful completion. */ + | "completed" + /** The owner reported failure. */ + | "failed" + /** The owner reported or confirmed cancellation. */ + | "cancelled" + /** The bound owner join disappeared; external executor state is unknown. */ + | "orphaned"; +/** + * Connection class owning a client task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientOwnerKind". + */ +/** @experimental */ +export type TaskClientOwnerKind = + /** A discovered extension connection owns the task. */ + | "extension" + /** A generic SDK connection owns the task. */ + | "sdk"; +/** + * Presence of the task's bound join. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientOwnerPresence". + */ +/** @experimental */ +export type TaskClientOwnerPresence = + /** The bound session join is connected. */ + | "connected" + /** The bound session join is disconnected. */ + | "disconnected"; +/** + * Progress or terminal update for a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientUpdate". + */ +/** @experimental */ +export type TaskClientUpdate = + | { + status?: TaskClientActiveStatus; + /** + * Optional progress message appended to recent activity when nonempty + */ + message?: string; + /** + * Optional progress phase; null clears the current phase + */ + phase?: string | null; + /** + * Optional completion percentage; null clears the current percentage + */ + percentage?: number | null; + /** + * Client task update variant discriminator. + */ + kind: "progress"; + } + | { + /** + * Optional final progress message + */ + message?: string; + /** + * Optional opaque successful terminal result + */ + result?: JsonValue; + /** + * Client task update variant discriminator. + */ + kind: "completed"; + } + | { + /** + * Optional final progress message + */ + message?: string; + /** + * Human-readable terminal failure message + */ + error: string; + /** + * Optional owner-supplied terminal failure code + */ + code?: string; + /** + * Client task update variant discriminator. + */ + kind: "failed"; + } + | { + /** + * Optional final progress message + */ + message?: string; + /** + * Optional human-readable cancellation reason + */ + reason?: string; + /** + * Client task update variant discriminator. + */ + kind: "cancelled"; + }; +/** + * Tracked task union returned by task APIs, containing an agent, client, or shell task. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "TaskInfo". */ /** @experimental */ -export type TaskInfo = TaskAgentInfo | TaskShellInfo; +export type TaskInfo = TaskAgentInfo | TaskClientInfo | TaskShellInfo; /** * Whether the shell runs inside a managed PTY session or as an independent background process * @@ -3586,7 +3769,7 @@ export type TaskShellInfoAttachmentMode = * via the `definition` "TaskProgress". */ /** @experimental */ -export type TaskProgress = (TaskAgentProgress | TaskShellProgress) | null; +export type TaskProgress = TaskAgentProgress | TaskClientProgress | TaskShellProgress | null; /** * Canonical result returned by a session tool. * @@ -6047,6 +6230,45 @@ export interface CatalogUnavailableTransportError { */ message: string; } +/** + * Runtime-to-owner cancellation request for a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ClientTaskCancelRequest". + */ +/** @experimental */ +export interface ClientTaskCancelRequest { + /** + * Session that owns the client task + */ + sessionId: string; + /** + * Canonical runtime-generated task identifier + */ + id: string; + /** + * Owner-scoped task key included for correlation + */ + clientTaskId: string; + /** + * Opaque identifier shared by coalesced cancellation callers + */ + cancellationId: string; + reason: ClientTaskCancelReason; +} +/** + * Whether the client authoritatively confirmed its external work stopped. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ClientTaskCancelResult". + */ +/** @experimental */ +export interface ClientTaskCancelResult { + /** + * True only when the owner confirms that external work stopped before responding + */ + cancelled: boolean; +} /** * Slash commands available in the session, after applying any include/exclude filters. * @@ -6489,6 +6711,10 @@ export interface ConnectRequest { */ enableGitHubTelemetryForwarding?: boolean; clientInfo?: ConnectClientInfo; + /** + * Task kinds this connection can decode when observing session tasks. Omit to retain agent and shell compatibility. + */ + supportedTaskKinds?: TaskKind[]; /** * Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN */ @@ -6515,6 +6741,10 @@ export interface ConnectResult { * Server package version */ version: string; + /** + * Task kinds the server may return to this connection. + */ + taskKinds?: TaskKind[]; } /** * Local file system absolute paths within the session working directory to check against its content-exclusion policy. @@ -6589,7 +6819,7 @@ export interface ContextHeaviestMessage { tokens: number; } /** - * The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + * The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "CurrentModel". @@ -6605,6 +6835,15 @@ export interface CurrentModel { */ reasoningEffort?: string; contextTier?: ContextTier; + autoTier?: AutoTier; + /** + * Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. + */ + pendingAutoTier?: AutoTier | null; + /** + * Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + */ + activatingAutoTier?: AutoTier | null; } /** * Lightweight metadata for a currently initialized session tool @@ -10457,6 +10696,10 @@ export interface McpConfigRemoveRequest { * Name of the MCP server to remove */ name: string; + /** + * OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. + */ + authClientIdMetadataUrl?: string; } /** * MCP server name and replacement configuration to write to user configuration. @@ -12223,6 +12466,12 @@ export interface Model { */ name: string; capabilities: ModelCapabilities; + /** + * Provider-supplied model metadata. Keys and JSON-compatible values are preserved unchanged. This is factual metadata published by the model provider; it carries no picker or UX semantics. + */ + metadata?: { + [k: string]: JsonValue | undefined; + }; policy?: ModelPolicy; billing?: ModelBilling; /** @@ -12702,6 +12951,43 @@ export interface ModelsListRequest { */ gitHubToken?: string; } +/** + * An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelSwitchAutoTierRequest". + */ +/** @experimental */ +export interface ModelSwitchAutoTierRequest { + /** + * Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. + */ + autoTier: AutoTier | null; + source?: ModelChangeSource; +} +/** + * Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelSwitchAutoTierResult". + */ +/** @experimental */ +export interface ModelSwitchAutoTierResult { + status: ModelSwitchAutoTierStatus; + effectiveAutoTier?: AutoTier; + /** + * Latest unclaimed Auto preference waiting for a future user turn. + */ + pendingAutoTier?: AutoTier | null; + /** + * Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + */ + activatingAutoTier?: AutoTier | null; + /** + * Earlier unclaimed preference replaced by this request. This can be present with either status, including when selecting the effective preference cancels pending work. + */ + supersededAutoTier?: AutoTier | null; +} /** @experimental */ export interface ModelSwitchConfirmation { @@ -12730,6 +13016,10 @@ export interface ModelSwitchToRequest { * 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. */ modelId: string; + /** + * Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`. + */ + autoTier?: AutoTier | null; /** * Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. "none" disables reasoning. When omitted, no effort override is applied. */ @@ -12802,6 +13092,7 @@ export interface ModelSwitchToResult { * Deprecation warnings associated with the selected model or options. */ deprecationWarnings?: string[]; + modelState?: CurrentModel; } /** * Agent interaction mode to apply to the session. @@ -16582,6 +16873,30 @@ export interface SandboxConfig { * Whether to auto-add the current working directory to readwritePaths. Default: true. */ addCurrentWorkingDirectory?: boolean; + /** + * Whether MCP servers the session launches are confined by the sandbox. Only an explicit `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and `enabled` are always read together. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + */ + sandboxMcpServers?: boolean; + /** + * Whether language servers the session launches are confined by the sandbox. Only an explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + */ + sandboxLspServers?: boolean; + /** + * Whether the agent may request that an individual command run outside the sandbox, which the host then approves or denies through the usual permission flow. A host capability flag rather than part of the policy: it is stripped from the effective spawn policy and only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this object: omitting it offers no bypass. Default: false (opt-in). + */ + allowBypass?: boolean; + /** + * Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at the administrator instead of a setting the next managed merge would override, and it is ignored when comparing two configs for change. Only the managed merge may set it; a caller-supplied value is stripped. + * + * @internal + */ + managedMcpRoutingLocked?: boolean; + /** + * The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`. + * + * @internal + */ + managedLspRoutingLocked?: boolean; auth?: SandboxConfigAuth; /** * Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out). @@ -18291,6 +18606,10 @@ export interface SessionOpenOptions { * Identifier of the client driving the session. */ clientName?: string; + /** + * OAuth Client ID Metadata Document URL used by this host for MCP authorization. + */ + authClientIdMetadataUrl?: string; /** * Structured client kind used for runtime behavior gates. */ @@ -20840,6 +21159,157 @@ export interface TaskProgressLine { */ timestamp: string; } +/** + * Tracked client-owned task metadata. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientInfo". + */ +/** @experimental */ +export interface TaskClientInfo { + type: TaskClientType; + /** + * Canonical runtime-generated task identifier + */ + id: string; + /** + * Owner-scoped registration and reclaim key + */ + clientTaskId: string; + /** + * Optional task display name + */ + displayName?: string; + /** + * Task description + */ + description: string; + status: TaskClientStatus; + owner: TaskClientOwner; + /** + * ISO 8601 timestamp when the task started + */ + startedAt: string; + /** + * ISO 8601 timestamp of the latest accepted lifecycle change + */ + updatedAt: string; + /** + * ISO 8601 timestamp when the task reached a terminal status + */ + completedAt?: string; + /** + * Accumulated active execution time in milliseconds + */ + activeTimeMs: number; + /** + * ISO 8601 timestamp when the current active segment started + */ + activeStartedAt?: string; + /** + * ISO 8601 timestamp when the connected owner entered idle status + */ + idleSince?: string; + /** + * ISO 8601 timestamp of the most recent orphan transition + */ + orphanedAt?: string; + /** + * ISO 8601 timestamp of the most recent successful reclaim + */ + reclaimedAt?: string; + executionMode: TaskClientExecutionMode; + /** + * Whether the currently bound owner can receive a cancellation request + */ + canCancel: boolean; + /** + * Sequence number of the latest accepted owner update + */ + sequence: number; + /** + * Opaque successful terminal result supplied by the task owner + */ + result?: JsonValue; + /** + * Human-readable terminal failure message + */ + error?: string; + /** + * Optional owner-supplied terminal failure code + */ + errorCode?: string; + /** + * Human-readable reason for terminal cancellation + */ + cancellationReason?: string; +} +/** + * Public owner attribution for a client-owned task. Identifiers are opaque and never authorize requests. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientOwner". + */ +/** @experimental */ +export interface TaskClientOwner { + /** + * Opaque session-scoped participant identity + */ + participantId: string; + /** + * Opaque identity of the currently or most recently bound session join + */ + joinId: string; + kind: TaskClientOwnerKind; + /** + * Display-only owner name + */ + displayName?: string; + /** + * Display-only owner source + */ + source?: string; + presence: TaskClientOwnerPresence; + /** + * ISO 8601 timestamp when the bound join disconnected + */ + disconnectedAt?: string; +} +/** + * Generic progress for a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientProgress". + */ +/** @experimental */ +export interface TaskClientProgress { + type: TaskClientType; + status: TaskClientStatus; + /** + * Sequence number of the latest accepted owner update + */ + sequence: number; + /** + * ISO 8601 timestamp of the latest accepted lifecycle change + */ + updatedAt: string; + /** + * Current owner-defined progress phase + */ + phase?: string; + /** + * Current completion percentage from zero through one hundred + */ + percentage?: number; + /** + * Most recent nonempty progress message + */ + lastMessage?: string; + /** + * Recent server-timestamped progress messages + */ + recentActivity: TaskProgressLine[]; +} /** @experimental */ export interface TaskCompletionDecision { @@ -21057,6 +21527,54 @@ export interface TasksPromoteToBackgroundResult { */ /** @experimental */ export interface TasksRefreshResult {} +/** + * Registers or reclaims a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TasksRegisterRequest". + */ +/** @experimental */ +export interface TasksRegisterRequest { + type: TaskClientType; + /** + * Owner-scoped idempotency key used for registration and reclaim + */ + clientTaskId: string; + /** + * Human-readable description of the external work + */ + description: string; + /** + * Optional short display name for the external work + */ + displayName?: string; + /** + * Whether the owner supports runtime cancellation requests + */ + cancellable: boolean; + /** + * Expected current sequence for idempotent registration or orphan reclaim + */ + expectedSequence?: number; +} +/** + * Result of registering or reclaiming a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TasksRegisterResult". + */ +/** @experimental */ +export interface TasksRegisterResult { + task: TaskClientInfo; + /** + * True only when this invocation created a new task + */ + created: boolean; + /** + * True only when this invocation reclaimed an orphaned task + */ + reclaimed: boolean; +} /** * Identifier of the completed or cancelled task to remove from tracking. * @@ -21163,6 +21681,42 @@ export interface TasksStartAgentResult { */ agentId: string; } +/** + * Updates a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TasksUpdateRequest". + */ +/** @experimental */ +export interface TasksUpdateRequest { + /** + * Canonical runtime-generated task identifier + */ + id: string; + /** + * Owner update sequence to apply + */ + sequence: number; + update: TaskClientUpdate; +} +/** + * Result of publishing a client-owned task update. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TasksUpdateResult". + */ +/** @experimental */ +export interface TasksUpdateResult { + task: TaskClientInfo; + /** + * Whether this invocation changed task state + */ + applied: boolean; + /** + * Whether this invocation repeated the latest accepted update + */ + duplicate: boolean; +} /** * Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS). * @@ -24165,9 +24719,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin /** @experimental */ model: { /** - * Gets the currently selected model for the session. + * Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn. * - * @returns The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + * @returns The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. */ getCurrent: async (): Promise => connection.sendRequest("session.model.getCurrent", { sessionId }), @@ -24180,6 +24734,15 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ switchTo: async (params: ModelSwitchToRequest): Promise => connection.sendRequest("session.model.switchTo", { sessionId, ...params }), + /** + * Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`. + * + * @param params An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. + * + * @returns Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. + */ + switchAutoTier: async (params: ModelSwitchAutoTierRequest): Promise => + connection.sendRequest("session.model.switchAutoTier", { sessionId, ...params }), /** * Updates the session's reasoning effort without changing the selected model. * @@ -24519,6 +25082,24 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ list: async (): Promise => connection.sendRequest("session.tasks.list", { sessionId }), + /** + * Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal. + * + * @param params Registers or reclaims a client-owned task. + * + * @returns Result of registering or reclaiming a client-owned task. + */ + register: async (params: TasksRegisterRequest): Promise => + connection.sendRequest("session.tasks.register", { sessionId, ...params }), + /** + * Publishes generic progress or a terminal outcome for a client-owned task. + * + * @param params Updates a client-owned task. + * + * @returns Result of publishing a client-owned task update. + */ + update: async (params: TasksUpdateRequest): Promise => + connection.sendRequest("session.tasks.update", { sessionId, ...params }), /** * Refreshes metadata for any detached background shells the runtime knows about. * @@ -26197,6 +26778,19 @@ export interface FactoryHandler { abort(params: FactoryAbortRequest): Promise; } +/** Handler for `tasks` client session API methods. */ +/** @experimental */ +export interface TasksHandler { + /** + * Asks the client currently bound to a client-owned session task to confirm that its external work stopped. + * + * @param params Runtime-to-owner cancellation request for a client-owned task. + * + * @returns Whether the client authoritatively confirmed its external work stopped. + */ + cancel(params: ClientTaskCancelRequest): Promise; +} + /** Handler for `sessionFs` client session API methods. */ /** @experimental */ export interface SessionFsHandler { @@ -26337,6 +26931,7 @@ export interface CanvasHandler { export interface ClientSessionApiHandlers { providerToken?: ProviderTokenHandler; factory?: FactoryHandler; + tasks?: TasksHandler; sessionFs?: SessionFsHandler; canvas?: CanvasHandler; } @@ -26366,6 +26961,11 @@ export function registerClientSessionApiHandlers( if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`); return handler.abort(params); }); + connection.onRequest("tasks.cancel", async (params: ClientTaskCancelRequest) => { + const handler = getHandlers(params.sessionId).tasks; + if (!handler) throw new Error(`No tasks handler registered for session: ${params.sessionId}`); + return handler.cancel(params); + }); connection.onRequest("sessionFs.readFile", async (params: SessionFsReadFileRequest) => { const handler = getHandlers(params.sessionId).sessionFs; if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 7d734bf491..a61a143111 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -23,6 +23,7 @@ export type SessionEvent = | InfoEvent | WarningEvent | ModelChangeEvent + | AutoTierSwitchFailedEvent | ModeChangedEvent | ModeNoticeDeliveredEvent | SessionLimitsChangedEvent @@ -126,6 +127,8 @@ export type SessionEvent = | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent + | McpServerRemovedEvent + | McpServerNeedsReconnectEvent | McpToolsListChangedEvent | McpResourcesListChangedEvent | McpPromptsListChangedEvent @@ -250,6 +253,18 @@ export type ModelChangeSource = | "automatic" /** An SDK or RPC caller selected the model. */ | "sdk"; +/** + * Terminal reason an Auto preference activation failed. + */ +export type AutoTierSwitchFailureReason = + /** The candidate model was rejected by model policy. */ + | "policy_rejected" + /** The Auto routing request failed or returned an unusable response. */ + | "request_failed" + /** The runtime could not prepare the Auto routing request. */ + | "setup_failed" + /** The provider does not support Auto routing. */ + | "unsupported"; /** * Permission mode for the session. */ @@ -1884,6 +1899,10 @@ export interface ModelChangeEvent { * Model change details including previous and new model identifiers */ export interface ModelChangeData { + /** + * Committed Auto preference after the model configuration change, when applicable. + */ + autoTier?: AutoTier | null; /** * Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. */ @@ -1896,6 +1915,7 @@ export interface ModelChangeData { * Newly selected model identifier */ newModel: string; + previousAutoTier?: AutoTier; /** * Model that was previously selected, if any */ @@ -1914,6 +1934,47 @@ export interface ModelChangeData { source?: ModelChangeSource; verbosity?: Verbosity; } +/** + * Session event "session.auto_tier_switch_failed". A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. + */ +export interface AutoTierSwitchFailedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AutoTierSwitchFailedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.auto_tier_switch_failed". + */ + type: "session.auto_tier_switch_failed"; +} +/** + * A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. + */ +export interface AutoTierSwitchFailedData { + effectiveAutoTier?: AutoTier; + reason: AutoTierSwitchFailureReason; + /** + * Auto preference that failed to activate, or null when returning to provider-default routing failed. + */ + requestedAutoTier: AutoTier | null; +} /** * Session event "session.mode_changed". Agent mode change details including previous and new modes */ @@ -11184,6 +11245,84 @@ export interface McpServerStatusChangedData { serverName: string; status: McpServerStatus; } +/** + * Session event "session.mcp_server_removed". Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. + */ +export interface McpServerRemovedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpServerRemovedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.mcp_server_removed". + */ + type: "session.mcp_server_removed"; +} +/** + * Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. + */ +export interface McpServerRemovedData { + /** + * Name of the MCP server that was removed from the graph + */ + serverName: string; +} +/** + * Session event "session.mcp_server_needs_reconnect". Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. + */ +export interface McpServerNeedsReconnectEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpServerNeedsReconnectData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.mcp_server_needs_reconnect". + */ + type: "session.mcp_server_needs_reconnect"; +} +/** + * Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. + */ +export interface McpServerNeedsReconnectData { + /** + * Name of the MCP server that needs to reconnect + */ + serverName: string; +} /** * Session event "mcp.tools.list_changed". Payload identifying the MCP server associated with a list change. */ diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 90d80591b9..d14fb4f561 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -1052,9 +1052,12 @@ class CapiSessionOptions: """Options scoped to the built-in CAPI (Copilot API) provider.""" auto_tier: AutoTier | None = None - """Routing preference used when the session model is `auto`. The runtime persists the - preference across cold resume. When omitted, the default routing behavior is used. - Resuming an already-resident session cannot change its preference. + """Routing preference for sessions whose model is `auto`. On create or cold resume, this + establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold + resume, the runtime restores the last committed preference. On resident resume, a + different value requests a safe switch after resume succeeds and cannot change an + in-flight turn. Successful switches are persisted for later cold resume. When no + preference is supplied or restored, CAPI default routing is used. """ enable_web_socket_responses: bool | None = None """Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when @@ -1497,6 +1500,34 @@ class CatalogUnsafeRetrievalReason(Enum): class CatalogUnsupportedKindErrorKind(Enum): UNSUPPORTED_KIND = "unsupported-kind" +# Experimental: this type is part of an experimental API and may change or be removed. +class ClientTaskCancelReason(Enum): + """Why the runtime requests client-task cancellation. + + Reason the runtime requests cancellation + """ + CANCEL_REQUESTED = "cancel_requested" + SESSION_SHUTDOWN = "session_shutdown" + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ClientTaskCancelResult: + """Whether the client authoritatively confirmed its external work stopped.""" + + cancelled: bool + """True only when the owner confirms that external work stopped before responding""" + + @staticmethod + def from_dict(obj: Any) -> 'ClientTaskCancelResult': + assert isinstance(obj, dict) + cancelled = from_bool(obj.get("cancelled")) + return ClientTaskCancelResult(cancelled) + + def to_dict(self) -> dict: + result: dict = {} + result["cancelled"] = from_bool(self.cancelled) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SlashCommandInputChoice: @@ -1832,34 +1863,14 @@ def to_dict(self) -> dict: return result # Experimental: this type is part of an experimental API and may change or be removed. -# Internal: this type is an internal SDK API and is not part of the public surface. -@dataclass -class _ConnectResult: - """Handshake result reporting the server's protocol version and package version on success.""" +class TaskKind(Enum): + """Closed set of public task kinds a connection can negotiate. - ok: bool - """Always true on success""" - - protocol_version: int - """Server protocol version number""" - - version: str - """Server package version""" - - @staticmethod - def from_dict(obj: Any) -> '_ConnectResult': - assert isinstance(obj, dict) - ok = from_bool(obj.get("ok")) - protocol_version = from_int(obj.get("protocolVersion")) - version = from_str(obj.get("version")) - return _ConnectResult(ok, protocol_version, version) - - def to_dict(self) -> dict: - result: dict = {} - result["ok"] = from_bool(self.ok) - result["protocolVersion"] = from_int(self.protocol_version) - result["version"] = from_str(self.version) - return result + Discriminator for a client-owned task. + """ + AGENT = "agent" + CLIENT = "client" + SHELL = "shell" # Experimental: this type is part of an experimental API and may change or be removed. class ConnectedRemoteSessionMetadataKind(Enum): @@ -2266,9 +2277,20 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class CurrentModel: - """The currently selected model, reasoning effort, and context tier for the session. The - context tier reflects `Session.getContextTier()`, restored from the session journal on - resume. + """The session's authoritative model snapshot. Auto preference fields are configuration for + the virtual `auto` model and do not change the selected model identifier. The context + tier reflects `Session.getContextTier()`, restored from the session journal on resume. + + Authoritative model and Auto preference state after an immediate switch. For deferred + switches this remains the current state until the queued change drains. + """ + activating_auto_tier: AutoTier | None = None + """Auto preference currently claimed by an in-progress activation. Null means the activation + is returning to provider-default routing. + """ + auto_tier: AutoTier | None = None + """Auto preference currently committed for the session. This can remain available while + another model is selected so a later switch to `auto` can reuse it. """ context_tier: ContextTier | None = None """Context tier for models that support multiple context-window sizes.""" @@ -2276,6 +2298,10 @@ class CurrentModel: model_id: str | None = None """Currently active model identifier""" + pending_auto_tier: AutoTier | None = None + """Latest unclaimed Auto preference waiting for a future user turn. Null means the pending + request is returning to provider-default routing. + """ reasoning_effort: str | None = None """Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the @@ -2285,17 +2311,26 @@ class CurrentModel: @staticmethod def from_dict(obj: Any) -> 'CurrentModel': assert isinstance(obj, dict) + activating_auto_tier = from_union([AutoTier, from_none], obj.get("activatingAutoTier")) + auto_tier = from_union([AutoTier, from_none], obj.get("autoTier")) context_tier = from_union([ContextTier, from_none], obj.get("contextTier")) model_id = from_union([from_str, from_none], obj.get("modelId")) + pending_auto_tier = from_union([AutoTier, from_none], obj.get("pendingAutoTier")) reasoning_effort = from_union([from_str, from_none], obj.get("reasoningEffort")) - return CurrentModel(context_tier, model_id, reasoning_effort) + return CurrentModel(activating_auto_tier, auto_tier, context_tier, model_id, pending_auto_tier, reasoning_effort) def to_dict(self) -> dict: result: dict = {} + if self.activating_auto_tier is not None: + result["activatingAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.activating_auto_tier) + if self.auto_tier is not None: + result["autoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.auto_tier) if self.context_tier is not None: result["contextTier"] = from_union([lambda x: to_enum(ContextTier, x), from_none], self.context_tier) if self.model_id is not None: result["modelId"] = from_union([from_str, from_none], self.model_id) + if self.pending_auto_tier is not None: + result["pendingAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.pending_auto_tier) if self.reasoning_effort is not None: result["reasoningEffort"] = from_union([from_str, from_none], self.reasoning_effort) return result @@ -5071,15 +5106,21 @@ class MCPConfigRemoveRequest: name: str """Name of the MCP server to remove""" + auth_client_id_metadata_url: str | None = None + """OAuth Client ID Metadata Document URL whose persisted credentials should also be removed.""" + @staticmethod def from_dict(obj: Any) -> 'MCPConfigRemoveRequest': assert isinstance(obj, dict) name = from_str(obj.get("name")) - return MCPConfigRemoveRequest(name) + auth_client_id_metadata_url = from_union([from_str, from_none], obj.get("authClientIdMetadataUrl")) + return MCPConfigRemoveRequest(name, auth_client_id_metadata_url) def to_dict(self) -> dict: result: dict = {} result["name"] = from_str(self.name) + if self.auth_client_id_metadata_url is not None: + result["authClientIdMetadataUrl"] = from_union([from_str, from_none], self.auth_client_id_metadata_url) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -6925,6 +6966,45 @@ def to_dict(self) -> dict: result["reasoningEffort"] = from_str(self.reasoning_effort) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ModelSwitchAutoTierRequest: + """An Auto preference request for the session. This updates Auto configuration only; it does + not change the selected model to `auto`. + """ + auto_tier: AutoTier | None = None + """Auto preference to activate when a future user turn using the `auto` model safely mints a + replacement model and token pair. Pass null to return to provider-default Auto routing. + """ + source: ModelChangeSource | None = None + """Origin to record on the effective `session.model_change` event. Defaults to `sdk` when + omitted. + """ + + @staticmethod + def from_dict(obj: Any) -> 'ModelSwitchAutoTierRequest': + assert isinstance(obj, dict) + auto_tier = from_union([AutoTier, from_none], obj.get("autoTier")) + source = from_union([ModelChangeSource, from_none], obj.get("source")) + return ModelSwitchAutoTierRequest(auto_tier, source) + + def to_dict(self) -> dict: + result: dict = {} + result["autoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.auto_tier) + if self.source is not None: + result["source"] = from_union([lambda x: to_enum(ModelChangeSource, x), from_none], self.source) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +class ModelSwitchAutoTierStatus(Enum): + """Immediate request status. `pending` means accepted but not committed. + + Whether the requested preference was already effective or was accepted for later + transactional activation. + """ + PENDING = "pending" + UNCHANGED = "unchanged" + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ModelsListRequest: @@ -13087,8 +13167,12 @@ class SubagentSettingsEntryContextTier(Enum): # Experimental: this type is part of an experimental API and may change or be removed. class TaskExecutionMode(Enum): - """Whether task execution is synchronously awaited or managed in the background""" + """Whether task execution is synchronously awaited or managed in the background + Client-owned tasks always execute outside the runtime in background mode. + + Execution mode, which is always background for client-owned tasks + """ BACKGROUND = "background" SYNC = "sync" @@ -13129,6 +13213,70 @@ def to_dict(self) -> dict: result["timestamp"] = self.timestamp.isoformat() return result +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientActiveStatus(Enum): + """Active status a client owner may publish with a progress update. + + Optional active status transition + """ + IDLE = "idle" + RUNNING = "running" + +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientExecutionMode(Enum): + """Client-owned tasks always execute outside the runtime in background mode. + + Execution mode, which is always background for client-owned tasks + """ + BACKGROUND = "background" + +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientOwnerKind(Enum): + """Class of the task owner + + Connection class owning a client task. + """ + EXTENSION = "extension" + SDK = "sdk" + +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientOwnerPresence(Enum): + """Whether this task's bound join is currently connected + + Presence of the task's bound join. + """ + CONNECTED = "connected" + DISCONNECTED = "disconnected" + +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientStatus(Enum): + """Client task lifecycle status + + Lifecycle status of a client-owned task. + + Current client task lifecycle status + + Current lifecycle status of the task + """ + CANCELLED = "cancelled" + COMPLETED = "completed" + FAILED = "failed" + IDLE = "idle" + ORPHANED = "orphaned" + RUNNING = "running" + +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientType(Enum): + """Discriminator for a client-owned task.""" + + CLIENT = "client" + +class TaskClientUpdateKind(Enum): + CANCELLED = "cancelled" + COMPLETED = "completed" + FAILED = "failed" + PROGRESS = "progress" + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class TaskCompleteData: @@ -13240,10 +13388,6 @@ class TaskShellInfoAttachmentMode(Enum): ATTACHED = "attached" DETACHED = "detached" -class TaskInfoType(Enum): - AGENT = "agent" - SHELL = "shell" - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class TaskList: @@ -15795,6 +15939,45 @@ def to_dict(self) -> dict: result["supportedKinds"] = from_list(lambda x: to_enum(CatalogCandidateKind, x), self.supported_kinds) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ClientTaskCancelRequest: + """Runtime-to-owner cancellation request for a client-owned task.""" + + cancellation_id: str + """Opaque identifier shared by coalesced cancellation callers""" + + client_task_id: str + """Owner-scoped task key included for correlation""" + + id: str + """Canonical runtime-generated task identifier""" + + reason: ClientTaskCancelReason + """Reason the runtime requests cancellation""" + + session_id: str + """Session that owns the client task""" + + @staticmethod + def from_dict(obj: Any) -> 'ClientTaskCancelRequest': + assert isinstance(obj, dict) + cancellation_id = from_str(obj.get("cancellationId")) + client_task_id = from_str(obj.get("clientTaskId")) + id = from_str(obj.get("id")) + reason = ClientTaskCancelReason(obj.get("reason")) + session_id = from_str(obj.get("sessionId")) + return ClientTaskCancelRequest(cancellation_id, client_task_id, id, reason, session_id) + + def to_dict(self) -> dict: + result: dict = {} + result["cancellationId"] = from_str(self.cancellation_id) + result["clientTaskId"] = from_str(self.client_task_id) + result["id"] = from_str(self.id) + result["reason"] = to_enum(ClientTaskCancelReason, self.reason) + result["sessionId"] = from_str(self.session_id) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SlashCommandInput: @@ -15948,6 +16131,10 @@ class _ConnectRequest: using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events. """ + supported_task_kinds: list[TaskKind] | None = None + """Task kinds this connection can decode when observing session tasks. Omit to retain agent + and shell compatibility. + """ token: str | None = None """Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN""" @@ -15956,8 +16143,9 @@ def from_dict(obj: Any) -> '_ConnectRequest': assert isinstance(obj, dict) client_info = from_union([_ConnectClientInfo.from_dict, from_none], obj.get("clientInfo")) enable_git_hub_telemetry_forwarding = from_union([from_bool, from_none], obj.get("enableGitHubTelemetryForwarding")) + supported_task_kinds = from_union([lambda x: from_list(TaskKind, x), from_none], obj.get("supportedTaskKinds")) token = from_union([from_str, from_none], obj.get("token")) - return _ConnectRequest(client_info, enable_git_hub_telemetry_forwarding, token) + return _ConnectRequest(client_info, enable_git_hub_telemetry_forwarding, supported_task_kinds, token) def to_dict(self) -> dict: result: dict = {} @@ -15965,10 +16153,48 @@ def to_dict(self) -> dict: result["clientInfo"] = from_union([lambda x: to_class(_ConnectClientInfo, x), from_none], self.client_info) if self.enable_git_hub_telemetry_forwarding is not None: result["enableGitHubTelemetryForwarding"] = from_union([from_bool, from_none], self.enable_git_hub_telemetry_forwarding) + if self.supported_task_kinds is not None: + result["supportedTaskKinds"] = from_union([lambda x: from_list(lambda x: to_enum(TaskKind, x), x), from_none], self.supported_task_kinds) if self.token is not None: result["token"] = from_union([from_str, from_none], self.token) return result +# Experimental: this type is part of an experimental API and may change or be removed. +# Internal: this type is an internal SDK API and is not part of the public surface. +@dataclass +class _ConnectResult: + """Handshake result reporting the server's protocol version and package version on success.""" + + ok: bool + """Always true on success""" + + protocol_version: int + """Server protocol version number""" + + version: str + """Server package version""" + + task_kinds: list[TaskKind] | None = None + """Task kinds the server may return to this connection.""" + + @staticmethod + def from_dict(obj: Any) -> '_ConnectResult': + assert isinstance(obj, dict) + ok = from_bool(obj.get("ok")) + protocol_version = from_int(obj.get("protocolVersion")) + version = from_str(obj.get("version")) + task_kinds = from_union([lambda x: from_list(TaskKind, x), from_none], obj.get("taskKinds")) + return _ConnectResult(ok, protocol_version, version, task_kinds) + + def to_dict(self) -> dict: + result: dict = {} + result["ok"] = from_bool(self.ok) + result["protocolVersion"] = from_int(self.protocol_version) + result["version"] = from_str(self.version) + if self.task_kinds is not None: + result["taskKinds"] = from_union([lambda x: from_list(lambda x: to_enum(TaskKind, x), x), from_none], self.task_kinds) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ConnectedRemoteSessionMetadata: @@ -19945,6 +20171,10 @@ class ModelSwitchToResult: model_id: str | None = None """Currently active model identifier after the switch""" + model_state: CurrentModel | None = None + """Authoritative model and Auto preference state after an immediate switch. For deferred + switches this remains the current state until the queued change drains. + """ persistence_error: str | None = None """Persistence failure encountered after applying the model switch.""" @@ -19962,10 +20192,11 @@ def from_dict(obj: Any) -> 'ModelSwitchToResult': deprecation_warnings = from_union([lambda x: from_list(from_str, x), from_none], obj.get("deprecationWarnings")) message = from_union([from_str, from_none], obj.get("message")) model_id = from_union([from_str, from_none], obj.get("modelId")) + model_state = from_union([CurrentModel.from_dict, from_none], obj.get("modelState")) persistence_error = from_union([from_str, from_none], obj.get("persistenceError")) status = from_union([from_str, from_none], obj.get("status")) warning = from_union([from_str, from_none], obj.get("warning")) - return ModelSwitchToResult(confirmation, deferred, deprecation_warnings, message, model_id, persistence_error, status, warning) + return ModelSwitchToResult(confirmation, deferred, deprecation_warnings, message, model_id, model_state, persistence_error, status, warning) def to_dict(self) -> dict: result: dict = {} @@ -19979,6 +20210,8 @@ def to_dict(self) -> dict: result["message"] = from_union([from_str, from_none], self.message) if self.model_id is not None: result["modelId"] = from_union([from_str, from_none], self.model_id) + if self.model_state is not None: + result["modelState"] = from_union([lambda x: to_class(CurrentModel, x), from_none], self.model_state) if self.persistence_error is not None: result["persistenceError"] = from_union([from_str, from_none], self.persistence_error) if self.status is not None: @@ -20188,6 +20421,53 @@ def to_dict(self) -> dict: result["vision"] = from_union([lambda x: to_class(ModelCapabilitiesOverrideLimitsVision, x), from_none], self.vision) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ModelSwitchAutoTierResult: + """Immediate acknowledgement and Auto preference snapshot after a switch request. This + result never implies that a pending preference committed. + """ + status: ModelSwitchAutoTierStatus + """Immediate request status. `pending` means accepted but not committed.""" + + activating_auto_tier: AutoTier | None = None + """Auto preference currently claimed by an in-progress activation. Null means the activation + is returning to provider-default routing. + """ + effective_auto_tier: AutoTier | None = None + """Auto preference currently committed for the session.""" + + pending_auto_tier: AutoTier | None = None + """Latest unclaimed Auto preference waiting for a future user turn.""" + + superseded_auto_tier: AutoTier | None = None + """Earlier unclaimed preference replaced by this request. This can be present with either + status, including when selecting the effective preference cancels pending work. + """ + + @staticmethod + def from_dict(obj: Any) -> 'ModelSwitchAutoTierResult': + assert isinstance(obj, dict) + status = ModelSwitchAutoTierStatus(obj.get("status")) + activating_auto_tier = from_union([AutoTier, from_none], obj.get("activatingAutoTier")) + effective_auto_tier = from_union([AutoTier, from_none], obj.get("effectiveAutoTier")) + pending_auto_tier = from_union([AutoTier, from_none], obj.get("pendingAutoTier")) + superseded_auto_tier = from_union([AutoTier, from_none], obj.get("supersededAutoTier")) + return ModelSwitchAutoTierResult(status, activating_auto_tier, effective_auto_tier, pending_auto_tier, superseded_auto_tier) + + def to_dict(self) -> dict: + result: dict = {} + result["status"] = to_enum(ModelSwitchAutoTierStatus, self.status) + if self.activating_auto_tier is not None: + result["activatingAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.activating_auto_tier) + if self.effective_auto_tier is not None: + result["effectiveAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.effective_auto_tier) + if self.pending_auto_tier is not None: + result["pendingAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.pending_auto_tier) + if self.superseded_auto_tier is not None: + result["supersededAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.superseded_auto_tier) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class NamedProviderConfig: @@ -24218,23 +24498,100 @@ def to_dict(self) -> dict: result["latestIntent"] = from_union([from_str, from_none], self.latest_intent) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TaskClientOwner: + """Public attribution and presence for the task owner + + Public owner attribution for a client-owned task. Identifiers are opaque and never + authorize requests. + """ + join_id: str + """Opaque identity of the currently or most recently bound session join""" + + kind: TaskClientOwnerKind + """Class of the task owner""" + + participant_id: str + """Opaque session-scoped participant identity""" + + presence: TaskClientOwnerPresence + """Whether this task's bound join is currently connected""" + + disconnected_at: datetime | None = None + """ISO 8601 timestamp when the bound join disconnected""" + + display_name: str | None = None + """Display-only owner name""" + + source: str | None = None + """Display-only owner source""" + + @staticmethod + def from_dict(obj: Any) -> 'TaskClientOwner': + assert isinstance(obj, dict) + join_id = from_str(obj.get("joinId")) + kind = TaskClientOwnerKind(obj.get("kind")) + participant_id = from_str(obj.get("participantId")) + presence = TaskClientOwnerPresence(obj.get("presence")) + disconnected_at = from_union([from_datetime, from_none], obj.get("disconnectedAt")) + display_name = from_union([from_str, from_none], obj.get("displayName")) + source = from_union([from_str, from_none], obj.get("source")) + return TaskClientOwner(join_id, kind, participant_id, presence, disconnected_at, display_name, source) + + def to_dict(self) -> dict: + result: dict = {} + result["joinId"] = from_str(self.join_id) + result["kind"] = to_enum(TaskClientOwnerKind, self.kind) + result["participantId"] = from_str(self.participant_id) + result["presence"] = to_enum(TaskClientOwnerPresence, self.presence) + if self.disconnected_at is not None: + result["disconnectedAt"] = from_union([lambda x: x.isoformat(), from_none], self.disconnected_at) + if self.display_name is not None: + result["displayName"] = from_union([from_str, from_none], self.display_name) + if self.source is not None: + result["source"] = from_union([from_str, from_none], self.source) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class TaskProgress: """Progress snapshot for an agent task, with recent activity lines and optional latest intent. + Generic progress for a client-owned task. + Progress snapshot for a shell task, with recent stdout/stderr output and optional process ID. """ - type: TaskInfoType + type: TaskKind """Progress kind""" latest_intent: str | None = None """The most recent intent reported by the agent""" recent_activity: list[TaskProgressLine] | None = None - """Recent tool execution events converted to display lines""" + """Recent tool execution events converted to display lines + + Recent server-timestamped progress messages + """ + last_message: str | None = None + """Most recent nonempty progress message""" + + percentage: float | None = None + """Current completion percentage from zero through one hundred""" + + phase: str | None = None + """Current owner-defined progress phase""" + + sequence: int | None = None + """Sequence number of the latest accepted owner update""" + + status: TaskClientStatus | None = None + """Current client task lifecycle status""" + + updated_at: datetime | None = None + """ISO 8601 timestamp of the latest accepted lifecycle change""" pid: int | None = None """Process ID when available""" @@ -24245,26 +24602,226 @@ class TaskProgress: @staticmethod def from_dict(obj: Any) -> 'TaskProgress': assert isinstance(obj, dict) - type = TaskInfoType(obj.get("type")) + type = TaskKind(obj.get("type")) latest_intent = from_union([from_str, from_none], obj.get("latestIntent")) recent_activity = from_union([lambda x: from_list(TaskProgressLine.from_dict, x), from_none], obj.get("recentActivity")) + last_message = from_union([from_str, from_none], obj.get("lastMessage")) + percentage = from_union([from_float, from_none], obj.get("percentage")) + phase = from_union([from_str, from_none], obj.get("phase")) + sequence = from_union([from_int, from_none], obj.get("sequence")) + status = from_union([TaskClientStatus, from_none], obj.get("status")) + updated_at = from_union([from_datetime, from_none], obj.get("updatedAt")) pid = from_union([from_int, from_none], obj.get("pid")) recent_output = from_union([from_str, from_none], obj.get("recentOutput")) - return TaskProgress(type, latest_intent, recent_activity, pid, recent_output) + return TaskProgress(type, latest_intent, recent_activity, last_message, percentage, phase, sequence, status, updated_at, pid, recent_output) def to_dict(self) -> dict: result: dict = {} - result["type"] = to_enum(TaskInfoType, self.type) + result["type"] = to_enum(TaskKind, self.type) if self.latest_intent is not None: result["latestIntent"] = from_union([from_str, from_none], self.latest_intent) if self.recent_activity is not None: result["recentActivity"] = from_union([lambda x: from_list(lambda x: to_class(TaskProgressLine, x), x), from_none], self.recent_activity) + if self.last_message is not None: + result["lastMessage"] = from_union([from_str, from_none], self.last_message) + if self.percentage is not None: + result["percentage"] = from_union([to_float, from_none], self.percentage) + if self.phase is not None: + result["phase"] = from_union([from_str, from_none], self.phase) + if self.sequence is not None: + result["sequence"] = from_union([from_int, from_none], self.sequence) + if self.status is not None: + result["status"] = from_union([lambda x: to_enum(TaskClientStatus, x), from_none], self.status) + if self.updated_at is not None: + result["updatedAt"] = from_union([lambda x: x.isoformat(), from_none], self.updated_at) if self.pid is not None: result["pid"] = from_union([from_int, from_none], self.pid) if self.recent_output is not None: result["recentOutput"] = from_union([from_str, from_none], self.recent_output) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TaskClientProgress: + """Generic progress for a client-owned task.""" + + recent_activity: list[TaskProgressLine] + """Recent server-timestamped progress messages""" + + sequence: int + """Sequence number of the latest accepted owner update""" + + status: TaskClientStatus + """Current client task lifecycle status""" + + type: TaskClientType + """Progress kind""" + + updated_at: datetime + """ISO 8601 timestamp of the latest accepted lifecycle change""" + + last_message: str | None = None + """Most recent nonempty progress message""" + + percentage: float | None = None + """Current completion percentage from zero through one hundred""" + + phase: str | None = None + """Current owner-defined progress phase""" + + @staticmethod + def from_dict(obj: Any) -> 'TaskClientProgress': + assert isinstance(obj, dict) + recent_activity = from_list(TaskProgressLine.from_dict, obj.get("recentActivity")) + sequence = from_int(obj.get("sequence")) + status = TaskClientStatus(obj.get("status")) + type = TaskClientType(obj.get("type")) + updated_at = from_datetime(obj.get("updatedAt")) + last_message = from_union([from_str, from_none], obj.get("lastMessage")) + percentage = from_union([from_float, from_none], obj.get("percentage")) + phase = from_union([from_str, from_none], obj.get("phase")) + return TaskClientProgress(recent_activity, sequence, status, type, updated_at, last_message, percentage, phase) + + def to_dict(self) -> dict: + result: dict = {} + result["recentActivity"] = from_list(lambda x: to_class(TaskProgressLine, x), self.recent_activity) + result["sequence"] = from_int(self.sequence) + result["status"] = to_enum(TaskClientStatus, self.status) + result["type"] = to_enum(TaskClientType, self.type) + result["updatedAt"] = self.updated_at.isoformat() + if self.last_message is not None: + result["lastMessage"] = from_union([from_str, from_none], self.last_message) + if self.percentage is not None: + result["percentage"] = from_union([to_float, from_none], self.percentage) + if self.phase is not None: + result["phase"] = from_union([from_str, from_none], self.phase) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TasksRegisterRequest: + """Registers or reclaims a client-owned task.""" + + cancellable: bool + """Whether the owner supports runtime cancellation requests""" + + client_task_id: str + """Owner-scoped idempotency key used for registration and reclaim""" + + description: str + """Human-readable description of the external work""" + + type: TaskClientType + """Task kind""" + + display_name: str | None = None + """Optional short display name for the external work""" + + expected_sequence: int | None = None + """Expected current sequence for idempotent registration or orphan reclaim""" + + @staticmethod + def from_dict(obj: Any) -> 'TasksRegisterRequest': + assert isinstance(obj, dict) + cancellable = from_bool(obj.get("cancellable")) + client_task_id = from_str(obj.get("clientTaskId")) + description = from_str(obj.get("description")) + type = TaskClientType(obj.get("type")) + display_name = from_union([from_str, from_none], obj.get("displayName")) + expected_sequence = from_union([from_int, from_none], obj.get("expectedSequence")) + return TasksRegisterRequest(cancellable, client_task_id, description, type, display_name, expected_sequence) + + def to_dict(self) -> dict: + result: dict = {} + result["cancellable"] = from_bool(self.cancellable) + result["clientTaskId"] = from_str(self.client_task_id) + result["description"] = from_str(self.description) + result["type"] = to_enum(TaskClientType, self.type) + if self.display_name is not None: + result["displayName"] = from_union([from_str, from_none], self.display_name) + if self.expected_sequence is not None: + result["expectedSequence"] = from_union([from_int, from_none], self.expected_sequence) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TaskClientUpdate: + """Progress or terminal update for a client-owned task. + + Progress or terminal update payload + + Publishes nonterminal progress for a running or idle client task. + + Reports successful terminal completion. + + Reports terminal failure. + + Reports terminal cancellation after external work stopped. + """ + kind: TaskClientUpdateKind + """Client task update variant discriminator.""" + + message: str | None = None + """Optional progress message appended to recent activity when nonempty + + Optional final progress message + """ + percentage: float | None = None + """Optional completion percentage; null clears the current percentage""" + + phase: str | None = None + """Optional progress phase; null clears the current phase""" + + status: TaskClientActiveStatus | None = None + """Optional active status transition""" + + result: Any = None + """Optional opaque successful terminal result""" + + code: str | None = None + """Optional owner-supplied terminal failure code""" + + error: str | None = None + """Human-readable terminal failure message""" + + reason: str | None = None + """Optional human-readable cancellation reason""" + + @staticmethod + def from_dict(obj: Any) -> 'TaskClientUpdate': + assert isinstance(obj, dict) + kind = TaskClientUpdateKind(obj.get("kind")) + message = from_union([from_str, from_none], obj.get("message")) + percentage = from_union([from_float, from_none], obj.get("percentage")) + phase = from_union([from_none, from_str], obj.get("phase")) + status = from_union([TaskClientActiveStatus, from_none], obj.get("status")) + result = obj.get("result") + code = from_union([from_str, from_none], obj.get("code")) + error = from_union([from_str, from_none], obj.get("error")) + reason = from_union([from_str, from_none], obj.get("reason")) + return TaskClientUpdate(kind, message, percentage, phase, status, result, code, error, reason) + + def to_dict(self) -> dict: + result: dict = {} + result["kind"] = to_enum(TaskClientUpdateKind, self.kind) + if self.message is not None: + result["message"] = from_union([from_str, from_none], self.message) + if self.percentage is not None: + result["percentage"] = from_union([to_float, from_none], self.percentage) + if self.phase is not None: + result["phase"] = from_union([from_none, from_str], self.phase) + if self.status is not None: + result["status"] = from_union([lambda x: to_enum(TaskClientActiveStatus, x), from_none], self.status) + if self.result is not None: + result["result"] = self.result + if self.code is not None: + result["code"] = from_union([from_str, from_none], self.code) + if self.error is not None: + result["error"] = from_union([from_str, from_none], self.error) + if self.reason is not None: + result["reason"] = from_union([from_str, from_none], self.reason) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class TaskShellInfo: @@ -28541,6 +29098,143 @@ def to_dict(self) -> dict: result["paths"] = from_list(lambda x: to_class(SkillDiscoveryPath, x), self.paths) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TaskClientInfo: + """Tracked client-owned task metadata. + + Authoritative registered or reclaimed task + + Authoritative task after processing the update + """ + active_time_ms: int + """Accumulated active execution time in milliseconds""" + + can_cancel: bool + """Whether the currently bound owner can receive a cancellation request""" + + client_task_id: str + """Owner-scoped registration and reclaim key""" + + description: str + """Task description""" + + execution_mode: TaskClientExecutionMode + """Execution mode, which is always background for client-owned tasks""" + + id: str + """Canonical runtime-generated task identifier""" + + owner: TaskClientOwner + """Public attribution and presence for the task owner""" + + sequence: int + """Sequence number of the latest accepted owner update""" + + started_at: datetime + """ISO 8601 timestamp when the task started""" + + status: TaskClientStatus + """Client task lifecycle status""" + + type: ClassVar[str] = "client" + """Task kind""" + + updated_at: datetime + """ISO 8601 timestamp of the latest accepted lifecycle change""" + + active_started_at: datetime | None = None + """ISO 8601 timestamp when the current active segment started""" + + cancellation_reason: str | None = None + """Human-readable reason for terminal cancellation""" + + completed_at: datetime | None = None + """ISO 8601 timestamp when the task reached a terminal status""" + + display_name: str | None = None + """Optional task display name""" + + error: str | None = None + """Human-readable terminal failure message""" + + error_code: str | None = None + """Optional owner-supplied terminal failure code""" + + idle_since: datetime | None = None + """ISO 8601 timestamp when the connected owner entered idle status""" + + orphaned_at: datetime | None = None + """ISO 8601 timestamp of the most recent orphan transition""" + + reclaimed_at: datetime | None = None + """ISO 8601 timestamp of the most recent successful reclaim""" + + result: Any = None + """Opaque successful terminal result supplied by the task owner""" + + @staticmethod + def from_dict(obj: Any) -> 'TaskClientInfo': + assert isinstance(obj, dict) + active_time_ms = from_int(obj.get("activeTimeMs")) + can_cancel = from_bool(obj.get("canCancel")) + client_task_id = from_str(obj.get("clientTaskId")) + description = from_str(obj.get("description")) + execution_mode = TaskClientExecutionMode(obj.get("executionMode")) + id = from_str(obj.get("id")) + owner = TaskClientOwner.from_dict(obj.get("owner")) + sequence = from_int(obj.get("sequence")) + started_at = from_datetime(obj.get("startedAt")) + status = TaskClientStatus(obj.get("status")) + updated_at = from_datetime(obj.get("updatedAt")) + active_started_at = from_union([from_datetime, from_none], obj.get("activeStartedAt")) + cancellation_reason = from_union([from_str, from_none], obj.get("cancellationReason")) + completed_at = from_union([from_datetime, from_none], obj.get("completedAt")) + display_name = from_union([from_str, from_none], obj.get("displayName")) + error = from_union([from_str, from_none], obj.get("error")) + error_code = from_union([from_str, from_none], obj.get("errorCode")) + idle_since = from_union([from_datetime, from_none], obj.get("idleSince")) + orphaned_at = from_union([from_datetime, from_none], obj.get("orphanedAt")) + reclaimed_at = from_union([from_datetime, from_none], obj.get("reclaimedAt")) + result = obj.get("result") + return TaskClientInfo(active_time_ms, can_cancel, client_task_id, description, execution_mode, id, owner, sequence, started_at, status, updated_at, active_started_at, cancellation_reason, completed_at, display_name, error, error_code, idle_since, orphaned_at, reclaimed_at, result) + + def to_dict(self) -> dict: + result: dict = {} + result["activeTimeMs"] = from_int(self.active_time_ms) + result["canCancel"] = from_bool(self.can_cancel) + result["clientTaskId"] = from_str(self.client_task_id) + result["description"] = from_str(self.description) + result["executionMode"] = to_enum(TaskClientExecutionMode, self.execution_mode) + result["id"] = from_str(self.id) + result["owner"] = to_class(TaskClientOwner, self.owner) + result["sequence"] = from_int(self.sequence) + result["startedAt"] = self.started_at.isoformat() + result["status"] = to_enum(TaskClientStatus, self.status) + result["type"] = self.type + result["updatedAt"] = self.updated_at.isoformat() + if self.active_started_at is not None: + result["activeStartedAt"] = from_union([lambda x: x.isoformat(), from_none], self.active_started_at) + if self.cancellation_reason is not None: + result["cancellationReason"] = from_union([from_str, from_none], self.cancellation_reason) + if self.completed_at is not None: + result["completedAt"] = from_union([lambda x: x.isoformat(), from_none], self.completed_at) + if self.display_name is not None: + result["displayName"] = from_union([from_str, from_none], self.display_name) + if self.error is not None: + result["error"] = from_union([from_str, from_none], self.error) + if self.error_code is not None: + result["errorCode"] = from_union([from_str, from_none], self.error_code) + if self.idle_since is not None: + result["idleSince"] = from_union([lambda x: x.isoformat(), from_none], self.idle_since) + if self.orphaned_at is not None: + result["orphanedAt"] = from_union([lambda x: x.isoformat(), from_none], self.orphaned_at) + if self.reclaimed_at is not None: + result["reclaimedAt"] = from_union([lambda x: x.isoformat(), from_none], self.reclaimed_at) + if self.result is not None: + result["result"] = self.result + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class TasksGetProgressResult: @@ -28563,6 +29257,35 @@ def to_dict(self) -> dict: result["progress"] = from_union([lambda x: to_class(TaskProgress, x), from_none], self.progress) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TasksUpdateRequest: + """Updates a client-owned task.""" + + id: str + """Canonical runtime-generated task identifier""" + + sequence: int + """Owner update sequence to apply""" + + update: TaskClientUpdate + """Progress or terminal update payload""" + + @staticmethod + def from_dict(obj: Any) -> 'TasksUpdateRequest': + assert isinstance(obj, dict) + id = from_str(obj.get("id")) + sequence = from_int(obj.get("sequence")) + update = TaskClientUpdate.from_dict(obj.get("update")) + return TasksUpdateRequest(id, sequence, update) + + def to_dict(self) -> dict: + result: dict = {} + result["id"] = from_str(self.id) + result["sequence"] = from_int(self.sequence) + result["update"] = to_class(TaskClientUpdate, self.update) + return result + # Experimental: this type is part of an experimental API and may change or be removed. # Internal: this type is an internal SDK API and is not part of the public surface. @dataclass @@ -30767,6 +31490,13 @@ class SandboxConfig: add_current_working_directory: bool | None = None """Whether to auto-add the current working directory to readwritePaths. Default: true.""" + allow_bypass: bool | None = None + """Whether the agent may request that an individual command run outside the sandbox, which + the host then approves or denies through the usual permission flow. A host capability + flag rather than part of the policy: it is stripped from the effective spawn policy and + only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this + object: omitting it offers no bypass. Default: false (opt-in). + """ allow_dev_tool_access: bool | None = None """Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common @@ -30783,6 +31513,29 @@ class SandboxConfig: auth: SandboxConfigAuth | None = None """Credential-injection capability flags.""" + # Internal: this field is an internal SDK API and is not part of the public surface. + managed_lsp_routing_locked: bool | None = None + """The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`.""" + + # Internal: this field is an internal SDK API and is not part of the public surface. + managed_mcp_routing_locked: bool | None = None + """Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local + opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at + the administrator instead of a setting the next managed merge would override, and it is + ignored when comparing two configs for change. Only the managed merge may set it; a + caller-supplied value is stripped. + """ + sandbox_lsp_servers: bool | None = None + """Whether language servers the session launches are confined by the sandbox. Only an + explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by + default; set to false to opt out). + """ + sandbox_mcp_servers: bool | None = None + """Whether MCP servers the session launches are confined by the sandbox. Only an explicit + `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and + `enabled` are always read together. Ignored while `enabled` is false. Default: true + (enabled by default; set to false to opt out). + """ user_policy: SandboxConfigUserPolicy | None = None """User-managed sandbox policy fragment merged into the auto-discovered base policy.""" @@ -30791,20 +31544,35 @@ def from_dict(obj: Any) -> 'SandboxConfig': assert isinstance(obj, dict) enabled = from_bool(obj.get("enabled")) add_current_working_directory = from_union([from_bool, from_none], obj.get("addCurrentWorkingDirectory")) + allow_bypass = from_union([from_bool, from_none], obj.get("allowBypass")) allow_dev_tool_access = from_union([from_bool, from_none], obj.get("allowDevToolAccess")) auth = from_union([SandboxConfigAuth.from_dict, from_none], obj.get("auth")) + managed_lsp_routing_locked = from_union([from_bool, from_none], obj.get("managedLspRoutingLocked")) + managed_mcp_routing_locked = from_union([from_bool, from_none], obj.get("managedMcpRoutingLocked")) + sandbox_lsp_servers = from_union([from_bool, from_none], obj.get("sandboxLspServers")) + sandbox_mcp_servers = from_union([from_bool, from_none], obj.get("sandboxMcpServers")) user_policy = from_union([SandboxConfigUserPolicy.from_dict, from_none], obj.get("userPolicy")) - return SandboxConfig(enabled, add_current_working_directory, allow_dev_tool_access, auth, user_policy) + return SandboxConfig(enabled, add_current_working_directory, allow_bypass, allow_dev_tool_access, auth, managed_lsp_routing_locked, managed_mcp_routing_locked, sandbox_lsp_servers, sandbox_mcp_servers, user_policy) def to_dict(self) -> dict: result: dict = {} result["enabled"] = from_bool(self.enabled) if self.add_current_working_directory is not None: result["addCurrentWorkingDirectory"] = from_union([from_bool, from_none], self.add_current_working_directory) + if self.allow_bypass is not None: + result["allowBypass"] = from_union([from_bool, from_none], self.allow_bypass) if self.allow_dev_tool_access is not None: result["allowDevToolAccess"] = from_union([from_bool, from_none], self.allow_dev_tool_access) if self.auth is not None: result["auth"] = from_union([lambda x: to_class(SandboxConfigAuth, x), from_none], self.auth) + if self.managed_lsp_routing_locked is not None: + result["managedLspRoutingLocked"] = from_union([from_bool, from_none], self.managed_lsp_routing_locked) + if self.managed_mcp_routing_locked is not None: + result["managedMcpRoutingLocked"] = from_union([from_bool, from_none], self.managed_mcp_routing_locked) + if self.sandbox_lsp_servers is not None: + result["sandboxLspServers"] = from_union([from_bool, from_none], self.sandbox_lsp_servers) + if self.sandbox_mcp_servers is not None: + result["sandboxMcpServers"] = from_union([from_bool, from_none], self.sandbox_mcp_servers) if self.user_policy is not None: result["userPolicy"] = from_union([lambda x: to_class(SandboxConfigUserPolicy, x), from_none], self.user_policy) return result @@ -30834,6 +31602,64 @@ def to_dict(self) -> dict: result["error"] = from_union([lambda x: to_class(SessionFSSqliteTransactionError, x), from_none], self.error) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TasksRegisterResult: + """Result of registering or reclaiming a client-owned task.""" + + created: bool + """True only when this invocation created a new task""" + + reclaimed: bool + """True only when this invocation reclaimed an orphaned task""" + + task: TaskClientInfo + """Authoritative registered or reclaimed task""" + + @staticmethod + def from_dict(obj: Any) -> 'TasksRegisterResult': + assert isinstance(obj, dict) + created = from_bool(obj.get("created")) + reclaimed = from_bool(obj.get("reclaimed")) + task = TaskClientInfo.from_dict(obj.get("task")) + return TasksRegisterResult(created, reclaimed, task) + + def to_dict(self) -> dict: + result: dict = {} + result["created"] = from_bool(self.created) + result["reclaimed"] = from_bool(self.reclaimed) + result["task"] = to_class(TaskClientInfo, self.task) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TasksUpdateResult: + """Result of publishing a client-owned task update.""" + + applied: bool + """Whether this invocation changed task state""" + + duplicate: bool + """Whether this invocation repeated the latest accepted update""" + + task: TaskClientInfo + """Authoritative task after processing the update""" + + @staticmethod + def from_dict(obj: Any) -> 'TasksUpdateResult': + assert isinstance(obj, dict) + applied = from_bool(obj.get("applied")) + duplicate = from_bool(obj.get("duplicate")) + task = TaskClientInfo.from_dict(obj.get("task")) + return TasksUpdateResult(applied, duplicate, task) + + def to_dict(self) -> dict: + result: dict = {} + result["applied"] = from_bool(self.applied) + result["duplicate"] = from_bool(self.duplicate) + result["task"] = to_class(TaskClientInfo, self.task) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPConfigAddRequest: @@ -31229,6 +32055,9 @@ class SessionOpenOptions: ask_user_disabled: bool | None = None """Whether ask_user is explicitly disabled.""" + auth_client_id_metadata_url: str | None = None + """OAuth Client ID Metadata Document URL used by this host for MCP authorization.""" + auth_info: AuthInfo | None = None """Initial authentication info for the session.""" @@ -31481,6 +32310,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': agent_context = from_union([from_str, from_none], obj.get("agentContext")) allow_all_mcp_server_instructions = from_union([from_bool, from_none], obj.get("allowAllMcpServerInstructions")) ask_user_disabled = from_union([from_bool, from_none], obj.get("askUserDisabled")) + auth_client_id_metadata_url = from_union([from_str, from_none], obj.get("authClientIdMetadataUrl")) auth_info = from_union([_load_AuthInfo, from_none], obj.get("authInfo")) available_tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("availableTools")) capi = from_union([CapiSessionOptions.from_dict, from_none], obj.get("capi")) @@ -31547,7 +32377,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': verbosity = from_union([Verbosity, from_none], obj.get("verbosity")) working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) working_directory_context = from_union([SessionContext.from_dict, from_none], obj.get("workingDirectoryContext")) - return SessionOpenOptions(additional_content_exclusion_policies, additional_directories, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_mcp_servers, disabled_skills, enable_citations, enable_file_change_tracking, enable_managed_settings, enable_on_demand_instruction_discovery, enable_script_safety, enable_skills, enable_streaming, env_value_mode, events_log_directory, events_log_includes_subagents, excluded_builtin_agents, excluded_tools, exp_assignments, feature_flags, has_skill_provider, included_builtin_agents, included_builtin_skills, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, managed_settings, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, sandbox_config_source, session_capabilities, session_id, session_limits, shell, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, verbosity, working_directory, working_directory_context) + return SessionOpenOptions(additional_content_exclusion_policies, additional_directories, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, auth_client_id_metadata_url, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_mcp_servers, disabled_skills, enable_citations, enable_file_change_tracking, enable_managed_settings, enable_on_demand_instruction_discovery, enable_script_safety, enable_skills, enable_streaming, env_value_mode, events_log_directory, events_log_includes_subagents, excluded_builtin_agents, excluded_tools, exp_assignments, feature_flags, has_skill_provider, included_builtin_agents, included_builtin_skills, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, managed_settings, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, sandbox_config_source, session_capabilities, session_id, session_limits, shell, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, verbosity, working_directory, working_directory_context) def to_dict(self) -> dict: result: dict = {} @@ -31561,6 +32391,8 @@ def to_dict(self) -> dict: result["allowAllMcpServerInstructions"] = from_union([from_bool, from_none], self.allow_all_mcp_server_instructions) if self.ask_user_disabled is not None: result["askUserDisabled"] = from_union([from_bool, from_none], self.ask_user_disabled) + if self.auth_client_id_metadata_url is not None: + result["authClientIdMetadataUrl"] = from_union([from_str, from_none], self.auth_client_id_metadata_url) if self.auth_info is not None: result["authInfo"] = from_union([lambda x: (x).to_dict(), from_none], self.auth_info) if self.available_tools is not None: @@ -34294,6 +35126,11 @@ class Model: a recommended alternative. Present only when the service published at least one notice. Hosts should surface these without implying anything is wrong with the model. """ + metadata: dict[str, Any] | None = None + """Provider-supplied model metadata. Keys and JSON-compatible values are preserved + unchanged. This is factual metadata published by the model provider; it carries no picker + or UX semantics. + """ model_picker_category: ModelPickerCategory | None = None """Model capability category for grouping in the model picker""" @@ -34331,6 +35168,7 @@ def from_dict(obj: Any) -> 'Model': billing = from_union([ModelBilling.from_dict, from_none], obj.get("billing")) default_reasoning_effort = from_union([from_str, from_none], obj.get("defaultReasoningEffort")) info_messages = from_union([lambda x: from_list(ModelMessage.from_dict, x), from_none], obj.get("infoMessages")) + metadata = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("metadata")) model_picker_category = from_union([ModelPickerCategory, from_none], obj.get("modelPickerCategory")) model_picker_price_category = from_union([ModelPickerPriceCategory, from_none], obj.get("modelPickerPriceCategory")) policy = from_union([ModelPolicy.from_dict, from_none], obj.get("policy")) @@ -34338,7 +35176,7 @@ def from_dict(obj: Any) -> 'Model': supported_reasoning_efforts = from_union([lambda x: from_list(from_str, x), from_none], obj.get("supportedReasoningEfforts")) warning_messages = from_union([lambda x: from_list(ModelMessage.from_dict, x), from_none], obj.get("warningMessages")) warning_text = from_union([ModelWarningText.from_dict, from_none], obj.get("warningText")) - return Model(capabilities, id, name, billing, default_reasoning_effort, info_messages, model_picker_category, model_picker_price_category, policy, supported_context_tiers, supported_reasoning_efforts, warning_messages, warning_text) + return Model(capabilities, id, name, billing, default_reasoning_effort, info_messages, metadata, model_picker_category, model_picker_price_category, policy, supported_context_tiers, supported_reasoning_efforts, warning_messages, warning_text) def to_dict(self) -> dict: result: dict = {} @@ -34351,6 +35189,8 @@ def to_dict(self) -> dict: result["defaultReasoningEffort"] = from_union([from_str, from_none], self.default_reasoning_effort) if self.info_messages is not None: result["infoMessages"] = from_union([lambda x: from_list(lambda x: to_class(ModelMessage, x), x), from_none], self.info_messages) + if self.metadata is not None: + result["metadata"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.metadata) if self.model_picker_category is not None: result["modelPickerCategory"] = from_union([lambda x: to_enum(ModelPickerCategory, x), from_none], self.model_picker_category) if self.model_picker_price_category is not None: @@ -34462,6 +35302,11 @@ class ModelSwitchToRequest: `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. """ + auto_tier: AutoTier | None = None + """Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to + return to provider-default Auto routing. This field is rejected when `modelId` is not + `auto`. + """ compaction_decision: str | None = None """Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary. @@ -34514,6 +35359,7 @@ class ModelSwitchToRequest: def from_dict(obj: Any) -> 'ModelSwitchToRequest': assert isinstance(obj, dict) model_id = from_str(obj.get("modelId")) + auto_tier = from_union([AutoTier, from_none], obj.get("autoTier")) compaction_decision = from_union([from_str, from_none], obj.get("compactionDecision")) context_tier = from_union([ContextTier, from_none], obj.get("contextTier")) defer_if_model_change_queued = from_union([from_bool, from_none], obj.get("deferIfModelChangeQueued")) @@ -34527,11 +35373,13 @@ def from_dict(obj: Any) -> 'ModelSwitchToRequest': run_compaction_preflight = from_union([from_bool, from_none], obj.get("runCompactionPreflight")) source = from_union([ModelChangeSource, from_none], obj.get("source")) verbosity = from_union([Verbosity, from_none], obj.get("verbosity")) - return ModelSwitchToRequest(model_id, compaction_decision, context_tier, defer_if_model_change_queued, model_capabilities, model_change_scope, picker_persistence, reasoning_effort, reasoning_summary, repo_scope, require_available, run_compaction_preflight, source, verbosity) + return ModelSwitchToRequest(model_id, auto_tier, compaction_decision, context_tier, defer_if_model_change_queued, model_capabilities, model_change_scope, picker_persistence, reasoning_effort, reasoning_summary, repo_scope, require_available, run_compaction_preflight, source, verbosity) def to_dict(self) -> dict: result: dict = {} result["modelId"] = from_str(self.model_id) + if self.auto_tier is not None: + result["autoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.auto_tier) if self.compaction_decision is not None: result["compactionDecision"] = from_union([from_str, from_none], self.compaction_decision) if self.context_tier is not None: @@ -35613,6 +36461,9 @@ class RPC: catalog_unsafe_retrieval_error: CatalogUnsafeRetrievalError catalog_unsafe_retrieval_reason: CatalogUnsafeRetrievalReason catalog_unsupported_kind_error: CatalogUnsupportedKindError + client_task_cancel_reason: ClientTaskCancelReason + client_task_cancel_request: ClientTaskCancelRequest + client_task_cancel_result: ClientTaskCancelResult command_list: CommandList commands_finalize_invocation_effect_request: CommandsFinalizeInvocationEffectRequest commands_finalize_invocation_effect_result: CommandsFinalizeInvocationEffectResult @@ -36032,6 +36883,9 @@ class RPC: model_set_reasoning_effort_request: ModelSetReasoningEffortRequest model_set_reasoning_effort_result: ModelSetReasoningEffortResult models_list_request: ModelsListRequest + model_switch_auto_tier_request: ModelSwitchAutoTierRequest + model_switch_auto_tier_result: ModelSwitchAutoTierResult + model_switch_auto_tier_status: ModelSwitchAutoTierStatus model_switch_confirmation: ModelSwitchConfirmation model_switch_to_request: ModelSwitchToRequest model_switch_to_result: ModelSwitchToResult @@ -36542,10 +37396,21 @@ class RPC: subagent_settings_entry_context_tier: SubagentSettingsEntryContextTier task_agent_info: TaskAgentInfo task_agent_progress: TaskAgentProgress + task_client_active_status: TaskClientActiveStatus + task_client_execution_mode: TaskClientExecutionMode + task_client_info: TaskClientInfo + task_client_owner: TaskClientOwner + task_client_owner_kind: TaskClientOwnerKind + task_client_owner_presence: TaskClientOwnerPresence + task_client_progress: TaskClientProgress + task_client_status: TaskClientStatus + task_client_type: TaskClientType + task_client_update: TaskClientUpdate task_complete_data: TaskCompleteData task_completion_decision: TaskCompletionDecision task_execution_mode: TaskExecutionMode task_info: TaskInfo + task_kind: TaskKind task_list: TaskList task_progress_line: TaskProgressLine tasks_cancel_request: TasksCancelRequest @@ -36560,6 +37425,8 @@ class RPC: tasks_promote_to_background_request: TasksPromoteToBackgroundRequest tasks_promote_to_background_result: TasksPromoteToBackgroundResult tasks_refresh_result: TasksRefreshResult + tasks_register_request: TasksRegisterRequest + tasks_register_result: TasksRegisterResult tasks_remove_request: TasksRemoveRequest tasks_remove_result: TasksRemoveResult tasks_send_message_request: TasksSendMessageRequest @@ -36567,6 +37434,8 @@ class RPC: tasks_start_agent_request: TasksStartAgentRequest tasks_start_agent_result: TasksStartAgentResult task_status: TaskStatus + tasks_update_request: TasksUpdateRequest + tasks_update_result: TasksUpdateResult tasks_wait_for_pending_result: TasksWaitForPendingResult telemetry_set_feature_overrides_request: TelemetrySetFeatureOverridesRequest token_auth_info: TokenAuthInfo @@ -36807,6 +37676,9 @@ def from_dict(obj: Any) -> 'RPC': catalog_unsafe_retrieval_error = CatalogUnsafeRetrievalError.from_dict(obj.get("CatalogUnsafeRetrievalError")) catalog_unsafe_retrieval_reason = CatalogUnsafeRetrievalReason(obj.get("CatalogUnsafeRetrievalReason")) catalog_unsupported_kind_error = CatalogUnsupportedKindError.from_dict(obj.get("CatalogUnsupportedKindError")) + client_task_cancel_reason = ClientTaskCancelReason(obj.get("ClientTaskCancelReason")) + client_task_cancel_request = ClientTaskCancelRequest.from_dict(obj.get("ClientTaskCancelRequest")) + client_task_cancel_result = ClientTaskCancelResult.from_dict(obj.get("ClientTaskCancelResult")) command_list = CommandList.from_dict(obj.get("CommandList")) commands_finalize_invocation_effect_request = CommandsFinalizeInvocationEffectRequest.from_dict(obj.get("CommandsFinalizeInvocationEffectRequest")) commands_finalize_invocation_effect_result = CommandsFinalizeInvocationEffectResult.from_dict(obj.get("CommandsFinalizeInvocationEffectResult")) @@ -37226,6 +38098,9 @@ def from_dict(obj: Any) -> 'RPC': model_set_reasoning_effort_request = ModelSetReasoningEffortRequest.from_dict(obj.get("ModelSetReasoningEffortRequest")) model_set_reasoning_effort_result = ModelSetReasoningEffortResult.from_dict(obj.get("ModelSetReasoningEffortResult")) models_list_request = ModelsListRequest.from_dict(obj.get("ModelsListRequest")) + model_switch_auto_tier_request = ModelSwitchAutoTierRequest.from_dict(obj.get("ModelSwitchAutoTierRequest")) + model_switch_auto_tier_result = ModelSwitchAutoTierResult.from_dict(obj.get("ModelSwitchAutoTierResult")) + model_switch_auto_tier_status = ModelSwitchAutoTierStatus(obj.get("ModelSwitchAutoTierStatus")) model_switch_confirmation = ModelSwitchConfirmation.from_dict(obj.get("ModelSwitchConfirmation")) model_switch_to_request = ModelSwitchToRequest.from_dict(obj.get("ModelSwitchToRequest")) model_switch_to_result = ModelSwitchToResult.from_dict(obj.get("ModelSwitchToResult")) @@ -37736,10 +38611,21 @@ def from_dict(obj: Any) -> 'RPC': subagent_settings_entry_context_tier = SubagentSettingsEntryContextTier(obj.get("SubagentSettingsEntryContextTier")) task_agent_info = TaskAgentInfo.from_dict(obj.get("TaskAgentInfo")) task_agent_progress = TaskAgentProgress.from_dict(obj.get("TaskAgentProgress")) + task_client_active_status = TaskClientActiveStatus(obj.get("TaskClientActiveStatus")) + task_client_execution_mode = TaskClientExecutionMode(obj.get("TaskClientExecutionMode")) + task_client_info = TaskClientInfo.from_dict(obj.get("TaskClientInfo")) + task_client_owner = TaskClientOwner.from_dict(obj.get("TaskClientOwner")) + task_client_owner_kind = TaskClientOwnerKind(obj.get("TaskClientOwnerKind")) + task_client_owner_presence = TaskClientOwnerPresence(obj.get("TaskClientOwnerPresence")) + task_client_progress = TaskClientProgress.from_dict(obj.get("TaskClientProgress")) + task_client_status = TaskClientStatus(obj.get("TaskClientStatus")) + task_client_type = TaskClientType(obj.get("TaskClientType")) + task_client_update = TaskClientUpdate.from_dict(obj.get("TaskClientUpdate")) task_complete_data = TaskCompleteData.from_dict(obj.get("TaskCompleteData")) task_completion_decision = TaskCompletionDecision.from_dict(obj.get("TaskCompletionDecision")) task_execution_mode = TaskExecutionMode(obj.get("TaskExecutionMode")) task_info = _load_TaskInfo(obj.get("TaskInfo")) + task_kind = TaskKind(obj.get("TaskKind")) task_list = TaskList.from_dict(obj.get("TaskList")) task_progress_line = TaskProgressLine.from_dict(obj.get("TaskProgressLine")) tasks_cancel_request = TasksCancelRequest.from_dict(obj.get("TasksCancelRequest")) @@ -37754,6 +38640,8 @@ def from_dict(obj: Any) -> 'RPC': tasks_promote_to_background_request = TasksPromoteToBackgroundRequest.from_dict(obj.get("TasksPromoteToBackgroundRequest")) tasks_promote_to_background_result = TasksPromoteToBackgroundResult.from_dict(obj.get("TasksPromoteToBackgroundResult")) tasks_refresh_result = TasksRefreshResult.from_dict(obj.get("TasksRefreshResult")) + tasks_register_request = TasksRegisterRequest.from_dict(obj.get("TasksRegisterRequest")) + tasks_register_result = TasksRegisterResult.from_dict(obj.get("TasksRegisterResult")) tasks_remove_request = TasksRemoveRequest.from_dict(obj.get("TasksRemoveRequest")) tasks_remove_result = TasksRemoveResult.from_dict(obj.get("TasksRemoveResult")) tasks_send_message_request = TasksSendMessageRequest.from_dict(obj.get("TasksSendMessageRequest")) @@ -37761,6 +38649,8 @@ def from_dict(obj: Any) -> 'RPC': tasks_start_agent_request = TasksStartAgentRequest.from_dict(obj.get("TasksStartAgentRequest")) tasks_start_agent_result = TasksStartAgentResult.from_dict(obj.get("TasksStartAgentResult")) task_status = TaskStatus(obj.get("TaskStatus")) + tasks_update_request = TasksUpdateRequest.from_dict(obj.get("TasksUpdateRequest")) + tasks_update_result = TasksUpdateResult.from_dict(obj.get("TasksUpdateResult")) tasks_wait_for_pending_result = TasksWaitForPendingResult.from_dict(obj.get("TasksWaitForPendingResult")) telemetry_set_feature_overrides_request = TelemetrySetFeatureOverridesRequest.from_dict(obj.get("TelemetrySetFeatureOverridesRequest")) token_auth_info = TokenAuthInfo.from_dict(obj.get("TokenAuthInfo")) @@ -37874,7 +38764,7 @@ def from_dict(obj: Any) -> 'RPC': subagent_settings = from_union([SubagentSettings.from_dict, from_none], obj.get("SubagentSettings")) task_progress = from_union([TaskProgress.from_dict, from_none], obj.get("TaskProgress")) workspace_summary = from_union([WorkspaceSummary.from_dict, from_none], obj.get("WorkspaceSummary")) - return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_list_request, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agent_set_prompt_request, agents_get_discovery_paths_request, api_key_auth_info, auth_identity, auth_info, auth_info_type, auth_validation_error, auth_validation_errors, built_in_model_catalog, built_in_model_catalog_entry, builtin_tool_descriptor, builtin_tool_format, builtin_tool_format_type, builtin_tool_input_schema, builtin_tool_input_schema_type, builtin_tool_safe_for_telemetry, builtin_tool_safe_telemetry_fields, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_provider_register_request, canvas_provider_unregister_request, canvas_session_context, capi_session_options, card_digest, card_digest_algorithm, card_digest_value, catalog_ai_skill_candidate, catalog_ai_skill_candidate_provenance, catalog_authentication_required_error, catalog_authentication_required_reason, catalog_candidate, catalog_candidate_kind, catalog_candidate_source, catalog_candidate_source_embedded, catalog_candidate_source_url, catalog_capability, catalog_capability_id, catalog_client_contract, catalog_contract_violation_error, catalog_contract_violation_reason, catalog_handle_rejected_error, catalog_handle_rejection_reason, catalog_handle_type, catalog_invalid_request_error, catalog_invalid_request_field, catalog_malformed_card_error, catalog_malformed_card_reason, catalog_mcp_server_candidate, catalog_mcp_server_candidate_provenance, catalog_mcp_server_installability, catalog_media_type, catalog_negotiated_contract, catalog_negotiation_refused_error, catalog_negotiation_refused_reason, catalog_network_failure_error, catalog_network_failure_reason, catalog_not_installable_error, catalog_not_installable_reason, catalog_policy_rejected_error, catalog_search_request, catalog_search_result, catalog_search_succeeded, catalog_unavailable_error, catalog_unavailable_reason, catalog_unavailable_transport_error, catalog_unavailable_transport_reason, catalog_unsafe_retrieval_error, catalog_unsafe_retrieval_reason, catalog_unsupported_kind_error, command_list, commands_finalize_invocation_effect_request, commands_finalize_invocation_effect_result, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invocation_effect_outcome, commands_invocation_origin, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connect_client_info, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, discovered_canvas, discovered_extension, discovered_extension_mode, discovered_extension_plugin, discovered_extensions, discovered_extensions_disable_request, discovered_extensions_enable_request, discovered_extension_source, discovered_hook, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_direction, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_launch_profile, extension_launch_provider_resolve_request, extension_launch_provider_resolve_result, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, factory_abort_request, factory_ack_result, factory_agent_options, factory_agent_request, factory_agent_result, factory_agent_summary, factory_cancel_request, factory_current_phase, factory_declared_limits, factory_durable_operation, factory_execute_request, factory_execute_result, factory_get_run_progress_request, factory_get_run_request, factory_journal_get_request, factory_journal_get_result, factory_journal_put_request, factory_list_runs_request, factory_list_runs_result, factory_log_line, factory_log_line_kind, factory_log_request, factory_phase_observation, factory_phase_status, factory_progress_line, factory_progress_page, factory_resume_request, factory_resume_result, factory_run_consumed, factory_run_detail, factory_run_failure, factory_run_failure_kind, factory_run_limits, factory_run_request, factory_run_result, factory_run_status, factory_run_summary, factory_run_terminal, factory_tool_resume_request, factory_tool_run_options, factory_tool_run_request, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, git_hub_token_acquire_reason, git_hub_token_acquire_request, git_hub_token_acquire_result, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_clear_context_request, history_clear_context_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_origin, hooks_discover_request, hooks_discover_result, hook_type, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, interrupt_main_turn_request, interrupt_main_turn_result, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, managed_settings_read_result, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_elicitation_form_mode, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_failed_server, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_install_plan, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_authentication_state_changed_request, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_probe_needs_auth_reason, mcp_oauth_probe_request, mcp_oauth_probe_result, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_plan_configuration_change, mcp_plan_configuration_operation, mcp_plan_enum_value_type, mcp_plan_install_planned, mcp_plan_install_request, mcp_plan_install_result, mcp_plan_install_source, mcp_plan_install_source_candidate, mcp_plan_install_source_candidate_kind, mcp_plan_install_source_card, mcp_plan_install_source_card_kind, mcp_plan_package_install_method, mcp_plan_package_transport, mcp_plan_policy_decision, mcp_plan_policy_result, mcp_plan_policy_source, mcp_plan_provenance, mcp_plan_remote_install_method, mcp_plan_remote_transport, mcp_plan_required_value, mcp_plan_required_value_enum, mcp_plan_required_value_enum_kind, mcp_plan_required_value_scalar, mcp_plan_required_value_scalar_kind, mcp_plan_resource_identity, mcp_plan_scalar_value_type, mcp_plan_scope, mcp_plan_secret_placeholder, mcp_plan_secret_reference, mcp_plan_target, mcp_plan_transport_choice, mcp_plan_transport_choice_package, mcp_plan_transport_choice_remote, mcp_plan_value_category, mcp_register_external_client_request, mcp_reload_config, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_safe_for_telemetry, mcp_safe_for_telemetry_fields, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_serializable_server_config, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_card_embedded, mcp_server_card_embedded_kind, mcp_server_card_media_type, mcp_server_card_reference, mcp_server_card_url, mcp_server_card_url_kind, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_memory, mcp_server_config_memory_type, mcp_server_config_stdio, mcp_server_config_stdio_type, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_task_metadata, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_apply_startup_overlay_request, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_message, model_picker_category, model_picker_persistence_request, model_picker_price_category, model_picker_settings_context, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_confirmation, model_switch_to_request, model_switch_to_result, model_warning_text, mode_set_request, mode_set_result, move_mcp_loading_to_background_result, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_env_access, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_factory, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_env_access, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_factory, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_context, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_outcome, permission_decision_reject, permission_decision_request, permission_decision_source, permission_decision_surface, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_mode_source, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_response_capability, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_mode_request, permissions_get_mode_result, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_env_access, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_factory, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_mode_request, permissions_set_mode_result, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_builtin_set_request, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, protocol_external_tool_defer, protocol_external_tool_definition, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_duplicate_at_request, queue_duplicate_at_result, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_insert_at_request, queue_insert_at_result, queue_insert_message, queue_move_item_request, queue_move_item_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_at_request, queue_remove_at_result, queue_remove_most_recent_result, queue_send_now_request, queue_send_now_result, queue_set_drain_paused_request, queue_snapshot_result, queue_update_text_request, queue_update_text_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_host_status, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, run_options, sandbox_config, sandbox_config_auth, sandbox_config_source, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_network_proxy, sandbox_config_user_policy_seatbelt, sandbox_enforcement_status, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_agent_list_request, session_auth_login_request, session_auth_logout_user_request, session_auth_status, session_auth_switch_request, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_commands_list_request, session_completion_item, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_git_hub_auth_get_all_auth_available_result, session_git_hub_auth_logout_result, session_git_hub_auth_logout_user_result, session_history_compact_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_limit_prediction_baseline_data, session_limit_prediction_client_type, session_limit_prediction_details, session_limit_prediction_predict_request, session_limit_prediction_request, session_limit_prediction_result, session_limit_prediction_source, session_limit_prediction_tier, session_limit_prediction_tier_option, session_limit_prediction_unavailable_reason, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_managed_permissions, session_managed_settings, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_model_list_request, session_model_price_category, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_plugins_reload_request, session_provider_get_endpoint_request, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_read_persisted_events_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, settable_auth_info, settable_token_auth_info, shell_cancel_user_requested_request, shell_credentials, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, skills_config_set_disabled_skills_request, skills_config_set_skill_disabled_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_add_timeline_entry_result, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_model_picker_dialog, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_set_model_result, slash_command_set_plan_model_result, slash_command_show_dialog_result, slash_command_text_result, slash_command_timeline_entry, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, token_provider_auth_info, tool, tool_list, tool_result, tool_result_expanded, tool_result_new_message, tool_result_type, tools_execute_request, tools_get_builtin_descriptors_request, tools_get_builtin_descriptors_result, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_set_request, tools_set_result, tools_shell_descriptor_config, tools_task_complete_event_data_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_agent_metric, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, session_auth_info_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) + return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_list_request, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agent_set_prompt_request, agents_get_discovery_paths_request, api_key_auth_info, auth_identity, auth_info, auth_info_type, auth_validation_error, auth_validation_errors, built_in_model_catalog, built_in_model_catalog_entry, builtin_tool_descriptor, builtin_tool_format, builtin_tool_format_type, builtin_tool_input_schema, builtin_tool_input_schema_type, builtin_tool_safe_for_telemetry, builtin_tool_safe_telemetry_fields, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_provider_register_request, canvas_provider_unregister_request, canvas_session_context, capi_session_options, card_digest, card_digest_algorithm, card_digest_value, catalog_ai_skill_candidate, catalog_ai_skill_candidate_provenance, catalog_authentication_required_error, catalog_authentication_required_reason, catalog_candidate, catalog_candidate_kind, catalog_candidate_source, catalog_candidate_source_embedded, catalog_candidate_source_url, catalog_capability, catalog_capability_id, catalog_client_contract, catalog_contract_violation_error, catalog_contract_violation_reason, catalog_handle_rejected_error, catalog_handle_rejection_reason, catalog_handle_type, catalog_invalid_request_error, catalog_invalid_request_field, catalog_malformed_card_error, catalog_malformed_card_reason, catalog_mcp_server_candidate, catalog_mcp_server_candidate_provenance, catalog_mcp_server_installability, catalog_media_type, catalog_negotiated_contract, catalog_negotiation_refused_error, catalog_negotiation_refused_reason, catalog_network_failure_error, catalog_network_failure_reason, catalog_not_installable_error, catalog_not_installable_reason, catalog_policy_rejected_error, catalog_search_request, catalog_search_result, catalog_search_succeeded, catalog_unavailable_error, catalog_unavailable_reason, catalog_unavailable_transport_error, catalog_unavailable_transport_reason, catalog_unsafe_retrieval_error, catalog_unsafe_retrieval_reason, catalog_unsupported_kind_error, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, command_list, commands_finalize_invocation_effect_request, commands_finalize_invocation_effect_result, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invocation_effect_outcome, commands_invocation_origin, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connect_client_info, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, discovered_canvas, discovered_extension, discovered_extension_mode, discovered_extension_plugin, discovered_extensions, discovered_extensions_disable_request, discovered_extensions_enable_request, discovered_extension_source, discovered_hook, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_direction, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_launch_profile, extension_launch_provider_resolve_request, extension_launch_provider_resolve_result, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, factory_abort_request, factory_ack_result, factory_agent_options, factory_agent_request, factory_agent_result, factory_agent_summary, factory_cancel_request, factory_current_phase, factory_declared_limits, factory_durable_operation, factory_execute_request, factory_execute_result, factory_get_run_progress_request, factory_get_run_request, factory_journal_get_request, factory_journal_get_result, factory_journal_put_request, factory_list_runs_request, factory_list_runs_result, factory_log_line, factory_log_line_kind, factory_log_request, factory_phase_observation, factory_phase_status, factory_progress_line, factory_progress_page, factory_resume_request, factory_resume_result, factory_run_consumed, factory_run_detail, factory_run_failure, factory_run_failure_kind, factory_run_limits, factory_run_request, factory_run_result, factory_run_status, factory_run_summary, factory_run_terminal, factory_tool_resume_request, factory_tool_run_options, factory_tool_run_request, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, git_hub_token_acquire_reason, git_hub_token_acquire_request, git_hub_token_acquire_result, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_clear_context_request, history_clear_context_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_origin, hooks_discover_request, hooks_discover_result, hook_type, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, interrupt_main_turn_request, interrupt_main_turn_result, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, managed_settings_read_result, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_elicitation_form_mode, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_failed_server, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_install_plan, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_authentication_state_changed_request, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_probe_needs_auth_reason, mcp_oauth_probe_request, mcp_oauth_probe_result, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_plan_configuration_change, mcp_plan_configuration_operation, mcp_plan_enum_value_type, mcp_plan_install_planned, mcp_plan_install_request, mcp_plan_install_result, mcp_plan_install_source, mcp_plan_install_source_candidate, mcp_plan_install_source_candidate_kind, mcp_plan_install_source_card, mcp_plan_install_source_card_kind, mcp_plan_package_install_method, mcp_plan_package_transport, mcp_plan_policy_decision, mcp_plan_policy_result, mcp_plan_policy_source, mcp_plan_provenance, mcp_plan_remote_install_method, mcp_plan_remote_transport, mcp_plan_required_value, mcp_plan_required_value_enum, mcp_plan_required_value_enum_kind, mcp_plan_required_value_scalar, mcp_plan_required_value_scalar_kind, mcp_plan_resource_identity, mcp_plan_scalar_value_type, mcp_plan_scope, mcp_plan_secret_placeholder, mcp_plan_secret_reference, mcp_plan_target, mcp_plan_transport_choice, mcp_plan_transport_choice_package, mcp_plan_transport_choice_remote, mcp_plan_value_category, mcp_register_external_client_request, mcp_reload_config, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_safe_for_telemetry, mcp_safe_for_telemetry_fields, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_serializable_server_config, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_card_embedded, mcp_server_card_embedded_kind, mcp_server_card_media_type, mcp_server_card_reference, mcp_server_card_url, mcp_server_card_url_kind, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_memory, mcp_server_config_memory_type, mcp_server_config_stdio, mcp_server_config_stdio_type, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_task_metadata, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_apply_startup_overlay_request, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_message, model_picker_category, model_picker_persistence_request, model_picker_price_category, model_picker_settings_context, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, model_switch_confirmation, model_switch_to_request, model_switch_to_result, model_warning_text, mode_set_request, mode_set_result, move_mcp_loading_to_background_result, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_env_access, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_factory, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_env_access, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_factory, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_context, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_outcome, permission_decision_reject, permission_decision_request, permission_decision_source, permission_decision_surface, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_mode_source, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_response_capability, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_mode_request, permissions_get_mode_result, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_env_access, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_factory, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_mode_request, permissions_set_mode_result, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_builtin_set_request, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, protocol_external_tool_defer, protocol_external_tool_definition, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_duplicate_at_request, queue_duplicate_at_result, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_insert_at_request, queue_insert_at_result, queue_insert_message, queue_move_item_request, queue_move_item_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_at_request, queue_remove_at_result, queue_remove_most_recent_result, queue_send_now_request, queue_send_now_result, queue_set_drain_paused_request, queue_snapshot_result, queue_update_text_request, queue_update_text_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_host_status, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, run_options, sandbox_config, sandbox_config_auth, sandbox_config_source, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_network_proxy, sandbox_config_user_policy_seatbelt, sandbox_enforcement_status, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_agent_list_request, session_auth_login_request, session_auth_logout_user_request, session_auth_status, session_auth_switch_request, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_commands_list_request, session_completion_item, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_git_hub_auth_get_all_auth_available_result, session_git_hub_auth_logout_result, session_git_hub_auth_logout_user_result, session_history_compact_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_limit_prediction_baseline_data, session_limit_prediction_client_type, session_limit_prediction_details, session_limit_prediction_predict_request, session_limit_prediction_request, session_limit_prediction_result, session_limit_prediction_source, session_limit_prediction_tier, session_limit_prediction_tier_option, session_limit_prediction_unavailable_reason, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_managed_permissions, session_managed_settings, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_model_list_request, session_model_price_category, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_plugins_reload_request, session_provider_get_endpoint_request, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_read_persisted_events_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, settable_auth_info, settable_token_auth_info, shell_cancel_user_requested_request, shell_credentials, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, skills_config_set_disabled_skills_request, skills_config_set_skill_disabled_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_add_timeline_entry_result, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_model_picker_dialog, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_set_model_result, slash_command_set_plan_model_result, slash_command_show_dialog_result, slash_command_text_result, slash_command_timeline_entry, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_register_request, tasks_register_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_update_request, tasks_update_result, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, token_provider_auth_info, tool, tool_list, tool_result, tool_result_expanded, tool_result_new_message, tool_result_type, tools_execute_request, tools_get_builtin_descriptors_request, tools_get_builtin_descriptors_result, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_set_request, tools_set_result, tools_shell_descriptor_config, tools_task_complete_event_data_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_agent_metric, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, session_auth_info_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -38001,6 +38891,9 @@ def to_dict(self) -> dict: result["CatalogUnsafeRetrievalError"] = to_class(CatalogUnsafeRetrievalError, self.catalog_unsafe_retrieval_error) result["CatalogUnsafeRetrievalReason"] = to_enum(CatalogUnsafeRetrievalReason, self.catalog_unsafe_retrieval_reason) result["CatalogUnsupportedKindError"] = to_class(CatalogUnsupportedKindError, self.catalog_unsupported_kind_error) + result["ClientTaskCancelReason"] = to_enum(ClientTaskCancelReason, self.client_task_cancel_reason) + result["ClientTaskCancelRequest"] = to_class(ClientTaskCancelRequest, self.client_task_cancel_request) + result["ClientTaskCancelResult"] = to_class(ClientTaskCancelResult, self.client_task_cancel_result) result["CommandList"] = to_class(CommandList, self.command_list) result["CommandsFinalizeInvocationEffectRequest"] = to_class(CommandsFinalizeInvocationEffectRequest, self.commands_finalize_invocation_effect_request) result["CommandsFinalizeInvocationEffectResult"] = to_class(CommandsFinalizeInvocationEffectResult, self.commands_finalize_invocation_effect_result) @@ -38420,6 +39313,9 @@ def to_dict(self) -> dict: result["ModelSetReasoningEffortRequest"] = to_class(ModelSetReasoningEffortRequest, self.model_set_reasoning_effort_request) result["ModelSetReasoningEffortResult"] = to_class(ModelSetReasoningEffortResult, self.model_set_reasoning_effort_result) result["ModelsListRequest"] = to_class(ModelsListRequest, self.models_list_request) + result["ModelSwitchAutoTierRequest"] = to_class(ModelSwitchAutoTierRequest, self.model_switch_auto_tier_request) + result["ModelSwitchAutoTierResult"] = to_class(ModelSwitchAutoTierResult, self.model_switch_auto_tier_result) + result["ModelSwitchAutoTierStatus"] = to_enum(ModelSwitchAutoTierStatus, self.model_switch_auto_tier_status) result["ModelSwitchConfirmation"] = to_class(ModelSwitchConfirmation, self.model_switch_confirmation) result["ModelSwitchToRequest"] = to_class(ModelSwitchToRequest, self.model_switch_to_request) result["ModelSwitchToResult"] = to_class(ModelSwitchToResult, self.model_switch_to_result) @@ -38930,10 +39826,21 @@ def to_dict(self) -> dict: result["SubagentSettingsEntryContextTier"] = to_enum(SubagentSettingsEntryContextTier, self.subagent_settings_entry_context_tier) result["TaskAgentInfo"] = to_class(TaskAgentInfo, self.task_agent_info) result["TaskAgentProgress"] = to_class(TaskAgentProgress, self.task_agent_progress) + result["TaskClientActiveStatus"] = to_enum(TaskClientActiveStatus, self.task_client_active_status) + result["TaskClientExecutionMode"] = to_enum(TaskClientExecutionMode, self.task_client_execution_mode) + result["TaskClientInfo"] = to_class(TaskClientInfo, self.task_client_info) + result["TaskClientOwner"] = to_class(TaskClientOwner, self.task_client_owner) + result["TaskClientOwnerKind"] = to_enum(TaskClientOwnerKind, self.task_client_owner_kind) + result["TaskClientOwnerPresence"] = to_enum(TaskClientOwnerPresence, self.task_client_owner_presence) + result["TaskClientProgress"] = to_class(TaskClientProgress, self.task_client_progress) + result["TaskClientStatus"] = to_enum(TaskClientStatus, self.task_client_status) + result["TaskClientType"] = to_enum(TaskClientType, self.task_client_type) + result["TaskClientUpdate"] = to_class(TaskClientUpdate, self.task_client_update) result["TaskCompleteData"] = to_class(TaskCompleteData, self.task_complete_data) result["TaskCompletionDecision"] = to_class(TaskCompletionDecision, self.task_completion_decision) result["TaskExecutionMode"] = to_enum(TaskExecutionMode, self.task_execution_mode) result["TaskInfo"] = (self.task_info).to_dict() + result["TaskKind"] = to_enum(TaskKind, self.task_kind) result["TaskList"] = to_class(TaskList, self.task_list) result["TaskProgressLine"] = to_class(TaskProgressLine, self.task_progress_line) result["TasksCancelRequest"] = to_class(TasksCancelRequest, self.tasks_cancel_request) @@ -38948,6 +39855,8 @@ def to_dict(self) -> dict: result["TasksPromoteToBackgroundRequest"] = to_class(TasksPromoteToBackgroundRequest, self.tasks_promote_to_background_request) result["TasksPromoteToBackgroundResult"] = to_class(TasksPromoteToBackgroundResult, self.tasks_promote_to_background_result) result["TasksRefreshResult"] = to_class(TasksRefreshResult, self.tasks_refresh_result) + result["TasksRegisterRequest"] = to_class(TasksRegisterRequest, self.tasks_register_request) + result["TasksRegisterResult"] = to_class(TasksRegisterResult, self.tasks_register_result) result["TasksRemoveRequest"] = to_class(TasksRemoveRequest, self.tasks_remove_request) result["TasksRemoveResult"] = to_class(TasksRemoveResult, self.tasks_remove_result) result["TasksSendMessageRequest"] = to_class(TasksSendMessageRequest, self.tasks_send_message_request) @@ -38955,6 +39864,8 @@ def to_dict(self) -> dict: result["TasksStartAgentRequest"] = to_class(TasksStartAgentRequest, self.tasks_start_agent_request) result["TasksStartAgentResult"] = to_class(TasksStartAgentResult, self.tasks_start_agent_result) result["TaskStatus"] = to_enum(TaskStatus, self.task_status) + result["TasksUpdateRequest"] = to_class(TasksUpdateRequest, self.tasks_update_request) + result["TasksUpdateResult"] = to_class(TasksUpdateResult, self.tasks_update_result) result["TasksWaitForPendingResult"] = to_class(TasksWaitForPendingResult, self.tasks_wait_for_pending_result) result["TelemetrySetFeatureOverridesRequest"] = to_class(TelemetrySetFeatureOverridesRequest, self.telemetry_set_feature_overrides_request) result["TokenAuthInfo"] = to_class(TokenAuthInfo, self.token_auth_info) @@ -39411,14 +40322,15 @@ def _load_SlashCommandInvocationResult(obj: Any) -> "SlashCommandInvocationResul case "set-plan-model": return SlashCommandSetPlanModelResult.from_dict(obj) case _: raise ValueError(f"Unknown SlashCommandInvocationResult kind: {kind!r}") -# Tracked task union returned by task APIs, containing either an agent task or a shell task. -TaskInfo = TaskAgentInfo | TaskShellInfo +# Tracked task union returned by task APIs, containing an agent, client, or shell task. +TaskInfo = TaskAgentInfo | TaskClientInfo | TaskShellInfo def _load_TaskInfo(obj: Any) -> "TaskInfo": assert isinstance(obj, dict) kind = obj.get("type") match kind: case "agent": return TaskAgentInfo.from_dict(obj) + case "client": return TaskClientInfo.from_dict(obj) case "shell": return TaskShellInfo.from_dict(obj) case _: raise ValueError(f"Unknown TaskInfo type: {kind!r}") @@ -40329,7 +41241,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def get_current(self, *, timeout: float | None = None) -> CurrentModel: - "Gets the currently selected model for the session.\n\nReturns:\n The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume." + "Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn.\n\nReturns:\n The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume." return CurrentModel.from_dict(await self._client.request("session.model.getCurrent", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def switch_to(self, params: ModelSwitchToRequest, *, timeout: float | None = None) -> ModelSwitchToResult: @@ -40338,6 +41250,12 @@ async def switch_to(self, params: ModelSwitchToRequest, *, timeout: float | None params_dict["sessionId"] = self._session_id return ModelSwitchToResult.from_dict(await self._client.request("session.model.switchTo", params_dict, **_timeout_kwargs(timeout))) + async def switch_auto_tier(self, params: ModelSwitchAutoTierRequest, *, timeout: float | None = None) -> ModelSwitchAutoTierResult: + "Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`.\n\nArgs:\n params: An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`.\n\nReturns:\n Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return ModelSwitchAutoTierResult.from_dict(await self._client.request("session.model.switchAutoTier", params_dict, **_timeout_kwargs(timeout))) + async def set_reasoning_effort(self, params: ModelSetReasoningEffortRequest, *, timeout: float | None = None) -> ModelSetReasoningEffortResult: "Updates the session's reasoning effort without changing the selected model.\n\nArgs:\n params: Reasoning effort level to apply to the currently selected model.\n\nReturns:\n Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} @@ -40605,6 +41523,18 @@ async def list(self, *, timeout: float | None = None) -> TaskList: "Lists background tasks tracked by the session.\n\nReturns:\n Background tasks currently tracked by the session." return TaskList.from_dict(await self._client.request("session.tasks.list", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + async def register(self, params: TasksRegisterRequest, *, timeout: float | None = None) -> TasksRegisterResult: + "Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal.\n\nArgs:\n params: Registers or reclaims a client-owned task.\n\nReturns:\n Result of registering or reclaiming a client-owned task." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return TasksRegisterResult.from_dict(await self._client.request("session.tasks.register", params_dict, **_timeout_kwargs(timeout))) + + async def update(self, params: TasksUpdateRequest, *, timeout: float | None = None) -> TasksUpdateResult: + "Publishes generic progress or a terminal outcome for a client-owned task.\n\nArgs:\n params: Updates a client-owned task.\n\nReturns:\n Result of publishing a client-owned task update." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return TasksUpdateResult.from_dict(await self._client.request("session.tasks.update", params_dict, **_timeout_kwargs(timeout))) + async def refresh(self, *, timeout: float | None = None) -> TasksRefreshResult: "Refreshes metadata for any detached background shells the runtime knows about.\n\nReturns:\n Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop." return TasksRefreshResult.from_dict(await self._client.request("session.tasks.refresh", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -42026,6 +42956,12 @@ async def abort(self, params: FactoryAbortRequest) -> FactoryACKResult: "Asks the owning extension connection to abort a running factory cooperatively.\n\nArgs:\n params: Parameters for cooperatively aborting a factory body.\n\nReturns:\n Acknowledgement that a factory request was accepted." pass +# Experimental: this API group is experimental and may change or be removed. +class TasksHandler(Protocol): + async def cancel(self, params: ClientTaskCancelRequest) -> ClientTaskCancelResult: + "Asks the client currently bound to a client-owned session task to confirm that its external work stopped.\n\nArgs:\n params: Runtime-to-owner cancellation request for a client-owned task.\n\nReturns:\n Whether the client authoritatively confirmed its external work stopped." + pass + # Experimental: this API group is experimental and may change or be removed. class SessionFsHandler(Protocol): async def read_file(self, params: SessionFSReadFileRequest) -> SessionFSReadFileResult: @@ -42084,6 +43020,7 @@ async def invoke(self, params: CanvasProviderInvokeActionRequest) -> Any: class ClientSessionApiHandlers: provider_token: ProviderTokenHandler | None = None factory: FactoryHandler | None = None + tasks: TasksHandler | None = None session_fs: SessionFsHandler | None = None canvas: CanvasHandler | None = None @@ -42113,6 +43050,13 @@ async def handle_factory_abort(params: dict) -> dict | None: result = await handler.abort(request) return result.to_dict() client.set_request_handler("factory.abort", handle_factory_abort) + async def handle_tasks_cancel(params: dict) -> dict | None: + request = ClientTaskCancelRequest.from_dict(params) + handler = get_handlers(request.session_id).tasks + if handler is None: raise RuntimeError(f"No tasks handler registered for session: {request.session_id}") + result = await handler.cancel(request) + return result.to_dict() + client.set_request_handler("tasks.cancel", handle_tasks_cancel) async def handle_session_fs_read_file(params: dict) -> dict | None: request = SessionFSReadFileRequest.from_dict(params) handler = get_handlers(request.session_id).session_fs @@ -42481,6 +43425,9 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "Categories", "ClientGlobalApiHandlers", "ClientSessionApiHandlers", + "ClientTaskCancelReason", + "ClientTaskCancelRequest", + "ClientTaskCancelResult", "CommandList", "CommandsApi", "CommandsFinalizeInvocationEffectRequest", @@ -42964,6 +43911,9 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "ModelPolicyState", "ModelSetReasoningEffortRequest", "ModelSetReasoningEffortResult", + "ModelSwitchAutoTierRequest", + "ModelSwitchAutoTierResult", + "ModelSwitchAutoTierStatus", "ModelSwitchConfirmation", "ModelSwitchToRequest", "ModelSwitchToResult", @@ -43588,13 +44538,24 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "TaskAgentInfo", "TaskAgentInfoType", "TaskAgentProgress", + "TaskClientActiveStatus", + "TaskClientExecutionMode", + "TaskClientInfo", + "TaskClientOwner", + "TaskClientOwnerKind", + "TaskClientOwnerPresence", + "TaskClientProgress", + "TaskClientStatus", + "TaskClientType", + "TaskClientUpdate", + "TaskClientUpdateKind", "TaskCompleteData", "TaskCompletionDecision", "TaskExecutionMode", "TaskInfo", "TaskInfoExecutionMode", "TaskInfoStatus", - "TaskInfoType", + "TaskKind", "TaskList", "TaskProgress", "TaskProgressLine", @@ -43610,16 +44571,21 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "TasksGetCurrentPromotableResult", "TasksGetProgressRequest", "TasksGetProgressResult", + "TasksHandler", "TasksPromoteCurrentToBackgroundResult", "TasksPromoteToBackgroundRequest", "TasksPromoteToBackgroundResult", "TasksRefreshResult", + "TasksRegisterRequest", + "TasksRegisterResult", "TasksRemoveRequest", "TasksRemoveResult", "TasksSendMessageRequest", "TasksSendMessageResult", "TasksStartAgentRequest", "TasksStartAgentResult", + "TasksUpdateRequest", + "TasksUpdateResult", "TasksWaitForPendingResult", "TelemetryApi", "TelemetrySetFeatureOverridesRequest", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index 51e719bcf9..636f63bcda 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -136,6 +136,7 @@ class SessionEventType(Enum): SESSION_INFO = "session.info" SESSION_WARNING = "session.warning" SESSION_MODEL_CHANGE = "session.model_change" + SESSION_AUTO_TIER_SWITCH_FAILED = "session.auto_tier_switch_failed" SESSION_MODE_CHANGED = "session.mode_changed" SESSION_MODE_NOTICE_DELIVERED = "session.mode_notice_delivered" SESSION_SESSION_LIMITS_CHANGED = "session.session_limits_changed" @@ -262,6 +263,8 @@ class SessionEventType(Enum): SESSION_CUSTOM_AGENTS_UPDATED = "session.custom_agents_updated" SESSION_MCP_SERVERS_LOADED = "session.mcp_servers_loaded" SESSION_MCP_SERVER_STATUS_CHANGED = "session.mcp_server_status_changed" + SESSION_MCP_SERVER_REMOVED = "session.mcp_server_removed" + SESSION_MCP_SERVER_NEEDS_RECONNECT = "session.mcp_server_needs_reconnect" MCP_TOOLS_LIST_CHANGED = "mcp.tools.list_changed" MCP_RESOURCES_LIST_CHANGED = "mcp.resources.list_changed" MCP_PROMPTS_LIST_CHANGED = "mcp.prompts.list_changed" @@ -7586,6 +7589,34 @@ def to_dict(self) -> dict: return {} +@dataclass +class SessionAutoTierSwitchFailedData: + "A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume." + reason: AutoTierSwitchFailureReason + requested_auto_tier: AutoTier | None + effective_auto_tier: AutoTier | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionAutoTierSwitchFailedData": + assert isinstance(obj, dict) + reason = parse_enum(AutoTierSwitchFailureReason, obj.get("reason")) + requested_auto_tier = from_union([from_none, lambda x: parse_enum(AutoTier, x)], obj.get("requestedAutoTier")) + effective_auto_tier = from_union([from_none, lambda x: parse_enum(AutoTier, x)], obj.get("effectiveAutoTier")) + return SessionAutoTierSwitchFailedData( + reason=reason, + requested_auto_tier=requested_auto_tier, + effective_auto_tier=effective_auto_tier, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["reason"] = to_enum(AutoTierSwitchFailureReason, self.reason) + result["requestedAutoTier"] = from_union([from_none, lambda x: to_enum(AutoTier, x)], self.requested_auto_tier) + if self.effective_auto_tier is not None: + result["effectiveAutoTier"] = from_union([from_none, lambda x: to_enum(AutoTier, x)], self.effective_auto_tier) + return result + + @dataclass class SessionAutopilotObjectiveChangedData: "Autopilot objective state file operation details indicating what changed" @@ -8289,6 +8320,44 @@ def to_dict(self) -> dict: return result +@dataclass +class SessionMcpServerNeedsReconnectData: + "Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established." + server_name: str + + @staticmethod + def from_dict(obj: Any) -> "SessionMcpServerNeedsReconnectData": + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + return SessionMcpServerNeedsReconnectData( + server_name=server_name, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + return result + + +@dataclass +class SessionMcpServerRemovedData: + "Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs." + server_name: str + + @staticmethod + def from_dict(obj: Any) -> "SessionMcpServerRemovedData": + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + return SessionMcpServerRemovedData( + server_name=server_name, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + return result + + @dataclass class SessionMcpServerStatusChangedData: "Payload of `session.mcp_server_status_changed` for one MCP server's status and optional failure error." @@ -8387,8 +8456,10 @@ def to_dict(self) -> dict: class SessionModelChangeData: "Model change details including previous and new model identifiers" new_model: str + auto_tier: AutoTier | None = None cause: str | None = None context_tier: ContextTier | None = None + previous_auto_tier: AutoTier | None = None previous_model: str | None = None previous_reasoning_effort: str | None = None previous_reasoning_summary: ReasoningSummary | None = None @@ -8402,8 +8473,10 @@ class SessionModelChangeData: def from_dict(obj: Any) -> "SessionModelChangeData": assert isinstance(obj, dict) new_model = from_str(obj.get("newModel")) + auto_tier = from_union([from_none, lambda x: parse_enum(AutoTier, x)], obj.get("autoTier")) cause = from_union([from_none, from_str], obj.get("cause")) context_tier = from_union([from_none, lambda x: parse_enum(ContextTier, x)], obj.get("contextTier")) + previous_auto_tier = from_union([from_none, lambda x: parse_enum(AutoTier, x)], obj.get("previousAutoTier")) previous_model = from_union([from_none, from_str], obj.get("previousModel")) previous_reasoning_effort = from_union([from_none, from_str], obj.get("previousReasoningEffort")) previous_reasoning_summary = from_union([from_none, lambda x: parse_enum(ReasoningSummary, x)], obj.get("previousReasoningSummary")) @@ -8414,8 +8487,10 @@ def from_dict(obj: Any) -> "SessionModelChangeData": verbosity = from_union([from_none, lambda x: parse_enum(Verbosity, x)], obj.get("verbosity")) return SessionModelChangeData( new_model=new_model, + auto_tier=auto_tier, cause=cause, context_tier=context_tier, + previous_auto_tier=previous_auto_tier, previous_model=previous_model, previous_reasoning_effort=previous_reasoning_effort, previous_reasoning_summary=previous_reasoning_summary, @@ -8429,10 +8504,14 @@ def from_dict(obj: Any) -> "SessionModelChangeData": def to_dict(self) -> dict: result: dict = {} result["newModel"] = from_str(self.new_model) + if self.auto_tier is not None: + result["autoTier"] = from_union([from_none, lambda x: to_enum(AutoTier, x)], self.auto_tier) if self.cause is not None: result["cause"] = from_union([from_none, from_str], self.cause) if self.context_tier is not None: result["contextTier"] = from_union([from_none, lambda x: to_enum(ContextTier, x)], self.context_tier) + if self.previous_auto_tier is not None: + result["previousAutoTier"] = from_union([from_none, lambda x: to_enum(AutoTier, x)], self.previous_auto_tier) if self.previous_model is not None: result["previousModel"] = from_union([from_none, from_str], self.previous_model) if self.previous_reasoning_effort is not None: @@ -12033,6 +12112,18 @@ class AutoTier(Enum): INTELLIGENCE = "intelligence" +class AutoTierSwitchFailureReason(Enum): + "Terminal reason an Auto preference activation failed." + # The candidate model was rejected by model policy. + POLICY_REJECTED = "policy_rejected" + # The Auto routing request failed or returned an unusable response. + REQUEST_FAILED = "request_failed" + # The runtime could not prepare the Auto routing request. + SETUP_FAILED = "setup_failed" + # The provider does not support Auto routing. + UNSUPPORTED = "unsupported" + + class AutopilotObjectiveChangedOperation(Enum): "The type of operation performed on the autopilot objective state file" # Autopilot objective state file was created for a new objective. @@ -12647,7 +12738,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionModeNoticeDeliveredData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionContextClearedData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | SessionCompletionReceiptData | SessionFusionRouteStartedData | SessionFusionRouteFailedData | SessionFusionResolvedData | SessionFusionCompletedData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantTurnRetryData | AgentInterruptedData | AssistantIntentData | AssistantFusionPhaseStartedData | AssistantFusionPhaseActivityData | AssistantFusionPhaseCompletedData | AssistantFusionPhaseFailedData | AssistantServerToolProgressData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | PromptCacheBreakData | ModelCallFailureData | ModelCallFinishedData | ModelCallStartData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | ToolSearchActivatedData | SkillInvokedData | SandboxDecisionData | SubagentStartedData | SubagentConfiguredData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | UiEphemeralQueryData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | SessionManagedSettingsResolvedData | SessionManagedSettingsEnforcedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | FactoryRunUpdatedData | FactoryRunStartedData | FactoryRunSettledData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data +SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionAutoTierSwitchFailedData | SessionModeChangedData | SessionModeNoticeDeliveredData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionContextClearedData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | SessionCompletionReceiptData | SessionFusionRouteStartedData | SessionFusionRouteFailedData | SessionFusionResolvedData | SessionFusionCompletedData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantTurnRetryData | AgentInterruptedData | AssistantIntentData | AssistantFusionPhaseStartedData | AssistantFusionPhaseActivityData | AssistantFusionPhaseCompletedData | AssistantFusionPhaseFailedData | AssistantServerToolProgressData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | PromptCacheBreakData | ModelCallFailureData | ModelCallFinishedData | ModelCallStartData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | ToolSearchActivatedData | SkillInvokedData | SandboxDecisionData | SubagentStartedData | SubagentConfiguredData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | UiEphemeralQueryData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | SessionManagedSettingsResolvedData | SessionManagedSettingsEnforcedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | FactoryRunUpdatedData | FactoryRunStartedData | FactoryRunSettledData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | SessionMcpServerRemovedData | SessionMcpServerNeedsReconnectData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -12686,6 +12777,7 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_INFO: data = SessionInfoData.from_dict(data_obj) case SessionEventType.SESSION_WARNING: data = SessionWarningData.from_dict(data_obj) case SessionEventType.SESSION_MODEL_CHANGE: data = SessionModelChangeData.from_dict(data_obj) + case SessionEventType.SESSION_AUTO_TIER_SWITCH_FAILED: data = SessionAutoTierSwitchFailedData.from_dict(data_obj) case SessionEventType.SESSION_MODE_CHANGED: data = SessionModeChangedData.from_dict(data_obj) case SessionEventType.SESSION_MODE_NOTICE_DELIVERED: data = SessionModeNoticeDeliveredData.from_dict(data_obj) case SessionEventType.SESSION_SESSION_LIMITS_CHANGED: data = SessionSessionLimitsChangedData.from_dict(data_obj) @@ -12794,6 +12886,8 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_CUSTOM_AGENTS_UPDATED: data = SessionCustomAgentsUpdatedData.from_dict(data_obj) case SessionEventType.SESSION_MCP_SERVERS_LOADED: data = SessionMcpServersLoadedData.from_dict(data_obj) case SessionEventType.SESSION_MCP_SERVER_STATUS_CHANGED: data = SessionMcpServerStatusChangedData.from_dict(data_obj) + case SessionEventType.SESSION_MCP_SERVER_REMOVED: data = SessionMcpServerRemovedData.from_dict(data_obj) + case SessionEventType.SESSION_MCP_SERVER_NEEDS_RECONNECT: data = SessionMcpServerNeedsReconnectData.from_dict(data_obj) case SessionEventType.MCP_TOOLS_LIST_CHANGED: data = McpToolsListChangedData.from_dict(data_obj) case SessionEventType.MCP_RESOURCES_LIST_CHANGED: data = McpResourcesListChangedData.from_dict(data_obj) case SessionEventType.MCP_PROMPTS_LIST_CHANGED: data = McpPromptsListChangedData.from_dict(data_obj) @@ -12904,6 +12998,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "AutoModeSwitchRequestedData", "AutoModeSwitchResponse", "AutoTier", + "AutoTierSwitchFailureReason", "AutopilotObjectiveChangedOperation", "AutopilotObjectiveChangedStatus", "BinaryAssetReference", @@ -13081,6 +13176,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SandboxDecisionData", "ScheduleOrigin", "SessionAutoModeResolvedData", + "SessionAutoTierSwitchFailedData", "SessionAutopilotObjectiveChangedData", "SessionBackgroundTasksChangedData", "SessionBinaryAssetData", @@ -13117,6 +13213,8 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SessionLimitsExhaustedResponseAction", "SessionManagedSettingsEnforcedData", "SessionManagedSettingsResolvedData", + "SessionMcpServerNeedsReconnectData", + "SessionMcpServerRemovedData", "SessionMcpServerStatusChangedData", "SessionMcpServersLoadedData", "SessionMode", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 96e18b0685..f1568a8232 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -288,6 +288,8 @@ pub mod rpc_methods { pub const SESSION_MODEL_GETCURRENT: &str = "session.model.getCurrent"; /// `session.model.switchTo` pub const SESSION_MODEL_SWITCHTO: &str = "session.model.switchTo"; + /// `session.model.switchAutoTier` + pub const SESSION_MODEL_SWITCHAUTOTIER: &str = "session.model.switchAutoTier"; /// `session.model.applyStartupOverlay` pub const SESSION_MODEL_APPLYSTARTUPOVERLAY: &str = "session.model.applyStartupOverlay"; /// `session.model.setReasoningEffort` @@ -376,6 +378,10 @@ pub mod rpc_methods { pub const SESSION_TASKS_STARTAGENT: &str = "session.tasks.startAgent"; /// `session.tasks.list` pub const SESSION_TASKS_LIST: &str = "session.tasks.list"; + /// `session.tasks.register` + pub const SESSION_TASKS_REGISTER: &str = "session.tasks.register"; + /// `session.tasks.update` + pub const SESSION_TASKS_UPDATE: &str = "session.tasks.update"; /// `session.tasks.refresh` pub const SESSION_TASKS_REFRESH: &str = "session.tasks.refresh"; /// `session.tasks.waitForPending` @@ -753,6 +759,8 @@ pub mod rpc_methods { pub const FACTORY_EXECUTE: &str = "factory.execute"; /// `factory.abort` pub const FACTORY_ABORT: &str = "factory.abort"; + /// `tasks.cancel` + pub const TASKS_CANCEL: &str = "tasks.cancel"; /// `sessionFs.readFile` pub const SESSIONFS_READFILE: &str = "sessionFs.readFile"; /// `sessionFs.writeFile` @@ -3038,7 +3046,7 @@ pub struct CanvasProviderUnregisterRequest { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CapiSessionOptions { - /// Routing preference used when the session model is `auto`. The runtime persists the preference across cold resume. When omitted, the default routing behavior is used. Resuming an already-resident session cannot change its preference. + /// Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. #[serde(skip_serializing_if = "Option::is_none")] pub auto_tier: Option, /// 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. @@ -3551,6 +3559,44 @@ pub struct CatalogUnavailableTransportError { pub reason: CatalogUnavailableTransportReason, } +/// Runtime-to-owner cancellation request for a client-owned task. +/// +///

+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ClientTaskCancelRequest { + /// Opaque identifier shared by coalesced cancellation callers + pub cancellation_id: String, + /// Owner-scoped task key included for correlation + pub client_task_id: String, + /// Canonical runtime-generated task identifier + pub id: String, + /// Reason the runtime requests cancellation + pub reason: ClientTaskCancelReason, + /// Session that owns the client task + pub session_id: SessionId, +} + +/// Whether the client authoritatively confirmed its external work stopped. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ClientTaskCancelResult { + /// True only when the owner confirms that external work stopped before responding + pub cancelled: bool, +} + /// A literal choice the command input accepts, with a human-facing description /// ///
@@ -3997,6 +4043,9 @@ pub(crate) struct ConnectRequest { /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events. #[serde(skip_serializing_if = "Option::is_none")] pub enable_git_hub_telemetry_forwarding: Option, + /// Task kinds this connection can decode when observing session tasks. Omit to retain agent and shell compatibility. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_task_kinds: Option>, /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN #[serde(skip_serializing_if = "Option::is_none")] pub token: Option, @@ -4017,6 +4066,9 @@ pub(crate) struct ConnectResult { pub ok: bool, /// Server protocol version number pub protocol_version: i64, + /// Task kinds the server may return to this connection. + #[serde(skip_serializing_if = "Option::is_none")] + pub task_kinds: Option>, /// Server package version pub version: String, } @@ -4091,7 +4143,7 @@ pub struct ContextHeaviestMessage { pub tokens: i64, } -/// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. +/// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. /// ///
/// @@ -4102,12 +4154,21 @@ pub struct ContextHeaviestMessage { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CurrentModel { + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub activating_auto_tier: Option, + /// Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_tier: Option, /// Context tier for models that support multiple context-window sizes. #[serde(skip_serializing_if = "Option::is_none")] pub context_tier: Option, /// Currently active model identifier #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_auto_tier: Option, /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_effort: Option, @@ -7720,6 +7781,9 @@ pub struct McpConfigList { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct McpConfigRemoveRequest { + /// OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. + #[serde(skip_serializing_if = "Option::is_none")] + pub auth_client_id_metadata_url: Option, /// Name of the MCP server to remove pub name: String, } @@ -10259,6 +10323,9 @@ pub struct Model { /// Informational notices the service published for this model, such as an upcoming change or a recommended alternative. Present only when the service published at least one notice. Hosts should surface these without implying anything is wrong with the model. #[serde(skip_serializing_if = "Option::is_none")] pub info_messages: Option>, + /// Provider-supplied model metadata. Keys and JSON-compatible values are preserved unchanged. This is factual metadata published by the model provider; it carries no picker or UX semantics. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, /// Model capability category for grouping in the model picker #[serde(skip_serializing_if = "Option::is_none")] pub model_picker_category: Option, @@ -10538,6 +10605,51 @@ pub struct ModelsListRequest { pub selection_id: Option, } +/// An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ModelSwitchAutoTierRequest { + /// Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. + pub auto_tier: Option, + /// Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, +} + +/// Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ModelSwitchAutoTierResult { + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub activating_auto_tier: Option, + /// Auto preference currently committed for the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_auto_tier: Option, + /// Latest unclaimed Auto preference waiting for a future user turn. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_auto_tier: Option, + /// Immediate request status. `pending` means accepted but not committed. + pub status: ModelSwitchAutoTierStatus, + /// Earlier unclaimed preference replaced by this request. This can be present with either status, including when selecting the effective preference cancels pending work. + #[serde(skip_serializing_if = "Option::is_none")] + pub superseded_auto_tier: Option, +} + /// ///
/// @@ -10567,6 +10679,9 @@ pub struct ModelSwitchConfirmation { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ModelSwitchToRequest { + /// Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_tier: Option, /// Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary. #[serde(skip_serializing_if = "Option::is_none")] pub compaction_decision: Option, @@ -10636,6 +10751,9 @@ pub struct ModelSwitchToResult { /// Currently active model identifier after the switch #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_state: Option, /// Persistence failure encountered after applying the model switch. #[serde(skip_serializing_if = "Option::is_none")] pub persistence_error: Option, @@ -14850,6 +14968,9 @@ pub struct SandboxConfig { /// Whether to auto-add the current working directory to readwritePaths. Default: true. #[serde(skip_serializing_if = "Option::is_none")] pub add_current_working_directory: Option, + /// Whether the agent may request that an individual command run outside the sandbox, which the host then approves or denies through the usual permission flow. A host capability flag rather than part of the policy: it is stripped from the effective spawn policy and only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this object: omitting it offers no bypass. Default: false (opt-in). + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_bypass: Option, /// Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out). #[serde(skip_serializing_if = "Option::is_none")] pub allow_dev_tool_access: Option, @@ -14858,6 +14979,20 @@ pub struct SandboxConfig { pub auth: Option, /// Whether sandboxing is enabled for the session. pub enabled: bool, + /// The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`. + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) managed_lsp_routing_locked: Option, + /// Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at the administrator instead of a setting the next managed merge would override, and it is ignored when comparing two configs for change. Only the managed merge may set it; a caller-supplied value is stripped. + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) managed_mcp_routing_locked: Option, + /// Whether language servers the session launches are confined by the sandbox. Only an explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + #[serde(skip_serializing_if = "Option::is_none")] + pub sandbox_lsp_servers: Option, + /// Whether MCP servers the session launches are confined by the sandbox. Only an explicit `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and `enabled` are always read together. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + #[serde(skip_serializing_if = "Option::is_none")] + pub sandbox_mcp_servers: Option, /// User-managed sandbox policy fragment merged into the auto-discovered base policy. #[serde(skip_serializing_if = "Option::is_none")] pub user_policy: Option, @@ -16817,6 +16952,9 @@ pub struct SessionOpenOptions { /// Whether ask_user is explicitly disabled. #[serde(skip_serializing_if = "Option::is_none")] pub ask_user_disabled: Option, + /// OAuth Client ID Metadata Document URL used by this host for MCP authorization. + #[serde(skip_serializing_if = "Option::is_none")] + pub auth_client_id_metadata_url: Option, /// Initial authentication info for the session. #[serde(skip_serializing_if = "Option::is_none")] pub auth_info: Option, @@ -19363,6 +19501,199 @@ pub struct TaskAgentProgress { pub r#type: TaskAgentProgressType, } +/// Public owner attribution for a client-owned task. Identifiers are opaque and never authorize requests. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientOwner { + /// ISO 8601 timestamp when the bound join disconnected + #[serde(skip_serializing_if = "Option::is_none")] + pub disconnected_at: Option, + /// Display-only owner name + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option, + /// Opaque identity of the currently or most recently bound session join + pub join_id: String, + /// Class of the task owner + pub kind: TaskClientOwnerKind, + /// Opaque session-scoped participant identity + pub participant_id: String, + /// Whether this task's bound join is currently connected + pub presence: TaskClientOwnerPresence, + /// Display-only owner source + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, +} + +/// Tracked client-owned task metadata. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientInfo { + /// ISO 8601 timestamp when the current active segment started + #[serde(skip_serializing_if = "Option::is_none")] + pub active_started_at: Option, + /// Accumulated active execution time in milliseconds + pub active_time_ms: i64, + /// Whether the currently bound owner can receive a cancellation request + pub can_cancel: bool, + /// Human-readable reason for terminal cancellation + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option, + /// Owner-scoped registration and reclaim key + pub client_task_id: String, + /// ISO 8601 timestamp when the task reached a terminal status + #[serde(skip_serializing_if = "Option::is_none")] + pub completed_at: Option, + /// Task description + pub description: String, + /// Optional task display name + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option, + /// Human-readable terminal failure message + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Optional owner-supplied terminal failure code + #[serde(skip_serializing_if = "Option::is_none")] + pub error_code: Option, + /// Execution mode, which is always background for client-owned tasks + pub execution_mode: TaskClientExecutionMode, + /// Canonical runtime-generated task identifier + pub id: String, + /// ISO 8601 timestamp when the connected owner entered idle status + #[serde(skip_serializing_if = "Option::is_none")] + pub idle_since: Option, + /// ISO 8601 timestamp of the most recent orphan transition + #[serde(skip_serializing_if = "Option::is_none")] + pub orphaned_at: Option, + /// Public attribution and presence for the task owner + pub owner: TaskClientOwner, + /// ISO 8601 timestamp of the most recent successful reclaim + #[serde(skip_serializing_if = "Option::is_none")] + pub reclaimed_at: Option, + /// Opaque successful terminal result supplied by the task owner + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option, + /// Sequence number of the latest accepted owner update + pub sequence: i64, + /// ISO 8601 timestamp when the task started + pub started_at: String, + /// Client task lifecycle status + pub status: TaskClientStatus, + /// Task kind + pub r#type: TaskClientType, + /// ISO 8601 timestamp of the latest accepted lifecycle change + pub updated_at: String, +} + +/// Generic progress for a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientProgress { + /// Most recent nonempty progress message + #[serde(skip_serializing_if = "Option::is_none")] + pub last_message: Option, + /// Current completion percentage from zero through one hundred + #[serde(skip_serializing_if = "Option::is_none")] + pub percentage: Option, + /// Current owner-defined progress phase + #[serde(skip_serializing_if = "Option::is_none")] + pub phase: Option, + /// Recent server-timestamped progress messages + pub recent_activity: Vec, + /// Sequence number of the latest accepted owner update + pub sequence: i64, + /// Current client task lifecycle status + pub status: TaskClientStatus, + /// Progress kind + pub r#type: TaskClientType, + /// ISO 8601 timestamp of the latest accepted lifecycle change + pub updated_at: String, +} + +/// Publishes nonterminal progress for a running or idle client task. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientUpdateProgress { + /// Client task update variant discriminator. + pub kind: TaskClientUpdateProgressKind, + /// Optional progress message appended to recent activity when nonempty + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + /// Optional completion percentage; null clears the current percentage + #[serde(skip_serializing_if = "Option::is_none")] + pub percentage: Option, + /// Optional progress phase; null clears the current phase + #[serde(skip_serializing_if = "Option::is_none")] + pub phase: Option, + /// Optional active status transition + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +/// Reports successful terminal completion. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientUpdateCompleted { + /// Client task update variant discriminator. + pub kind: TaskClientUpdateCompletedKind, + /// Optional final progress message + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + /// Optional opaque successful terminal result + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option, +} + +/// Reports terminal failure. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientUpdateFailed { + /// Optional owner-supplied terminal failure code + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, + /// Human-readable terminal failure message + pub error: String, + /// Client task update variant discriminator. + pub kind: TaskClientUpdateFailedKind, + /// Optional final progress message + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, +} + +/// Reports terminal cancellation after external work stopped. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientUpdateCancelled { + /// Client task update variant discriminator. + pub kind: TaskClientUpdateCancelledKind, + /// Optional final progress message + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + /// Optional human-readable cancellation reason + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, +} + /// Task completion notification with summary from the agent /// ///
@@ -19511,7 +19842,7 @@ pub struct TasksGetProgressRequest { #[serde(rename_all = "camelCase")] pub struct TasksGetProgressResult { /// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. - pub progress: Option, + pub progress: serde_json::Value, } /// Tracked shell task metadata, including ID, command, status, timing, attachment/execution mode, log path, and PID. @@ -19634,6 +19965,52 @@ pub struct TasksPromoteToBackgroundResult { #[serde(rename_all = "camelCase")] pub struct TasksRefreshResult {} +/// Registers or reclaims a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TasksRegisterRequest { + /// Whether the owner supports runtime cancellation requests + pub cancellable: bool, + /// Owner-scoped idempotency key used for registration and reclaim + pub client_task_id: String, + /// Human-readable description of the external work + pub description: String, + /// Optional short display name for the external work + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option, + /// Expected current sequence for idempotent registration or orphan reclaim + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_sequence: Option, + /// Task kind + pub r#type: TaskClientType, +} + +/// Result of registering or reclaiming a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TasksRegisterResult { + /// True only when this invocation created a new task + pub created: bool, + /// True only when this invocation reclaimed an orphaned task + pub reclaimed: bool, + /// Authoritative registered or reclaimed task + pub task: TaskClientInfo, +} + /// Identifier of the completed or cancelled task to remove from tracking. /// ///
@@ -19742,6 +20119,44 @@ pub struct TasksStartAgentResult { pub agent_id: String, } +/// Updates a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TasksUpdateRequest { + /// Canonical runtime-generated task identifier + pub id: String, + /// Owner update sequence to apply + pub sequence: i64, + /// Progress or terminal update payload + pub update: TaskClientUpdate, +} + +/// Result of publishing a client-owned task update. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TasksUpdateResult { + /// Whether this invocation changed task state + pub applied: bool, + /// Whether this invocation repeated the latest accepted update + pub duplicate: bool, + /// Authoritative task after processing the update + pub task: TaskClientInfo, +} + /// Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS). /// ///
@@ -22972,7 +23387,7 @@ pub struct SessionModelGetCurrentParams { pub session_id: SessionId, } -/// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. +/// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. /// ///
/// @@ -22983,12 +23398,21 @@ pub struct SessionModelGetCurrentParams { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionModelGetCurrentResult { + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub activating_auto_tier: Option, + /// Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_tier: Option, /// Context tier for models that support multiple context-window sizes. #[serde(skip_serializing_if = "Option::is_none")] pub context_tier: Option, /// Currently active model identifier #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_auto_tier: Option, /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_effort: Option, @@ -23020,6 +23444,9 @@ pub struct SessionModelSwitchToResult { /// Currently active model identifier after the switch #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_state: Option, /// Persistence failure encountered after applying the model switch. #[serde(skip_serializing_if = "Option::is_none")] pub persistence_error: Option, @@ -23031,6 +23458,33 @@ pub struct SessionModelSwitchToResult { pub warning: Option, } +/// Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionModelSwitchAutoTierResult { + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub activating_auto_tier: Option, + /// Auto preference currently committed for the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_auto_tier: Option, + /// Latest unclaimed Auto preference waiting for a future user turn. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_auto_tier: Option, + /// Immediate request status. `pending` means accepted but not committed. + pub status: ModelSwitchAutoTierStatus, + /// Earlier unclaimed preference replaced by this request. This can be present with either status, including when selecting the effective preference cancels pending work. + #[serde(skip_serializing_if = "Option::is_none")] + pub superseded_auto_tier: Option, +} + /// The model identifier active on the session after the switch. /// ///
@@ -23057,6 +23511,9 @@ pub struct SessionModelApplyStartupOverlayResult { /// Currently active model identifier after the switch #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_state: Option, /// Persistence failure encountered after applying the model switch. #[serde(skip_serializing_if = "Option::is_none")] pub persistence_error: Option, @@ -24136,6 +24593,44 @@ pub struct SessionTasksListResult { pub tasks: Vec, } +/// Result of registering or reclaiming a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionTasksRegisterResult { + /// True only when this invocation created a new task + pub created: bool, + /// True only when this invocation reclaimed an orphaned task + pub reclaimed: bool, + /// Authoritative registered or reclaimed task + pub task: TaskClientInfo, +} + +/// Result of publishing a client-owned task update. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionTasksUpdateResult { + /// Whether this invocation changed task state + pub applied: bool, + /// Whether this invocation repeated the latest accepted update + pub duplicate: bool, + /// Authoritative task after processing the update + pub task: TaskClientInfo, +} + /// Identifies the target session. /// ///
@@ -24202,7 +24697,7 @@ pub struct SessionTasksWaitForPendingResult {} #[serde(rename_all = "camelCase")] pub struct SessionTasksGetProgressResult { /// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. - pub progress: Option, + pub progress: serde_json::Value, } /// Identifies the target session. @@ -28888,6 +29383,28 @@ pub enum CatalogUnavailableTransportReason { Unknown, } +/// Why the runtime requests client-task cancellation. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ClientTaskCancelReason { + /// A caller requested task cancellation. + #[serde(rename = "cancel_requested")] + CancelRequested, + /// The session is shutting down. + #[serde(rename = "session_shutdown")] + SessionShutdown, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Optional completion hint for the input (e.g. 'directory' for filesystem path completion) /// ///
@@ -28993,6 +29510,31 @@ pub enum ConnectedRemoteSessionMetadataKind { Unknown, } +/// Closed set of public task kinds a connection can negotiate. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskKind { + /// Runtime-owned background agent task. + #[serde(rename = "agent")] + Agent, + /// Runtime-owned shell task. + #[serde(rename = "shell")] + Shell, + /// Client-owned externally executed task. + #[serde(rename = "client")] + Client, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Controls how MCP tool result content is filtered: none leaves content unchanged, markdown sanitizes HTML while preserving Markdown-friendly output, and hidden_characters removes characters that can hide directives. /// ///
@@ -31211,6 +31753,28 @@ pub enum ModelPolicyState { Unknown, } +/// Whether the requested preference was already effective or was accepted for later transactional activation. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ModelSwitchAutoTierStatus { + /// The requested preference is already effective. No activation is pending for it, although this request may have cancelled an earlier unclaimed preference reported in `supersededAutoTier`. + #[serde(rename = "unchanged")] + Unchanged, + /// The request was accepted but has not committed. A later user turn using the `auto` model must mint and validate the replacement before it becomes effective. + #[serde(rename = "pending")] + Pending, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Provider transport. Defaults to "http". /// ///
@@ -33574,6 +34138,191 @@ pub enum TaskAgentProgressType { Agent, } +/// Active status a client owner may publish with a progress update. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientActiveStatus { + /// The external owner is actively working. + #[serde(rename = "running")] + Running, + /// The external owner is connected but waiting. + #[serde(rename = "idle")] + Idle, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Client-owned tasks always execute outside the runtime in background mode. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientExecutionMode { + #[serde(rename = "background")] + Background, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Connection class owning a client task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientOwnerKind { + /// A discovered extension connection owns the task. + #[serde(rename = "extension")] + Extension, + /// A generic SDK connection owns the task. + #[serde(rename = "sdk")] + Sdk, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Presence of the task's bound join. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientOwnerPresence { + /// The bound session join is connected. + #[serde(rename = "connected")] + Connected, + /// The bound session join is disconnected. + #[serde(rename = "disconnected")] + Disconnected, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Lifecycle status of a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientStatus { + /// The external owner is actively working. + #[serde(rename = "running")] + Running, + /// The external owner is connected but waiting. + #[serde(rename = "idle")] + Idle, + /// The owner reported successful completion. + #[serde(rename = "completed")] + Completed, + /// The owner reported failure. + #[serde(rename = "failed")] + Failed, + /// The owner reported or confirmed cancellation. + #[serde(rename = "cancelled")] + Cancelled, + /// The bound owner join disappeared; external executor state is unknown. + #[serde(rename = "orphaned")] + Orphaned, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Discriminator for a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientType { + #[serde(rename = "client")] + Client, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Client task update variant discriminator. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientUpdateProgressKind { + #[serde(rename = "progress")] + #[default] + Progress, +} + +/// Client task update variant discriminator. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientUpdateCompletedKind { + #[serde(rename = "completed")] + #[default] + Completed, +} + +/// Client task update variant discriminator. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientUpdateFailedKind { + #[serde(rename = "failed")] + #[default] + Failed, +} + +/// Client task update variant discriminator. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientUpdateCancelledKind { + #[serde(rename = "cancelled")] + #[default] + Cancelled, +} + +/// Progress or terminal update for a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TaskClientUpdate { + Progress(TaskClientUpdateProgress), + Completed(TaskClientUpdateCompleted), + Failed(TaskClientUpdateFailed), + Cancelled(TaskClientUpdateCancelled), +} + /// Whether the shell runs inside a managed PTY session or as an independent background process /// ///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 14b77f6254..9dd8f9e58b 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -7454,13 +7454,13 @@ pub struct SessionRpcModel<'a> { } impl<'a> SessionRpcModel<'a> { - /// Gets the currently selected model for the session. + /// Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn. /// /// Wire method: `session.model.getCurrent`. /// /// # Returns /// - /// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + /// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. /// ///
/// @@ -7512,6 +7512,39 @@ impl<'a> SessionRpcModel<'a> { Ok(serde_json::from_value(_value)?) } + /// Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`. + /// + /// Wire method: `session.model.switchAutoTier`. + /// + /// # Parameters + /// + /// * `params` - An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. + /// + /// # Returns + /// + /// Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn switch_auto_tier( + &self, + params: ModelSwitchAutoTierRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_MODEL_SWITCHAUTOTIER, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Resolves and applies organization-managed and repository model overlays. /// /// Wire method: `session.model.applyStartupOverlay`. @@ -10263,6 +10296,69 @@ impl<'a> SessionRpcTasks<'a> { Ok(serde_json::from_value(_value)?) } + /// Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal. + /// + /// Wire method: `session.tasks.register`. + /// + /// # Parameters + /// + /// * `params` - Registers or reclaims a client-owned task. + /// + /// # Returns + /// + /// Result of registering or reclaiming a client-owned task. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn register( + &self, + params: TasksRegisterRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_TASKS_REGISTER, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Publishes generic progress or a terminal outcome for a client-owned task. + /// + /// Wire method: `session.tasks.update`. + /// + /// # Parameters + /// + /// * `params` - Updates a client-owned task. + /// + /// # Returns + /// + /// Result of publishing a client-owned task update. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn update(&self, params: TasksUpdateRequest) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_TASKS_UPDATE, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Refreshes metadata for any detached background shells the runtime knows about. /// /// Wire method: `session.tasks.refresh`. diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index eb63f11438..fff10bd697 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -37,6 +37,8 @@ pub enum SessionEventType { SessionWarning, #[serde(rename = "session.model_change")] SessionModelChange, + #[serde(rename = "session.auto_tier_switch_failed")] + SessionAutoTierSwitchFailed, #[serde(rename = "session.mode_changed")] SessionModeChanged, #[serde(rename = "session.mode_notice_delivered")] @@ -379,6 +381,10 @@ pub enum SessionEventType { SessionMcpServersLoaded, #[serde(rename = "session.mcp_server_status_changed")] SessionMcpServerStatusChanged, + #[serde(rename = "session.mcp_server_removed")] + SessionMcpServerRemoved, + #[serde(rename = "session.mcp_server_needs_reconnect")] + SessionMcpServerNeedsReconnect, #[serde(rename = "mcp.tools.list_changed")] McpToolsListChanged, #[serde(rename = "mcp.resources.list_changed")] @@ -483,6 +489,8 @@ pub enum SessionEventData { SessionWarning(SessionWarningData), #[serde(rename = "session.model_change")] SessionModelChange(SessionModelChangeData), + #[serde(rename = "session.auto_tier_switch_failed")] + SessionAutoTierSwitchFailed(SessionAutoTierSwitchFailedData), #[serde(rename = "session.mode_changed")] SessionModeChanged(SessionModeChangedData), #[serde(rename = "session.mode_notice_delivered")] @@ -818,6 +826,10 @@ pub enum SessionEventData { SessionMcpServersLoaded(SessionMcpServersLoadedData), #[serde(rename = "session.mcp_server_status_changed")] SessionMcpServerStatusChanged(SessionMcpServerStatusChangedData), + #[serde(rename = "session.mcp_server_removed")] + SessionMcpServerRemoved(SessionMcpServerRemovedData), + #[serde(rename = "session.mcp_server_needs_reconnect")] + SessionMcpServerNeedsReconnect(SessionMcpServerNeedsReconnectData), #[serde(rename = "mcp.tools.list_changed")] McpToolsListChanged(McpToolsListChangedData), #[serde(rename = "mcp.resources.list_changed")] @@ -1231,6 +1243,9 @@ pub struct SessionWarningData { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionModelChangeData { + /// Committed Auto preference after the model configuration change, when applicable. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_tier: Option, /// Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. #[serde(skip_serializing_if = "Option::is_none")] pub cause: Option, @@ -1239,6 +1254,9 @@ pub struct SessionModelChangeData { pub context_tier: Option, /// Newly selected model identifier pub new_model: String, + /// Previously committed Auto preference, when one was explicitly selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub previous_auto_tier: Option, /// Model that was previously selected, if any #[serde(skip_serializing_if = "Option::is_none")] pub previous_model: Option, @@ -1265,6 +1283,19 @@ pub struct SessionModelChangeData { pub verbosity: Option, } +/// Session event "session.auto_tier_switch_failed". A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionAutoTierSwitchFailedData { + /// Auto preference that remains effective after the failed request. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_auto_tier: Option, + /// Low-cardinality failure outcome reported by Auto resolution. + pub reason: AutoTierSwitchFailureReason, + /// Auto preference that failed to activate, or null when returning to provider-default routing failed. + pub requested_auto_tier: Option, +} + /// Session event "session.mode_changed". Agent mode change details including previous and new modes #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -6238,6 +6269,22 @@ pub struct SessionMcpServerStatusChangedData { pub status: McpServerStatus, } +/// Session event "session.mcp_server_removed". Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionMcpServerRemovedData { + /// Name of the MCP server that was removed from the graph + pub server_name: String, +} + +/// Session event "session.mcp_server_needs_reconnect". Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionMcpServerNeedsReconnectData { + /// Name of the MCP server that needs to reconnect + pub server_name: String, +} + /// Session event "mcp.tools.list_changed". Payload identifying the MCP server associated with a list change. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -6733,6 +6780,27 @@ pub enum ModelChangeSource { Unknown, } +/// Terminal reason an Auto preference activation failed. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum AutoTierSwitchFailureReason { + /// The candidate model was rejected by model policy. + #[serde(rename = "policy_rejected")] + PolicyRejected, + /// The Auto routing request failed or returned an unusable response. + #[serde(rename = "request_failed")] + RequestFailed, + /// The runtime could not prepare the Auto routing request. + #[serde(rename = "setup_failed")] + SetupFailed, + /// The provider does not support Auto routing. + #[serde(rename = "unsupported")] + Unsupported, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Permission mode for the session. /// ///
From 9bfebada20f4178ef8740fd8b1824d77e725f802 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 18:10:43 +0000 Subject: [PATCH 10/14] Update Copilot CLI to 1.0.83-4 Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com> --- dotnet/src/Generated/Rpc.cs | 1312 +- dotnet/src/Generated/SessionEvents.cs | 158 + go/rpc/zrpc.go | 630 +- go/rpc/zrpc_encoding.go | 155 + go/rpc/zsession_encoding.go | 18 + go/rpc/zsession_events.go | 58 + go/zsession_events.go | 11 + java/pom.xml | 2 +- java/scripts/codegen/package-lock.json | 72 +- java/scripts/codegen/package.json | 2 +- .../AutoTierSwitchFailureReason.java | 39 + .../SessionAutoTierSwitchFailedEvent.java | 45 + .../copilot/generated/SessionEvent.java | 6 + .../SessionMcpServerNeedsReconnectEvent.java | 41 + .../SessionMcpServerRemovedEvent.java | 41 + .../generated/SessionModelChangeEvent.java | 6 +- .../generated/rpc/CapiSessionOptions.java | 2 +- .../generated/rpc/ClientTaskCancelReason.java | 35 + .../copilot/generated/rpc/ConnectParams.java | 3 + .../copilot/generated/rpc/ConnectResult.java | 5 +- .../copilot/generated/rpc/CurrentModel.java | 37 + .../generated/rpc/McpConfigRemoveParams.java | 4 +- .../github/copilot/generated/rpc/Model.java | 3 + .../rpc/ModelSwitchAutoTierStatus.java | 35 + .../copilot/generated/rpc/SandboxConfig.java | 10 + .../rpc/ServerManagedSettingsApi.java | 11 + .../generated/rpc/SessionModelApi.java | 16 + ...SessionModelApplyStartupOverlayResult.java | 4 +- .../rpc/SessionModelGetCurrentResult.java | 10 +- .../rpc/SessionModelSwitchAutoTierParams.java | 34 + .../rpc/SessionModelSwitchAutoTierResult.java | 38 + .../rpc/SessionModelSwitchToParams.java | 2 + .../rpc/SessionModelSwitchToResult.java | 4 +- .../generated/rpc/SessionOpenOptions.java | 2 + .../generated/rpc/SessionTasksApi.java | 32 + .../rpc/SessionTasksRegisterParams.java | 42 + .../rpc/SessionTasksRegisterResult.java | 34 + .../rpc/SessionTasksUpdateParams.java | 36 + .../rpc/SessionTasksUpdateResult.java | 34 + .../rpc/TaskClientExecutionMode.java | 33 + .../copilot/generated/rpc/TaskClientInfo.java | 70 + .../generated/rpc/TaskClientOwner.java | 40 + .../generated/rpc/TaskClientOwnerKind.java | 35 + .../rpc/TaskClientOwnerPresence.java | 35 + .../generated/rpc/TaskClientStatus.java | 43 + .../copilot/generated/rpc/TaskClientType.java | 33 + .../copilot/generated/rpc/TaskKind.java | 37 + .../generated/rpc/TasksCancelParams.java | 38 + .../generated/rpc/TasksCancelResult.java | 30 + nodejs/package.json | 2 +- nodejs/src/cliVersion.ts | 2 +- nodejs/src/generated/rpc.ts | 27021 ++++++++-------- nodejs/src/generated/session-events.ts | 18666 +++++------ python/copilot/generated/rpc.py | 1078 +- python/copilot/generated/session_events.py | 100 +- rust/src/generated/api_types.rs | 759 +- rust/src/generated/rpc.rs | 100 +- rust/src/generated/session_events.rs | 68 + 58 files changed, 28872 insertions(+), 22347 deletions(-) create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/AutoTierSwitchFailureReason.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierSwitchFailedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerNeedsReconnectEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerRemovedEvent.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientTaskCancelReason.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/CurrentModel.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/ModelSwitchAutoTierStatus.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateResult.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientExecutionMode.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientInfo.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwner.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerKind.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerPresence.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientStatus.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientType.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskKind.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelParams.java create mode 100644 java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelResult.java diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index c05bada39e..d65aa4f1b8 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -56,6 +56,10 @@ internal sealed class ConnectResult [JsonPropertyName("protocolVersion")] public long ProtocolVersion { get; set; } + /// Task kinds the server may return to this connection. + [JsonPropertyName("taskKinds")] + public IList? TaskKinds { get; set; } + /// Server package version. [JsonPropertyName("version")] public string Version { get; set; } = string.Empty; @@ -94,6 +98,10 @@ internal sealed class ConnectRequest [JsonPropertyName("enableGitHubTelemetryForwarding")] public bool? EnableGitHubTelemetryForwarding { get; set; } + /// Task kinds this connection can decode when observing session tasks. Omit to retain agent and shell compatibility. + [JsonPropertyName("supportedTaskKinds")] + public IList? SupportedTaskKinds { get; set; } + /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN. [JsonPropertyName("token")] public string? Token { get; set; } @@ -433,6 +441,10 @@ public sealed class Model [JsonPropertyName("infoMessages")] public IList? InfoMessages { get; set; } + /// Provider-supplied model metadata. Keys and JSON-compatible values are preserved unchanged. This is factual metadata published by the model provider; it carries no picker or UX semantics. + [JsonPropertyName("metadata")] + public IDictionary? Metadata { get; set; } + /// Model capability category for grouping in the model picker. [JsonPropertyName("modelPickerCategory")] public ModelPickerCategory? ModelPickerCategory { get; set; } @@ -2231,6 +2243,10 @@ internal sealed class McpConfigUpdateRequest [Experimental(Diagnostics.Experimental)] internal sealed class McpConfigRemoveRequest { + /// OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. + [JsonPropertyName("authClientIdMetadataUrl")] + public string? AuthClientIdMetadataUrl { get; set; } + /// Name of the MCP server to remove. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] @@ -7357,10 +7373,18 @@ internal sealed class FactoryJournalPutRequest public string SessionId { get; set; } = string.Empty; } -/// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. +/// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. [Experimental(Diagnostics.Experimental)] public sealed class CurrentModel { + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + [JsonPropertyName("activatingAutoTier")] + public AutoTier? ActivatingAutoTier { get; set; } + + /// Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it. + [JsonPropertyName("autoTier")] + public AutoTier? AutoTier { get; set; } + /// Context tier for models that support multiple context-window sizes. [JsonPropertyName("contextTier")] public ContextTier? ContextTier { get; set; } @@ -7369,6 +7393,10 @@ public sealed class CurrentModel [JsonPropertyName("modelId")] public string? ModelId { get; set; } + /// Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. + [JsonPropertyName("pendingAutoTier")] + public AutoTier? PendingAutoTier { get; set; } + /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. [JsonPropertyName("reasoningEffort")] public string? ReasoningEffort { get; set; } @@ -7424,6 +7452,10 @@ public sealed class ModelSwitchToResult [JsonPropertyName("modelId")] public string? ModelId { get; set; } + /// Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. + [JsonPropertyName("modelState")] + public CurrentModel? ModelState { get; set; } + /// Persistence failure encountered after applying the model switch. [JsonPropertyName("persistenceError")] public string? PersistenceError { get; set; } @@ -7548,6 +7580,10 @@ public sealed class ModelPickerPersistenceRequest [Experimental(Diagnostics.Experimental)] internal sealed class ModelSwitchToRequest { + /// Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`. + [JsonPropertyName("autoTier")] + public AutoTier? AutoTier { get; set; } + /// Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary. [JsonPropertyName("compactionDecision")] public string? CompactionDecision { get; set; } @@ -7609,6 +7645,48 @@ internal sealed class ModelSwitchToRequest public Verbosity? Verbosity { get; set; } } +/// Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. +[Experimental(Diagnostics.Experimental)] +public sealed class ModelSwitchAutoTierResult +{ + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + [JsonPropertyName("activatingAutoTier")] + public AutoTier? ActivatingAutoTier { get; set; } + + /// Auto preference currently committed for the session. + [JsonPropertyName("effectiveAutoTier")] + public AutoTier? EffectiveAutoTier { get; set; } + + /// Latest unclaimed Auto preference waiting for a future user turn. + [JsonPropertyName("pendingAutoTier")] + public AutoTier? PendingAutoTier { get; set; } + + /// Immediate request status. `pending` means accepted but not committed. + [JsonPropertyName("status")] + public ModelSwitchAutoTierStatus Status { get; set; } + + /// Earlier unclaimed preference replaced by this request. This can be present with either status, including when selecting the effective preference cancels pending work. + [JsonPropertyName("supersededAutoTier")] + public AutoTier? SupersededAutoTier { get; set; } +} + +/// An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. +[Experimental(Diagnostics.Experimental)] +internal sealed class ModelSwitchAutoTierRequest +{ + /// Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. + [JsonPropertyName("autoTier")] + public AutoTier? AutoTier { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. + [JsonPropertyName("source")] + public ModelChangeSource? Source { get; set; } +} + /// Managed, repository, and CLI model overrides to overlay onto the session at startup. [Experimental(Diagnostics.Experimental)] internal sealed class ModelApplyStartupOverlayRequest @@ -8753,13 +8831,14 @@ internal sealed class TasksStartAgentRequest public string SessionId { get; set; } = string.Empty; } -/// Tracked task union returned by task APIs, containing either an agent task or a shell task. +/// Tracked task union returned by task APIs, containing an agent, client, or shell task. /// Polymorphic base type discriminated by type. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(TaskInfoAgent), "agent")] +[JsonDerivedType(typeof(TaskInfoClient), "client")] [JsonDerivedType(typeof(TaskInfoShell), "shell")] public partial class TaskInfo { @@ -8868,6 +8947,143 @@ public partial class TaskInfoAgent : TaskInfo public required string ToolCallId { get; set; } } +/// Public owner attribution for a client-owned task. Identifiers are opaque and never authorize requests. +[Experimental(Diagnostics.Experimental)] +public sealed class TaskClientOwner +{ + /// ISO 8601 timestamp when the bound join disconnected. + [JsonPropertyName("disconnectedAt")] + public DateTimeOffset? DisconnectedAt { get; set; } + + /// Display-only owner name. + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// Opaque identity of the currently or most recently bound session join. + [JsonPropertyName("joinId")] + public string JoinId { get; set; } = string.Empty; + + /// Class of the task owner. + [JsonPropertyName("kind")] + public TaskClientOwnerKind Kind { get; set; } + + /// Opaque session-scoped participant identity. + [JsonPropertyName("participantId")] + public string ParticipantId { get; set; } = string.Empty; + + /// Whether this task's bound join is currently connected. + [JsonPropertyName("presence")] + public TaskClientOwnerPresence Presence { get; set; } + + /// Display-only owner source. + [JsonPropertyName("source")] + public string? Source { get; set; } +} + +/// Tracked client-owned task metadata. +/// The client variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskInfoClient : TaskInfo +{ + /// + [JsonIgnore] + public override string Type => "client"; + + /// ISO 8601 timestamp when the current active segment started. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("activeStartedAt")] + public DateTimeOffset? ActiveStartedAt { get; set; } + + /// Accumulated active execution time in milliseconds. + [JsonPropertyName("activeTimeMs")] + public required long ActiveTimeMs { get; set; } + + /// Whether the currently bound owner can receive a cancellation request. + [JsonPropertyName("canCancel")] + public required bool CanCancel { get; set; } + + /// Human-readable reason for terminal cancellation. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("cancellationReason")] + public string? CancellationReason { get; set; } + + /// Owner-scoped registration and reclaim key. + [JsonPropertyName("clientTaskId")] + public required string ClientTaskId { get; set; } + + /// ISO 8601 timestamp when the task reached a terminal status. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("completedAt")] + public DateTimeOffset? CompletedAt { get; set; } + + /// Task description. + [JsonPropertyName("description")] + public required string Description { get; set; } + + /// Optional task display name. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// Human-readable terminal failure message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("error")] + public string? Error { get; set; } + + /// Optional owner-supplied terminal failure code. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("errorCode")] + public string? ErrorCode { get; set; } + + /// Execution mode, which is always background for client-owned tasks. + [JsonPropertyName("executionMode")] + public required TaskClientExecutionMode ExecutionMode { get; set; } + + /// Canonical runtime-generated task identifier. + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// ISO 8601 timestamp when the connected owner entered idle status. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("idleSince")] + public DateTimeOffset? IdleSince { get; set; } + + /// ISO 8601 timestamp of the most recent orphan transition. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("orphanedAt")] + public DateTimeOffset? OrphanedAt { get; set; } + + /// Public attribution and presence for the task owner. + [JsonPropertyName("owner")] + public required TaskClientOwner Owner { get; set; } + + /// ISO 8601 timestamp of the most recent successful reclaim. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("reclaimedAt")] + public DateTimeOffset? ReclaimedAt { get; set; } + + /// Opaque successful terminal result supplied by the task owner. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("result")] + public JsonElement? Result { get; set; } + + /// Sequence number of the latest accepted owner update. + [JsonPropertyName("sequence")] + public required long Sequence { get; set; } + + /// ISO 8601 timestamp when the task started. + [JsonPropertyName("startedAt")] + public required DateTimeOffset StartedAt { get; set; } + + /// Client task lifecycle status. + [JsonPropertyName("status")] + public required TaskClientStatus Status { get; set; } + + /// ISO 8601 timestamp of the latest accepted lifecycle change. + [JsonPropertyName("updatedAt")] + public required DateTimeOffset UpdatedAt { get; set; } +} + /// Tracked shell task metadata, including ID, command, status, timing, attachment/execution mode, log path, and PID. /// The shell variant of . [Experimental(Diagnostics.Experimental)] @@ -8945,6 +9161,299 @@ internal sealed class SessionTasksListRequest public string SessionId { get; set; } = string.Empty; } +/// Tracked client-owned task metadata. +[Experimental(Diagnostics.Experimental)] +public sealed class TaskClientInfo +{ + /// ISO 8601 timestamp when the current active segment started. + [JsonPropertyName("activeStartedAt")] + public DateTimeOffset? ActiveStartedAt { get; set; } + + /// Accumulated active execution time in milliseconds. + [JsonPropertyName("activeTimeMs")] + public long ActiveTimeMs { get; set; } + + /// Whether the currently bound owner can receive a cancellation request. + [JsonPropertyName("canCancel")] + public bool CanCancel { get; set; } + + /// Human-readable reason for terminal cancellation. + [JsonPropertyName("cancellationReason")] + public string? CancellationReason { get; set; } + + /// Owner-scoped registration and reclaim key. + [JsonPropertyName("clientTaskId")] + public string ClientTaskId { get; set; } = string.Empty; + + /// ISO 8601 timestamp when the task reached a terminal status. + [JsonPropertyName("completedAt")] + public DateTimeOffset? CompletedAt { get; set; } + + /// Task description. + [JsonPropertyName("description")] + public string Description { get; set; } = string.Empty; + + /// Optional task display name. + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// Human-readable terminal failure message. + [JsonPropertyName("error")] + public string? Error { get; set; } + + /// Optional owner-supplied terminal failure code. + [JsonPropertyName("errorCode")] + public string? ErrorCode { get; set; } + + /// Execution mode, which is always background for client-owned tasks. + [JsonPropertyName("executionMode")] + public TaskClientExecutionMode ExecutionMode { get; set; } + + /// Canonical runtime-generated task identifier. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; + + /// ISO 8601 timestamp when the connected owner entered idle status. + [JsonPropertyName("idleSince")] + public DateTimeOffset? IdleSince { get; set; } + + /// ISO 8601 timestamp of the most recent orphan transition. + [JsonPropertyName("orphanedAt")] + public DateTimeOffset? OrphanedAt { get; set; } + + /// Public attribution and presence for the task owner. + [JsonPropertyName("owner")] + public TaskClientOwner Owner { get => field ??= new(); set; } + + /// ISO 8601 timestamp of the most recent successful reclaim. + [JsonPropertyName("reclaimedAt")] + public DateTimeOffset? ReclaimedAt { get; set; } + + /// Opaque successful terminal result supplied by the task owner. + [JsonPropertyName("result")] + public JsonElement? Result { get; set; } + + /// Sequence number of the latest accepted owner update. + [JsonPropertyName("sequence")] + public long Sequence { get; set; } + + /// ISO 8601 timestamp when the task started. + [JsonPropertyName("startedAt")] + public DateTimeOffset StartedAt { get; set; } + + /// Client task lifecycle status. + [JsonPropertyName("status")] + public TaskClientStatus Status { get; set; } + + /// Task kind. + [JsonPropertyName("type")] + public TaskClientType Type { get; set; } + + /// ISO 8601 timestamp of the latest accepted lifecycle change. + [JsonPropertyName("updatedAt")] + public DateTimeOffset UpdatedAt { get; set; } +} + +/// Result of registering or reclaiming a client-owned task. +[Experimental(Diagnostics.Experimental)] +public sealed class TasksRegisterResult +{ + /// True only when this invocation created a new task. + [JsonPropertyName("created")] + public bool Created { get; set; } + + /// True only when this invocation reclaimed an orphaned task. + [JsonPropertyName("reclaimed")] + public bool Reclaimed { get; set; } + + /// Authoritative registered or reclaimed task. + [JsonPropertyName("task")] + public TaskClientInfo Task { get => field ??= new(); set; } +} + +/// Registers or reclaims a client-owned task. +[Experimental(Diagnostics.Experimental)] +internal sealed class TasksRegisterRequest +{ + /// Whether the owner supports runtime cancellation requests. + [JsonPropertyName("cancellable")] + public bool Cancellable { get; set; } + + /// Owner-scoped idempotency key used for registration and reclaim. + [JsonPropertyName("clientTaskId")] + public string ClientTaskId { get; set; } = string.Empty; + + /// Human-readable description of the external work. + [JsonPropertyName("description")] + public string Description { get; set; } = string.Empty; + + /// Optional short display name for the external work. + [JsonPropertyName("displayName")] + public string? DisplayName { get; set; } + + /// Expected current sequence for idempotent registration or orphan reclaim. + [JsonPropertyName("expectedSequence")] + public long? ExpectedSequence { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// Task kind. + [JsonPropertyName("type")] + public TaskClientType Type { get; set; } +} + +/// Result of publishing a client-owned task update. +[Experimental(Diagnostics.Experimental)] +public sealed class TasksUpdateResult +{ + /// Whether this invocation changed task state. + [JsonPropertyName("applied")] + public bool Applied { get; set; } + + /// Whether this invocation repeated the latest accepted update. + [JsonPropertyName("duplicate")] + public bool Duplicate { get; set; } + + /// Authoritative task after processing the update. + [JsonPropertyName("task")] + public TaskClientInfo Task { get => field ??= new(); set; } +} + +/// Progress or terminal update for a client-owned task. +/// Polymorphic base type discriminated by kind. +[Experimental(Diagnostics.Experimental)] +[JsonPolymorphic( + TypeDiscriminatorPropertyName = "kind", + UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] +[JsonDerivedType(typeof(TaskClientUpdateProgress), "progress")] +[JsonDerivedType(typeof(TaskClientUpdateCompleted), "completed")] +[JsonDerivedType(typeof(TaskClientUpdateFailed), "failed")] +[JsonDerivedType(typeof(TaskClientUpdateCancelled), "cancelled")] +public partial class TaskClientUpdate +{ + /// The type discriminator. + [JsonPropertyName("kind")] + public virtual string Kind { get; set; } = string.Empty; +} + + +/// Publishes nonterminal progress for a running or idle client task. +/// The progress variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskClientUpdateProgress : TaskClientUpdate +{ + /// + [JsonIgnore] + public override string Kind => "progress"; + + /// Optional progress message appended to recent activity when nonempty. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Optional completion percentage; null clears the current percentage. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("percentage")] + public double? Percentage { get; set; } + + /// Optional progress phase; null clears the current phase. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("phase")] + public string? Phase { get; set; } + + /// Optional active status transition. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("status")] + public TaskClientActiveStatus? Status { get; set; } +} + +/// Reports successful terminal completion. +/// The completed variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskClientUpdateCompleted : TaskClientUpdate +{ + /// + [JsonIgnore] + public override string Kind => "completed"; + + /// Optional final progress message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Optional opaque successful terminal result. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("result")] + public JsonElement? Result { get; set; } +} + +/// Reports terminal failure. +/// The failed variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskClientUpdateFailed : TaskClientUpdate +{ + /// + [JsonIgnore] + public override string Kind => "failed"; + + /// Optional owner-supplied terminal failure code. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("code")] + public string? Code { get; set; } + + /// Human-readable terminal failure message. + [JsonPropertyName("error")] + public required string Error { get; set; } + + /// Optional final progress message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("message")] + public string? Message { get; set; } +} + +/// Reports terminal cancellation after external work stopped. +/// The cancelled variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskClientUpdateCancelled : TaskClientUpdate +{ + /// + [JsonIgnore] + public override string Kind => "cancelled"; + + /// Optional final progress message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// Optional human-readable cancellation reason. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("reason")] + public string? Reason { get; set; } +} + +/// Updates a client-owned task. +[Experimental(Diagnostics.Experimental)] +internal sealed class TasksUpdateRequest +{ + /// Canonical runtime-generated task identifier. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; + + /// Owner update sequence to apply. + [JsonPropertyName("sequence")] + public long Sequence { get; set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// Progress or terminal update payload. + [JsonPropertyName("update")] + public TaskClientUpdate Update { get => field ??= new(); set; } +} + /// Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop. [Experimental(Diagnostics.Experimental)] public sealed class TasksRefreshResult @@ -8975,13 +9484,16 @@ internal sealed class SessionTasksWaitForPendingRequest public string SessionId { get; set; } = string.Empty; } -/// Polymorphic base type discriminated by type. +/// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. +/// Polymorphic base type discriminated by type. +[Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] -[JsonDerivedType(typeof(TasksGetProgressResultProgressAgent), "agent")] -[JsonDerivedType(typeof(TasksGetProgressResultProgressShell), "shell")] -public partial class TasksGetProgressResultProgress +[JsonDerivedType(typeof(TaskProgressAgent), "agent")] +[JsonDerivedType(typeof(TaskProgressClient), "client")] +[JsonDerivedType(typeof(TaskProgressShell), "shell")] +public partial class TaskProgress { /// The type discriminator. [JsonPropertyName("type")] @@ -9003,8 +9515,9 @@ public sealed class TaskProgressLine } /// Progress snapshot for an agent task, with recent activity lines and optional latest intent. -/// The agent variant of . -public partial class TasksGetProgressResultProgressAgent : TasksGetProgressResultProgress +/// The agent variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskProgressAgent : TaskProgress { /// [JsonIgnore] @@ -9020,9 +9533,51 @@ public partial class TasksGetProgressResultProgressAgent : TasksGetProgressResul public required IList RecentActivity { get; set; } } +/// Generic progress for a client-owned task. +/// The client variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskProgressClient : TaskProgress +{ + /// + [JsonIgnore] + public override string Type => "client"; + + /// Most recent nonempty progress message. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("lastMessage")] + public string? LastMessage { get; set; } + + /// Current completion percentage from zero through one hundred. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("percentage")] + public double? Percentage { get; set; } + + /// Current owner-defined progress phase. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("phase")] + public string? Phase { get; set; } + + /// Recent server-timestamped progress messages. + [JsonPropertyName("recentActivity")] + public required IList RecentActivity { get; set; } + + /// Sequence number of the latest accepted owner update. + [JsonPropertyName("sequence")] + public required long Sequence { get; set; } + + /// Current client task lifecycle status. + [JsonPropertyName("status")] + public required TaskClientStatus Status { get; set; } + + /// ISO 8601 timestamp of the latest accepted lifecycle change. + [JsonPropertyName("updatedAt")] + public required DateTimeOffset UpdatedAt { get; set; } +} + /// Progress snapshot for a shell task, with recent stdout/stderr output and optional process ID. -/// The shell variant of . -public partial class TasksGetProgressResultProgressShell : TasksGetProgressResultProgress +/// The shell variant of . +[Experimental(Diagnostics.Experimental)] +public partial class TaskProgressShell : TaskProgress { /// [JsonIgnore] @@ -9044,7 +9599,7 @@ public sealed class TasksGetProgressResult { /// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. [JsonPropertyName("progress")] - public TasksGetProgressResultProgress? Progress { get; set; } + public TaskProgress? Progress { get; set; } } /// Identifier of the background task to fetch progress for. @@ -11113,7 +11668,7 @@ public sealed class OptionsUpdateAdditionalContentExclusionPolicy [Experimental(Diagnostics.Experimental)] public sealed class CapiSessionOptions { - /// Routing preference used when the session model is `auto`. The runtime persists the preference across cold resume. When omitted, the default routing behavior is used. Resuming an already-resident session cannot change its preference. + /// Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. [JsonPropertyName("autoTier")] public AutoTier? AutoTier { get; set; } @@ -11356,6 +11911,10 @@ public sealed class SandboxConfig [JsonPropertyName("addCurrentWorkingDirectory")] public bool? AddCurrentWorkingDirectory { get; set; } + /// Whether the agent may request that an individual command run outside the sandbox, which the host then approves or denies through the usual permission flow. A host capability flag rather than part of the policy: it is stripped from the effective spawn policy and only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this object: omitting it offers no bypass. Default: false (opt-in). + [JsonPropertyName("allowBypass")] + public bool? AllowBypass { get; set; } + /// Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out). [JsonPropertyName("allowDevToolAccess")] public bool? AllowDevToolAccess { get; set; } @@ -11368,6 +11927,24 @@ public sealed class SandboxConfig [JsonPropertyName("enabled")] public bool Enabled { get; set; } + /// The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`. + [JsonInclude] + [JsonPropertyName("managedLspRoutingLocked")] + internal bool? ManagedLspRoutingLocked { get; set; } + + /// Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at the administrator instead of a setting the next managed merge would override, and it is ignored when comparing two configs for change. Only the managed merge may set it; a caller-supplied value is stripped. + [JsonInclude] + [JsonPropertyName("managedMcpRoutingLocked")] + internal bool? ManagedMcpRoutingLocked { get; set; } + + /// Whether language servers the session launches are confined by the sandbox. Only an explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + [JsonPropertyName("sandboxLspServers")] + public bool? SandboxLspServers { get; set; } + + /// Whether MCP servers the session launches are confined by the sandbox. Only an explicit `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and `enabled` are always read together. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + [JsonPropertyName("sandboxMcpServers")] + public bool? SandboxMcpServers { get; set; } + /// User-managed sandbox policy fragment merged into the auto-discovered base policy. [JsonPropertyName("userPolicy")] public SandboxConfigUserPolicy? UserPolicy { get; set; } @@ -18088,6 +18665,40 @@ public sealed class FactoryAbortRequest public string SessionId { get; set; } = string.Empty; } +/// Whether the client authoritatively confirmed its external work stopped. +[Experimental(Diagnostics.Experimental)] +public sealed class ClientTaskCancelResult +{ + /// True only when the owner confirms that external work stopped before responding. + [JsonPropertyName("cancelled")] + public bool Cancelled { get; set; } +} + +/// Runtime-to-owner cancellation request for a client-owned task. +[Experimental(Diagnostics.Experimental)] +public sealed class ClientTaskCancelRequest +{ + /// Opaque identifier shared by coalesced cancellation callers. + [JsonPropertyName("cancellationId")] + public string CancellationId { get; set; } = string.Empty; + + /// Owner-scoped task key included for correlation. + [JsonPropertyName("clientTaskId")] + public string ClientTaskId { get; set; } = string.Empty; + + /// Canonical runtime-generated task identifier. + [JsonPropertyName("id")] + public string Id { get; set; } = string.Empty; + + /// Reason the runtime requests cancellation. + [JsonPropertyName("reason")] + public ClientTaskCancelReason Reason { get; set; } + + /// Session that owns the client task. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Describes a filesystem error. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsError @@ -18941,6 +19552,72 @@ public sealed class GitHubTokenAcquireRequest public string? SessionId { get; set; } } +/// Closed set of public task kinds a connection can negotiate. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskKind : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskKind(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Runtime-owned background agent task. + public static TaskKind Agent { get; } = new("agent"); + + /// Runtime-owned shell task. + public static TaskKind Shell { get; } = new("shell"); + + /// Client-owned externally executed task. + public static TaskKind Client { get; } = new("client"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskKind left, TaskKind right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskKind left, TaskKind right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskKind other && Equals(other); + + /// + public bool Equals(TaskKind other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskKind value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskKind)); + } + } +} + + /// Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -24179,6 +24856,69 @@ public override void Write(Utf8JsonWriter writer, FactoryLogLineKind value, Json } +/// Whether the requested preference was already effective or was accepted for later transactional activation. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ModelSwitchAutoTierStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ModelSwitchAutoTierStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The requested preference is already effective. No activation is pending for it, although this request may have cancelled an earlier unclaimed preference reported in `supersededAutoTier`. + public static ModelSwitchAutoTierStatus Unchanged { get; } = new("unchanged"); + + /// The request was accepted but has not committed. A later user turn using the `auto` model must mint and validate the replacement before it becomes effective. + public static ModelSwitchAutoTierStatus Pending { get; } = new("pending"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ModelSwitchAutoTierStatus left, ModelSwitchAutoTierStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ModelSwitchAutoTierStatus left, ModelSwitchAutoTierStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is ModelSwitchAutoTierStatus other && Equals(other); + + /// + public bool Equals(ModelSwitchAutoTierStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override ModelSwitchAutoTierStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, ModelSwitchAutoTierStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelSwitchAutoTierStatus)); + } + } +} + + /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -24578,6 +25318,267 @@ public override void Write(Utf8JsonWriter writer, TaskStatus value, JsonSerializ } +/// Client-owned tasks always execute outside the runtime in background mode. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientExecutionMode : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientExecutionMode(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Gets the background value. + public static TaskClientExecutionMode Background { get; } = new("background"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientExecutionMode left, TaskClientExecutionMode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientExecutionMode left, TaskClientExecutionMode right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientExecutionMode other && Equals(other); + + /// + public bool Equals(TaskClientExecutionMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientExecutionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientExecutionMode value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientExecutionMode)); + } + } +} + + +/// Connection class owning a client task. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientOwnerKind : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientOwnerKind(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// A discovered extension connection owns the task. + public static TaskClientOwnerKind Extension { get; } = new("extension"); + + /// A generic SDK connection owns the task. + public static TaskClientOwnerKind Sdk { get; } = new("sdk"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientOwnerKind left, TaskClientOwnerKind right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientOwnerKind left, TaskClientOwnerKind right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientOwnerKind other && Equals(other); + + /// + public bool Equals(TaskClientOwnerKind other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientOwnerKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientOwnerKind value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientOwnerKind)); + } + } +} + + +/// Presence of the task's bound join. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientOwnerPresence : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientOwnerPresence(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The bound session join is connected. + public static TaskClientOwnerPresence Connected { get; } = new("connected"); + + /// The bound session join is disconnected. + public static TaskClientOwnerPresence Disconnected { get; } = new("disconnected"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientOwnerPresence left, TaskClientOwnerPresence right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientOwnerPresence left, TaskClientOwnerPresence right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientOwnerPresence other && Equals(other); + + /// + public bool Equals(TaskClientOwnerPresence other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientOwnerPresence Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientOwnerPresence value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientOwnerPresence)); + } + } +} + + +/// Lifecycle status of a client-owned task. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The external owner is actively working. + public static TaskClientStatus Running { get; } = new("running"); + + /// The external owner is connected but waiting. + public static TaskClientStatus Idle { get; } = new("idle"); + + /// The owner reported successful completion. + public static TaskClientStatus Completed { get; } = new("completed"); + + /// The owner reported failure. + public static TaskClientStatus Failed { get; } = new("failed"); + + /// The owner reported or confirmed cancellation. + public static TaskClientStatus Cancelled { get; } = new("cancelled"); + + /// The bound owner join disappeared; external executor state is unknown. + public static TaskClientStatus Orphaned { get; } = new("orphaned"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientStatus left, TaskClientStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientStatus left, TaskClientStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientStatus other && Equals(other); + + /// + public bool Equals(TaskClientStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientStatus)); + } + } +} + + /// Whether the shell runs inside a managed PTY session or as an independent background process. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -24641,6 +25642,129 @@ public override void Write(Utf8JsonWriter writer, TaskShellInfoAttachmentMode va } +/// Discriminator for a client-owned task. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientType : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientType(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Gets the client value. + public static TaskClientType Client { get; } = new("client"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientType left, TaskClientType right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientType left, TaskClientType right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientType other && Equals(other); + + /// + public bool Equals(TaskClientType other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientType value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientType)); + } + } +} + + +/// Active status a client owner may publish with a progress update. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct TaskClientActiveStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public TaskClientActiveStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The external owner is actively working. + public static TaskClientActiveStatus Running { get; } = new("running"); + + /// The external owner is connected but waiting. + public static TaskClientActiveStatus Idle { get; } = new("idle"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(TaskClientActiveStatus left, TaskClientActiveStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(TaskClientActiveStatus left, TaskClientActiveStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is TaskClientActiveStatus other && Equals(other); + + /// + public bool Equals(TaskClientActiveStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override TaskClientActiveStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, TaskClientActiveStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskClientActiveStatus)); + } + } +} + + /// Consumer allowed to call an MCP tool. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -29479,6 +30603,69 @@ public override void Write(Utf8JsonWriter writer, SessionVisibilityStatus value, } +/// Why the runtime requests client-task cancellation. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ClientTaskCancelReason : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ClientTaskCancelReason(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// A caller requested task cancellation. + public static ClientTaskCancelReason CancelRequested { get; } = new("cancel_requested"); + + /// The session is shutting down. + public static ClientTaskCancelReason SessionShutdown { get; } = new("session_shutdown"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ClientTaskCancelReason left, ClientTaskCancelReason right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ClientTaskCancelReason left, ClientTaskCancelReason right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is ClientTaskCancelReason other && Equals(other); + + /// + public bool Equals(ClientTaskCancelReason other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override ClientTaskCancelReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, ClientTaskCancelReason value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ClientTaskCancelReason)); + } + } +} + + /// Error classification. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -29887,13 +31074,14 @@ public async Task PingAsync(string? message = null, CancellationToke /// Performs the SDK server connection handshake and validates the optional connection token. Marked internal because this is JSON-RPC transport plumbing invoked automatically by an SDK client's own `connect()` wrapper, not a user-facing method. Stays internal as long as the SDK client owns the handshake; would only become public if the SDK ever exposed the raw schema surface to consumers without a connection wrapper. /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events. /// Identity of the integrating host. Optional; omit it to keep the default attribution. + /// Task kinds this connection can decode when observing session tasks. Omit to retain agent and shell compatibility. /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN. /// The to monitor for cancellation requests. The default is . /// Handshake result reporting the server's protocol version and package version on success. [Experimental(Diagnostics.Experimental)] - internal async Task ConnectAsync(bool? enableGitHubTelemetryForwarding = null, ConnectClientInfo? clientInfo = null, string? token = null, CancellationToken cancellationToken = default) + internal async Task ConnectAsync(bool? enableGitHubTelemetryForwarding = null, ConnectClientInfo? clientInfo = null, IList? supportedTaskKinds = null, string? token = null, CancellationToken cancellationToken = default) { - var request = new ConnectRequest { EnableGitHubTelemetryForwarding = enableGitHubTelemetryForwarding, ClientInfo = clientInfo, Token = token }; + var request = new ConnectRequest { EnableGitHubTelemetryForwarding = enableGitHubTelemetryForwarding, ClientInfo = clientInfo, SupportedTaskKinds = supportedTaskKinds, Token = token }; return await CopilotClient.InvokeRpcAsync(_rpc, "connect", [request], cancellationToken); } @@ -30281,12 +31469,13 @@ public async Task UpdateAsync(string name, object config, CancellationToken canc /// Removes an MCP server from user configuration. /// Name of the MCP server to remove. + /// OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. /// The to monitor for cancellation requests. The default is . - public async Task RemoveAsync(string name, CancellationToken cancellationToken = default) + public async Task RemoveAsync(string name, string? authClientIdMetadataUrl = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); - var request = new McpConfigRemoveRequest { Name = name }; + var request = new McpConfigRemoveRequest { Name = name, AuthClientIdMetadataUrl = authClientIdMetadataUrl }; await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.remove", [request], cancellationToken); } @@ -32310,9 +33499,9 @@ internal ModelApi(CopilotSession session) _session = session; } - /// Gets the currently selected model for the session. + /// Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn. /// The to monitor for cancellation requests. The default is . - /// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + /// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. public async Task GetCurrentAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); @@ -32323,6 +33512,7 @@ public async Task GetCurrentAsync(CancellationToken cancellationTo /// Switches the session to a model and optional reasoning configuration. /// 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. + /// Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`. /// Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. "none" disables reasoning. When omitted, no effort override is applied. /// Reasoning summary mode to request for supported model clients. /// Output verbosity level to request for supported models. @@ -32338,15 +33528,28 @@ public async Task GetCurrentAsync(CancellationToken cancellationTo /// Optional settings context and explicit-override flags used to persist a picker selection. /// The to monitor for cancellation requests. The default is . /// The model identifier active on the session after the switch. - public async Task SwitchToAsync(string modelId, string? reasoningEffort = null, ReasoningSummary? reasoningSummary = null, Verbosity? verbosity = null, ModelCapabilitiesOverride? modelCapabilities = null, ContextTier? contextTier = null, ModelChangeSource? source = null, bool? deferIfModelChangeQueued = null, string? compactionDecision = null, bool? runCompactionPreflight = null, string? repoScope = null, string? modelChangeScope = null, bool? requireAvailable = null, ModelPickerPersistenceRequest? pickerPersistence = null, CancellationToken cancellationToken = default) + public async Task SwitchToAsync(string modelId, AutoTier? autoTier = null, string? reasoningEffort = null, ReasoningSummary? reasoningSummary = null, Verbosity? verbosity = null, ModelCapabilitiesOverride? modelCapabilities = null, ContextTier? contextTier = null, ModelChangeSource? source = null, bool? deferIfModelChangeQueued = null, string? compactionDecision = null, bool? runCompactionPreflight = null, string? repoScope = null, string? modelChangeScope = null, bool? requireAvailable = null, ModelPickerPersistenceRequest? pickerPersistence = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(modelId); _session.ThrowIfDisposed(); - var request = new ModelSwitchToRequest { SessionId = _session.SessionId, ModelId = modelId, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, Verbosity = verbosity, ModelCapabilities = modelCapabilities, ContextTier = contextTier, Source = source, DeferIfModelChangeQueued = deferIfModelChangeQueued, CompactionDecision = compactionDecision, RunCompactionPreflight = runCompactionPreflight, RepoScope = repoScope, ModelChangeScope = modelChangeScope, RequireAvailable = requireAvailable, PickerPersistence = pickerPersistence }; + var request = new ModelSwitchToRequest { SessionId = _session.SessionId, ModelId = modelId, AutoTier = autoTier, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, Verbosity = verbosity, ModelCapabilities = modelCapabilities, ContextTier = contextTier, Source = source, DeferIfModelChangeQueued = deferIfModelChangeQueued, CompactionDecision = compactionDecision, RunCompactionPreflight = runCompactionPreflight, RepoScope = repoScope, ModelChangeScope = modelChangeScope, RequireAvailable = requireAvailable, PickerPersistence = pickerPersistence }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.switchTo", [request], cancellationToken); } + /// Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`. + /// Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. + /// Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. + /// The to monitor for cancellation requests. The default is . + /// Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. + public async Task SwitchAutoTierAsync(AutoTier? autoTier, ModelChangeSource? source = null, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new ModelSwitchAutoTierRequest { SessionId = _session.SessionId, AutoTier = autoTier, Source = source }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.switchAutoTier", [request], cancellationToken); + } + /// Resolves and applies organization-managed and repository model overlays. /// Model required by device-managed policy, when configured. /// Model required by server-managed policy, when configured. @@ -32968,6 +34171,41 @@ public async Task ListAsync(CancellationToken cancellationToken = defa return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.list", [request], cancellationToken); } + /// Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal. + /// Task kind. + /// Owner-scoped idempotency key used for registration and reclaim. + /// Human-readable description of the external work. + /// Whether the owner supports runtime cancellation requests. + /// Optional short display name for the external work. + /// Expected current sequence for idempotent registration or orphan reclaim. + /// The to monitor for cancellation requests. The default is . + /// Result of registering or reclaiming a client-owned task. + public async Task RegisterAsync(TaskClientType type, string clientTaskId, string description, bool cancellable, string? displayName = null, long? expectedSequence = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(clientTaskId); + ArgumentNullException.ThrowIfNull(description); + _session.ThrowIfDisposed(); + + var request = new TasksRegisterRequest { SessionId = _session.SessionId, Type = type, ClientTaskId = clientTaskId, Description = description, Cancellable = cancellable, DisplayName = displayName, ExpectedSequence = expectedSequence }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.register", [request], cancellationToken); + } + + /// Publishes generic progress or a terminal outcome for a client-owned task. + /// Canonical runtime-generated task identifier. + /// Owner update sequence to apply. + /// Progress or terminal update payload. + /// The to monitor for cancellation requests. The default is . + /// Result of publishing a client-owned task update. + public async Task UpdateAsync(string id, long sequence, TaskClientUpdate update, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(id); + ArgumentNullException.ThrowIfNull(update); + _session.ThrowIfDisposed(); + + var request = new TasksUpdateRequest { SessionId = _session.SessionId, Id = id, Sequence = sequence, Update = update }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.update", [request], cancellationToken); + } + /// Refreshes metadata for any detached background shells the runtime knows about. /// The to monitor for cancellation requests. The default is . /// Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop. @@ -35671,6 +36909,17 @@ public interface IFactoryHandler Task AbortAsync(FactoryAbortRequest request, CancellationToken cancellationToken = default); } +/// Handles `tasks` client session API methods. +[Experimental(Diagnostics.Experimental)] +public interface ITasksHandler +{ + /// Asks the client currently bound to a client-owned session task to confirm that its external work stopped. + /// Runtime-to-owner cancellation request for a client-owned task. + /// The to monitor for cancellation requests. The default is . + /// Whether the client authoritatively confirmed its external work stopped. + Task CancelAsync(ClientTaskCancelRequest request, CancellationToken cancellationToken = default); +} + /// Handles `sessionFs` client session API methods. [Experimental(Diagnostics.Experimental)] public interface ISessionFsHandler @@ -35771,6 +37020,9 @@ public sealed class ClientSessionApiHandlers /// Optional handler for Factory client session API methods. public IFactoryHandler? Factory { get; set; } + /// Optional handler for Tasks client session API methods. + public ITasksHandler? Tasks { get; set; } + /// Optional handler for SessionFs client session API methods. public ISessionFsHandler? SessionFs { get; set; } @@ -35806,6 +37058,12 @@ public static void RegisterClientSessionApiHandlers(JsonRpc rpc, Func>)(async (request, cancellationToken) => + { + var handler = getHandlers(request.SessionId).Tasks; + if (handler is null) throw new InvalidOperationException($"No tasks handler registered for session: {request.SessionId}"); + return await handler.CancelAsync(request, cancellationToken); + }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.readFile", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; @@ -36099,6 +37357,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchRequestedEvent), TypeInfoPropertyName = "SessionEventsAutoModeSwitchRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchResponse), TypeInfoPropertyName = "SessionEventsAutoModeSwitchResponse")] [JsonSerializable(typeof(GitHub.Copilot.AutoTier), TypeInfoPropertyName = "SessionEventsAutoTier")] +[JsonSerializable(typeof(GitHub.Copilot.AutoTierSwitchFailureReason), TypeInfoPropertyName = "SessionEventsAutoTierSwitchFailureReason")] [JsonSerializable(typeof(GitHub.Copilot.AutopilotObjectiveChangedOperation), TypeInfoPropertyName = "SessionEventsAutopilotObjectiveChangedOperation")] [JsonSerializable(typeof(GitHub.Copilot.AutopilotObjectiveChangedStatus), TypeInfoPropertyName = "SessionEventsAutopilotObjectiveChangedStatus")] [JsonSerializable(typeof(GitHub.Copilot.BinaryAssetReference), TypeInfoPropertyName = "SessionEventsBinaryAssetReference")] @@ -36476,6 +37735,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(CatalogNegotiatedContract))] [JsonSerializable(typeof(CatalogSearchRequest))] [JsonSerializable(typeof(CatalogSearchResult))] +[JsonSerializable(typeof(ClientTaskCancelRequest))] +[JsonSerializable(typeof(ClientTaskCancelResult))] [JsonSerializable(typeof(CommandList))] [JsonSerializable(typeof(CommandsFinalizeInvocationEffectRequest))] [JsonSerializable(typeof(CommandsFinalizeInvocationEffectRequestEffect))] @@ -36782,6 +38043,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(ModelPolicy))] [JsonSerializable(typeof(ModelSetReasoningEffortRequest))] [JsonSerializable(typeof(ModelSetReasoningEffortResult))] +[JsonSerializable(typeof(ModelSwitchAutoTierRequest))] +[JsonSerializable(typeof(ModelSwitchAutoTierResult))] [JsonSerializable(typeof(ModelSwitchConfirmation))] [JsonSerializable(typeof(ModelSwitchToRequest))] [JsonSerializable(typeof(ModelSwitchToResult))] @@ -37202,27 +38465,34 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SlashCommandSelectSubcommandOption))] [JsonSerializable(typeof(SlashCommandTimelineEntry))] [JsonSerializable(typeof(SubagentSettingsEntry))] +[JsonSerializable(typeof(TaskClientInfo))] +[JsonSerializable(typeof(TaskClientOwner))] +[JsonSerializable(typeof(TaskClientUpdate))] [JsonSerializable(typeof(TaskCompleteData))] [JsonSerializable(typeof(TaskCompletionDecision))] [JsonSerializable(typeof(TaskInfo))] [JsonSerializable(typeof(TaskList))] +[JsonSerializable(typeof(TaskProgress))] [JsonSerializable(typeof(TaskProgressLine))] [JsonSerializable(typeof(TasksCancelRequest))] [JsonSerializable(typeof(TasksCancelResult))] [JsonSerializable(typeof(TasksGetCurrentPromotableResult))] [JsonSerializable(typeof(TasksGetProgressRequest))] [JsonSerializable(typeof(TasksGetProgressResult))] -[JsonSerializable(typeof(TasksGetProgressResultProgress))] [JsonSerializable(typeof(TasksPromoteCurrentToBackgroundResult))] [JsonSerializable(typeof(TasksPromoteToBackgroundRequest))] [JsonSerializable(typeof(TasksPromoteToBackgroundResult))] [JsonSerializable(typeof(TasksRefreshResult))] +[JsonSerializable(typeof(TasksRegisterRequest))] +[JsonSerializable(typeof(TasksRegisterResult))] [JsonSerializable(typeof(TasksRemoveRequest))] [JsonSerializable(typeof(TasksRemoveResult))] [JsonSerializable(typeof(TasksSendMessageRequest))] [JsonSerializable(typeof(TasksSendMessageResult))] [JsonSerializable(typeof(TasksStartAgentRequest))] [JsonSerializable(typeof(TasksStartAgentResult))] +[JsonSerializable(typeof(TasksUpdateRequest))] +[JsonSerializable(typeof(TasksUpdateResult))] [JsonSerializable(typeof(TasksWaitForPendingResult))] [JsonSerializable(typeof(TelemetrySetFeatureOverridesRequest))] [JsonSerializable(typeof(Tool))] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index 147e08e458..e7890dee92 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -84,6 +84,7 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionLimitsExhaustedCompletedEvent), "session_limits_exhausted.completed")] [JsonDerivedType(typeof(SessionLimitsExhaustedRequestedEvent), "session_limits_exhausted.requested")] [JsonDerivedType(typeof(SessionAutoModeResolvedEvent), "session.auto_mode_resolved")] +[JsonDerivedType(typeof(SessionAutoTierSwitchFailedEvent), "session.auto_tier_switch_failed")] [JsonDerivedType(typeof(SessionAutopilotObjectiveChangedEvent), "session.autopilot_objective_changed")] [JsonDerivedType(typeof(SessionBackgroundTasksChangedEvent), "session.background_tasks_changed")] [JsonDerivedType(typeof(SessionBinaryAssetEvent), "session.binary_asset")] @@ -112,6 +113,8 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionInfoEvent), "session.info")] [JsonDerivedType(typeof(SessionManagedSettingsEnforcedEvent), "session.managed_settings_enforced")] [JsonDerivedType(typeof(SessionManagedSettingsResolvedEvent), "session.managed_settings_resolved")] +[JsonDerivedType(typeof(SessionMcpServerNeedsReconnectEvent), "session.mcp_server_needs_reconnect")] +[JsonDerivedType(typeof(SessionMcpServerRemovedEvent), "session.mcp_server_removed")] [JsonDerivedType(typeof(SessionMcpServerStatusChangedEvent), "session.mcp_server_status_changed")] [JsonDerivedType(typeof(SessionMcpServersLoadedEvent), "session.mcp_servers_loaded")] [JsonDerivedType(typeof(SessionModeChangedEvent), "session.mode_changed")] @@ -368,6 +371,19 @@ public sealed partial class SessionModelChangeEvent : SessionEvent public required SessionModelChangeData Data { get; set; } } +/// A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. +/// Represents the session.auto_tier_switch_failed event. +public sealed partial class SessionAutoTierSwitchFailedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.auto_tier_switch_failed"; + + /// The session.auto_tier_switch_failed event payload. + [JsonPropertyName("data")] + public required SessionAutoTierSwitchFailedData Data { get; set; } +} + /// Agent mode change details including previous and new modes. /// Represents the session.mode_changed event. public sealed partial class SessionModeChangedEvent : SessionEvent @@ -1790,6 +1806,32 @@ public sealed partial class SessionMcpServerStatusChangedEvent : SessionEvent public required SessionMcpServerStatusChangedData Data { get; set; } } +/// Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. +/// Represents the session.mcp_server_removed event. +public sealed partial class SessionMcpServerRemovedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.mcp_server_removed"; + + /// The session.mcp_server_removed event payload. + [JsonPropertyName("data")] + public required SessionMcpServerRemovedData Data { get; set; } +} + +/// Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. +/// Represents the session.mcp_server_needs_reconnect event. +public sealed partial class SessionMcpServerNeedsReconnectEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.mcp_server_needs_reconnect"; + + /// The session.mcp_server_needs_reconnect event payload. + [JsonPropertyName("data")] + public required SessionMcpServerNeedsReconnectData Data { get; set; } +} + /// Payload identifying the MCP server associated with a list change. /// Represents the mcp.tools.list_changed event. public sealed partial class McpToolsListChangedEvent : SessionEvent @@ -2323,6 +2365,11 @@ public sealed partial class SessionWarningData /// Model change details including previous and new model identifiers. public sealed partial class SessionModelChangeData { + /// Committed Auto preference after the model configuration change, when applicable. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("autoTier")] + public AutoTier? AutoTier { get; set; } + /// Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("cause")] @@ -2337,6 +2384,11 @@ public sealed partial class SessionModelChangeData [JsonPropertyName("newModel")] public required string NewModel { get; set; } + /// Previously committed Auto preference, when one was explicitly selected. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("previousAutoTier")] + public AutoTier? PreviousAutoTier { get; set; } + /// Model that was previously selected, if any. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("previousModel")] @@ -2378,6 +2430,23 @@ public sealed partial class SessionModelChangeData public Verbosity? Verbosity { get; set; } } +/// A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. +public sealed partial class SessionAutoTierSwitchFailedData +{ + /// Auto preference that remains effective after the failed request. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("effectiveAutoTier")] + public AutoTier? EffectiveAutoTier { get; set; } + + /// Low-cardinality failure outcome reported by Auto resolution. + [JsonPropertyName("reason")] + public required AutoTierSwitchFailureReason Reason { get; set; } + + /// Auto preference that failed to activate, or null when returning to provider-default routing failed. + [JsonPropertyName("requestedAutoTier")] + public AutoTier? RequestedAutoTier { get; set; } +} + /// Agent mode change details including previous and new modes. public sealed partial class SessionModeChangedData { @@ -5855,6 +5924,22 @@ public sealed partial class SessionMcpServerStatusChangedData public required McpServerStatus Status { get; set; } } +/// Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. +public sealed partial class SessionMcpServerRemovedData +{ + /// Name of the MCP server that was removed from the graph. + [JsonPropertyName("serverName")] + public required string ServerName { get; set; } +} + +/// Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. +public sealed partial class SessionMcpServerNeedsReconnectData +{ + /// Name of the MCP server that needs to reconnect. + [JsonPropertyName("serverName")] + public required string ServerName { get; set; } +} + /// Payload identifying the MCP server associated with a list change. public sealed partial class McpToolsListChangedData { @@ -11233,6 +11318,73 @@ public override void Write(Utf8JsonWriter writer, ModelChangeSource value, JsonS } } +/// Terminal reason an Auto preference activation failed. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct AutoTierSwitchFailureReason : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public AutoTierSwitchFailureReason(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The candidate model was rejected by model policy. + public static AutoTierSwitchFailureReason PolicyRejected { get; } = new("policy_rejected"); + + /// The Auto routing request failed or returned an unusable response. + public static AutoTierSwitchFailureReason RequestFailed { get; } = new("request_failed"); + + /// The runtime could not prepare the Auto routing request. + public static AutoTierSwitchFailureReason SetupFailed { get; } = new("setup_failed"); + + /// The provider does not support Auto routing. + public static AutoTierSwitchFailureReason Unsupported { get; } = new("unsupported"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(AutoTierSwitchFailureReason left, AutoTierSwitchFailureReason right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(AutoTierSwitchFailureReason left, AutoTierSwitchFailureReason right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is AutoTierSwitchFailureReason other && Equals(other); + + /// + public bool Equals(AutoTierSwitchFailureReason other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override AutoTierSwitchFailureReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, AutoTierSwitchFailureReason value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AutoTierSwitchFailureReason)); + } + } +} + /// Permission mode for the session. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -16307,6 +16459,8 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SandboxDecisionEvent))] [JsonSerializable(typeof(SessionAutoModeResolvedData))] [JsonSerializable(typeof(SessionAutoModeResolvedEvent))] +[JsonSerializable(typeof(SessionAutoTierSwitchFailedData))] +[JsonSerializable(typeof(SessionAutoTierSwitchFailedEvent))] [JsonSerializable(typeof(SessionAutopilotObjectiveChangedData))] [JsonSerializable(typeof(SessionAutopilotObjectiveChangedEvent))] [JsonSerializable(typeof(SessionBackgroundTasksChangedData))] @@ -16370,6 +16524,10 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(SessionManagedSettingsEnforcedEvent))] [JsonSerializable(typeof(SessionManagedSettingsResolvedData))] [JsonSerializable(typeof(SessionManagedSettingsResolvedEvent))] +[JsonSerializable(typeof(SessionMcpServerNeedsReconnectData))] +[JsonSerializable(typeof(SessionMcpServerNeedsReconnectEvent))] +[JsonSerializable(typeof(SessionMcpServerRemovedData))] +[JsonSerializable(typeof(SessionMcpServerRemovedEvent))] [JsonSerializable(typeof(SessionMcpServerStatusChangedData))] [JsonSerializable(typeof(SessionMcpServerStatusChangedEvent))] [JsonSerializable(typeof(SessionMcpServersLoadedData))] diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index fea4796fae..cf7b8f4738 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -1366,9 +1366,12 @@ type CanvasSessionContext struct { // Experimental: CapiSessionOptions is part of an experimental API and may change or be // removed. type CapiSessionOptions struct { - // Routing preference used when the session model is `auto`. The runtime persists the - // preference across cold resume. When omitted, the default routing behavior is used. - // Resuming an already-resident session cannot change its preference. + // Routing preference for sessions whose model is `auto`. On create or cold resume, this + // establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold + // resume, the runtime restores the last committed preference. On resident resume, a + // different value requests a safe switch after resume succeeds and cannot change an + // in-flight turn. Successful switches are persisted for later cold resume. When no + // preference is supplied or restored, CAPI default routing is used. AutoTier *AutoTier `json:"autoTier,omitempty"` // 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 @@ -1850,6 +1853,30 @@ func (CatalogUnsupportedKindError) Kind() CatalogSearchResultKind { return CatalogSearchResultKindUnsupportedKind } +// Runtime-to-owner cancellation request for a client-owned task. +// Experimental: ClientTaskCancelRequest is part of an experimental API and may change or be +// removed. +type ClientTaskCancelRequest struct { + // Opaque identifier shared by coalesced cancellation callers + CancellationID string `json:"cancellationId"` + // Owner-scoped task key included for correlation + ClientTaskID string `json:"clientTaskId"` + // Canonical runtime-generated task identifier + ID string `json:"id"` + // Reason the runtime requests cancellation + Reason ClientTaskCancelReason `json:"reason"` + // Session that owns the client task + SessionID string `json:"sessionId"` +} + +// Whether the client authoritatively confirmed its external work stopped. +// Experimental: ClientTaskCancelResult is part of an experimental API and may change or be +// removed. +type ClientTaskCancelResult struct { + // True only when the owner confirms that external work stopped before responding + Cancelled bool `json:"cancelled"` +} + // Slash commands available in the session, after applying any include/exclude filters. // Experimental: CommandList is part of an experimental API and may change or be removed. type CommandList struct { @@ -2073,6 +2100,9 @@ type ConnectRequest struct { // using the process-global gate for ordinary events and an explicit session-scoped decision // for host-only events. EnableGitHubTelemetryForwarding *bool `json:"enableGitHubTelemetryForwarding,omitempty"` + // Task kinds this connection can decode when observing session tasks. Omit to retain agent + // and shell compatibility. + SupportedTaskKinds []TaskKind `json:"supportedTaskKinds,omitzero"` // Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN Token *string `json:"token,omitempty"` } @@ -2085,6 +2115,8 @@ type ConnectResult struct { Ok bool `json:"ok"` // Server protocol version number ProtocolVersion int64 `json:"protocolVersion"` + // Task kinds the server may return to this connection. + TaskKinds []TaskKind `json:"taskKinds,omitzero"` // Server package version Version string `json:"version"` } @@ -2341,15 +2373,24 @@ type CopilotUserResponseQuotaSnapshotsPremiumInteractions struct { Unlimited *bool `json:"unlimited,omitempty"` } -// The currently selected model, reasoning effort, and context tier for the session. The -// context tier reflects `Session.getContextTier()`, restored from the session journal on -// resume. +// The session's authoritative model snapshot. Auto preference fields are configuration for +// the virtual `auto` model and do not change the selected model identifier. The context +// tier reflects `Session.getContextTier()`, restored from the session journal on resume. // Experimental: CurrentModel is part of an experimental API and may change or be removed. type CurrentModel struct { + // Auto preference currently claimed by an in-progress activation. Null means the activation + // is returning to provider-default routing. + ActivatingAutoTier *AutoTier `json:"activatingAutoTier,omitempty"` + // Auto preference currently committed for the session. This can remain available while + // another model is selected so a later switch to `auto` can reuse it. + AutoTier *AutoTier `json:"autoTier,omitempty"` // Context tier for models that support multiple context-window sizes. ContextTier *ContextTier `json:"contextTier,omitempty"` // Currently active model identifier ModelID *string `json:"modelId,omitempty"` + // Latest unclaimed Auto preference waiting for a future user turn. Null means the pending + // request is returning to provider-default routing. + PendingAutoTier *AutoTier `json:"pendingAutoTier,omitempty"` // Reasoning effort level currently applied to the active model, when one is set. Reads // `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the // two values are reported as a snapshot. @@ -5127,6 +5168,8 @@ type MCPConfigReloadResult struct { // Experimental: MCPConfigRemoveRequest is part of an experimental API and may change or be // removed. type MCPConfigRemoveRequest struct { + // OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. + AuthClientIDMetadataURL *string `json:"authClientIdMetadataUrl,omitempty"` // Name of the MCP server to remove Name string `json:"name"` } @@ -6938,6 +6981,10 @@ type Model struct { // a recommended alternative. Present only when the service published at least one notice. // Hosts should surface these without implying anything is wrong with the model. InfoMessages []ModelMessage `json:"infoMessages,omitzero"` + // Provider-supplied model metadata. Keys and JSON-compatible values are preserved + // unchanged. This is factual metadata published by the model provider; it carries no picker + // or UX semantics. + Metadata map[string]any `json:"metadata,omitzero"` // Model capability category for grouping in the model picker ModelPickerCategory *ModelPickerCategory `json:"modelPickerCategory,omitempty"` // Relative cost tier for token-based billing users @@ -7266,6 +7313,38 @@ type ModelsListRequest struct { SelectionID *string `json:"selectionId,omitempty"` } +// An Auto preference request for the session. This updates Auto configuration only; it does +// not change the selected model to `auto`. +// Experimental: ModelSwitchAutoTierRequest is part of an experimental API and may change or +// be removed. +type ModelSwitchAutoTierRequest struct { + // Auto preference to activate when a future user turn using the `auto` model safely mints a + // replacement model and token pair. Pass null to return to provider-default Auto routing. + AutoTier *AutoTier `json:"autoTier"` + // Origin to record on the effective `session.model_change` event. Defaults to `sdk` when + // omitted. + Source *ModelChangeSource `json:"source,omitempty"` +} + +// Immediate acknowledgement and Auto preference snapshot after a switch request. This +// result never implies that a pending preference committed. +// Experimental: ModelSwitchAutoTierResult is part of an experimental API and may change or +// be removed. +type ModelSwitchAutoTierResult struct { + // Auto preference currently claimed by an in-progress activation. Null means the activation + // is returning to provider-default routing. + ActivatingAutoTier *AutoTier `json:"activatingAutoTier,omitempty"` + // Auto preference currently committed for the session. + EffectiveAutoTier *AutoTier `json:"effectiveAutoTier,omitempty"` + // Latest unclaimed Auto preference waiting for a future user turn. + PendingAutoTier *AutoTier `json:"pendingAutoTier,omitempty"` + // Immediate request status. `pending` means accepted but not committed. + Status ModelSwitchAutoTierStatus `json:"status"` + // Earlier unclaimed preference replaced by this request. This can be present with either + // status, including when selecting the effective preference cancels pending work. + SupersededAutoTier *AutoTier `json:"supersededAutoTier,omitempty"` +} + // Experimental: ModelSwitchConfirmation is part of an experimental API and may change or be // removed. type ModelSwitchConfirmation struct { @@ -7282,6 +7361,10 @@ type ModelSwitchConfirmation struct { // Experimental: ModelSwitchToRequest is part of an experimental API and may change or be // removed. type ModelSwitchToRequest struct { + // Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to + // return to provider-default Auto routing. This field is rejected when `modelId` is not + // `auto`. + AutoTier *AutoTier `json:"autoTier,omitempty"` // Explicit response to a model-switch compaction preflight. Omit to request a confirmation // projection when compaction is necessary. CompactionDecision *string `json:"compactionDecision,omitempty"` @@ -7340,6 +7423,9 @@ type ModelSwitchToResult struct { Message *string `json:"message,omitempty"` // Currently active model identifier after the switch ModelID *string `json:"modelId,omitempty"` + // Authoritative model and Auto preference state after an immediate switch. For deferred + // switches this remains the current state until the queued change drains. + ModelState *CurrentModel `json:"modelState,omitempty"` // Persistence failure encountered after applying the model switch. PersistenceError *string `json:"persistenceError,omitempty"` // Lifecycle result for the requested switch @@ -10321,6 +10407,12 @@ type RuntimeShutdownResult struct { type SandboxConfig struct { // Whether to auto-add the current working directory to readwritePaths. Default: true. AddCurrentWorkingDirectory *bool `json:"addCurrentWorkingDirectory,omitempty"` + // Whether the agent may request that an individual command run outside the sandbox, which + // the host then approves or denies through the usual permission flow. A host capability + // flag rather than part of the policy: it is stripped from the effective spawn policy and + // only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this + // object: omitting it offers no bypass. Default: false (opt-in). + AllowBypass *bool `json:"allowBypass,omitempty"` // Whether to auto-grant read access to tool directories discovered on PATH and in toolchain // environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common // developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the @@ -10337,6 +10429,27 @@ type SandboxConfig struct { Auth *SandboxConfigAuth `json:"auth,omitempty"` // Whether sandboxing is enabled for the session. Enabled bool `json:"enabled"` + // The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`. + // Internal: ManagedLspRoutingLocked is part of the SDK's internal API surface and is not + // intended for external use. + ManagedLspRoutingLocked *bool `json:"managedLspRoutingLocked,omitempty"` + // Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local + // opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at + // the administrator instead of a setting the next managed merge would override, and it is + // ignored when comparing two configs for change. Only the managed merge may set it; a + // caller-supplied value is stripped. + // Internal: ManagedMCPRoutingLocked is part of the SDK's internal API surface and is not + // intended for external use. + ManagedMCPRoutingLocked *bool `json:"managedMcpRoutingLocked,omitempty"` + // Whether language servers the session launches are confined by the sandbox. Only an + // explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by + // default; set to false to opt out). + SandboxLspServers *bool `json:"sandboxLspServers,omitempty"` + // Whether MCP servers the session launches are confined by the sandbox. Only an explicit + // `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and + // `enabled` are always read together. Ignored while `enabled` is false. Default: true + // (enabled by default; set to false to opt out). + SandboxMCPServers *bool `json:"sandboxMcpServers,omitempty"` // User-managed sandbox policy fragment merged into the auto-discovered base policy. UserPolicy *SandboxConfigUserPolicy `json:"userPolicy,omitempty"` } @@ -11999,6 +12112,8 @@ type SessionOpenOptions struct { AllowAllMCPServerInstructions *bool `json:"allowAllMcpServerInstructions,omitempty"` // Whether ask_user is explicitly disabled. AskUserDisabled *bool `json:"askUserDisabled,omitempty"` + // OAuth Client ID Metadata Document URL used by this host for MCP authorization. + AuthClientIDMetadataURL *string `json:"authClientIdMetadataUrl,omitempty"` // Initial authentication info for the session. AuthInfo AuthInfo `json:"authInfo,omitempty"` // Allowlist of available tool names. @@ -14077,6 +14192,102 @@ type SubagentSettingsEntry struct { ModelPolicy *AgentModelPolicy `json:"modelPolicy,omitempty"` } +// Public owner attribution for a client-owned task. Identifiers are opaque and never +// authorize requests. +// Experimental: TaskClientOwner is part of an experimental API and may change or be removed. +type TaskClientOwner struct { + // ISO 8601 timestamp when the bound join disconnected + DisconnectedAt *time.Time `json:"disconnectedAt,omitempty"` + // Display-only owner name + DisplayName *string `json:"displayName,omitempty"` + // Opaque identity of the currently or most recently bound session join + JoinID string `json:"joinId"` + // Class of the task owner + Kind TaskClientOwnerKind `json:"kind"` + // Opaque session-scoped participant identity + ParticipantID string `json:"participantId"` + // Whether this task's bound join is currently connected + Presence TaskClientOwnerPresence `json:"presence"` + // Display-only owner source + Source *string `json:"source,omitempty"` +} + +// Progress or terminal update for a client-owned task. +// Experimental: TaskClientUpdate is part of an experimental API and may change or be +// removed. +type TaskClientUpdate interface { + taskClientUpdate() + Kind() TaskClientUpdateKind +} + +type RawTaskClientUpdateData struct { + Discriminator TaskClientUpdateKind + Raw json.RawMessage +} + +func (RawTaskClientUpdateData) taskClientUpdate() {} +func (r RawTaskClientUpdateData) Kind() TaskClientUpdateKind { + return r.Discriminator +} + +// Reports terminal cancellation after external work stopped. +type TaskClientUpdateCancelled struct { + // Optional final progress message + Message *string `json:"message,omitempty"` + // Optional human-readable cancellation reason + Reason *string `json:"reason,omitempty"` +} + +func (TaskClientUpdateCancelled) taskClientUpdate() {} +func (TaskClientUpdateCancelled) Kind() TaskClientUpdateKind { + return TaskClientUpdateKindCancelled +} + +// Reports successful terminal completion. +type TaskClientUpdateCompleted struct { + // Optional final progress message + Message *string `json:"message,omitempty"` + // Optional opaque successful terminal result + Result any `json:"result,omitempty"` +} + +func (TaskClientUpdateCompleted) taskClientUpdate() {} +func (TaskClientUpdateCompleted) Kind() TaskClientUpdateKind { + return TaskClientUpdateKindCompleted +} + +// Reports terminal failure. +type TaskClientUpdateFailed struct { + // Optional owner-supplied terminal failure code + Code *string `json:"code,omitempty"` + // Human-readable terminal failure message + Error string `json:"error"` + // Optional final progress message + Message *string `json:"message,omitempty"` +} + +func (TaskClientUpdateFailed) taskClientUpdate() {} +func (TaskClientUpdateFailed) Kind() TaskClientUpdateKind { + return TaskClientUpdateKindFailed +} + +// Publishes nonterminal progress for a running or idle client task. +type TaskClientUpdateProgress struct { + // Optional progress message appended to recent activity when nonempty + Message *string `json:"message,omitempty"` + // Optional completion percentage; null clears the current percentage + Percentage *float64 `json:"percentage,omitempty"` + // Optional progress phase; null clears the current phase + Phase *string `json:"phase,omitempty"` + // Optional active status transition + Status *TaskClientActiveStatus `json:"status,omitempty"` +} + +func (TaskClientUpdateProgress) taskClientUpdate() {} +func (TaskClientUpdateProgress) Kind() TaskClientUpdateKind { + return TaskClientUpdateKindProgress +} + // Task completion notification with summary from the agent // Experimental: TaskCompleteData is part of an experimental API and may change or be // removed. @@ -14116,7 +14327,7 @@ type TaskCompletionDecision struct { ReviewerResultMeta any `json:"reviewerResultMeta,omitempty"` } -// Tracked task union returned by task APIs, containing either an agent task or a shell task. +// Tracked task union returned by task APIs, containing an agent, client, or shell task. // Experimental: TaskInfo is part of an experimental API and may change or be removed. type TaskInfo interface { taskInfo() @@ -14185,6 +14396,58 @@ func (TaskAgentInfo) Type() TaskInfoType { return TaskInfoTypeAgent } +// Tracked client-owned task metadata. +// Experimental: TaskClientInfo is part of an experimental API and may change or be removed. +type TaskClientInfo struct { + // ISO 8601 timestamp when the current active segment started + ActiveStartedAt *time.Time `json:"activeStartedAt,omitempty"` + // Accumulated active execution time in milliseconds + ActiveTimeMs int64 `json:"activeTimeMs"` + // Whether the currently bound owner can receive a cancellation request + CanCancel bool `json:"canCancel"` + // Human-readable reason for terminal cancellation + CancellationReason *string `json:"cancellationReason,omitempty"` + // Owner-scoped registration and reclaim key + ClientTaskID string `json:"clientTaskId"` + // ISO 8601 timestamp when the task reached a terminal status + CompletedAt *time.Time `json:"completedAt,omitempty"` + // Task description + Description string `json:"description"` + // Optional task display name + DisplayName *string `json:"displayName,omitempty"` + // Human-readable terminal failure message + Error *string `json:"error,omitempty"` + // Optional owner-supplied terminal failure code + ErrorCode *string `json:"errorCode,omitempty"` + // Execution mode, which is always background for client-owned tasks + ExecutionMode TaskClientExecutionMode `json:"executionMode"` + // Canonical runtime-generated task identifier + ID string `json:"id"` + // ISO 8601 timestamp when the connected owner entered idle status + IdleSince *time.Time `json:"idleSince,omitempty"` + // ISO 8601 timestamp of the most recent orphan transition + OrphanedAt *time.Time `json:"orphanedAt,omitempty"` + // Public attribution and presence for the task owner + Owner TaskClientOwner `json:"owner"` + // ISO 8601 timestamp of the most recent successful reclaim + ReclaimedAt *time.Time `json:"reclaimedAt,omitempty"` + // Opaque successful terminal result supplied by the task owner + Result any `json:"result,omitempty"` + // Sequence number of the latest accepted owner update + Sequence int64 `json:"sequence"` + // ISO 8601 timestamp when the task started + StartedAt time.Time `json:"startedAt"` + // Client task lifecycle status + Status TaskClientStatus `json:"status"` + // ISO 8601 timestamp of the latest accepted lifecycle change + UpdatedAt time.Time `json:"updatedAt"` +} + +func (TaskClientInfo) taskInfo() {} +func (TaskClientInfo) Type() TaskInfoType { + return TaskInfoTypeClient +} + // Tracked shell task metadata, including ID, command, status, timing, attachment/execution // mode, log path, and PID. // Experimental: TaskShellInfo is part of an experimental API and may change or be removed. @@ -14226,6 +14489,8 @@ type TaskList struct { Tasks []TaskInfo `json:"tasks"` } +// Progress information for the task, discriminated by type. Returns null when no task with +// this ID is currently tracked. // Experimental: TaskProgress is part of an experimental API and may change or be removed. type TaskProgress interface { taskProgress() @@ -14258,6 +14523,31 @@ func (TaskAgentProgress) Type() TaskProgressType { return TaskProgressTypeAgent } +// Generic progress for a client-owned task. +// Experimental: TaskClientProgress is part of an experimental API and may change or be +// removed. +type TaskClientProgress struct { + // Most recent nonempty progress message + LastMessage *string `json:"lastMessage,omitempty"` + // Current completion percentage from zero through one hundred + Percentage *float64 `json:"percentage,omitempty"` + // Current owner-defined progress phase + Phase *string `json:"phase,omitempty"` + // Recent server-timestamped progress messages + RecentActivity []TaskProgressLine `json:"recentActivity"` + // Sequence number of the latest accepted owner update + Sequence int64 `json:"sequence"` + // Current client task lifecycle status + Status TaskClientStatus `json:"status"` + // ISO 8601 timestamp of the latest accepted lifecycle change + UpdatedAt time.Time `json:"updatedAt"` +} + +func (TaskClientProgress) taskProgress() {} +func (TaskClientProgress) Type() TaskProgressType { + return TaskProgressTypeClient +} + // Progress snapshot for a shell task, with recent stdout/stderr output and optional process // ID. // Experimental: TaskShellProgress is part of an experimental API and may change or be @@ -14361,6 +14651,36 @@ type TasksPromoteToBackgroundResult struct { type TasksRefreshResult struct { } +// Registers or reclaims a client-owned task. +// Experimental: TasksRegisterRequest is part of an experimental API and may change or be +// removed. +type TasksRegisterRequest struct { + // Whether the owner supports runtime cancellation requests + Cancellable bool `json:"cancellable"` + // Owner-scoped idempotency key used for registration and reclaim + ClientTaskID string `json:"clientTaskId"` + // Human-readable description of the external work + Description string `json:"description"` + // Optional short display name for the external work + DisplayName *string `json:"displayName,omitempty"` + // Expected current sequence for idempotent registration or orphan reclaim + ExpectedSequence *int64 `json:"expectedSequence,omitempty"` + // Task kind + Type TaskClientType `json:"type"` +} + +// Result of registering or reclaiming a client-owned task. +// Experimental: TasksRegisterResult is part of an experimental API and may change or be +// removed. +type TasksRegisterResult struct { + // True only when this invocation created a new task + Created bool `json:"created"` + // True only when this invocation reclaimed an orphaned task + Reclaimed bool `json:"reclaimed"` + // Authoritative registered or reclaimed task + Task TaskClientInfo `json:"task"` +} + // Identifier of the completed or cancelled task to remove from tracking. // Experimental: TasksRemoveRequest is part of an experimental API and may change or be // removed. @@ -14425,6 +14745,30 @@ type TasksStartAgentResult struct { AgentID string `json:"agentId"` } +// Updates a client-owned task. +// Experimental: TasksUpdateRequest is part of an experimental API and may change or be +// removed. +type TasksUpdateRequest struct { + // Canonical runtime-generated task identifier + ID string `json:"id"` + // Owner update sequence to apply + Sequence int64 `json:"sequence"` + // Progress or terminal update payload + Update TaskClientUpdate `json:"update"` +} + +// Result of publishing a client-owned task update. +// Experimental: TasksUpdateResult is part of an experimental API and may change or be +// removed. +type TasksUpdateResult struct { + // Whether this invocation changed task state + Applied bool `json:"applied"` + // Whether this invocation repeated the latest accepted update + Duplicate bool `json:"duplicate"` + // Authoritative task after processing the update + Task TaskClientInfo `json:"task"` +} + // Wait until all in-flight background tasks (agents + shells) and any follow-up turns // scheduled by their completions have settled. Returns when the runtime is fully drained or // after an internal timeout (default 10 minutes; configurable via @@ -16440,6 +16784,18 @@ const ( CatalogUnsafeRetrievalReasonRedirectToBlockedAddress CatalogUnsafeRetrievalReason = "redirect-to-blocked-address" ) +// Why the runtime requests client-task cancellation. +// Experimental: ClientTaskCancelReason is part of an experimental API and may change or be +// removed. +type ClientTaskCancelReason string + +const ( + // A caller requested task cancellation. + ClientTaskCancelReasonCancelRequested ClientTaskCancelReason = "cancel_requested" + // The session is shutting down. + ClientTaskCancelReasonSessionShutdown ClientTaskCancelReason = "session_shutdown" +) + // Whether a pending slash-command invocation effect was applied or cancelled by the host. // Experimental: CommandsInvocationEffectOutcome is part of an experimental API and may // change or be removed. @@ -17816,6 +18172,22 @@ const ( ModelPolicyStateUnconfigured ModelPolicyState = "unconfigured" ) +// Whether the requested preference was already effective or was accepted for later +// transactional activation. +// Experimental: ModelSwitchAutoTierStatus is part of an experimental API and may change or +// be removed. +type ModelSwitchAutoTierStatus string + +const ( + // The request was accepted but has not committed. A later user turn using the `auto` model + // must mint and validate the replacement before it becomes effective. + ModelSwitchAutoTierStatusPending ModelSwitchAutoTierStatus = "pending" + // The requested preference is already effective. No activation is pending for it, although + // this request may have cancelled an earlier unclaimed preference reported in + // `supersededAutoTier`. + ModelSwitchAutoTierStatusUnchanged ModelSwitchAutoTierStatus = "unchanged" +) + // Why the binary data is absent: it exceeded the inline size limit, or its asset was // unavailable // Experimental: OmittedBinaryOmittedReason is part of an experimental API and may change or @@ -18974,6 +19346,89 @@ const ( SubagentSettingsEntryContextTierLongContext SubagentSettingsEntryContextTier = "long_context" ) +// Active status a client owner may publish with a progress update. +// Experimental: TaskClientActiveStatus is part of an experimental API and may change or be +// removed. +type TaskClientActiveStatus string + +const ( + // The external owner is connected but waiting. + TaskClientActiveStatusIdle TaskClientActiveStatus = "idle" + // The external owner is actively working. + TaskClientActiveStatusRunning TaskClientActiveStatus = "running" +) + +// Client-owned tasks always execute outside the runtime in background mode. +// Experimental: TaskClientExecutionMode is part of an experimental API and may change or be +// removed. +type TaskClientExecutionMode string + +const ( + TaskClientExecutionModeBackground TaskClientExecutionMode = "background" +) + +// Connection class owning a client task. +// Experimental: TaskClientOwnerKind is part of an experimental API and may change or be +// removed. +type TaskClientOwnerKind string + +const ( + // A discovered extension connection owns the task. + TaskClientOwnerKindExtension TaskClientOwnerKind = "extension" + // A generic SDK connection owns the task. + TaskClientOwnerKindSDK TaskClientOwnerKind = "sdk" +) + +// Presence of the task's bound join. +// Experimental: TaskClientOwnerPresence is part of an experimental API and may change or be +// removed. +type TaskClientOwnerPresence string + +const ( + // The bound session join is connected. + TaskClientOwnerPresenceConnected TaskClientOwnerPresence = "connected" + // The bound session join is disconnected. + TaskClientOwnerPresenceDisconnected TaskClientOwnerPresence = "disconnected" +) + +// Lifecycle status of a client-owned task. +// Experimental: TaskClientStatus is part of an experimental API and may change or be +// removed. +type TaskClientStatus string + +const ( + // The owner reported or confirmed cancellation. + TaskClientStatusCancelled TaskClientStatus = "cancelled" + // The owner reported successful completion. + TaskClientStatusCompleted TaskClientStatus = "completed" + // The owner reported failure. + TaskClientStatusFailed TaskClientStatus = "failed" + // The external owner is connected but waiting. + TaskClientStatusIdle TaskClientStatus = "idle" + // The bound owner join disappeared; external executor state is unknown. + TaskClientStatusOrphaned TaskClientStatus = "orphaned" + // The external owner is actively working. + TaskClientStatusRunning TaskClientStatus = "running" +) + +// Discriminator for a client-owned task. +// Experimental: TaskClientType is part of an experimental API and may change or be removed. +type TaskClientType string + +const ( + TaskClientTypeClient TaskClientType = "client" +) + +// Kind discriminator for TaskClientUpdate. +type TaskClientUpdateKind string + +const ( + TaskClientUpdateKindCancelled TaskClientUpdateKind = "cancelled" + TaskClientUpdateKindCompleted TaskClientUpdateKind = "completed" + TaskClientUpdateKindFailed TaskClientUpdateKind = "failed" + TaskClientUpdateKindProgress TaskClientUpdateKind = "progress" +) + // Semantic result of evaluating a task completion request // Experimental: TaskCompletionOutcome is part of an experimental API and may change or be // removed. @@ -19005,16 +19460,31 @@ const ( type TaskInfoType string const ( - TaskInfoTypeAgent TaskInfoType = "agent" - TaskInfoTypeShell TaskInfoType = "shell" + TaskInfoTypeAgent TaskInfoType = "agent" + TaskInfoTypeClient TaskInfoType = "client" + TaskInfoTypeShell TaskInfoType = "shell" +) + +// Closed set of public task kinds a connection can negotiate. +// Experimental: TaskKind is part of an experimental API and may change or be removed. +type TaskKind string + +const ( + // Runtime-owned background agent task. + TaskKindAgent TaskKind = "agent" + // Client-owned externally executed task. + TaskKindClient TaskKind = "client" + // Runtime-owned shell task. + TaskKindShell TaskKind = "shell" ) // Type discriminator for TaskProgress. type TaskProgressType string const ( - TaskProgressTypeAgent TaskProgressType = "agent" - TaskProgressTypeShell TaskProgressType = "shell" + TaskProgressTypeAgent TaskProgressType = "agent" + TaskProgressTypeClient TaskProgressType = "client" + TaskProgressTypeShell TaskProgressType = "shell" ) // Whether the shell runs inside a managed PTY session or as an independent background @@ -23874,13 +24344,15 @@ func (a *ModeAPI) Set(ctx context.Context, params *ModeSetRequest) (*ModeSetResu // Experimental: ModelAPI contains experimental APIs that may change or be removed. type ModelAPI sessionAPI -// GetCurrent gets the currently selected model for the session. +// GetCurrent gets the session's authoritative model snapshot, including the committed Auto +// preference and any newer unclaimed Auto preference waiting for a future user turn. // // RPC method: session.model.getCurrent. // -// Returns: The currently selected model, reasoning effort, and context tier for the -// session. The context tier reflects `Session.getContextTier()`, restored from the session -// journal on resume. +// Returns: The session's authoritative model snapshot. Auto preference fields are +// configuration for the virtual `auto` model and do not change the selected model +// identifier. The context tier reflects `Session.getContextTier()`, restored from the +// session journal on resume. func (a *ModelAPI) GetCurrent(ctx context.Context) (*CurrentModel, error) { req := map[string]any{"sessionId": a.sessionID} raw, err := a.client.Request(ctx, "session.model.getCurrent", req) @@ -23951,6 +24423,40 @@ func (a *ModelAPI) SetReasoningEffort(ctx context.Context, params *ModelSetReaso return &result, nil } +// SwitchAutoTier requests an Auto preference change without changing the session's selected +// model. The latest unclaimed request wins; the runtime commits it only after a later +// prompt using the `auto` model mints a usable model and token pair. A `pending` response +// confirms that the request was accepted, not that it committed. Observe eventual success +// through `session.model_change`, failure through the ephemeral +// `session.auto_tier_switch_failed` event, or current unclaimed state through +// `session.model.getCurrent`. +// +// RPC method: session.model.switchAutoTier. +// +// Parameters: An Auto preference request for the session. This updates Auto configuration +// only; it does not change the selected model to `auto`. +// +// Returns: Immediate acknowledgement and Auto preference snapshot after a switch request. +// This result never implies that a pending preference committed. +func (a *ModelAPI) SwitchAutoTier(ctx context.Context, params *ModelSwitchAutoTierRequest) (*ModelSwitchAutoTierResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["autoTier"] = params.AutoTier + if params.Source != nil { + req["source"] = *params.Source + } + } + raw, err := a.client.Request(ctx, "session.model.switchAutoTier", req) + if err != nil { + return nil, err + } + var result ModelSwitchAutoTierResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // SwitchTo switches the session to a model and optional reasoning configuration. // // RPC method: session.model.switchTo. @@ -23962,6 +24468,9 @@ func (a *ModelAPI) SetReasoningEffort(ctx context.Context, params *ModelSetReaso func (a *ModelAPI) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) (*ModelSwitchToResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { + if params.AutoTier != nil { + req["autoTier"] = *params.AutoTier + } if params.CompactionDecision != nil { req["compactionDecision"] = *params.CompactionDecision } @@ -25838,6 +26347,39 @@ func (a *TasksAPI) Refresh(ctx context.Context) (*TasksRefreshResult, error) { return &result, nil } +// Registers a client-owned task, or reclaims an orphaned task belonging to the same +// extension principal. +// +// RPC method: session.tasks.register. +// +// Parameters: Registers or reclaims a client-owned task. +// +// Returns: Result of registering or reclaiming a client-owned task. +func (a *TasksAPI) Register(ctx context.Context, params *TasksRegisterRequest) (*TasksRegisterResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["cancellable"] = params.Cancellable + req["clientTaskId"] = params.ClientTaskID + req["description"] = params.Description + if params.DisplayName != nil { + req["displayName"] = *params.DisplayName + } + if params.ExpectedSequence != nil { + req["expectedSequence"] = *params.ExpectedSequence + } + req["type"] = params.Type + } + raw, err := a.client.Request(ctx, "session.tasks.register", req) + if err != nil { + return nil, err + } + var result TasksRegisterResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // Removes a completed or cancelled background task from tracking. // // RPC method: session.tasks.remove. @@ -25923,6 +26465,31 @@ func (a *TasksAPI) StartAgent(ctx context.Context, params *TasksStartAgentReques return &result, nil } +// Update publishes generic progress or a terminal outcome for a client-owned task. +// +// RPC method: session.tasks.update. +// +// Parameters: Updates a client-owned task. +// +// Returns: Result of publishing a client-owned task update. +func (a *TasksAPI) Update(ctx context.Context, params *TasksUpdateRequest) (*TasksUpdateResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["id"] = params.ID + req["sequence"] = params.Sequence + req["update"] = params.Update + } + raw, err := a.client.Request(ctx, "session.tasks.update", req) + if err != nil { + return nil, err + } + var result TasksUpdateResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // WaitForPending waits for all in-flight background tasks and any follow-up turns to settle. // // RPC method: session.tasks.waitForPending. @@ -28510,12 +29077,26 @@ type SessionFSHandler interface { WriteFile(request *SessionFSWriteFileRequest) (*SessionFSError, error) } +// Experimental: TasksHandler contains experimental APIs that may change or be removed. +type TasksHandler interface { + // Cancel asks the client currently bound to a client-owned session task to confirm that its + // external work stopped. + // + // RPC method: tasks.cancel. + // + // Parameters: Runtime-to-owner cancellation request for a client-owned task. + // + // Returns: Whether the client authoritatively confirmed its external work stopped. + Cancel(request *ClientTaskCancelRequest) (*ClientTaskCancelResult, error) +} + // ClientSessionAPIHandlers provides all client session API handler groups for a session. type ClientSessionAPIHandlers struct { Canvas CanvasHandler Factory FactoryHandler ProviderToken ProviderTokenHandler SessionFS SessionFSHandler + Tasks TasksHandler } func clientSessionHandlerError(err error) *jsonrpc2.Error { @@ -28893,6 +29474,25 @@ func RegisterClientSessionAPIHandlers(client *jsonrpc2.Client, getHandlers func( } return raw, nil }) + client.SetRequestHandler("tasks.cancel", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { + var request ClientTaskCancelRequest + if err := json.Unmarshal(params, &request); err != nil { + return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} + } + handlers := getHandlers(request.SessionID) + if handlers == nil || handlers.Tasks == nil { + return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No tasks handler registered for session: %s", request.SessionID)} + } + result, err := handlers.Tasks.Cancel(&request) + if err != nil { + return nil, clientSessionHandlerError(err) + } + raw, err := json.Marshal(result) + if err != nil { + return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("Failed to marshal response: %v", err)} + } + return raw, nil + }) } // Experimental: ExtensionLaunchProviderHandler contains experimental APIs that may change diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go index 9242a889a8..13d190be22 100644 --- a/go/rpc/zrpc_encoding.go +++ b/go/rpc/zrpc_encoding.go @@ -5381,6 +5381,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { AgentContext *string `json:"agentContext,omitempty"` AllowAllMCPServerInstructions *bool `json:"allowAllMcpServerInstructions,omitempty"` AskUserDisabled *bool `json:"askUserDisabled,omitempty"` + AuthClientIDMetadataURL *string `json:"authClientIdMetadataUrl,omitempty"` AuthInfo json.RawMessage `json:"authInfo,omitempty"` AvailableTools []string `json:"availableTools,omitzero"` Capi *CapiSessionOptions `json:"capi,omitempty"` @@ -5457,6 +5458,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { r.AgentContext = raw.AgentContext r.AllowAllMCPServerInstructions = raw.AllowAllMCPServerInstructions r.AskUserDisabled = raw.AskUserDisabled + r.AuthClientIDMetadataURL = raw.AuthClientIDMetadataURL if raw.AuthInfo != nil { value, err := unmarshalAuthInfo(raw.AuthInfo) if err != nil { @@ -5945,6 +5947,103 @@ func (r SlashCommandTextResult) MarshalJSON() ([]byte, error) { }) } +func unmarshalTaskClientUpdate(data []byte) (TaskClientUpdate, error) { + if string(data) == "null" { + return nil, nil + } + type rawUnion struct { + Kind TaskClientUpdateKind `json:"kind"` + } + var raw rawUnion + if err := json.Unmarshal(data, &raw); err != nil { + return nil, err + } + + switch raw.Kind { + case TaskClientUpdateKindCancelled: + var d TaskClientUpdateCancelled + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case TaskClientUpdateKindCompleted: + var d TaskClientUpdateCompleted + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case TaskClientUpdateKindFailed: + var d TaskClientUpdateFailed + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + case TaskClientUpdateKindProgress: + var d TaskClientUpdateProgress + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil + default: + return &RawTaskClientUpdateData{Discriminator: raw.Kind, Raw: data}, nil + } +} + +func (r RawTaskClientUpdateData) MarshalJSON() ([]byte, error) { + if r.Raw != nil { + return r.Raw, nil + } + return json.Marshal(struct { + Kind TaskClientUpdateKind `json:"kind"` + }{ + Kind: r.Discriminator, + }) +} + +func (r TaskClientUpdateCancelled) MarshalJSON() ([]byte, error) { + type alias TaskClientUpdateCancelled + return json.Marshal(struct { + Kind TaskClientUpdateKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + +func (r TaskClientUpdateCompleted) MarshalJSON() ([]byte, error) { + type alias TaskClientUpdateCompleted + return json.Marshal(struct { + Kind TaskClientUpdateKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + +func (r TaskClientUpdateFailed) MarshalJSON() ([]byte, error) { + type alias TaskClientUpdateFailed + return json.Marshal(struct { + Kind TaskClientUpdateKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + +func (r TaskClientUpdateProgress) MarshalJSON() ([]byte, error) { + type alias TaskClientUpdateProgress + return json.Marshal(struct { + Kind TaskClientUpdateKind `json:"kind"` + alias + }{ + Kind: r.Kind(), + alias: alias(r), + }) +} + func unmarshalTaskInfo(data []byte) (TaskInfo, error) { if string(data) == "null" { return nil, nil @@ -5964,6 +6063,12 @@ func unmarshalTaskInfo(data []byte) (TaskInfo, error) { return nil, err } return &d, nil + case TaskInfoTypeClient: + var d TaskClientInfo + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case TaskInfoTypeShell: var d TaskShellInfo if err := json.Unmarshal(data, &d); err != nil { @@ -5997,6 +6102,17 @@ func (r TaskAgentInfo) MarshalJSON() ([]byte, error) { }) } +func (r TaskClientInfo) MarshalJSON() ([]byte, error) { + type alias TaskClientInfo + return json.Marshal(struct { + Type TaskInfoType `json:"type"` + alias + }{ + Type: r.Type(), + alias: alias(r), + }) +} + func (r TaskShellInfo) MarshalJSON() ([]byte, error) { type alias TaskShellInfo return json.Marshal(struct { @@ -6048,6 +6164,12 @@ func unmarshalTaskProgress(data []byte) (TaskProgress, error) { return nil, err } return &d, nil + case TaskProgressTypeClient: + var d TaskClientProgress + if err := json.Unmarshal(data, &d); err != nil { + return nil, err + } + return &d, nil case TaskProgressTypeShell: var d TaskShellProgress if err := json.Unmarshal(data, &d); err != nil { @@ -6081,6 +6203,17 @@ func (r TaskAgentProgress) MarshalJSON() ([]byte, error) { }) } +func (r TaskClientProgress) MarshalJSON() ([]byte, error) { + type alias TaskClientProgress + return json.Marshal(struct { + Type TaskProgressType `json:"type"` + alias + }{ + Type: r.Type(), + alias: alias(r), + }) +} + func (r TaskShellProgress) MarshalJSON() ([]byte, error) { type alias TaskShellProgress return json.Marshal(struct { @@ -6146,6 +6279,28 @@ func (r *TasksPromoteCurrentToBackgroundResult) UnmarshalJSON(data []byte) error return nil } +func (r *TasksUpdateRequest) UnmarshalJSON(data []byte) error { + type rawTasksUpdateRequest struct { + ID string `json:"id"` + Sequence int64 `json:"sequence"` + Update json.RawMessage `json:"update"` + } + var raw rawTasksUpdateRequest + if err := json.Unmarshal(data, &raw); err != nil { + return err + } + r.ID = raw.ID + r.Sequence = raw.Sequence + if raw.Update != nil { + value, err := unmarshalTaskClientUpdate(raw.Update) + if err != nil { + return err + } + r.Update = value + } + return nil +} + func (r *ToolResultExpanded) UnmarshalJSON(data []byte) error { type rawToolResultExpanded struct { BinaryResultsForLlm []ExternalToolTextResultForLlmBinaryResultsForLlm `json:"binaryResultsForLlm,omitzero"` diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index bbe9fbc74b..a220b79ad5 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -389,6 +389,12 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionAutoTierSwitchFailed: + var d SessionAutoTierSwitchFailedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionBackgroundTasksChanged: var d SessionBackgroundTasksChangedData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -563,6 +569,18 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionMCPServerNeedsReconnect: + var d SessionMCPServerNeedsReconnectData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeSessionMCPServerRemoved: + var d SessionMCPServerRemovedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionMCPServersLoaded: var d SessionMCPServersLoadedData if err := json.Unmarshal(raw.Data, &d); err != nil { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 63709921d8..ccddffb360 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -128,6 +128,7 @@ const ( // that may change or be removed. SessionEventTypeSessionAutoModeResolved SessionEventType = "session.auto_mode_resolved" SessionEventTypeSessionAutopilotObjectiveChanged SessionEventType = "session.autopilot_objective_changed" + SessionEventTypeSessionAutoTierSwitchFailed SessionEventType = "session.auto_tier_switch_failed" SessionEventTypeSessionBackgroundTasksChanged SessionEventType = "session.background_tasks_changed" // Experimental: SessionEventTypeSessionBinaryAsset identifies an experimental event that // may change or be removed. @@ -185,6 +186,8 @@ const ( // Experimental: SessionEventTypeSessionManagedSettingsResolved identifies an experimental // event that may change or be removed. SessionEventTypeSessionManagedSettingsResolved SessionEventType = "session.managed_settings_resolved" + SessionEventTypeSessionMCPServerNeedsReconnect SessionEventType = "session.mcp_server_needs_reconnect" + SessionEventTypeSessionMCPServerRemoved SessionEventType = "session.mcp_server_removed" SessionEventTypeSessionMCPServersLoaded SessionEventType = "session.mcp_servers_loaded" SessionEventTypeSessionMCPServerStatusChanged SessionEventType = "session.mcp_server_status_changed" SessionEventTypeSessionModeChanged SessionEventType = "session.mode_changed" @@ -306,6 +309,21 @@ type PromptCacheBreakData struct { func (*PromptCacheBreakData) sessionEventData() {} func (*PromptCacheBreakData) Type() SessionEventType { return SessionEventTypePromptCacheBreak } +// A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. +type SessionAutoTierSwitchFailedData struct { + // Auto preference that remains effective after the failed request. + EffectiveAutoTier *AutoTier `json:"effectiveAutoTier,omitempty"` + // Low-cardinality failure outcome reported by Auto resolution. + Reason AutoTierSwitchFailureReason `json:"reason"` + // Auto preference that failed to activate, or null when returning to provider-default routing failed. + RequestedAutoTier *AutoTier `json:"requestedAutoTier"` +} + +func (*SessionAutoTierSwitchFailedData) sessionEventData() {} +func (*SessionAutoTierSwitchFailedData) Type() SessionEventType { + return SessionEventTypeSessionAutoTierSwitchFailed +} + // Agent intent description for current activity or plan type AssistantIntentData struct { // Short description of what the agent is currently doing or planning to do @@ -1577,12 +1595,16 @@ func (*ModelCallStartData) Type() SessionEventType { return SessionEventTypeMode // Model change details including previous and new model identifiers type SessionModelChangeData struct { + // Committed Auto preference after the model configuration change, when applicable. + AutoTier *AutoTier `json:"autoTier,omitempty"` // Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. Cause *string `json:"cause,omitempty"` // Context tier after the model change; null explicitly clears a previously selected tier ContextTier *ContextTier `json:"contextTier,omitempty"` // Newly selected model identifier NewModel string `json:"newModel"` + // Previously committed Auto preference, when one was explicitly selected. + PreviousAutoTier *AutoTier `json:"previousAutoTier,omitempty"` // Model that was previously selected, if any PreviousModel *string `json:"previousModel,omitempty"` // Reasoning effort level before the model change, if applicable @@ -1822,6 +1844,28 @@ func (*SessionExtensionsLoadedData) Type() SessionEventType { return SessionEventTypeSessionExtensionsLoaded } +// Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. +type SessionMCPServerNeedsReconnectData struct { + // Name of the MCP server that needs to reconnect + ServerName string `json:"serverName"` +} + +func (*SessionMCPServerNeedsReconnectData) sessionEventData() {} +func (*SessionMCPServerNeedsReconnectData) Type() SessionEventType { + return SessionEventTypeSessionMCPServerNeedsReconnect +} + +// Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. +type SessionMCPServerRemovedData struct { + // Name of the MCP server that was removed from the graph + ServerName string `json:"serverName"` +} + +func (*SessionMCPServerRemovedData) sessionEventData() {} +func (*SessionMCPServerRemovedData) Type() SessionEventType { + return SessionEventTypeSessionMCPServerRemoved +} + // Payload of `session.mcp_server_status_changed` for one MCP server's status and optional failure error. type SessionMCPServerStatusChangedData struct { // Error message if the server entered a failed state @@ -5119,6 +5163,20 @@ const ( AutopilotObjectiveChangedStatusPaused AutopilotObjectiveChangedStatus = "paused" ) +// Terminal reason an Auto preference activation failed. +type AutoTierSwitchFailureReason string + +const ( + // The candidate model was rejected by model policy. + AutoTierSwitchFailureReasonPolicyRejected AutoTierSwitchFailureReason = "policy_rejected" + // The Auto routing request failed or returned an unusable response. + AutoTierSwitchFailureReasonRequestFailed AutoTierSwitchFailureReason = "request_failed" + // The runtime could not prepare the Auto routing request. + AutoTierSwitchFailureReasonSetupFailed AutoTierSwitchFailureReason = "setup_failed" + // The provider does not support Auto routing. + AutoTierSwitchFailureReasonUnsupported AutoTierSwitchFailureReason = "unsupported" +) + // Binary result type discriminator. Use "image" for images and "resource" for other binary data. type BinaryAssetReferenceType string diff --git a/go/zsession_events.go b/go/zsession_events.go index b5f6fa34f0..8ac49affba 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -73,6 +73,7 @@ type ( AutoModeSwitchResponse = rpc.AutoModeSwitchResponse AutopilotObjectiveChangedOperation = rpc.AutopilotObjectiveChangedOperation AutopilotObjectiveChangedStatus = rpc.AutopilotObjectiveChangedStatus + AutoTierSwitchFailureReason = rpc.AutoTierSwitchFailureReason BinaryAssetReference = rpc.BinaryAssetReference BinaryAssetReferenceType = rpc.BinaryAssetReferenceType BinaryAssetType = rpc.BinaryAssetType @@ -263,6 +264,7 @@ type ( ScheduleOrigin = rpc.ScheduleOrigin SessionAutoModeResolvedData = rpc.SessionAutoModeResolvedData SessionAutopilotObjectiveChangedData = rpc.SessionAutopilotObjectiveChangedData + SessionAutoTierSwitchFailedData = rpc.SessionAutoTierSwitchFailedData SessionBackgroundTasksChangedData = rpc.SessionBackgroundTasksChangedData SessionBinaryAssetData = rpc.SessionBinaryAssetData SessionCanvasClosedData = rpc.SessionCanvasClosedData @@ -298,6 +300,8 @@ type ( SessionLimitsExhaustedResponseAction = rpc.SessionLimitsExhaustedResponseAction SessionManagedSettingsEnforcedData = rpc.SessionManagedSettingsEnforcedData SessionManagedSettingsResolvedData = rpc.SessionManagedSettingsResolvedData + SessionMCPServerNeedsReconnectData = rpc.SessionMCPServerNeedsReconnectData + SessionMCPServerRemovedData = rpc.SessionMCPServerRemovedData SessionMCPServersLoadedData = rpc.SessionMCPServersLoadedData SessionMCPServerStatusChangedData = rpc.SessionMCPServerStatusChangedData SessionMode = rpc.SessionMode @@ -487,6 +491,10 @@ const ( AutopilotObjectiveChangedStatusCapReached = rpc.AutopilotObjectiveChangedStatusCapReached AutopilotObjectiveChangedStatusCompleted = rpc.AutopilotObjectiveChangedStatusCompleted AutopilotObjectiveChangedStatusPaused = rpc.AutopilotObjectiveChangedStatusPaused + AutoTierSwitchFailureReasonPolicyRejected = rpc.AutoTierSwitchFailureReasonPolicyRejected + AutoTierSwitchFailureReasonRequestFailed = rpc.AutoTierSwitchFailureReasonRequestFailed + AutoTierSwitchFailureReasonSetupFailed = rpc.AutoTierSwitchFailureReasonSetupFailed + AutoTierSwitchFailureReasonUnsupported = rpc.AutoTierSwitchFailureReasonUnsupported BinaryAssetReferenceTypeImage = rpc.BinaryAssetReferenceTypeImage BinaryAssetReferenceTypeResource = rpc.BinaryAssetReferenceTypeResource BinaryAssetTypeImage = rpc.BinaryAssetTypeImage @@ -750,6 +758,7 @@ const ( SessionEventTypeSandboxDecision = rpc.SessionEventTypeSandboxDecision SessionEventTypeSessionAutoModeResolved = rpc.SessionEventTypeSessionAutoModeResolved SessionEventTypeSessionAutopilotObjectiveChanged = rpc.SessionEventTypeSessionAutopilotObjectiveChanged + SessionEventTypeSessionAutoTierSwitchFailed = rpc.SessionEventTypeSessionAutoTierSwitchFailed SessionEventTypeSessionBackgroundTasksChanged = rpc.SessionEventTypeSessionBackgroundTasksChanged SessionEventTypeSessionBinaryAsset = rpc.SessionEventTypeSessionBinaryAsset SessionEventTypeSessionCanvasClosed = rpc.SessionEventTypeSessionCanvasClosed @@ -779,6 +788,8 @@ const ( SessionEventTypeSessionLimitsExhaustedRequested = rpc.SessionEventTypeSessionLimitsExhaustedRequested SessionEventTypeSessionManagedSettingsEnforced = rpc.SessionEventTypeSessionManagedSettingsEnforced SessionEventTypeSessionManagedSettingsResolved = rpc.SessionEventTypeSessionManagedSettingsResolved + SessionEventTypeSessionMCPServerNeedsReconnect = rpc.SessionEventTypeSessionMCPServerNeedsReconnect + SessionEventTypeSessionMCPServerRemoved = rpc.SessionEventTypeSessionMCPServerRemoved SessionEventTypeSessionMCPServersLoaded = rpc.SessionEventTypeSessionMCPServersLoaded SessionEventTypeSessionMCPServerStatusChanged = rpc.SessionEventTypeSessionMCPServerStatusChanged SessionEventTypeSessionModeChanged = rpc.SessionEventTypeSessionModeChanged diff --git a/java/pom.xml b/java/pom.xml index 285cb7bb9a..bf21d05af4 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -63,7 +63,7 @@ DO NOT EDIT MANUALLY. Updated by the update-copilot-dependency workflow. --> - ^1.0.83-3 + ^1.0.83-4 true diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index 44a6d9fe9d..6a5225e54b 100644 --- a/java/scripts/codegen/package-lock.json +++ b/java/scripts/codegen/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "copilot-sdk-java-codegen", "dependencies": { - "@github/copilot": "^1.0.83-3", + "@github/copilot": "^1.0.83-4", "json-schema": "^0.4.0", "tsx": "^4.23.13" } @@ -428,9 +428,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.83-3.tgz", - "integrity": "sha512-4+5wVGC2IvLYog3kdfmY6rg+NIGJesjENVrTONZr6uic6zR+8Ksgy+sCWO86n6AARs09MXktAZNHbbrXz+hl7A==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.83-4.tgz", + "integrity": "sha512-IiUDou0khxU8hu3Xjfq0uwp08qqZwJROizROC+ZMUZaUZGOMD64UXi4N/hauosTEnL/kI/WxzYKw4kO7W6LtpQ==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -439,20 +439,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.83-3", - "@github/copilot-darwin-x64": "1.0.83-3", - "@github/copilot-linux-arm64": "1.0.83-3", - "@github/copilot-linux-x64": "1.0.83-3", - "@github/copilot-linuxmusl-arm64": "1.0.83-3", - "@github/copilot-linuxmusl-x64": "1.0.83-3", - "@github/copilot-win32-arm64": "1.0.83-3", - "@github/copilot-win32-x64": "1.0.83-3" + "@github/copilot-darwin-arm64": "1.0.83-4", + "@github/copilot-darwin-x64": "1.0.83-4", + "@github/copilot-linux-arm64": "1.0.83-4", + "@github/copilot-linux-x64": "1.0.83-4", + "@github/copilot-linuxmusl-arm64": "1.0.83-4", + "@github/copilot-linuxmusl-x64": "1.0.83-4", + "@github/copilot-win32-arm64": "1.0.83-4", + "@github/copilot-win32-x64": "1.0.83-4" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.83-3.tgz", - "integrity": "sha512-pNI71CRL2WR6Wp+Nm+HOsSBcUIOoybcSZtMHqm2zwJGdzAjzv6MU2lLOFFeqhBh8UNQGltD4KtPU/pr+t6t4Uw==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.83-4.tgz", + "integrity": "sha512-rImrvW6dGC16Fu2MLPGNyxb1Nav9n+E5o4hKqyzC1NvK+9kknH8vPTosDEJt4+QEYPCGqyicTjfEoFvQjam6gg==", "cpu": [ "arm64" ], @@ -466,9 +466,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.83-3.tgz", - "integrity": "sha512-9LKUwR7em12mz76s2ytWl/xkHyF13t0TLScAUcnNNj171/Kvg0lWNemwsmPK4m0QbbcmRUs7FyFFF79TmKBAmA==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.83-4.tgz", + "integrity": "sha512-w7ZGwEwDutVLBfkO0WcJaHuNpv/OZxHbtj0cAzGFHYt6NiC7Pk/VQ9X+OAZBlVby/75yCC0Lf2SlIHM7/4Weqw==", "cpu": [ "x64" ], @@ -482,9 +482,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.83-3.tgz", - "integrity": "sha512-ouGA46t6flyUqUdutQL+94bnD+IwcCurR+5KS2JPHozbkeiR2BW4ed0ZZ5KT/6I13mTsjO9uu9LvWwfO5+PjiQ==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.83-4.tgz", + "integrity": "sha512-UksdtQRk+sYVNP+X0VhGDhmmOE1kW9Bmnkj+1zLspwRxuzAZwLY5LXzrZ0/HIw5s6xQKDTWJKGWPlRvipK3mrQ==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.83-3.tgz", - "integrity": "sha512-AiAf2yVrnP+Dw0M8RpacpOoK89sMFizPMuQfFPxAJUWS9hIw5mq4o4invKtUfiz0F7cjxaDJZz1JLUSuGEAQhw==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.83-4.tgz", + "integrity": "sha512-Pxc6f9ear0vt0oMkG1tMxxDKQBsazaUiU7fcWYlfA1qBog0Q+UYoFxAmENNVPREPZ71nwM7P6gW7iO/GdMfYug==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.83-3.tgz", - "integrity": "sha512-TmXPXi65OX/Wfd7JnU8RZjZxzc5kFZU/3Gvr/N1Y+G+cJJyB0NBmWk2PP+yD381ASYOOgeNgWitlYMw8tU7Ddg==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.83-4.tgz", + "integrity": "sha512-Y4AjA9FCMzlfYcS9GYffXiJLEe0yXwFWB/lGT8em0P0Pvi/U2cOxuZu/4CzFrSE8zDhBLwI8/JAZWCE0pPeV7g==", "cpu": [ "arm64" ], @@ -530,9 +530,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.83-3.tgz", - "integrity": "sha512-Zlbya4anjkbI8LcbenwuBhxUUeVIrGJqeYh/6JUWwnisOiuuimqQ4zb2UU2pX3vxE03f2PbTcueOo/GkF6AS8A==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.83-4.tgz", + "integrity": "sha512-Gg6amLZ6M2kxVSCghLcFpT+T/mwIJLK/oV5XyHZW0wnsYaoaeTlAUpJJ+K4JwRxyxTeFGxRV7woUmY3iWRU1EQ==", "cpu": [ "x64" ], @@ -546,9 +546,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.83-3.tgz", - "integrity": "sha512-zNmVj3ZDmI3dFmBigfEMzEvMxyjBjL5+nTVxrt9fvTA+29jI0C6A+cdCqrad3fJ1RKgn2RbsZyhnpyViPNhNDw==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.83-4.tgz", + "integrity": "sha512-ZYqGCzJyQlw4DquuIJQAKEud9OpNizOgpTwoLTgf6ej3glqM+ISu8iVIQ9EQFhaI6m9KrXJ4iwCpFjUwv7zWDQ==", "cpu": [ "arm64" ], @@ -562,9 +562,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.83-3", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.83-3.tgz", - "integrity": "sha512-pbw739Jdwjr4ovsjwpMI1hguZyOPwTy/fdVnrgBv1nazXxIFrwE3tq0FgzF0NnNcs4r5LXdbIBjKQP+HKFZagA==", + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.83-4.tgz", + "integrity": "sha512-BZB6DkRaj2n0UXXgG5IqVz7FN3gMBpEh6tdv1DGfIsfMVlCwQWGR5gb5fzOfxVlJWAlxxBk7nmJYFsYgZtC7yQ==", "cpu": [ "x64" ], diff --git a/java/scripts/codegen/package.json b/java/scripts/codegen/package.json index a9f84732a2..4010551edd 100644 --- a/java/scripts/codegen/package.json +++ b/java/scripts/codegen/package.json @@ -7,7 +7,7 @@ "generate:java": "tsx java.ts" }, "dependencies": { - "@github/copilot": "^1.0.83-3", + "@github/copilot": "^1.0.83-4", "json-schema": "^0.4.0", "tsx": "^4.23.13" } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/AutoTierSwitchFailureReason.java b/java/sdk/src/generated/java/com/github/copilot/generated/AutoTierSwitchFailureReason.java new file mode 100644 index 0000000000..4180045ace --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/AutoTierSwitchFailureReason.java @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import javax.annotation.processing.Generated; + +/** + * Terminal reason an Auto preference activation failed. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum AutoTierSwitchFailureReason { + /** The {@code policy_rejected} variant. */ + POLICY_REJECTED("policy_rejected"), + /** The {@code request_failed} variant. */ + REQUEST_FAILED("request_failed"), + /** The {@code setup_failed} variant. */ + SETUP_FAILED("setup_failed"), + /** The {@code unsupported} variant. */ + UNSUPPORTED("unsupported"); + + private final String value; + AutoTierSwitchFailureReason(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static AutoTierSwitchFailureReason fromValue(String value) { + for (AutoTierSwitchFailureReason v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown AutoTierSwitchFailureReason value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierSwitchFailedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierSwitchFailedEvent.java new file mode 100644 index 0000000000..7509bb678f --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionAutoTierSwitchFailedEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.auto_tier_switch_failed". A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionAutoTierSwitchFailedEvent extends SessionEvent { + + @Override + public String getType() { return "session.auto_tier_switch_failed"; } + + @JsonProperty("data") + private SessionAutoTierSwitchFailedEventData data; + + public SessionAutoTierSwitchFailedEventData getData() { return data; } + public void setData(SessionAutoTierSwitchFailedEventData data) { this.data = data; } + + /** Data payload for {@link SessionAutoTierSwitchFailedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionAutoTierSwitchFailedEventData( + /** Auto preference that remains effective after the failed request. */ + @JsonProperty("effectiveAutoTier") AutoTier effectiveAutoTier, + /** Auto preference that failed to activate, or null when returning to provider-default routing failed. */ + @JsonProperty("requestedAutoTier") AutoTier requestedAutoTier, + /** Low-cardinality failure outcome reported by Auto resolution. */ + @JsonProperty("reason") AutoTierSwitchFailureReason reason + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java index 193aa56b8f..367fa120b5 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionEvent.java @@ -38,6 +38,7 @@ @JsonSubTypes.Type(value = SessionInfoEvent.class, name = "session.info"), @JsonSubTypes.Type(value = SessionWarningEvent.class, name = "session.warning"), @JsonSubTypes.Type(value = SessionModelChangeEvent.class, name = "session.model_change"), + @JsonSubTypes.Type(value = SessionAutoTierSwitchFailedEvent.class, name = "session.auto_tier_switch_failed"), @JsonSubTypes.Type(value = SessionModeChangedEvent.class, name = "session.mode_changed"), @JsonSubTypes.Type(value = SessionModeNoticeDeliveredEvent.class, name = "session.mode_notice_delivered"), @JsonSubTypes.Type(value = SessionSessionLimitsChangedEvent.class, name = "session.session_limits_changed"), @@ -146,6 +147,8 @@ @JsonSubTypes.Type(value = SessionCustomAgentsUpdatedEvent.class, name = "session.custom_agents_updated"), @JsonSubTypes.Type(value = SessionMcpServersLoadedEvent.class, name = "session.mcp_servers_loaded"), @JsonSubTypes.Type(value = SessionMcpServerStatusChangedEvent.class, name = "session.mcp_server_status_changed"), + @JsonSubTypes.Type(value = SessionMcpServerRemovedEvent.class, name = "session.mcp_server_removed"), + @JsonSubTypes.Type(value = SessionMcpServerNeedsReconnectEvent.class, name = "session.mcp_server_needs_reconnect"), @JsonSubTypes.Type(value = McpToolsListChangedEvent.class, name = "mcp.tools.list_changed"), @JsonSubTypes.Type(value = McpResourcesListChangedEvent.class, name = "mcp.resources.list_changed"), @JsonSubTypes.Type(value = McpPromptsListChangedEvent.class, name = "mcp.prompts.list_changed"), @@ -174,6 +177,7 @@ public abstract sealed class SessionEvent permits SessionInfoEvent, SessionWarningEvent, SessionModelChangeEvent, + SessionAutoTierSwitchFailedEvent, SessionModeChangedEvent, SessionModeNoticeDeliveredEvent, SessionSessionLimitsChangedEvent, @@ -282,6 +286,8 @@ public abstract sealed class SessionEvent permits SessionCustomAgentsUpdatedEvent, SessionMcpServersLoadedEvent, SessionMcpServerStatusChangedEvent, + SessionMcpServerRemovedEvent, + SessionMcpServerNeedsReconnectEvent, McpToolsListChangedEvent, McpResourcesListChangedEvent, McpPromptsListChangedEvent, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerNeedsReconnectEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerNeedsReconnectEvent.java new file mode 100644 index 0000000000..9b03a66b94 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerNeedsReconnectEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.mcp_server_needs_reconnect". Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionMcpServerNeedsReconnectEvent extends SessionEvent { + + @Override + public String getType() { return "session.mcp_server_needs_reconnect"; } + + @JsonProperty("data") + private SessionMcpServerNeedsReconnectEventData data; + + public SessionMcpServerNeedsReconnectEventData getData() { return data; } + public void setData(SessionMcpServerNeedsReconnectEventData data) { this.data = data; } + + /** Data payload for {@link SessionMcpServerNeedsReconnectEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionMcpServerNeedsReconnectEventData( + /** Name of the MCP server that needs to reconnect */ + @JsonProperty("serverName") String serverName + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerRemovedEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerRemovedEvent.java new file mode 100644 index 0000000000..68b5107118 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionMcpServerRemovedEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.mcp_server_removed". Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionMcpServerRemovedEvent extends SessionEvent { + + @Override + public String getType() { return "session.mcp_server_removed"; } + + @JsonProperty("data") + private SessionMcpServerRemovedEventData data; + + public SessionMcpServerRemovedEventData getData() { return data; } + public void setData(SessionMcpServerRemovedEventData data) { this.data = data; } + + /** Data payload for {@link SessionMcpServerRemovedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionMcpServerRemovedEventData( + /** Name of the MCP server that was removed from the graph */ + @JsonProperty("serverName") String serverName + ) { + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java b/java/sdk/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java index 868d78fe0d..4ea1dbd46d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/SessionModelChangeEvent.java @@ -55,7 +55,11 @@ public record SessionModelChangeEventData( /** Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. */ @JsonProperty("cause") String cause, /** Origin of the effective model change, when known. */ - @JsonProperty("source") ModelChangeSource source + @JsonProperty("source") ModelChangeSource source, + /** Previously committed Auto preference, when one was explicitly selected. */ + @JsonProperty("previousAutoTier") AutoTier previousAutoTier, + /** Committed Auto preference after the model configuration change, when applicable. */ + @JsonProperty("autoTier") AutoTier autoTier ) { } } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java index e77117b2cb..4fd7a91ca2 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record CapiSessionOptions( - /** Routing preference used when the session model is `auto`. The runtime persists the preference across cold resume. When omitted, the default routing behavior is used. Resuming an already-resident session cannot change its preference. */ + /** Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. */ @JsonProperty("autoTier") AutoTier autoTier, /** 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. */ @JsonProperty("enableWebSocketResponses") Boolean enableWebSocketResponses diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientTaskCancelReason.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientTaskCancelReason.java new file mode 100644 index 0000000000..723e7e80b0 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ClientTaskCancelReason.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Why the runtime requests client-task cancellation. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ClientTaskCancelReason { + /** The {@code cancel_requested} variant. */ + CANCEL_REQUESTED("cancel_requested"), + /** The {@code session_shutdown} variant. */ + SESSION_SHUTDOWN("session_shutdown"); + + private final String value; + ClientTaskCancelReason(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ClientTaskCancelReason fromValue(String value) { + for (ClientTaskCancelReason v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ClientTaskCancelReason value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java index 05f2534970..0975b7bd87 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectParams.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.github.copilot.CopilotExperimental; +import java.util.List; import javax.annotation.processing.Generated; /** @@ -28,6 +29,8 @@ public record ConnectParams( @JsonProperty("enableGitHubTelemetryForwarding") Boolean enableGitHubTelemetryForwarding, /** Identity of the integrating host. Optional; omit it to keep the default attribution. */ @JsonProperty("clientInfo") ConnectClientInfo clientInfo, + /** Task kinds this connection can decode when observing session tasks. Omit to retain agent and shell compatibility. */ + @JsonProperty("supportedTaskKinds") List supportedTaskKinds, /** Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN */ @JsonProperty("token") String token ) { diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java index 8c12b57a80..41a200ff4b 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ConnectResult.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.github.copilot.CopilotExperimental; +import java.util.List; import javax.annotation.processing.Generated; /** @@ -29,6 +30,8 @@ public record ConnectResult( /** Server protocol version number */ @JsonProperty("protocolVersion") Long protocolVersion, /** Server package version */ - @JsonProperty("version") String version + @JsonProperty("version") String version, + /** Task kinds the server may return to this connection. */ + @JsonProperty("taskKinds") List taskKinds ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CurrentModel.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CurrentModel.java new file mode 100644 index 0000000000..bf5f9a8b97 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/CurrentModel.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record CurrentModel( + /** Currently active model identifier */ + @JsonProperty("modelId") String modelId, + /** Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. */ + @JsonProperty("reasoningEffort") String reasoningEffort, + /** Context tier for models that support multiple context-window sizes. */ + @JsonProperty("contextTier") ContextTier contextTier, + /** Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it. */ + @JsonProperty("autoTier") AutoTier autoTier, + /** Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. */ + @JsonProperty("pendingAutoTier") AutoTier pendingAutoTier, + /** Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. */ + @JsonProperty("activatingAutoTier") AutoTier activatingAutoTier +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java index 81a0aa0e21..74258dcfc5 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/McpConfigRemoveParams.java @@ -25,6 +25,8 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record McpConfigRemoveParams( /** Name of the MCP server to remove */ - @JsonProperty("name") String name + @JsonProperty("name") String name, + /** OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. */ + @JsonProperty("authClientIdMetadataUrl") String authClientIdMetadataUrl ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/Model.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/Model.java index a652e8f4f6..3e9f0b6b87 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/Model.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/Model.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; import javax.annotation.processing.Generated; /** @@ -28,6 +29,8 @@ public record Model( @JsonProperty("name") String name, /** Model capabilities and limits */ @JsonProperty("capabilities") ModelCapabilities capabilities, + /** Provider-supplied model metadata. Keys and JSON-compatible values are preserved unchanged. This is factual metadata published by the model provider; it carries no picker or UX semantics. */ + @JsonProperty("metadata") Map metadata, /** Policy state (if applicable) */ @JsonProperty("policy") ModelPolicy policy, /** Billing information */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ModelSwitchAutoTierStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ModelSwitchAutoTierStatus.java new file mode 100644 index 0000000000..e4a1baed5e --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ModelSwitchAutoTierStatus.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Whether the requested preference was already effective or was accepted for later transactional activation. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ModelSwitchAutoTierStatus { + /** The {@code unchanged} variant. */ + UNCHANGED("unchanged"), + /** The {@code pending} variant. */ + PENDING("pending"); + + private final String value; + ModelSwitchAutoTierStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ModelSwitchAutoTierStatus fromValue(String value) { + for (ModelSwitchAutoTierStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ModelSwitchAutoTierStatus value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java index beda6b20a2..dd522f7a34 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java @@ -27,6 +27,16 @@ public record SandboxConfig( @JsonProperty("userPolicy") SandboxConfigUserPolicy userPolicy, /** Whether to auto-add the current working directory to readwritePaths. Default: true. */ @JsonProperty("addCurrentWorkingDirectory") Boolean addCurrentWorkingDirectory, + /** Whether MCP servers the session launches are confined by the sandbox. Only an explicit `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and `enabled` are always read together. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). */ + @JsonProperty("sandboxMcpServers") Boolean sandboxMcpServers, + /** Whether language servers the session launches are confined by the sandbox. Only an explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). */ + @JsonProperty("sandboxLspServers") Boolean sandboxLspServers, + /** Whether the agent may request that an individual command run outside the sandbox, which the host then approves or denies through the usual permission flow. A host capability flag rather than part of the policy: it is stripped from the effective spawn policy and only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this object: omitting it offers no bypass. Default: false (opt-in). */ + @JsonProperty("allowBypass") Boolean allowBypass, + /** Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at the administrator instead of a setting the next managed merge would override, and it is ignored when comparing two configs for change. Only the managed merge may set it; a caller-supplied value is stripped. */ + @JsonProperty("managedMcpRoutingLocked") Boolean managedMcpRoutingLocked, + /** The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`. */ + @JsonProperty("managedLspRoutingLocked") Boolean managedLspRoutingLocked, /** Credential-injection capability flags. */ @JsonProperty("auth") SandboxConfigAuth auth, /** Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out). */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java index e85b7b987a..e6013c870d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/ServerManagedSettingsApi.java @@ -37,4 +37,15 @@ public CompletableFuture read() { return caller.invoke("managedSettings.read", java.util.Map.of(), ManagedSettingsReadResult.class); } + /** + * Invokes {@code managedSettings.clearCache}. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture clearCache() { + return caller.invoke("managedSettings.clearCache", java.util.Map.of(), Void.class); + } + } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java index 12777c9a1f..b9adc34484 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApi.java @@ -57,6 +57,22 @@ public CompletableFuture switchTo(SessionModelSwitch return caller.invoke("session.model.switchTo", _p, SessionModelSwitchToResult.class); } + /** + * An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture switchAutoTier(SessionModelSwitchAutoTierParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.model.switchAutoTier", _p, SessionModelSwitchAutoTierResult.class); + } + /** * Managed, repository, and CLI model overrides to overlay onto the session at startup. *

diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApplyStartupOverlayResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApplyStartupOverlayResult.java index f29e249c32..53ce443e08 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApplyStartupOverlayResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelApplyStartupOverlayResult.java @@ -40,6 +40,8 @@ public record SessionModelApplyStartupOverlayResult( /** User-facing warning produced while applying the model switch. */ @JsonProperty("warning") String warning, /** Deprecation warnings associated with the selected model or options. */ - @JsonProperty("deprecationWarnings") List deprecationWarnings + @JsonProperty("deprecationWarnings") List deprecationWarnings, + /** Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. */ + @JsonProperty("modelState") CurrentModel modelState ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java index 21afab2fa4..23a9788540 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelGetCurrentResult.java @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + * The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -29,6 +29,12 @@ public record SessionModelGetCurrentResult( /** Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. */ @JsonProperty("reasoningEffort") String reasoningEffort, /** Context tier for models that support multiple context-window sizes. */ - @JsonProperty("contextTier") ContextTier contextTier + @JsonProperty("contextTier") ContextTier contextTier, + /** Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it. */ + @JsonProperty("autoTier") AutoTier autoTier, + /** Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. */ + @JsonProperty("pendingAutoTier") AutoTier pendingAutoTier, + /** Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. */ + @JsonProperty("activatingAutoTier") AutoTier activatingAutoTier ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java new file mode 100644 index 0000000000..576df55aa1 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelSwitchAutoTierParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. */ + @JsonProperty("autoTier") AutoTier autoTier, + /** Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. */ + @JsonProperty("source") ModelChangeSource source +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierResult.java new file mode 100644 index 0000000000..7e95695492 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierResult.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionModelSwitchAutoTierResult( + /** Immediate request status. `pending` means accepted but not committed. */ + @JsonProperty("status") ModelSwitchAutoTierStatus status, + /** Auto preference currently committed for the session. */ + @JsonProperty("effectiveAutoTier") AutoTier effectiveAutoTier, + /** Latest unclaimed Auto preference waiting for a future user turn. */ + @JsonProperty("pendingAutoTier") AutoTier pendingAutoTier, + /** Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. */ + @JsonProperty("activatingAutoTier") AutoTier activatingAutoTier, + /** Earlier unclaimed preference replaced by this request. This can be present with either status, including when selecting the effective preference cancels pending work. */ + @JsonProperty("supersededAutoTier") AutoTier supersededAutoTier +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java index d7e36cf3c9..cfd59bcf36 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToParams.java @@ -28,6 +28,8 @@ public record SessionModelSwitchToParams( @JsonProperty("sessionId") String sessionId, /** 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. */ @JsonProperty("modelId") String modelId, + /** Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`. */ + @JsonProperty("autoTier") AutoTier autoTier, /** Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. "none" disables reasoning. When omitted, no effort override is applied. */ @JsonProperty("reasoningEffort") String reasoningEffort, /** Reasoning summary mode to request for supported model clients */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java index fb143abc30..47099e42ea 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchToResult.java @@ -40,6 +40,8 @@ public record SessionModelSwitchToResult( /** User-facing warning produced while applying the model switch. */ @JsonProperty("warning") String warning, /** Deprecation warnings associated with the selected model or options. */ - @JsonProperty("deprecationWarnings") List deprecationWarnings + @JsonProperty("deprecationWarnings") List deprecationWarnings, + /** Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. */ + @JsonProperty("modelState") CurrentModel modelState ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java index 5f4753b1ac..a1c234903e 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionOpenOptions.java @@ -37,6 +37,8 @@ public record SessionOpenOptions( @JsonProperty("verbosity") Verbosity verbosity, /** Identifier of the client driving the session. */ @JsonProperty("clientName") String clientName, + /** OAuth Client ID Metadata Document URL used by this host for MCP authorization. */ + @JsonProperty("authClientIdMetadataUrl") String authClientIdMetadataUrl, /** Structured client kind used for runtime behavior gates. */ @JsonProperty("clientKind") String clientKind, /** Identifier sent to LSP-style integrations. */ diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java index 68f038eb4b..c6ca1335de 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksApi.java @@ -57,6 +57,38 @@ public CompletableFuture list() { return caller.invoke("session.tasks.list", java.util.Map.of("sessionId", this.sessionId), SessionTasksListResult.class); } + /** + * Registers or reclaims a client-owned task. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture register(SessionTasksRegisterParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.tasks.register", _p, SessionTasksRegisterResult.class); + } + + /** + * Updates a client-owned task. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture update(SessionTasksUpdateParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.tasks.update", _p, SessionTasksUpdateResult.class); + } + /** * Identifies the target session. * diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterParams.java new file mode 100644 index 0000000000..0b14af08fd --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterParams.java @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Registers or reclaims a client-owned task. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksRegisterParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Task kind */ + @JsonProperty("type") TaskClientType type, + /** Owner-scoped idempotency key used for registration and reclaim */ + @JsonProperty("clientTaskId") String clientTaskId, + /** Human-readable description of the external work */ + @JsonProperty("description") String description, + /** Optional short display name for the external work */ + @JsonProperty("displayName") String displayName, + /** Whether the owner supports runtime cancellation requests */ + @JsonProperty("cancellable") Boolean cancellable, + /** Expected current sequence for idempotent registration or orphan reclaim */ + @JsonProperty("expectedSequence") Long expectedSequence +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterResult.java new file mode 100644 index 0000000000..f7e25fe885 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksRegisterResult.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of registering or reclaiming a client-owned task. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksRegisterResult( + /** Authoritative registered or reclaimed task */ + @JsonProperty("task") TaskClientInfo task, + /** True only when this invocation created a new task */ + @JsonProperty("created") Boolean created, + /** True only when this invocation reclaimed an orphaned task */ + @JsonProperty("reclaimed") Boolean reclaimed +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateParams.java new file mode 100644 index 0000000000..ecd06a1b7e --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateParams.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Updates a client-owned task. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksUpdateParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Canonical runtime-generated task identifier */ + @JsonProperty("id") String id, + /** Owner update sequence to apply */ + @JsonProperty("sequence") Long sequence, + /** Progress or terminal update payload */ + @JsonProperty("update") Object update +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateResult.java new file mode 100644 index 0000000000..8a08e87859 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionTasksUpdateResult.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Result of publishing a client-owned task update. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionTasksUpdateResult( + /** Authoritative task after processing the update */ + @JsonProperty("task") TaskClientInfo task, + /** Whether this invocation changed task state */ + @JsonProperty("applied") Boolean applied, + /** Whether this invocation repeated the latest accepted update */ + @JsonProperty("duplicate") Boolean duplicate +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientExecutionMode.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientExecutionMode.java new file mode 100644 index 0000000000..6c948f86e0 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientExecutionMode.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Client-owned tasks always execute outside the runtime in background mode. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskClientExecutionMode { + /** The {@code background} variant. */ + BACKGROUND("background"); + + private final String value; + TaskClientExecutionMode(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskClientExecutionMode fromValue(String value) { + for (TaskClientExecutionMode v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskClientExecutionMode value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientInfo.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientInfo.java new file mode 100644 index 0000000000..6a221303eb --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientInfo.java @@ -0,0 +1,70 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * Tracked client-owned task metadata. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record TaskClientInfo( + /** Task kind */ + @JsonProperty("type") TaskClientType type, + /** Canonical runtime-generated task identifier */ + @JsonProperty("id") String id, + /** Owner-scoped registration and reclaim key */ + @JsonProperty("clientTaskId") String clientTaskId, + /** Optional task display name */ + @JsonProperty("displayName") String displayName, + /** Task description */ + @JsonProperty("description") String description, + /** Client task lifecycle status */ + @JsonProperty("status") TaskClientStatus status, + /** Public attribution and presence for the task owner */ + @JsonProperty("owner") TaskClientOwner owner, + /** ISO 8601 timestamp when the task started */ + @JsonProperty("startedAt") OffsetDateTime startedAt, + /** ISO 8601 timestamp of the latest accepted lifecycle change */ + @JsonProperty("updatedAt") OffsetDateTime updatedAt, + /** ISO 8601 timestamp when the task reached a terminal status */ + @JsonProperty("completedAt") OffsetDateTime completedAt, + /** Accumulated active execution time in milliseconds */ + @JsonProperty("activeTimeMs") Long activeTimeMs, + /** ISO 8601 timestamp when the current active segment started */ + @JsonProperty("activeStartedAt") OffsetDateTime activeStartedAt, + /** ISO 8601 timestamp when the connected owner entered idle status */ + @JsonProperty("idleSince") OffsetDateTime idleSince, + /** ISO 8601 timestamp of the most recent orphan transition */ + @JsonProperty("orphanedAt") OffsetDateTime orphanedAt, + /** ISO 8601 timestamp of the most recent successful reclaim */ + @JsonProperty("reclaimedAt") OffsetDateTime reclaimedAt, + /** Execution mode, which is always background for client-owned tasks */ + @JsonProperty("executionMode") TaskClientExecutionMode executionMode, + /** Whether the currently bound owner can receive a cancellation request */ + @JsonProperty("canCancel") Boolean canCancel, + /** Sequence number of the latest accepted owner update */ + @JsonProperty("sequence") Long sequence, + /** Opaque successful terminal result supplied by the task owner */ + @JsonProperty("result") Object result, + /** Human-readable terminal failure message */ + @JsonProperty("error") String error, + /** Optional owner-supplied terminal failure code */ + @JsonProperty("errorCode") String errorCode, + /** Human-readable reason for terminal cancellation */ + @JsonProperty("cancellationReason") String cancellationReason +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwner.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwner.java new file mode 100644 index 0000000000..e2ce54019b --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwner.java @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import javax.annotation.processing.Generated; + +/** + * Public owner attribution for a client-owned task. Identifiers are opaque and never authorize requests. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record TaskClientOwner( + /** Opaque session-scoped participant identity */ + @JsonProperty("participantId") String participantId, + /** Opaque identity of the currently or most recently bound session join */ + @JsonProperty("joinId") String joinId, + /** Class of the task owner */ + @JsonProperty("kind") TaskClientOwnerKind kind, + /** Display-only owner name */ + @JsonProperty("displayName") String displayName, + /** Display-only owner source */ + @JsonProperty("source") String source, + /** Whether this task's bound join is currently connected */ + @JsonProperty("presence") TaskClientOwnerPresence presence, + /** ISO 8601 timestamp when the bound join disconnected */ + @JsonProperty("disconnectedAt") OffsetDateTime disconnectedAt +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerKind.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerKind.java new file mode 100644 index 0000000000..92518264a5 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerKind.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Connection class owning a client task. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskClientOwnerKind { + /** The {@code extension} variant. */ + EXTENSION("extension"), + /** The {@code sdk} variant. */ + SDK("sdk"); + + private final String value; + TaskClientOwnerKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskClientOwnerKind fromValue(String value) { + for (TaskClientOwnerKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskClientOwnerKind value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerPresence.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerPresence.java new file mode 100644 index 0000000000..282cc69206 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientOwnerPresence.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Presence of the task's bound join. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskClientOwnerPresence { + /** The {@code connected} variant. */ + CONNECTED("connected"), + /** The {@code disconnected} variant. */ + DISCONNECTED("disconnected"); + + private final String value; + TaskClientOwnerPresence(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskClientOwnerPresence fromValue(String value) { + for (TaskClientOwnerPresence v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskClientOwnerPresence value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientStatus.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientStatus.java new file mode 100644 index 0000000000..a72daddc41 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientStatus.java @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Lifecycle status of a client-owned task. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskClientStatus { + /** The {@code running} variant. */ + RUNNING("running"), + /** The {@code idle} variant. */ + IDLE("idle"), + /** The {@code completed} variant. */ + COMPLETED("completed"), + /** The {@code failed} variant. */ + FAILED("failed"), + /** The {@code cancelled} variant. */ + CANCELLED("cancelled"), + /** The {@code orphaned} variant. */ + ORPHANED("orphaned"); + + private final String value; + TaskClientStatus(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskClientStatus fromValue(String value) { + for (TaskClientStatus v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskClientStatus value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientType.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientType.java new file mode 100644 index 0000000000..42f74cf3dd --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskClientType.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Discriminator for a client-owned task. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskClientType { + /** The {@code client} variant. */ + CLIENT("client"); + + private final String value; + TaskClientType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskClientType fromValue(String value) { + for (TaskClientType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskClientType value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskKind.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskKind.java new file mode 100644 index 0000000000..413859db20 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TaskKind.java @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Closed set of public task kinds a connection can negotiate. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum TaskKind { + /** The {@code agent} variant. */ + AGENT("agent"), + /** The {@code shell} variant. */ + SHELL("shell"), + /** The {@code client} variant. */ + CLIENT("client"); + + private final String value; + TaskKind(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static TaskKind fromValue(String value) { + for (TaskKind v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown TaskKind value: " + value); + } +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelParams.java new file mode 100644 index 0000000000..57cbd5e6e0 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelParams.java @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Runtime-to-owner cancellation request for a client-owned task. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record TasksCancelParams( + /** Session that owns the client task */ + @JsonProperty("sessionId") String sessionId, + /** Canonical runtime-generated task identifier */ + @JsonProperty("id") String id, + /** Owner-scoped task key included for correlation */ + @JsonProperty("clientTaskId") String clientTaskId, + /** Opaque identifier shared by coalesced cancellation callers */ + @JsonProperty("cancellationId") String cancellationId, + /** Reason the runtime requests cancellation */ + @JsonProperty("reason") ClientTaskCancelReason reason +) { +} diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelResult.java new file mode 100644 index 0000000000..bd549d1df4 --- /dev/null +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/TasksCancelResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * Whether the client authoritatively confirmed its external work stopped. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record TasksCancelResult( + /** True only when the owner confirms that external work stopped before responding */ + @JsonProperty("cancelled") Boolean cancelled +) { +} diff --git a/nodejs/package.json b/nodejs/package.json index c937d83bf7..f64c05897e 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -5,7 +5,7 @@ "url": "https://github.com/github/copilot-sdk.git" }, "version": "0.0.0-dev", - "copilotCliVersion": "1.0.83-3", + "copilotCliVersion": "1.0.83-4", "description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC", "main": "./dist/cjs/index.js", "types": "./dist/index.d.ts", diff --git a/nodejs/src/cliVersion.ts b/nodejs/src/cliVersion.ts index a0c4eb8558..c4ad7b3045 100644 --- a/nodejs/src/cliVersion.ts +++ b/nodejs/src/cliVersion.ts @@ -1,3 +1,3 @@ -export const COPILOT_CLI_VERSION = "1.0.83-3"; +export const COPILOT_CLI_VERSION = "1.0.83-4"; export const COPILOT_CLI_USE_NPM_PACKAGE = false; diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 5f2ff0c62d..0099ca2d58 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -5,10 +5,42 @@ import type { MessageConnection } from "vscode-jsonrpc/node.js"; -import type { AbortReason, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerSource, McpServerStatus, ModelChangeSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompleteData, TaskCompletionOutcome, UserToolSessionApproval, Verbosity } from "./session-events.js"; +import type { + AbortReason, + AgentModelPolicy, + Attachment, + AutoTier, + ContextTier, + EmbeddedBlobResourceContents, + EmbeddedTextResourceContents, + McpOauthHttpResponse, + McpOauthWWWAuthenticateParams, + McpServerSource, + McpServerStatus, + ModelChangeSource, + PermissionMode, + PermissionPromptRequest, + PermissionRule, + ReasoningSummary, + SessionEvent, + SessionLimitsConfig, + SessionMode, + ShutdownType, + SkillSource, + TaskCompleteData, + TaskCompletionOutcome, + UserToolSessionApproval, + Verbosity, +} from "./session-events.js"; /** A value that can be represented losslessly on the SDK JSON wire. */ -export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue }; +export type JsonValue = + | null + | boolean + | number + | string + | JsonValue[] + | { [key: string]: JsonValue }; /** * A value that lives only in this process and never crosses the JSON-RPC @@ -25,14 +57,14 @@ export type OpaqueInProcessValue = unknown; */ /** @experimental */ export type AuthInfo = - | HMACAuthInfo - | EnvAuthInfo - | TokenAuthInfo - | TokenProviderAuthInfo - | CopilotApiTokenAuthInfo - | UserAuthInfo - | GhCliAuthInfo - | ApiKeyAuthInfo; + | HMACAuthInfo + | EnvAuthInfo + | TokenAuthInfo + | TokenProviderAuthInfo + | CopilotApiTokenAuthInfo + | UserAuthInfo + | GhCliAuthInfo + | ApiKeyAuthInfo; /** * User to log out * @@ -41,7 +73,7 @@ export type AuthInfo = */ /** @experimental */ export type AccountLogoutRequest = { - [k: string]: unknown | undefined; + [k: string]: unknown | undefined; }; /** * Resolved Anthropic adaptive-thinking capability for a model. @@ -51,12 +83,12 @@ export type AccountLogoutRequest = { */ /** @experimental */ export type AdaptiveThinkingSupport = - /** The model does not accept thinking.type='adaptive' */ - | "unsupported" - /** The model accepts adaptive thinking but also accepts thinking.type='enabled' */ - | "optional" - /** The model only accepts adaptive thinking and rejects thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8) */ - | "required"; + /** The model does not accept thinking.type='adaptive' */ + | "unsupported" + /** The model accepts adaptive thinking but also accepts thinking.type='enabled' */ + | "optional" + /** The model only accepts adaptive thinking and rejects thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8) */ + | "required"; /** * Which tier this directory belongs to * @@ -65,10 +97,10 @@ export type AdaptiveThinkingSupport = */ /** @experimental */ export type AgentDiscoveryPathScope = - /** The user's personal agent configuration directory. */ - | "user" - /** A project's repository agent directory. */ - | "project"; + /** The user's personal agent configuration directory. */ + | "user" + /** A project's repository agent directory. */ + | "project"; /** * Where the agent definition was loaded from * @@ -77,18 +109,18 @@ export type AgentDiscoveryPathScope = */ /** @experimental */ export type AgentInfoSource = - /** Agent loaded from the user's personal agent configuration. */ - | "user" - /** Agent loaded from the current project's repository configuration. */ - | "project" - /** Agent inherited from a parent project or workspace. */ - | "inherited" - /** Agent provided by a remote runtime or service. */ - | "remote" - /** Agent contributed by an installed plugin. */ - | "plugin" - /** Agent built into the Copilot runtime. */ - | "builtin"; + /** Agent loaded from the user's personal agent configuration. */ + | "user" + /** Agent loaded from the current project's repository configuration. */ + | "project" + /** Agent inherited from a parent project or workspace. */ + | "inherited" + /** Agent provided by a remote runtime or service. */ + | "remote" + /** Agent contributed by an installed plugin. */ + | "plugin" + /** Agent built into the Copilot runtime. */ + | "builtin"; /** * Controls whether built-in agents and authored prompt text are included. * @@ -97,19 +129,19 @@ export type AgentInfoSource = */ /** @experimental */ export type AgentListRequest = - | { - [k: string]: unknown | undefined; - } - | { - /** - * When true, request the session's configured built-in agents alongside custom agents. Listing applies feature, context, inclusion, exclusion, and user-disabled-agent policy, but does not evaluate transient invocation requirements such as model availability. Built-in metadata may be omitted when the session cannot project it, such as a relay session. - */ - includeBuiltInAgents?: boolean; - /** - * When true, request authored base prompt text on each AgentInfo. Prompt text may be omitted when unavailable, such as for agents projected through a relay session. - */ - includePrompt?: boolean; - }; + | { + [k: string]: unknown | undefined; + } + | { + /** + * When true, request the session's configured built-in agents alongside custom agents. Listing applies feature, context, inclusion, exclusion, and user-disabled-agent policy, but does not evaluate transient invocation requirements such as model availability. Built-in metadata may be omitted when the session cannot project it, such as a relay session. + */ + includeBuiltInAgents?: boolean; + /** + * When true, request authored base prompt text on each AgentInfo. Prompt text may be omitted when unavailable, such as for agents projected through a relay session. + */ + includePrompt?: boolean; + }; /** * Process kind tag for the registry entry * @@ -118,10 +150,10 @@ export type AgentListRequest = */ /** @experimental */ export type AgentRegistryLiveTargetEntryKind = - /** Interactive Copilot CLI exposing a UI server (legacy/normal CLI process) */ - | "ui-server" - /** Headless `--server --managed-server` child spawned by a controller */ - | "managed-server"; + /** Interactive Copilot CLI exposing a UI server (legacy/normal CLI process) */ + | "ui-server" + /** Headless `--server --managed-server` child spawned by a controller */ + | "managed-server"; /** * Coarse lifecycle status of the foreground session * @@ -130,14 +162,14 @@ export type AgentRegistryLiveTargetEntryKind = */ /** @experimental */ export type AgentRegistryLiveTargetEntryStatus = - /** Session is actively processing a turn */ - | "working" - /** Session is idle, waiting for input */ - | "waiting" - /** Last turn completed successfully */ - | "done" - /** Session needs user attention (see attentionKind for the specific reason) */ - | "attention"; + /** Session is actively processing a turn */ + | "working" + /** Session is idle, waiting for input */ + | "waiting" + /** Last turn completed successfully */ + | "done" + /** Session needs user attention (see attentionKind for the specific reason) */ + | "attention"; /** * Kind of attention required when status === "attention". Meaningful only when status === "attention". * @@ -146,16 +178,16 @@ export type AgentRegistryLiveTargetEntryStatus = */ /** @experimental */ export type AgentRegistryLiveTargetEntryAttentionKind = - /** Session is blocked on an unrecoverable error */ - | "error" - /** Session is waiting for a tool-permission decision */ - | "permission" - /** Session is waiting for the user to approve or reject a plan */ - | "exit_plan" - /** Session is waiting on an elicitation prompt */ - | "elicitation" - /** Session is waiting for free-form user input */ - | "user_input"; + /** Session is blocked on an unrecoverable error */ + | "error" + /** Session is waiting for a tool-permission decision */ + | "permission" + /** Session is waiting for the user to approve or reject a plan */ + | "exit_plan" + /** Session is waiting on an elicitation prompt */ + | "elicitation" + /** Session is waiting for free-form user input */ + | "user_input"; /** * How the most recent turn ended (clean vs aborted). Lets the renderer distinguish done from done_cancelled. * @@ -164,10 +196,10 @@ export type AgentRegistryLiveTargetEntryAttentionKind = */ /** @experimental */ export type AgentRegistryLiveTargetEntryLastTerminalEvent = - /** Last turn ended cleanly (model returned a final assistant message) */ - | "turn_end" - /** Last turn was aborted (e.g. user interrupted) */ - | "abort"; + /** Last turn ended cleanly (model returned a final assistant message) */ + | "turn_end" + /** Last turn was aborted (e.g. user interrupted) */ + | "abort"; /** * Categorized reason for log-open failure * @@ -176,12 +208,12 @@ export type AgentRegistryLiveTargetEntryLastTerminalEvent = */ /** @experimental */ export type AgentRegistryLogCaptureOpenErrorReason = - /** Filesystem permission denied opening the log file */ - | "permission" - /** No space left on device */ - | "disk_full" - /** Other / uncategorized open failure */ - | "other"; + /** Filesystem permission denied opening the log file */ + | "permission" + /** No space left on device */ + | "disk_full" + /** Other / uncategorized open failure */ + | "other"; /** * Permission posture for the new session. 'yolo' requires the controller-local session to currently be in allow-all mode. * @@ -190,10 +222,10 @@ export type AgentRegistryLogCaptureOpenErrorReason = */ /** @experimental */ export type AgentRegistrySpawnPermissionMode = - /** Standard permission posture (prompts for each request) */ - | "default" - /** Full allow-all (requires the controller-local session to currently be in allow-all mode) */ - | "yolo"; + /** Standard permission posture (prompts for each request) */ + | "default" + /** Full allow-all (requires the controller-local session to currently be in allow-all mode) */ + | "yolo"; /** * Outcome of an agentRegistry.spawn call. * @@ -202,10 +234,10 @@ export type AgentRegistrySpawnPermissionMode = */ /** @experimental */ export type AgentRegistrySpawnResult = - | AgentRegistrySpawnSpawned - | AgentRegistrySpawnError - | AgentRegistrySpawnRegistryTimeout - | AgentRegistrySpawnValidationError; + | AgentRegistrySpawnSpawned + | AgentRegistrySpawnError + | AgentRegistrySpawnRegistryTimeout + | AgentRegistrySpawnValidationError; /** * Categorized reason for the rejection. Low-cardinality enum so telemetry can aggregate by reason without leaking raw paths or agent/model names. * @@ -214,18 +246,18 @@ export type AgentRegistrySpawnResult = */ /** @experimental */ export type AgentRegistrySpawnValidationErrorReason = - /** Provided cwd does not exist on disk */ - | "cwd-not-found" - /** Provided cwd exists but is not a directory */ - | "cwd-not-directory" - /** Session name failed validateSessionName */ - | "invalid-name" - /** Requested agent name was not found in builtin or custom agents */ - | "unknown-agent" - /** Requested model is not available to this session */ - | "unknown-model" - /** Caller asked for permissionMode='yolo' but the controller is not currently in allow-all mode */ - | "yolo-not-allowed"; + /** Provided cwd does not exist on disk */ + | "cwd-not-found" + /** Provided cwd exists but is not a directory */ + | "cwd-not-directory" + /** Session name failed validateSessionName */ + | "invalid-name" + /** Requested agent name was not found in builtin or custom agents */ + | "unknown-agent" + /** Requested model is not available to this session */ + | "unknown-model" + /** Caller asked for permissionMode='yolo' but the controller is not currently in allow-all mode */ + | "yolo-not-allowed"; /** * Which parameter field was invalid. Omitted when the rejection is not field-specific. * @@ -234,16 +266,16 @@ export type AgentRegistrySpawnValidationErrorReason = */ /** @experimental */ export type AgentRegistrySpawnValidationErrorField = - /** The cwd parameter */ - | "cwd" - /** The session name parameter */ - | "name" - /** The agentName parameter */ - | "agentName" - /** The model parameter */ - | "model" - /** The permissionMode parameter */ - | "permissionMode"; + /** The cwd parameter */ + | "cwd" + /** The session name parameter */ + | "name" + /** The agentName parameter */ + | "agentName" + /** The model parameter */ + | "model" + /** The permissionMode parameter */ + | "permissionMode"; /** * Authentication type * @@ -252,22 +284,22 @@ export type AgentRegistrySpawnValidationErrorField = */ /** @experimental */ export type AuthInfoType = - /** Authentication provided by a GitHub App HMAC credential. */ - | "hmac" - /** Authentication resolved from environment-provided credentials. */ - | "env" - /** Authentication from an interactive user sign-in. */ - | "user" - /** Authentication delegated to the GitHub CLI. */ - | "gh-cli" - /** Authentication from an API key credential. */ - | "api-key" - /** Authentication from a GitHub token. */ - | "token" - /** Authentication from an SDK GitHub token callback. */ - | "token-provider" - /** Authentication from a Copilot API token. */ - | "copilot-api-token"; + /** Authentication provided by a GitHub App HMAC credential. */ + | "hmac" + /** Authentication resolved from environment-provided credentials. */ + | "env" + /** Authentication from an interactive user sign-in. */ + | "user" + /** Authentication delegated to the GitHub CLI. */ + | "gh-cli" + /** Authentication from an API key credential. */ + | "api-key" + /** Authentication from a GitHub token. */ + | "token" + /** Authentication from an SDK GitHub token callback. */ + | "token-provider" + /** Authentication from a Copilot API token. */ + | "copilot-api-token"; /** * Validation errors from the most recent authentication attempt. * @@ -291,7 +323,8 @@ export type BuiltinToolInputSchemaType = /** The tool accepts a JSON object. */ * via the `definition` "BuiltinToolFormatType". */ /** @experimental */ -export type BuiltinToolFormatType = /** The tool input is parsed with the supplied grammar. */ "grammar"; +export type BuiltinToolFormatType = + /** The tool input is parsed with the supplied grammar. */ "grammar"; /** * Telemetry-safety policy for a built-in tool. * @@ -323,7 +356,8 @@ export type CanvasActionInvokeResult = JsonValue; * via the `definition` "CardDigestAlgorithm". */ /** @experimental */ -export type CardDigestAlgorithm = /** SHA-256 over RFC 8785 canonical JSON encoded as UTF-8. */ "sha256-rfc8785"; +export type CardDigestAlgorithm = + /** SHA-256 over RFC 8785 canonical JSON encoded as UTF-8. */ "sha256-rfc8785"; /** * SHA-256 digest encoded as exactly 64 lowercase hexadecimal characters. * @@ -348,12 +382,12 @@ export type CatalogCandidateSource = CatalogCandidateSourceUrl | CatalogCandidat */ /** @experimental */ export type CatalogAuthenticationRequiredReason = - /** No credential was presented, so there is nothing to refresh and the caller must sign in. */ - | "no-credential" - /** A credential was presented and its lifetime has elapsed. A silent refresh is worth attempting before prompting anyone. */ - | "credential-expired" - /** A credential was presented and the authority refused it, for example because it was revoked, malformed, or issued for another audience. Refreshing the same rejected credential is not useful; the caller must sign in again. */ - | "credential-rejected"; + /** No credential was presented, so there is nothing to refresh and the caller must sign in. */ + | "no-credential" + /** A credential was presented and its lifetime has elapsed. A silent refresh is worth attempting before prompting anyone. */ + | "credential-expired" + /** A credential was presented and the authority refused it, for example because it was revoked, malformed, or issued for another audience. Refreshing the same rejected credential is not useful; the caller must sign in again. */ + | "credential-rejected"; /** * One inert catalog result, represented as an MCP server or discovery-only AI skill variant so kind, media type, provenance, and installability cannot contradict each other. * @@ -370,10 +404,10 @@ export type CatalogCandidate = CatalogMcpServerCandidate | CatalogAiSkillCandida */ /** @experimental */ export type McpServerCardMediaType = - /** The current MCP server card media type. */ - | "application/mcp-server-card+json" - /** The legacy MCP server card media type, accepted for compatibility. */ - | "application/mcp-server+json"; + /** The current MCP server card media type. */ + | "application/mcp-server-card+json" + /** The legacy MCP server card media type, accepted for compatibility. */ + | "application/mcp-server+json"; /** * Whether an MCP server candidate can be planned for installation * @@ -382,10 +416,10 @@ export type McpServerCardMediaType = */ /** @experimental */ export type CatalogMcpServerInstallability = - /** An install plan can be computed for this MCP server candidate. */ - | "installable" - /** Policy forbids installing this MCP server candidate. */ - | "not-installable-policy"; + /** An install plan can be computed for this MCP server candidate. */ + | "installable" + /** Policy forbids installing this MCP server candidate. */ + | "not-installable-policy"; /** * What kind of resource a catalog candidate describes * @@ -394,10 +428,10 @@ export type CatalogMcpServerInstallability = */ /** @experimental */ export type CatalogCandidateKind = - /** An MCP server, which can be planned for installation. */ - | "mcp-server" - /** An AI skill, which is discoverable but not installable through this surface. */ - | "ai-skill"; + /** An MCP server, which can be planned for installation. */ + | "mcp-server" + /** An AI skill, which is discoverable but not installable through this surface. */ + | "ai-skill"; /** * A wire feature a caller can require of the catalog surface, negotiated per request. A grant means the runtime understands the feature's contract, not that the deployment has enabled the operation; typed unavailable results report availability separately. * @@ -406,16 +440,16 @@ export type CatalogCandidateKind = */ /** @experimental */ export type CatalogCapability = - /** Understands the current `application/mcp-server-card+json` media type. */ - | "mcp-server-card" - /** Understands the legacy `application/mcp-server+json` media type. */ - | "legacy-mcp-server-card" - /** Understands `application/ai-skill` candidates as discovery-only and typed non-installable. */ - | "ai-skill-discovery" - /** Understands side-effect-free MCP install-plan requests, results, and plan handles; `planning-unavailable` separately reports that planning is not enabled. */ - | "mcp-install-planning" - /** Understands plans that enumerate every eligible transport rather than a single preferred one. */ - | "multiple-transport-choice"; + /** Understands the current `application/mcp-server-card+json` media type. */ + | "mcp-server-card" + /** Understands the legacy `application/mcp-server+json` media type. */ + | "legacy-mcp-server-card" + /** Understands `application/ai-skill` candidates as discovery-only and typed non-installable. */ + | "ai-skill-discovery" + /** Understands side-effect-free MCP install-plan requests, results, and plan handles; `planning-unavailable` separately reports that planning is not enabled. */ + | "mcp-install-planning" + /** Understands plans that enumerate every eligible transport rather than a single preferred one. */ + | "multiple-transport-choice"; /** * Bounded extensible wire-feature identifier. Known values are described by `CatalogCapability`; newer callers may send future identifiers so an older runtime can return a typed negotiation refusal instead of failing schema validation. Capability negotiation establishes contract understanding, while each operation's result separately reports runtime availability. * @@ -432,14 +466,14 @@ export type CatalogCapabilityId = string; */ /** @experimental */ export type CatalogContractViolationReason = - /** A result carried both a URL and embedded data, when exactly one is permitted. */ - | "both-url-and-data" - /** A result carried neither a URL nor embedded data, when exactly one is required. */ - | "neither-url-nor-data" - /** Two results claimed the same normalised identity. */ - | "duplicate-identity" - /** A result declared no media type, or one this contract does not model. */ - | "unknown-media-type"; + /** A result carried both a URL and embedded data, when exactly one is permitted. */ + | "both-url-and-data" + /** A result carried neither a URL nor embedded data, when exactly one is required. */ + | "neither-url-nor-data" + /** Two results claimed the same normalised identity. */ + | "duplicate-identity" + /** A result declared no media type, or one this contract does not model. */ + | "unknown-media-type"; /** * Which kind of opaque handle was presented * @@ -448,10 +482,10 @@ export type CatalogContractViolationReason = */ /** @experimental */ export type CatalogHandleType = - /** A search candidate handle. */ - | "candidate" - /** An install plan handle. */ - | "plan"; + /** A search candidate handle. */ + | "candidate" + /** An install plan handle. */ + | "plan"; /** * Why a presented handle was rejected * @@ -460,14 +494,14 @@ export type CatalogHandleType = */ /** @experimental */ export type CatalogHandleRejectionReason = - /** The handle is unparseable, unknown, or was issued for a different operation. */ - | "invalid" - /** The handle's time to live has elapsed. */ - | "stale" - /** The handle has already been used, and handles are single-use. */ - | "replayed" - /** The handle was issued by a different runtime instance. */ - | "foreign"; + /** The handle is unparseable, unknown, or was issued for a different operation. */ + | "invalid" + /** The handle's time to live has elapsed. */ + | "stale" + /** The handle has already been used, and handles are single-use. */ + | "replayed" + /** The handle was issued by a different runtime instance. */ + | "foreign"; /** * Which request field was rejected before any work was done * @@ -476,20 +510,20 @@ export type CatalogHandleRejectionReason = */ /** @experimental */ export type CatalogInvalidRequestField = - /** The search query was empty or longer than permitted. */ - | "query" - /** The requested result count fell outside its permitted range. */ - | "limit" - /** The requested candidate kinds were empty or contained a duplicate. */ - | "kinds" - /** The negotiation block was missing or malformed. */ - | "contract" - /** The plan source was missing or malformed. */ - | "source" - /** The supplied card was missing its media type, URL, or data. */ - | "card" - /** The requested configuration scope is not one this runtime writes. */ - | "scope"; + /** The search query was empty or longer than permitted. */ + | "query" + /** The requested result count fell outside its permitted range. */ + | "limit" + /** The requested candidate kinds were empty or contained a duplicate. */ + | "kinds" + /** The negotiation block was missing or malformed. */ + | "contract" + /** The plan source was missing or malformed. */ + | "source" + /** The supplied card was missing its media type, URL, or data. */ + | "card" + /** The requested configuration scope is not one this runtime writes. */ + | "scope"; /** * How a card failed validation * @@ -498,16 +532,16 @@ export type CatalogInvalidRequestField = */ /** @experimental */ export type CatalogMalformedCardReason = - /** The document is not well-formed JSON. */ - | "invalid-json" - /** The document does not satisfy its media type's schema. */ - | "schema-violation" - /** The declared media type is not one this runtime understands. */ - | "unsupported-media-type" - /** A field the media type requires is absent. */ - | "missing-required-field" - /** The document exceeded the permitted size. */ - | "size-limit-exceeded"; + /** The document is not well-formed JSON. */ + | "invalid-json" + /** The document does not satisfy its media type's schema. */ + | "schema-violation" + /** The declared media type is not one this runtime understands. */ + | "unsupported-media-type" + /** A field the media type requires is absent. */ + | "missing-required-field" + /** The document exceeded the permitted size. */ + | "size-limit-exceeded"; /** * Media type a catalog card is interpreted as * @@ -516,12 +550,12 @@ export type CatalogMalformedCardReason = */ /** @experimental */ export type CatalogMediaType = - /** The current MCP server card media type. */ - | "application/mcp-server-card+json" - /** The legacy MCP server card media type, accepted for compatibility. */ - | "application/mcp-server+json" - /** An AI skill card. Representable and searchable, but typed non-installable. */ - | "application/ai-skill"; + /** The current MCP server card media type. */ + | "application/mcp-server-card+json" + /** The legacy MCP server card media type, accepted for compatibility. */ + | "application/mcp-server+json" + /** An AI skill card. Representable and searchable, but typed non-installable. */ + | "application/ai-skill"; /** * Why capability and protocol-version negotiation refused a caller * @@ -530,10 +564,10 @@ export type CatalogMediaType = */ /** @experimental */ export type CatalogNegotiationRefusedReason = - /** The caller's protocol version is below the lowest this runtime serves. */ - | "unsupported-protocol-version" - /** The caller requires at least one capability this runtime cannot honour. */ - | "unsupported-capability"; + /** The caller's protocol version is below the lowest this runtime serves. */ + | "unsupported-protocol-version" + /** The caller requires at least one capability this runtime cannot honour. */ + | "unsupported-capability"; /** * Categorised network failure, low cardinality so it can be aggregated without carrying a URL * @@ -542,28 +576,28 @@ export type CatalogNegotiationRefusedReason = */ /** @experimental */ export type CatalogNetworkFailureReason = - /** No network is available, so nothing was attempted. */ - | "offline" - /** The authority's name could not be resolved. */ - | "dns" - /** The request exceeded its time budget. */ - | "timeout" - /** The TLS handshake or certificate validation failed. */ - | "tls" - /** The connection was refused or reset. */ - | "connection-refused" - /** The configured proxy returned 407 and requires authentication. */ - | "proxy-authentication-required" - /** The authority rate-limited requests and supplied or implied a bounded cooldown. */ - | "rate-limited" - /** The authority returned a transient 5xx response. */ - | "service-unavailable" - /** The authority returned another status the runtime treats as a failure. */ - | "http-status" - /** The response exceeded the permitted size. */ - | "response-too-large" - /** A redirect was refused by the runtime's redirect policy. */ - | "redirect-rejected"; + /** No network is available, so nothing was attempted. */ + | "offline" + /** The authority's name could not be resolved. */ + | "dns" + /** The request exceeded its time budget. */ + | "timeout" + /** The TLS handshake or certificate validation failed. */ + | "tls" + /** The connection was refused or reset. */ + | "connection-refused" + /** The configured proxy returned 407 and requires authentication. */ + | "proxy-authentication-required" + /** The authority rate-limited requests and supplied or implied a bounded cooldown. */ + | "rate-limited" + /** The authority returned a transient 5xx response. */ + | "service-unavailable" + /** The authority returned another status the runtime treats as a failure. */ + | "http-status" + /** The response exceeded the permitted size. */ + | "response-too-large" + /** A redirect was refused by the runtime's redirect policy. */ + | "redirect-rejected"; /** * Why a discoverable candidate cannot be installed * @@ -572,12 +606,12 @@ export type CatalogNetworkFailureReason = */ /** @experimental */ export type CatalogNotInstallableReason = - /** This kind of resource is not installable through this surface. */ - | "kind-not-installable" - /** AI skills are discoverable but have no typed importer in this phase. */ - | "ai-skill-not-installable" - /** Policy forbids installing this candidate. */ - | "policy-forbids"; + /** This kind of resource is not installable through this surface. */ + | "kind-not-installable" + /** AI skills are discoverable but have no typed importer in this phase. */ + | "ai-skill-not-installable" + /** Policy forbids installing this candidate. */ + | "policy-forbids"; /** * Which authority produced a policy decision * @@ -586,14 +620,14 @@ export type CatalogNotInstallableReason = */ /** @experimental */ export type McpPlanPolicySource = - /** No policy applied, so the server is permitted by default. */ - | "none" - /** An enterprise allowlist evaluated the server. */ - | "enterprise-allowlist" - /** The registry the card came from evaluated the server. */ - | "registry-policy" - /** Local trust settings evaluated the server. */ - | "local-trust"; + /** No policy applied, so the server is permitted by default. */ + | "none" + /** An enterprise allowlist evaluated the server. */ + | "enterprise-allowlist" + /** The registry the card came from evaluated the server. */ + | "registry-policy" + /** Local trust settings evaluated the server. */ + | "local-trust"; /** * Outcome of a catalog.search call: either bounded inert candidates, or one typed refusal. Never a partial success. * @@ -602,17 +636,17 @@ export type McpPlanPolicySource = */ /** @experimental */ export type CatalogSearchResult = - | CatalogSearchSucceeded - | CatalogNegotiationRefusedError - | CatalogUnsupportedKindError - | CatalogInvalidRequestError - | CatalogAuthenticationRequiredError - | CatalogPolicyRejectedError - | CatalogNetworkFailureError - | CatalogUnsafeRetrievalError - | CatalogMalformedCardError - | CatalogContractViolationError - | CatalogUnavailableError; + | CatalogSearchSucceeded + | CatalogNegotiationRefusedError + | CatalogUnsupportedKindError + | CatalogInvalidRequestError + | CatalogAuthenticationRequiredError + | CatalogPolicyRejectedError + | CatalogNetworkFailureError + | CatalogUnsafeRetrievalError + | CatalogMalformedCardError + | CatalogContractViolationError + | CatalogUnavailableError; /** * Which hardened-fetch control refused a retrieval * @@ -621,18 +655,18 @@ export type CatalogSearchResult = */ /** @experimental */ export type CatalogUnsafeRetrievalReason = - /** The URL used a scheme the runtime refuses to fetch. */ - | "blocked-scheme" - /** The URL embedded credentials. */ - | "credentials-in-url" - /** The URL resolved to a loopback, private, link-local, or cloud metadata address. */ - | "blocked-address" - /** A redirect target resolved to a blocked address. */ - | "redirect-to-blocked-address" - /** The configured proxy policy refused the request. */ - | "proxy-rejected" - /** The authority is not permitted for card retrieval. */ - | "host-not-permitted"; + /** The URL used a scheme the runtime refuses to fetch. */ + | "blocked-scheme" + /** The URL embedded credentials. */ + | "credentials-in-url" + /** The URL resolved to a loopback, private, link-local, or cloud metadata address. */ + | "blocked-address" + /** A redirect target resolved to a blocked address. */ + | "redirect-to-blocked-address" + /** The configured proxy policy refused the request. */ + | "proxy-rejected" + /** The authority is not permitted for card retrieval. */ + | "host-not-permitted"; /** * Why a catalog operation is not available on this runtime * @@ -641,14 +675,14 @@ export type CatalogUnsafeRetrievalReason = */ /** @experimental */ export type CatalogUnavailableReason = - /** Bounded search is not wired up on this runtime build. */ - | "search-unavailable" - /** Install planning is not wired up on this runtime build. */ - | "planning-unavailable" - /** No catalog authority is configured for this runtime. */ - | "authority-not-configured" - /** The surface is disabled by policy on this runtime. */ - | "disabled-by-policy"; + /** Bounded search is not wired up on this runtime build. */ + | "search-unavailable" + /** Install planning is not wired up on this runtime build. */ + | "planning-unavailable" + /** No catalog authority is configured for this runtime. */ + | "authority-not-configured" + /** The surface is disabled by policy on this runtime. */ + | "disabled-by-policy"; /** * Why no usable transport could be offered * @@ -657,12 +691,24 @@ export type CatalogUnavailableReason = */ /** @experimental */ export type CatalogUnavailableTransportReason = - /** The card advertises no transport this runtime can use. */ - | "no-eligible-transport" - /** Every advertised transport is of a kind this runtime does not implement. */ - | "transport-not-supported" - /** Eligible remotes could not be enumerated, so no explicit choice can be offered. */ - | "remote-enumeration-unavailable"; + /** The card advertises no transport this runtime can use. */ + | "no-eligible-transport" + /** Every advertised transport is of a kind this runtime does not implement. */ + | "transport-not-supported" + /** Eligible remotes could not be enumerated, so no explicit choice can be offered. */ + | "remote-enumeration-unavailable"; +/** + * Why the runtime requests client-task cancellation. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ClientTaskCancelReason". + */ +/** @experimental */ +export type ClientTaskCancelReason = + /** A caller requested task cancellation. */ + | "cancel_requested" + /** The session is shutting down. */ + | "session_shutdown"; /** * Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command * @@ -671,12 +717,12 @@ export type CatalogUnavailableTransportReason = */ /** @experimental */ export type SlashCommandKind = - /** Command implemented by the runtime. */ - | "builtin" - /** Command backed by a skill. */ - | "skill" - /** Command registered by an SDK client or extension. */ - | "client"; + /** Command implemented by the runtime. */ + | "builtin" + /** Command backed by a skill. */ + | "skill" + /** Command registered by an SDK client or extension. */ + | "client"; /** * Optional completion hint for the input (e.g. 'directory' for filesystem path completion) * @@ -684,7 +730,8 @@ export type SlashCommandKind = * via the `definition` "SlashCommandInputCompletion". */ /** @experimental */ -export type SlashCommandInputCompletion = /** Input should complete filesystem directories. */ "directory"; +export type SlashCommandInputCompletion = + /** Input should complete filesystem directories. */ "directory"; /** * Whether a pending slash-command invocation effect was applied or cancelled by the host. * @@ -693,10 +740,10 @@ export type SlashCommandInputCompletion = /** Input should complete filesystem d */ /** @experimental */ export type CommandsInvocationEffectOutcome = - /** The host applied the pending invocation effect. */ - | "applied" - /** The host cancelled the pending invocation effect, so any provisional state must be reverted. */ - | "cancelled"; + /** The host applied the pending invocation effect. */ + | "applied" + /** The host cancelled the pending invocation effect, so any provisional state must be reverted. */ + | "cancelled"; /** @experimental */ export type CommandsInvocationOrigin = "settings"; @@ -708,23 +755,23 @@ export type CommandsInvocationOrigin = "settings"; */ /** @experimental */ export type CommandsListRequest = - | { - [k: string]: unknown | undefined; - } - | { - /** - * Include runtime built-in commands - */ - includeBuiltins?: boolean; - /** - * Include enabled user-invocable skills and commands - */ - includeSkills?: boolean; - /** - * Include commands registered by protocol clients, including SDK clients and extensions - */ - includeClientCommands?: boolean; - }; + | { + [k: string]: unknown | undefined; + } + | { + /** + * Include runtime built-in commands + */ + includeBuiltins?: boolean; + /** + * Include enabled user-invocable skills and commands + */ + includeSkills?: boolean; + /** + * Include commands registered by protocol clients, including SDK clients and extensions + */ + includeClientCommands?: boolean; + }; /** * Result of the queued command execution. * @@ -741,10 +788,24 @@ export type QueuedCommandResult = QueuedCommandHandled | QueuedCommandNotHandled */ /** @experimental */ export type ConnectedRemoteSessionMetadataKind = - /** Remote CLI session. */ - | "remote-session" - /** GitHub Copilot coding agent session. */ - | "coding-agent"; + /** Remote CLI session. */ + | "remote-session" + /** GitHub Copilot coding agent session. */ + | "coding-agent"; +/** + * Closed set of public task kinds a connection can negotiate. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskKind". + */ +/** @experimental */ +export type TaskKind = + /** Runtime-owned background agent task. */ + | "agent" + /** Runtime-owned shell task. */ + | "shell" + /** Client-owned externally executed task. */ + | "client"; /** * Controls how MCP tool result content is filtered: none leaves content unchanged, markdown sanitizes HTML while preserving Markdown-friendly output, and hidden_characters removes characters that can hide directives. * @@ -753,12 +814,12 @@ export type ConnectedRemoteSessionMetadataKind = */ /** @experimental */ export type ContentFilterMode = - /** Leave MCP tool result content unchanged. */ - | "none" - /** Sanitize HTML while preserving Markdown-friendly output. */ - | "markdown" - /** Remove characters that can hide directives. */ - | "hidden_characters"; + /** Leave MCP tool result content unchanged. */ + | "none" + /** Sanitize HTML while preserving Markdown-friendly output. */ + | "markdown" + /** Remove characters that can hide directives. */ + | "hidden_characters"; /** * Source category for a collected debug bundle entry. * @@ -767,14 +828,14 @@ export type ContentFilterMode = */ /** @experimental */ export type DebugCollectLogsSource = - /** Session event log. */ - | "events" - /** Process log for the session. */ - | "process-log" - /** Interactive shell log for the session. */ - | "shell-log" - /** Caller-provided diagnostic entry. */ - | "additional"; + /** Session event log. */ + | "events" + /** Process log for the session. */ + | "process-log" + /** Interactive shell log for the session. */ + | "shell-log" + /** Caller-provided diagnostic entry. */ + | "additional"; /** * Destination for the redacted debug bundle. * @@ -783,30 +844,30 @@ export type DebugCollectLogsSource = */ /** @experimental */ export type DebugCollectLogsDestination = - | { - /** - * Absolute or server-relative path for the .tgz archive to create. - */ - outputPath: string; - /** - * When true, create the archive atomically without overwriting an existing file by appending ` (N)` before the extension as needed. Defaults to false. - */ - noOverwrite?: boolean; - /** - * Destination variant discriminator. - */ - kind: "archive"; - } - | { - /** - * Directory where redacted files should be staged. The directory is created if needed. - */ - outputDirectory: string; - /** - * Destination variant discriminator. - */ - kind: "directory"; - }; + | { + /** + * Absolute or server-relative path for the .tgz archive to create. + */ + outputPath: string; + /** + * When true, create the archive atomically without overwriting an existing file by appending ` (N)` before the extension as needed. Defaults to false. + */ + noOverwrite?: boolean; + /** + * Destination variant discriminator. + */ + kind: "archive"; + } + | { + /** + * Directory where redacted files should be staged. The directory is created if needed. + */ + outputDirectory: string; + /** + * Destination variant discriminator. + */ + kind: "directory"; + }; /** * Kind of caller-provided debug log entry. * @@ -815,10 +876,10 @@ export type DebugCollectLogsDestination = */ /** @experimental */ export type DebugCollectLogsEntryKind = - /** Include a single server-local file. */ - | "file" - /** Include files from a server-local directory recursively. */ - | "directory"; + /** Include a single server-local file. */ + | "file" + /** Include files from a server-local directory recursively. */ + | "directory"; /** * How a collected debug entry should be redacted before being staged. * @@ -827,10 +888,10 @@ export type DebugCollectLogsEntryKind = */ /** @experimental */ export type DebugCollectLogsRedaction = - /** Redact the file as plain UTF-8 log text. */ - | "plain-text" - /** Redact each non-empty line as a session event JSON object, falling back to plain-text redaction for malformed lines. */ - | "events-jsonl"; + /** Redact the file as plain UTF-8 log text. */ + | "plain-text" + /** Redact each non-empty line as a session event JSON object, falling back to plain-text redaction for malformed lines. */ + | "events-jsonl"; /** * Destination kind that was written. * @@ -839,10 +900,10 @@ export type DebugCollectLogsRedaction = */ /** @experimental */ export type DebugCollectLogsResultKind = - /** A .tgz archive was written. */ - | "archive" - /** A directory containing redacted files was written. */ - | "directory"; + /** A .tgz archive was written. */ + | "archive" + /** A directory containing redacted files was written. */ + | "directory"; /** * Persisted extension discovery source * @@ -851,10 +912,10 @@ export type DebugCollectLogsResultKind = */ /** @experimental */ export type DiscoveredExtensionSource = - /** Extension discovered from the user's extensions directory. */ - | "user" - /** Extension contributed by an installed plugin. */ - | "plugin"; + /** Extension discovered from the user's extensions directory. */ + | "user" + /** Extension contributed by an installed plugin. */ + | "plugin"; /** * Effective extension loading and agent-management mode * @@ -863,12 +924,12 @@ export type DiscoveredExtensionSource = */ /** @experimental */ export type DiscoveredExtensionMode = - /** Extensions are not loaded. */ - | "disabled" - /** Extensions are loaded, but the agent cannot create, reload, or manage them. */ - | "load_only" - /** Extensions are loaded and the agent can create, reload, and manage them. */ - | "load_and_augment"; + /** Extensions are not loaded. */ + | "disabled" + /** Extensions are loaded, but the agent cannot create, reload, or manage them. */ + | "load_only" + /** Extensions are loaded and the agent can create, reload, and manage them. */ + | "load_and_augment"; /** * Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events. * @@ -877,40 +938,40 @@ export type DiscoveredExtensionMode = */ /** @experimental */ export type HookType = - /** Runs before a tool is invoked. */ - | "preToolUse" - /** Runs before an MCP tool is invoked. */ - | "preMcpToolCall" - /** Runs after a tool completes successfully. */ - | "postToolUse" - /** Runs after a tool fails. */ - | "postToolUseFailure" - /** Runs after the user submits a prompt. */ - | "userPromptSubmitted" - /** Runs after the runtime transforms the submitted prompt for the model, before it is added to session history. */ - | "userPromptTransformed" - /** Runs when a session starts. */ - | "sessionStart" - /** Runs when a session ends. */ - | "sessionEnd" - /** Runs after an agent result is produced. */ - | "postResult" - /** Runs before a pull request description is generated. */ - | "prePRDescription" - /** Runs when the agent encounters an error. */ - | "errorOccurred" - /** Runs when the agent stops. */ - | "agentStop" - /** Runs when a subagent starts. */ - | "subagentStart" - /** Runs when a subagent stops. */ - | "subagentStop" - /** Runs before conversation context is compacted. */ - | "preCompact" - /** Runs when the agent requests permission. */ - | "permissionRequest" - /** Runs when the agent emits a notification. */ - | "notification"; + /** Runs before a tool is invoked. */ + | "preToolUse" + /** Runs before an MCP tool is invoked. */ + | "preMcpToolCall" + /** Runs after a tool completes successfully. */ + | "postToolUse" + /** Runs after a tool fails. */ + | "postToolUseFailure" + /** Runs after the user submits a prompt. */ + | "userPromptSubmitted" + /** Runs after the runtime transforms the submitted prompt for the model, before it is added to session history. */ + | "userPromptTransformed" + /** Runs when a session starts. */ + | "sessionStart" + /** Runs when a session ends. */ + | "sessionEnd" + /** Runs after an agent result is produced. */ + | "postResult" + /** Runs before a pull request description is generated. */ + | "prePRDescription" + /** Runs when the agent encounters an error. */ + | "errorOccurred" + /** Runs when the agent stops. */ + | "agentStop" + /** Runs when a subagent starts. */ + | "subagentStart" + /** Runs when a subagent stops. */ + | "subagentStop" + /** Runs before conversation context is compacted. */ + | "preCompact" + /** Runs when the agent requests permission. */ + | "permissionRequest" + /** Runs when the agent emits a notification. */ + | "notification"; /** * Configuration tier that contributed a discovered hook action. * @@ -919,14 +980,14 @@ export type HookType = */ /** @experimental */ export type HookOrigin = - /** Hook loaded from user settings or the user's hook directory. */ - | "user" - /** Hook loaded from repository settings or the repository hook directory. */ - | "repository" - /** Hook provided by an enabled installed or explicit plugin. Projectless rows omit projectPath and do not expand a project directory. */ - | "plugin" - /** Hook enforced by centrally managed policy. */ - | "policy"; + /** Hook loaded from user settings or the user's hook directory. */ + | "user" + /** Hook loaded from repository settings or the repository hook directory. */ + | "repository" + /** Hook provided by an enabled installed or explicit plugin. Projectless rows omit projectPath and do not expand a project directory. */ + | "plugin" + /** Hook enforced by centrally managed policy. */ + | "policy"; /** * Server transport type: stdio, http, sse (deprecated), or memory * @@ -935,14 +996,14 @@ export type HookOrigin = */ /** @experimental */ export type DiscoveredMcpServerType = - /** Server communicates over stdio with a local child process. */ - | "stdio" - /** Server communicates over streamable HTTP. */ - | "http" - /** Server communicates over Server-Sent Events (deprecated). */ - | "sse" - /** Server is backed by an in-memory runtime implementation. */ - | "memory"; + /** Server communicates over stdio with a local child process. */ + | "stdio" + /** Server communicates over streamable HTTP. */ + | "http" + /** Server communicates over Server-Sent Events (deprecated). */ + | "sse" + /** Server is backed by an in-memory runtime implementation. */ + | "memory"; /** * Either '*' to receive all event types, or a non-empty list of event types to receive * @@ -959,10 +1020,10 @@ export type EventLogTypes = "*" | [string, ...string[]]; */ /** @experimental */ export type EventsAgentScope = - /** Return main-agent events and typed subagent lifecycle events. */ - | "primary" - /** Return events from all agents. */ - | "all"; + /** Return main-agent events and typed subagent lifecycle events. */ + | "primary" + /** Return events from all agents. */ + | "all"; /** * Direction to page through the session's persisted event history. 'forward' pages from the cursor toward newer events; 'backward' returns the newest window first (tail-first) and pages toward older events. Events within a returned batch are always chronological (oldest-to-newest), even for a backward read. * @@ -971,10 +1032,10 @@ export type EventsAgentScope = */ /** @experimental */ export type EventsReadDirection = - /** Page from the cursor toward newer events (default). */ - | "forward" - /** Tail-first: return the newest events and page toward older events. */ - | "backward"; + /** Page from the cursor toward newer events (default). */ + | "forward" + /** Tail-first: return the newest events and page toward older events. */ + | "backward"; /** * Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history (the beginning for a forward read, the tail for a backward read). The fallback page is a fresh boundary snapshot, not a continuation of the requested cursor, so it may overlap already-rendered events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate by event id) before continuing from the returned cursor. * @@ -983,10 +1044,10 @@ export type EventsReadDirection = */ /** @experimental */ export type EventsCursorStatus = - /** The cursor was applied successfully. */ - | "ok" - /** The cursor referred to history that is no longer available. */ - | "expired"; + /** The cursor was applied successfully. */ + | "ok" + /** The cursor referred to history that is no longer available. */ + | "expired"; /** * Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin (installed plugin), or session (session-state//extensions/) * @@ -995,14 +1056,14 @@ export type EventsCursorStatus = */ /** @experimental */ export type ExtensionSource = - /** Extension discovered from the current project's .github/extensions directory. */ - | "project" - /** Extension discovered from the user's ~/.copilot/extensions directory. */ - | "user" - /** Extension contributed by an installed plugin. */ - | "plugin" - /** Extension discovered from the current session's state directory (loaded only for this session). */ - | "session"; + /** Extension discovered from the current project's .github/extensions directory. */ + | "project" + /** Extension discovered from the user's ~/.copilot/extensions directory. */ + | "user" + /** Extension contributed by an installed plugin. */ + | "plugin" + /** Extension discovered from the current session's state directory (loaded only for this session). */ + | "session"; /** * Current status: running, disabled, failed, or starting * @@ -1011,14 +1072,14 @@ export type ExtensionSource = */ /** @experimental */ export type ExtensionStatus = - /** The extension process is running. */ - | "running" - /** The extension is installed but disabled. */ - | "disabled" - /** The extension failed to start or crashed. */ - | "failed" - /** The extension process is starting. */ - | "starting"; + /** The extension process is running. */ + | "running" + /** The extension is installed but disabled. */ + | "disabled" + /** The extension failed to start or crashed. */ + | "failed" + /** The extension process is starting. */ + | "starting"; /** * Tool call result (string or expanded result object) * @@ -1035,10 +1096,10 @@ export type ExternalToolResult = string | ExternalToolTextResultForLlm; */ /** @experimental */ export type ExternalToolTextResultForLlmBinaryResultsForLlmType = - /** Binary image data. */ - | "image" - /** Other binary resource data. */ - | "resource"; + /** Binary image data. */ + | "image" + /** Other binary resource data. */ + | "resource"; /** * A content block within a tool result, which may be text, terminal output, image, audio, or a resource * @@ -1047,13 +1108,13 @@ export type ExternalToolTextResultForLlmBinaryResultsForLlmType = */ /** @experimental */ export type ExternalToolTextResultForLlmContent = - | ExternalToolTextResultForLlmContentText - | ExternalToolTextResultForLlmContentTerminal - | ExternalToolTextResultForLlmContentShellExit - | ExternalToolTextResultForLlmContentImage - | ExternalToolTextResultForLlmContentAudio - | ExternalToolTextResultForLlmContentResourceLink - | ExternalToolTextResultForLlmContentResource; + | ExternalToolTextResultForLlmContentText + | ExternalToolTextResultForLlmContentTerminal + | ExternalToolTextResultForLlmContentShellExit + | ExternalToolTextResultForLlmContentImage + | ExternalToolTextResultForLlmContentAudio + | ExternalToolTextResultForLlmContentResourceLink + | ExternalToolTextResultForLlmContentResource; /** * Theme variant this icon is intended for * @@ -1062,10 +1123,10 @@ export type ExternalToolTextResultForLlmContent = */ /** @experimental */ export type ExternalToolTextResultForLlmContentResourceLinkIconTheme = - /** Icon intended for light themes. */ - | "light" - /** Icon intended for dark themes. */ - | "dark"; + /** Icon intended for light themes. */ + | "light" + /** Icon intended for dark themes. */ + | "dark"; /** * The embedded resource contents, either text or base64-encoded binary * @@ -1074,8 +1135,8 @@ export type ExternalToolTextResultForLlmContentResourceLinkIconTheme = */ /** @experimental */ export type ExternalToolTextResultForLlmContentResourceDetails = - | EmbeddedTextResourceContents - | EmbeddedBlobResourceContents; + | EmbeddedTextResourceContents + | EmbeddedBlobResourceContents; /** * Execution-critical factory storage operation. * @@ -1084,28 +1145,28 @@ export type ExternalToolTextResultForLlmContentResourceDetails = */ /** @experimental */ export type FactoryDurableOperation = - /** Creating the durable run and declared phases. */ - | "createRun" - /** Persisting the transition to running. */ - | "markRunStarted" - /** Persisting the terminal run envelope. */ - | "finishRun" - /** Persisting subagent admission accounting. */ - | "reserveAgent" - /** Rolling back an uncommitted subagent admission. */ - | "releaseAgent" - /** Persisting an idempotent model-usage charge. */ - | "chargeCredit" - /** Persisting active execution time. */ - | "addElapsed" - /** Reading the authoritative AI-credit total. */ - | "reconcileCreditTotal" - /** Reading a journal entry without treating storage failure as a cache miss. */ - | "journalGet" - /** Persisting a journal entry before reporting success. */ - | "journalPut" - /** Renewing the durable owner lease that proves this process still owns the run. */ - | "refreshLease"; + /** Creating the durable run and declared phases. */ + | "createRun" + /** Persisting the transition to running. */ + | "markRunStarted" + /** Persisting the terminal run envelope. */ + | "finishRun" + /** Persisting subagent admission accounting. */ + | "reserveAgent" + /** Rolling back an uncommitted subagent admission. */ + | "releaseAgent" + /** Persisting an idempotent model-usage charge. */ + | "chargeCredit" + /** Persisting active execution time. */ + | "addElapsed" + /** Reading the authoritative AI-credit total. */ + | "reconcileCreditTotal" + /** Reading a journal entry without treating storage failure as a cache miss. */ + | "journalGet" + /** Persisting a journal entry before reporting success. */ + | "journalPut" + /** Renewing the durable owner lease that proves this process still owns the run. */ + | "refreshLease"; /** * Current or terminal state of a factory run. * @@ -1114,18 +1175,18 @@ export type FactoryDurableOperation = */ /** @experimental */ export type FactoryRunStatus = - /** The run was minted and is awaiting approval. */ - | "pending" - /** The run is executing. */ - | "running" - /** The run completed successfully. */ - | "completed" - /** The run was interrupted while resource budget remained. */ - | "halted" - /** The run was cancelled before completion. */ - | "cancelled" - /** The factory body failed or reached a cumulative resource ceiling. */ - | "error"; + /** The run was minted and is awaiting approval. */ + | "pending" + /** The run is executing. */ + | "running" + /** The run completed successfully. */ + | "completed" + /** The run was interrupted while resource budget remained. */ + | "halted" + /** The run was cancelled before completion. */ + | "cancelled" + /** The factory body failed or reached a cumulative resource ceiling. */ + | "error"; /** * Machine-readable factory run failure. * @@ -1134,74 +1195,74 @@ export type FactoryRunStatus = */ /** @experimental */ export type FactoryRunFailure = - | { - kind: FactoryRunFailureKind; - /** - * Approved effective ceiling that was reached. - */ - value: number; - /** - * Factory run identifier. - */ - runId: string; - /** - * Factory failure variant discriminator. - */ - type: "factory_limit_reached"; - } - | { - /** - * Factory run identifier whose changed limits were declined. - */ - runId: string; - /** - * Human-readable reason the resume did not proceed. - */ - reason: string; - /** - * Factory failure variant discriminator. - */ - type: "factory_resume_declined"; - } - | { - /** - * Stable failure code. - */ - code: string; - operation: FactoryDurableOperation; - /** - * Factory run identifier. - */ - runId: string; - /** - * Factory failure variant discriminator. - */ - type: "factory_durable_failure"; - } - | { - /** - * Factory run identifier. - */ - runId: string; - /** - * Confirmed usage in nano-AIU, representing the floor of what the run spent. - */ - drainedNanoAiu: number; - /** - * Factory failure variant discriminator. - */ - type: "factory_accounting_incomplete"; - } - | { - /** - * Factory run identifier. - */ - runId: string; - /** - * Factory failure variant discriminator. - */ - type: "factory_provider_disconnected"; - }; + | { + kind: FactoryRunFailureKind; + /** + * Approved effective ceiling that was reached. + */ + value: number; + /** + * Factory run identifier. + */ + runId: string; + /** + * Factory failure variant discriminator. + */ + type: "factory_limit_reached"; + } + | { + /** + * Factory run identifier whose changed limits were declined. + */ + runId: string; + /** + * Human-readable reason the resume did not proceed. + */ + reason: string; + /** + * Factory failure variant discriminator. + */ + type: "factory_resume_declined"; + } + | { + /** + * Stable failure code. + */ + code: string; + operation: FactoryDurableOperation; + /** + * Factory run identifier. + */ + runId: string; + /** + * Factory failure variant discriminator. + */ + type: "factory_durable_failure"; + } + | { + /** + * Factory run identifier. + */ + runId: string; + /** + * Confirmed usage in nano-AIU, representing the floor of what the run spent. + */ + drainedNanoAiu: number; + /** + * Factory failure variant discriminator. + */ + type: "factory_accounting_incomplete"; + } + | { + /** + * Factory run identifier. + */ + runId: string; + /** + * Factory failure variant discriminator. + */ + type: "factory_provider_disconnected"; + }; /** * Cumulative resource ceiling that stopped a factory run. * @@ -1210,12 +1271,12 @@ export type FactoryRunFailure = */ /** @experimental */ export type FactoryRunFailureKind = - /** The run admitted the approved maximum total number of subagents. */ - | "maxTotalSubagents" - /** The run reached the approved accumulated active-execution time in seconds. */ - | "timeoutSeconds" - /** The run's settled subagent model usage exceeded the approved AI-credit ceiling, or no headroom remained for another subagent. */ - | "maxAiCredits"; + /** The run admitted the approved maximum total number of subagents. */ + | "maxTotalSubagents" + /** The run reached the approved accumulated active-execution time in seconds. */ + | "timeoutSeconds" + /** The run's settled subagent model usage exceeded the approved AI-credit ceiling, or no headroom remained for another subagent. */ + | "maxAiCredits"; /** * Kind of factory progress line. * @@ -1224,10 +1285,10 @@ export type FactoryRunFailureKind = */ /** @experimental */ export type FactoryLogLineKind = - /** A narrator log line. */ - | "log" - /** A named factory phase marker. */ - | "phase"; + /** A narrator log line. */ + | "log" + /** A named factory phase marker. */ + | "phase"; /** * Derived lifecycle state of a factory phase. * @@ -1236,14 +1297,14 @@ export type FactoryLogLineKind = */ /** @experimental */ export type FactoryPhaseStatus = - /** The phase has not been entered yet. */ - | "pending" - /** The phase is currently entered and accumulating active time. */ - | "active" - /** The phase was entered and has since been closed. */ - | "completed" - /** The phase was never entered because a later phase was entered or the run reached a terminal state. */ - | "skipped"; + /** The phase has not been entered yet. */ + | "pending" + /** The phase is currently entered and accumulating active time. */ + | "active" + /** The phase was entered and has since been closed. */ + | "completed" + /** The phase was never entered because a later phase was entered or the run reached a terminal state. */ + | "skipped"; /** * Content filtering mode to apply to all tools, or a map of tool name to content filtering mode. * @@ -1252,10 +1313,10 @@ export type FactoryPhaseStatus = */ /** @experimental */ export type FilterMapping = - | { - [k: string]: ContentFilterMode; - } - | ContentFilterMode; + | { + [k: string]: ContentFilterMode; + } + | ContentFilterMode; /** * Why the runtime is requesting a GitHub credential. * @@ -1264,10 +1325,10 @@ export type FilterMapping = */ /** @experimental */ export type GitHubTokenAcquireReason = - /** The runtime is acquiring the registration's first credential. */ - | "initial" - /** The runtime is replacing a credential that is approaching expiry. */ - | "refresh"; + /** The runtime is acquiring the registration's first credential. */ + | "initial" + /** The runtime is replacing a credential that is approaching expiry. */ + | "refresh"; /** * SDK host response to a GitHub credential request. * @@ -1276,30 +1337,30 @@ export type GitHubTokenAcquireReason = */ /** @experimental */ export type GitHubTokenAcquireResult = - | { - /** - * GitHub access token acquired by the SDK host. - */ - accessToken: string; - /** - * OAuth token type. Defaults to bearer when omitted. - */ - tokenType?: string; - /** - * Remaining token lifetime in seconds when callback execution completes. It must exceed the one-hour preflight refresh threshold. - */ - expiresIn: number; - /** - * GitHub credential response variant discriminator. - */ - kind: "token"; - } - | { - /** - * GitHub credential response variant discriminator. - */ - kind: "cancelled"; - }; + | { + /** + * GitHub access token acquired by the SDK host. + */ + accessToken: string; + /** + * OAuth token type. Defaults to bearer when omitted. + */ + tokenType?: string; + /** + * Remaining token lifetime in seconds when callback execution completes. It must exceed the one-hour preflight refresh threshold. + */ + expiresIn: number; + /** + * GitHub credential response variant discriminator. + */ + kind: "token"; + } + | { + /** + * GitHub credential response variant discriminator. + */ + kind: "cancelled"; + }; /** * Optional compaction parameters. * @@ -1308,26 +1369,26 @@ export type GitHubTokenAcquireResult = */ /** @experimental */ export type HistoryCompactRequest = - | { - [k: string]: unknown | undefined; - } - | { - /** - * Optional user-provided instructions to focus the compaction summary - */ - customInstructions?: string; - /** - * What initiated this compaction request, recorded as the `trigger` on the persisted `session.compaction_start` / `session.compaction_complete` events. When absent, the compaction is persisted without trigger attribution (initiator unknown). - */ - trigger?: /** User-requested compaction, e.g. the /compact command or a direct history.compact call. */ - | "manual" - /** Compaction requested while switching to a model with a smaller context window. */ - | "model_switch"; - /** - * Context window token limit this compaction is targeting, recorded as the `tokenLimit` on the persisted `session.compaction_start` / `session.compaction_complete` events. Set it when the compaction targets a window other than the compacting model's own, e.g. switching to a model with a smaller context window: the compaction still runs on the current model, so the limit that motivated it would otherwise be lost. When absent, the events record the compacting model's own resolved limit. Attribution metadata only - it does not change how much the compaction removes. - */ - tokenLimit?: number; - }; + | { + [k: string]: unknown | undefined; + } + | { + /** + * Optional user-provided instructions to focus the compaction summary + */ + customInstructions?: string; + /** + * What initiated this compaction request, recorded as the `trigger` on the persisted `session.compaction_start` / `session.compaction_complete` events. When absent, the compaction is persisted without trigger attribution (initiator unknown). + */ + trigger?: /** User-requested compaction, e.g. the /compact command or a direct history.compact call. */ + | "manual" + /** Compaction requested while switching to a model with a smaller context window. */ + | "model_switch"; + /** + * Context window token limit this compaction is targeting, recorded as the `tokenLimit` on the persisted `session.compaction_start` / `session.compaction_complete` events. Set it when the compaction targets a window other than the compacting model's own, e.g. switching to a model with a smaller context window: the compaction still runs on the current model, so the limit that motivated it would otherwise be lost. When absent, the events record the compacting model's own resolved limit. Attribution metadata only - it does not change how much the compaction removes. + */ + tokenLimit?: number; + }; /** * Reason a captured file was not restored. * @@ -1336,10 +1397,10 @@ export type HistoryCompactRequest = */ /** @experimental */ export type HistoryFileRestoreSkipReason = - /** The file changed after Copilot's last captured write. */ - | "user-modified" - /** A faithful preimage was not captured. */ - | "skipped-capture"; + /** The file changed after Copilot's last captured write. */ + | "user-modified" + /** A faithful preimage was not captured. */ + | "skipped-capture"; /** * Reason a rewind read (rewind points, file-restore preview, or session diff) could not be answered from the session's file-change captures. * @@ -1348,12 +1409,12 @@ export type HistoryFileRestoreSkipReason = */ /** @experimental */ export type HistoryRewindUnavailableReason = - /** The session did not opt into file-change tracking before its first turn. */ - | "file-change-tracking-disabled" - /** The session still has work that may mutate files or history. Transient: the same request succeeds once the session settles, so callers should retry rather than treat it as a failure. */ - | "session-busy" - /** Remote-backed rewind routing is not supported. */ - | "unsupported-remote-session"; + /** The session did not opt into file-change tracking before its first turn. */ + | "file-change-tracking-disabled" + /** The session still has work that may mutate files or history. Transient: the same request succeeds once the session settles, so callers should retry rather than treat it as a failure. */ + | "session-busy" + /** Remote-backed rewind routing is not supported. */ + | "unsupported-remote-session"; /** * Aggregate file change represented by a rewind preview. * @@ -1362,12 +1423,12 @@ export type HistoryRewindUnavailableReason = */ /** @experimental */ export type HistoryRewindChangeType = - /** The discarded turns created the file. */ - | "created" - /** The discarded turns deleted the file. */ - | "deleted" - /** The discarded turns modified the file. */ - | "modified"; + /** The discarded turns created the file. */ + | "created" + /** The discarded turns deleted the file. */ + | "deleted" + /** The discarded turns modified the file. */ + | "modified"; /** * Scope of a rewind operation. * @@ -1376,10 +1437,10 @@ export type HistoryRewindChangeType = */ /** @experimental */ export type HistoryRewindMode = - /** Discard conversation events while leaving files unchanged. */ - | "conversation" - /** Discard conversation events and restore captured files changed by those turns. */ - | "conversation-and-files"; + /** Discard conversation events while leaving files unchanged. */ + | "conversation" + /** Discard conversation events and restore captured files changed by those turns. */ + | "conversation-and-files"; /** * Outcome of a rewind request. * @@ -1388,24 +1449,24 @@ export type HistoryRewindMode = */ /** @experimental */ export type HistoryRewindOutcome = - /** The requested rewind completed; reachable in either mode. */ - | "success" - /** The session still has work that may mutate files or history; reachable in either mode. */ - | "session-busy" - /** A conversation-and-files rewind was requested for a session that did not enable capture; conversation-only rewinds never produce this. */ - | "file-change-tracking-disabled" - /** Remote-backed rewind routing is not supported; reachable in either mode. */ - | "unsupported-remote-session" - /** File restore failed and all applied file changes were rolled back; only conversation-and-files rewinds produce this. */ - | "files-rolled-back" - /** File restore failed and its rollback could not fully restore the pre-rewind state; only conversation-and-files rewinds produce this. */ - | "rollback-incomplete" - /** Conversation truncation failed. In conversation-and-files mode any files that were restored are left in place because conversation history cannot be un-truncated; in conversation-only mode no files are restored. Consult restoredFiles for what, if anything, was applied. */ - | "truncation-failed" - /** The conversation was rewound (and, in conversation-and-files mode, captured files were restored), but persisted checkpoints could not be cleaned up; reachable in either mode. */ - | "checkpoint-cleanup-failed" - /** Files and conversation were rewound, but obsolete file snapshots could not be removed; only conversation-and-files rewinds produce this. */ - | "snapshot-prune-failed"; + /** The requested rewind completed; reachable in either mode. */ + | "success" + /** The session still has work that may mutate files or history; reachable in either mode. */ + | "session-busy" + /** A conversation-and-files rewind was requested for a session that did not enable capture; conversation-only rewinds never produce this. */ + | "file-change-tracking-disabled" + /** Remote-backed rewind routing is not supported; reachable in either mode. */ + | "unsupported-remote-session" + /** File restore failed and all applied file changes were rolled back; only conversation-and-files rewinds produce this. */ + | "files-rolled-back" + /** File restore failed and its rollback could not fully restore the pre-rewind state; only conversation-and-files rewinds produce this. */ + | "rollback-incomplete" + /** Conversation truncation failed. In conversation-and-files mode any files that were restored are left in place because conversation history cannot be un-truncated; in conversation-only mode no files are restored. Consult restoredFiles for what, if anything, was applied. */ + | "truncation-failed" + /** The conversation was rewound (and, in conversation-and-files mode, captured files were restored), but persisted checkpoints could not be cleaned up; reachable in either mode. */ + | "checkpoint-cleanup-failed" + /** Files and conversation were rewound, but obsolete file snapshots could not be removed; only conversation-and-files rewinds produce this. */ + | "snapshot-prune-failed"; /** * Source for direct repo installs (when marketplace is empty) * @@ -1414,10 +1475,10 @@ export type HistoryRewindOutcome = */ /** @experimental */ export type InstalledPluginSource = - | string - | InstalledPluginSourceGitHub - | InstalledPluginSourceUrl - | InstalledPluginSourceLocal; + | string + | InstalledPluginSourceGitHub + | InstalledPluginSourceUrl + | InstalledPluginSourceLocal; /** * Which tier this target belongs to * @@ -1426,14 +1487,14 @@ export type InstalledPluginSource = */ /** @experimental */ export type InstructionDiscoveryPathLocation = - /** Instructions live in user-level configuration. */ - | "user" - /** Instructions live in repository-level configuration. */ - | "repository" - /** Instructions live under the current working directory. */ - | "working-directory" - /** Instructions live in plugin-provided configuration. */ - | "plugin"; + /** Instructions live in user-level configuration. */ + | "user" + /** Instructions live in repository-level configuration. */ + | "repository" + /** Instructions live under the current working directory. */ + | "working-directory" + /** Instructions live in plugin-provided configuration. */ + | "plugin"; /** * Whether the target is a single file or a directory of instruction files * @@ -1442,10 +1503,10 @@ export type InstructionDiscoveryPathLocation = */ /** @experimental */ export type InstructionDiscoveryPathKind = - /** The target is a single instruction file. */ - | "file" - /** The target is a directory that holds instruction files. */ - | "directory"; + /** The target is a single instruction file. */ + | "file" + /** The target is a directory that holds instruction files. */ + | "directory"; /** * Category of instruction source — used for merge logic * @@ -1454,20 +1515,20 @@ export type InstructionDiscoveryPathKind = */ /** @experimental */ export type InstructionSourceType = - /** Instructions loaded from the user's home configuration. */ - | "home" - /** Instructions loaded from repository-scoped files. */ - | "repo" - /** Instructions loaded from model-specific files. */ - | "model" - /** Instructions loaded from VS Code instruction files. */ - | "vscode" - /** Instructions discovered from nested agent files. */ - | "nested-agents" - /** Instructions inherited from child instruction files. */ - | "child-instructions" - /** Instructions supplied by an installed plugin. */ - | "plugin"; + /** Instructions loaded from the user's home configuration. */ + | "home" + /** Instructions loaded from repository-scoped files. */ + | "repo" + /** Instructions loaded from model-specific files. */ + | "model" + /** Instructions loaded from VS Code instruction files. */ + | "vscode" + /** Instructions discovered from nested agent files. */ + | "nested-agents" + /** Instructions inherited from child instruction files. */ + | "child-instructions" + /** Instructions supplied by an installed plugin. */ + | "plugin"; /** * Where this source lives — used for UI grouping * @@ -1476,14 +1537,14 @@ export type InstructionSourceType = */ /** @experimental */ export type InstructionSourceLocation = - /** Instructions live in user-level configuration. */ - | "user" - /** Instructions live in repository-level configuration. */ - | "repository" - /** Instructions live under the current working directory. */ - | "working-directory" - /** Instructions live in plugin-provided configuration. */ - | "plugin"; + /** Instructions live in user-level configuration. */ + | "user" + /** Instructions live in repository-level configuration. */ + | "repository" + /** Instructions live under the current working directory. */ + | "working-directory" + /** Instructions live in plugin-provided configuration. */ + | "plugin"; /** * 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. * @@ -1492,10 +1553,10 @@ export type InstructionSourceLocation = */ /** @experimental */ export type LlmInferenceHttpRequestStartTransport = - /** 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. */ - | "http" - /** 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. */ - | "websocket"; + /** 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. */ + | "http" + /** 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. */ + | "websocket"; /** * Repository host type * @@ -1504,10 +1565,10 @@ export type LlmInferenceHttpRequestStartTransport = */ /** @experimental */ export type SessionContextHostType = - /** Session repository is hosted on GitHub. */ - | "github" - /** Session repository is hosted on Azure DevOps. */ - | "ado"; + /** Session repository is hosted on GitHub. */ + | "github" + /** Session repository is hosted on Azure DevOps. */ + | "ado"; /** * Log severity level. Determines how the message is displayed in the timeline. Defaults to "info". * @@ -1516,12 +1577,12 @@ export type SessionContextHostType = */ /** @experimental */ export type SessionLogLevel = - /** Informational message. */ - | "info" - /** Warning message that may require attention. */ - | "warning" - /** Error message describing a failure. */ - | "error"; + /** Informational message. */ + | "info" + /** Warning message that may require attention. */ + | "warning" + /** Error message describing a failure. */ + | "error"; /** * UI theme preference per SEP-1865 * @@ -1530,10 +1591,10 @@ export type SessionLogLevel = */ /** @experimental */ export type McpAppsHostContextDetailsTheme = - /** Light UI theme */ - | "light" - /** Dark UI theme */ - | "dark"; + /** Light UI theme */ + | "light" + /** Dark UI theme */ + | "dark"; /** * Current display mode (SEP-1865) * @@ -1542,12 +1603,12 @@ export type McpAppsHostContextDetailsTheme = */ /** @experimental */ export type McpAppsHostContextDetailsDisplayMode = - /** Rendered inline within the host conversation surface */ - | "inline" - /** Rendered as a fullscreen overlay */ - | "fullscreen" - /** Rendered as a picture-in-picture floating panel */ - | "pip"; + /** Rendered inline within the host conversation surface */ + | "inline" + /** Rendered as a fullscreen overlay */ + | "fullscreen" + /** Rendered as a picture-in-picture floating panel */ + | "pip"; /** * Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration. * @@ -1556,12 +1617,12 @@ export type McpAppsHostContextDetailsDisplayMode = */ /** @experimental */ export type McpAppsHostContextDetailsAvailableDisplayMode = - /** Rendered inline within the host conversation surface */ - | "inline" - /** Rendered as a fullscreen overlay */ - | "fullscreen" - /** Rendered as a picture-in-picture floating panel */ - | "pip"; + /** Rendered inline within the host conversation surface */ + | "inline" + /** Rendered as a fullscreen overlay */ + | "fullscreen" + /** Rendered as a picture-in-picture floating panel */ + | "pip"; /** * Platform type for responsive design * @@ -1570,12 +1631,12 @@ export type McpAppsHostContextDetailsAvailableDisplayMode = */ /** @experimental */ export type McpAppsHostContextDetailsPlatform = - /** Host runs in a web browser */ - | "web" - /** Host runs as a desktop application */ - | "desktop" - /** Host runs on a mobile device */ - | "mobile"; + /** Host runs in a web browser */ + | "web" + /** Host runs as a desktop application */ + | "desktop" + /** Host runs on a mobile device */ + | "mobile"; /** * UI theme preference per SEP-1865 * @@ -1584,10 +1645,10 @@ export type McpAppsHostContextDetailsPlatform = */ /** @experimental */ export type McpAppsSetHostContextDetailsTheme = - /** Light UI theme */ - | "light" - /** Dark UI theme */ - | "dark"; + /** Light UI theme */ + | "light" + /** Dark UI theme */ + | "dark"; /** * Current display mode (SEP-1865) * @@ -1596,12 +1657,12 @@ export type McpAppsSetHostContextDetailsTheme = */ /** @experimental */ export type McpAppsSetHostContextDetailsDisplayMode = - /** Rendered inline within the host conversation surface */ - | "inline" - /** Rendered as a fullscreen overlay */ - | "fullscreen" - /** Rendered as a picture-in-picture floating panel */ - | "pip"; + /** Rendered inline within the host conversation surface */ + | "inline" + /** Rendered as a fullscreen overlay */ + | "fullscreen" + /** Rendered as a picture-in-picture floating panel */ + | "pip"; /** * Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration. * @@ -1610,12 +1671,12 @@ export type McpAppsSetHostContextDetailsDisplayMode = */ /** @experimental */ export type McpAppsSetHostContextDetailsAvailableDisplayMode = - /** Rendered inline within the host conversation surface */ - | "inline" - /** Rendered as a fullscreen overlay */ - | "fullscreen" - /** Rendered as a picture-in-picture floating panel */ - | "pip"; + /** Rendered inline within the host conversation surface */ + | "inline" + /** Rendered as a fullscreen overlay */ + | "fullscreen" + /** Rendered as a picture-in-picture floating panel */ + | "pip"; /** * Platform type for responsive design * @@ -1624,12 +1685,12 @@ export type McpAppsSetHostContextDetailsAvailableDisplayMode = */ /** @experimental */ export type McpAppsSetHostContextDetailsPlatform = - /** Host runs in a web browser */ - | "web" - /** Host runs as a desktop application */ - | "desktop" - /** Host runs on a mobile device */ - | "mobile"; + /** Host runs in a web browser */ + | "web" + /** Host runs as a desktop application */ + | "desktop" + /** Host runs on a mobile device */ + | "mobile"; /** * Serializable MCP server configuration (stdio process or remote HTTP/SSE) * @@ -1662,10 +1723,10 @@ export type McpServerAuthConfig = boolean | McpServerAuthConfigRedirectPort; */ /** @experimental */ export type McpServerConfigDeferTools = - /** Tools may be deferred under certain conditions */ - | "auto" - /** Tools are always included in the initial tool list, even when tool search is enabled. */ - | "never"; + /** Tools may be deferred under certain conditions */ + | "auto" + /** Tools are always included in the initial tool list, even when tool search is enabled. */ + | "never"; /** * Local MCP transport type. * @@ -1674,10 +1735,10 @@ export type McpServerConfigDeferTools = */ /** @experimental */ export type McpServerConfigStdioType = - /** Legacy alias for the local stdio transport. */ - | "local" - /** Server communicates over stdio with a local child process. */ - | "stdio"; + /** Legacy alias for the local stdio transport. */ + | "local" + /** Server communicates over stdio with a local child process. */ + | "stdio"; /** * Remote transport type. Defaults to "http" when omitted. * @@ -1686,10 +1747,10 @@ export type McpServerConfigStdioType = */ /** @experimental */ export type McpServerConfigHttpType = - /** Streamable HTTP transport. */ - | "http" - /** Server-Sent Events transport. */ - | "sse"; + /** Streamable HTTP transport. */ + | "http" + /** Server-Sent Events transport. */ + | "sse"; /** * OAuth grant type to use when authenticating to the remote MCP server. * @@ -1698,10 +1759,10 @@ export type McpServerConfigHttpType = */ /** @experimental */ export type McpServerConfigHttpOauthGrantType = - /** Interactive browser-based authorization code flow with PKCE. */ - | "authorization_code" - /** Headless client credentials flow using the configured OAuth client. */ - | "client_credentials"; + /** Interactive browser-based authorization code flow with PKCE. */ + | "authorization_code" + /** Headless client credentials flow using the configured OAuth client. */ + | "client_credentials"; /** * Structured MCP elicitation mode. * @@ -1718,24 +1779,24 @@ export type McpElicitationFormMode = "form"; */ /** @experimental */ export type McpHeadersHandlePendingHeadersRefreshRequest = - | { - /** - * Headers to overlay onto the MCP request. Dynamic headers override static config headers but do not replace SDK-managed request headers. - */ - headers: { - [k: string]: string | undefined; + | { + /** + * Headers to overlay onto the MCP request. Dynamic headers override static config headers but do not replace SDK-managed request headers. + */ + headers: { + [k: string]: string | undefined; + }; + /** + * Headers-refresh response variant discriminator. + */ + kind: "headers"; + } + | { + /** + * Headers-refresh response variant discriminator. + */ + kind: "none"; }; - /** - * Headers-refresh response variant discriminator. - */ - kind: "headers"; - } - | { - /** - * Headers-refresh response variant discriminator. - */ - kind: "none"; - }; /** * One eligible way to run the server, represented as a tagged package or remote variant so package identity and endpoint states cannot contradict the install method. * @@ -1752,8 +1813,8 @@ export type McpPlanTransportChoice = McpPlanTransportChoicePackage | McpPlanTran */ /** @experimental */ export type McpPlanPackageTransport = - /** A locally launched process spoken to over standard input and output. */ - "stdio"; + /** A locally launched process spoken to over standard input and output. */ + "stdio"; /** * Discriminator for a package-backed transport choice * @@ -1786,16 +1847,16 @@ export type McpPlanRequiredValueScalarKind = /** The value uses one scalar type. */ /** @experimental */ export type McpPlanValueCategory = - /** Set as an environment variable on the launched process. */ - | "environment-variable" - /** Passed to the runtime that launches the package. */ - | "runtime-argument" - /** Passed to the packaged server itself. */ - | "package-argument" - /** Sent as a request header to a remote endpoint. */ - | "header" - /** Substituted into the remote endpoint URL. */ - | "url-variable"; + /** Set as an environment variable on the launched process. */ + | "environment-variable" + /** Passed to the runtime that launches the package. */ + | "runtime-argument" + /** Passed to the packaged server itself. */ + | "package-argument" + /** Sent as a request header to a remote endpoint. */ + | "header" + /** Substituted into the remote endpoint URL. */ + | "url-variable"; /** * Scalar type a required value must conform to * @@ -1804,14 +1865,14 @@ export type McpPlanValueCategory = */ /** @experimental */ export type McpPlanScalarValueType = - /** Free text. */ - | "string" - /** A number. */ - | "number" - /** A boolean. */ - | "boolean" - /** A filesystem path. */ - | "path"; + /** Free text. */ + | "string" + /** A number. */ + | "number" + /** A boolean. */ + | "boolean" + /** A filesystem path. */ + | "path"; /** * Discriminator for an enumerated required value * @@ -1819,7 +1880,8 @@ export type McpPlanScalarValueType = * via the `definition` "McpPlanRequiredValueEnumKind". */ /** @experimental */ -export type McpPlanRequiredValueEnumKind = /** The value uses a fixed non-empty enumeration. */ "enum"; +export type McpPlanRequiredValueEnumKind = + /** The value uses a fixed non-empty enumeration. */ "enum"; /** * Discriminator for an enumerated required value * @@ -1844,12 +1906,12 @@ export type McpPlanSecretReference = string; */ /** @experimental */ export type McpPlanRemoteTransport = - /** An HTTP endpoint. */ - | "http" - /** A streamable HTTP endpoint. */ - | "streamable-http" - /** A server-sent events endpoint. */ - | "sse"; + /** An HTTP endpoint. */ + | "http" + /** A streamable HTTP endpoint. */ + | "streamable-http" + /** A server-sent events endpoint. */ + | "sse"; /** * Discriminator for a remote-endpoint transport choice * @@ -1874,12 +1936,12 @@ export type McpPlanScope = /** The user's own MCP configuration. */ "user"; */ /** @experimental */ export type McpPlanPolicyDecision = - /** Policy permits the server. */ - | "allowed" - /** Policy forbids the server, so the plan cannot be applied. */ - | "blocked" - /** Policy permits the server only after an explicit approval. */ - | "requires-approval"; + /** Policy permits the server. */ + | "allowed" + /** Policy forbids the server, so the plan cannot be applied. */ + | "blocked" + /** Policy permits the server only after an explicit approval. */ + | "requires-approval"; /** * Whether a planned configuration change would create or modify an entry * @@ -1888,10 +1950,10 @@ export type McpPlanPolicyDecision = */ /** @experimental */ export type McpPlanConfigurationOperation = - /** Creates a configuration entry that does not exist yet. */ - | "add" - /** Modifies a configuration entry that already exists. */ - | "update"; + /** Creates a configuration entry that does not exist yet. */ + | "add" + /** Modifies a configuration entry that already exists. */ + | "update"; /** * Consumer allowed to call an MCP tool. * @@ -1900,10 +1962,10 @@ export type McpPlanConfigurationOperation = */ /** @experimental */ export type McpToolUiVisibility = - /** The model may call the tool. */ - | "model" - /** An MCP App view may call the tool. */ - | "app"; + /** The model may call the tool. */ + | "model" + /** An MCP App view may call the tool. */ + | "app"; /** * Host response to the pending OAuth request. * @@ -1912,30 +1974,30 @@ export type McpToolUiVisibility = */ /** @experimental */ export type McpOauthPendingRequestResponse = - | { - /** - * Access token acquired by the SDK host - */ - accessToken: string; - /** - * OAuth token type. Defaults to bearer when omitted. - */ - tokenType?: string; - /** - * Token lifetime in seconds, if known. - */ - expiresIn?: number; - /** - * OAuth response variant discriminator. - */ - kind: "token"; - } - | { - /** - * OAuth response variant discriminator. - */ - kind: "cancelled"; - }; + | { + /** + * Access token acquired by the SDK host + */ + accessToken: string; + /** + * OAuth token type. Defaults to bearer when omitted. + */ + tokenType?: string; + /** + * Token lifetime in seconds, if known. + */ + expiresIn?: number; + /** + * OAuth response variant discriminator. + */ + kind: "token"; + } + | { + /** + * OAuth response variant discriminator. + */ + kind: "cancelled"; + }; /** * OAuth grant type override for this login. * @@ -1944,10 +2006,10 @@ export type McpOauthPendingRequestResponse = */ /** @experimental */ export type McpOauthLoginGrantType = - /** Interactive browser-based OAuth flow using an authorization code, typically with PKCE. */ - | "authorization_code" - /** Headless OAuth flow where a confidential client authenticates directly with a client secret. */ - | "client_credentials"; + /** Interactive browser-based OAuth flow using an authorization code, typically with PKCE. */ + | "authorization_code" + /** Headless OAuth flow where a confidential client authenticates directly with a client secret. */ + | "client_credentials"; /** * Why a passive MCP OAuth probe determined authentication is needed. * @@ -1956,12 +2018,12 @@ export type McpOauthLoginGrantType = */ /** @experimental */ export type McpOauthProbeNeedsAuthReason = - /** No token was sent and the server requires authentication. */ - | "initial" - /** A cached token was sent and rejected. */ - | "refresh" - /** The server returned a 403 insufficient_scope challenge, indicating additional scopes or audience are needed. */ - | "upscope"; + /** No token was sent and the server requires authentication. */ + | "initial" + /** A cached token was sent and rejected. */ + | "refresh" + /** The server returned a 403 insufficient_scope challenge, indicating additional scopes or audience are needed. */ + | "upscope"; /** * Passive MCP OAuth probe result. `authenticated` means the server accepted the probe request while an OAuth-origin access token was attached; it does not prove the server required or independently validated that token. The probe does not make a second unauthenticated request. Failed is an expected probe-domain outcome; JSON-RPC errors are reserved for API-call failures. * @@ -1970,40 +2032,40 @@ export type McpOauthProbeNeedsAuthReason = */ /** @experimental */ export type McpOauthProbeResult = - | { - httpResponse: McpOauthHttpResponse; - /** - * Probe outcome variant discriminator. - */ - status: "no-auth-required"; - } - | { - httpResponse: McpOauthHttpResponse; - /** - * Probe outcome variant discriminator. - */ - status: "authenticated"; - } - | { - httpResponse: McpOauthHttpResponse; - reason: McpOauthProbeNeedsAuthReason; - wwwAuthenticateParams?: McpOauthWWWAuthenticateParams; - /** - * Probe outcome variant discriminator. - */ - status: "needs-auth"; - } - | { - /** - * Human-readable probe failure detail. - */ - error: string; - httpResponse?: McpOauthHttpResponse; - /** - * Probe outcome variant discriminator. - */ - status: "failed"; - }; + | { + httpResponse: McpOauthHttpResponse; + /** + * Probe outcome variant discriminator. + */ + status: "no-auth-required"; + } + | { + httpResponse: McpOauthHttpResponse; + /** + * Probe outcome variant discriminator. + */ + status: "authenticated"; + } + | { + httpResponse: McpOauthHttpResponse; + reason: McpOauthProbeNeedsAuthReason; + wwwAuthenticateParams?: McpOauthWWWAuthenticateParams; + /** + * Probe outcome variant discriminator. + */ + status: "needs-auth"; + } + | { + /** + * Human-readable probe failure detail. + */ + error: string; + httpResponse?: McpOauthHttpResponse; + /** + * Probe outcome variant discriminator. + */ + status: "failed"; + }; /** * What an install plan is computed from: a candidate handle from a previous search, or a card supplied directly. * @@ -2019,7 +2081,8 @@ export type McpPlanInstallSource = McpPlanInstallSourceCandidate | McpPlanInstal * via the `definition` "McpPlanInstallSourceCandidateKind". */ /** @experimental */ -export type McpPlanInstallSourceCandidateKind = /** Plan from a candidate returned by catalog search. */ "candidate"; +export type McpPlanInstallSourceCandidateKind = + /** Plan from a candidate returned by catalog search. */ "candidate"; /** * Discriminator for a caller-supplied-card install-plan source * @@ -2060,19 +2123,19 @@ export type McpServerCardEmbeddedKind = /** Use the embedded card document. */ " */ /** @experimental */ export type McpPlanInstallResult = - | McpPlanInstallPlanned - | CatalogNegotiationRefusedError - | CatalogHandleRejectedError - | CatalogInvalidRequestError - | CatalogAuthenticationRequiredError - | CatalogPolicyRejectedError - | CatalogNetworkFailureError - | CatalogUnsafeRetrievalError - | CatalogMalformedCardError - | CatalogContractViolationError - | CatalogUnavailableTransportError - | CatalogNotInstallableError - | CatalogUnavailableError; + | McpPlanInstallPlanned + | CatalogNegotiationRefusedError + | CatalogHandleRejectedError + | CatalogInvalidRequestError + | CatalogAuthenticationRequiredError + | CatalogPolicyRejectedError + | CatalogNetworkFailureError + | CatalogUnsafeRetrievalError + | CatalogMalformedCardError + | CatalogContractViolationError + | CatalogUnavailableTransportError + | CatalogNotInstallableError + | CatalogUnavailableError; /** * MCP server configuration (stdio, remote HTTP/SSE, or in-process) * @@ -2089,12 +2152,12 @@ export type McpServerConfig = (McpServerConfigStdio | McpServerConfigHttp) | und */ /** @experimental */ export type McpSamplingExecutionAction = - /** The sampling inference completed and produced a result. */ - | "success" - /** The sampling inference failed or was rejected. */ - | "failure" - /** The sampling inference was cancelled before completion. */ - | "cancelled"; + /** The sampling inference completed and produced a result. */ + | "success" + /** The sampling inference failed or was rejected. */ + | "failure" + /** The sampling inference was cancelled before completion. */ + | "cancelled"; /** * In-process MCP transport type. * @@ -2112,10 +2175,10 @@ export type McpServerConfigMemoryType = "memory"; */ /** @experimental */ export type McpSetEnvValueModeDetails = - /** Treat MCP server environment values as literal strings. */ - | "direct" - /** Treat MCP server environment values as host-side references to resolve before launch. */ - | "indirect"; + /** Treat MCP server environment values as literal strings. */ + | "direct" + /** Treat MCP server environment values as host-side references to resolve before launch. */ + | "indirect"; /** * Per-source context-window attribution, or null if the session has not yet been initialized (no system prompt or tool metadata cached). * @@ -2124,107 +2187,107 @@ export type McpSetEnvValueModeDetails = */ /** @experimental */ export type SessionContextAttribution = { - /** - * Total token count of the current context window the entries are measured against (system message + conversation messages + tool definitions — the same total reported by /context). Divide an entry's `tokens` by this to derive its share. - */ - totalTokens: number; - /** - * The concrete model id the entire breakdown was tokenized against (feeds the per-model token multiplier). Under `Auto` (Free/Student) this is the resolved model, not the literal `auto` sentinel, so totals are not undercounted. A single-model approximation of a potentially multi-model Auto session. - */ - modelId: string; - /** - * How `modelId` was chosen. Not a closed set — tolerate unknown values. Known values today: `autoResolved` (the model Auto resolved to), `selected` (the user's explicitly selected model), `default` (a fallback before any model is known). - */ - modelSource: string; - /** - * Maximum prompt tokens the resolved model accepts — the denominator for a `##k/###k` context-usage display. Mirrors `SessionContextInfo.promptTokenLimit`. - */ - promptTokenLimit: number; - /** - * Prompt limit plus the model's output reserve: the full context window `categories.freeSpace` and `categories.buffer` are measured against. Mirrors `SessionContextInfo.limit`. - */ - limit: number; - /** - * Output reserve plus the tokens past the buffer-exhaustion blocking threshold. Mirrors `SessionContextInfo.bufferTokens`. - */ - bufferTokens: number; - /** - * Token count at which background compaction starts. Mirrors `SessionContextInfo.compactionThreshold`. - */ - compactionThreshold: number; - /** - * The six normalized `/context` header buckets, computed from the same tokenization as `entries` so the two never disagree. Convenience rollups: `freeSpace` and `buffer` describe window capacity rather than occupied context, so the values do not sum to `totalTokens`. - */ - categories: { - /** - * System prompt tokens, excluding custom instructions. - */ - systemPrompt: number; - /** - * Custom-instructions tokens (0 when none are configured). - */ - customInstructions: number; - /** - * Non-MCP tool-definition tokens. - */ - systemTools: number; - /** - * MCP tool-definition tokens. - */ - mcpTools: number; - /** - * Conversation (user/assistant/tool) message tokens. - */ - messages: number; - /** - * Remaining unused window capacity (clamped at 0). - */ - freeSpace: number; - /** - * Output reserve plus post-blocking-threshold buffer. - */ - buffer: number; - }; - /** - * Flat list of per-source attribution entries. Group by `kind` and render unrecognized kinds generically. Nesting and rollups are expressed via `parentId`. - */ - entries: { - /** - * Source category for this entry. Not a closed set — tolerate unknown values. Known values today: `skill`, `subagent`, `mcpServer`, `tool`, `system`, `toolDefinition`, `plugin`. + /** + * Total token count of the current context window the entries are measured against (system message + conversation messages + tool definitions — the same total reported by /context). Divide an entry's `tokens` by this to derive its share. */ - kind: string; + totalTokens: number; /** - * Identifier for this entry, formed by joining its `kind` and source name (e.g. `tool:bash`, `skill:tmux`, `toolDefinition:bash`); unique within the snapshot. Use it to match the same entry across snapshots, to correlate with other APIs (skill/agent/MCP registries), and as the `parentId` target for nesting. Distinct from the human-facing `label`. + * The concrete model id the entire breakdown was tokenized against (feeds the per-model token multiplier). Under `Auto` (Free/Student) this is the resolved model, not the literal `auto` sentinel, so totals are not undercounted. A single-model approximation of a potentially multi-model Auto session. */ - id: string; + modelId: string; /** - * Human-readable display label, e.g. `bash` or `skill: tmux`. Presentation-only; may be localized/reformatted without notice — do not key off it. + * How `modelId` was chosen. Not a closed set — tolerate unknown values. Known values today: `autoResolved` (the model Auto resolved to), `selected` (the user's explicitly selected model), `default` (a fallback before any model is known). */ - label: string; + modelSource: string; /** - * Token count currently in context attributable to this entry. + * Maximum prompt tokens the resolved model accepts — the denominator for a `##k/###k` context-usage display. Mirrors `SessionContextInfo.promptTokenLimit`. */ - tokens: number; + promptTokenLimit: number; + /** + * Prompt limit plus the model's output reserve: the full context window `categories.freeSpace` and `categories.buffer` are measured against. Mirrors `SessionContextInfo.limit`. + */ + limit: number; + /** + * Output reserve plus the tokens past the buffer-exhaustion blocking threshold. Mirrors `SessionContextInfo.bufferTokens`. + */ + bufferTokens: number; /** - * Optional `id` of the parent entry: e.g. a `plugin` entry parenting its `skill`/`mcpServer` entries, or the `system` entry parenting `toolDefinition` entries. Omitted for top-level entries. + * Token count at which background compaction starts. Mirrors `SessionContextInfo.compactionThreshold`. */ - parentId?: string; + compactionThreshold: number; /** - * Supplementary per-entry metadata (e.g. `messageCount`, `role`, `evictable`, `pluginSource`). Values are stringified; parse as needed and ignore unrecognized keys. + * The six normalized `/context` header buckets, computed from the same tokenization as `entries` so the two never disagree. Convenience rollups: `freeSpace` and `buffer` describe window capacity rather than occupied context, so the values do not sum to `totalTokens`. */ - attributes?: { - [k: string]: string | undefined; + categories: { + /** + * System prompt tokens, excluding custom instructions. + */ + systemPrompt: number; + /** + * Custom-instructions tokens (0 when none are configured). + */ + customInstructions: number; + /** + * Non-MCP tool-definition tokens. + */ + systemTools: number; + /** + * MCP tool-definition tokens. + */ + mcpTools: number; + /** + * Conversation (user/assistant/tool) message tokens. + */ + messages: number; + /** + * Remaining unused window capacity (clamped at 0). + */ + freeSpace: number; + /** + * Output reserve plus post-blocking-threshold buffer. + */ + buffer: number; }; - }[]; - /** - * Successful compaction history for the session. - */ - compactions: { /** - * Number of successful compactions in this session. + * Flat list of per-source attribution entries. Group by `kind` and render unrecognized kinds generically. Nesting and rollups are expressed via `parentId`. */ - count: number; - }; + entries: { + /** + * Source category for this entry. Not a closed set — tolerate unknown values. Known values today: `skill`, `subagent`, `mcpServer`, `tool`, `system`, `toolDefinition`, `plugin`. + */ + kind: string; + /** + * Identifier for this entry, formed by joining its `kind` and source name (e.g. `tool:bash`, `skill:tmux`, `toolDefinition:bash`); unique within the snapshot. Use it to match the same entry across snapshots, to correlate with other APIs (skill/agent/MCP registries), and as the `parentId` target for nesting. Distinct from the human-facing `label`. + */ + id: string; + /** + * Human-readable display label, e.g. `bash` or `skill: tmux`. Presentation-only; may be localized/reformatted without notice — do not key off it. + */ + label: string; + /** + * Token count currently in context attributable to this entry. + */ + tokens: number; + /** + * Optional `id` of the parent entry: e.g. a `plugin` entry parenting its `skill`/`mcpServer` entries, or the `system` entry parenting `toolDefinition` entries. Omitted for top-level entries. + */ + parentId?: string; + /** + * Supplementary per-entry metadata (e.g. `messageCount`, `role`, `evictable`, `pluginSource`). Values are stringified; parse as needed and ignore unrecognized keys. + */ + attributes?: { + [k: string]: string | undefined; + }; + }[]; + /** + * Successful compaction history for the session. + */ + compactions: { + /** + * Number of successful compactions in this session. + */ + count: number; + }; } | null; /** * Token breakdown for the current context window, or null if the session has not yet been initialized (no system prompt or tool metadata cached). @@ -2234,46 +2297,46 @@ export type SessionContextAttribution = { */ /** @experimental */ export type SessionContextInfo = { - /** - * The model used for token counting - */ - modelName: string; - /** - * Tokens consumed by the system prompt - */ - systemTokens: number; - /** - * Tokens consumed by user/assistant/tool messages - */ - conversationTokens: number; - /** - * Tokens consumed by tool definitions sent to the model (excludes deferred tools) - */ - toolDefinitionsTokens: number; - /** - * Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools) - */ - mcpToolsTokens: number; - /** - * Sum of system, conversation and tool-definition tokens - */ - totalTokens: number; - /** - * Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified) - */ - promptTokenLimit: number; - /** - * Token count at which background compaction starts (configurable percentage of promptTokenLimit) - */ - compactionThreshold: number; - /** - * Prompt token limit plus the model's full output token limit. - */ - limit: number; - /** - * Output reserve plus tokens after the buffer-exhaustion blocking threshold (default 95%) - */ - bufferTokens: number; + /** + * The model used for token counting + */ + modelName: string; + /** + * Tokens consumed by the system prompt + */ + systemTokens: number; + /** + * Tokens consumed by user/assistant/tool messages + */ + conversationTokens: number; + /** + * Tokens consumed by tool definitions sent to the model (excludes deferred tools) + */ + toolDefinitionsTokens: number; + /** + * Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools) + */ + mcpToolsTokens: number; + /** + * Sum of system, conversation and tool-definition tokens + */ + totalTokens: number; + /** + * Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified) + */ + promptTokenLimit: number; + /** + * Token count at which background compaction starts (configurable percentage of promptTokenLimit) + */ + compactionThreshold: number; + /** + * Prompt token limit plus the model's full output token limit. + */ + limit: number; + /** + * Output reserve plus tokens after the buffer-exhaustion blocking threshold (default 95%) + */ + bufferTokens: number; } | null; /** * Hosting platform type of the repository @@ -2283,10 +2346,10 @@ export type SessionContextInfo = { */ /** @experimental */ export type SessionWorkingDirectoryContextHostType = - /** The working directory repository is hosted on GitHub. */ - | "github" - /** The working directory repository is hosted on Azure DevOps. */ - | "ado"; + /** The working directory repository is hosted on GitHub. */ + | "github" + /** The working directory repository is hosted on Azure DevOps. */ + | "ado"; /** * The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot') * @@ -2295,12 +2358,12 @@ export type SessionWorkingDirectoryContextHostType = */ /** @experimental */ export type MetadataSnapshotCurrentMode = - /** The agent is responding interactively to the user. */ - | "interactive" - /** The agent is preparing a plan before making changes. */ - | "plan" - /** The agent is working autonomously toward task completion. */ - | "autopilot"; + /** The agent is responding interactively to the user. */ + | "interactive" + /** The agent is preparing a plan before making changes. */ + | "plan" + /** The agent is working autonomously toward task completion. */ + | "autopilot"; /** * Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote` invocation. * @@ -2309,10 +2372,10 @@ export type MetadataSnapshotCurrentMode = */ /** @experimental */ export type MetadataSnapshotRemoteMetadataTaskType = - /** Remote task originated from Copilot Coding Agent. */ - | "cca" - /** Remote task originated from a CLI remote-session invocation. */ - | "cli"; + /** Remote task originated from Copilot Coding Agent. */ + | "cca" + /** Remote task originated from a CLI remote-session invocation. */ + | "cli"; /** * Current policy state for this model * @@ -2321,12 +2384,12 @@ export type MetadataSnapshotRemoteMetadataTaskType = */ /** @experimental */ export type ModelPolicyState = - /** The model is enabled by policy. */ - | "enabled" - /** The model is disabled by policy. */ - | "disabled" - /** No explicit policy is configured for the model. */ - | "unconfigured"; + /** The model is enabled by policy. */ + | "enabled" + /** The model is disabled by policy. */ + | "disabled" + /** No explicit policy is configured for the model. */ + | "unconfigured"; /** * Model capability category for grouping in the model picker * @@ -2335,12 +2398,12 @@ export type ModelPolicyState = */ /** @experimental */ export type ModelPickerCategory = - /** Lightweight model category optimized for faster, lower-cost interactions. */ - | "lightweight" - /** Versatile model category suitable for a broad range of tasks. */ - | "versatile" - /** Powerful model category optimized for complex tasks. */ - | "powerful"; + /** Lightweight model category optimized for faster, lower-cost interactions. */ + | "lightweight" + /** Versatile model category suitable for a broad range of tasks. */ + | "versatile" + /** Powerful model category optimized for complex tasks. */ + | "powerful"; /** * Relative cost tier for token-based billing users * @@ -2349,14 +2412,14 @@ export type ModelPickerCategory = */ /** @experimental */ export type ModelPickerPriceCategory = - /** Lowest relative token cost tier. */ - | "low" - /** Medium relative token cost tier. */ - | "medium" - /** High relative token cost tier. */ - | "high" - /** Highest relative token cost tier. */ - | "very_high"; + /** Lowest relative token cost tier. */ + | "low" + /** Medium relative token cost tier. */ + | "medium" + /** High relative token cost tier. */ + | "high" + /** Highest relative token cost tier. */ + | "very_high"; /** * Optional listing options. * @@ -2365,15 +2428,27 @@ export type ModelPickerPriceCategory = */ /** @experimental */ export type ModelListRequest = - | { - [k: string]: unknown | undefined; - } - | { - /** - * If true, bypasses the per-session model list cache and re-fetches from CAPI. - */ - skipCache?: boolean; - }; + | { + [k: string]: unknown | undefined; + } + | { + /** + * If true, bypasses the per-session model list cache and re-fetches from CAPI. + */ + skipCache?: boolean; + }; +/** + * Whether the requested preference was already effective or was accepted for later transactional activation. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelSwitchAutoTierStatus". + */ +/** @experimental */ +export type ModelSwitchAutoTierStatus = + /** The requested preference is already effective. No activation is pending for it, although this request may have cancelled an earlier unclaimed preference reported in `supersededAutoTier`. */ + | "unchanged" + /** The request was accepted but has not committed. A later user turn using the `auto` model must mint and validate the replacement before it becomes effective. */ + | "pending"; /** * Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. * @@ -2382,12 +2457,12 @@ export type ModelListRequest = */ /** @experimental */ export type ProviderConfigType = - /** Generic OpenAI-compatible API. */ - | "openai" - /** Azure OpenAI Service endpoint. */ - | "azure" - /** Anthropic API endpoint. */ - | "anthropic"; + /** Generic OpenAI-compatible API. */ + | "openai" + /** Azure OpenAI Service endpoint. */ + | "azure" + /** Anthropic API endpoint. */ + | "anthropic"; /** * Wire API format (openai/azure only). Defaults to "completions". * @@ -2396,10 +2471,10 @@ export type ProviderConfigType = */ /** @experimental */ export type ProviderConfigWireApi = - /** OpenAI Chat Completions wire format. */ - | "completions" - /** OpenAI Responses API wire format. */ - | "responses"; + /** OpenAI Chat Completions wire format. */ + | "completions" + /** OpenAI Responses API wire format. */ + | "responses"; /** * Provider transport. Defaults to "http". * @@ -2408,10 +2483,10 @@ export type ProviderConfigWireApi = */ /** @experimental */ export type ProviderConfigTransport = - /** HTTP request/streaming transport. */ - | "http" - /** WebSocket transport. */ - | "websockets"; + /** HTTP request/streaming transport. */ + | "http" + /** WebSocket transport. */ + | "websockets"; /** * Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration. * @@ -2420,10 +2495,10 @@ export type ProviderConfigTransport = */ /** @experimental */ export type OptionsUpdateAdditionalContentExclusionPolicyScope = - /** The content exclusion policy applies to the current repository. */ - | "repo" - /** The content exclusion policy applies across all repositories. */ - | "all"; + /** The content exclusion policy applies to the current repository. */ + | "repo" + /** The content exclusion policy applies across all repositories. */ + | "all"; /** * 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. * @@ -2432,10 +2507,10 @@ export type OptionsUpdateAdditionalContentExclusionPolicyScope = */ /** @experimental */ export type OptionsUpdateContextTier = - /** Use the model's default context tier and its standard token limits / pricing. */ - | "default" - /** Use the model's long-context tier (when available) so larger inputs are accepted and tier-specific pricing applies. */ - | "long_context"; + /** Use the model's default context tier and its standard token limits / pricing. */ + | "default" + /** Use the model's long-context tier (when available) so larger inputs are accepted and tier-specific pricing applies. */ + | "long_context"; /** * How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). * @@ -2444,10 +2519,10 @@ export type OptionsUpdateContextTier = */ /** @experimental */ export type OptionsUpdateEnvValueMode = - /** Pass MCP server environment values as literal strings. */ - | "direct" - /** Resolve MCP server environment values from host-side references. */ - | "indirect"; + /** Pass MCP server environment values as literal strings. */ + | "direct" + /** Resolve MCP server environment values from host-side references. */ + | "indirect"; /** * Reasoning summary mode for supported model clients. * @@ -2456,12 +2531,12 @@ export type OptionsUpdateEnvValueMode = */ /** @experimental */ export type OptionsUpdateReasoningSummary = - /** Do not request reasoning summaries from the model. */ - | "none" - /** Request a concise summary of model reasoning. */ - | "concise" - /** Request a detailed summary of model reasoning. */ - | "detailed"; + /** Do not request reasoning summaries from the model. */ + | "none" + /** Request a concise summary of model reasoning. */ + | "concise" + /** Request a detailed summary of model reasoning. */ + | "detailed"; /** * Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set. * @@ -2470,10 +2545,10 @@ export type OptionsUpdateReasoningSummary = */ /** @experimental */ export type OptionsUpdateToolFilterPrecedence = - /** If availableTools is set, it is the only constraint that applies (excludedTools is ignored). Preserves CLI / pre-existing client behavior. Default. */ - | "available" - /** A tool is enabled if and only if it matches the allowlist (or the allowlist is unset) AND it does not match the denylist. Makes 'all except X' expressible by combining the two lists. */ - | "excluded"; + /** If availableTools is set, it is the only constraint that applies (excludedTools is ignored). Preserves CLI / pre-existing client behavior. Default. */ + | "available" + /** A tool is enabled if and only if it matches the allowlist (or the allowlist is unset) AND it does not match the denylist. Makes 'all except X' expressible by combining the two lists. */ + | "excluded"; /** * The client's response to the pending permission prompt * @@ -2482,21 +2557,21 @@ export type OptionsUpdateToolFilterPrecedence = */ /** @experimental */ export type PermissionDecision = - | PermissionDecisionApproveOnce - | PermissionDecisionApproveForSession - | PermissionDecisionApproveForLocation - | PermissionDecisionApprovePermanently - | PermissionDecisionReject - | PermissionDecisionUserNotAvailable - | PermissionDecisionApproved - | PermissionDecisionApprovedForSession - | PermissionDecisionApprovedForLocation - | PermissionDecisionCancelled - | PermissionDecisionDeniedByRules - | PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser - | PermissionDecisionDeniedInteractivelyByUser - | PermissionDecisionDeniedByContentExclusionPolicy - | PermissionDecisionDeniedByPermissionRequestHook; + | PermissionDecisionApproveOnce + | PermissionDecisionApproveForSession + | PermissionDecisionApproveForLocation + | PermissionDecisionApprovePermanently + | PermissionDecisionReject + | PermissionDecisionUserNotAvailable + | PermissionDecisionApproved + | PermissionDecisionApprovedForSession + | PermissionDecisionApprovedForLocation + | PermissionDecisionCancelled + | PermissionDecisionDeniedByRules + | PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser + | PermissionDecisionDeniedInteractivelyByUser + | PermissionDecisionDeniedByContentExclusionPolicy + | PermissionDecisionDeniedByPermissionRequestHook; /** * Session-scoped approval to remember (tool prompts only; omitted for path/url prompts) * @@ -2505,17 +2580,17 @@ export type PermissionDecision = */ /** @experimental */ export type PermissionDecisionApproveForSessionApproval = - | PermissionDecisionApproveForSessionApprovalCommands - | PermissionDecisionApproveForSessionApprovalRead - | PermissionDecisionApproveForSessionApprovalWrite - | PermissionDecisionApproveForSessionApprovalMcp - | PermissionDecisionApproveForSessionApprovalMcpSampling - | PermissionDecisionApproveForSessionApprovalMemory - | PermissionDecisionApproveForSessionApprovalCustomTool - | PermissionDecisionApproveForSessionApprovalExtensionManagement - | PermissionDecisionApproveForSessionApprovalFactory - | PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess - | PermissionDecisionApproveForSessionApprovalExtensionEnvAccess; + | PermissionDecisionApproveForSessionApprovalCommands + | PermissionDecisionApproveForSessionApprovalRead + | PermissionDecisionApproveForSessionApprovalWrite + | PermissionDecisionApproveForSessionApprovalMcp + | PermissionDecisionApproveForSessionApprovalMcpSampling + | PermissionDecisionApproveForSessionApprovalMemory + | PermissionDecisionApproveForSessionApprovalCustomTool + | PermissionDecisionApproveForSessionApprovalExtensionManagement + | PermissionDecisionApproveForSessionApprovalFactory + | PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess + | PermissionDecisionApproveForSessionApprovalExtensionEnvAccess; /** * Approval to persist for this location * @@ -2524,17 +2599,17 @@ export type PermissionDecisionApproveForSessionApproval = */ /** @experimental */ export type PermissionDecisionApproveForLocationApproval = - | PermissionDecisionApproveForLocationApprovalCommands - | PermissionDecisionApproveForLocationApprovalRead - | PermissionDecisionApproveForLocationApprovalWrite - | PermissionDecisionApproveForLocationApprovalMcp - | PermissionDecisionApproveForLocationApprovalMcpSampling - | PermissionDecisionApproveForLocationApprovalMemory - | PermissionDecisionApproveForLocationApprovalCustomTool - | PermissionDecisionApproveForLocationApprovalExtensionManagement - | PermissionDecisionApproveForLocationApprovalFactory - | PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess - | PermissionDecisionApproveForLocationApprovalExtensionEnvAccess; + | PermissionDecisionApproveForLocationApprovalCommands + | PermissionDecisionApproveForLocationApprovalRead + | PermissionDecisionApproveForLocationApprovalWrite + | PermissionDecisionApproveForLocationApprovalMcp + | PermissionDecisionApproveForLocationApprovalMcpSampling + | PermissionDecisionApproveForLocationApprovalMemory + | PermissionDecisionApproveForLocationApprovalCustomTool + | PermissionDecisionApproveForLocationApprovalExtensionManagement + | PermissionDecisionApproveForLocationApprovalFactory + | PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess + | PermissionDecisionApproveForLocationApprovalExtensionEnvAccess; /** * Disposition of a permission request as observed by the responding client. * @@ -2543,12 +2618,12 @@ export type PermissionDecisionApproveForLocationApproval = */ /** @experimental */ export type PermissionDecisionOutcome = - /** The request was approved automatically without a new human decision. */ - | "auto_approved" - /** The request was denied without an interactive user decision; source records why. */ - | "autopilot_denied" - /** The response came from an interactive user prompt. */ - | "prompted_user"; + /** The request was approved automatically without a new human decision. */ + | "auto_approved" + /** The request was denied without an interactive user decision; source records why. */ + | "autopilot_denied" + /** The response came from an interactive user prompt. */ + | "prompted_user"; /** * Controlled reason or actor responsible for a permission response. * @@ -2557,14 +2632,14 @@ export type PermissionDecisionOutcome = */ /** @experimental */ export type PermissionDecisionSource = - /** The response followed the assisted-approval judge recommendation. */ - | "assisted_approval" - /** A human supplied the response through an interactive prompt. */ - | "human_response" - /** The host applied a standing policy or override rather than a judge recommendation or human decision. */ - | "host_policy" - /** The host denied the request because no interactive user response was available. */ - | "unattended_fallback"; + /** The response followed the assisted-approval judge recommendation. */ + | "assisted_approval" + /** A human supplied the response through an interactive prompt. */ + | "human_response" + /** The host applied a standing policy or override rather than a judge recommendation or human decision. */ + | "host_policy" + /** The host denied the request because no interactive user response was available. */ + | "unattended_fallback"; /** * Client surface that submitted a permission response. * @@ -2573,16 +2648,16 @@ export type PermissionDecisionSource = */ /** @experimental */ export type PermissionDecisionSurface = - /** The interactive Copilot CLI terminal UI. */ - | "tui" - /** The non-interactive Copilot CLI prompt mode. */ - | "prompt_mode" - /** The Copilot App client. */ - | "copilot_app" - /** An Agent Client Protocol host. */ - | "acp" - /** A generic Copilot SDK client. */ - | "sdk"; + /** The interactive Copilot CLI terminal UI. */ + | "tui" + /** The non-interactive Copilot CLI prompt mode. */ + | "prompt_mode" + /** The Copilot App client. */ + | "copilot_app" + /** An Agent Client Protocol host. */ + | "acp" + /** A generic Copilot SDK client. */ + | "sdk"; /** * Response capability available to the client when it settled a permission request. * @@ -2591,12 +2666,12 @@ export type PermissionDecisionSurface = */ /** @experimental */ export type PermissionResponseCapability = - /** The client could ask a user for this decision. */ - | "interactive" - /** The client could return an automated response but could not ask a user. */ - | "headless" - /** The client had no response path available. */ - | "none"; + /** The client could ask a user for this decision. */ + | "interactive" + /** The client could return an automated response but could not ask a user. */ + | "headless" + /** The client had no response path available. */ + | "none"; /** * Tool approval to persist and apply * @@ -2605,17 +2680,17 @@ export type PermissionResponseCapability = */ /** @experimental */ export type PermissionsLocationsAddToolApprovalDetails = - | PermissionsLocationsAddToolApprovalDetailsCommands - | PermissionsLocationsAddToolApprovalDetailsRead - | PermissionsLocationsAddToolApprovalDetailsWrite - | PermissionsLocationsAddToolApprovalDetailsMcp - | PermissionsLocationsAddToolApprovalDetailsMcpSampling - | PermissionsLocationsAddToolApprovalDetailsMemory - | PermissionsLocationsAddToolApprovalDetailsCustomTool - | PermissionsLocationsAddToolApprovalDetailsExtensionManagement - | PermissionsLocationsAddToolApprovalDetailsFactory - | PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess - | PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess; + | PermissionsLocationsAddToolApprovalDetailsCommands + | PermissionsLocationsAddToolApprovalDetailsRead + | PermissionsLocationsAddToolApprovalDetailsWrite + | PermissionsLocationsAddToolApprovalDetailsMcp + | PermissionsLocationsAddToolApprovalDetailsMcpSampling + | PermissionsLocationsAddToolApprovalDetailsMemory + | PermissionsLocationsAddToolApprovalDetailsCustomTool + | PermissionsLocationsAddToolApprovalDetailsExtensionManagement + | PermissionsLocationsAddToolApprovalDetailsFactory + | PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess + | PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess; /** * Whether the location is a git repo or directory * @@ -2624,10 +2699,10 @@ export type PermissionsLocationsAddToolApprovalDetails = */ /** @experimental */ export type PermissionLocationType = - /** The permission location is persisted at the git repository root. */ - | "repo" - /** The permission location is persisted at the working directory. */ - | "dir"; + /** The permission location is persisted at the git repository root. */ + | "repo" + /** The permission location is persisted at the working directory. */ + | "dir"; /** * Optional source for permission-mode telemetry. Defaults to `rpc` when omitted for SDK callers. * @@ -2636,16 +2711,16 @@ export type PermissionLocationType = */ /** @experimental */ export type PermissionModeSource = - /** The mode was set from a CLI command-line flag. */ - | "cli_flag" - /** The mode was set by a slash command. */ - | "slash_command" - /** The mode was set by confirming autopilot behavior. */ - | "autopilot_confirmation" - /** The mode was set at startup by the `defaultPermissionMode` user setting. */ - | "user_setting" - /** The mode was set through an RPC caller. */ - | "rpc"; + /** The mode was set from a CLI command-line flag. */ + | "cli_flag" + /** The mode was set by a slash command. */ + | "slash_command" + /** The mode was set by confirming autopilot behavior. */ + | "autopilot_confirmation" + /** The mode was set at startup by the `defaultPermissionMode` user setting. */ + | "user_setting" + /** The mode was set through an RPC caller. */ + | "rpc"; /** * Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration. * @@ -2654,10 +2729,10 @@ export type PermissionModeSource = */ /** @experimental */ export type PermissionsConfigureAdditionalContentExclusionPolicyScope = - /** The content exclusion policy applies to the current repository. */ - | "repo" - /** The content exclusion policy applies across all repositories. */ - | "all"; + /** The content exclusion policy applies to the current repository. */ + | "repo" + /** The content exclusion policy applies across all repositories. */ + | "all"; /** * Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file. * @@ -2666,10 +2741,10 @@ export type PermissionsConfigureAdditionalContentExclusionPolicyScope = */ /** @experimental */ export type PermissionsModifyRulesScope = - /** Apply the rule change only to this session. */ - | "session" - /** Persist the rule change for this project location. */ - | "location"; + /** Apply the rule change only to this session. */ + | "session" + /** Persist the rule change for this project location. */ + | "location"; /** * Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. * @@ -2678,16 +2753,16 @@ export type PermissionsModifyRulesScope = */ /** @experimental */ export type PermissionsSetApproveAllSource = - /** Allow-all was enabled from a CLI command-line flag. */ - | "cli_flag" - /** Allow-all was enabled by a slash command. */ - | "slash_command" - /** Allow-all was enabled by confirming autopilot behavior. */ - | "autopilot_confirmation" - /** Allow-all was enabled at startup by the `defaultPermissionMode` user setting. */ - | "user_setting" - /** Allow-all was enabled through an RPC caller. */ - | "rpc"; + /** Allow-all was enabled from a CLI command-line flag. */ + | "cli_flag" + /** Allow-all was enabled by a slash command. */ + | "slash_command" + /** Allow-all was enabled by confirming autopilot behavior. */ + | "autopilot_confirmation" + /** Allow-all was enabled at startup by the `defaultPermissionMode` user setting. */ + | "user_setting" + /** Allow-all was enabled through an RPC caller. */ + | "rpc"; /** * Optional flags controlling which side effects the reload performs. * @@ -2696,31 +2771,31 @@ export type PermissionsSetApproveAllSource = */ /** @experimental */ export type PluginsReloadRequest = - | { - [k: string]: unknown | undefined; - } - | { - /** - * Reload MCP server connections after refreshing plugins. Defaults to true. - */ - reloadMcp?: boolean; - /** - * Re-run custom-agent discovery after refreshing plugins. Defaults to true. - */ - reloadCustomAgents?: boolean; - /** - * Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions). - */ - reloadHooks?: boolean; - /** - * Re-discover and relaunch subprocess extensions (including plugin-shipped extensions) after refreshing plugins. Defaults to true. Has no effect when the session has no active extension controller (e.g. extensions were not requested for the session). - */ - reloadExtensions?: boolean; - /** - * When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`. - */ - deferRepoHooks?: boolean; - }; + | { + [k: string]: unknown | undefined; + } + | { + /** + * Reload MCP server connections after refreshing plugins. Defaults to true. + */ + reloadMcp?: boolean; + /** + * Re-run custom-agent discovery after refreshing plugins. Defaults to true. + */ + reloadCustomAgents?: boolean; + /** + * Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions). + */ + reloadHooks?: boolean; + /** + * Re-discover and relaunch subprocess extensions (including plugin-shipped extensions) after refreshing plugins. Defaults to true. Has no effect when the session has no active extension controller (e.g. extensions were not requested for the session). + */ + reloadExtensions?: boolean; + /** + * When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`. + */ + deferRepoHooks?: boolean; + }; /** * Controls whether the runtime may defer loading an external tool definition. * @@ -2729,10 +2804,10 @@ export type PluginsReloadRequest = */ /** @experimental */ export type ProtocolExternalToolDefer = - /** The runtime may defer the tool according to its tool-loading policy. */ - | "auto" - /** The runtime must include the tool without deferring it. */ - | "never"; + /** The runtime may defer the tool according to its tool-loading policy. */ + | "auto" + /** The runtime must include the tool without deferring it. */ + | "never"; /** * Provider family. Matches the `type` field of a BYOK provider config. * @@ -2741,12 +2816,12 @@ export type ProtocolExternalToolDefer = */ /** @experimental */ export type ProviderEndpointType = - /** OpenAI-compatible endpoint (use the OpenAI client library). */ - | "openai" - /** Azure OpenAI endpoint (use the OpenAI client library with the Azure base URL). */ - | "azure" - /** Anthropic endpoint (use the Anthropic client library). */ - | "anthropic"; + /** OpenAI-compatible endpoint (use the OpenAI client library). */ + | "openai" + /** Azure OpenAI endpoint (use the OpenAI client library with the Azure base URL). */ + | "azure" + /** Anthropic endpoint (use the Anthropic client library). */ + | "anthropic"; /** * Wire API to be used, when required for the provider type. * @@ -2755,10 +2830,10 @@ export type ProviderEndpointType = */ /** @experimental */ export type ProviderEndpointWireApi = - /** Classic chat-completions request shape. */ - | "completions" - /** Newer responses request shape. */ - | "responses"; + /** Classic chat-completions request shape. */ + | "completions" + /** Newer responses request shape. */ + | "responses"; /** * Transport to be used for provider requests. * @@ -2767,10 +2842,10 @@ export type ProviderEndpointWireApi = */ /** @experimental */ export type ProviderEndpointTransport = - /** HTTP request/streaming transport. */ - | "http" - /** WebSocket transport. */ - | "websockets"; + /** HTTP request/streaming transport. */ + | "http" + /** WebSocket transport. */ + | "websockets"; /** * Optional model identifier to scope the endpoint snapshot to. * @@ -2779,15 +2854,15 @@ export type ProviderEndpointTransport = */ /** @experimental */ export type ProviderGetEndpointRequest = - | { - [k: string]: unknown | undefined; - } - | { - /** - * Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using. - */ - modelId?: string; - }; + | { + [k: string]: unknown | undefined; + } + | { + /** + * Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using. + */ + modelId?: string; + }; /** * Attachment union accepted by push input, covering files, directories, GitHub objects, blobs, snippets, and extension context. * @@ -2796,21 +2871,21 @@ export type ProviderGetEndpointRequest = */ /** @experimental */ export type PushAttachment = - | PushAttachmentFile - | PushAttachmentDirectory - | PushAttachmentSelection - | PushAttachmentGitHubReference - | PushAttachmentGitHubCommit - | PushAttachmentGitHubRelease - | PushAttachmentGitHubActionsJob - | PushAttachmentGitHubRepository - | PushAttachmentGitHubFileDiff - | PushAttachmentGitHubTreeComparison - | PushAttachmentGitHubUrl - | PushAttachmentGitHubFile - | PushAttachmentGitHubSnippet - | PushAttachmentBlob - | ExtensionContextPushInput; + | PushAttachmentFile + | PushAttachmentDirectory + | PushAttachmentSelection + | PushAttachmentGitHubReference + | PushAttachmentGitHubCommit + | PushAttachmentGitHubRelease + | PushAttachmentGitHubActionsJob + | PushAttachmentGitHubRepository + | PushAttachmentGitHubFileDiff + | PushAttachmentGitHubTreeComparison + | PushAttachmentGitHubUrl + | PushAttachmentGitHubFile + | PushAttachmentGitHubSnippet + | PushAttachmentBlob + | ExtensionContextPushInput; /** * Type of GitHub reference * @@ -2819,12 +2894,12 @@ export type PushAttachment = */ /** @experimental */ export type PushAttachmentGitHubReferenceType = - /** GitHub issue reference. */ - | "issue" - /** GitHub pull request reference. */ - | "pr" - /** GitHub discussion reference. */ - | "discussion"; + /** GitHub issue reference. */ + | "issue" + /** GitHub pull request reference. */ + | "pr" + /** GitHub discussion reference. */ + | "discussion"; /** * The UI mode the agent was in when this message was sent. Defaults to the session's current mode. * @@ -2833,14 +2908,14 @@ export type PushAttachmentGitHubReferenceType = */ /** @experimental */ export type SendAgentMode = - /** The agent is responding interactively to the user. */ - | "interactive" - /** The agent is preparing a plan before making changes. */ - | "plan" - /** The agent is working autonomously toward task completion. */ - | "autopilot" - /** The agent is in shell-focused UI mode. */ - | "shell"; + /** The agent is responding interactively to the user. */ + | "interactive" + /** The agent is preparing a plan before making changes. */ + | "plan" + /** The agent is working autonomously toward task completion. */ + | "autopilot" + /** The agent is in shell-focused UI mode. */ + | "shell"; /** * How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn. * @@ -2849,10 +2924,10 @@ export type SendAgentMode = */ /** @experimental */ export type SendMode = - /** Append the message to the normal session queue. */ - | "enqueue" - /** Interject the message during the in-progress turn. */ - | "immediate"; + /** Append the message to the normal session queue. */ + | "enqueue" + /** Interject the message during the in-progress turn. */ + | "immediate"; /** * Whether this item is a queued user message or a queued slash command / model change * @@ -2861,10 +2936,10 @@ export type SendMode = */ /** @experimental */ export type QueuePendingItemsKind = - /** A queued user message. */ - | "message" - /** A queued slash command or model-change command. */ - | "command"; + /** A queued user message. */ + | "message" + /** A queued slash command or model-change command. */ + | "command"; /** * State of the runtime-managed remote-control singleton. * @@ -2873,10 +2948,10 @@ export type QueuePendingItemsKind = */ /** @experimental */ export type RemoteControlStatus = - | RemoteControlStatusOff - | RemoteControlStatusConnecting - | RemoteControlStatusActive - | RemoteControlStatusError; + | RemoteControlStatusOff + | RemoteControlStatusConnecting + | RemoteControlStatusActive + | RemoteControlStatusError; /** * Per-session remote mode. "off" disables remote, "export" exports session events to GitHub without enabling remote steering, "on" enables both export and remote steering. * @@ -2885,12 +2960,12 @@ export type RemoteControlStatus = */ /** @experimental */ export type RemoteSessionMode = - /** Disable remote session export and steering. */ - | "off" - /** Export session events to GitHub without enabling remote steering. */ - | "export" - /** Enable both remote session export and remote steering. */ - | "on"; + /** Disable remote session export and steering. */ + | "off" + /** Export session events to GitHub without enabling remote steering. */ + | "export" + /** Enable both remote session export and remote steering. */ + | "on"; /** * What a remote host says one of its sessions is doing right now. Deliberately coarse: this is what a host can report for EVERY session in a catalogue listing, without a client subscribing to each one. AHP's `SessionSummary.status` is the source today; `input-needed` covers both a permission prompt and an `ask_user` question, since the summary does not say which. * @@ -2899,14 +2974,14 @@ export type RemoteSessionMode = */ /** @experimental */ export type RemoteSessionHostStatus = - /** No turn is running. */ - | "idle" - /** A turn is running. */ - | "working" - /** The session is blocked on the user: a permission prompt or an `ask_user` question. */ - | "input-needed" - /** The session ended its last turn in an error. */ - | "error"; + /** No turn is running. */ + | "idle" + /** A turn is running. */ + | "working" + /** The session is blocked on the user: a permission prompt or an `ask_user` question. */ + | "input-needed" + /** The session ended its last turn in an error. */ + | "error"; /** * Whether the remote task originated from CCA or CLI `--remote`. * @@ -2915,10 +2990,10 @@ export type RemoteSessionHostStatus = */ /** @experimental */ export type RemoteSessionMetadataTaskType = - /** GitHub Copilot coding agent task. */ - | "cca" - /** CLI remote task. */ - | "cli"; + /** GitHub Copilot coding agent task. */ + | "cca" + /** CLI remote task. */ + | "cli"; /** * Origin of the sandbox choice supplied by an internal client. * @@ -2928,20 +3003,20 @@ export type RemoteSessionMetadataTaskType = /** @experimental */ /** @internal */ export type SandboxConfigSource = - /** The client applied the default because no sandbox preference was configured. */ - | "never_configured" - /** The user's persisted settings enabled the sandbox. */ - | "user_enabled" - /** The user's persisted settings disabled the sandbox. */ - | "user_disabled" - /** A command-line flag selected the sandbox state for this session. */ - | "session_flag" - /** The user disabled the sandbox for the current session. */ - | "session_disabled" - /** The client disabled the sandbox because the host cannot enforce it. */ - | "unsupported_host" - /** A repository policy selected the sandbox state. */ - | "repository_policy"; + /** The client applied the default because no sandbox preference was configured. */ + | "never_configured" + /** The user's persisted settings enabled the sandbox. */ + | "user_enabled" + /** The user's persisted settings disabled the sandbox. */ + | "user_disabled" + /** A command-line flag selected the sandbox state for this session. */ + | "session_flag" + /** The user disabled the sandbox for the current session. */ + | "session_disabled" + /** The client disabled the sandbox because the host cannot enforce it. */ + | "unsupported_host" + /** A repository policy selected the sandbox state. */ + | "repository_policy"; /** * Current authentication information, or null when no authentication is active. * @@ -2958,28 +3033,28 @@ export type SessionAuthInfoResult = AuthIdentity | null; */ /** @experimental */ export type SessionCapability = - /** TUI-specific prompt hints such as keyboard shortcuts. */ - | "tui-hints" - /** Plan-mode handling and instructions. */ - | "plan-mode" - /** Memory tool and memories prompt section. */ - | "memory" - /** Copilot CLI documentation tool and prompt section. */ - | "cli-documentation" - /** Interactive ask_user tool support. */ - | "ask-user" - /** Interactive CLI identity and behavior. */ - | "interactive-mode" - /** Automatic hidden system notifications. */ - | "system-notifications" - /** SDK elicitation support. */ - | "elicitation" - /** Cross-session history tools and session-store SQL prompt/tool metadata. */ - | "session-store" - /** MCP Apps UI passthrough. */ - | "mcp-apps" - /** Host-provided canvas rendering support. */ - | "canvas-renderer"; + /** TUI-specific prompt hints such as keyboard shortcuts. */ + | "tui-hints" + /** Plan-mode handling and instructions. */ + | "plan-mode" + /** Memory tool and memories prompt section. */ + | "memory" + /** Copilot CLI documentation tool and prompt section. */ + | "cli-documentation" + /** Interactive ask_user tool support. */ + | "ask-user" + /** Interactive CLI identity and behavior. */ + | "interactive-mode" + /** Automatic hidden system notifications. */ + | "system-notifications" + /** SDK elicitation support. */ + | "elicitation" + /** Cross-session history tools and session-store SQL prompt/tool metadata. */ + | "session-store" + /** MCP Apps UI passthrough. */ + | "mcp-apps" + /** Host-provided canvas rendering support. */ + | "canvas-renderer"; /** * Error classification * @@ -2988,10 +3063,10 @@ export type SessionCapability = */ /** @experimental */ export type SessionFsErrorCode = - /** The requested path does not exist. */ - | "ENOENT" - /** The filesystem operation failed for an unspecified reason. */ - | "UNKNOWN"; + /** The requested path does not exist. */ + | "ENOENT" + /** The filesystem operation failed for an unspecified reason. */ + | "UNKNOWN"; /** * Entry type * @@ -3000,10 +3075,10 @@ export type SessionFsErrorCode = */ /** @experimental */ export type SessionFsReaddirWithTypesEntryType = - /** The entry is a file. */ - | "file" - /** The entry is a directory. */ - | "directory"; + /** The entry is a file. */ + | "file" + /** The entry is a directory. */ + | "directory"; /** * Path conventions used by this filesystem * @@ -3012,10 +3087,10 @@ export type SessionFsReaddirWithTypesEntryType = */ /** @experimental */ export type SessionFsSetProviderConventions = - /** Paths use Windows path conventions. */ - | "windows" - /** Paths use POSIX path conventions. */ - | "posix"; + /** Paths use Windows path conventions. */ + | "windows" + /** Paths use POSIX path conventions. */ + | "posix"; /** * How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected) * @@ -3024,12 +3099,12 @@ export type SessionFsSetProviderConventions = */ /** @experimental */ export type SessionFsSqliteQueryType = - /** Execute DDL or multi-statement SQL without returning rows. */ - | "exec" - /** Execute a SELECT-style query and return rows. */ - | "query" - /** Execute INSERT, UPDATE, or DELETE SQL and return affected-row metadata. */ - | "run"; + /** Execute DDL or multi-statement SQL without returning rows. */ + | "exec" + /** Execute a SELECT-style query and return rows. */ + | "query" + /** Execute INSERT, UPDATE, or DELETE SQL and return affected-row metadata. */ + | "run"; /** * SQLite transaction failure classification. * @@ -3038,12 +3113,12 @@ export type SessionFsSqliteQueryType = */ /** @experimental */ export type SessionFsSqliteTransactionErrorClass = - /** SQLite reported BUSY or LOCKED before commit; the transaction was rolled back and may be retried. */ - | "busyOrLocked" - /** The statement, database, or provider failed definitively and must not be retried automatically. */ - | "fatal" - /** The transport failed after the provider may have committed; retrying could duplicate effects. */ - | "postCommitAmbiguous"; + /** SQLite reported BUSY or LOCKED before commit; the transaction was rolled back and may be retried. */ + | "busyOrLocked" + /** The statement, database, or provider failed definitively and must not be retried automatically. */ + | "fatal" + /** The transport failed after the provider may have committed; retrying could duplicate effects. */ + | "postCommitAmbiguous"; /** * Source descriptor for direct repo installs (when marketplace is empty) * @@ -3052,10 +3127,10 @@ export type SessionFsSqliteTransactionErrorClass = */ /** @experimental */ export type SessionInstalledPluginSource = - | string - | SessionInstalledPluginSourceGitHub - | SessionInstalledPluginSourceUrl - | SessionInstalledPluginSourceLocal; + | string + | SessionInstalledPluginSourceGitHub + | SessionInstalledPluginSourceUrl + | SessionInstalledPluginSourceLocal; /** * Client population used for the prediction baseline. * @@ -3064,10 +3139,10 @@ export type SessionInstalledPluginSource = */ /** @experimental */ export type SessionLimitPredictionClientType = - /** Interactive CLI sessions where a user can accept, edit, or top up the limit. */ - | "cli-interactive" - /** Prompt/non-interactive CLI sessions where the initial limit must cover more of the run. */ - | "cli-prompt"; + /** Interactive CLI sessions where a user can accept, edit, or top up the limit. */ + | "cli-interactive" + /** Prompt/non-interactive CLI sessions where the initial limit must cover more of the run. */ + | "cli-prompt"; /** * Baseline fallback level used to create the prediction. * @@ -3076,12 +3151,12 @@ export type SessionLimitPredictionClientType = */ /** @experimental */ export type SessionLimitPredictionSource = - /** The prediction used the exact resolved model's baseline cell. */ - | "model" - /** The exact model was unavailable, so the prediction used the model family's baseline cell. */ - | "family" - /** No model or family cell was available, so the prediction used the global client-type baseline cell. */ - | "global"; + /** The prediction used the exact resolved model's baseline cell. */ + | "model" + /** The exact model was unavailable, so the prediction used the model family's baseline cell. */ + | "family" + /** No model or family cell was available, so the prediction used the global client-type baseline cell. */ + | "global"; /** * Semantic usage tier used for a recommended cap or additional headroom. * @@ -3090,14 +3165,14 @@ export type SessionLimitPredictionSource = */ /** @experimental */ export type SessionLimitPredictionTier = - /** Recommended starting tier. */ - | "recommended" - /** Additional headroom for longer-running sessions. */ - | "additional_headroom" - /** Generous headroom for unusually high usage. */ - | "generous_headroom" - /** Maximum available headroom tier. */ - | "maximum_headroom"; + /** Recommended starting tier. */ + | "recommended" + /** Additional headroom for longer-running sessions. */ + | "additional_headroom" + /** Generous headroom for unusually high usage. */ + | "generous_headroom" + /** Maximum available headroom tier. */ + | "maximum_headroom"; /** * Parameters for predicting an AI-credit session limit. Omitting `modelId` uses the session's currently selected model. * @@ -3106,16 +3181,16 @@ export type SessionLimitPredictionTier = */ /** @experimental */ export type SessionLimitPredictionRequest = - | { - [k: string]: unknown | undefined; - } - | { - /** - * Optional model identifier override. If omitted, the session's current model is used. - */ - modelId?: string; - clientType?: SessionLimitPredictionClientType; - }; + | { + [k: string]: unknown | undefined; + } + | { + /** + * Optional model identifier override. If omitted, the session's current model is used. + */ + modelId?: string; + clientType?: SessionLimitPredictionClientType; + }; /** * Prediction result. Available results include prediction details; unavailable results include an explicit reason. * @@ -3124,20 +3199,20 @@ export type SessionLimitPredictionRequest = */ /** @experimental */ export type SessionLimitPredictionResult = - | { - prediction: SessionLimitPredictionDetails; - /** - * Prediction result variant discriminator. - */ - kind: "available"; - } - | { - reason: SessionLimitPredictionUnavailableReason; - /** - * Prediction result variant discriminator. - */ - kind: "unavailable"; - }; + | { + prediction: SessionLimitPredictionDetails; + /** + * Prediction result variant discriminator. + */ + kind: "available"; + } + | { + reason: SessionLimitPredictionUnavailableReason; + /** + * Prediction result variant discriminator. + */ + kind: "unavailable"; + }; /** * Reason a prediction could not be computed. * @@ -3146,10 +3221,10 @@ export type SessionLimitPredictionResult = */ /** @experimental */ export type SessionLimitPredictionUnavailableReason = - /** The current model is auto and has not resolved to a concrete model yet. */ - | "auto_unresolved" - /** No model was provided and the session does not currently have a selected model. */ - | "no_model"; + /** The current model is auto and has not resolved to a concrete model yet. */ + | "auto_unresolved" + /** No model was provided and the session does not currently have a selected model. */ + | "no_model"; /** * Local or remote session metadata entry. Narrow on `isRemote` to access source-specific fields. * @@ -3166,43 +3241,43 @@ export type SessionListEntry = LocalSessionMetadataValue | RemoteSessionMetadata */ /** @experimental */ export type WorkspaceSummary = { - /** - * Workspace identifier (1:1 with sessionId) - */ - id: string; - /** - * Current working directory at session start - */ - cwd?: string; - /** - * Resolved git root for cwd, if any - */ - git_root?: string; - /** - * Repository identifier in 'owner/repo' or 'org/project/repo' format, if any - */ - repository?: string; - host_type?: WorkspaceSummaryHostType; - /** - * Branch checked out at session start, if any - */ - branch?: string; - /** - * Display name for the session, if set - */ - name?: string; - /** - * Whether the display name was explicitly set by the user - */ - user_named?: boolean; - /** - * ISO 8601 timestamp when the workspace was created - */ - created_at?: string; - /** - * ISO 8601 timestamp when the workspace was last updated - */ - updated_at?: string; + /** + * Workspace identifier (1:1 with sessionId) + */ + id: string; + /** + * Current working directory at session start + */ + cwd?: string; + /** + * Resolved git root for cwd, if any + */ + git_root?: string; + /** + * Repository identifier in 'owner/repo' or 'org/project/repo' format, if any + */ + repository?: string; + host_type?: WorkspaceSummaryHostType; + /** + * Branch checked out at session start, if any + */ + branch?: string; + /** + * Display name for the session, if set + */ + name?: string; + /** + * Whether the display name was explicitly set by the user + */ + user_named?: boolean; + /** + * ISO 8601 timestamp when the workspace was created + */ + created_at?: string; + /** + * ISO 8601 timestamp when the workspace was last updated + */ + updated_at?: string; } | null; /** * Repository host type, if known @@ -3212,10 +3287,10 @@ export type WorkspaceSummary = { */ /** @experimental */ export type WorkspaceSummaryHostType = - /** Workspace summary repository is hosted on GitHub. */ - | "github" - /** Workspace summary repository is hosted on Azure DevOps. */ - | "ado"; + /** Workspace summary repository is hosted on GitHub. */ + | "github" + /** Workspace summary repository is hosted on Azure DevOps. */ + | "ado"; /** * Initial reasoning summary mode for supported model clients. * @@ -3224,12 +3299,12 @@ export type WorkspaceSummaryHostType = */ /** @experimental */ export type SessionOpenOptionsReasoningSummary = - /** Do not request reasoning summaries from the model. */ - | "none" - /** Request a concise summary of model reasoning. */ - | "concise" - /** Request a detailed summary of model reasoning. */ - | "detailed"; + /** Do not request reasoning summaries from the model. */ + | "none" + /** Request a concise summary of model reasoning. */ + | "concise" + /** Request a detailed summary of model reasoning. */ + | "detailed"; /** * Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected. * @@ -3238,10 +3313,10 @@ export type SessionOpenOptionsReasoningSummary = */ /** @experimental */ export type ShellInitProfile = - /** Disable automatic non-interactive profile loading. Explicit initScripts still run. */ - | "none" - /** Allow automatic non-interactive profile loading when supported. Explicit initScripts still run. */ - | "non-interactive"; + /** Disable automatic non-interactive profile loading. Explicit initScripts still run. */ + | "none" + /** Allow automatic non-interactive profile loading when supported. Explicit initScripts still run. */ + | "non-interactive"; /** * Supported built-in shells for initialization scripts. * @@ -3250,10 +3325,10 @@ export type ShellInitProfile = */ /** @experimental */ export type ShellInitScriptShell = - /** Source the script in the built-in Bash shell on macOS and Linux. */ - | "bash" - /** Source the script in the built-in PowerShell shell on Windows. */ - | "powershell"; + /** Source the script in the built-in Bash shell on macOS and Linux. */ + | "bash" + /** Source the script in the built-in PowerShell shell on Windows. */ + | "powershell"; /** * How MCP server environment values are interpreted. * @@ -3262,10 +3337,10 @@ export type ShellInitScriptShell = */ /** @experimental */ export type SessionOpenOptionsEnvValueMode = - /** Pass MCP server environment values as literal strings. */ - | "direct" - /** Resolve MCP server environment values from host-side references. */ - | "indirect"; + /** Pass MCP server environment values as literal strings. */ + | "direct" + /** Resolve MCP server environment values from host-side references. */ + | "indirect"; /** * Allowed values for the `SessionOpenOptionsAdditionalContentExclusionPolicyScope` enumeration. * @@ -3274,10 +3349,10 @@ export type SessionOpenOptionsEnvValueMode = */ /** @experimental */ export type SessionOpenOptionsAdditionalContentExclusionPolicyScope = - /** The content exclusion policy applies to the current repository. */ - | "repo" - /** The content exclusion policy applies across all repositories. */ - | "all"; + /** The content exclusion policy applies to the current repository. */ + | "repo" + /** The content exclusion policy applies across all repositories. */ + | "all"; /** * Open a session by creating, resuming, attaching, connecting to a remote, or handing off. * @@ -3286,13 +3361,13 @@ export type SessionOpenOptionsAdditionalContentExclusionPolicyScope = */ /** @experimental */ export type SessionOpenParams = - | SessionsOpenCreate - | SessionsOpenResume - | SessionsOpenResumeLast - | SessionsOpenAttach - | SessionsOpenRemote - | SessionsOpenCloud - | SessionsOpenHandoff; + | SessionsOpenCreate + | SessionsOpenResume + | SessionsOpenResumeLast + | SessionsOpenAttach + | SessionsOpenRemote + | SessionsOpenCloud + | SessionsOpenHandoff; /** * Task type determines the handoff strategy (CCA fetches events; CLI prepares a transient session). * @@ -3301,10 +3376,10 @@ export type SessionOpenParams = */ /** @experimental */ export type SessionsOpenHandoffTaskType = - /** GitHub Copilot coding agent task. */ - | "cca" - /** CLI remote task. */ - | "cli"; + /** GitHub Copilot coding agent task. */ + | "cca" + /** CLI remote task. */ + | "cli"; /** * Outcome of the open request. * @@ -3313,16 +3388,16 @@ export type SessionsOpenHandoffTaskType = */ /** @experimental */ export type SessionsOpenStatus = - /** A new session was created. */ - | "created" - /** An existing session was loaded or reattached. */ - | "resumed" - /** No matching persisted session was found. */ - | "not_found" - /** Connected to an existing remote session. */ - | "connected" - /** Remote session was handed off to a new local session. */ - | "handed_off"; + /** A new session was created. */ + | "created" + /** An existing session was loaded or reattached. */ + | "resumed" + /** No matching persisted session was found. */ + | "not_found" + /** Connected to an existing remote session. */ + | "connected" + /** Remote session was handed off to a new local session. */ + | "handed_off"; /** * Handoff step. * @@ -3331,18 +3406,18 @@ export type SessionsOpenStatus = */ /** @experimental */ export type SessionsOpenProgressStep = - /** Loading the source session's events from the remote service. */ - | "load-session" - /** Validating that the local repository matches the remote session's repository. */ - | "validate-repo" - /** Checking the local working tree for uncommitted changes that would block the handoff. */ - | "check-changes" - /** Checking out the branch associated with the remote session in the local working tree. */ - | "checkout-branch" - /** Creating the new local session and seeding it with the source session's events. */ - | "create-session" - /** Persisting the newly-created local session to disk. */ - | "save-session"; + /** Loading the source session's events from the remote service. */ + | "load-session" + /** Validating that the local repository matches the remote session's repository. */ + | "validate-repo" + /** Checking the local working tree for uncommitted changes that would block the handoff. */ + | "check-changes" + /** Checking out the branch associated with the remote session in the local working tree. */ + | "checkout-branch" + /** Creating the new local session and seeding it with the source session's events. */ + | "create-session" + /** Persisting the newly-created local session to disk. */ + | "save-session"; /** * Step status. * @@ -3351,10 +3426,10 @@ export type SessionsOpenProgressStep = */ /** @experimental */ export type SessionsOpenProgressStatus = - /** The step has started and has not yet finished. */ - | "in-progress" - /** The step has completed successfully. */ - | "complete"; + /** The step has started and has not yet finished. */ + | "in-progress" + /** The step has completed successfully. */ + | "complete"; /** * Authentication credentials accepted by session.gitHubAuth.setCredentials. Session-owned token-provider identities cannot be installed through this method. * @@ -3363,13 +3438,13 @@ export type SessionsOpenProgressStatus = */ /** @experimental */ export type SettableAuthInfo = - | HMACAuthInfo - | EnvAuthInfo - | SettableTokenAuthInfo - | CopilotApiTokenAuthInfo - | UserAuthInfo - | GhCliAuthInfo - | ApiKeyAuthInfo; + | HMACAuthInfo + | EnvAuthInfo + | SettableTokenAuthInfo + | CopilotApiTokenAuthInfo + | UserAuthInfo + | GhCliAuthInfo + | ApiKeyAuthInfo; /** * Rust-owned settings predicates exposed across the SDK boundary. Raw feature-flag names are intentionally not part of the contract. * @@ -3378,44 +3453,44 @@ export type SettableAuthInfo = */ /** @experimental */ export type SessionSettingsPredicateName = - /** Whether the security-tools feature flag enables security tool wiring. */ - | "securityToolsEnabled" - /** Whether third-party security tools should receive the security prompt. */ - | "thirdPartySecurityPromptEnabled" - /** Whether validation may run in parallel. */ - | "parallelValidationEnabled" - /** Whether runtime timing telemetry is enabled. */ - | "runtimeTimingTelemetryEnabled" - /** Whether the co-author hook is enabled. */ - | "coAuthorHookEnabled" - /** Whether Chronicle integration is enabled. */ - | "chronicleEnabled" - /** Whether content-exclusion policy may self-fetch data. */ - | "contentExclusionSelfFetchEnabled" - /** Whether Claude Opus token-limit caps should be applied. */ - | "capClaudeOpusTokenLimitsEnabled" - /** Whether code-review behavior is enabled. */ - | "codeReviewFeatureEnabled" - /** Whether CCA should use the TypeScript autofind behavior. */ - | "ccaUseTsAutofindEnabled" - /** Whether the dependency checker is enabled. */ - | "dependencyCheckerEnabled" - /** Whether the Dependabot checker is enabled. */ - | "dependabotCheckerEnabled" - /** Whether the CodeQL checker is enabled. */ - | "codeqlCheckerEnabled" - /** Whether trivial-change handling is enabled. */ - | "trivialChangeEnabled" - /** Whether trivial-change skip behavior is enabled. */ - | "trivialChangeSkipEnabled" - /** Whether trivial-change handling is enabled for code review. */ - | "trivialChangeEnabledForCodeReview" - /** Whether trivial-change skip behavior is enabled for code review. */ - | "trivialChangeSkipEnabledForCodeReview" - /** Whether trivial-change handling is enabled for a specific tool. */ - | "trivialChangeEnabledForTool" - /** Whether trivial-change skip behavior is enabled for a specific tool. */ - | "trivialChangeSkipEnabledForTool"; + /** Whether the security-tools feature flag enables security tool wiring. */ + | "securityToolsEnabled" + /** Whether third-party security tools should receive the security prompt. */ + | "thirdPartySecurityPromptEnabled" + /** Whether validation may run in parallel. */ + | "parallelValidationEnabled" + /** Whether runtime timing telemetry is enabled. */ + | "runtimeTimingTelemetryEnabled" + /** Whether the co-author hook is enabled. */ + | "coAuthorHookEnabled" + /** Whether Chronicle integration is enabled. */ + | "chronicleEnabled" + /** Whether content-exclusion policy may self-fetch data. */ + | "contentExclusionSelfFetchEnabled" + /** Whether Claude Opus token-limit caps should be applied. */ + | "capClaudeOpusTokenLimitsEnabled" + /** Whether code-review behavior is enabled. */ + | "codeReviewFeatureEnabled" + /** Whether CCA should use the TypeScript autofind behavior. */ + | "ccaUseTsAutofindEnabled" + /** Whether the dependency checker is enabled. */ + | "dependencyCheckerEnabled" + /** Whether the Dependabot checker is enabled. */ + | "dependabotCheckerEnabled" + /** Whether the CodeQL checker is enabled. */ + | "codeqlCheckerEnabled" + /** Whether trivial-change handling is enabled. */ + | "trivialChangeEnabled" + /** Whether trivial-change skip behavior is enabled. */ + | "trivialChangeSkipEnabled" + /** Whether trivial-change handling is enabled for code review. */ + | "trivialChangeEnabledForCodeReview" + /** Whether trivial-change skip behavior is enabled for code review. */ + | "trivialChangeSkipEnabledForCodeReview" + /** Whether trivial-change handling is enabled for a specific tool. */ + | "trivialChangeEnabledForTool" + /** Whether trivial-change skip behavior is enabled for a specific tool. */ + | "trivialChangeSkipEnabledForTool"; /** * Which session sources to include. Defaults to `local` for backward compatibility. * @@ -3424,12 +3499,12 @@ export type SessionSettingsPredicateName = */ /** @experimental */ export type SessionSource = - /** Return only local sessions. */ - | "local" - /** Return only remote sessions. */ - | "remote" - /** Return both local and remote sessions. */ - | "all"; + /** Return only local sessions. */ + | "local" + /** Return only remote sessions. */ + | "remote" + /** Return both local and remote sessions. */ + | "all"; /** * Sharing status for a synced session. "repo" makes the session visible to anyone with read access to the repository; "unshared" restricts it to the creator and collaborators. * @@ -3438,10 +3513,10 @@ export type SessionSource = */ /** @experimental */ export type SessionVisibilityStatus = - /** The session is visible to repository readers. */ - | "repo" - /** The session is restricted to its creator and collaborators. */ - | "unshared"; + /** The session is visible to repository readers. */ + | "repo" + /** The session is restricted to its creator and collaborators. */ + | "unshared"; /** * Signal to send (default: SIGTERM) * @@ -3450,12 +3525,12 @@ export type SessionVisibilityStatus = */ /** @experimental */ export type ShellKillSignal = - /** Request graceful process termination. */ - | "SIGTERM" - /** Forcefully terminate the process. */ - | "SIGKILL" - /** Send an interrupt signal to the process. */ - | "SIGINT"; + /** Request graceful process termination. */ + | "SIGTERM" + /** Forcefully terminate the process. */ + | "SIGKILL" + /** Send an interrupt signal to the process. */ + | "SIGINT"; /** * Which tier this directory belongs to * @@ -3464,14 +3539,14 @@ export type ShellKillSignal = */ /** @experimental */ export type SkillDiscoveryScope = - /** A project's repository skill directory. */ - | "project" - /** The user's personal Copilot skill directory. */ - | "personal-copilot" - /** The user's personal agents skill directory. */ - | "personal-agents" - /** A configured custom skill directory. */ - | "custom"; + /** A project's repository skill directory. */ + | "project" + /** The user's personal Copilot skill directory. */ + | "personal-copilot" + /** The user's personal agents skill directory. */ + | "personal-agents" + /** A configured custom skill directory. */ + | "custom"; /** * Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection). * @@ -3480,14 +3555,14 @@ export type SkillDiscoveryScope = */ /** @experimental */ export type SlashCommandInvocationResult = - | SlashCommandTextResult - | SlashCommandAgentPromptResult - | SlashCommandCompletedResult - | SlashCommandSelectSubcommandResult - | SlashCommandAddTimelineEntryResult - | SlashCommandShowDialogResult - | SlashCommandSetModelResult - | SlashCommandSetPlanModelResult; + | SlashCommandTextResult + | SlashCommandAgentPromptResult + | SlashCommandCompletedResult + | SlashCommandSelectSubcommandResult + | SlashCommandAddTimelineEntryResult + | SlashCommandShowDialogResult + | SlashCommandSetModelResult + | SlashCommandSetPlanModelResult; /** * Subagent settings to apply, or null to clear the live session override * @@ -3496,24 +3571,24 @@ export type SlashCommandInvocationResult = */ /** @experimental */ export type SubagentSettings = { - /** - * Per-agent settings keyed by subagent agent_type - */ - agents?: { - [k: string]: SubagentSettingsEntry | undefined; - }; - /** - * Names of subagents the user has turned off; they cannot be dispatched - */ - disabledSubagents?: string[]; - /** - * Maximum number of subagents that can run concurrently; applies to usage-based billing users only - */ - maxConcurrency?: number; - /** - * Maximum subagent nesting depth; applies to usage-based billing users only - */ - maxDepth?: number; + /** + * Per-agent settings keyed by subagent agent_type + */ + agents?: { + [k: string]: SubagentSettingsEntry | undefined; + }; + /** + * Names of subagents the user has turned off; they cannot be dispatched + */ + disabledSubagents?: string[]; + /** + * Maximum number of subagents that can run concurrently; applies to usage-based billing users only + */ + maxConcurrency?: number; + /** + * Maximum subagent nesting depth; applies to usage-based billing users only + */ + maxDepth?: number; } | null; /** * Context tier override for matching subagents @@ -3523,12 +3598,12 @@ export type SubagentSettings = { */ /** @experimental */ export type SubagentSettingsEntryContextTier = - /** Inherit the parent session's effective context tier at dispatch time. */ - | "inherit" - /** Use the model's default context window. */ - | "default" - /** Pin the subagent to the long-context tier when supported. */ - | "long_context"; + /** Inherit the parent session's effective context tier at dispatch time. */ + | "inherit" + /** Use the model's default context window. */ + | "default" + /** Pin the subagent to the long-context tier when supported. */ + | "long_context"; /** * Current lifecycle status of the task * @@ -3537,16 +3612,16 @@ export type SubagentSettingsEntryContextTier = */ /** @experimental */ export type TaskStatus = - /** The task is actively executing. */ - | "running" - /** The task is waiting for additional input. */ - | "idle" - /** The task finished successfully. */ - | "completed" - /** The task finished with an error. */ - | "failed" - /** The task was cancelled before completion. */ - | "cancelled"; + /** The task is actively executing. */ + | "running" + /** The task is waiting for additional input. */ + | "idle" + /** The task finished successfully. */ + | "completed" + /** The task finished with an error. */ + | "failed" + /** The task was cancelled before completion. */ + | "cancelled"; /** * Whether task execution is synchronously awaited or managed in the background * @@ -3555,18 +3630,163 @@ export type TaskStatus = */ /** @experimental */ export type TaskExecutionMode = - /** The task was started with synchronous waiting. */ - | "sync" - /** The task is managed in the background. */ - | "background"; + /** The task was started with synchronous waiting. */ + | "sync" + /** The task is managed in the background. */ + | "background"; +/** + * Active status a client owner may publish with a progress update. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientActiveStatus". + */ +/** @experimental */ +export type TaskClientActiveStatus = + /** The external owner is actively working. */ + | "running" + /** The external owner is connected but waiting. */ + | "idle"; +/** + * Client-owned tasks always execute outside the runtime in background mode. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientExecutionMode". + */ +/** @experimental */ +export type TaskClientExecutionMode = "background"; +/** + * Discriminator for a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientType". + */ +/** @experimental */ +export type TaskClientType = "client"; +/** + * Lifecycle status of a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientStatus". + */ +/** @experimental */ +export type TaskClientStatus = + /** The external owner is actively working. */ + | "running" + /** The external owner is connected but waiting. */ + | "idle" + /** The owner reported successful completion. */ + | "completed" + /** The owner reported failure. */ + | "failed" + /** The owner reported or confirmed cancellation. */ + | "cancelled" + /** The bound owner join disappeared; external executor state is unknown. */ + | "orphaned"; +/** + * Connection class owning a client task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientOwnerKind". + */ +/** @experimental */ +export type TaskClientOwnerKind = + /** A discovered extension connection owns the task. */ + | "extension" + /** A generic SDK connection owns the task. */ + | "sdk"; +/** + * Presence of the task's bound join. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientOwnerPresence". + */ +/** @experimental */ +export type TaskClientOwnerPresence = + /** The bound session join is connected. */ + | "connected" + /** The bound session join is disconnected. */ + | "disconnected"; +/** + * Progress or terminal update for a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientUpdate". + */ +/** @experimental */ +export type TaskClientUpdate = + | { + status?: TaskClientActiveStatus; + /** + * Optional progress message appended to recent activity when nonempty + */ + message?: string; + /** + * Optional progress phase; null clears the current phase + */ + phase?: string | null; + /** + * Optional completion percentage; null clears the current percentage + */ + percentage?: number | null; + /** + * Client task update variant discriminator. + */ + kind: "progress"; + } + | { + /** + * Optional final progress message + */ + message?: string; + /** + * Optional opaque successful terminal result + */ + result?: JsonValue; + /** + * Client task update variant discriminator. + */ + kind: "completed"; + } + | { + /** + * Optional final progress message + */ + message?: string; + /** + * Human-readable terminal failure message + */ + error: string; + /** + * Optional owner-supplied terminal failure code + */ + code?: string; + /** + * Client task update variant discriminator. + */ + kind: "failed"; + } + | { + /** + * Optional final progress message + */ + message?: string; + /** + * Optional human-readable cancellation reason + */ + reason?: string; + /** + * Client task update variant discriminator. + */ + kind: "cancelled"; + }; /** - * Tracked task union returned by task APIs, containing either an agent task or a shell task. + * Tracked task union returned by task APIs, containing an agent, client, or shell task. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "TaskInfo". */ /** @experimental */ -export type TaskInfo = TaskAgentInfo | TaskShellInfo; +export type TaskInfo = TaskAgentInfo | TaskClientInfo | TaskShellInfo; /** * Whether the shell runs inside a managed PTY session or as an independent background process * @@ -3575,10 +3795,10 @@ export type TaskInfo = TaskAgentInfo | TaskShellInfo; */ /** @experimental */ export type TaskShellInfoAttachmentMode = - /** The shell runs in a managed PTY session. */ - | "attached" - /** The shell runs as an independent background process. */ - | "detached"; + /** The shell runs in a managed PTY session. */ + | "attached" + /** The shell runs as an independent background process. */ + | "detached"; /** * Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. * @@ -3586,7 +3806,7 @@ export type TaskShellInfoAttachmentMode = * via the `definition` "TaskProgress". */ /** @experimental */ -export type TaskProgress = (TaskAgentProgress | TaskShellProgress) | null; +export type TaskProgress = TaskAgentProgress | TaskClientProgress | TaskShellProgress | null; /** * Canonical result returned by a session tool. * @@ -3603,16 +3823,16 @@ export type ToolResult = string | ToolResultExpanded; */ /** @experimental */ export type ToolResultType = - /** The tool completed successfully. */ - | "success" - /** The tool failed. */ - | "failure" - /** The tool exceeded its execution timeout. */ - | "timeout" - /** The tool request was rejected before execution. */ - | "rejected" - /** Permission policy denied the tool request. */ - | "denied"; + /** The tool completed successfully. */ + | "success" + /** The tool failed. */ + | "failure" + /** The tool exceeded its execution timeout. */ + | "timeout" + /** The tool request was rejected before execution. */ + | "rejected" + /** Permission policy denied the tool request. */ + | "denied"; /** * User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline). * @@ -3621,12 +3841,12 @@ export type ToolResultType = */ /** @experimental */ export type UIAutoModeSwitchResponse = - /** Allow the automatic mode switch for this turn. */ - | "yes" - /** Allow this mode switch and persist the preference. */ - | "yes_always" - /** Decline the automatic mode switch. */ - | "no"; + /** Allow the automatic mode switch for this turn. */ + | "yes" + /** Allow this mode switch and persist the preference. */ + | "yes_always" + /** Decline the automatic mode switch. */ + | "no"; /** * Submitted UI elicitation field value: string, number, boolean, or an array of strings. * @@ -3643,16 +3863,16 @@ export type UIElicitationFieldValue = string | number | boolean | string[]; */ /** @experimental */ export type UIElicitationSchemaProperty = - | ( - | UIElicitationStringEnumField - | UIElicitationStringOneOfField - | UIElicitationArrayEnumField - | UIElicitationArrayAnyOfField - | UIElicitationSchemaPropertyBoolean - | UIElicitationSchemaPropertyString - | UIElicitationSchemaPropertyNumber - ) - | undefined; + | ( + | UIElicitationStringEnumField + | UIElicitationStringOneOfField + | UIElicitationArrayEnumField + | UIElicitationArrayAnyOfField + | UIElicitationSchemaPropertyBoolean + | UIElicitationSchemaPropertyString + | UIElicitationSchemaPropertyNumber + ) + | undefined; /** * Optional format hint that constrains the accepted input. * @@ -3661,14 +3881,14 @@ export type UIElicitationSchemaProperty = */ /** @experimental */ export type UIElicitationSchemaPropertyStringFormat = - /** Email address string format. */ - | "email" - /** URI string format. */ - | "uri" - /** Calendar date string format. */ - | "date" - /** Date-time string format. */ - | "date-time"; + /** Email address string format. */ + | "email" + /** URI string format. */ + | "uri" + /** Calendar date string format. */ + | "date" + /** Date-time string format. */ + | "date-time"; /** * Numeric type accepted by the field. * @@ -3677,10 +3897,10 @@ export type UIElicitationSchemaPropertyStringFormat = */ /** @experimental */ export type UIElicitationSchemaPropertyNumberType = - /** Any JSON number. */ - | "number" - /** Integer JSON number. */ - | "integer"; + /** Any JSON number. */ + | "number" + /** Integer JSON number. */ + | "integer"; /** * The user's response: accept (submitted), decline (rejected), or cancel (dismissed) * @@ -3689,12 +3909,12 @@ export type UIElicitationSchemaPropertyNumberType = */ /** @experimental */ export type UIElicitationResponseAction = - /** The user submitted the requested form values. */ - | "accept" - /** The user explicitly declined to provide the requested input. */ - | "decline" - /** The user dismissed the elicitation request. */ - | "cancel"; + /** The user submitted the requested form values. */ + | "accept" + /** The user explicitly declined to provide the requested input. */ + | "decline" + /** The user dismissed the elicitation request. */ + | "cancel"; /** * The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'. * @@ -3703,14 +3923,14 @@ export type UIElicitationResponseAction = */ /** @experimental */ export type UIExitPlanModeAction = - /** Exit plan mode without starting implementation. */ - | "exit_only" - /** Exit plan mode and continue interactively. */ - | "interactive" - /** Exit plan mode and continue in autopilot mode. */ - | "autopilot" - /** Exit plan mode and continue in autopilot mode with parallel subagent execution. */ - | "autopilot_fleet"; + /** Exit plan mode without starting implementation. */ + | "exit_only" + /** Exit plan mode and continue interactively. */ + | "interactive" + /** Exit plan mode and continue in autopilot mode. */ + | "autopilot" + /** Exit plan mode and continue in autopilot mode with parallel subagent execution. */ + | "autopilot_fleet"; /** * User action selected for an exhausted session limit. * @@ -3719,14 +3939,14 @@ export type UIExitPlanModeAction = */ /** @experimental */ export type UISessionLimitsExhaustedResponseAction = - /** Increase the current max by an exact AI Credits amount. */ - | "add" - /** Set a new absolute max AI Credits value. */ - | "set" - /** Remove the current session limit. */ - | "unset" - /** Leave the limit unchanged and cancel the blocked model request. */ - | "cancel"; + /** Increase the current max by an exact AI Credits amount. */ + | "add" + /** Set a new absolute max AI Credits value. */ + | "set" + /** Remove the current session limit. */ + | "unset" + /** Leave the limit unchanged and cancel the blocked model request. */ + | "cancel"; /** * Type of change represented by this file diff. * @@ -3735,14 +3955,14 @@ export type UISessionLimitsExhaustedResponseAction = */ /** @experimental */ export type WorkspaceDiffFileChangeType = - /** The file was added. */ - | "added" - /** The file was modified. */ - | "modified" - /** The file was deleted. */ - | "deleted" - /** The file was renamed. */ - | "renamed"; + /** The file was added. */ + | "added" + /** The file was modified. */ + | "modified" + /** The file was deleted. */ + | "deleted" + /** The file was renamed. */ + | "renamed"; /** * Diff mode requested by the client. * @@ -3751,12 +3971,12 @@ export type WorkspaceDiffFileChangeType = */ /** @experimental */ export type WorkspaceDiffMode = - /** Return staged, unstaged, and untracked working tree changes. */ - | "unstaged" - /** Return changes compared with the default branch. */ - | "branch" - /** Return the cumulative diff of files Copilot changed this session (used in non-git workspaces). */ - | "session"; + /** Return staged, unstaged, and untracked working tree changes. */ + | "unstaged" + /** Return changes compared with the default branch. */ + | "branch" + /** Return the cumulative diff of files Copilot changed this session (used in non-git workspaces). */ + | "session"; /** * Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. * @@ -3765,10 +3985,10 @@ export type WorkspaceDiffMode = */ /** @experimental */ export type WorkspacesWorkspaceDetailsHostType = - /** Workspace repository is hosted on GitHub. */ - | "github" - /** Workspace repository is hosted on Azure DevOps. */ - | "ado"; + /** Workspace repository is hosted on GitHub. */ + | "github" + /** Workspace repository is hosted on Azure DevOps. */ + | "ado"; /** * List of all authenticated users * @@ -3818,7 +4038,7 @@ export type SessionGitHubAuthLogoutUserResult = boolean; */ /** @experimental */ export interface AbortRequest { - reason?: AbortReason; + reason?: AbortReason; } /** * Result of aborting the current turn @@ -3828,14 +4048,14 @@ export interface AbortRequest { */ /** @experimental */ export interface AbortResult { - /** - * Whether the abort completed successfully - */ - success: boolean; - /** - * Error message if the abort failed - */ - error?: string; + /** + * Whether the abort completed successfully + */ + success: boolean; + /** + * Error message if the abort failed + */ + error?: string; } /** * Authenticated account entry returned by `account.getAllUsers`. @@ -3845,15 +4065,15 @@ export interface AbortResult { */ /** @experimental */ export interface AccountAllUsers { - authInfo: AuthInfo; - /** - * Opaque identifier accepted by account and model selection APIs - */ - selectionId?: string; - /** - * Associated token, if available - */ - token?: string; + authInfo: AuthInfo; + /** + * Opaque identifier accepted by account and model selection APIs + */ + selectionId?: string; + /** + * Associated token, if available + */ + token?: string; } /** * Authentication-info input variant for GitHub-internal HMAC auth, carrying the public GitHub host and HMAC secret. @@ -3863,19 +4083,19 @@ export interface AccountAllUsers { */ /** @experimental */ export interface HMACAuthInfo { - /** - * HMAC-based authentication used by GitHub-internal services. - */ - type: "hmac"; - /** - * Authentication host. HMAC auth always targets the public GitHub host. - */ - host: "https://github.com"; - /** - * HMAC secret used to sign requests. - */ - hmac: string; - copilotUser?: CopilotUserResponse; + /** + * HMAC-based authentication used by GitHub-internal services. + */ + type: "hmac"; + /** + * Authentication host. HMAC auth always targets the public GitHub host. + */ + host: "https://github.com"; + /** + * HMAC secret used to sign requests. + */ + hmac: string; + copilotUser?: CopilotUserResponse; } /** * Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. @@ -3885,152 +4105,152 @@ export interface HMACAuthInfo { */ /** @experimental */ export interface CopilotUserResponse { - /** - * GitHub login of the authenticated user. - */ - login?: string; - /** - * Copilot access SKU identifier (e.g. `free_limited_copilot`, `copilot_for_business_seat_quota`) used to gate model and feature access. - */ - access_type_sku?: string; - /** - * Opaque analytics tracking identifier for the user, forwarded from the Copilot API. - */ - analytics_tracking_id?: string; - /** - * Date the Copilot seat was assigned to the user, if applicable. - */ - assigned_date?: - | ( - | { - [k: string]: unknown | undefined; - } - | string - ) - | null; - /** - * Whether the user is eligible to sign up for the free/limited Copilot tier. - */ - can_signup_for_limited?: boolean; - /** - * Whether Copilot chat is enabled for the user. - */ - chat_enabled?: boolean; - /** - * Copilot plan name for the user (e.g. `individual`, `business`, `enterprise`). - */ - copilot_plan?: string; - /** - * Whether `.copilotignore` content-exclusion support is enabled for the user. - */ - copilotignore_enabled?: boolean; - endpoints?: CopilotUserResponseEndpoints; - /** - * Logins of the organizations the user belongs to. - */ - organization_login_list?: string[]; - /** - * Organizations the user belongs to, each with an optional login and display name. - */ - organization_list?: - | ( - | { - [k: string]: unknown | undefined; - } - | ({ - /** - * GitHub login of the organization. - */ - login?: - | ( - | { - [k: string]: unknown | undefined; - } - | string - ) - | null; - /** - * Display name of the organization. - */ - name?: - | ( - | { - [k: string]: unknown | undefined; - } - | string - ) - | null; - } | null)[] - ) - | null; - /** - * Whether the Codex agent is enabled for the user. - */ - codex_agent_enabled?: boolean; - /** - * Whether MCP (Model Context Protocol) support is enabled for the user. - */ - is_mcp_enabled?: - | ( - | { - [k: string]: unknown | undefined; - } - | boolean - ) - | null; - /** - * Date the user's usage quota next resets, as a raw string from the Copilot API; see `quota_reset_date_utc` for the UTC-normalized value. - */ - quota_reset_date?: string; - quota_snapshots?: CopilotUserResponseQuotaSnapshots; - /** - * Whether the user's telemetry is subject to restricted-data handling. - */ - restricted_telemetry?: boolean; - /** - * Whether the user is a GitHub/Microsoft staff member. - */ - is_staff?: boolean; - /** - * Raw passthrough of the Copilot API `te` flag for the user (an opaque server-side eligibility signal surfaced in telemetry); not otherwise interpreted by the runtime. - */ - te?: boolean; - /** - * Whether the account is on usage-based (token/AI-credit) billing rather than a fixed premium-request quota. - */ - token_based_billing?: boolean; - /** - * Whether the user is able to upgrade their Copilot plan. - */ - can_upgrade_plan?: boolean; - /** - * UTC-normalized form of `quota_reset_date` (the date the user's usage quota next resets). - */ - quota_reset_date_utc?: string; - /** - * Per-category quota allotments for free/limited-tier users, keyed by quota category. - */ - limited_user_quotas?: { - [k: string]: number | undefined; - }; - /** - * Date the free/limited-tier user's quotas next reset, as a raw string from the Copilot API. - */ - limited_user_reset_date?: string; - /** - * Per-category monthly quota allotments, keyed by quota category. - */ - monthly_quotas?: { - [k: string]: number | undefined; - }; - /** - * Whether cloud session storage is enabled for the user. - */ - cloud_session_storage_enabled?: boolean; - /** - * Whether CLI remote control is enabled for the user. - */ - cli_remote_control_enabled?: boolean; + /** + * GitHub login of the authenticated user. + */ + login?: string; + /** + * Copilot access SKU identifier (e.g. `free_limited_copilot`, `copilot_for_business_seat_quota`) used to gate model and feature access. + */ + access_type_sku?: string; + /** + * Opaque analytics tracking identifier for the user, forwarded from the Copilot API. + */ + analytics_tracking_id?: string; + /** + * Date the Copilot seat was assigned to the user, if applicable. + */ + assigned_date?: + | ( + | { + [k: string]: unknown | undefined; + } + | string + ) + | null; + /** + * Whether the user is eligible to sign up for the free/limited Copilot tier. + */ + can_signup_for_limited?: boolean; + /** + * Whether Copilot chat is enabled for the user. + */ + chat_enabled?: boolean; + /** + * Copilot plan name for the user (e.g. `individual`, `business`, `enterprise`). + */ + copilot_plan?: string; + /** + * Whether `.copilotignore` content-exclusion support is enabled for the user. + */ + copilotignore_enabled?: boolean; + endpoints?: CopilotUserResponseEndpoints; + /** + * Logins of the organizations the user belongs to. + */ + organization_login_list?: string[]; + /** + * Organizations the user belongs to, each with an optional login and display name. + */ + organization_list?: + | ( + | { + [k: string]: unknown | undefined; + } + | ({ + /** + * GitHub login of the organization. + */ + login?: + | ( + | { + [k: string]: unknown | undefined; + } + | string + ) + | null; + /** + * Display name of the organization. + */ + name?: + | ( + | { + [k: string]: unknown | undefined; + } + | string + ) + | null; + } | null)[] + ) + | null; + /** + * Whether the Codex agent is enabled for the user. + */ + codex_agent_enabled?: boolean; + /** + * Whether MCP (Model Context Protocol) support is enabled for the user. + */ + is_mcp_enabled?: + | ( + | { + [k: string]: unknown | undefined; + } + | boolean + ) + | null; + /** + * Date the user's usage quota next resets, as a raw string from the Copilot API; see `quota_reset_date_utc` for the UTC-normalized value. + */ + quota_reset_date?: string; + quota_snapshots?: CopilotUserResponseQuotaSnapshots; + /** + * Whether the user's telemetry is subject to restricted-data handling. + */ + restricted_telemetry?: boolean; + /** + * Whether the user is a GitHub/Microsoft staff member. + */ + is_staff?: boolean; + /** + * Raw passthrough of the Copilot API `te` flag for the user (an opaque server-side eligibility signal surfaced in telemetry); not otherwise interpreted by the runtime. + */ + te?: boolean; + /** + * Whether the account is on usage-based (token/AI-credit) billing rather than a fixed premium-request quota. + */ + token_based_billing?: boolean; + /** + * Whether the user is able to upgrade their Copilot plan. + */ + can_upgrade_plan?: boolean; + /** + * UTC-normalized form of `quota_reset_date` (the date the user's usage quota next resets). + */ + quota_reset_date_utc?: string; + /** + * Per-category quota allotments for free/limited-tier users, keyed by quota category. + */ + limited_user_quotas?: { + [k: string]: number | undefined; + }; + /** + * Date the free/limited-tier user's quotas next reset, as a raw string from the Copilot API. + */ + limited_user_reset_date?: string; + /** + * Per-category monthly quota allotments, keyed by quota category. + */ + monthly_quotas?: { + [k: string]: number | undefined; + }; + /** + * Whether cloud session storage is enabled for the user. + */ + cloud_session_storage_enabled?: boolean; + /** + * Whether CLI remote control is enabled for the user. + */ + cli_remote_control_enabled?: boolean; } /** * Endpoint URLs from the raw Copilot `/copilot_internal/v2/token` user-response passthrough. @@ -4040,26 +4260,26 @@ export interface CopilotUserResponse { */ /** @experimental */ export interface CopilotUserResponseEndpoints { - /** - * Copilot API endpoint URL. - */ - api?: string; - /** - * Origin-tracker endpoint URL. - */ - "origin-tracker"?: string; - /** - * Copilot proxy endpoint URL. - */ - proxy?: string; - /** - * Copilot telemetry endpoint URL. - */ - telemetry?: string; - /** - * Experimental-service endpoint URL. - */ - exp?: string; + /** + * Copilot API endpoint URL. + */ + api?: string; + /** + * Origin-tracker endpoint URL. + */ + "origin-tracker"?: string; + /** + * Copilot proxy endpoint URL. + */ + proxy?: string; + /** + * Copilot telemetry endpoint URL. + */ + telemetry?: string; + /** + * Experimental-service endpoint URL. + */ + exp?: string; } /** * Quota snapshot map from the raw Copilot user-response passthrough, with chat, completions, premium-interactions, and other entries. @@ -4069,25 +4289,25 @@ export interface CopilotUserResponseEndpoints { */ /** @experimental */ export interface CopilotUserResponseQuotaSnapshots { - chat?: CopilotUserResponseQuotaSnapshotsChat; - completions?: CopilotUserResponseQuotaSnapshotsCompletions; - premium_interactions?: CopilotUserResponseQuotaSnapshotsPremiumInteractions; - [k: string]: - | ({ - entitlement?: number; - overage_count?: number; - overage_permitted?: boolean; - percent_remaining?: number; - quota_id?: string; - quota_remaining?: number; - remaining?: number; - unlimited?: boolean; - timestamp_utc?: string; - has_quota?: boolean; - quota_reset_at?: number; - token_based_billing?: boolean; - } | null) - | undefined; + chat?: CopilotUserResponseQuotaSnapshotsChat; + completions?: CopilotUserResponseQuotaSnapshotsCompletions; + premium_interactions?: CopilotUserResponseQuotaSnapshotsPremiumInteractions; + [k: string]: + | ({ + entitlement?: number; + overage_count?: number; + overage_permitted?: boolean; + percent_remaining?: number; + quota_id?: string; + quota_remaining?: number; + remaining?: number; + unlimited?: boolean; + timestamp_utc?: string; + has_quota?: boolean; + quota_reset_at?: number; + token_based_billing?: boolean; + } | null) + | undefined; } /** * Chat quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields. @@ -4097,111 +4317,111 @@ export interface CopilotUserResponseQuotaSnapshots { */ /** @experimental */ export interface CopilotUserResponseQuotaSnapshotsChat { - /** - * Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement. - */ - entitlement?: number; - /** - * Count of additional pay-per-request usage consumed this period beyond the entitlement. - */ - overage_count?: number; - /** - * Whether usage may continue at pay-per-request rates once the entitlement is exhausted. - */ - overage_permitted?: boolean; - /** - * Percentage of the entitlement remaining at the snapshot timestamp. - */ - percent_remaining?: number; - /** - * Identifier of the quota bucket this snapshot describes. - */ - quota_id?: string; - /** - * Amount of quota remaining at the snapshot timestamp. - */ - quota_remaining?: number; - /** - * Remaining entitlement/quota amount at the snapshot timestamp. - */ - remaining?: number; - /** - * Whether the entitlement for this category is unlimited. - */ - unlimited?: boolean; - /** - * UTC timestamp when this snapshot was captured. - */ - timestamp_utc?: string; - /** - * Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets. - */ - has_quota?: boolean; - /** - * Unix epoch time, in seconds, when this quota next resets. - */ - quota_reset_at?: number; - /** - * Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count. - */ - token_based_billing?: boolean; -} -/** - * Completions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields. - * + /** + * Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement. + */ + entitlement?: number; + /** + * Count of additional pay-per-request usage consumed this period beyond the entitlement. + */ + overage_count?: number; + /** + * Whether usage may continue at pay-per-request rates once the entitlement is exhausted. + */ + overage_permitted?: boolean; + /** + * Percentage of the entitlement remaining at the snapshot timestamp. + */ + percent_remaining?: number; + /** + * Identifier of the quota bucket this snapshot describes. + */ + quota_id?: string; + /** + * Amount of quota remaining at the snapshot timestamp. + */ + quota_remaining?: number; + /** + * Remaining entitlement/quota amount at the snapshot timestamp. + */ + remaining?: number; + /** + * Whether the entitlement for this category is unlimited. + */ + unlimited?: boolean; + /** + * UTC timestamp when this snapshot was captured. + */ + timestamp_utc?: string; + /** + * Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets. + */ + has_quota?: boolean; + /** + * Unix epoch time, in seconds, when this quota next resets. + */ + quota_reset_at?: number; + /** + * Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count. + */ + token_based_billing?: boolean; +} +/** + * Completions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields. + * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "CopilotUserResponseQuotaSnapshotsCompletions". */ /** @experimental */ export interface CopilotUserResponseQuotaSnapshotsCompletions { - /** - * Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement. - */ - entitlement?: number; - /** - * Count of additional pay-per-request usage consumed this period beyond the entitlement. - */ - overage_count?: number; - /** - * Whether usage may continue at pay-per-request rates once the entitlement is exhausted. - */ - overage_permitted?: boolean; - /** - * Percentage of the entitlement remaining at the snapshot timestamp. - */ - percent_remaining?: number; - /** - * Identifier of the quota bucket this snapshot describes. - */ - quota_id?: string; - /** - * Amount of quota remaining at the snapshot timestamp. - */ - quota_remaining?: number; - /** - * Remaining entitlement/quota amount at the snapshot timestamp. - */ - remaining?: number; - /** - * Whether the entitlement for this category is unlimited. - */ - unlimited?: boolean; - /** - * UTC timestamp when this snapshot was captured. - */ - timestamp_utc?: string; - /** - * Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets. - */ - has_quota?: boolean; - /** - * Unix epoch time, in seconds, when this quota next resets. - */ - quota_reset_at?: number; - /** - * Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count. - */ - token_based_billing?: boolean; + /** + * Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement. + */ + entitlement?: number; + /** + * Count of additional pay-per-request usage consumed this period beyond the entitlement. + */ + overage_count?: number; + /** + * Whether usage may continue at pay-per-request rates once the entitlement is exhausted. + */ + overage_permitted?: boolean; + /** + * Percentage of the entitlement remaining at the snapshot timestamp. + */ + percent_remaining?: number; + /** + * Identifier of the quota bucket this snapshot describes. + */ + quota_id?: string; + /** + * Amount of quota remaining at the snapshot timestamp. + */ + quota_remaining?: number; + /** + * Remaining entitlement/quota amount at the snapshot timestamp. + */ + remaining?: number; + /** + * Whether the entitlement for this category is unlimited. + */ + unlimited?: boolean; + /** + * UTC timestamp when this snapshot was captured. + */ + timestamp_utc?: string; + /** + * Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets. + */ + has_quota?: boolean; + /** + * Unix epoch time, in seconds, when this quota next resets. + */ + quota_reset_at?: number; + /** + * Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count. + */ + token_based_billing?: boolean; } /** * Premium-interactions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields. @@ -4211,54 +4431,54 @@ export interface CopilotUserResponseQuotaSnapshotsCompletions { */ /** @experimental */ export interface CopilotUserResponseQuotaSnapshotsPremiumInteractions { - /** - * Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement. - */ - entitlement?: number; - /** - * Count of additional pay-per-request usage consumed this period beyond the entitlement. - */ - overage_count?: number; - /** - * Whether usage may continue at pay-per-request rates once the entitlement is exhausted. - */ - overage_permitted?: boolean; - /** - * Percentage of the entitlement remaining at the snapshot timestamp. - */ - percent_remaining?: number; - /** - * Identifier of the quota bucket this snapshot describes. - */ - quota_id?: string; - /** - * Amount of quota remaining at the snapshot timestamp. - */ - quota_remaining?: number; - /** - * Remaining entitlement/quota amount at the snapshot timestamp. - */ - remaining?: number; - /** - * Whether the entitlement for this category is unlimited. - */ - unlimited?: boolean; - /** - * UTC timestamp when this snapshot was captured. - */ - timestamp_utc?: string; - /** - * Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets. - */ - has_quota?: boolean; - /** - * Unix epoch time, in seconds, when this quota next resets. - */ - quota_reset_at?: number; - /** - * Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count. - */ - token_based_billing?: boolean; + /** + * Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement. + */ + entitlement?: number; + /** + * Count of additional pay-per-request usage consumed this period beyond the entitlement. + */ + overage_count?: number; + /** + * Whether usage may continue at pay-per-request rates once the entitlement is exhausted. + */ + overage_permitted?: boolean; + /** + * Percentage of the entitlement remaining at the snapshot timestamp. + */ + percent_remaining?: number; + /** + * Identifier of the quota bucket this snapshot describes. + */ + quota_id?: string; + /** + * Amount of quota remaining at the snapshot timestamp. + */ + quota_remaining?: number; + /** + * Remaining entitlement/quota amount at the snapshot timestamp. + */ + remaining?: number; + /** + * Whether the entitlement for this category is unlimited. + */ + unlimited?: boolean; + /** + * UTC timestamp when this snapshot was captured. + */ + timestamp_utc?: string; + /** + * Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets. + */ + has_quota?: boolean; + /** + * Unix epoch time, in seconds, when this quota next resets. + */ + quota_reset_at?: number; + /** + * Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count. + */ + token_based_billing?: boolean; } /** * Authentication-info input variant for a token sourced from an environment variable, with host, optional login, token, and env var name. @@ -4268,27 +4488,27 @@ export interface CopilotUserResponseQuotaSnapshotsPremiumInteractions { */ /** @experimental */ export interface EnvAuthInfo { - /** - * Personal access token (PAT) or server-to-server token sourced from an environment variable. - */ - type: "env"; - /** - * Authentication host (e.g. https://github.com or a GHES host). - */ - host: string; - /** - * User login associated with the token. Undefined for server-to-server tokens (those starting with `ghs_`). - */ - login?: string; - /** - * The token value itself. Treat as a secret. - */ - token: string; - /** - * Name of the environment variable the token was sourced from. - */ - envVar: string; - copilotUser?: CopilotUserResponse; + /** + * Personal access token (PAT) or server-to-server token sourced from an environment variable. + */ + type: "env"; + /** + * Authentication host (e.g. https://github.com or a GHES host). + */ + host: string; + /** + * User login associated with the token. Undefined for server-to-server tokens (those starting with `ghs_`). + */ + login?: string; + /** + * The token value itself. Treat as a secret. + */ + token: string; + /** + * Name of the environment variable the token was sourced from. + */ + envVar: string; + copilotUser?: CopilotUserResponse; } /** * Authentication-info input variant for SDK-configured token authentication, carrying host and the secret token value. @@ -4298,23 +4518,23 @@ export interface EnvAuthInfo { */ /** @experimental */ export interface TokenAuthInfo { - /** - * SDK-side token authentication; the host configured the token directly via the SDK. - */ - type: "token"; - /** - * Authentication host. - */ - host: string; - /** - * The token value itself. Treat as a secret. - */ - token: string; - /** - * Opaque native GitHub credential registration backing this token identity, when applicable. - */ - registrationId?: string; - copilotUser?: CopilotUserResponse; + /** + * SDK-side token authentication; the host configured the token directly via the SDK. + */ + type: "token"; + /** + * Authentication host. + */ + host: string; + /** + * The token value itself. Treat as a secret. + */ + token: string; + /** + * Opaque native GitHub credential registration backing this token identity, when applicable. + */ + registrationId?: string; + copilotUser?: CopilotUserResponse; } /** * Authentication-info variant backed by an SDK GitHub token callback. It carries routing metadata but never a plaintext token. @@ -4324,19 +4544,19 @@ export interface TokenAuthInfo { */ /** @experimental */ export interface TokenProviderAuthInfo { - /** - * SDK callback-backed GitHub token authentication. - */ - type: "token-provider"; - /** - * Authentication host. - */ - host: string; - /** - * Opaque SDK callback registration identifier. - */ - registrationId: string; - copilotUser?: CopilotUserResponse; + /** + * SDK callback-backed GitHub token authentication. + */ + type: "token-provider"; + /** + * Authentication host. + */ + host: string; + /** + * Opaque SDK callback registration identifier. + */ + registrationId: string; + copilotUser?: CopilotUserResponse; } /** * Authentication-info variant for direct Copilot API token auth sourced from environment variables, with public GitHub host. @@ -4346,15 +4566,15 @@ export interface TokenProviderAuthInfo { */ /** @experimental */ export interface CopilotApiTokenAuthInfo { - /** - * Direct Copilot API authentication via the `GITHUB_COPILOT_API_TOKEN` + `COPILOT_API_URL` environment-variable pair. The token itself is read from the environment by the runtime, not carried in this struct. - */ - type: "copilot-api-token"; - /** - * Authentication host (always the public GitHub host). - */ - host: "https://github.com"; - copilotUser?: CopilotUserResponse; + /** + * Direct Copilot API authentication via the `GITHUB_COPILOT_API_TOKEN` + `COPILOT_API_URL` environment-variable pair. The token itself is read from the environment by the runtime, not carried in this struct. + */ + type: "copilot-api-token"; + /** + * Authentication host (always the public GitHub host). + */ + host: "https://github.com"; + copilotUser?: CopilotUserResponse; } /** * Authentication-info variant for OAuth user auth, with host and login; the token remains in the runtime secret store. @@ -4364,19 +4584,19 @@ export interface CopilotApiTokenAuthInfo { */ /** @experimental */ export interface UserAuthInfo { - /** - * OAuth user authentication. The token itself is held in the runtime's secret token store (keyed by host+login) and is NOT carried in this struct. - */ - type: "user"; - /** - * Authentication host. - */ - host: string; - /** - * OAuth user login. - */ - login: string; - copilotUser?: CopilotUserResponse; + /** + * OAuth user authentication. The token itself is held in the runtime's secret token store (keyed by host+login) and is NOT carried in this struct. + */ + type: "user"; + /** + * Authentication host. + */ + host: string; + /** + * OAuth user login. + */ + login: string; + copilotUser?: CopilotUserResponse; } /** * Authentication-info input variant for GitHub CLI credentials, carrying host, login, and the `gh auth token` value. @@ -4386,23 +4606,23 @@ export interface UserAuthInfo { */ /** @experimental */ export interface GhCliAuthInfo { - /** - * Authentication via the `gh` CLI's saved credentials. - */ - type: "gh-cli"; - /** - * Authentication host. - */ - host: string; - /** - * User login as reported by `gh auth status`. - */ - login: string; - /** - * The token returned by `gh auth token`. Treat as a secret. - */ - token: string; - copilotUser?: CopilotUserResponse; + /** + * Authentication via the `gh` CLI's saved credentials. + */ + type: "gh-cli"; + /** + * Authentication host. + */ + host: string; + /** + * User login as reported by `gh auth status`. + */ + login: string; + /** + * The token returned by `gh auth token`. Treat as a secret. + */ + token: string; + copilotUser?: CopilotUserResponse; } /** * Authentication-info input variant for API-key authentication to a non-GitHub LLM provider, carrying the secret `apiKey` and host. @@ -4412,19 +4632,19 @@ export interface GhCliAuthInfo { */ /** @experimental */ export interface ApiKeyAuthInfo { - /** - * API-key authentication for non-GitHub LLM providers (e.g. when running BYOM-style). - */ - type: "api-key"; - /** - * The API key. Treat as a secret. - */ - apiKey: string; - /** - * Authentication host. - */ - host: string; - copilotUser?: CopilotUserResponse; + /** + * API-key authentication for non-GitHub LLM providers (e.g. when running BYOM-style). + */ + type: "api-key"; + /** + * The API key. Treat as a secret. + */ + apiKey: string; + /** + * Authentication host. + */ + host: string; + copilotUser?: CopilotUserResponse; } /** * Current authentication state @@ -4434,23 +4654,23 @@ export interface ApiKeyAuthInfo { */ /** @experimental */ export interface AccountGetCurrentAuthResult { - authInfo?: AuthInfo; - /** - * Authentication errors from the last auth attempt, if any - */ - authErrors?: string[]; + authInfo?: AuthInfo; + /** + * Authentication errors from the last auth attempt, if any + */ + authErrors?: string[]; } /** @experimental */ export interface AccountGetQuotaRequest { - /** - * Opaque account identifier returned by `account.getAllUsers`. When omitted, the current account is used. - */ - selectionId?: string; - /** - * GitHub token accepted for compatibility with existing SDK clients. When provided, resolves this token instead of using the current account. - */ - gitHubToken?: string; + /** + * Opaque account identifier returned by `account.getAllUsers`. When omitted, the current account is used. + */ + selectionId?: string; + /** + * GitHub token accepted for compatibility with existing SDK clients. When provided, resolves this token instead of using the current account. + */ + gitHubToken?: string; } /** * Quota usage snapshots for the resolved user, keyed by quota type. @@ -4460,12 +4680,12 @@ export interface AccountGetQuotaRequest { */ /** @experimental */ export interface AccountGetQuotaResult { - /** - * Quota snapshots keyed by type (e.g., chat, completions, premium_interactions) - */ - quotaSnapshots: { - [k: string]: AccountQuotaSnapshot | undefined; - }; + /** + * Quota snapshots keyed by type (e.g., chat, completions, premium_interactions) + */ + quotaSnapshots: { + [k: string]: AccountQuotaSnapshot | undefined; + }; } /** * Quota usage snapshot for a Copilot quota type, including entitlement, used requests, overage, reset date, and remaining percentage. @@ -4475,38 +4695,38 @@ export interface AccountGetQuotaResult { */ /** @experimental */ export interface AccountQuotaSnapshot { - /** - * Whether the user has an unlimited usage entitlement - */ - isUnlimitedEntitlement: boolean; - /** - * Number of requests included in the entitlement, or -1 for unlimited entitlements - */ - entitlementRequests: number; - /** - * Number of requests used so far this period - */ - usedRequests: number; - /** - * Whether usage is still permitted after quota exhaustion - */ - usageAllowedWithExhaustedQuota: boolean; - /** - * Percentage of entitlement remaining - */ - remainingPercentage: number; - /** - * Number of additional usage requests made this period - */ - overage: number; - /** - * Whether additional usage is allowed when quota is exhausted - */ - overageAllowedWithExhaustedQuota: boolean; - /** - * Date when the quota resets (ISO 8601 string) - */ - resetDate?: string; + /** + * Whether the user has an unlimited usage entitlement + */ + isUnlimitedEntitlement: boolean; + /** + * Number of requests included in the entitlement, or -1 for unlimited entitlements + */ + entitlementRequests: number; + /** + * Number of requests used so far this period + */ + usedRequests: number; + /** + * Whether usage is still permitted after quota exhaustion + */ + usageAllowedWithExhaustedQuota: boolean; + /** + * Percentage of entitlement remaining + */ + remainingPercentage: number; + /** + * Number of additional usage requests made this period + */ + overage: number; + /** + * Whether additional usage is allowed when quota is exhausted + */ + overageAllowedWithExhaustedQuota: boolean; + /** + * Date when the quota resets (ISO 8601 string) + */ + resetDate?: string; } /** * Credentials to validate and store. Omit login to resolve the authenticated user from the token. @@ -4516,18 +4736,18 @@ export interface AccountQuotaSnapshot { */ /** @experimental */ export interface AccountLoginRequest { - /** - * GitHub host URL - */ - host: string; - /** - * User login/username. When omitted, the runtime validates the token and resolves the login from GitHub. - */ - login?: string; - /** - * GitHub authentication token - */ - token: string; + /** + * GitHub host URL + */ + host: string; + /** + * User login/username. When omitted, the runtime validates the token and resolves the login from GitHub. + */ + login?: string; + /** + * GitHub authentication token + */ + token: string; } /** * Result of a successful login; throws on failure @@ -4537,10 +4757,10 @@ export interface AccountLoginRequest { */ /** @experimental */ export interface AccountLoginResult { - /** - * 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. - */ - storedInVault: boolean; + /** + * 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. + */ + storedInVault: boolean; } /** * Logout result indicating if more users remain @@ -4550,10 +4770,10 @@ export interface AccountLoginResult { */ /** @experimental */ export interface AccountLogoutResult { - /** - * Whether other authenticated users remain after logout - */ - hasMoreUsers: boolean; + /** + * Whether other authenticated users remain after logout + */ + hasMoreUsers: boolean; } /** * Canonical directory where custom agents can be discovered or created, with scope, preference, and optional project path. @@ -4563,19 +4783,19 @@ export interface AccountLogoutResult { */ /** @experimental */ export interface AgentDiscoveryPath { - /** - * Absolute path of the search/create directory (may not exist on disk yet) - */ - path: string; - scope: AgentDiscoveryPathScope; - /** - * Whether this is the canonical directory to create a new agent in its tier. At most one entry per tier is preferred. - */ - preferredForCreation: boolean; - /** - * The input project path this directory was derived from (only for project scope) - */ - projectPath?: string; + /** + * Absolute path of the search/create directory (may not exist on disk yet) + */ + path: string; + scope: AgentDiscoveryPathScope; + /** + * Whether this is the canonical directory to create a new agent in its tier. At most one entry per tier is preferred. + */ + preferredForCreation: boolean; + /** + * The input project path this directory was derived from (only for project scope) + */ + projectPath?: string; } /** * Canonical locations where custom agents can be created so the runtime will recognize them. @@ -4585,10 +4805,10 @@ export interface AgentDiscoveryPath { */ /** @experimental */ export interface AgentDiscoveryPathList { - /** - * Canonical agent create/discovery directories, in priority order - */ - paths: AgentDiscoveryPath[]; + /** + * Canonical agent create/discovery directories, in priority order + */ + paths: AgentDiscoveryPath[]; } /** * The currently selected custom agent, or null when using the default agent. @@ -4598,10 +4818,10 @@ export interface AgentDiscoveryPathList { */ /** @experimental */ export interface AgentGetCurrentResult { - /** - * Currently selected custom agent, or null if using the default agent - */ - agent?: AgentInfo | null; + /** + * Currently selected custom agent, or null if using the default agent + */ + agent?: AgentInfo | null; } /** * Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path. @@ -4611,60 +4831,60 @@ export interface AgentGetCurrentResult { */ /** @experimental */ export interface AgentInfo { - /** - * Name of the agent. Use `id` as the stable selection identifier. - */ - name: string; - /** - * Human-readable display name - */ - displayName: string; - /** - * Description of the agent's purpose - */ - description: string; - /** - * Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path. - */ - path?: string; - /** - * Stable identifier for selection. For most agents this is the same as `name`; for plugin/builtin agents it may differ. Always populated; defaults to `name` when no distinct id was assigned. - */ - id: string; - source?: AgentInfoSource; - /** - * Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only. - */ - userInvocable?: boolean; - /** - * Allowed tool names for this agent. Empty array means none; omitted means inherit defaults. - */ - tools?: string[]; - /** - * Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference. - */ - model?: string; - /** - * Authored preferred model ids for this agent, in priority order. Runtime model selection chooses the first available model; omitted means no authored preference. - */ - models?: string[]; - modelPolicy?: AgentModelPolicy; - /** - * MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema. - * - * @experimental - */ - mcpServers?: { - [k: string]: JsonValue | undefined; - }; - /** - * Skill names preloaded into this agent's context. Omitted means none. - */ - skills?: string[]; - /** - * Authored base prompt for the agent. Runtime prompt assembly may add dynamic context at invocation time. Omitted from `session.agent.list` unless `includePrompt` is true. - */ - prompt?: string; + /** + * Name of the agent. Use `id` as the stable selection identifier. + */ + name: string; + /** + * Human-readable display name + */ + displayName: string; + /** + * Description of the agent's purpose + */ + description: string; + /** + * Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path. + */ + path?: string; + /** + * Stable identifier for selection. For most agents this is the same as `name`; for plugin/builtin agents it may differ. Always populated; defaults to `name` when no distinct id was assigned. + */ + id: string; + source?: AgentInfoSource; + /** + * Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only. + */ + userInvocable?: boolean; + /** + * Allowed tool names for this agent. Empty array means none; omitted means inherit defaults. + */ + tools?: string[]; + /** + * Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference. + */ + model?: string; + /** + * Authored preferred model ids for this agent, in priority order. Runtime model selection chooses the first available model; omitted means no authored preference. + */ + models?: string[]; + modelPolicy?: AgentModelPolicy; + /** + * MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema. + * + * @experimental + */ + mcpServers?: { + [k: string]: JsonValue | undefined; + }; + /** + * Skill names preloaded into this agent's context. Omitted means none. + */ + skills?: string[]; + /** + * Authored base prompt for the agent. Runtime prompt assembly may add dynamic context at invocation time. Omitted from `session.agent.list` unless `includePrompt` is true. + */ + prompt?: string; } /** * Agents available to the session. @@ -4674,10 +4894,10 @@ export interface AgentInfo { */ /** @experimental */ export interface AgentList { - /** - * Available agents - */ - agents: AgentInfo[]; + /** + * Available agents + */ + agents: AgentInfo[]; } /** * Full registry entry for the spawned child. Lets the controller call `handleLiveTargetSelected(entry)` directly without re-reading the registry (avoids a TOCTOU window). @@ -4687,68 +4907,68 @@ export interface AgentList { */ /** @experimental */ export interface AgentRegistryLiveTargetEntry { - /** - * Registry entry schema version (1 = ui-server, 2 = managed-server) - */ - schemaVersion: number; - kind: AgentRegistryLiveTargetEntryKind; - /** - * Operating-system pid of the process owning this entry - */ - pid: number; - /** - * Bind host for the entry's JSON-RPC server - */ - host: string; - /** - * TCP port the entry's JSON-RPC server is listening on - */ - port: number; - /** - * Session ID of the foreground session for this entry - */ - sessionId?: string; - /** - * Friendly session name (when set) - */ - sessionName?: string; - /** - * Working directory of the session (when known) - */ - cwd?: string; - /** - * Git branch of the session (when known) - */ - branch?: string; - /** - * Model identifier currently selected for the session - */ - model?: string; - status?: AgentRegistryLiveTargetEntryStatus; - attentionKind?: AgentRegistryLiveTargetEntryAttentionKind; - /** - * Monotonic per-publisher revision counter incremented on every status update. Lets watchers detect transient flips. - */ - statusRevision?: number; - lastTerminalEvent?: AgentRegistryLiveTargetEntryLastTerminalEvent; - /** - * ISO 8601 timestamp captured at registration - */ - startedAt: string; - /** - * Copilot CLI version that wrote the entry - */ - copilotVersion: string; - /** - * Wall-clock milliseconds since the watcher last observed this entry (heartbeat freshness) - */ - lastSeenMs: number; - /** - * Connection token (null when the target is unauthenticated) - * - * @internal - */ - token?: string | null; + /** + * Registry entry schema version (1 = ui-server, 2 = managed-server) + */ + schemaVersion: number; + kind: AgentRegistryLiveTargetEntryKind; + /** + * Operating-system pid of the process owning this entry + */ + pid: number; + /** + * Bind host for the entry's JSON-RPC server + */ + host: string; + /** + * TCP port the entry's JSON-RPC server is listening on + */ + port: number; + /** + * Session ID of the foreground session for this entry + */ + sessionId?: string; + /** + * Friendly session name (when set) + */ + sessionName?: string; + /** + * Working directory of the session (when known) + */ + cwd?: string; + /** + * Git branch of the session (when known) + */ + branch?: string; + /** + * Model identifier currently selected for the session + */ + model?: string; + status?: AgentRegistryLiveTargetEntryStatus; + attentionKind?: AgentRegistryLiveTargetEntryAttentionKind; + /** + * Monotonic per-publisher revision counter incremented on every status update. Lets watchers detect transient flips. + */ + statusRevision?: number; + lastTerminalEvent?: AgentRegistryLiveTargetEntryLastTerminalEvent; + /** + * ISO 8601 timestamp captured at registration + */ + startedAt: string; + /** + * Copilot CLI version that wrote the entry + */ + copilotVersion: string; + /** + * Wall-clock milliseconds since the watcher last observed this entry (heartbeat freshness) + */ + lastSeenMs: number; + /** + * Connection token (null when the target is unauthenticated) + * + * @internal + */ + token?: string | null; } /** * Per-spawn log-capture outcome; populated from spawnLiveTarget. @@ -4758,19 +4978,19 @@ export interface AgentRegistryLiveTargetEntry { */ /** @experimental */ export interface AgentRegistryLogCapture { - /** - * Whether per-spawn log capture is on (false when env-disabled or open failed) - */ - enabled: boolean; - /** - * Absolute path to the per-spawn log file (only set when enabled) - */ - path?: string; - /** - * Human-readable open failure message (only set when enabled === false AND the env-disable opt-out was NOT used) - */ - openError?: string; - openErrorReason?: AgentRegistryLogCaptureOpenErrorReason; + /** + * Whether per-spawn log capture is on (false when env-disabled or open failed) + */ + enabled: boolean; + /** + * Absolute path to the per-spawn log file (only set when enabled) + */ + path?: string; + /** + * Human-readable open failure message (only set when enabled === false AND the env-disable opt-out was NOT used) + */ + openError?: string; + openErrorReason?: AgentRegistryLogCaptureOpenErrorReason; } /** * `child_process.spawn` itself failed before the child entered the registry. @@ -4780,18 +5000,18 @@ export interface AgentRegistryLogCapture { */ /** @experimental */ export interface AgentRegistrySpawnError { - /** - * Discriminator: child_process.spawn itself failed - */ - kind: "spawn-error"; - /** - * Human-readable error message - */ - message: string; - /** - * Underlying errno code (e.g. ENOENT, EACCES) when available - */ - code?: string; + /** + * Discriminator: child_process.spawn itself failed + */ + kind: "spawn-error"; + /** + * Human-readable error message + */ + message: string; + /** + * Underlying errno code (e.g. ENOENT, EACCES) when available + */ + code?: string; } /** * Spawn succeeded but the child did not publish a matching managed-server entry within the timeout. @@ -4801,15 +5021,15 @@ export interface AgentRegistrySpawnError { */ /** @experimental */ export interface AgentRegistrySpawnRegistryTimeout { - /** - * Discriminator: spawn succeeded but child never registered - */ - kind: "registry-timeout"; - /** - * Process ID of the orphaned child (so the caller can offer 'kill the pid' guidance) - */ - childPid: number; - logCapture?: AgentRegistryLogCapture; + /** + * Discriminator: spawn succeeded but child never registered + */ + kind: "registry-timeout"; + /** + * Process ID of the orphaned child (so the caller can offer 'kill the pid' guidance) + */ + childPid: number; + logCapture?: AgentRegistryLogCapture; } /** * Inputs to spawn a managed-server child via the controller's spawn delegate. @@ -4819,27 +5039,27 @@ export interface AgentRegistrySpawnRegistryTimeout { */ /** @experimental */ export interface AgentRegistrySpawnRequest { - /** - * Working directory for the spawned child (must be an existing directory) - */ - cwd: string; - /** - * Custom or built-in agent name (e.g. 'explore'). When omitted, the child uses its own default. - */ - agentName?: string; - /** - * Model identifier to apply to the new session - */ - model?: string; - /** - * Friendly session name. Must satisfy validateSessionName: non-empty, no leading/trailing whitespace, <=100 chars, no control chars, no double quotes. - */ - name?: string; - permissionMode?: AgentRegistrySpawnPermissionMode; - /** - * Optional first user message. Forwarded to the caller (the CLI's spawn wrapper sends it post-attach via the standard LocalRpcSession.send path). - */ - initialPrompt?: string; + /** + * Working directory for the spawned child (must be an existing directory) + */ + cwd: string; + /** + * Custom or built-in agent name (e.g. 'explore'). When omitted, the child uses its own default. + */ + agentName?: string; + /** + * Model identifier to apply to the new session + */ + model?: string; + /** + * Friendly session name. Must satisfy validateSessionName: non-empty, no leading/trailing whitespace, <=100 chars, no control chars, no double quotes. + */ + name?: string; + permissionMode?: AgentRegistrySpawnPermissionMode; + /** + * Optional first user message. Forwarded to the caller (the CLI's spawn wrapper sends it post-attach via the standard LocalRpcSession.send path). + */ + initialPrompt?: string; } /** * Managed-server child was spawned and registered successfully. @@ -4849,20 +5069,20 @@ export interface AgentRegistrySpawnRequest { */ /** @experimental */ export interface AgentRegistrySpawnSpawned { - /** - * Discriminator: managed-server child spawned successfully - */ - kind: "spawned"; - entry: AgentRegistryLiveTargetEntry; - /** - * Whether the delegate already sent the initial prompt. Always omitted in the current wiring: the controller sends the prompt post-attach via the standard LocalRpcSession.send path. - */ - initialPromptSent?: boolean; - /** - * If the delegate attempted to send the initial prompt and failed, the categorized error message. - */ - initialPromptError?: string; - logCapture?: AgentRegistryLogCapture; + /** + * Discriminator: managed-server child spawned successfully + */ + kind: "spawned"; + entry: AgentRegistryLiveTargetEntry; + /** + * Whether the delegate already sent the initial prompt. Always omitted in the current wiring: the controller sends the prompt post-attach via the standard LocalRpcSession.send path. + */ + initialPromptSent?: boolean; + /** + * If the delegate attempted to send the initial prompt and failed, the categorized error message. + */ + initialPromptError?: string; + logCapture?: AgentRegistryLogCapture; } /** * Synchronous pre-validation rejected the spawn request. @@ -4872,16 +5092,16 @@ export interface AgentRegistrySpawnSpawned { */ /** @experimental */ export interface AgentRegistrySpawnValidationError { - /** - * Discriminator: synchronous pre-validation rejected the request - */ - kind: "validation-error"; - reason: AgentRegistrySpawnValidationErrorReason; - field?: AgentRegistrySpawnValidationErrorField; - /** - * Human-readable explanation; safe to surface in the UI banner. Never logged to unrestricted telemetry. - */ - message: string; + /** + * Discriminator: synchronous pre-validation rejected the request + */ + kind: "validation-error"; + reason: AgentRegistrySpawnValidationErrorReason; + field?: AgentRegistrySpawnValidationErrorField; + /** + * Human-readable explanation; safe to surface in the UI banner. Never logged to unrestricted telemetry. + */ + message: string; } /** * Custom agents available to the session after reloading definitions from disk. @@ -4891,10 +5111,10 @@ export interface AgentRegistrySpawnValidationError { */ /** @experimental */ export interface AgentReloadResult { - /** - * Reloaded custom agents - */ - agents: AgentInfo[]; + /** + * Reloaded custom agents + */ + agents: AgentInfo[]; } /** * Optional project paths to include in agent discovery. @@ -4904,14 +5124,14 @@ export interface AgentReloadResult { */ /** @experimental */ export interface AgentsDiscoverRequest { - /** - * Optional list of project directory paths to scan for project-scoped agents. When omitted or empty, only user/plugin/remote-independent agents are returned (no project scan). - */ - projectPaths?: string[]; - /** - * 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. - */ - excludeHostAgents?: boolean; + /** + * Optional list of project directory paths to scan for project-scoped agents. When omitted or empty, only user/plugin/remote-independent agents are returned (no project scan). + */ + projectPaths?: string[]; + /** + * 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. + */ + excludeHostAgents?: boolean; } /** * Name of the custom agent to select for subsequent turns. @@ -4921,10 +5141,10 @@ export interface AgentsDiscoverRequest { */ /** @experimental */ export interface AgentSelectRequest { - /** - * Name of the custom agent to select - */ - name: string; + /** + * Name of the custom agent to select + */ + name: string; } /** * The newly selected custom agent. @@ -4934,7 +5154,7 @@ export interface AgentSelectRequest { */ /** @experimental */ export interface AgentSelectResult { - agent: AgentInfo; + agent: AgentInfo; } /** * An in-memory authored prompt override for an available agent. @@ -4944,14 +5164,14 @@ export interface AgentSelectResult { */ /** @experimental */ export interface AgentSetPromptRequest { - /** - * Stable effective agent id. Plugin namespace separators are normalized. - */ - id: string; - /** - * Replacement authored prompt. Empty text is valid. - */ - prompt: string; + /** + * Stable effective agent id. Plugin namespace separators are normalized. + */ + id: string; + /** + * Replacement authored prompt. Empty text is valid. + */ + prompt: string; } /** * Optional project paths to include when enumerating agent discovery directories. @@ -4961,14 +5181,14 @@ export interface AgentSetPromptRequest { */ /** @experimental */ export interface AgentsGetDiscoveryPathsRequest { - /** - * Optional list of project directory paths. When omitted or empty, only the user-level directory is returned. - */ - projectPaths?: string[]; - /** - * When true, omit the host's user-level agent directory, leaving only project directories. For multitenant deployments (mirrors `discover`'s `excludeHostAgents`). - */ - excludeHostAgents?: boolean; + /** + * Optional list of project directory paths. When omitted or empty, only the user-level directory is returned. + */ + projectPaths?: string[]; + /** + * When true, omit the host's user-level agent directory, leaving only project directories. For multitenant deployments (mirrors `discover`'s `excludeHostAgents`). + */ + excludeHostAgents?: boolean; } /** * Credential-free authentication identity safe to expose to hosts and user interfaces. @@ -4978,24 +5198,24 @@ export interface AgentsGetDiscoveryPathsRequest { */ /** @experimental */ export interface AuthIdentity { - type: AuthInfoType; - /** - * Authentication host - */ - host: string; - /** - * Authenticated login, when available - */ - login?: string; - /** - * Name of the environment variable that supplied the credential, when applicable - */ - envVar?: string; - /** - * Opaque SDK GitHub credential registration backing this identity. Routing metadata only; never a credential. - */ - registrationId?: string; - copilotUser?: CopilotUserResponse; + type: AuthInfoType; + /** + * Authentication host + */ + host: string; + /** + * Authenticated login, when available + */ + login?: string; + /** + * Name of the environment variable that supplied the credential, when applicable + */ + envVar?: string; + /** + * Opaque SDK GitHub credential registration backing this identity. Routing metadata only; never a credential. + */ + registrationId?: string; + copilotUser?: CopilotUserResponse; } /** * Validation error from an authentication attempt. @@ -5005,14 +5225,14 @@ export interface AuthIdentity { */ /** @experimental */ export interface AuthValidationError { - /** - * Authentication validation error message - */ - message: string; - /** - * Optional message returned by GitHub - */ - githubMessage?: string; + /** + * Authentication validation error message + */ + message: string; + /** + * Optional message returned by GitHub + */ + githubMessage?: string; } /** * The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. @@ -5022,10 +5242,10 @@ export interface AuthValidationError { */ /** @experimental */ export interface BuiltInModelCatalog { - /** - * Built-in model entries. - */ - models: BuiltInModelCatalogEntry[]; + /** + * Built-in model entries. + */ + models: BuiltInModelCatalogEntry[]; } /** * A well-known model in the runtime's built-in catalog. @@ -5035,10 +5255,10 @@ export interface BuiltInModelCatalog { */ /** @experimental */ export interface BuiltInModelCatalogEntry { - /** - * Well-known runtime model ID suitable for provider or provider-model metadata. This is not necessarily the provider-facing deployment or model name and does not indicate CAPI entitlement or provider availability. - */ - id: string; + /** + * Well-known runtime model ID suitable for provider or provider-model metadata. This is not necessarily the provider-facing deployment or model name and does not indicate CAPI entitlement or provider availability. + */ + id: string; } /** * Rust-owned metadata and input schema for a built-in tool. @@ -5048,43 +5268,43 @@ export interface BuiltInModelCatalogEntry { */ /** @experimental */ export interface BuiltinToolDescriptor { - /** - * Stable name used to invoke the built-in tool. - */ - name: string; - /** - * Optional human-readable title for the tool. - */ - title: string | null; - /** - * Model-facing description of the tool's behavior. - */ - description: string; - /** - * JSON Schema for the tool input, or null when the tool uses a custom format. - */ - inputSchema: BuiltinToolInputSchema | null; - /** - * Optional supplemental usage instructions for the tool. - */ - instructions: string | null; - /** - * Optional tool category discriminator. - */ - type: string | null; - /** - * Optional custom input format used instead of a JSON Schema. - */ - format: BuiltinToolFormat | null; - safeForTelemetry: BuiltinToolSafeForTelemetry; - /** - * Whether the tool executes commands in a terminal. - */ - isTerminal: boolean; - /** - * Whether the tool provides a specialized intention summary. - */ - hasSummariseIntention: boolean; + /** + * Stable name used to invoke the built-in tool. + */ + name: string; + /** + * Optional human-readable title for the tool. + */ + title: string | null; + /** + * Model-facing description of the tool's behavior. + */ + description: string; + /** + * JSON Schema for the tool input, or null when the tool uses a custom format. + */ + inputSchema: BuiltinToolInputSchema | null; + /** + * Optional supplemental usage instructions for the tool. + */ + instructions: string | null; + /** + * Optional tool category discriminator. + */ + type: string | null; + /** + * Optional custom input format used instead of a JSON Schema. + */ + format: BuiltinToolFormat | null; + safeForTelemetry: BuiltinToolSafeForTelemetry; + /** + * Whether the tool executes commands in a terminal. + */ + isTerminal: boolean; + /** + * Whether the tool provides a specialized intention summary. + */ + hasSummariseIntention: boolean; } /** * JSON Schema object accepted by a built-in tool. @@ -5094,8 +5314,8 @@ export interface BuiltinToolDescriptor { */ /** @experimental */ export interface BuiltinToolInputSchema { - type: BuiltinToolInputSchemaType; - [k: string]: JsonValue | undefined; + type: BuiltinToolInputSchemaType; + [k: string]: JsonValue | undefined; } /** * Custom grammar input format accepted by a built-in tool. @@ -5105,15 +5325,15 @@ export interface BuiltinToolInputSchema { */ /** @experimental */ export interface BuiltinToolFormat { - type: BuiltinToolFormatType; - /** - * Grammar syntax used by the format definition. - */ - syntax: string; - /** - * Grammar definition accepted by the tool. - */ - definition: string; + type: BuiltinToolFormatType; + /** + * Grammar syntax used by the format definition. + */ + syntax: string; + /** + * Grammar definition accepted by the tool. + */ + definition: string; } /** * Per-field telemetry-safety policy for a built-in tool. @@ -5123,14 +5343,14 @@ export interface BuiltinToolFormat { */ /** @experimental */ export interface BuiltinToolSafeTelemetryFields { - /** - * Whether the tool name may be included in telemetry without obfuscation. - */ - name?: boolean; - /** - * Whether tool input names may be included in telemetry without obfuscation. - */ - inputsNames?: boolean; + /** + * Whether the tool name may be included in telemetry without obfuscation. + */ + name?: boolean; + /** + * Whether tool input names may be included in telemetry without obfuscation. + */ + inputsNames?: boolean; } /** * Cancellation result for a user-requested shell command. @@ -5140,10 +5360,10 @@ export interface BuiltinToolSafeTelemetryFields { */ /** @experimental */ export interface CancelUserRequestedShellCommandResult { - /** - * Whether an in-flight execution was found and signalled to cancel - */ - cancelled: boolean; + /** + * Whether an in-flight execution was found and signalled to cancel + */ + cancelled: boolean; } /** * Canvas action that the agent or host can invoke. To discover the input schema for a particular action, call the list_canvas_capabilities tool. @@ -5153,15 +5373,15 @@ export interface CancelUserRequestedShellCommandResult { */ /** @experimental */ export interface CanvasAction { - /** - * Action name exposed by the canvas provider - */ - name: string; - /** - * Description of the action - */ - description?: string; - inputSchema?: CanvasJsonSchema; + /** + * Action name exposed by the canvas provider + */ + name: string; + /** + * Description of the action + */ + description?: string; + inputSchema?: CanvasJsonSchema; } /** * Canvas action invocation parameters. @@ -5171,18 +5391,18 @@ export interface CanvasAction { */ /** @experimental */ export interface CanvasActionInvokeRequest { - /** - * Open canvas instance identifier - */ - instanceId: string; - /** - * Action name to invoke - */ - actionName: string; - /** - * Action input - */ - input?: JsonValue; + /** + * Open canvas instance identifier + */ + instanceId: string; + /** + * Action name to invoke + */ + actionName: string; + /** + * Action input + */ + input?: JsonValue; } /** * Canvas close parameters. @@ -5192,10 +5412,10 @@ export interface CanvasActionInvokeRequest { */ /** @experimental */ export interface CanvasCloseRequest { - /** - * Open canvas instance identifier - */ - instanceId: string; + /** + * Open canvas instance identifier + */ + instanceId: string; } /** * Host context supplied by the runtime. @@ -5205,7 +5425,7 @@ export interface CanvasCloseRequest { */ /** @experimental */ export interface CanvasHostContext { - capabilities?: CanvasHostContextCapabilities; + capabilities?: CanvasHostContextCapabilities; } /** * Host capabilities @@ -5215,10 +5435,10 @@ export interface CanvasHostContext { */ /** @experimental */ export interface CanvasHostContextCapabilities { - /** - * Whether canvas rendering is supported - */ - canvases?: boolean; + /** + * Whether canvas rendering is supported + */ + canvases?: boolean; } /** * Declared canvases available in this session. @@ -5228,10 +5448,10 @@ export interface CanvasHostContextCapabilities { */ /** @experimental */ export interface CanvasList { - /** - * Declared canvases available in this session - */ - canvases: DiscoveredCanvas[]; + /** + * Declared canvases available in this session + */ + canvases: DiscoveredCanvas[]; } /** * Canvas available in the current session. @@ -5241,35 +5461,35 @@ export interface CanvasList { */ /** @experimental */ export interface DiscoveredCanvas { - /** - * Human-readable canvas name - */ - displayName: string; - /** - * Short, single-sentence description shown to the agent in canvas catalogs. - */ - description: string; - /** - * Host-local PNG path for the canvas icon, when supplied - */ - icon?: string; - inputSchema?: CanvasJsonSchema; - /** - * Actions the agent or host may invoke on an open instance - */ - actions?: CanvasAction[]; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Owning extension display name, when available - */ - extensionName?: string; - /** - * Provider-local canvas identifier - */ - canvasId: string; + /** + * Human-readable canvas name + */ + displayName: string; + /** + * Short, single-sentence description shown to the agent in canvas catalogs. + */ + description: string; + /** + * Host-local PNG path for the canvas icon, when supplied + */ + icon?: string; + inputSchema?: CanvasJsonSchema; + /** + * Actions the agent or host may invoke on an open instance + */ + actions?: CanvasAction[]; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Owning extension display name, when available + */ + extensionName?: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; } /** * Live open-canvas snapshot. @@ -5279,10 +5499,10 @@ export interface DiscoveredCanvas { */ /** @experimental */ export interface CanvasListOpenResult { - /** - * Currently open canvas instances - */ - openCanvases: OpenCanvasInstance[]; + /** + * Currently open canvas instances + */ + openCanvases: OpenCanvasInstance[]; } /** * Open canvas instance snapshot. @@ -5292,42 +5512,42 @@ export interface CanvasListOpenResult { */ /** @experimental */ export interface OpenCanvasInstance { - /** - * Stable caller-supplied canvas instance identifier - */ - instanceId: string; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Owning extension display name, when available - */ - extensionName?: string; - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Host-local PNG path for the canvas icon, when supplied - */ - icon?: string; - /** - * Rendered title - */ - title?: string; - /** - * Provider-supplied status text - */ - status?: string; - /** - * URL for web-rendered canvases - */ - url?: string; - /** - * Input supplied when the instance was opened - */ - input?: JsonValue; + /** + * Stable caller-supplied canvas instance identifier + */ + instanceId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Owning extension display name, when available + */ + extensionName?: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Host-local PNG path for the canvas icon, when supplied + */ + icon?: string; + /** + * Rendered title + */ + title?: string; + /** + * Provider-supplied status text + */ + status?: string; + /** + * URL for web-rendered canvases + */ + url?: string; + /** + * Input supplied when the instance was opened + */ + input?: JsonValue; } /** * Canvas open parameters. @@ -5337,22 +5557,22 @@ export interface OpenCanvasInstance { */ /** @experimental */ export interface CanvasOpenRequest { - /** - * Owning provider identifier. Optional when the canvasId is unique across providers; required to disambiguate when multiple providers register the same canvasId. - */ - extensionId?: string; - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Caller-supplied stable instance identifier - */ - instanceId: string; - /** - * Canvas open input - */ - input?: JsonValue; + /** + * Owning provider identifier. Optional when the canvasId is unique across providers; required to disambiguate when multiple providers register the same canvasId. + */ + extensionId?: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Caller-supplied stable instance identifier + */ + instanceId: string; + /** + * Canvas open input + */ + input?: JsonValue; } /** * Canvas close parameters sent to the provider. @@ -5362,24 +5582,24 @@ export interface CanvasOpenRequest { */ /** @experimental */ export interface CanvasProviderCloseRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Canvas instance identifier - */ - instanceId: string; - host?: CanvasHostContext; - session?: CanvasSessionContext; + /** + * Target session identifier + */ + sessionId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Canvas instance identifier + */ + instanceId: string; + host?: CanvasHostContext; + session?: CanvasSessionContext; } /** * Session context supplied by the runtime. @@ -5389,10 +5609,10 @@ export interface CanvasProviderCloseRequest { */ /** @experimental */ export interface CanvasSessionContext { - /** - * Active session working directory, when known. - */ - workingDirectory?: string; + /** + * Active session working directory, when known. + */ + workingDirectory?: string; } /** * Canvas action invocation parameters sent to the provider. @@ -5402,32 +5622,32 @@ export interface CanvasSessionContext { */ /** @experimental */ export interface CanvasProviderInvokeActionRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Canvas instance identifier - */ - instanceId: string; - /** - * Action name to invoke - */ - actionName: string; - /** - * Action input - */ - input?: JsonValue; - host?: CanvasHostContext; - session?: CanvasSessionContext; + /** + * Target session identifier + */ + sessionId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Canvas instance identifier + */ + instanceId: string; + /** + * Action name to invoke + */ + actionName: string; + /** + * Action input + */ + input?: JsonValue; + host?: CanvasHostContext; + session?: CanvasSessionContext; } /** * Canvas open parameters sent to the provider. @@ -5437,28 +5657,28 @@ export interface CanvasProviderInvokeActionRequest { */ /** @experimental */ export interface CanvasProviderOpenRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Stable caller-supplied canvas instance identifier - */ - instanceId: string; - /** - * Canvas open input - */ - input?: JsonValue; - host?: CanvasHostContext; - session?: CanvasSessionContext; + /** + * Target session identifier + */ + sessionId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Stable caller-supplied canvas instance identifier + */ + instanceId: string; + /** + * Canvas open input + */ + input?: JsonValue; + host?: CanvasHostContext; + session?: CanvasSessionContext; } /** * Canvas open result returned by the provider. @@ -5468,18 +5688,18 @@ export interface CanvasProviderOpenRequest { */ /** @experimental */ export interface CanvasProviderOpenResult { - /** - * URL for web-rendered canvases - */ - url?: string; - /** - * Provider-supplied title - */ - title?: string; - /** - * Provider-supplied status text - */ - status?: string; + /** + * URL for web-rendered canvases + */ + url?: string; + /** + * Provider-supplied title + */ + title?: string; + /** + * Provider-supplied status text + */ + status?: string; } /** * Internal canvas provider registration parameters. @@ -5489,18 +5709,18 @@ export interface CanvasProviderOpenResult { */ /** @experimental */ export interface CanvasProviderRegisterRequest { - /** - * Connection identifier for callback routing - */ - connectionId: string; - /** - * Provider metadata supplied by the host - */ - info: JsonValue; - /** - * Canvas contributions supplied by the provider - */ - canvases: JsonValue[]; + /** + * Connection identifier for callback routing + */ + connectionId: string; + /** + * Provider metadata supplied by the host + */ + info: JsonValue; + /** + * Canvas contributions supplied by the provider + */ + canvases: JsonValue[]; } /** * Internal canvas provider unregistration parameters. @@ -5510,10 +5730,10 @@ export interface CanvasProviderRegisterRequest { */ /** @experimental */ export interface CanvasProviderUnregisterRequest { - /** - * Connection identifier to unregister - */ - connectionId: string; + /** + * Connection identifier to unregister + */ + connectionId: string; } /** * Options scoped to the built-in CAPI (Copilot API) provider. @@ -5523,11 +5743,11 @@ export interface CanvasProviderUnregisterRequest { */ /** @experimental */ export interface CapiSessionOptions { - autoTier?: AutoTier; - /** - * 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. - */ - enableWebSocketResponses?: boolean; + autoTier?: AutoTier; + /** + * 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. + */ + enableWebSocketResponses?: boolean; } /** * Semantic digest of a strictly parsed and schema-validated JSON MCP card. Both URL-backed and embedded cards are canonicalised with RFC 8785 JSON Canonicalization Scheme, encoded as UTF-8, and hashed with SHA-256. @@ -5537,8 +5757,8 @@ export interface CapiSessionOptions { */ /** @experimental */ export interface CardDigest { - algorithm: CardDigestAlgorithm; - value: CardDigestValue; + algorithm: CardDigestAlgorithm; + value: CardDigestValue; } /** * An inert AI skill catalog result. AI skills are discovery-only and cannot be represented as installable through this surface. @@ -5548,40 +5768,40 @@ export interface CardDigest { */ /** @experimental */ export interface CatalogAiSkillCandidate { - /** - * Opaque, runtime-instance scoped, TTL-bound, single-use handle for this candidate. Carries no readable information and is rejected when stale, replayed, or presented to a different runtime instance. Never logged. - */ - handle: string; - /** - * ISO 8601 timestamp after which the handle is stale and will be rejected. - */ - handleExpiresAt: string; - /** - * Discriminator: this candidate describes an AI skill - */ - kind: "ai-skill"; - /** - * Media type of the underlying AI skill card - */ - mediaType: "application/ai-skill"; - /** - * AI skills are discovery-only and cannot be installed through this surface - */ - installability: "not-installable-kind"; - /** - * Display name taken verbatim from the card. Inert untrusted text. - */ - displayName: string; - /** - * Description taken verbatim from the card. Inert untrusted text. - */ - description?: string; - /** - * Publisher taken verbatim from the card. Inert untrusted text. - */ - publisher?: string; - source: CatalogCandidateSource; - provenance: CatalogAiSkillCandidateProvenance; + /** + * Opaque, runtime-instance scoped, TTL-bound, single-use handle for this candidate. Carries no readable information and is rejected when stale, replayed, or presented to a different runtime instance. Never logged. + */ + handle: string; + /** + * ISO 8601 timestamp after which the handle is stale and will be rejected. + */ + handleExpiresAt: string; + /** + * Discriminator: this candidate describes an AI skill + */ + kind: "ai-skill"; + /** + * Media type of the underlying AI skill card + */ + mediaType: "application/ai-skill"; + /** + * AI skills are discovery-only and cannot be installed through this surface + */ + installability: "not-installable-kind"; + /** + * Display name taken verbatim from the card. Inert untrusted text. + */ + displayName: string; + /** + * Description taken verbatim from the card. Inert untrusted text. + */ + description?: string; + /** + * Publisher taken verbatim from the card. Inert untrusted text. + */ + publisher?: string; + source: CatalogCandidateSource; + provenance: CatalogAiSkillCandidateProvenance; } /** * Candidate whose card is retrieved from a URL through the runtime's hardened fetch boundary. @@ -5591,14 +5811,14 @@ export interface CatalogAiSkillCandidate { */ /** @experimental */ export interface CatalogCandidateSourceUrl { - /** - * Discriminator: the card is URL-backed, and carries no embedded data - */ - kind: "url"; - /** - * Card URL as advertised. Inert untrusted data: the runtime retrieves it only through its own hardened boundary, and it is never logged. - */ - url: string; + /** + * Discriminator: the card is URL-backed, and carries no embedded data + */ + kind: "url"; + /** + * Card URL as advertised. Inert untrusted data: the runtime retrieves it only through its own hardened boundary, and it is never logged. + */ + url: string; } /** * Candidate whose card reference arrived inline. The document and its content-derived properties stay behind the runtime boundary. @@ -5608,10 +5828,10 @@ export interface CatalogCandidateSourceUrl { */ /** @experimental */ export interface CatalogCandidateSourceEmbedded { - /** - * Discriminator: the card is embedded, and carries no URL - */ - kind: "embedded"; + /** + * Discriminator: the card is embedded, and carries no URL + */ + kind: "embedded"; } /** * Where and when an AI skill catalog reference was observed. Discovery provenance deliberately carries no content digest because search does not establish the exact validated content a later plan will bind. @@ -5621,18 +5841,18 @@ export interface CatalogCandidateSourceEmbedded { */ /** @experimental */ export interface CatalogAiSkillCandidateProvenance { - /** - * Host of the catalog authority that advertised the reference, without path, query, or credentials. Inert untrusted data. - */ - authority: string; - /** - * ISO 8601 timestamp at which the runtime observed the catalog reference. This is not a retrieval or validation timestamp. - */ - observedAt: string; - /** - * Media type advertised for the referenced AI skill card - */ - mediaType: "application/ai-skill"; + /** + * Host of the catalog authority that advertised the reference, without path, query, or credentials. Inert untrusted data. + */ + authority: string; + /** + * ISO 8601 timestamp at which the runtime observed the catalog reference. This is not a retrieval or validation timestamp. + */ + observedAt: string; + /** + * Media type advertised for the referenced AI skill card + */ + mediaType: "application/ai-skill"; } /** * An optional catalog authentication exchange did not establish the caller's identity. Anonymous search remains supported; this refusal is reserved for an operation that cannot continue after the attempted exchange. It is distinct from `policy-rejected` and from a network failure, and the reason identifies the recovery action. @@ -5642,15 +5862,15 @@ export interface CatalogAiSkillCandidateProvenance { */ /** @experimental */ export interface CatalogAuthenticationRequiredError { - /** - * Discriminator: the caller is not authenticated - */ - kind: "authentication-required"; - reason: CatalogAuthenticationRequiredReason; - /** - * Human-readable explanation, safe to surface. Never contains a credential or token, nor a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: the caller is not authenticated + */ + kind: "authentication-required"; + reason: CatalogAuthenticationRequiredReason; + /** + * Human-readable explanation, safe to surface. Never contains a credential or token, nor a query, URL, handle, or secret. + */ + message: string; } /** * An inert MCP server catalog result. Every free-text field is untrusted external data and must never be treated as an instruction, and the handle is the only way to refer to the candidate in a later operation. @@ -5660,34 +5880,34 @@ export interface CatalogAuthenticationRequiredError { */ /** @experimental */ export interface CatalogMcpServerCandidate { - /** - * Opaque, runtime-instance scoped, TTL-bound, single-use handle for this candidate. Carries no readable information and is rejected when stale, replayed, or presented to a different runtime instance. Never logged. - */ - handle: string; - /** - * ISO 8601 timestamp after which the handle is stale and will be rejected. - */ - handleExpiresAt: string; - /** - * Discriminator: this candidate describes an MCP server - */ - kind: "mcp-server"; - mediaType: McpServerCardMediaType; - installability: CatalogMcpServerInstallability; - /** - * Display name taken verbatim from the card. Inert untrusted text. - */ - displayName: string; - /** - * Description taken verbatim from the card. Inert untrusted text. - */ - description?: string; - /** - * Publisher taken verbatim from the card. Inert untrusted text. - */ - publisher?: string; - source: CatalogCandidateSource; - provenance: CatalogMcpServerCandidateProvenance; + /** + * Opaque, runtime-instance scoped, TTL-bound, single-use handle for this candidate. Carries no readable information and is rejected when stale, replayed, or presented to a different runtime instance. Never logged. + */ + handle: string; + /** + * ISO 8601 timestamp after which the handle is stale and will be rejected. + */ + handleExpiresAt: string; + /** + * Discriminator: this candidate describes an MCP server + */ + kind: "mcp-server"; + mediaType: McpServerCardMediaType; + installability: CatalogMcpServerInstallability; + /** + * Display name taken verbatim from the card. Inert untrusted text. + */ + displayName: string; + /** + * Description taken verbatim from the card. Inert untrusted text. + */ + description?: string; + /** + * Publisher taken verbatim from the card. Inert untrusted text. + */ + publisher?: string; + source: CatalogCandidateSource; + provenance: CatalogMcpServerCandidateProvenance; } /** * Where and when an MCP server catalog reference was observed. Discovery provenance deliberately carries no content digest because search does not establish the exact validated content a later plan will bind. @@ -5697,15 +5917,15 @@ export interface CatalogMcpServerCandidate { */ /** @experimental */ export interface CatalogMcpServerCandidateProvenance { - /** - * Host of the catalog authority that advertised the reference, without path, query, or credentials. Inert untrusted data. - */ - authority: string; - /** - * ISO 8601 timestamp at which the runtime observed the catalog reference. This is not a retrieval or validation timestamp. - */ - observedAt: string; - mediaType: McpServerCardMediaType; + /** + * Host of the catalog authority that advertised the reference, without path, query, or credentials. Inert untrusted data. + */ + authority: string; + /** + * ISO 8601 timestamp at which the runtime observed the catalog reference. This is not a retrieval or validation timestamp. + */ + observedAt: string; + mediaType: McpServerCardMediaType; } /** * The protocol version and capability set a caller requires, supplied on every catalog request so negotiation cannot be skipped by omission. @@ -5715,16 +5935,16 @@ export interface CatalogMcpServerCandidateProvenance { */ /** @experimental */ export interface CatalogClientContract { - /** - * SDK protocol version the caller was generated against. A caller below the runtime's minimum supported version is refused rather than served a partial result. - */ - protocolVersion: number; - /** - * Wire features the caller requires the runtime to understand. Identifiers are bounded but extensible so a newer caller can negotiate with an older runtime. Requiring an unknown feature yields a typed refusal listing what is understood, never a partial grant. A grant does not promise that a deployment has enabled the operation; typed unavailable results report that separately. - * - * @maxItems 32 - */ - requiredCapabilities: CatalogCapabilityId[]; + /** + * SDK protocol version the caller was generated against. A caller below the runtime's minimum supported version is refused rather than served a partial result. + */ + protocolVersion: number; + /** + * Wire features the caller requires the runtime to understand. Identifiers are bounded but extensible so a newer caller can negotiate with an older runtime. Requiring an unknown feature yields a typed refusal listing what is understood, never a partial grant. A grant does not promise that a deployment has enabled the operation; typed unavailable results report that separately. + * + * @maxItems 32 + */ + requiredCapabilities: CatalogCapabilityId[]; } /** * An upstream catalog response broke the wire contract. Most importantly, every result must carry exactly one of a URL or embedded data: a result carrying both, or neither, is refused here rather than being guessed at. @@ -5734,15 +5954,15 @@ export interface CatalogClientContract { */ /** @experimental */ export interface CatalogContractViolationError { - /** - * Discriminator: the upstream response broke the contract - */ - kind: "contract-violation"; - reason: CatalogContractViolationReason; - /** - * Human-readable explanation, safe to surface. Never echoes response content, nor a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: the upstream response broke the contract + */ + kind: "contract-violation"; + reason: CatalogContractViolationReason; + /** + * Human-readable explanation, safe to surface. Never echoes response content, nor a query, URL, handle, or secret. + */ + message: string; } /** * A presented handle was not accepted. Handles are runtime-instance scoped, TTL-bound, and single-use, so each way of failing is reported distinctly. @@ -5752,16 +5972,16 @@ export interface CatalogContractViolationError { */ /** @experimental */ export interface CatalogHandleRejectedError { - /** - * Discriminator: a handle was rejected - */ - kind: "handle-rejected"; - handleType: CatalogHandleType; - reason: CatalogHandleRejectionReason; - /** - * Human-readable explanation, safe to surface. Never contains the handle itself, nor a query, URL, or secret. - */ - message: string; + /** + * Discriminator: a handle was rejected + */ + kind: "handle-rejected"; + handleType: CatalogHandleType; + reason: CatalogHandleRejectionReason; + /** + * Human-readable explanation, safe to surface. Never contains the handle itself, nor a query, URL, or secret. + */ + message: string; } /** * The request was rejected before any work was done, because a bounded field fell outside its permitted range or a required field was unusable. @@ -5771,15 +5991,15 @@ export interface CatalogHandleRejectedError { */ /** @experimental */ export interface CatalogInvalidRequestError { - /** - * Discriminator: the request itself was invalid - */ - kind: "invalid-request"; - field: CatalogInvalidRequestField; - /** - * Human-readable explanation, safe to surface. Never echoes the offending value, nor a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: the request itself was invalid + */ + kind: "invalid-request"; + field: CatalogInvalidRequestField; + /** + * Human-readable explanation, safe to surface. Never echoes the offending value, nor a query, URL, handle, or secret. + */ + message: string; } /** * A card could not be parsed or did not satisfy its declared media type's schema. @@ -5789,16 +6009,16 @@ export interface CatalogInvalidRequestError { */ /** @experimental */ export interface CatalogMalformedCardError { - /** - * Discriminator: the card was malformed - */ - kind: "malformed-card"; - reason: CatalogMalformedCardReason; - mediaType?: CatalogMediaType; - /** - * Human-readable explanation, safe to surface. Never echoes card content, nor a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: the card was malformed + */ + kind: "malformed-card"; + reason: CatalogMalformedCardReason; + mediaType?: CatalogMediaType; + /** + * Human-readable explanation, safe to surface. Never echoes card content, nor a query, URL, handle, or secret. + */ + message: string; } /** * The protocol version and capability set the runtime actually honoured for a successful catalog operation. @@ -5808,14 +6028,14 @@ export interface CatalogMalformedCardError { */ /** @experimental */ export interface CatalogNegotiatedContract { - /** - * Protocol version of the runtime that served the request. - */ - runtimeProtocolVersion: number; - /** - * Wire features the runtime understood for this operation. Always a superset of the caller's required features, because any shortfall is a refusal instead. Operation availability remains a separate typed result. - */ - grantedCapabilities: CatalogCapability[]; + /** + * Protocol version of the runtime that served the request. + */ + runtimeProtocolVersion: number; + /** + * Wire features the runtime understood for this operation. Always a superset of the caller's required features, because any shortfall is a refusal instead. Operation availability remains a separate typed result. + */ + grantedCapabilities: CatalogCapability[]; } /** * The caller's protocol version or required capabilities cannot be honoured. Returned instead of a partial or ambiguous success. @@ -5825,33 +6045,33 @@ export interface CatalogNegotiatedContract { */ /** @experimental */ export interface CatalogNegotiationRefusedError { - /** - * Discriminator: capability or protocol-version negotiation failed - */ - kind: "negotiation-refused"; - reason: CatalogNegotiationRefusedReason; - /** - * Protocol version of the runtime that refused the request. - */ - runtimeProtocolVersion: number; - /** - * Lowest caller protocol version this runtime will serve. - */ - minimumSupportedProtocolVersion: number; - /** - * Every wire feature this runtime understands, so the caller can retry within that contract. This list does not imply that every deployment has enabled every operation. - */ - supportedCapabilities: CatalogCapability[]; - /** - * The subset of the caller's bounded extensible capability identifiers this runtime cannot honour. - * - * @maxItems 32 - */ - unsupportedCapabilities: CatalogCapabilityId[]; - /** - * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: capability or protocol-version negotiation failed + */ + kind: "negotiation-refused"; + reason: CatalogNegotiationRefusedReason; + /** + * Protocol version of the runtime that refused the request. + */ + runtimeProtocolVersion: number; + /** + * Lowest caller protocol version this runtime will serve. + */ + minimumSupportedProtocolVersion: number; + /** + * Every wire feature this runtime understands, so the caller can retry within that contract. This list does not imply that every deployment has enabled every operation. + */ + supportedCapabilities: CatalogCapability[]; + /** + * The subset of the caller's bounded extensible capability identifiers this runtime cannot honour. + * + * @maxItems 32 + */ + unsupportedCapabilities: CatalogCapabilityId[]; + /** + * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. + */ + message: string; } /** * The runtime could not reach the catalog authority or retrieve a card. Covers being offline as well as transport-level failure. @@ -5861,23 +6081,23 @@ export interface CatalogNegotiationRefusedError { */ /** @experimental */ export interface CatalogNetworkFailureError { - /** - * Discriminator: the network operation failed - */ - kind: "network-failure"; - reason: CatalogNetworkFailureReason; - /** - * HTTP status code, when the failure was a rejected response. - */ - statusCode?: number; - /** - * Bounded cooldown in seconds before another catalog request should be attempted, when the authority supplied a numeric Retry-After value or the runtime applied its documented fallback. - */ - retryAfterSeconds?: number; - /** - * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: the network operation failed + */ + kind: "network-failure"; + reason: CatalogNetworkFailureReason; + /** + * HTTP status code, when the failure was a rejected response. + */ + statusCode?: number; + /** + * Bounded cooldown in seconds before another catalog request should be attempted, when the authority supplied a numeric Retry-After value or the runtime applied its documented fallback. + */ + retryAfterSeconds?: number; + /** + * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. + */ + message: string; } /** * The candidate is discoverable but cannot be installed. `application/ai-skill` resolves here, because it stays searchable while remaining typed non-installable. @@ -5887,15 +6107,15 @@ export interface CatalogNetworkFailureError { */ /** @experimental */ export interface CatalogNotInstallableError { - /** - * Discriminator: the candidate cannot be installed - */ - kind: "not-installable"; - reason: CatalogNotInstallableReason; - /** - * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: the candidate cannot be installed + */ + kind: "not-installable"; + reason: CatalogNotInstallableReason; + /** + * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. + */ + message: string; } /** * Registry or enterprise policy refused the operation. @@ -5905,15 +6125,15 @@ export interface CatalogNotInstallableError { */ /** @experimental */ export interface CatalogPolicyRejectedError { - /** - * Discriminator: policy refused the operation - */ - kind: "policy-rejected"; - source: McpPlanPolicySource; - /** - * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: policy refused the operation + */ + kind: "policy-rejected"; + source: McpPlanPolicySource; + /** + * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. + */ + message: string; } /** * A bounded catalog search. Both the query length and the result count are capped by the schema so a caller cannot request an unbounded scan. @@ -5923,22 +6143,22 @@ export interface CatalogPolicyRejectedError { */ /** @experimental */ export interface CatalogSearchRequest { - contract: CatalogClientContract; - /** - * Free-text search query. Persisted as tool input for session continuity, but omitted from telemetry. - */ - query: string; - /** - * Maximum number of candidates to return. Defaults to 10 when omitted. - */ - limit?: number; - /** - * Restrict results to these candidate kinds. When omitted, every kind the runtime supports is searched. - * - * @minItems 1 - * @maxItems 2 - */ - kinds?: [CatalogCandidateKind] | [CatalogCandidateKind, CatalogCandidateKind]; + contract: CatalogClientContract; + /** + * Free-text search query. Persisted as tool input for session continuity, but omitted from telemetry. + */ + query: string; + /** + * Maximum number of candidates to return. Defaults to 10 when omitted. + */ + limit?: number; + /** + * Restrict results to these candidate kinds. When omitted, every kind the runtime supports is searched. + * + * @minItems 1 + * @maxItems 2 + */ + kinds?: [CatalogCandidateKind] | [CatalogCandidateKind, CatalogCandidateKind]; } /** * A completed catalog search: inert candidate summaries, each carrying a single-use handle. @@ -5948,25 +6168,25 @@ export interface CatalogSearchRequest { */ /** @experimental */ export interface CatalogSearchSucceeded { - /** - * Discriminator: the search completed - */ - kind: "succeeded"; - /** - * Pseudonymous identifier for this search, issued by the runtime or by the catalog authority it queried and never by the caller, so it cannot be forged or replayed to attribute an install to a search that never happened. Always present on a success, so a result set can be tied to the installs it leads to. It identifies a search rather than a person: it is derived from no user, account, device, or query data, and must never be joined with user identity to re-identify anyone. - */ - searchId: string; - /** - * Matching candidates, never more than the requested limit. All text is inert untrusted data. - * - * @maxItems 50 - */ - candidates: CatalogCandidate[]; - /** - * Whether further matches existed beyond the requested limit. - */ - truncated: boolean; - negotiated: CatalogNegotiatedContract; + /** + * Discriminator: the search completed + */ + kind: "succeeded"; + /** + * Pseudonymous identifier for this search, issued by the runtime or by the catalog authority it queried and never by the caller, so it cannot be forged or replayed to attribute an install to a search that never happened. Always present on a success, so a result set can be tied to the installs it leads to. It identifies a search rather than a person: it is derived from no user, account, device, or query data, and must never be joined with user identity to re-identify anyone. + */ + searchId: string; + /** + * Matching candidates, never more than the requested limit. All text is inert untrusted data. + * + * @maxItems 50 + */ + candidates: CatalogCandidate[]; + /** + * Whether further matches existed beyond the requested limit. + */ + truncated: boolean; + negotiated: CatalogNegotiatedContract; } /** * The request asked for a candidate kind this runtime does not serve. @@ -5976,22 +6196,22 @@ export interface CatalogSearchSucceeded { */ /** @experimental */ export interface CatalogUnsupportedKindError { - /** - * Discriminator: an unsupported candidate kind was requested - */ - kind: "unsupported-kind"; - /** - * The kinds from the request that are not supported. - */ - requestedKinds: CatalogCandidateKind[]; - /** - * Every candidate kind this runtime can serve. - */ - supportedKinds: CatalogCandidateKind[]; - /** - * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: an unsupported candidate kind was requested + */ + kind: "unsupported-kind"; + /** + * The kinds from the request that are not supported. + */ + requestedKinds: CatalogCandidateKind[]; + /** + * Every candidate kind this runtime can serve. + */ + supportedKinds: CatalogCandidateKind[]; + /** + * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. + */ + message: string; } /** * Retrieval was refused by the runtime's hardened fetch boundary before any request left the process, or before a redirect was followed. @@ -6001,15 +6221,15 @@ export interface CatalogUnsupportedKindError { */ /** @experimental */ export interface CatalogUnsafeRetrievalError { - /** - * Discriminator: retrieval was refused as unsafe - */ - kind: "unsafe-retrieval"; - reason: CatalogUnsafeRetrievalReason; - /** - * Human-readable explanation, safe to surface. Never contains the refused URL, nor a query, handle, or secret. - */ - message: string; + /** + * Discriminator: retrieval was refused as unsafe + */ + kind: "unsafe-retrieval"; + reason: CatalogUnsafeRetrievalReason; + /** + * Human-readable explanation, safe to surface. Never contains the refused URL, nor a query, handle, or secret. + */ + message: string; } /** * The operation is not available on this runtime. Distinct from a network failure: nothing was attempted. @@ -6019,15 +6239,15 @@ export interface CatalogUnsafeRetrievalError { */ /** @experimental */ export interface CatalogUnavailableError { - /** - * Discriminator: the operation is not available - */ - kind: "unavailable"; - reason: CatalogUnavailableReason; - /** - * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: the operation is not available + */ + kind: "unavailable"; + reason: CatalogUnavailableReason; + /** + * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. + */ + message: string; } /** * No transport this runtime can use is available for the requested server. @@ -6037,15 +6257,54 @@ export interface CatalogUnavailableError { */ /** @experimental */ export interface CatalogUnavailableTransportError { - /** - * Discriminator: no usable transport is available - */ - kind: "unavailable-transport"; - reason: CatalogUnavailableTransportReason; - /** - * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. - */ - message: string; + /** + * Discriminator: no usable transport is available + */ + kind: "unavailable-transport"; + reason: CatalogUnavailableTransportReason; + /** + * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. + */ + message: string; +} +/** + * Runtime-to-owner cancellation request for a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ClientTaskCancelRequest". + */ +/** @experimental */ +export interface ClientTaskCancelRequest { + /** + * Session that owns the client task + */ + sessionId: string; + /** + * Canonical runtime-generated task identifier + */ + id: string; + /** + * Owner-scoped task key included for correlation + */ + clientTaskId: string; + /** + * Opaque identifier shared by coalesced cancellation callers + */ + cancellationId: string; + reason: ClientTaskCancelReason; +} +/** + * Whether the client authoritatively confirmed its external work stopped. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ClientTaskCancelResult". + */ +/** @experimental */ +export interface ClientTaskCancelResult { + /** + * True only when the owner confirms that external work stopped before responding + */ + cancelled: boolean; } /** * Slash commands available in the session, after applying any include/exclude filters. @@ -6055,10 +6314,10 @@ export interface CatalogUnavailableTransportError { */ /** @experimental */ export interface CommandList { - /** - * Commands available in this session - */ - commands: SlashCommandInfo[]; + /** + * Commands available in this session + */ + commands: SlashCommandInfo[]; } /** * Slash-command metadata with name, aliases, description, kind, input hint, execution allowance, and schedulability. @@ -6068,32 +6327,32 @@ export interface CommandList { */ /** @experimental */ export interface SlashCommandInfo { - /** - * Canonical command name without a leading slash - */ - name: string; - /** - * Canonical aliases without leading slashes - */ - aliases?: string[]; - /** - * Human-readable command description - */ - description: string; - kind: SlashCommandKind; - input?: SlashCommandInput; - /** - * Whether the command may run while an agent turn is active - */ - allowDuringAgentExecution: boolean; - /** - * Whether the command is experimental - */ - experimental?: boolean; - /** - * Whether the command may be the target of `/every` / `/after` schedules. Resolution happens at every tick, so only set this when the command is safe to re-invoke and produces an agent prompt. - */ - schedulable?: boolean; + /** + * Canonical command name without a leading slash + */ + name: string; + /** + * Canonical aliases without leading slashes + */ + aliases?: string[]; + /** + * Human-readable command description + */ + description: string; + kind: SlashCommandKind; + input?: SlashCommandInput; + /** + * Whether the command may run while an agent turn is active + */ + allowDuringAgentExecution: boolean; + /** + * Whether the command is experimental + */ + experimental?: boolean; + /** + * Whether the command may be the target of `/every` / `/after` schedules. Resolution happens at every tick, so only set this when the command is safe to re-invoke and produces an agent prompt. + */ + schedulable?: boolean; } /** * Optional unstructured input hint @@ -6103,23 +6362,23 @@ export interface SlashCommandInfo { */ /** @experimental */ export interface SlashCommandInput { - /** - * Hint to display when command input has not been provided - */ - hint: string; - /** - * Optional literal choices the input accepts, each with a human-facing description; clients may render these as selectable options - */ - choices?: SlashCommandInputChoice[]; - /** - * When true, the command requires non-empty input; clients should render the input hint as required - */ - required?: boolean; - completion?: SlashCommandInputCompletion; - /** - * When true, clients should pass the full text after the command name as a single argument rather than splitting on whitespace - */ - preserveMultilineInput?: boolean; + /** + * Hint to display when command input has not been provided + */ + hint: string; + /** + * Optional literal choices the input accepts, each with a human-facing description; clients may render these as selectable options + */ + choices?: SlashCommandInputChoice[]; + /** + * When true, the command requires non-empty input; clients should render the input hint as required + */ + required?: boolean; + completion?: SlashCommandInputCompletion; + /** + * When true, clients should pass the full text after the command name as a single argument rather than splitting on whitespace + */ + preserveMultilineInput?: boolean; } /** * A literal choice the command input accepts, with a human-facing description @@ -6129,14 +6388,14 @@ export interface SlashCommandInput { */ /** @experimental */ export interface SlashCommandInputChoice { - /** - * The literal choice value (e.g. 'on', 'off', 'show') - */ - name: string; - /** - * Human-readable description shown alongside the choice - */ - description: string; + /** + * The literal choice value (e.g. 'on', 'off', 'show') + */ + name: string; + /** + * Human-readable description shown alongside the choice + */ + description: string; } /** * The pending slash-command invocation effect to finalize, plus whether the host applied or cancelled it. @@ -6146,11 +6405,11 @@ export interface SlashCommandInputChoice { */ /** @experimental */ export interface CommandsFinalizeInvocationEffectRequest { - /** - * The slash-command result object that produced the pending effect, echoed back unchanged. - */ - effect: {}; - outcome: CommandsInvocationEffectOutcome; + /** + * The slash-command result object that produced the pending effect, echoed back unchanged. + */ + effect: {}; + outcome: CommandsInvocationEffectOutcome; } /** * Whether finalizing the invocation effect succeeded, and the failure reason when it did not. @@ -6160,14 +6419,14 @@ export interface CommandsFinalizeInvocationEffectRequest { */ /** @experimental */ export interface CommandsFinalizeInvocationEffectResult { - /** - * Whether the pending invocation effect was finalized successfully. - */ - success: boolean; - /** - * Failure reason when the invocation effect could not be finalized. - */ - error?: string; + /** + * Whether the pending invocation effect was finalized successfully. + */ + success: boolean; + /** + * Failure reason when the invocation effect could not be finalized. + */ + error?: string; } /** * Pending command request ID and an optional error if the client handler failed. @@ -6177,14 +6436,14 @@ export interface CommandsFinalizeInvocationEffectResult { */ /** @experimental */ export interface CommandsHandlePendingCommandRequest { - /** - * Request ID from the command invocation event - */ - requestId: string; - /** - * Error message if the command handler failed - */ - error?: string; + /** + * Request ID from the command invocation event + */ + requestId: string; + /** + * Error message if the command handler failed + */ + error?: string; } /** * Indicates whether the pending client-handled command was completed successfully. @@ -6194,10 +6453,10 @@ export interface CommandsHandlePendingCommandRequest { */ /** @experimental */ export interface CommandsHandlePendingCommandResult { - /** - * Whether the command was handled successfully - */ - success: boolean; + /** + * Whether the command was handled successfully + */ + success: boolean; } /** * Slash command name and optional raw input string to invoke. @@ -6207,15 +6466,15 @@ export interface CommandsHandlePendingCommandResult { */ /** @experimental */ export interface CommandsInvokeRequest { - /** - * Command name. Leading slashes are stripped and the name is matched case-insensitively. - */ - name: string; - /** - * Raw input after the command name - */ - input?: string; - origin?: CommandsInvocationOrigin; + /** + * Command name. Leading slashes are stripped and the name is matched case-insensitively. + */ + name: string; + /** + * Raw input after the command name + */ + input?: string; + origin?: CommandsInvocationOrigin; } /** * Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands). @@ -6225,11 +6484,11 @@ export interface CommandsInvokeRequest { */ /** @experimental */ export interface CommandsRespondToQueuedCommandRequest { - /** - * Request ID from the `command.queued` event the host is responding to. - */ - requestId: string; - result: QueuedCommandResult; + /** + * Request ID from the `command.queued` event the host is responding to. + */ + requestId: string; + result: QueuedCommandResult; } /** * Queued-command response indicating the host executed the command, with an optional flag to stop queue processing. @@ -6239,14 +6498,14 @@ export interface CommandsRespondToQueuedCommandRequest { */ /** @experimental */ export interface QueuedCommandHandled { - /** - * The host actually executed the queued command. - */ - handled: true; - /** - * When true, the runtime will not process subsequent queued commands until a new request comes in. - */ - stopProcessingQueue?: boolean; + /** + * The host actually executed the queued command. + */ + handled: true; + /** + * When true, the runtime will not process subsequent queued commands until a new request comes in. + */ + stopProcessingQueue?: boolean; } /** * Queued-command response indicating the host did not execute the command and the queue may continue. @@ -6256,10 +6515,10 @@ export interface QueuedCommandHandled { */ /** @experimental */ export interface QueuedCommandNotHandled { - /** - * The host did not execute the queued command. Unblocks the queue without claiming the command was processed (e.g. when the handler threw before completing). - */ - handled: false; + /** + * The host did not execute the queued command. Unblocks the queue without claiming the command was processed (e.g. when the handler threw before completing). + */ + handled: false; } /** * Indicates whether the queued-command response was matched to a pending request. @@ -6269,10 +6528,10 @@ export interface QueuedCommandNotHandled { */ /** @experimental */ export interface CommandsRespondToQueuedCommandResult { - /** - * Whether a pending queued command with the given request ID was found and resolved. False when the request was already resolved, cancelled, or unknown. - */ - success: boolean; + /** + * Whether a pending queued command with the given request ID was found and resolved. False when the request was already resolved, cancelled, or unknown. + */ + success: boolean; } /** * Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). @@ -6282,10 +6541,10 @@ export interface CommandsRespondToQueuedCommandResult { */ /** @experimental */ export interface CompletionsGetTriggerCharactersResult { - /** - * Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven completions for the session. - */ - triggerCharacters: string[]; + /** + * Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven completions for the session. + */ + triggerCharacters: string[]; } /** * Request host-driven completions for the current composer input. @@ -6295,14 +6554,14 @@ export interface CompletionsGetTriggerCharactersResult { */ /** @experimental */ export interface CompletionsRequestRequest { - /** - * The full composed composer input. - */ - text: string; - /** - * Cursor offset within `text`, in UTF-16 code units. - */ - offset: number; + /** + * The full composed composer input. + */ + text: string; + /** + * Cursor offset within `text`, in UTF-16 code units. + */ + offset: number; } /** * Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. @@ -6312,10 +6571,10 @@ export interface CompletionsRequestRequest { */ /** @experimental */ export interface CompletionsRequestResult { - /** - * Completion items in host-ranked order. - */ - items: SessionCompletionItem[]; + /** + * Completion items in host-ranked order. + */ + items: SessionCompletionItem[]; } /** * A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced. @@ -6325,26 +6584,26 @@ export interface CompletionsRequestResult { */ /** @experimental */ export interface SessionCompletionItem { - /** - * Text spliced into the composer when the item is accepted. - */ - insertText: string; - /** - * Start of the replacement range in `text`, in UTF-16 code units. - */ - rangeStart?: number; - /** - * End (exclusive) of the replacement range in `text`, in UTF-16 code units. - */ - rangeEnd?: number; - /** - * Primary display label for the picker row. Falls back to `insertText` when absent. - */ - label?: string; - /** - * Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the host's display kind. - */ - kind?: string; + /** + * Text spliced into the composer when the item is accepted. + */ + insertText: string; + /** + * Start of the replacement range in `text`, in UTF-16 code units. + */ + rangeStart?: number; + /** + * End (exclusive) of the replacement range in `text`, in UTF-16 code units. + */ + rangeEnd?: number; + /** + * Primary display label for the picker row. Falls back to `insertText` when absent. + */ + label?: string; + /** + * Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the host's display kind. + */ + kind?: string; } /** * Params to attach or detach an in-process ExtensionController delegate. @@ -6355,18 +6614,18 @@ export interface SessionCompletionItem { /** @experimental */ /** @internal */ export interface ConfigureSessionExtensionsParams { - /** - * Session to attach the extension controller delegate to. - */ - sessionId: string; - /** - * 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. - * - * @internal - * - * @internal - */ - controller?: OpaqueInProcessValue; + /** + * Session to attach the extension controller delegate to. + */ + sessionId: string; + /** + * 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. + * + * @internal + * + * @internal + */ + controller?: OpaqueInProcessValue; } /** * Identity of the integrating host, declared once on the `server.connect` handshake so telemetry from this connection is attributed to a single, consistent surface. All fields are optional; omit them to keep the default attribution. @@ -6377,22 +6636,22 @@ export interface ConfigureSessionExtensionsParams { /** @experimental */ /** @internal */ export interface ConnectClientInfo { - /** - * Name of the host editor, e.g. `"vscode"`. - */ - editorName?: string; - /** - * Version of the host editor, e.g. `"1.124.2"`. Ignored unless it looks like a version string. - */ - editorVersion?: string; - /** - * Name of the Copilot extension within the host, e.g. `"copilot-chat"`. - */ - extensionName?: string; - /** - * Version of the Copilot extension within the host, e.g. `"0.54.0"`. Ignored unless it looks like a version string. - */ - extensionVersion?: string; + /** + * Name of the host editor, e.g. `"vscode"`. + */ + editorName?: string; + /** + * Version of the host editor, e.g. `"1.124.2"`. Ignored unless it looks like a version string. + */ + editorVersion?: string; + /** + * Name of the Copilot extension within the host, e.g. `"copilot-chat"`. + */ + extensionName?: string; + /** + * Version of the Copilot extension within the host, e.g. `"0.54.0"`. Ignored unless it looks like a version string. + */ + extensionVersion?: string; } /** * Metadata for a connected remote session. @@ -6402,44 +6661,44 @@ export interface ConnectClientInfo { */ /** @experimental */ export interface ConnectedRemoteSessionMetadata { - /** - * SDK session ID for the connected remote session. - */ - sessionId: string; - /** - * Optional friendly session name. - */ - name?: string; - /** - * Optional session summary. - */ - summary?: string; - /** - * Session start time as an ISO 8601 string. - */ - startTime: string; - /** - * Last session update time as an ISO 8601 string. - */ - modifiedTime: string; - repository: ConnectedRemoteSessionMetadataRepository; - /** - * Pull request number associated with the session. - */ - pullRequestNumber?: number; - /** - * Original remote resource identifier. - */ - resourceId?: string; - kind: ConnectedRemoteSessionMetadataKind; - /** - * Remote session staleness deadline as an ISO 8601 string. - */ - staleAt?: string; - /** - * Remote session state returned by the backing service. - */ - state?: string; + /** + * SDK session ID for the connected remote session. + */ + sessionId: string; + /** + * Optional friendly session name. + */ + name?: string; + /** + * Optional session summary. + */ + summary?: string; + /** + * Session start time as an ISO 8601 string. + */ + startTime: string; + /** + * Last session update time as an ISO 8601 string. + */ + modifiedTime: string; + repository: ConnectedRemoteSessionMetadataRepository; + /** + * Pull request number associated with the session. + */ + pullRequestNumber?: number; + /** + * Original remote resource identifier. + */ + resourceId?: string; + kind: ConnectedRemoteSessionMetadataKind; + /** + * Remote session staleness deadline as an ISO 8601 string. + */ + staleAt?: string; + /** + * Remote session state returned by the backing service. + */ + state?: string; } /** * Repository associated with the connected remote session. @@ -6449,18 +6708,18 @@ export interface ConnectedRemoteSessionMetadata { */ /** @experimental */ export interface ConnectedRemoteSessionMetadataRepository { - /** - * Repository owner or organization login. - */ - owner: string; - /** - * Repository name. - */ - name: string; - /** - * Branch associated with the remote session. - */ - branch: string; + /** + * Repository owner or organization login. + */ + owner: string; + /** + * Repository name. + */ + name: string; + /** + * Branch associated with the remote session. + */ + branch: string; } /** * Remote session connection parameters. @@ -6470,10 +6729,10 @@ export interface ConnectedRemoteSessionMetadataRepository { */ /** @experimental */ export interface ConnectRemoteSessionParams { - /** - * Session ID to connect to. - */ - sessionId: string; + /** + * Session ID to connect to. + */ + sessionId: string; } /** * Connection-level opt-ins for the `server.connect` handshake. Transport authentication is consumed by the native protocol boundary before dispatch. @@ -6484,15 +6743,19 @@ export interface ConnectRemoteSessionParams { /** @experimental */ /** @internal */ export interface ConnectRequest { - /** - * Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events. - */ - enableGitHubTelemetryForwarding?: boolean; - clientInfo?: ConnectClientInfo; - /** - * Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN - */ - token?: string; + /** + * Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events. + */ + enableGitHubTelemetryForwarding?: boolean; + clientInfo?: ConnectClientInfo; + /** + * Task kinds this connection can decode when observing session tasks. Omit to retain agent and shell compatibility. + */ + supportedTaskKinds?: TaskKind[]; + /** + * Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN + */ + token?: string; } /** * Handshake result reporting the server's protocol version and package version on success. @@ -6503,18 +6766,22 @@ export interface ConnectRequest { /** @experimental */ /** @internal */ export interface ConnectResult { - /** - * Always true on success - */ - ok: true; - /** - * Server protocol version number - */ - protocolVersion: number; - /** - * Server package version - */ - version: string; + /** + * Always true on success + */ + ok: true; + /** + * Server protocol version number + */ + protocolVersion: number; + /** + * Server package version + */ + version: string; + /** + * Task kinds the server may return to this connection. + */ + taskKinds?: TaskKind[]; } /** * Local file system absolute paths within the session working directory to check against its content-exclusion policy. @@ -6524,10 +6791,10 @@ export interface ConnectResult { */ /** @experimental */ export interface ContentExclusionCheckPathsRequest { - /** - * Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates. - */ - paths: string[]; + /** + * Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates. + */ + paths: string[]; } /** * Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable. @@ -6537,14 +6804,14 @@ export interface ContentExclusionCheckPathsRequest { */ /** @experimental */ export interface ContentExclusionCheckPathsResult { - /** - * Whether the session's policy service was available for the complete batch. When false, checks is empty and callers must treat every requested path as excluded. - */ - available: boolean; - /** - * Per-path decisions in request order. Empty when available is false. - */ - checks: ContentExclusionPathCheck[]; + /** + * Whether the session's policy service was available for the complete batch. When false, checks is empty and callers must treat every requested path as excluded. + */ + available: boolean; + /** + * Per-path decisions in request order. Empty when available is false. + */ + checks: ContentExclusionPathCheck[]; } /** * Content-exclusion decision for one requested path. @@ -6554,14 +6821,14 @@ export interface ContentExclusionCheckPathsResult { */ /** @experimental */ export interface ContentExclusionPathCheck { - /** - * The path supplied by the caller. - */ - path: string; - /** - * Whether the session's complete content-exclusion policy excludes the path. - */ - excluded: boolean; + /** + * The path supplied by the caller. + */ + path: string; + /** + * Whether the session's complete content-exclusion policy excludes the path. + */ + excluded: boolean; } /** * A single large message currently in context. @@ -6571,40 +6838,49 @@ export interface ContentExclusionPathCheck { */ /** @experimental */ export interface ContextHeaviestMessage { - /** - * Stable identifier for this message within the snapshot. - */ - id: string; - /** - * Human-readable source label, e.g. `tool: bash` or `skill: tmux`. Presentation-only. - */ - label: string; - /** - * Role of the chat message (`user`, `assistant`, or `tool`). - */ - role: string; - /** - * Token count currently in context for this individual message. - */ - tokens: number; -} -/** - * The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + /** + * Stable identifier for this message within the snapshot. + */ + id: string; + /** + * Human-readable source label, e.g. `tool: bash` or `skill: tmux`. Presentation-only. + */ + label: string; + /** + * Role of the chat message (`user`, `assistant`, or `tool`). + */ + role: string; + /** + * Token count currently in context for this individual message. + */ + tokens: number; +} +/** + * The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "CurrentModel". */ /** @experimental */ export interface CurrentModel { - /** - * Currently active model identifier - */ - modelId?: string; - /** - * Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. - */ - reasoningEffort?: string; - contextTier?: ContextTier; + /** + * Currently active model identifier + */ + modelId?: string; + /** + * Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. + */ + reasoningEffort?: string; + contextTier?: ContextTier; + autoTier?: AutoTier; + /** + * Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. + */ + pendingAutoTier?: AutoTier | null; + /** + * Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + */ + activatingAutoTier?: AutoTier | null; } /** * Lightweight metadata for a currently initialized session tool @@ -6614,36 +6890,36 @@ export interface CurrentModel { */ /** @experimental */ export interface CurrentToolMetadata { - /** - * Model-facing tool name - */ - name: string; - /** - * Optional MCP/config namespaced tool name - */ - namespacedName?: string; - /** - * MCP server name for MCP-backed tools - */ - mcpServerName?: string; - /** - * Raw MCP tool name for MCP-backed tools - */ - mcpToolName?: string; - /** - * Tool description - */ - description: string; - /** - * JSON Schema for tool input - */ - input_schema?: { - [k: string]: JsonValue | undefined; - }; - /** - * Whether the tool is loaded on demand via tool search - */ - deferLoading?: boolean; + /** + * Model-facing tool name + */ + name: string; + /** + * Optional MCP/config namespaced tool name + */ + namespacedName?: string; + /** + * MCP server name for MCP-backed tools + */ + mcpServerName?: string; + /** + * Raw MCP tool name for MCP-backed tools + */ + mcpToolName?: string; + /** + * Tool description + */ + description: string; + /** + * JSON Schema for tool input + */ + input_schema?: { + [k: string]: JsonValue | undefined; + }; + /** + * Whether the tool is loaded on demand via tool search + */ + deferLoading?: boolean; } /** * A file included in the redacted debug bundle. @@ -6653,15 +6929,15 @@ export interface CurrentToolMetadata { */ /** @experimental */ export interface DebugCollectLogsCollectedEntry { - /** - * Relative path of the file in the staged bundle/archive. - */ - bundlePath: string; - source: DebugCollectLogsSource; - /** - * Redacted output size in bytes. - */ - sizeBytes: number; + /** + * Relative path of the file in the staged bundle/archive. + */ + bundlePath: string; + source: DebugCollectLogsSource; + /** + * Redacted output size in bytes. + */ + sizeBytes: number; } /** * A caller-provided server-local file or directory to include in the debug bundle. @@ -6671,20 +6947,20 @@ export interface DebugCollectLogsCollectedEntry { */ /** @experimental */ export interface DebugCollectLogsEntry { - kind: DebugCollectLogsEntryKind; - /** - * Server-local source path to read. - */ - path: string; - /** - * Relative path to use inside the staged bundle/archive. - */ - bundlePath: string; - redaction?: DebugCollectLogsRedaction; - /** - * When true, collection fails if this entry cannot be read. Defaults to false, which records the entry in `skippedEntries`. - */ - required?: boolean; + kind: DebugCollectLogsEntryKind; + /** + * Server-local source path to read. + */ + path: string; + /** + * Relative path to use inside the staged bundle/archive. + */ + bundlePath: string; + redaction?: DebugCollectLogsRedaction; + /** + * When true, collection fails if this entry cannot be read. Defaults to false, which records the entry in `skippedEntries`. + */ + required?: boolean; } /** * Built-in session diagnostics to include in the bundle. Omitted fields default to true. @@ -6694,34 +6970,34 @@ export interface DebugCollectLogsEntry { */ /** @experimental */ export interface DebugCollectLogsInclude { - /** - * Include the session event log (`events.jsonl`). Defaults to true. - */ - events?: boolean; - /** - * Include process logs for the session. Defaults to true. - */ - processLogs?: boolean; - /** - * Include interactive shell logs written under the session's `shell-logs` directory. Defaults to true. - */ - shellLogs?: boolean; - /** - * Server-local path to the session's events.jsonl file. Internal callers normally omit this and let the runtime derive it from the session. - */ - eventsPath?: string; - /** - * Server-local path to the current process log. When set, it is included as `process.log` and its directory is searched for prior logs from the same session. - */ - currentProcessLogPath?: string; - /** - * Server-local process log directory to search when `currentProcessLogPath` is unavailable, useful for collecting logs for inactive sessions. - */ - processLogDirectory?: string; - /** - * Maximum number of previous process logs to include. Defaults to 5. - */ - previousProcessLogLimit?: number; + /** + * Include the session event log (`events.jsonl`). Defaults to true. + */ + events?: boolean; + /** + * Include process logs for the session. Defaults to true. + */ + processLogs?: boolean; + /** + * Include interactive shell logs written under the session's `shell-logs` directory. Defaults to true. + */ + shellLogs?: boolean; + /** + * Server-local path to the session's events.jsonl file. Internal callers normally omit this and let the runtime derive it from the session. + */ + eventsPath?: string; + /** + * Server-local path to the current process log. When set, it is included as `process.log` and its directory is searched for prior logs from the same session. + */ + currentProcessLogPath?: string; + /** + * Server-local process log directory to search when `currentProcessLogPath` is unavailable, useful for collecting logs for inactive sessions. + */ + processLogDirectory?: string; + /** + * Maximum number of previous process logs to include. Defaults to 5. + */ + previousProcessLogLimit?: number; } /** * Options for collecting a redacted session debug bundle. @@ -6731,12 +7007,12 @@ export interface DebugCollectLogsInclude { */ /** @experimental */ export interface DebugCollectLogsRequest { - destination: DebugCollectLogsDestination; - include?: DebugCollectLogsInclude; - /** - * Caller-provided server-local files or directories to include in addition to the runtime's built-in session diagnostics. This lets host applications add their own diagnostics without changing the API shape. - */ - additionalEntries?: DebugCollectLogsEntry[]; + destination: DebugCollectLogsDestination; + include?: DebugCollectLogsInclude; + /** + * Caller-provided server-local files or directories to include in addition to the runtime's built-in session diagnostics. This lets host applications add their own diagnostics without changing the API shape. + */ + additionalEntries?: DebugCollectLogsEntry[]; } /** * Result of collecting a redacted debug bundle. @@ -6746,19 +7022,19 @@ export interface DebugCollectLogsRequest { */ /** @experimental */ export interface DebugCollectLogsResult { - kind: DebugCollectLogsResultKind; - /** - * Actual archive path or staging directory path written. This may differ from the requested path when no-overwrite suffixing or fallback-to-temp-directory was needed. - */ - path: string; - /** - * Files included in the redacted bundle. - */ - entries: DebugCollectLogsCollectedEntry[]; - /** - * Optional files or directories that could not be included. - */ - skippedEntries?: DebugCollectLogsSkippedEntry[]; + kind: DebugCollectLogsResultKind; + /** + * Actual archive path or staging directory path written. This may differ from the requested path when no-overwrite suffixing or fallback-to-temp-directory was needed. + */ + path: string; + /** + * Files included in the redacted bundle. + */ + entries: DebugCollectLogsCollectedEntry[]; + /** + * Optional files or directories that could not be included. + */ + skippedEntries?: DebugCollectLogsSkippedEntry[]; } /** * An optional debug bundle entry that could not be included. @@ -6768,18 +7044,18 @@ export interface DebugCollectLogsResult { */ /** @experimental */ export interface DebugCollectLogsSkippedEntry { - /** - * Relative path requested for this bundle entry. - */ - bundlePath: string; - /** - * Server-local source path that could not be read. - */ - path?: string; - /** - * Reason the entry was skipped. - */ - reason: string; + /** + * Relative path requested for this bundle entry. + */ + bundlePath: string; + /** + * Server-local source path that could not be read. + */ + path?: string; + /** + * Reason the entry was skipped. + */ + reason: string; } /** * Discovered extension metadata and persistent enablement state. @@ -6789,24 +7065,24 @@ export interface DebugCollectLogsSkippedEntry { */ /** @experimental */ export interface DiscoveredExtension { - /** - * Source-qualified ID accepted by both server and session extension enablement methods - */ - id: string; - /** - * Human-readable extension name - */ - name: string; - /** - * Absolute path to the extension entry module, suitable for revealing it in a file manager - */ - path: string; - source: DiscoveredExtensionSource; - /** - * Whether this extension's persistent per-ID preference is enabled - */ - enabled: boolean; - plugin?: DiscoveredExtensionPlugin; + /** + * Source-qualified ID accepted by both server and session extension enablement methods + */ + id: string; + /** + * Human-readable extension name + */ + name: string; + /** + * Absolute path to the extension entry module, suitable for revealing it in a file manager + */ + path: string; + source: DiscoveredExtensionSource; + /** + * Whether this extension's persistent per-ID preference is enabled + */ + enabled: boolean; + plugin?: DiscoveredExtensionPlugin; } /** * Installed plugin that contributes a discovered extension. @@ -6816,10 +7092,10 @@ export interface DiscoveredExtension { */ /** @experimental */ export interface DiscoveredExtensionPlugin { - /** - * Installed plugin name - */ - name: string; + /** + * Installed plugin name + */ + name: string; } /** * Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included. @@ -6829,11 +7105,11 @@ export interface DiscoveredExtensionPlugin { */ /** @experimental */ export interface DiscoveredExtensions { - /** - * Discovered user and enabled installed-plugin extensions from persisted Copilot home state - */ - extensions: DiscoveredExtension[]; - mode: DiscoveredExtensionMode; + /** + * Discovered user and enabled installed-plugin extensions from persisted Copilot home state + */ + extensions: DiscoveredExtension[]; + mode: DiscoveredExtensionMode; } /** * Source-qualified extension identifiers to persistently disable for future sessions. @@ -6843,10 +7119,10 @@ export interface DiscoveredExtensions { */ /** @experimental */ export interface DiscoveredExtensionsDisableRequest { - /** - * Source-qualified user or plugin extension IDs to disable - */ - ids: string[]; + /** + * Source-qualified user or plugin extension IDs to disable + */ + ids: string[]; } /** * Source-qualified extension identifiers to persistently enable for future sessions. @@ -6856,10 +7132,10 @@ export interface DiscoveredExtensionsDisableRequest { */ /** @experimental */ export interface DiscoveredExtensionsEnableRequest { - /** - * Source-qualified user or plugin extension IDs to enable - */ - ids: string[]; + /** + * Source-qualified user or plugin extension IDs to enable + */ + ids: string[]; } /** * One server-discovered hook action from user, repository, plugin, or managed-policy configuration. @@ -6869,28 +7145,28 @@ export interface DiscoveredExtensionsEnableRequest { */ /** @experimental */ export interface DiscoveredHook { - /** - * Deterministic identifier for this server-discovered action row. It remains stable while the project, origin, source, event, action content, and duplicate ordinal are unchanged. This is row identity, not the key persisted in disabledHooks. - */ - id: string; - hookType: HookType; - origin: HookOrigin; - /** - * Human-readable source label, such as a hook file path, settings source, or plugin name. - */ - source?: string; - /** - * Input project path for which this server-side action was resolved. Set on every row returned for project-scoped discovery, including repeated user and policy actions. - */ - projectPath?: string; - /** - * Whether this action is enabled under the server-side discovery settings. Concrete sessions may differ because they can add session-specific directories, plugins, or trust. False when its disable key is present in the user's disabled-hooks setting or disable-all settings suppress the action. - */ - enabled: boolean; - /** - * Durable content hash used by hook enablement. Identical actions may intentionally share this key. Omitted when changing the user's disabled-hooks setting cannot change the action's current server-discovered state, including managed-policy hooks, session-start prompt actions, actions suppressed by disable-all settings, and projectless plugin actions that require project-directory expansion. - */ - disableKey?: string; + /** + * Deterministic identifier for this server-discovered action row. It remains stable while the project, origin, source, event, action content, and duplicate ordinal are unchanged. This is row identity, not the key persisted in disabledHooks. + */ + id: string; + hookType: HookType; + origin: HookOrigin; + /** + * Human-readable source label, such as a hook file path, settings source, or plugin name. + */ + source?: string; + /** + * Input project path for which this server-side action was resolved. Set on every row returned for project-scoped discovery, including repeated user and policy actions. + */ + projectPath?: string; + /** + * Whether this action is enabled under the server-side discovery settings. Concrete sessions may differ because they can add session-specific directories, plugins, or trust. False when its disable key is present in the user's disabled-hooks setting or disable-all settings suppress the action. + */ + enabled: boolean; + /** + * Durable content hash used by hook enablement. Identical actions may intentionally share this key. Omitted when changing the user's disabled-hooks setting cannot change the action's current server-discovered state, including managed-policy hooks, session-start prompt actions, actions suppressed by disable-all settings, and projectless plugin actions that require project-directory expansion. + */ + disableKey?: string; } /** * MCP server discovered by `mcp.discover`, with config source, optional plugin source, transport type, and enabled state. @@ -6900,24 +7176,24 @@ export interface DiscoveredHook { */ /** @experimental */ export interface DiscoveredMcpServer { - /** - * Server name (config key) - */ - name: string; - type?: DiscoveredMcpServerType; - source: McpServerSource; - /** - * Plugin name that provided this server, when source is plugin. - */ - sourcePlugin?: string; - /** - * Plugin version that provided this server, when source is plugin. - */ - sourcePluginVersion?: string; - /** - * Whether the server is enabled (not in the disabled list) - */ - enabled: boolean; + /** + * Server name (config key) + */ + name: string; + type?: DiscoveredMcpServerType; + source: McpServerSource; + /** + * Plugin name that provided this server, when source is plugin. + */ + sourcePlugin?: string; + /** + * Plugin version that provided this server, when source is plugin. + */ + sourcePluginVersion?: string; + /** + * Whether the server is enabled (not in the disabled list) + */ + enabled: boolean; } /** * Slash-prefixed command string to enqueue for FIFO processing. @@ -6927,14 +7203,14 @@ export interface DiscoveredMcpServer { */ /** @experimental */ export interface EnqueueCommandParams { - /** - * Slash-prefixed command string to enqueue, e.g. '/compact' or '/model gpt-4'. Queued FIFO with any in-flight items; if the session is idle, processing kicks off immediately. - */ - command: string; - /** - * Optional user-facing text for the queue row. The command string is shown when omitted. - */ - displayText?: string | null; + /** + * Slash-prefixed command string to enqueue, e.g. '/compact' or '/model gpt-4'. Queued FIFO with any in-flight items; if the session is idle, processing kicks off immediately. + */ + command: string; + /** + * Optional user-facing text for the queue row. The command string is shown when omitted. + */ + displayText?: string | null; } /** * Indicates whether the command was accepted into the local execution queue. @@ -6944,10 +7220,10 @@ export interface EnqueueCommandParams { */ /** @experimental */ export interface EnqueueCommandResult { - /** - * True when the command was accepted into the local execution queue. False when the call targets a session that does not support local command queueing (e.g. remote sessions). - */ - queued: boolean; + /** + * True when the command was accepted into the local execution queue. False when the call targets a session that does not support local command queueing (e.g. remote sessions). + */ + queued: boolean; } /** * Cursor, batch size, and optional long-poll/filter parameters for reading session events. @@ -6957,31 +7233,31 @@ export interface EnqueueCommandResult { */ /** @experimental */ export interface EventLogReadRequest { - /** - * Opaque cursor returned by a previous read. Omit on the first call to start from the beginning of the session's persisted history. - */ - cursor?: string; - /** - * Maximum number of events to return in this batch (1–1000, default 200). - */ - max?: number; - /** - * 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). This applies to forward reads only: a backward read always returns immediately and ignores `waitMs`, because backward paging covers persisted history only while new events append at the tail (the opposite end from a backward page), so no blocking or ephemeral delivery can occur. - */ - waitMs?: number; - types?: EventLogTypes; - agentScope?: EventsAgentScope; - /** - * Optional non-empty list of subagent identifiers. When provided, only events owned by one of these agents are returned; ownership recognizes the event envelope's agentId plus legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over agentScope. - * - * @minItems 1 - */ - agentIds?: [string, ...string[]]; - direction?: EventsReadDirection; - /** - * When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). Ignored by backward reads, which always cover persisted history only. - */ - includeEphemeral?: boolean; + /** + * Opaque cursor returned by a previous read. Omit on the first call to start from the beginning of the session's persisted history. + */ + cursor?: string; + /** + * Maximum number of events to return in this batch (1–1000, default 200). + */ + max?: number; + /** + * 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). This applies to forward reads only: a backward read always returns immediately and ignores `waitMs`, because backward paging covers persisted history only while new events append at the tail (the opposite end from a backward page), so no blocking or ephemeral delivery can occur. + */ + waitMs?: number; + types?: EventLogTypes; + agentScope?: EventsAgentScope; + /** + * Optional non-empty list of subagent identifiers. When provided, only events owned by one of these agents are returned; ownership recognizes the event envelope's agentId plus legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over agentScope. + * + * @minItems 1 + */ + agentIds?: [string, ...string[]]; + direction?: EventsReadDirection; + /** + * When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). Ignored by backward reads, which always cover persisted history only. + */ + includeEphemeral?: boolean; } /** * Indicates whether the operation succeeded. @@ -6991,10 +7267,10 @@ export interface EventLogReadRequest { */ /** @experimental */ export interface EventLogReleaseInterestResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * Snapshot of the current tail cursor without returning any events. Use this when a consumer wants to subscribe to live events going forward without first paginating through the entire persisted history (which would happen if `read` were called without a cursor on a long-lived session). @@ -7004,10 +7280,10 @@ export interface EventLogReleaseInterestResult { */ /** @experimental */ export interface EventLogTailResult { - /** - * Opaque cursor pointing at the current tail of the session's persisted-events history. Pass back to `read` to receive only events that arrive AFTER this snapshot. When the session has no events, this returns the same sentinel as an unset cursor (i.e. equivalent to omitting the cursor on a first read). - */ - cursor: string; + /** + * Opaque cursor pointing at the current tail of the session's persisted-events history. Pass back to `read` to receive only events that arrive AFTER this snapshot. When the session has no events, this returns the same sentinel as an unset cursor (i.e. equivalent to omitting the cursor on a first read). + */ + cursor: string; } /** * Batch of session events returned by a read, with cursor and continuation metadata. @@ -7017,19 +7293,19 @@ export interface EventLogTailResult { */ /** @experimental */ export interface EventsReadResult { - /** - * Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window contains persisted events only, still in chronological (oldest-to-newest) append order. - */ - events: SessionEvent[]; - /** - * Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. For a backward read this cursor pages toward OLDER events; keep passing `direction: backward` with it (the cursor is also self-describing, so backward paging continues correctly). - */ - cursor: string; - /** - * True when more events are available in the read's direction. For a forward read, true means the batch returned `max` events and more are available immediately. For a backward read, true means older persisted events remain before the returned window. - */ - hasMore: boolean; - cursorStatus: EventsCursorStatus; + /** + * Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window contains persisted events only, still in chronological (oldest-to-newest) append order. + */ + events: SessionEvent[]; + /** + * Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. For a backward read this cursor pages toward OLDER events; keep passing `direction: backward` with it (the cursor is also self-describing, so backward paging continues correctly). + */ + cursor: string; + /** + * True when more events are available in the read's direction. For a forward read, true means the batch returned `max` events and more are available immediately. For a backward read, true means older persisted events remain before the returned window. + */ + hasMore: boolean; + cursorStatus: EventsCursorStatus; } /** * Slash command name and argument string to execute synchronously. @@ -7039,14 +7315,14 @@ export interface EventsReadResult { */ /** @experimental */ export interface ExecuteCommandParams { - /** - * Name of the slash command to invoke (without the leading '/'). - */ - commandName: string; - /** - * Argument string to pass to the command (empty string if none). - */ - args: string; + /** + * Name of the slash command to invoke (without the leading '/'). + */ + commandName: string; + /** + * Argument string to pass to the command (empty string if none). + */ + args: string; } /** * Error message produced while executing the command, if any. @@ -7056,10 +7332,10 @@ export interface ExecuteCommandParams { */ /** @experimental */ export interface ExecuteCommandResult { - /** - * Error message produced while executing the command, if any. Omitted when the handler succeeded. - */ - error?: string; + /** + * Error message produced while executing the command, if any. Omitted when the handler succeeded. + */ + error?: string; } /** * Discovered extension metadata, including source-qualified ID, name, discovery source, status, and optional process ID. @@ -7069,20 +7345,20 @@ export interface ExecuteCommandResult { */ /** @experimental */ export interface Extension { - /** - * Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper', 'plugin:my-plugin:my-ext') - */ - id: string; - /** - * Extension name (directory name) - */ - name: string; - source: ExtensionSource; - status: ExtensionStatus; - /** - * Process ID if the extension is running - */ - pid?: number; + /** + * Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper', 'plugin:my-plugin:my-ext') + */ + id: string; + /** + * Extension name (directory name) + */ + name: string; + source: ExtensionSource; + status: ExtensionStatus; + /** + * Process ID if the extension is running + */ + pid?: number; } /** * Slim input shape for extension_context attachments; identity fields are runtime-derived. @@ -7092,18 +7368,18 @@ export interface Extension { */ /** @experimental */ export interface ExtensionContextPushInput { - /** - * Attachment type discriminator - */ - type: "extension_context"; - /** - * Human-readable composer pill label - */ - title: string; - /** - * Caller-supplied JSON payload (required, may be null but not undefined) - */ - payload: JsonValue; + /** + * Attachment type discriminator + */ + type: "extension_context"; + /** + * Human-readable composer pill label + */ + title: string; + /** + * Caller-supplied JSON payload (required, may be null but not undefined) + */ + payload: JsonValue; } /** * Opaque integrator-owned process launch profile for one extension entrypoint. @@ -7113,20 +7389,20 @@ export interface ExtensionContextPushInput { */ /** @experimental */ export interface ExtensionLaunchProfile { - /** - * Executable used to launch the extension entrypoint. - */ - executable: string; - /** - * Opaque integrator-defined arguments passed to the executable. The runtime does not append the extension entrypoint. - */ - args: string[]; - /** - * Opaque integrator-defined environment variables. Runtime-owned COPILOT_SDK_PATH, SESSION_ID, and COPILOT_EXTENSION_PARENT_PID values take precedence. - */ - env: { - [k: string]: string | undefined; - }; + /** + * Executable used to launch the extension entrypoint. + */ + executable: string; + /** + * Opaque integrator-defined arguments passed to the executable. The runtime does not append the extension entrypoint. + */ + args: string[]; + /** + * Opaque integrator-defined environment variables. Runtime-owned COPILOT_SDK_PATH, SESSION_ID, and COPILOT_EXTENSION_PARENT_PID values take precedence. + */ + env: { + [k: string]: string | undefined; + }; } /** * A discovered extension entrypoint that the registered integrator may classify and resolve to an opaque launch profile. @@ -7136,19 +7412,19 @@ export interface ExtensionLaunchProfile { */ /** @experimental */ export interface ExtensionLaunchProviderResolveRequest { - /** - * Source-qualified extension identifier. - */ - id: string; - /** - * Human-readable extension name. - */ - name: string; - /** - * Absolute path to the discovered extension entrypoint. - */ - modulePath: string; - source: ExtensionSource; + /** + * Source-qualified extension identifier. + */ + id: string; + /** + * Human-readable extension name. + */ + name: string; + /** + * Absolute path to the discovered extension entrypoint. + */ + modulePath: string; + source: ExtensionSource; } /** * The launch profile for a supported entrypoint. Omit launch when the provider does not support the entrypoint. @@ -7158,7 +7434,7 @@ export interface ExtensionLaunchProviderResolveRequest { */ /** @experimental */ export interface ExtensionLaunchProviderResolveResult { - launch?: ExtensionLaunchProfile; + launch?: ExtensionLaunchProfile; } /** * Extensions discovered for the session, with their current status. @@ -7168,10 +7444,10 @@ export interface ExtensionLaunchProviderResolveResult { */ /** @experimental */ export interface ExtensionList { - /** - * Discovered extensions and their current status - */ - extensions: Extension[]; + /** + * Discovered extensions and their current status + */ + extensions: Extension[]; } /** * Source-qualified extension identifier to disable for the session. @@ -7181,10 +7457,10 @@ export interface ExtensionList { */ /** @experimental */ export interface ExtensionsDisableRequest { - /** - * Source-qualified extension ID to disable - */ - id: string; + /** + * Source-qualified extension ID to disable + */ + id: string; } /** * Source-qualified extension identifier to enable for the session. @@ -7194,10 +7470,10 @@ export interface ExtensionsDisableRequest { */ /** @experimental */ export interface ExtensionsEnableRequest { - /** - * Source-qualified extension ID to enable - */ - id: string; + /** + * Source-qualified extension ID to enable + */ + id: string; } /** * Expanded external tool result payload @@ -7207,40 +7483,40 @@ export interface ExtensionsEnableRequest { */ /** @experimental */ export interface ExternalToolTextResultForLlm { - /** - * Text result returned to the model - */ - textResultForLlm: string; - /** - * Execution outcome classification. Optional for back-compat; normalized to 'success' (or 'failure' when error is present) when missing or unrecognized. - */ - resultType?: string; - /** - * Optional error message for failed executions - */ - error?: string; - /** - * Detailed log content for timeline display - */ - sessionLog?: string; - /** - * Optional tool-specific telemetry - */ - toolTelemetry?: { - [k: string]: JsonValue | undefined; - }; - /** - * Base64-encoded binary results returned to the model - */ - binaryResultsForLlm?: ExternalToolTextResultForLlmBinaryResultsForLlm[]; - /** - * Structured content blocks from the tool - */ - contents?: ExternalToolTextResultForLlmContent[]; - /** - * Tool references returned by a tool-search override: names of deferred tools to surface to the model. When set, the tool result is materialized as `tool_reference` content blocks (rather than plain text) so the model knows which deferred tools are now available. - */ - toolReferences?: string[]; + /** + * Text result returned to the model + */ + textResultForLlm: string; + /** + * Execution outcome classification. Optional for back-compat; normalized to 'success' (or 'failure' when error is present) when missing or unrecognized. + */ + resultType?: string; + /** + * Optional error message for failed executions + */ + error?: string; + /** + * Detailed log content for timeline display + */ + sessionLog?: string; + /** + * Optional tool-specific telemetry + */ + toolTelemetry?: { + [k: string]: JsonValue | undefined; + }; + /** + * Base64-encoded binary results returned to the model + */ + binaryResultsForLlm?: ExternalToolTextResultForLlmBinaryResultsForLlm[]; + /** + * Structured content blocks from the tool + */ + contents?: ExternalToolTextResultForLlmContent[]; + /** + * Tool references returned by a tool-search override: names of deferred tools to surface to the model. When set, the tool result is materialized as `tool_reference` content blocks (rather than plain text) so the model knows which deferred tools are now available. + */ + toolReferences?: string[]; } /** * Binary result returned by a tool for the model @@ -7250,25 +7526,25 @@ export interface ExternalToolTextResultForLlm { */ /** @experimental */ export interface ExternalToolTextResultForLlmBinaryResultsForLlm { - type: ExternalToolTextResultForLlmBinaryResultsForLlmType; - /** - * Base64-encoded binary data - */ - data: string; - /** - * MIME type of the binary data - */ - mimeType: string; - /** - * Human-readable description of the binary data - */ - description?: string; - /** - * Optional metadata from the producing tool. - */ - metadata?: { - [k: string]: JsonValue | undefined; - }; + type: ExternalToolTextResultForLlmBinaryResultsForLlmType; + /** + * Base64-encoded binary data + */ + data: string; + /** + * MIME type of the binary data + */ + mimeType: string; + /** + * Human-readable description of the binary data + */ + description?: string; + /** + * Optional metadata from the producing tool. + */ + metadata?: { + [k: string]: JsonValue | undefined; + }; } /** * Plain text content block @@ -7278,14 +7554,14 @@ export interface ExternalToolTextResultForLlmBinaryResultsForLlm { */ /** @experimental */ export interface ExternalToolTextResultForLlmContentText { - /** - * Content block type discriminator - */ - type: "text"; - /** - * The text content - */ - text: string; + /** + * Content block type discriminator + */ + type: "text"; + /** + * The text content + */ + text: string; } /** * Terminal/shell output content block with optional exit code and working directory @@ -7295,22 +7571,22 @@ export interface ExternalToolTextResultForLlmContentText { */ /** @experimental */ export interface ExternalToolTextResultForLlmContentTerminal { - /** - * Content block type discriminator - */ - type: "terminal"; - /** - * Terminal/shell output text - */ - text: string; - /** - * Process exit code, if the command has completed - */ - exitCode?: number; - /** - * Working directory where the command was executed - */ - cwd?: string; + /** + * Content block type discriminator + */ + type: "terminal"; + /** + * Terminal/shell output text + */ + text: string; + /** + * Process exit code, if the command has completed + */ + exitCode?: number; + /** + * Working directory where the command was executed + */ + cwd?: string; } /** * Shell command exit metadata with optional output preview @@ -7320,34 +7596,34 @@ export interface ExternalToolTextResultForLlmContentTerminal { */ /** @experimental */ export interface ExternalToolTextResultForLlmContentShellExit { - /** - * Content block type discriminator - */ - type: "shell_exit"; - /** - * Shell id, as assigned by Copilot runtime - */ - shellId: string; - /** - * Exit code from the completed shell command - */ - exitCode: number; - /** - * Working directory where the shell command was executed - */ - cwd?: string; - /** - * Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. - */ - outputPreview?: string; - /** - * Whether outputPreview is known to be incomplete or truncated - */ - outputTruncated?: boolean; - /** - * Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. - */ - outputFilePath?: string; + /** + * Content block type discriminator + */ + type: "shell_exit"; + /** + * Shell id, as assigned by Copilot runtime + */ + shellId: string; + /** + * Exit code from the completed shell command + */ + exitCode: number; + /** + * Working directory where the shell command was executed + */ + cwd?: string; + /** + * Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. + */ + outputPreview?: string; + /** + * Whether outputPreview is known to be incomplete or truncated + */ + outputTruncated?: boolean; + /** + * Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. + */ + outputFilePath?: string; } /** * Image content block with base64-encoded data @@ -7357,18 +7633,18 @@ export interface ExternalToolTextResultForLlmContentShellExit { */ /** @experimental */ export interface ExternalToolTextResultForLlmContentImage { - /** - * Content block type discriminator - */ - type: "image"; - /** - * Base64-encoded image data - */ - data: string; - /** - * MIME type of the image (e.g., image/png, image/jpeg) - */ - mimeType: string; + /** + * Content block type discriminator + */ + type: "image"; + /** + * Base64-encoded image data + */ + data: string; + /** + * MIME type of the image (e.g., image/png, image/jpeg) + */ + mimeType: string; } /** * Audio content block with base64-encoded data @@ -7378,18 +7654,18 @@ export interface ExternalToolTextResultForLlmContentImage { */ /** @experimental */ export interface ExternalToolTextResultForLlmContentAudio { - /** - * Content block type discriminator - */ - type: "audio"; - /** - * Base64-encoded audio data - */ - data: string; - /** - * MIME type of the audio (e.g., audio/wav, audio/mpeg) - */ - mimeType: string; + /** + * Content block type discriminator + */ + type: "audio"; + /** + * Base64-encoded audio data + */ + data: string; + /** + * MIME type of the audio (e.g., audio/wav, audio/mpeg) + */ + mimeType: string; } /** * Resource link content block referencing an external resource @@ -7399,38 +7675,38 @@ export interface ExternalToolTextResultForLlmContentAudio { */ /** @experimental */ export interface ExternalToolTextResultForLlmContentResourceLink { - /** - * Icons associated with this resource - */ - icons?: ExternalToolTextResultForLlmContentResourceLinkIcon[]; - /** - * Resource name identifier - */ - name: string; - /** - * Human-readable display title for the resource - */ - title?: string; - /** - * URI identifying the resource - */ - uri: string; - /** - * Human-readable description of the resource - */ - description?: string; - /** - * MIME type of the resource content - */ - mimeType?: string; - /** - * Size of the resource in bytes - */ - size?: number; - /** - * Content block type discriminator - */ - type: "resource_link"; + /** + * Icons associated with this resource + */ + icons?: ExternalToolTextResultForLlmContentResourceLinkIcon[]; + /** + * Resource name identifier + */ + name: string; + /** + * Human-readable display title for the resource + */ + title?: string; + /** + * URI identifying the resource + */ + uri: string; + /** + * Human-readable description of the resource + */ + description?: string; + /** + * MIME type of the resource content + */ + mimeType?: string; + /** + * Size of the resource in bytes + */ + size?: number; + /** + * Content block type discriminator + */ + type: "resource_link"; } /** * Icon image for a resource @@ -7440,19 +7716,19 @@ export interface ExternalToolTextResultForLlmContentResourceLink { */ /** @experimental */ export interface ExternalToolTextResultForLlmContentResourceLinkIcon { - /** - * URL or path to the icon image - */ - src: string; - /** - * MIME type of the icon image - */ - mimeType?: string; - /** - * Available icon sizes (e.g., ['16x16', '32x32']) - */ - sizes?: string[]; - theme?: ExternalToolTextResultForLlmContentResourceLinkIconTheme; + /** + * URL or path to the icon image + */ + src: string; + /** + * MIME type of the icon image + */ + mimeType?: string; + /** + * Available icon sizes (e.g., ['16x16', '32x32']) + */ + sizes?: string[]; + theme?: ExternalToolTextResultForLlmContentResourceLinkIconTheme; } /** * Embedded resource content block with inline text or binary data @@ -7462,11 +7738,11 @@ export interface ExternalToolTextResultForLlmContentResourceLinkIcon { */ /** @experimental */ export interface ExternalToolTextResultForLlmContentResource { - /** - * Content block type discriminator - */ - type: "resource"; - resource: ExternalToolTextResultForLlmContentResourceDetails; + /** + * Content block type discriminator + */ + type: "resource"; + resource: ExternalToolTextResultForLlmContentResourceDetails; } /** * Parameters for cooperatively aborting a factory body. @@ -7476,14 +7752,14 @@ export interface ExternalToolTextResultForLlmContentResource { */ /** @experimental */ export interface FactoryAbortRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Factory run identifier. - */ - runId: string; + /** + * Target session identifier + */ + sessionId: string; + /** + * Factory run identifier. + */ + runId: string; } /** * Acknowledgement that a factory request was accepted. @@ -7501,27 +7777,27 @@ export interface FactoryAckResult {} */ /** @experimental */ export interface FactoryAgentOptions { - /** - * Optional label distinguishing otherwise identical memoized agent calls. - */ - label?: string; - /** - * Optional JSON Schema for structured agent output. - */ - schema?: JsonValue; - /** - * Optional model identifier for the subagent. - */ - model?: string; - /** - * Optional reasoning effort for the subagent. This field is accepted but not yet honored. - */ - reasoningEffort?: string; - contextTier?: ContextTier; - /** - * Optional custom agent name for the subagent. This field is accepted but not yet honored. - */ - agent?: string; + /** + * Optional label distinguishing otherwise identical memoized agent calls. + */ + label?: string; + /** + * Optional JSON Schema for structured agent output. + */ + schema?: JsonValue; + /** + * Optional model identifier for the subagent. + */ + model?: string; + /** + * Optional reasoning effort for the subagent. This field is accepted but not yet honored. + */ + reasoningEffort?: string; + contextTier?: ContextTier; + /** + * Optional custom agent name for the subagent. This field is accepted but not yet honored. + */ + agent?: string; } /** * Parameters for one factory-scoped subagent call. @@ -7531,19 +7807,19 @@ export interface FactoryAgentOptions { */ /** @experimental */ export interface FactoryAgentRequest { - /** - * Factory run identifier that owns the subagent. - */ - factoryRunId: string; - /** - * Opaque token identifying the current factory execution attempt. - */ - executionToken: string; - /** - * Prompt to send to the subagent. - */ - prompt: string; - opts: FactoryAgentOptions; + /** + * Factory run identifier that owns the subagent. + */ + factoryRunId: string; + /** + * Opaque token identifying the current factory execution attempt. + */ + executionToken: string; + /** + * Prompt to send to the subagent. + */ + prompt: string; + opts: FactoryAgentOptions; } /** * Result of one factory-scoped subagent call. @@ -7553,10 +7829,10 @@ export interface FactoryAgentRequest { */ /** @experimental */ export interface FactoryAgentResult { - /** - * Agent result, omitted when the agent produced no result. - */ - result?: JsonValue; + /** + * Agent result, omitted when the agent produced no result. + */ + result?: JsonValue; } /** * Prompt-safe durable identity and live status for a direct factory agent. @@ -7566,62 +7842,62 @@ export interface FactoryAgentResult { */ /** @experimental */ export interface FactoryAgentSummary { - /** - * Stable direct-agent identifier. - */ - agentId: string; - /** - * Tool-call identifier that launched the agent. - */ - toolCallId: string; - /** - * Owning factory run identifier. - */ - runId: string; - /** - * Phase identifier active when the agent was launched, or null. - */ - phaseId: string | null; - /** - * Friendly, non-unique name intended for display - */ - label: string; - /** - * Friendly, non-unique name intended for display - */ - displayName?: string; - /** - * Registered agent type. - */ - agentType: string; - /** - * Current durable or live agent status. - */ - status: string; - /** - * Model requested when the agent was launched. - */ - requestedModel?: string; - /** - * Concrete model resolved for the agent. - */ - resolvedModel?: string; - /** - * Epoch milliseconds when the agent started. - */ - startedAt?: number; - /** - * Epoch milliseconds when the agent completed. - */ - completedAt?: number; - /** - * Accumulated active agent time in milliseconds. - */ - activeMs: number; - /** - * Prompt-safe live activity text. - */ - activity?: string; + /** + * Stable direct-agent identifier. + */ + agentId: string; + /** + * Tool-call identifier that launched the agent. + */ + toolCallId: string; + /** + * Owning factory run identifier. + */ + runId: string; + /** + * Phase identifier active when the agent was launched, or null. + */ + phaseId: string | null; + /** + * Friendly, non-unique name intended for display + */ + label: string; + /** + * Friendly, non-unique name intended for display + */ + displayName?: string; + /** + * Registered agent type. + */ + agentType: string; + /** + * Current durable or live agent status. + */ + status: string; + /** + * Model requested when the agent was launched. + */ + requestedModel?: string; + /** + * Concrete model resolved for the agent. + */ + resolvedModel?: string; + /** + * Epoch milliseconds when the agent started. + */ + startedAt?: number; + /** + * Epoch milliseconds when the agent completed. + */ + completedAt?: number; + /** + * Accumulated active agent time in milliseconds. + */ + activeMs: number; + /** + * Prompt-safe live activity text. + */ + activity?: string; } /** * Parameters for cancelling a factory run. @@ -7631,10 +7907,10 @@ export interface FactoryAgentSummary { */ /** @experimental */ export interface FactoryCancelRequest { - /** - * Factory run identifier. - */ - runId: string; + /** + * Factory run identifier. + */ + runId: string; } /** * Current factory phase identity. @@ -7644,14 +7920,14 @@ export interface FactoryCancelRequest { */ /** @experimental */ export interface FactoryCurrentPhase { - /** - * Current phase identifier. - */ - id: string; - /** - * Zero-based declared phase ordinal, or null for an undeclared phase. - */ - ordinal: number | null; + /** + * Current phase identifier. + */ + id: string; + /** + * Zero-based declared phase ordinal, or null for an undeclared phase. + */ + ordinal: number | null; } /** * Declared or approved factory resource ceilings. @@ -7661,22 +7937,22 @@ export interface FactoryCurrentPhase { */ /** @experimental */ export interface FactoryDeclaredLimits { - /** - * Maximum concurrently active subagents. - */ - maxConcurrentSubagents?: number; - /** - * Maximum total subagents spawned by the run. - */ - maxTotalSubagents?: number; - /** - * Maximum accumulated active execution time in seconds. - */ - timeoutSeconds?: number; - /** - * Maximum AI credits consumed by subagents and descendants. - */ - maxAiCredits?: number; + /** + * Maximum concurrently active subagents. + */ + maxConcurrentSubagents?: number; + /** + * Maximum total subagents spawned by the run. + */ + maxTotalSubagents?: number; + /** + * Maximum accumulated active execution time in seconds. + */ + timeoutSeconds?: number; + /** + * Maximum AI credits consumed by subagents and descendants. + */ + maxAiCredits?: number; } /** * Parameters sent to the owning extension to execute a factory closure. @@ -7686,26 +7962,26 @@ export interface FactoryDeclaredLimits { */ /** @experimental */ export interface FactoryExecuteRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Registered factory name. - */ - name: string; - /** - * Factory run identifier. - */ - runId: string; - /** - * Opaque token identifying this factory execution attempt. - */ - executionToken: string; - /** - * Factory input value. - */ - args: JsonValue; + /** + * Target session identifier + */ + sessionId: string; + /** + * Registered factory name. + */ + name: string; + /** + * Factory run identifier. + */ + runId: string; + /** + * Opaque token identifying this factory execution attempt. + */ + executionToken: string; + /** + * Factory input value. + */ + args: JsonValue; } /** * Result returned by an extension factory closure. @@ -7715,10 +7991,10 @@ export interface FactoryExecuteRequest { */ /** @experimental */ export interface FactoryExecuteResult { - /** - * Factory result value. - */ - result?: JsonValue; + /** + * Factory result value. + */ + result?: JsonValue; } /** * Parameters for paging factory progress. @@ -7728,26 +8004,26 @@ export interface FactoryExecuteResult { */ /** @experimental */ export interface FactoryGetRunProgressRequest { - /** - * Factory run identifier. - */ - runId: string; - /** - * Optional phase identifier used to scope records and cursors. - */ - phaseId?: string; - /** - * Exclusive forward cursor. - */ - afterSeq?: number; - /** - * Exclusive backward cursor. - */ - beforeSeq?: number; - /** - * Maximum records to return. Defaults to 200 and is capped at 500. - */ - limit?: number; + /** + * Factory run identifier. + */ + runId: string; + /** + * Optional phase identifier used to scope records and cursors. + */ + phaseId?: string; + /** + * Exclusive forward cursor. + */ + afterSeq?: number; + /** + * Exclusive backward cursor. + */ + beforeSeq?: number; + /** + * Maximum records to return. Defaults to 200 and is capped at 500. + */ + limit?: number; } /** * Parameters for retrieving a factory run. @@ -7757,10 +8033,10 @@ export interface FactoryGetRunProgressRequest { */ /** @experimental */ export interface FactoryGetRunRequest { - /** - * Factory run identifier. - */ - runId: string; + /** + * Factory run identifier. + */ + runId: string; } /** * Parameters for reading a factory journal entry. @@ -7770,18 +8046,18 @@ export interface FactoryGetRunRequest { */ /** @experimental */ export interface FactoryJournalGetRequest { - /** - * Factory run identifier. - */ - runId: string; - /** - * Opaque token identifying the current factory execution attempt. - */ - executionToken: string; - /** - * Namespaced journal key. - */ - key: string; + /** + * Factory run identifier. + */ + runId: string; + /** + * Opaque token identifying the current factory execution attempt. + */ + executionToken: string; + /** + * Namespaced journal key. + */ + key: string; } /** * Result of reading a factory journal entry. @@ -7791,14 +8067,14 @@ export interface FactoryJournalGetRequest { */ /** @experimental */ export interface FactoryJournalGetResult { - /** - * Whether the journal contained the requested key. - */ - hit: boolean; - /** - * Cached JSON result. The hit field distinguishes a cached JSON null from a miss. - */ - resultJson?: JsonValue; + /** + * Whether the journal contained the requested key. + */ + hit: boolean; + /** + * Cached JSON result. The hit field distinguishes a cached JSON null from a miss. + */ + resultJson?: JsonValue; } /** * Parameters for storing a factory journal entry. @@ -7808,22 +8084,22 @@ export interface FactoryJournalGetResult { */ /** @experimental */ export interface FactoryJournalPutRequest { - /** - * Factory run identifier. - */ - runId: string; - /** - * Opaque token identifying the current factory execution attempt. - */ - executionToken: string; - /** - * Namespaced journal key. - */ - key: string; - /** - * JSON result to memoize. - */ - resultJson: JsonValue; + /** + * Factory run identifier. + */ + runId: string; + /** + * Opaque token identifying the current factory execution attempt. + */ + executionToken: string; + /** + * Namespaced journal key. + */ + key: string; + /** + * JSON result to memoize. + */ + resultJson: JsonValue; } /** * Parameters for paging factory runs. @@ -7833,18 +8109,18 @@ export interface FactoryJournalPutRequest { */ /** @experimental */ export interface FactoryListRunsRequest { - /** - * Exclusive forward cursor. - */ - afterSeq?: number; - /** - * Exclusive backward cursor. - */ - beforeSeq?: number; - /** - * Maximum terminal runs to return. Defaults to 200 and is capped at 500. - */ - limit?: number; + /** + * Exclusive forward cursor. + */ + afterSeq?: number; + /** + * Exclusive backward cursor. + */ + beforeSeq?: number; + /** + * Maximum terminal runs to return. Defaults to 200 and is capped at 500. + */ + limit?: number; } /** * A page of factory runs in durable creation order. @@ -7854,26 +8130,26 @@ export interface FactoryListRunsRequest { */ /** @experimental */ export interface FactoryListRunsResult { - /** - * Factory run summaries in durable creation order. - */ - runs: FactoryRunSummary[]; - /** - * Oldest terminal-run cursor in this page, or null when the terminal window is empty. - */ - oldestSeq?: number | null; - /** - * Newest terminal-run cursor in this page, or null when the terminal window is empty. - */ - newestSeq?: number | null; - /** - * Whether terminal runs newer than this page exist. - */ - hasMoreNewer?: boolean; - /** - * Number of terminal runs older than this page. - */ - omittedOlder?: number; + /** + * Factory run summaries in durable creation order. + */ + runs: FactoryRunSummary[]; + /** + * Oldest terminal-run cursor in this page, or null when the terminal window is empty. + */ + oldestSeq?: number | null; + /** + * Newest terminal-run cursor in this page, or null when the terminal window is empty. + */ + newestSeq?: number | null; + /** + * Whether terminal runs newer than this page exist. + */ + hasMoreNewer?: boolean; + /** + * Number of terminal runs older than this page. + */ + omittedOlder?: number; } /** * Durable factory run summary with read-time live overlays. @@ -7883,73 +8159,73 @@ export interface FactoryListRunsResult { */ /** @experimental */ export interface FactoryRunSummary { - /** - * Factory run identifier. - */ - runId: string; - /** - * Registered factory name. - */ - factoryName: string; - /** - * Human-readable factory description. - */ - description: string; - status: FactoryRunStatus; - /** - * Monotonic durable run revision. - */ - revision: number; - /** - * Epoch milliseconds when the run was created. - */ - createdAt: number; - /** - * Epoch milliseconds when execution first started, or null before start. - */ - startedAt: number | null; - /** - * Epoch milliseconds when the durable run was last updated. - */ - updatedAt: number; - /** - * Epoch milliseconds when the run completed, or null while nonterminal. - */ - completedAt: number | null; - /** - * Current phase identity, or null before any phase is entered. - */ - currentPhase: FactoryCurrentPhase | null; - /** - * Number of phases declared by the factory. - */ - declaredPhaseCount: number; - /** - * Number of direct factory agents currently live. - */ - liveAgentCount: number; - /** - * Total direct factory agents spawned across all attempts. - */ - totalSpawnedAgentCount: number; - consumed: FactoryRunConsumed; - declaredLimits: FactoryDeclaredLimits; - /** - * Approved effective resource ceilings, or null until approved. - */ - approved: FactoryDeclaredLimits | null; - /** - * Epoch milliseconds when this live-overlay snapshot was observed. - */ - observedAt: number; - /** - * Epoch milliseconds when the current active segment started, or null while inactive. - */ - activeSegmentStartedAt: number | null; - /** - * Terminal run outcome, or null while nonterminal. - */ - terminal: FactoryRunTerminal | null; + /** + * Factory run identifier. + */ + runId: string; + /** + * Registered factory name. + */ + factoryName: string; + /** + * Human-readable factory description. + */ + description: string; + status: FactoryRunStatus; + /** + * Monotonic durable run revision. + */ + revision: number; + /** + * Epoch milliseconds when the run was created. + */ + createdAt: number; + /** + * Epoch milliseconds when execution first started, or null before start. + */ + startedAt: number | null; + /** + * Epoch milliseconds when the durable run was last updated. + */ + updatedAt: number; + /** + * Epoch milliseconds when the run completed, or null while nonterminal. + */ + completedAt: number | null; + /** + * Current phase identity, or null before any phase is entered. + */ + currentPhase: FactoryCurrentPhase | null; + /** + * Number of phases declared by the factory. + */ + declaredPhaseCount: number; + /** + * Number of direct factory agents currently live. + */ + liveAgentCount: number; + /** + * Total direct factory agents spawned across all attempts. + */ + totalSpawnedAgentCount: number; + consumed: FactoryRunConsumed; + declaredLimits: FactoryDeclaredLimits; + /** + * Approved effective resource ceilings, or null until approved. + */ + approved: FactoryDeclaredLimits | null; + /** + * Epoch milliseconds when this live-overlay snapshot was observed. + */ + observedAt: number; + /** + * Epoch milliseconds when the current active segment started, or null while inactive. + */ + activeSegmentStartedAt: number | null; + /** + * Terminal run outcome, or null while nonterminal. + */ + terminal: FactoryRunTerminal | null; } /** * Durable factory resource consumption. @@ -7959,18 +8235,18 @@ export interface FactoryRunSummary { */ /** @experimental */ export interface FactoryRunConsumed { - /** - * Accumulated active execution time in milliseconds. - */ - activeMs: number; - /** - * Total subagents spawned by the run. - */ - subagents: number; - /** - * AI usage consumed by the run in nano-AIU. - */ - nanoAiu: number; + /** + * Accumulated active execution time in milliseconds. + */ + activeMs: number; + /** + * Total subagents spawned by the run. + */ + subagents: number; + /** + * AI usage consumed by the run in nano-AIU. + */ + nanoAiu: number; } /** * Prompt-safe terminal factory outcome. @@ -7980,19 +8256,19 @@ export interface FactoryRunConsumed { */ /** @experimental */ export interface FactoryRunTerminal { - /** - * Human-readable terminal reason. - */ - reason?: string; - failure?: FactoryRunFailure; - /** - * Human-readable terminal error. - */ - error?: string; - /** - * Prompt-safe preview of the completed result. - */ - resultPreview?: string; + /** + * Human-readable terminal reason. + */ + reason?: string; + failure?: FactoryRunFailure; + /** + * Human-readable terminal error. + */ + error?: string; + /** + * Prompt-safe preview of the completed result. + */ + resultPreview?: string; } /** * One ordered factory progress line. @@ -8002,15 +8278,15 @@ export interface FactoryRunTerminal { */ /** @experimental */ export interface FactoryLogLine { - /** - * Monotonic sequence number within the factory run. - */ - seq: number; - kind: FactoryLogLineKind; - /** - * Progress text. - */ - text: string; + /** + * Monotonic sequence number within the factory run. + */ + seq: number; + kind: FactoryLogLineKind; + /** + * Progress text. + */ + text: string; } /** * Parameters for recording factory progress. @@ -8020,18 +8296,18 @@ export interface FactoryLogLine { */ /** @experimental */ export interface FactoryLogRequest { - /** - * Factory run identifier. - */ - runId: string; - /** - * Opaque token identifying the current factory execution attempt. - */ - executionToken: string; - /** - * Ordered progress lines to append. - */ - lines: FactoryLogLine[]; + /** + * Factory run identifier. + */ + runId: string; + /** + * Opaque token identifying the current factory execution attempt. + */ + executionToken: string; + /** + * Ordered progress lines to append. + */ + lines: FactoryLogLine[]; } /** * Durable lifecycle and timing for one factory phase. @@ -8041,55 +8317,55 @@ export interface FactoryLogRequest { */ /** @experimental */ export interface FactoryPhaseObservation { - /** - * Phase identifier. - */ - id: string; - /** - * Zero-based declared phase ordinal, or null for an undeclared phase. - */ - ordinal: number | null; - /** - * Human-readable phase title. - */ - title: string; - /** - * Optional human-readable phase detail. - */ - detail?: string; - status: FactoryPhaseStatus; - /** - * Most recent run attempt that entered this phase, or `0` if the phase has never been entered. - */ - lastEnteredRunAttempt: number; - /** - * Number of times execution entered this phase. - */ - entryCount: number; - /** - * Epoch milliseconds when this phase first started; for a skipped phase, the synthetic skip timestamp (equal to `completedAt`). - */ - startedAt?: number; - /** - * Epoch milliseconds when this phase completed; for a skipped phase, the synthetic skip timestamp (equal to `startedAt`). - */ - completedAt?: number; - /** - * Completed active time accumulated by this phase in milliseconds. - */ - accumulatedActiveMs: number; - /** - * Current live active time for this phase in milliseconds. - */ - currentActiveMs: number; - /** - * Total direct agents associated with this phase. - */ - totalAgentCount: number; - /** - * Direct agents in this phase that are currently live. - */ - liveAgentCount: number; + /** + * Phase identifier. + */ + id: string; + /** + * Zero-based declared phase ordinal, or null for an undeclared phase. + */ + ordinal: number | null; + /** + * Human-readable phase title. + */ + title: string; + /** + * Optional human-readable phase detail. + */ + detail?: string; + status: FactoryPhaseStatus; + /** + * Most recent run attempt that entered this phase, or `0` if the phase has never been entered. + */ + lastEnteredRunAttempt: number; + /** + * Number of times execution entered this phase. + */ + entryCount: number; + /** + * Epoch milliseconds when this phase first started; for a skipped phase, the synthetic skip timestamp (equal to `completedAt`). + */ + startedAt?: number; + /** + * Epoch milliseconds when this phase completed; for a skipped phase, the synthetic skip timestamp (equal to `startedAt`). + */ + completedAt?: number; + /** + * Completed active time accumulated by this phase in milliseconds. + */ + accumulatedActiveMs: number; + /** + * Current live active time for this phase in milliseconds. + */ + currentActiveMs: number; + /** + * Total direct agents associated with this phase. + */ + totalAgentCount: number; + /** + * Direct agents in this phase that are currently live. + */ + liveAgentCount: number; } /** * One durable factory progress record. @@ -8099,27 +8375,27 @@ export interface FactoryPhaseObservation { */ /** @experimental */ export interface FactoryProgressLine { - /** - * Global monotonic sequence number within the run. - */ - seq: number; - /** - * Resume attempt that emitted this record. - */ - attempt: number; - /** - * Phase active when the record was emitted, or null before any phase. - */ - phaseId: string | null; - /** - * Epoch milliseconds when the record was persisted. - */ - recordedAt: number; - kind: FactoryLogLineKind; - /** - * Prompt-safe progress text. - */ - text: string; + /** + * Global monotonic sequence number within the run. + */ + seq: number; + /** + * Resume attempt that emitted this record. + */ + attempt: number; + /** + * Phase active when the record was emitted, or null before any phase. + */ + phaseId: string | null; + /** + * Epoch milliseconds when the record was persisted. + */ + recordedAt: number; + kind: FactoryLogLineKind; + /** + * Prompt-safe progress text. + */ + text: string; } /** * A bidirectional page of factory progress. @@ -8129,30 +8405,30 @@ export interface FactoryProgressLine { */ /** @experimental */ export interface FactoryProgressPage { - /** - * Progress records in sequence order. - */ - records: FactoryProgressLine[]; - /** - * Oldest sequence number in this page, or null when empty. - */ - oldestSeq: number | null; - /** - * Newest sequence number in this page, or null when empty. - */ - newestSeq: number | null; - /** - * Whether progress records older than this page exist. - */ - hasMoreOlder: boolean; - /** - * Whether progress records newer than this page exist. - */ - hasMoreNewer: boolean; - /** - * Run revision reflected by this page. - */ - revision: number; + /** + * Progress records in sequence order. + */ + records: FactoryProgressLine[]; + /** + * Oldest sequence number in this page, or null when empty. + */ + oldestSeq: number | null; + /** + * Newest sequence number in this page, or null when empty. + */ + newestSeq: number | null; + /** + * Whether progress records older than this page exist. + */ + hasMoreOlder: boolean; + /** + * Whether progress records newer than this page exist. + */ + hasMoreNewer: boolean; + /** + * Run revision reflected by this page. + */ + revision: number; } /** * Parameters for resuming a factory run from its persisted identity. @@ -8162,19 +8438,19 @@ export interface FactoryProgressPage { */ /** @experimental */ export interface FactoryResumeRequest { - /** - * Factory run identifier. - */ - runId: string; - limits?: FactoryRunLimits; - /** - * Whether to notify the originating session when the factory completes. - */ - notifyOnComplete?: boolean; - /** - * Whether to emit factory phase names to the session transcript. - */ - logPhaseNames?: boolean; + /** + * Factory run identifier. + */ + runId: string; + limits?: FactoryRunLimits; + /** + * Whether to notify the originating session when the factory completes. + */ + notifyOnComplete?: boolean; + /** + * Whether to emit factory phase names to the session transcript. + */ + logPhaseNames?: boolean; } /** * Wire-only per-invocation factory resource ceiling overrides. @@ -8184,22 +8460,22 @@ export interface FactoryResumeRequest { */ /** @experimental */ export interface FactoryRunLimits { - /** - * Maximum number of factory subagents that may run concurrently. - */ - maxConcurrentSubagents?: number; - /** - * Maximum total number of factory subagents that may be admitted. - */ - maxTotalSubagents?: number; - /** - * Maximum accumulated active-execution time in seconds. Active execution includes the entire extension body, subprocess waits, queued-agent waits, and sleeps; time between resumed attempts is not counted. - */ - timeoutSeconds?: number; - /** - * Maximum AI credits consumed by factory subagents and their descendants. The post-paid ceiling is soft: parallel turns can settle beyond it before the run stops. - */ - maxAiCredits?: number; + /** + * Maximum number of factory subagents that may run concurrently. + */ + maxConcurrentSubagents?: number; + /** + * Maximum total number of factory subagents that may be admitted. + */ + maxTotalSubagents?: number; + /** + * Maximum accumulated active-execution time in seconds. Active execution includes the entire extension body, subprocess waits, queued-agent waits, and sleeps; time between resumed attempts is not counted. + */ + timeoutSeconds?: number; + /** + * Maximum AI credits consumed by factory subagents and their descendants. The post-paid ceiling is soft: parallel turns can settle beyond it before the run stops. + */ + maxAiCredits?: number; } /** * Resolved persisted factory identity and resumed run envelope. @@ -8209,11 +8485,11 @@ export interface FactoryRunLimits { */ /** @experimental */ export interface FactoryResumeResult { - /** - * Persisted factory name resolved for the resumed run. - */ - factoryName: string; - run: FactoryRunResult; + /** + * Persisted factory name resolved for the resumed run. + */ + factoryName: string; + run: FactoryRunResult; } /** * Complete current or terminal factory run envelope. @@ -8223,32 +8499,32 @@ export interface FactoryResumeResult { */ /** @experimental */ export interface FactoryRunResult { - /** - * Factory run identifier. - */ - runId: string; - /** - * One-based execution attempt represented by this envelope. Absent before the first attempt starts or when returned by an older runtime. - */ - attempt?: number; - status: FactoryRunStatus; - /** - * Completed factory result. - */ - result?: JsonValue; - /** - * Error message for an errored run. - */ - error?: string; - failure?: FactoryRunFailure; - /** - * Reason for a halted or cancelled run. - */ - reason?: string; - /** - * Partial journal and progress snapshot for a halted, cancelled, or errored run. - */ - snapshot?: JsonValue; + /** + * Factory run identifier. + */ + runId: string; + /** + * One-based execution attempt represented by this envelope. Absent before the first attempt starts or when returned by an older runtime. + */ + attempt?: number; + status: FactoryRunStatus; + /** + * Completed factory result. + */ + result?: JsonValue; + /** + * Error message for an errored run. + */ + error?: string; + failure?: FactoryRunFailure; + /** + * Reason for a halted or cancelled run. + */ + reason?: string; + /** + * Partial journal and progress snapshot for a halted, cancelled, or errored run. + */ + snapshot?: JsonValue; } /** * Full factory run observability detail. @@ -8258,82 +8534,82 @@ export interface FactoryRunResult { */ /** @experimental */ export interface FactoryRunDetail { - /** - * Factory run identifier. - */ - runId: string; - /** - * Registered factory name. - */ - factoryName: string; - /** - * Human-readable factory description. - */ - description: string; - status: FactoryRunStatus; - /** - * Monotonic durable run revision. - */ - revision: number; - /** - * Epoch milliseconds when the run was created. - */ - createdAt: number; - /** - * Epoch milliseconds when execution first started, or null before start. - */ - startedAt: number | null; - /** - * Epoch milliseconds when the durable run was last updated. - */ - updatedAt: number; - /** - * Epoch milliseconds when the run completed, or null while nonterminal. - */ - completedAt: number | null; - /** - * Current phase identity, or null before any phase is entered. - */ - currentPhase: FactoryCurrentPhase | null; - /** - * Number of phases declared by the factory. - */ - declaredPhaseCount: number; - /** - * Number of direct factory agents currently live. - */ - liveAgentCount: number; - /** - * Total direct factory agents spawned across all attempts. - */ - totalSpawnedAgentCount: number; - consumed: FactoryRunConsumed; - declaredLimits: FactoryDeclaredLimits; - /** - * Approved effective resource ceilings, or null until approved. - */ - approved: FactoryDeclaredLimits | null; - /** - * Epoch milliseconds when this live-overlay snapshot was observed. - */ - observedAt: number; - /** - * Epoch milliseconds when the current active segment started, or null while inactive. - */ - activeSegmentStartedAt: number | null; - /** - * Terminal run outcome, or null while nonterminal. - */ - terminal: FactoryRunTerminal | null; - /** - * Lifecycle and timing observations for each factory phase. - */ - phases: FactoryPhaseObservation[]; - /** - * Durable identities and live statuses for direct factory agents. - */ - agents: FactoryAgentSummary[]; - progress: FactoryProgressPage; + /** + * Factory run identifier. + */ + runId: string; + /** + * Registered factory name. + */ + factoryName: string; + /** + * Human-readable factory description. + */ + description: string; + status: FactoryRunStatus; + /** + * Monotonic durable run revision. + */ + revision: number; + /** + * Epoch milliseconds when the run was created. + */ + createdAt: number; + /** + * Epoch milliseconds when execution first started, or null before start. + */ + startedAt: number | null; + /** + * Epoch milliseconds when the durable run was last updated. + */ + updatedAt: number; + /** + * Epoch milliseconds when the run completed, or null while nonterminal. + */ + completedAt: number | null; + /** + * Current phase identity, or null before any phase is entered. + */ + currentPhase: FactoryCurrentPhase | null; + /** + * Number of phases declared by the factory. + */ + declaredPhaseCount: number; + /** + * Number of direct factory agents currently live. + */ + liveAgentCount: number; + /** + * Total direct factory agents spawned across all attempts. + */ + totalSpawnedAgentCount: number; + consumed: FactoryRunConsumed; + declaredLimits: FactoryDeclaredLimits; + /** + * Approved effective resource ceilings, or null until approved. + */ + approved: FactoryDeclaredLimits | null; + /** + * Epoch milliseconds when this live-overlay snapshot was observed. + */ + observedAt: number; + /** + * Epoch milliseconds when the current active segment started, or null while inactive. + */ + activeSegmentStartedAt: number | null; + /** + * Terminal run outcome, or null while nonterminal. + */ + terminal: FactoryRunTerminal | null; + /** + * Lifecycle and timing observations for each factory phase. + */ + phases: FactoryPhaseObservation[]; + /** + * Durable identities and live statuses for direct factory agents. + */ + agents: FactoryAgentSummary[]; + progress: FactoryProgressPage; } /** * Parameters for invoking a registered factory. @@ -8343,15 +8619,15 @@ export interface FactoryRunDetail { */ /** @experimental */ export interface FactoryRunRequest { - /** - * Registered factory name. - */ - name: string; - /** - * Factory input value. - */ - args: JsonValue; - options?: RunOptions; + /** + * Registered factory name. + */ + name: string; + /** + * Factory input value. + */ + args: JsonValue; + options?: RunOptions; } /** * Options controlling factory invocation. @@ -8361,19 +8637,19 @@ export interface FactoryRunRequest { */ /** @experimental */ export interface RunOptions { - limits?: FactoryRunLimits; - /** - * Whether to notify the originating session when the factory completes. - */ - notifyOnComplete?: boolean; - /** - * Whether to emit factory phase names to the session transcript. - */ - logPhaseNames?: boolean; - /** - * Run identifier whose journal and progress should seed this resumed run. - */ - resumeFromRunId?: string; + limits?: FactoryRunLimits; + /** + * Whether to notify the originating session when the factory completes. + */ + notifyOnComplete?: boolean; + /** + * Whether to emit factory phase names to the session transcript. + */ + logPhaseNames?: boolean; + /** + * Run identifier whose journal and progress should seed this resumed run. + */ + resumeFromRunId?: string; } /** * Internal parameters for resuming a factory run from a tool. @@ -8384,15 +8660,15 @@ export interface RunOptions { /** @experimental */ /** @internal */ export interface FactoryToolResumeRequest { - /** - * Factory run identifier. - */ - runId: string; - limits?: FactoryRunLimits; - /** - * Opaque identifier of the originating tool call. - */ - toolCallId?: string; + /** + * Factory run identifier. + */ + runId: string; + limits?: FactoryRunLimits; + /** + * Opaque identifier of the originating tool call. + */ + toolCallId?: string; } /** * Options for an internal tool-originated factory invocation. @@ -8403,11 +8679,11 @@ export interface FactoryToolResumeRequest { /** @experimental */ /** @internal */ export interface FactoryToolRunOptions { - limits?: FactoryRunLimits; - /** - * Run identifier whose journal and progress should seed this resumed run. - */ - resumeFromRunId?: string; + limits?: FactoryRunLimits; + /** + * Run identifier whose journal and progress should seed this resumed run. + */ + resumeFromRunId?: string; } /** * Internal parameters for invoking a registered factory from a tool. @@ -8418,19 +8694,19 @@ export interface FactoryToolRunOptions { /** @experimental */ /** @internal */ export interface FactoryToolRunRequest { - /** - * Registered factory name. - */ - name: string; - /** - * Factory input value. - */ - args: JsonValue; - options?: FactoryToolRunOptions; - /** - * Opaque identifier of the originating tool call. - */ - toolCallId?: string; + /** + * Registered factory name. + */ + name: string; + /** + * Factory input value. + */ + args: JsonValue; + options?: FactoryToolRunOptions; + /** + * Opaque identifier of the originating tool call. + */ + toolCallId?: string; } /** * Optional user prompt to combine with the fleet orchestration instructions. @@ -8440,10 +8716,10 @@ export interface FactoryToolRunRequest { */ /** @experimental */ export interface FleetStartRequest { - /** - * Optional user prompt to combine with fleet instructions - */ - prompt?: string; + /** + * Optional user prompt to combine with fleet instructions + */ + prompt?: string; } /** * Indicates whether fleet mode was successfully activated. @@ -8453,10 +8729,10 @@ export interface FleetStartRequest { */ /** @experimental */ export interface FleetStartResult { - /** - * Whether fleet mode was successfully activated - */ - started: boolean; + /** + * Whether fleet mode was successfully activated + */ + started: boolean; } /** * Folder path to add to trusted folders. @@ -8466,10 +8742,10 @@ export interface FleetStartResult { */ /** @experimental */ export interface FolderTrustAddParams { - /** - * Folder path to mark as trusted - */ - path: string; + /** + * Folder path to mark as trusted + */ + path: string; } /** * Folder path to check for trust. @@ -8479,10 +8755,10 @@ export interface FolderTrustAddParams { */ /** @experimental */ export interface FolderTrustCheckParams { - /** - * Folder path to check - */ - path: string; + /** + * Folder path to check + */ + path: string; } /** * Folder trust check result. @@ -8492,10 +8768,10 @@ export interface FolderTrustCheckParams { */ /** @experimental */ export interface FolderTrustCheckResult { - /** - * Whether the folder is trusted - */ - trusted: boolean; + /** + * Whether the folder is trusted + */ + trusted: boolean; } /** * Client environment metadata describing the process that produced a telemetry event. @@ -8505,54 +8781,54 @@ export interface FolderTrustCheckResult { */ /** @experimental */ export interface GitHubTelemetryClientInfo { - /** - * Copilot CLI version string. - */ - cli_version: string; - /** - * Operating system platform (e.g. darwin, linux, win32). - */ - os_platform: string; - /** - * Operating system version string. - */ - os_version: string; - /** - * Operating system architecture (e.g. arm64, x64). - */ - os_arch: string; - /** - * Node.js runtime version string. - */ - node_version: string; - /** - * Copilot subscription plan, when known. - */ - copilot_plan?: string; - /** - * Type of client. - */ - client_type?: string; - /** - * Name of the client application. - */ - client_name?: string; - /** - * Whether the user is a GitHub/Microsoft staff member. - */ - is_staff?: boolean; - /** - * Stable machine identifier for the device. - */ - dev_device_id?: string; - /** - * Distinct CPU model names for the host, comma-separated. - */ - cpu_model?: string; - /** - * Number of logical CPU cores on the host. - */ - cpu_count?: number; + /** + * Copilot CLI version string. + */ + cli_version: string; + /** + * Operating system platform (e.g. darwin, linux, win32). + */ + os_platform: string; + /** + * Operating system version string. + */ + os_version: string; + /** + * Operating system architecture (e.g. arm64, x64). + */ + os_arch: string; + /** + * Node.js runtime version string. + */ + node_version: string; + /** + * Copilot subscription plan, when known. + */ + copilot_plan?: string; + /** + * Type of client. + */ + client_type?: string; + /** + * Name of the client application. + */ + client_name?: string; + /** + * Whether the user is a GitHub/Microsoft staff member. + */ + is_staff?: boolean; + /** + * Stable machine identifier for the device. + */ + dev_device_id?: string; + /** + * Distinct CPU model names for the host, comma-separated. + */ + cpu_model?: string; + /** + * Number of logical CPU cores on the host. + */ + cpu_count?: number; } /** * A single telemetry event in the runtime's native GitHub-shaped telemetry format, forwarded verbatim to opted-in hosts. The `restricted` flag on the enclosing GitHubTelemetryNotification distinguishes standard from restricted events; the payload shape is identical for both. @@ -8562,49 +8838,49 @@ export interface GitHubTelemetryClientInfo { */ /** @experimental */ export interface GitHubTelemetryEvent { - /** - * Event type/kind (e.g. get_completion_with_tools_turn, tool_call_executed). - */ - kind: string; - /** - * Timestamp when the event was created (ISO 8601 format). - */ - created_at?: string; - /** - * Reference to the model call that produced this event. - */ - model_call_id?: string; - /** - * String-valued properties as a map from key to value. - */ - properties: { - [k: string]: string | undefined; - }; - /** - * Numeric metrics as a map from key to value. - */ - metrics: { - [k: string]: number | undefined; - }; - /** - * Experiment assignment context. - */ - exp_assignment_context?: string; - /** - * Feature flags enabled for this session, as a map from flag to value. - */ - features?: { - [k: string]: string | undefined; - }; - /** - * Session identifier the event belongs to. - */ - session_id?: string; - /** - * Copilot tracking ID for user-level attribution. - */ - copilot_tracking_id?: string; - client?: GitHubTelemetryClientInfo; + /** + * Event type/kind (e.g. get_completion_with_tools_turn, tool_call_executed). + */ + kind: string; + /** + * Timestamp when the event was created (ISO 8601 format). + */ + created_at?: string; + /** + * Reference to the model call that produced this event. + */ + model_call_id?: string; + /** + * String-valued properties as a map from key to value. + */ + properties: { + [k: string]: string | undefined; + }; + /** + * Numeric metrics as a map from key to value. + */ + metrics: { + [k: string]: number | undefined; + }; + /** + * Experiment assignment context. + */ + exp_assignment_context?: string; + /** + * Feature flags enabled for this session, as a map from flag to value. + */ + features?: { + [k: string]: string | undefined; + }; + /** + * Session identifier the event belongs to. + */ + session_id?: string; + /** + * Copilot tracking ID for user-level attribution. + */ + copilot_tracking_id?: string; + client?: GitHubTelemetryClientInfo; } /** * Payload for a `gitHubTelemetry.event` notification: a single GitHub telemetry event the runtime forwards to a host connection that opted into telemetry forwarding during the `server.connect` handshake. @@ -8614,15 +8890,15 @@ export interface GitHubTelemetryEvent { */ /** @experimental */ export interface GitHubTelemetryNotification { - /** - * Session the telemetry event belongs to, when it is session-scoped. Omitted for sessionless events (for example, `server.sendTelemetry` calls with no session id), which are still forwarded to opted-in connections. - */ - sessionId?: string; - /** - * Whether this is a restricted telemetry event (cli.restricted_telemetry). Hosts must route restricted events to first-party Microsoft stores only. - */ - restricted: boolean; - event: GitHubTelemetryEvent; + /** + * Session the telemetry event belongs to, when it is session-scoped. Omitted for sessionless events (for example, `server.sendTelemetry` calls with no session id), which are still forwarded to opted-in connections. + */ + sessionId?: string; + /** + * Whether this is a restricted telemetry event (cli.restricted_telemetry). Hosts must route restricted events to first-party Microsoft stores only. + */ + restricted: boolean; + event: GitHubTelemetryEvent; } /** * Asks the SDK client to acquire a GitHub access token from an opaque callback registration. @@ -8632,19 +8908,19 @@ export interface GitHubTelemetryNotification { */ /** @experimental */ export interface GitHubTokenAcquireRequest { - /** - * Opaque identifier generated by the SDK for this callback registration. - */ - registrationId: string; - /** - * Effective GitHub host for which the callback must return a token. - */ - host: string; - /** - * Session receiving the token. Absent only before a cloud session has been assigned its id. - */ - sessionId?: string; - reason: GitHubTokenAcquireReason; + /** + * Opaque identifier generated by the SDK for this callback registration. + */ + registrationId: string; + /** + * Effective GitHub host for which the callback must return a token. + */ + host: string; + /** + * Session receiving the token. Absent only before a cloud session has been assigned its id. + */ + sessionId?: string; + reason: GitHubTokenAcquireReason; } /** * Pending external tool call request ID, with the tool result or an error describing why it failed. @@ -8654,15 +8930,15 @@ export interface GitHubTokenAcquireRequest { */ /** @experimental */ export interface HandlePendingToolCallRequest { - /** - * Request ID of the pending tool call - */ - requestId: string; - result?: ExternalToolResult; - /** - * Error message if the tool call failed - */ - error?: string; + /** + * Request ID of the pending tool call + */ + requestId: string; + result?: ExternalToolResult; + /** + * Error message if the tool call failed + */ + error?: string; } /** * Indicates whether the external tool call result was handled successfully. @@ -8672,10 +8948,10 @@ export interface HandlePendingToolCallRequest { */ /** @experimental */ export interface HandlePendingToolCallResult { - /** - * Whether the tool call result was handled successfully - */ - success: boolean; + /** + * Whether the tool call result was handled successfully + */ + success: boolean; } /** * Indicates whether an in-progress manual compaction was aborted. @@ -8685,10 +8961,10 @@ export interface HandlePendingToolCallResult { */ /** @experimental */ export interface HistoryAbortManualCompactionResult { - /** - * Whether an in-progress manual compaction was aborted. False when no manual compaction was running, when its abort controller was already aborted, or when the session is remote. - */ - aborted: boolean; + /** + * Whether an in-progress manual compaction was aborted. False when no manual compaction was running, when its abort controller was already aborted, or when the session is remote. + */ + aborted: boolean; } /** * Indicates whether an in-progress background compaction was cancelled. @@ -8698,10 +8974,10 @@ export interface HistoryAbortManualCompactionResult { */ /** @experimental */ export interface HistoryCancelBackgroundCompactionResult { - /** - * Whether an in-progress background compaction was cancelled. False when no compaction was running, when the session is remote, or when the underlying processor was unavailable. - */ - cancelled: boolean; + /** + * Whether an in-progress background compaction was cancelled. False when no compaction was running, when the session is remote, or when the underlying processor was unavailable. + */ + cancelled: boolean; } /** * Parameters for clearing the conversation and seeding the window that replaces it. @@ -8711,10 +8987,10 @@ export interface HistoryCancelBackgroundCompactionResult { */ /** @experimental */ export interface HistoryClearContextRequest { - /** - * First user message of the fresh context window. Required: a cleared window holding only system and developer messages is not a conversation a model can answer, so every clear seeds the window it creates. Delivered by the enclosing turn driver once the agentic loop exits, which is why the call must be made from inside a tool handler. - */ - prompt: string; + /** + * First user message of the fresh context window. Required: a cleared window holding only system and developer messages is not a conversation a model can answer, so every clear seeds the window it creates. Delivered by the enclosing turn driver once the agentic loop exits, which is why the call must be made from inside a tool handler. + */ + prompt: string; } /** * What a successful clear removed. A clear that could not be applied rejects instead of reporting a count. @@ -8724,10 +9000,10 @@ export interface HistoryClearContextRequest { */ /** @experimental */ export interface HistoryClearContextResult { - /** - * Number of non-system, non-developer messages that were removed from the conversation. Zero only when the window already held no conversation. - */ - messagesCleared: number; + /** + * Number of non-system, non-developer messages that were removed from the conversation. Zero only when the window already held no conversation. + */ + messagesCleared: number; } /** * Post-compaction context window usage breakdown @@ -8737,30 +9013,30 @@ export interface HistoryClearContextResult { */ /** @experimental */ export interface HistoryCompactContextWindow { - /** - * Maximum token count for the model's context window - */ - tokenLimit: number; - /** - * Current total tokens in the context window (system + conversation + tool definitions) - */ - currentTokens: number; - /** - * Current number of messages in the conversation - */ - messagesLength: number; - /** - * Token count from system message(s) - */ - systemTokens?: number; - /** - * Token count from non-system messages (user, assistant, tool) - */ - conversationTokens?: number; - /** - * Token count from tool definitions - */ - toolDefinitionsTokens?: number; + /** + * Maximum token count for the model's context window + */ + tokenLimit: number; + /** + * Current total tokens in the context window (system + conversation + tool definitions) + */ + currentTokens: number; + /** + * Current number of messages in the conversation + */ + messagesLength: number; + /** + * Token count from system message(s) + */ + systemTokens?: number; + /** + * Token count from non-system messages (user, assistant, tool) + */ + conversationTokens?: number; + /** + * Token count from tool definitions + */ + toolDefinitionsTokens?: number; } /** * Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown. @@ -8770,23 +9046,23 @@ export interface HistoryCompactContextWindow { */ /** @experimental */ export interface HistoryCompactResult { - /** - * Whether compaction completed successfully - */ - success: boolean; - /** - * Number of tokens freed by compaction - */ - tokensRemoved: number; - /** - * Number of messages removed during compaction - */ - messagesRemoved: number; - /** - * Summary text produced by compaction. Omitted when compaction did not produce a summary (e.g. failure path). - */ - summaryContent?: string; - contextWindow?: HistoryCompactContextWindow; + /** + * Whether compaction completed successfully + */ + success: boolean; + /** + * Number of tokens freed by compaction + */ + tokensRemoved: number; + /** + * Number of messages removed during compaction + */ + messagesRemoved: number; + /** + * Summary text produced by compaction. Omitted when compaction did not produce a summary (e.g. failure path). + */ + summaryContent?: string; + contextWindow?: HistoryCompactContextWindow; } /** * Rewind points and file-change-tracking availability for the session. @@ -8796,15 +9072,15 @@ export interface HistoryCompactResult { */ /** @experimental */ export interface HistoryListRewindPointsResult { - /** - * Whether this session captured file changes from its first turn. - */ - fileChangeTrackingEnabled: boolean; - unavailableReason?: HistoryRewindUnavailableReason; - /** - * Root user turns in chronological order. Empty when `unavailableReason` is set. - */ - points: HistoryRewindPoint[]; + /** + * Whether this session captured file changes from its first turn. + */ + fileChangeTrackingEnabled: boolean; + unavailableReason?: HistoryRewindUnavailableReason; + /** + * Root user turns in chronological order. Empty when `unavailableReason` is set. + */ + points: HistoryRewindPoint[]; } /** * A root user turn that the session can rewind to. @@ -8814,42 +9090,42 @@ export interface HistoryListRewindPointsResult { */ /** @experimental */ export interface HistoryRewindPoint { - /** - * ID of the user.message event that begins the discarded suffix. - */ - eventId: string; - /** - * User-visible message text for the turn. - */ - userMessage: string; - /** - * ISO timestamp of the user turn. - */ - timestamp: string; - /** - * Whether at least one file in this turn or a later turn can be restored. - */ - canRestoreFiles: boolean; - /** - * Number of unique files in this turn and all later turns that have captured changes. - */ - fileCount: number; - /** - * Whether this turn itself captured any file changes. - */ - turnChangedFiles: boolean; - /** - * Lines added by this turn's captured file changes. - */ - linesAdded: number; - /** - * Lines removed by this turn's captured file changes. - */ - linesRemoved: number; - /** - * Whether this turn was an automatically injected autopilot continuation. - */ - isAutopilotContinuation: boolean; + /** + * ID of the user.message event that begins the discarded suffix. + */ + eventId: string; + /** + * User-visible message text for the turn. + */ + userMessage: string; + /** + * ISO timestamp of the user turn. + */ + timestamp: string; + /** + * Whether at least one file in this turn or a later turn can be restored. + */ + canRestoreFiles: boolean; + /** + * Number of unique files in this turn and all later turns that have captured changes. + */ + fileCount: number; + /** + * Whether this turn itself captured any file changes. + */ + turnChangedFiles: boolean; + /** + * Lines added by this turn's captured file changes. + */ + linesAdded: number; + /** + * Lines removed by this turn's captured file changes. + */ + linesRemoved: number; + /** + * Whether this turn was an automatically injected autopilot continuation. + */ + isAutopilotContinuation: boolean; } /** * Event boundary to preview for conversation-and-files rewind. @@ -8859,10 +9135,10 @@ export interface HistoryRewindPoint { */ /** @experimental */ export interface HistoryPreviewRewindRequest { - /** - * ID of the user.message event that begins the discarded suffix. - */ - eventId: string; + /** + * ID of the user.message event that begins the discarded suffix. + */ + eventId: string; } /** * Files and aggregate changes for a prospective rewind. @@ -8872,19 +9148,19 @@ export interface HistoryPreviewRewindRequest { */ /** @experimental */ export interface HistoryPreviewRewindResult { - /** - * Whether file restore is available for this session. This is authoritative: switch on it and read `reason` only when it is false. - */ - available: boolean; - reason?: HistoryRewindUnavailableReason; - /** - * Number of unique files in the preview. - */ - fileCount: number; - /** - * Files ordered by path. - */ - files: HistoryRewindFilePreview[]; + /** + * Whether file restore is available for this session. This is authoritative: switch on it and read `reason` only when it is false. + */ + available: boolean; + reason?: HistoryRewindUnavailableReason; + /** + * Number of unique files in the preview. + */ + fileCount: number; + /** + * Files ordered by path. + */ + files: HistoryRewindFilePreview[]; } /** * A file that a conversation-and-files rewind would restore. @@ -8894,19 +9170,19 @@ export interface HistoryPreviewRewindResult { */ /** @experimental */ export interface HistoryRewindFilePreview { - /** - * Absolute path of the captured file. - */ - path: string; - changeType: HistoryRewindChangeType; - /** - * Lines added across the discarded turns. - */ - linesAdded: number; - /** - * Lines removed across the discarded turns. - */ - linesRemoved: number; + /** + * Absolute path of the captured file. + */ + path: string; + changeType: HistoryRewindChangeType; + /** + * Lines added across the discarded turns. + */ + linesAdded: number; + /** + * Lines removed across the discarded turns. + */ + linesRemoved: number; } /** * Boundary and mode for rewinding session history. @@ -8916,11 +9192,11 @@ export interface HistoryRewindFilePreview { */ /** @experimental */ export interface HistoryRewindRequest { - /** - * ID of the user.message event that begins the discarded suffix. - */ - eventId: string; - mode: HistoryRewindMode; + /** + * ID of the user.message event that begins the discarded suffix. + */ + eventId: string; + mode: HistoryRewindMode; } /** * Structured outcome of a rewind request. @@ -8930,23 +9206,23 @@ export interface HistoryRewindRequest { */ /** @experimental */ export interface HistoryRewindResult { - outcome: HistoryRewindOutcome; - /** - * Number of persisted events removed by conversation truncation. Present only when truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`) and for `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`. - */ - eventsRemoved?: number; - /** - * Absolute paths restored to their captured preimages. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. - */ - restoredFiles: string[]; - /** - * Captured files intentionally left unchanged. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. - */ - skippedFiles: HistorySkippedFileRestore[]; - /** - * Failure detail. Set only for the failure and partial-failure outcomes (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`). - */ - error?: string; + outcome: HistoryRewindOutcome; + /** + * Number of persisted events removed by conversation truncation. Present only when truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`) and for `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`. + */ + eventsRemoved?: number; + /** + * Absolute paths restored to their captured preimages. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. + */ + restoredFiles: string[]; + /** + * Captured files intentionally left unchanged. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it. + */ + skippedFiles: HistorySkippedFileRestore[]; + /** + * Failure detail. Set only for the failure and partial-failure outcomes (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`). + */ + error?: string; } /** * A captured file that rewind intentionally left unchanged. @@ -8956,11 +9232,11 @@ export interface HistoryRewindResult { */ /** @experimental */ export interface HistorySkippedFileRestore { - /** - * Absolute path of the skipped file. - */ - path: string; - reason: HistoryFileRestoreSkipReason; + /** + * Absolute path of the skipped file. + */ + path: string; + reason: HistoryFileRestoreSkipReason; } /** * Markdown summary of the conversation context (empty when not available). @@ -8970,10 +9246,10 @@ export interface HistorySkippedFileRestore { */ /** @experimental */ export interface HistorySummarizeForHandoffResult { - /** - * Markdown summary of the conversation context produced by an LLM. Empty string when there are no messages or when the session does not support local summarization. - */ - summary: string; + /** + * Markdown summary of the conversation context produced by an LLM. Empty string when there are no messages or when the session does not support local summarization. + */ + summary: string; } /** * Identifier of the event to truncate to; this event and all later events are removed. @@ -8983,10 +9259,10 @@ export interface HistorySummarizeForHandoffResult { */ /** @experimental */ export interface HistoryTruncateRequest { - /** - * Event ID to truncate to. This event and all events after it are removed from the session. - */ - eventId: string; + /** + * Event ID to truncate to. This event and all events after it are removed from the session. + */ + eventId: string; } /** * Number of events that were removed by the truncation. @@ -8996,18 +9272,18 @@ export interface HistoryTruncateRequest { */ /** @experimental */ export interface HistoryTruncateResult { - /** - * Number of events that were removed - */ - eventsRemoved: number; - /** - * True when conversation truncation succeeded but post-truncation workspace checkpoint cleanup failed. History is already truncated; callers may still prune snapshots but should report a checkpoint-cleanup rather than a truncation failure. - */ - checkpointCleanupFailed?: boolean; - /** - * Failure detail when checkpointCleanupFailed is true. - */ - checkpointCleanupError?: string; + /** + * Number of events that were removed + */ + eventsRemoved: number; + /** + * True when conversation truncation succeeded but post-truncation workspace checkpoint cleanup failed. History is already truncated; callers may still prune snapshots but should report a checkpoint-cleanup rather than a truncation failure. + */ + checkpointCleanupFailed?: boolean; + /** + * Failure detail when checkpointCleanupFailed is true. + */ + checkpointCleanupError?: string; } /** * Runtime-owned wire payload for a server-to-client hook callback invocation. @@ -9018,9 +9294,9 @@ export interface HistoryTruncateResult { /** @experimental */ /** @internal */ export interface HookInvokeRequest { - sessionId: string; - hookType: HookType; - input: JsonValue; + sessionId: string; + hookType: HookType; + input: JsonValue; } /** * Optional output returned by an SDK callback hook. @@ -9031,7 +9307,7 @@ export interface HookInvokeRequest { /** @experimental */ /** @internal */ export interface HookInvokeResponse { - output?: JsonValue; + output?: JsonValue; } /** * Optional project paths and host-exclusion behavior for server-scoped hook discovery. @@ -9041,14 +9317,14 @@ export interface HookInvokeResponse { */ /** @experimental */ export interface HooksDiscoverRequest { - /** - * Optional project directory paths whose trusted repository and project-expanded plugin hooks should be discovered. When omitted or empty, user, managed-policy, and globally enabled installed or explicit plugin hooks are returned without project expansion. - */ - projectPaths?: string[]; - /** - * When true, omit host-owned user and plugin hook rows and their diagnostics. Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks still contribute to each remaining row's effective enabled state. This filters sources rather than simulating a host with no settings. - */ - excludeHostHooks?: boolean; + /** + * Optional project directory paths whose trusted repository and project-expanded plugin hooks should be discovered. When omitted or empty, user, managed-policy, and globally enabled installed or explicit plugin hooks are returned without project expansion. + */ + projectPaths?: string[]; + /** + * When true, omit host-owned user and plugin hook rows and their diagnostics. Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks still contribute to each remaining row's effective enabled state. This filters sources rather than simulating a host with no settings. + */ + excludeHostHooks?: boolean; } /** * Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources. @@ -9058,18 +9334,18 @@ export interface HooksDiscoverRequest { */ /** @experimental */ export interface HooksDiscoverResult { - /** - * All discovered hook actions. Byte-identical actions remain separate rows even when they share a disable key. - */ - hooks: DiscoveredHook[]; - /** - * Non-fatal source-loading warnings. Discovery remains complete for the affected source, although the source had a recoverable issue. Repository-settings warnings are prefixed with their project path when attribution is available. - */ - warnings: string[]; - /** - * Errors for hook sources or actions that could not be loaded, making the result partially incomplete. Other valid actions are still returned. Project-resolution and repository-settings errors are prefixed with their project path. - */ - errors: string[]; + /** + * All discovered hook actions. Byte-identical actions remain separate rows even when they share a disable key. + */ + hooks: DiscoveredHook[]; + /** + * Non-fatal source-loading warnings. Discovery remains complete for the affected source, although the source had a recoverable issue. Repository-settings warnings are prefixed with their project path when attribution is available. + */ + warnings: string[]; + /** + * Errors for hook sources or actions that could not be loaded, making the result partially incomplete. Other valid actions are still returned. Project-resolution and repository-settings errors are prefixed with their project path. + */ + errors: string[]; } /** * Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source. @@ -9079,39 +9355,39 @@ export interface HooksDiscoverResult { */ /** @experimental */ export interface InstalledPlugin { - /** - * Plugin name - */ - name: string; - /** - * Marketplace the plugin came from (empty string for direct repo installs) - */ - marketplace: string; - /** - * Version installed (if available) - */ - version?: string; - /** - * Installation timestamp - */ - installed_at: string; - /** - * Whether the plugin is currently enabled - */ - enabled: boolean; - /** - * Path where the plugin is cached locally - */ - cache_path?: string; - source?: InstalledPluginSource; - /** - * Per-plugin source fingerprint (a SHA-256 hash of the plugin's catalog source spec plus its resolved source subtree — NOT a Git commit SHA) captured at marketplace install/update time. Auto-update compares it against the freshly recomputed fingerprint to detect a content change that does not bump the version. Absent for pre-existing installs and for direct (non-marketplace) installs. - */ - source_sha?: string; - /** - * Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — those synthesized at session start for a directory/local marketplace, whose cache_path points at the real plugin directory on disk rather than a copy under the installed-plugins cache. Its presence is what marks a record as live, and no record carrying it is ever written to the persisted installedPlugins key. - */ - installed_from?: string; + /** + * Plugin name + */ + name: string; + /** + * Marketplace the plugin came from (empty string for direct repo installs) + */ + marketplace: string; + /** + * Version installed (if available) + */ + version?: string; + /** + * Installation timestamp + */ + installed_at: string; + /** + * Whether the plugin is currently enabled + */ + enabled: boolean; + /** + * Path where the plugin is cached locally + */ + cache_path?: string; + source?: InstalledPluginSource; + /** + * Per-plugin source fingerprint (a SHA-256 hash of the plugin's catalog source spec plus its resolved source subtree — NOT a Git commit SHA) captured at marketplace install/update time. Auto-update compares it against the freshly recomputed fingerprint to detect a content change that does not bump the version. Absent for pre-existing installs and for direct (non-marketplace) installs. + */ + source_sha?: string; + /** + * Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — those synthesized at session start for a directory/local marketplace, whose cache_path points at the real plugin directory on disk rather than a copy under the installed-plugins cache. Its presence is what marks a record as live, and no record carrying it is ever written to the persisted installedPlugins key. + */ + installed_from?: string; } /** * Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref or full commit SHA, and optional subpath. @@ -9121,26 +9397,26 @@ export interface InstalledPlugin { */ /** @experimental */ export interface InstalledPluginSourceGitHub { - /** - * Constant value. Always "github". - */ - source: "github"; - /** - * GitHub repository in `owner/repo` form. - */ - repo: string; - /** - * Optional Git ref to resolve. - */ - ref?: string; - /** - * Optional full 40-character hexadecimal commit SHA. - */ - sha?: string; - /** - * Optional repository-relative path to the plugin. - */ - path?: string; + /** + * Constant value. Always "github". + */ + source: "github"; + /** + * GitHub repository in `owner/repo` form. + */ + repo: string; + /** + * Optional Git ref to resolve. + */ + ref?: string; + /** + * Optional full 40-character hexadecimal commit SHA. + */ + sha?: string; + /** + * Optional repository-relative path to the plugin. + */ + path?: string; } /** * Source descriptor for a direct URL plugin install, with URL, optional ref or full commit SHA, and optional subpath. @@ -9150,26 +9426,26 @@ export interface InstalledPluginSourceGitHub { */ /** @experimental */ export interface InstalledPluginSourceUrl { - /** - * Constant value. Always "url". - */ - source: "url"; - /** - * URL of the plugin source. - */ - url: string; - /** - * Optional Git ref to resolve. - */ - ref?: string; - /** - * Optional full 40-character hexadecimal commit SHA. - */ - sha?: string; - /** - * Optional source-relative path to the plugin. - */ - path?: string; + /** + * Constant value. Always "url". + */ + source: "url"; + /** + * URL of the plugin source. + */ + url: string; + /** + * Optional Git ref to resolve. + */ + ref?: string; + /** + * Optional full 40-character hexadecimal commit SHA. + */ + sha?: string; + /** + * Optional source-relative path to the plugin. + */ + path?: string; } /** * Source descriptor for a direct local plugin install, with a local filesystem path. @@ -9179,14 +9455,14 @@ export interface InstalledPluginSourceUrl { */ /** @experimental */ export interface InstalledPluginSourceLocal { - /** - * Constant value. Always "local". - */ - source: "local"; - /** - * Local filesystem path to the plugin. - */ - path: string; + /** + * Constant value. Always "local". + */ + source: "local"; + /** + * Local filesystem path to the plugin. + */ + path: string; } /** * Information about an installed plugin tracked in global state. @@ -9196,30 +9472,30 @@ export interface InstalledPluginSourceLocal { */ /** @experimental */ export interface InstalledPluginInfo { - /** - * Plugin name - */ - name: string; - /** - * Marketplace the plugin came from. Empty string ("") for direct repo / URL / local installs. - */ - marketplace: string; - /** - * Opaque, stable hash identifying a direct (non-marketplace) install source. Present only for direct repo / URL / local installs; absent for marketplace plugins. Same source yields the same id; distinct sources never collide. - */ - directSourceId?: string; - /** - * Installed version (when reported by the plugin manifest) - */ - version?: string; - /** - * Whether the plugin is currently enabled for new sessions - */ - enabled: boolean; - /** - * Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — a plugin belonging to a directory/local marketplace, which is loaded from its real directory on every pass instead of a copy under the installed-plugins cache. Its presence is what marks a listed plugin as live: such a plugin is always present on disk, so `enabled` is its only meaningful state and it is never "not installed". - */ - installedFrom?: string; + /** + * Plugin name + */ + name: string; + /** + * Marketplace the plugin came from. Empty string ("") for direct repo / URL / local installs. + */ + marketplace: string; + /** + * Opaque, stable hash identifying a direct (non-marketplace) install source. Present only for direct repo / URL / local installs; absent for marketplace plugins. Same source yields the same id; distinct sources never collide. + */ + directSourceId?: string; + /** + * Installed version (when reported by the plugin manifest) + */ + version?: string; + /** + * Whether the plugin is currently enabled for new sessions + */ + enabled: boolean; + /** + * Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — a plugin belonging to a directory/local marketplace, which is loaded from its real directory on every pass instead of a copy under the installed-plugins cache. Its presence is what marks a listed plugin as live: such a plugin is always present on disk, so `enabled` is its only meaningful state and it is never "not installed". + */ + installedFrom?: string; } /** * Canonical file or directory where custom instructions can be discovered or created, with location, kind, preference, and project path. @@ -9229,20 +9505,20 @@ export interface InstalledPluginInfo { */ /** @experimental */ export interface InstructionDiscoveryPath { - /** - * Absolute path of the file or directory (may not exist on disk yet) - */ - path: string; - location: InstructionDiscoveryPathLocation; - kind: InstructionDiscoveryPathKind; - /** - * Whether this is the canonical target to create new instructions in its tier. At most one entry per tier is preferred. - */ - preferredForCreation: boolean; - /** - * The input project path this target was derived from (only for repository targets) - */ - projectPath?: string; + /** + * Absolute path of the file or directory (may not exist on disk yet) + */ + path: string; + location: InstructionDiscoveryPathLocation; + kind: InstructionDiscoveryPathKind; + /** + * Whether this is the canonical target to create new instructions in its tier. At most one entry per tier is preferred. + */ + preferredForCreation: boolean; + /** + * The input project path this target was derived from (only for repository targets) + */ + projectPath?: string; } /** * Canonical files and directories where custom instructions can be created so the runtime will recognize them. @@ -9252,10 +9528,10 @@ export interface InstructionDiscoveryPath { */ /** @experimental */ export interface InstructionDiscoveryPathList { - /** - * Canonical instruction create/discovery files and directories, in priority order - */ - paths: InstructionDiscoveryPath[]; + /** + * Canonical instruction create/discovery files and directories, in priority order + */ + paths: InstructionDiscoveryPath[]; } /** * Optional project paths to include in instruction discovery. @@ -9265,14 +9541,14 @@ export interface InstructionDiscoveryPathList { */ /** @experimental */ export interface InstructionsDiscoverRequest { - /** - * Optional list of project directory paths to scan for repository/working-directory instruction sources. When omitted or empty, only user-level and plugin instruction sources are returned (no project scan). - */ - projectPaths?: string[]; - /** - * When true, omit the host's instruction sources (user/home-level files and plugin rules), leaving only repository and working-directory sources. For multitenant deployments. - */ - excludeHostInstructions?: boolean; + /** + * Optional list of project directory paths to scan for repository/working-directory instruction sources. When omitted or empty, only user-level and plugin instruction sources are returned (no project scan). + */ + projectPaths?: string[]; + /** + * When true, omit the host's instruction sources (user/home-level files and plugin rules), leaving only repository and working-directory sources. For multitenant deployments. + */ + excludeHostInstructions?: boolean; } /** * Optional project paths to include when enumerating instruction discovery targets. @@ -9282,14 +9558,14 @@ export interface InstructionsDiscoverRequest { */ /** @experimental */ export interface InstructionsGetDiscoveryPathsRequest { - /** - * Optional list of project directory paths. When omitted or empty, only the user-level targets are returned. - */ - projectPaths?: string[]; - /** - * When true, omit the host's user-level instruction targets, leaving only repository targets. For multitenant deployments (mirrors `discover`'s `excludeHostInstructions`). - */ - excludeHostInstructions?: boolean; + /** + * Optional list of project directory paths. When omitted or empty, only the user-level targets are returned. + */ + projectPaths?: string[]; + /** + * When true, omit the host's user-level instruction targets, leaving only repository targets. For multitenant deployments (mirrors `discover`'s `excludeHostInstructions`). + */ + excludeHostInstructions?: boolean; } /** * Instruction sources loaded for the session, in merge order. @@ -9299,10 +9575,10 @@ export interface InstructionsGetDiscoveryPathsRequest { */ /** @experimental */ export interface InstructionsGetSourcesResult { - /** - * Instruction sources for the session - */ - sources: InstructionSource[]; + /** + * Instruction sources for the session + */ + sources: InstructionSource[]; } /** * Loaded instruction source for a session, including path, content, category, location, applicability, and optional description. @@ -9312,40 +9588,40 @@ export interface InstructionsGetSourcesResult { */ /** @experimental */ export interface InstructionSource { - /** - * Unique identifier for this source (used for toggling) - */ - id: string; - /** - * Human-readable label - */ - label: string; - /** - * File path relative to repo or absolute for home - */ - sourcePath: string; - /** - * Raw content of the instruction file - */ - content: string; - type: InstructionSourceType; - location: InstructionSourceLocation; - /** - * Glob pattern(s) from frontmatter — when set, this instruction applies only to matching files - */ - applyTo?: string[]; - /** - * Short description (body after frontmatter) for use in instruction tables - */ - description?: string; - /** - * When true, this source starts disabled and must be toggled on by the user - */ - defaultDisabled?: boolean; - /** - * The project path this source was discovered from. Only set by sessionless discovery for repository, working-directory, and project-scoped plugin sources, where it disambiguates sources across multiple workspace roots. The session-scoped getSources leaves it unset. - */ - projectPath?: string; + /** + * Unique identifier for this source (used for toggling) + */ + id: string; + /** + * Human-readable label + */ + label: string; + /** + * File path relative to repo or absolute for home + */ + sourcePath: string; + /** + * Raw content of the instruction file + */ + content: string; + type: InstructionSourceType; + location: InstructionSourceLocation; + /** + * Glob pattern(s) from frontmatter — when set, this instruction applies only to matching files + */ + applyTo?: string[]; + /** + * Short description (body after frontmatter) for use in instruction tables + */ + description?: string; + /** + * When true, this source starts disabled and must be toggled on by the user + */ + defaultDisabled?: boolean; + /** + * The project path this source was discovered from. Only set by sessionless discovery for repository, working-directory, and project-scoped plugin sources, where it disambiguates sources across multiple workspace roots. The session-scoped getSources leaves it unset. + */ + projectPath?: string; } /** * Parameters for interrupting the main agent turn. @@ -9355,10 +9631,10 @@ export interface InstructionSource { */ /** @experimental */ export interface InterruptMainTurnRequest { - /** - * When true, the user's queued prompts are preserved and run as the next turn once the interrupted turn unwinds; when false (the default), the queue is cleared like a plain abort. - */ - flushQueued?: boolean; + /** + * When true, the user's queued prompts are preserved and run as the next turn once the interrupted turn unwinds; when false (the default), the queue is cleared like a plain abort. + */ + flushQueued?: boolean; } /** * Result of interrupting the main agent turn. @@ -9368,10 +9644,10 @@ export interface InterruptMainTurnRequest { */ /** @experimental */ export interface InterruptMainTurnResult { - /** - * Whether an in-flight main agent turn was interrupted. False when the main loop was not processing. - */ - interrupted: boolean; + /** + * Whether an in-flight main agent turn was interrupted. False when the main loop was not processing. + */ + interrupted: boolean; } /** * HTTP headers as a map from lowercased header name to a list of values. Multi-valued headers (e.g. Set-Cookie) preserve all values. @@ -9381,7 +9657,7 @@ export interface InterruptMainTurnResult { */ /** @experimental */ export interface LlmInferenceHeaders { - [k: string]: string[] | undefined; + [k: string]: string[] | undefined; } /** * A request body chunk or cancellation signal. @@ -9391,34 +9667,34 @@ export interface LlmInferenceHeaders { */ /** @experimental */ export interface LlmInferenceHttpRequestChunkRequest { - /** - * Matches the requestId from the originating httpRequestStart frame. - */ - requestId: string; - /** - * Body byte range. UTF-8 text when `binary` is absent or false; base64-encoded bytes when `binary` is true. May be empty. - */ - data: string; - /** - * When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text. - */ - binary?: boolean; - /** - * 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. - */ - end?: boolean; - /** - * When true, the runtime is cancelling the in-flight request (e.g. upstream consumer aborted). `data` is ignored. Implies end-of-request. - */ - cancel?: boolean; - /** - * Optional human-readable reason for the cancellation, propagated for logging. - */ - cancelReason?: string; - /** - * Identity of the agent invocation (one agentic loop) this body chunk belongs to, matching the `agentInvocationId` semantics on httpRequestStart. Carried per chunk so a persistent transport can attribute successive turns correctly: when a WebSocket connection is reused across turns, the httpRequestStart identity reflects only the turn that opened the connection, so each later turn stamps its own invocation id here. Absent when the runtime has no invocation context for the request, or on the plain-HTTP transport where every request has its own httpRequestStart. - */ - agentInvocationId?: string; + /** + * Matches the requestId from the originating httpRequestStart frame. + */ + requestId: string; + /** + * Body byte range. UTF-8 text when `binary` is absent or false; base64-encoded bytes when `binary` is true. May be empty. + */ + data: string; + /** + * When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text. + */ + binary?: boolean; + /** + * 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. + */ + end?: boolean; + /** + * When true, the runtime is cancelling the in-flight request (e.g. upstream consumer aborted). `data` is ignored. Implies end-of-request. + */ + cancel?: boolean; + /** + * Optional human-readable reason for the cancellation, propagated for logging. + */ + cancelReason?: string; + /** + * Identity of the agent invocation (one agentic loop) this body chunk belongs to, matching the `agentInvocationId` semantics on httpRequestStart. Carried per chunk so a persistent transport can attribute successive turns correctly: when a WebSocket connection is reused across turns, the httpRequestStart identity reflects only the turn that opened the connection, so each later turn stamps its own invocation id here. Absent when the runtime has no invocation context for the request, or on the plain-HTTP transport where every request has its own httpRequestStart. + */ + agentInvocationId?: string; } /** * Acknowledgement. The SDK is free to ignore the ack and treat chunk delivery as fire-and-forget. @@ -9436,40 +9712,40 @@ export interface LlmInferenceHttpRequestChunkResult {} */ /** @experimental */ export interface LlmInferenceHttpRequestStartRequest { - /** - * 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. - */ - requestId: string; - /** - * 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. - */ - sessionId?: string; - /** - * HTTP method, e.g. GET, POST. - */ - method: string; - /** - * Absolute request URL. - */ - url: string; - headers: LlmInferenceHeaders; - transport?: LlmInferenceHttpRequestStartTransport; - /** - * Stable identity of the agent trajectory that issued this request. Present when the request originates from an agent turn; absent for requests outside any agent context. This is the same identity used by lifecycle and bridged session events and remains constant across turns and retries. - */ - agentId?: string; - /** - * Stable identity of the immediate parent trajectory. Present for child trajectories such as subagents and conversation-sampling requests; absent for root-agent and non-agent requests. - */ - parentAgentId?: string; - /** - * Identity of the agent invocation (one agentic loop) that issued this request. It remains fixed across physical retries within the invocation and is distinct from the stable trajectory `agentId`. A caller-supplied invocation id always takes precedence (this covers auxiliary calls that have no model call id). Otherwise, first-party CAPI requests fall back to the runtime's agent task id — the same value the runtime emits as the `X-Agent-Task-Id` header — while custom-provider requests fall back to the model call id. - */ - agentInvocationId?: string; - /** - * Coarse classification of the interaction that produced this request. Open string for forward-compatibility; known values include `conversation-agent`, `conversation-subagent`, `conversation-sampling`, `conversation-background`, `conversation-compaction`, and `conversation-user`. Absent when the runtime did not classify the request. Comes from the runtime's per-request agent context independently of transport; on the CAPI transport the runtime derives the upstream `X-Interaction-Type` header from this same context. - */ - interactionType?: string; + /** + * 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. + */ + requestId: string; + /** + * 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. + */ + sessionId?: string; + /** + * HTTP method, e.g. GET, POST. + */ + method: string; + /** + * Absolute request URL. + */ + url: string; + headers: LlmInferenceHeaders; + transport?: LlmInferenceHttpRequestStartTransport; + /** + * Stable identity of the agent trajectory that issued this request. Present when the request originates from an agent turn; absent for requests outside any agent context. This is the same identity used by lifecycle and bridged session events and remains constant across turns and retries. + */ + agentId?: string; + /** + * Stable identity of the immediate parent trajectory. Present for child trajectories such as subagents and conversation-sampling requests; absent for root-agent and non-agent requests. + */ + parentAgentId?: string; + /** + * Identity of the agent invocation (one agentic loop) that issued this request. It remains fixed across physical retries within the invocation and is distinct from the stable trajectory `agentId`. A caller-supplied invocation id always takes precedence (this covers auxiliary calls that have no model call id). Otherwise, first-party CAPI requests fall back to the runtime's agent task id — the same value the runtime emits as the `X-Agent-Task-Id` header — while custom-provider requests fall back to the model call id. + */ + agentInvocationId?: string; + /** + * Coarse classification of the interaction that produced this request. Open string for forward-compatibility; known values include `conversation-agent`, `conversation-subagent`, `conversation-sampling`, `conversation-background`, `conversation-compaction`, and `conversation-user`. Absent when the runtime did not classify the request. Comes from the runtime's per-request agent context independently of transport; on the CAPI transport the runtime derives the upstream `X-Interaction-Type` header from this same context. + */ + interactionType?: string; } /** * Acknowledgement. Returning successfully simply means the SDK accepted the start frame; it does not imply the request will succeed. @@ -9487,14 +9763,14 @@ export interface LlmInferenceHttpRequestStartResult {} */ /** @experimental */ export interface LlmInferenceHttpResponseChunkError { - /** - * Human-readable failure description. - */ - message: string; - /** - * Optional machine-readable error code. - */ - code?: string; + /** + * Human-readable failure description. + */ + message: string; + /** + * Optional machine-readable error code. + */ + code?: string; } /** * A response body chunk or terminal error. @@ -9504,23 +9780,23 @@ export interface LlmInferenceHttpResponseChunkError { */ /** @experimental */ export interface LlmInferenceHttpResponseChunkRequest { - /** - * Matches the requestId from the originating httpRequestStart frame. - */ - requestId: string; - /** - * 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). - */ - data: string; - /** - * When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text. - */ - binary?: boolean; - /** - * 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. - */ - end?: boolean; - error?: LlmInferenceHttpResponseChunkError; + /** + * Matches the requestId from the originating httpRequestStart frame. + */ + requestId: string; + /** + * 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). + */ + data: string; + /** + * When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text. + */ + binary?: boolean; + /** + * 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. + */ + end?: boolean; + error?: LlmInferenceHttpResponseChunkError; } /** * Whether the chunk was accepted. @@ -9530,10 +9806,10 @@ export interface LlmInferenceHttpResponseChunkRequest { */ /** @experimental */ export interface LlmInferenceHttpResponseChunkResult { - /** - * True when the chunk was matched to a pending request; false when unknown. - */ - accepted: boolean; + /** + * True when the chunk was matched to a pending request; false when unknown. + */ + accepted: boolean; } /** * Response head. @@ -9543,19 +9819,19 @@ export interface LlmInferenceHttpResponseChunkResult { */ /** @experimental */ export interface LlmInferenceHttpResponseStartRequest { - /** - * Matches the requestId from the originating httpRequestStart frame. - */ - requestId: string; - /** - * HTTP status code. - */ - status: number; - /** - * Optional HTTP status reason phrase. - */ - statusText?: string; - headers: LlmInferenceHeaders; + /** + * Matches the requestId from the originating httpRequestStart frame. + */ + requestId: string; + /** + * HTTP status code. + */ + status: number; + /** + * Optional HTTP status reason phrase. + */ + statusText?: string; + headers: LlmInferenceHeaders; } /** * Whether the start frame was accepted. @@ -9565,10 +9841,10 @@ export interface LlmInferenceHttpResponseStartRequest { */ /** @experimental */ export interface LlmInferenceHttpResponseStartResult { - /** - * True when the response start was matched to a pending request; false when unknown. - */ - accepted: boolean; + /** + * True when the response start was matched to a pending request; false when unknown. + */ + accepted: boolean; } /** * Indicates whether the calling client was registered as the LLM inference provider. @@ -9578,10 +9854,10 @@ export interface LlmInferenceHttpResponseStartResult { */ /** @experimental */ export interface LlmInferenceSetProviderResult { - /** - * Whether the provider was set successfully - */ - success: boolean; + /** + * Whether the provider was set successfully + */ + success: boolean; } /** * Persisted local session metadata, including identifiers, timestamps, summary/name, client, context, detached state, and task ID. @@ -9591,43 +9867,43 @@ export interface LlmInferenceSetProviderResult { */ /** @experimental */ export interface LocalSessionMetadataValue { - /** - * Stable session identifier - */ - sessionId: string; - /** - * Session creation time as an ISO 8601 timestamp - */ - startTime: string; - /** - * Last-modified time of the session's persisted state, as ISO 8601 - */ - modifiedTime: string; - /** - * Short summary of the session, when one has been derived - */ - summary?: string; - /** - * Optional human-friendly name set via /rename - */ - name?: string; - /** - * Runtime client name that created/last resumed this session - */ - clientName?: string; - /** - * Always false for local sessions. - */ - isRemote: false; - /** - * True for detached maintenance sessions that should be hidden from normal resume lists. - */ - isDetached?: boolean; - context?: SessionContext; - /** - * GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control. - */ - mcTaskId?: string; + /** + * Stable session identifier + */ + sessionId: string; + /** + * Session creation time as an ISO 8601 timestamp + */ + startTime: string; + /** + * Last-modified time of the session's persisted state, as ISO 8601 + */ + modifiedTime: string; + /** + * Short summary of the session, when one has been derived + */ + summary?: string; + /** + * Optional human-friendly name set via /rename + */ + name?: string; + /** + * Runtime client name that created/last resumed this session + */ + clientName?: string; + /** + * Always false for local sessions. + */ + isRemote: false; + /** + * True for detached maintenance sessions that should be hidden from normal resume lists. + */ + isDetached?: boolean; + context?: SessionContext; + /** + * GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control. + */ + mcTaskId?: string; } /** * Pre-resolved working-directory context for session startup. @@ -9637,23 +9913,23 @@ export interface LocalSessionMetadataValue { */ /** @experimental */ export interface SessionContext { - /** - * Most recent working directory for this session - */ - cwd: string; - /** - * Git repository root, if the cwd was inside a git repo - */ - gitRoot?: string; - /** - * Repository slug in `owner/name` form, when known - */ - repository?: string; - hostType?: SessionContextHostType; - /** - * Active git branch - */ - branch?: string; + /** + * Most recent working directory for this session + */ + cwd: string; + /** + * Git repository root, if the cwd was inside a git repo + */ + gitRoot?: string; + /** + * Repository slug in `owner/name` form, when known + */ + repository?: string; + hostType?: SessionContextHostType; + /** + * Active git branch + */ + branch?: string; } /** * Message text, optional severity level, persistence flag, optional follow-up URL, and optional tip. @@ -9663,27 +9939,27 @@ export interface SessionContext { */ /** @experimental */ export interface LogRequest { - /** - * Human-readable message - */ - message: string; - level?: SessionLogLevel; - /** - * Domain category for this log entry (e.g., "mcp", "subscription", "policy", "model"). Maps to `infoType`/`warningType`/`errorType` on the emitted event. Defaults to "notification". - */ - type?: string; - /** - * When true, the message is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Optional URL the user can open in their browser for more details - */ - url?: string; - /** - * Optional actionable tip displayed alongside the message. Only honored on `level: "info"`. - */ - tip?: string; + /** + * Human-readable message + */ + message: string; + level?: SessionLogLevel; + /** + * Domain category for this log entry (e.g., "mcp", "subscription", "policy", "model"). Maps to `infoType`/`warningType`/`errorType` on the emitted event. Defaults to "notification". + */ + type?: string; + /** + * When true, the message is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Optional URL the user can open in their browser for more details + */ + url?: string; + /** + * Optional actionable tip displayed alongside the message. Only honored on `level: "info"`. + */ + tip?: string; } /** * Identifier of the session event that was emitted for the log message. @@ -9693,10 +9969,10 @@ export interface LogRequest { */ /** @experimental */ export interface LogResult { - /** - * The unique identifier of the emitted session event - */ - eventId: string; + /** + * The unique identifier of the emitted session event + */ + eventId: string; } /** * Parameters for (re)loading the merged LSP configuration set. @@ -9706,18 +9982,18 @@ export interface LogResult { */ /** @experimental */ export interface LspInitializeRequest { - /** - * Working directory used to load project-level LSP configs. Defaults to the session working directory when omitted. - */ - workingDirectory?: string; - /** - * Git root used as the boundary when traversing for project-level LSP configs (supports monorepos). - */ - gitRoot?: string; - /** - * Force re-initialization even when LSP configs were already loaded for the working directory. - */ - force?: boolean; + /** + * Working directory used to load project-level LSP configs. Defaults to the session working directory when omitted. + */ + workingDirectory?: string; + /** + * Git root used as the boundary when traversing for project-level LSP configs (supports monorepos). + */ + gitRoot?: string; + /** + * Force re-initialization even when LSP configs were already loaded for the working directory. + */ + force?: boolean; } /** * Validated device-managed settings discovered before a session exists. @@ -9727,14 +10003,14 @@ export interface LspInitializeRequest { */ /** @experimental */ export interface ManagedSettingsReadResult { - /** - * Validated, canonical managed-settings JSON. Omitted when no managed settings were discovered or when discovered settings failed validation. - */ - settingsJson?: JsonValue; - /** - * Discovery or validation error text when managed settings could not be read safely. - */ - errorMessage?: string; + /** + * Validated, canonical managed-settings JSON. Omitted when no managed settings were discovered or when discovered settings failed validation. + */ + settingsJson?: JsonValue; + /** + * Discovery or validation error text when managed settings could not be read safely. + */ + errorMessage?: string; } /** * Result of registering a new marketplace. @@ -9744,10 +10020,10 @@ export interface ManagedSettingsReadResult { */ /** @experimental */ export interface MarketplaceAddResult { - /** - * Final name of the marketplace as resolved from its manifest - */ - name: string; + /** + * Final name of the marketplace as resolved from its manifest + */ + name: string; } /** * Plugins advertised by the marketplace. @@ -9757,10 +10033,10 @@ export interface MarketplaceAddResult { */ /** @experimental */ export interface MarketplaceBrowseResult { - /** - * Plugins advertised by the marketplace - */ - plugins: MarketplacePluginInfo[]; + /** + * Plugins advertised by the marketplace + */ + plugins: MarketplacePluginInfo[]; } /** * Plugin entry advertised by a marketplace. @@ -9770,14 +10046,14 @@ export interface MarketplaceBrowseResult { */ /** @experimental */ export interface MarketplacePluginInfo { - /** - * Plugin name as listed in the marketplace catalog - */ - name: string; - /** - * Short description from the marketplace catalog, when present - */ - description?: string; + /** + * Plugin name as listed in the marketplace catalog + */ + name: string; + /** + * Short description from the marketplace catalog, when present + */ + description?: string; } /** * Registered marketplace summary. @@ -9787,18 +10063,18 @@ export interface MarketplacePluginInfo { */ /** @experimental */ export interface MarketplaceInfo { - /** - * Marketplace name (matches the @marketplace suffix in plugin specs) - */ - name: string; - /** - * Human-readable description of where the marketplace data is fetched from (e.g. "GitHub: owner/repo"). - */ - source: string; - /** - * True when this is a default marketplace shipped with the runtime. Defaults are not removable. - */ - isDefault?: boolean; + /** + * Marketplace name (matches the @marketplace suffix in plugin specs) + */ + name: string; + /** + * Human-readable description of where the marketplace data is fetched from (e.g. "GitHub: owner/repo"). + */ + source: string; + /** + * True when this is a default marketplace shipped with the runtime. Defaults are not removable. + */ + isDefault?: boolean; } /** * All registered marketplaces, including built-in defaults. @@ -9808,10 +10084,10 @@ export interface MarketplaceInfo { */ /** @experimental */ export interface MarketplaceListResult { - /** - * Registered marketplaces - */ - marketplaces: MarketplaceInfo[]; + /** + * Registered marketplaces + */ + marketplaces: MarketplaceInfo[]; } /** * Per-marketplace refresh result, including marketplace name, success flag, and optional failure error. @@ -9821,18 +10097,18 @@ export interface MarketplaceListResult { */ /** @experimental */ export interface MarketplaceRefreshEntry { - /** - * Marketplace name that was refreshed - */ - name: string; - /** - * Whether the refresh succeeded - */ - success: boolean; - /** - * Error message (failure only) - */ - error?: string; + /** + * Marketplace name that was refreshed + */ + name: string; + /** + * Whether the refresh succeeded + */ + success: boolean; + /** + * Error message (failure only) + */ + error?: string; } /** * Result of refreshing one or more marketplace catalogs. @@ -9842,10 +10118,10 @@ export interface MarketplaceRefreshEntry { */ /** @experimental */ export interface MarketplaceRefreshResult { - /** - * Per-marketplace refresh results in deterministic order. - */ - results: MarketplaceRefreshEntry[]; + /** + * Per-marketplace refresh results in deterministic order. + */ + results: MarketplaceRefreshEntry[]; } /** * Outcome of the remove attempt, including dependent-plugin info when applicable. @@ -9855,14 +10131,14 @@ export interface MarketplaceRefreshResult { */ /** @experimental */ export interface MarketplaceRemoveResult { - /** - * True when the marketplace was actually removed. False when removal was skipped because the marketplace has dependent plugins and `force` was not set. - */ - removed: boolean; - /** - * Names of installed plugins that prevented removal. Populated only when `removed=false`. - */ - dependentPlugins?: string[]; + /** + * True when the marketplace was actually removed. False when removal was skipped because the marketplace has dependent plugins and `force` was not set. + */ + removed: boolean; + /** + * Names of installed plugins that prevented removal. Populated only when `removed=false`. + */ + dependentPlugins?: string[]; } /** * MCP server allowed by policy, with server name and optional PII-free explanatory note. @@ -9872,14 +10148,14 @@ export interface MarketplaceRemoveResult { */ /** @experimental */ export interface McpAllowedServer { - /** - * Allowed server name - */ - name: string; - /** - * PII-free note explaining why the server was allowed - */ - redactedNote?: string; + /** + * Allowed server name + */ + name: string; + /** + * PII-free note explaining why the server was allowed + */ + redactedNote?: string; } /** * MCP server, tool name, and arguments to invoke from an MCP App view. @@ -9889,24 +10165,24 @@ export interface McpAllowedServer { */ /** @experimental */ export interface McpAppsCallToolRequest { - /** - * MCP server hosting the tool - */ - serverName: string; - /** - * MCP tool name - */ - toolName: string; - /** - * Tool arguments - */ - arguments?: { - [k: string]: JsonValue | undefined; - }; - /** - * **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. - */ - originServerName: string; + /** + * MCP server hosting the tool + */ + serverName: string; + /** + * MCP tool name + */ + toolName: string; + /** + * Tool arguments + */ + arguments?: { + [k: string]: JsonValue | undefined; + }; + /** + * **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. + */ + originServerName: string; } /** * Capability negotiation snapshot @@ -9916,18 +10192,18 @@ export interface McpAppsCallToolRequest { */ /** @experimental */ export interface McpAppsDiagnoseCapability { - /** - * Whether the session has the `mcp-apps` capability - */ - sessionHasMcpApps: boolean; - /** - * Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on - */ - featureFlagEnabled: boolean; - /** - * Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers - */ - advertised: boolean; + /** + * Whether the session has the `mcp-apps` capability + */ + sessionHasMcpApps: boolean; + /** + * Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on + */ + featureFlagEnabled: boolean; + /** + * Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers + */ + advertised: boolean; } /** * MCP server to diagnose MCP Apps wiring for. @@ -9937,10 +10213,10 @@ export interface McpAppsDiagnoseCapability { */ /** @experimental */ export interface McpAppsDiagnoseRequest { - /** - * MCP server to probe - */ - serverName: string; + /** + * MCP server to probe + */ + serverName: string; } /** * Diagnostic snapshot of MCP Apps wiring for the named server. @@ -9950,8 +10226,8 @@ export interface McpAppsDiagnoseRequest { */ /** @experimental */ export interface McpAppsDiagnoseResult { - capability: McpAppsDiagnoseCapability; - server: McpAppsDiagnoseServer; + capability: McpAppsDiagnoseCapability; + server: McpAppsDiagnoseServer; } /** * What the server returned for this session @@ -9961,22 +10237,22 @@ export interface McpAppsDiagnoseResult { */ /** @experimental */ export interface McpAppsDiagnoseServer { - /** - * Whether the named server is currently connected - */ - connected: boolean; - /** - * Total tools returned by the server's tools/list - */ - toolCount: number; - /** - * Tools whose `_meta.ui` is populated (resourceUri and/or visibility set) - */ - toolsWithUiMeta: number; - /** - * Up to 5 tool names with `_meta.ui` for quick inspection - */ - sampleToolNames: string[]; + /** + * Whether the named server is currently connected + */ + connected: boolean; + /** + * Total tools returned by the server's tools/list + */ + toolCount: number; + /** + * Tools whose `_meta.ui` is populated (resourceUri and/or visibility set) + */ + toolsWithUiMeta: number; + /** + * Up to 5 tool names with `_meta.ui` for quick inspection + */ + sampleToolNames: string[]; } /** * Current host context advertised to MCP App guests. @@ -9986,7 +10262,7 @@ export interface McpAppsDiagnoseServer { */ /** @experimental */ export interface McpAppsHostContext { - context: McpAppsHostContextDetails; + context: McpAppsHostContextDetails; } /** * Current host context @@ -9996,26 +10272,26 @@ export interface McpAppsHostContext { */ /** @experimental */ export interface McpAppsHostContextDetails { - theme?: McpAppsHostContextDetailsTheme; - /** - * BCP-47 locale, e.g. 'en-US' - */ - locale?: string; - /** - * IANA timezone, e.g. 'America/New_York' - */ - timeZone?: string; - displayMode?: McpAppsHostContextDetailsDisplayMode; - /** - * Display modes the host supports - */ - availableDisplayModes?: McpAppsHostContextDetailsAvailableDisplayMode[]; - platform?: McpAppsHostContextDetailsPlatform; - /** - * Host application identifier - */ - userAgent?: string; - [k: string]: unknown | undefined; + theme?: McpAppsHostContextDetailsTheme; + /** + * BCP-47 locale, e.g. 'en-US' + */ + locale?: string; + /** + * IANA timezone, e.g. 'America/New_York' + */ + timeZone?: string; + displayMode?: McpAppsHostContextDetailsDisplayMode; + /** + * Display modes the host supports + */ + availableDisplayModes?: McpAppsHostContextDetailsAvailableDisplayMode[]; + platform?: McpAppsHostContextDetailsPlatform; + /** + * Host application identifier + */ + userAgent?: string; + [k: string]: unknown | undefined; } /** * MCP server to list app-callable tools for. @@ -10025,14 +10301,14 @@ export interface McpAppsHostContextDetails { */ /** @experimental */ export interface McpAppsListToolsRequest { - /** - * MCP server hosting the app - */ - serverName: string; - /** - * **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. - */ - originServerName: string; + /** + * MCP server hosting the app + */ + serverName: string; + /** + * **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. + */ + originServerName: string; } /** * App-callable tools from the named MCP server. @@ -10042,12 +10318,12 @@ export interface McpAppsListToolsRequest { */ /** @experimental */ export interface McpAppsListToolsResult { - /** - * App-callable tools from the server - */ - tools: { - [k: string]: JsonValue | undefined; - }[]; + /** + * App-callable tools from the server + */ + tools: { + [k: string]: JsonValue | undefined; + }[]; } /** * MCP server and resource URI to fetch. @@ -10057,14 +10333,14 @@ export interface McpAppsListToolsResult { */ /** @experimental */ export interface McpAppsReadResourceRequest { - /** - * Name of the MCP server hosting the resource - */ - serverName: string; - /** - * Resource URI (typically ui://...) - */ - uri: string; + /** + * Name of the MCP server hosting the resource + */ + serverName: string; + /** + * Resource URI (typically ui://...) + */ + uri: string; } /** * Resource contents returned by the MCP server. @@ -10074,10 +10350,10 @@ export interface McpAppsReadResourceRequest { */ /** @experimental */ export interface McpAppsReadResourceResult { - /** - * Resource contents returned by the server - */ - contents: McpAppsResourceContent[]; + /** + * Resource contents returned by the server + */ + contents: McpAppsResourceContent[]; } /** * MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource metadata. @@ -10087,28 +10363,28 @@ export interface McpAppsReadResourceResult { */ /** @experimental */ export interface McpAppsResourceContent { - /** - * The resource URI (typically ui://...) - */ - uri: string; - /** - * MIME type of the content - */ - mimeType?: string; - /** - * Text content (e.g. HTML) - */ - text?: string; - /** - * Base64-encoded binary content - */ - blob?: string; - /** - * Resource-level metadata (CSP, permissions, etc.) - */ - _meta?: { - [k: string]: JsonValue | undefined; - }; + /** + * The resource URI (typically ui://...) + */ + uri: string; + /** + * MIME type of the content + */ + mimeType?: string; + /** + * Text content (e.g. HTML) + */ + text?: string; + /** + * Base64-encoded binary content + */ + blob?: string; + /** + * Resource-level metadata (CSP, permissions, etc.) + */ + _meta?: { + [k: string]: JsonValue | undefined; + }; } /** * Host context advertised to MCP App guests @@ -10118,26 +10394,26 @@ export interface McpAppsResourceContent { */ /** @experimental */ export interface McpAppsSetHostContextDetails { - theme?: McpAppsSetHostContextDetailsTheme; - /** - * BCP-47 locale, e.g. 'en-US' - */ - locale?: string; - /** - * IANA timezone, e.g. 'America/New_York' - */ - timeZone?: string; - displayMode?: McpAppsSetHostContextDetailsDisplayMode; - /** - * Display modes the host supports - */ - availableDisplayModes?: McpAppsSetHostContextDetailsAvailableDisplayMode[]; - platform?: McpAppsSetHostContextDetailsPlatform; - /** - * Host application identifier - */ - userAgent?: string; - [k: string]: unknown | undefined; + theme?: McpAppsSetHostContextDetailsTheme; + /** + * BCP-47 locale, e.g. 'en-US' + */ + locale?: string; + /** + * IANA timezone, e.g. 'America/New_York' + */ + timeZone?: string; + displayMode?: McpAppsSetHostContextDetailsDisplayMode; + /** + * Display modes the host supports + */ + availableDisplayModes?: McpAppsSetHostContextDetailsAvailableDisplayMode[]; + platform?: McpAppsSetHostContextDetailsPlatform; + /** + * Host application identifier + */ + userAgent?: string; + [k: string]: unknown | undefined; } /** * Host context to advertise to MCP App guests. @@ -10147,7 +10423,7 @@ export interface McpAppsSetHostContextDetails { */ /** @experimental */ export interface McpAppsSetHostContextRequest { - context: McpAppsSetHostContextDetails; + context: McpAppsSetHostContextDetails; } /** * The requestId previously passed to executeSampling that should be cancelled. @@ -10157,10 +10433,10 @@ export interface McpAppsSetHostContextRequest { */ /** @experimental */ export interface McpCancelSamplingExecutionParams { - /** - * The requestId previously passed to executeSampling that should be cancelled - */ - requestId: string; + /** + * The requestId previously passed to executeSampling that should be cancelled + */ + requestId: string; } /** * Indicates whether an in-flight sampling execution with the given requestId was found and cancelled. @@ -10170,10 +10446,10 @@ export interface McpCancelSamplingExecutionParams { */ /** @experimental */ export interface McpCancelSamplingExecutionResult { - /** - * True if an in-flight execution with the given requestId was found and signalled to cancel. False when no such execution is in flight (already completed, never started, or cancelled by another caller). - */ - cancelled: boolean; + /** + * True if an in-flight execution with the given requestId was found and signalled to cancel. False when no such execution is in flight (already completed, never started, or cancelled by another caller). + */ + cancelled: boolean; } /** * MCP server name and configuration to add to user configuration. @@ -10183,11 +10459,11 @@ export interface McpCancelSamplingExecutionResult { */ /** @experimental */ export interface McpConfigAddRequest { - /** - * Unique name for the MCP server - */ - name: string; - config: McpSerializableServerConfig; + /** + * Unique name for the MCP server + */ + name: string; + config: McpSerializableServerConfig; } /** * Stdio MCP server configuration launched as a child process. @@ -10197,87 +10473,87 @@ export interface McpConfigAddRequest { */ /** @experimental */ export interface McpServerConfigStdio { - /** - * Optional human-readable server name. - */ - displayName?: string; - safeForTelemetry?: McpSafeForTelemetry; - /** - * Tools to include. Defaults to all tools if not specified. - */ - tools?: string[]; - /** - * Whether this server is a built-in fallback used when the user has not configured their own server. - */ - isDefaultServer?: boolean; - filterMapping?: FilterMapping; - /** - * Timeout in milliseconds for tool discovery and tool calls. - */ - timeout?: number; - oidc?: McpServerAuthConfig; - auth?: McpServerAuthConfig; - deferTools?: McpServerConfigDeferTools; - /** - * Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery is unaffected. - */ - disableToolCache?: boolean; - /** - * Whether secret masking is disabled for calls to this server. - */ - disableSecretMasking?: boolean; - /** - * Tool names excluded after the include filter is applied. - */ - excludeTools?: string[]; - /** - * Event types this server receives as Copilot notifications. - */ - events?: string[]; - /** - * Copilot notification types this server may send to the host. - */ - notifications?: string[]; - source?: McpServerSource; - /** - * Plugin that provided this server. - */ - sourcePlugin?: string; - /** - * Version of the plugin that provided this server. - */ - sourcePluginVersion?: string; - /** - * Whether the providing plugin uses the Open Plugin Spec. - */ - sourcePluginSpec?: boolean; - /** - * Source file path recorded while loading the config. - */ - sourcePath?: string; - /** - * Configuration warnings recorded while loading the server. - */ - configWarnings?: string[]; - /** - * Executable command used to start the Stdio MCP server process. - */ - command: string; - /** - * Command-line arguments passed to the Stdio MCP server process. - */ - args?: string[]; - /** - * Working directory for the Stdio MCP server process. - */ - cwd?: string; - /** - * Environment variables to pass to the Stdio MCP server process. - */ - env?: { - [k: string]: string | undefined; - }; - type?: McpServerConfigStdioType; + /** + * Optional human-readable server name. + */ + displayName?: string; + safeForTelemetry?: McpSafeForTelemetry; + /** + * Tools to include. Defaults to all tools if not specified. + */ + tools?: string[]; + /** + * Whether this server is a built-in fallback used when the user has not configured their own server. + */ + isDefaultServer?: boolean; + filterMapping?: FilterMapping; + /** + * Timeout in milliseconds for tool discovery and tool calls. + */ + timeout?: number; + oidc?: McpServerAuthConfig; + auth?: McpServerAuthConfig; + deferTools?: McpServerConfigDeferTools; + /** + * Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery is unaffected. + */ + disableToolCache?: boolean; + /** + * Whether secret masking is disabled for calls to this server. + */ + disableSecretMasking?: boolean; + /** + * Tool names excluded after the include filter is applied. + */ + excludeTools?: string[]; + /** + * Event types this server receives as Copilot notifications. + */ + events?: string[]; + /** + * Copilot notification types this server may send to the host. + */ + notifications?: string[]; + source?: McpServerSource; + /** + * Plugin that provided this server. + */ + sourcePlugin?: string; + /** + * Version of the plugin that provided this server. + */ + sourcePluginVersion?: string; + /** + * Whether the providing plugin uses the Open Plugin Spec. + */ + sourcePluginSpec?: boolean; + /** + * Source file path recorded while loading the config. + */ + sourcePath?: string; + /** + * Configuration warnings recorded while loading the server. + */ + configWarnings?: string[]; + /** + * Executable command used to start the Stdio MCP server process. + */ + command: string; + /** + * Command-line arguments passed to the Stdio MCP server process. + */ + args?: string[]; + /** + * Working directory for the Stdio MCP server process. + */ + cwd?: string; + /** + * Environment variables to pass to the Stdio MCP server process. + */ + env?: { + [k: string]: string | undefined; + }; + type?: McpServerConfigStdioType; } /** * Per-field MCP telemetry-obfuscation policy. @@ -10287,14 +10563,14 @@ export interface McpServerConfigStdio { */ /** @experimental */ export interface McpSafeForTelemetryFields { - /** - * Whether the MCP tool name may be included in telemetry without obfuscation. - */ - name: boolean; - /** - * Whether MCP tool input names may be included in telemetry without obfuscation. - */ - inputsNames: boolean; + /** + * Whether the MCP tool name may be included in telemetry without obfuscation. + */ + name: boolean; + /** + * Whether MCP tool input names may be included in telemetry without obfuscation. + */ + inputsNames: boolean; } /** * Authentication settings with optional redirect port configuration. @@ -10304,10 +10580,10 @@ export interface McpSafeForTelemetryFields { */ /** @experimental */ export interface McpServerAuthConfigRedirectPort { - /** - * Fixed port for the OAuth redirect callback server. - */ - redirectPort?: number; + /** + * Fixed port for the OAuth redirect callback server. + */ + redirectPort?: number; } /** * Remote MCP server configuration accessed over HTTP or SSE. @@ -10317,92 +10593,92 @@ export interface McpServerAuthConfigRedirectPort { */ /** @experimental */ export interface McpServerConfigHttp { - /** - * Optional human-readable server name. - */ - displayName?: string; - safeForTelemetry?: McpSafeForTelemetry; - /** - * Tools to include. Defaults to all tools if not specified. - */ - tools?: string[]; - type?: McpServerConfigHttpType; - /** - * Whether this server is a built-in fallback used when the user has not configured their own server. - */ - isDefaultServer?: boolean; - filterMapping?: FilterMapping; - /** - * Timeout in milliseconds for tool discovery and tool calls. - */ - timeout?: number; - oidc?: McpServerAuthConfig; - auth?: McpServerAuthConfig; - deferTools?: McpServerConfigDeferTools; - /** - * Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery is unaffected. - */ - disableToolCache?: boolean; - /** - * Whether secret masking is disabled for calls to this server. - */ - disableSecretMasking?: boolean; - /** - * Tool names excluded after the include filter is applied. - */ - excludeTools?: string[]; - /** - * Event types this server receives as Copilot notifications. - */ - events?: string[]; - /** - * Copilot notification types this server may send to the host. - */ - notifications?: string[]; - source?: McpServerSource; - /** - * Plugin that provided this server. - */ - sourcePlugin?: string; - /** - * Version of the plugin that provided this server. - */ - sourcePluginVersion?: string; - /** - * Whether the providing plugin uses the Open Plugin Spec. - */ - sourcePluginSpec?: boolean; - /** - * Source file path recorded while loading the config. - */ - sourcePath?: string; - /** - * Configuration warnings recorded while loading the server. - */ - configWarnings?: string[]; - /** - * URL of the remote MCP server endpoint. - */ - url: string; - /** - * HTTP headers to include in requests to the remote MCP server. - */ - headers?: { - [k: string]: string | undefined; - }; - /** - * Dynamic-header refresh cache lifetime in milliseconds. - */ - headersRefreshTtlMs?: number; - /** - * OAuth client ID for a pre-registered remote MCP OAuth client. - */ - oauthClientId?: string; - /** - * Whether the configured OAuth client is public and does not require a client secret. - */ - oauthPublicClient?: boolean; - oauthGrantType?: McpServerConfigHttpOauthGrantType; + /** + * Optional human-readable server name. + */ + displayName?: string; + safeForTelemetry?: McpSafeForTelemetry; + /** + * Tools to include. Defaults to all tools if not specified. + */ + tools?: string[]; + type?: McpServerConfigHttpType; + /** + * Whether this server is a built-in fallback used when the user has not configured their own server. + */ + isDefaultServer?: boolean; + filterMapping?: FilterMapping; + /** + * Timeout in milliseconds for tool discovery and tool calls. + */ + timeout?: number; + oidc?: McpServerAuthConfig; + auth?: McpServerAuthConfig; + deferTools?: McpServerConfigDeferTools; + /** + * Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery is unaffected. + */ + disableToolCache?: boolean; + /** + * Whether secret masking is disabled for calls to this server. + */ + disableSecretMasking?: boolean; + /** + * Tool names excluded after the include filter is applied. + */ + excludeTools?: string[]; + /** + * Event types this server receives as Copilot notifications. + */ + events?: string[]; + /** + * Copilot notification types this server may send to the host. + */ + notifications?: string[]; + source?: McpServerSource; + /** + * Plugin that provided this server. + */ + sourcePlugin?: string; + /** + * Version of the plugin that provided this server. + */ + sourcePluginVersion?: string; + /** + * Whether the providing plugin uses the Open Plugin Spec. + */ + sourcePluginSpec?: boolean; + /** + * Source file path recorded while loading the config. + */ + sourcePath?: string; + /** + * Configuration warnings recorded while loading the server. + */ + configWarnings?: string[]; + /** + * URL of the remote MCP server endpoint. + */ + url: string; + /** + * HTTP headers to include in requests to the remote MCP server. + */ + headers?: { + [k: string]: string | undefined; + }; + /** + * Dynamic-header refresh cache lifetime in milliseconds. + */ + headersRefreshTtlMs?: number; + /** + * OAuth client ID for a pre-registered remote MCP OAuth client. + */ + oauthClientId?: string; + /** + * Whether the configured OAuth client is public and does not require a client secret. + */ + oauthPublicClient?: boolean; + oauthGrantType?: McpServerConfigHttpOauthGrantType; } /** * MCP server names to disable for new sessions. @@ -10412,10 +10688,10 @@ export interface McpServerConfigHttp { */ /** @experimental */ export interface McpConfigDisableRequest { - /** - * Names of MCP servers to disable. Each server is added to the persisted disabled list so new sessions skip it. Already-disabled names are ignored. Active sessions keep their current connections until they end. - */ - names: string[]; + /** + * Names of MCP servers to disable. Each server is added to the persisted disabled list so new sessions skip it. Already-disabled names are ignored. Active sessions keep their current connections until they end. + */ + names: string[]; } /** * MCP server names to enable for new sessions. @@ -10425,10 +10701,10 @@ export interface McpConfigDisableRequest { */ /** @experimental */ export interface McpConfigEnableRequest { - /** - * Names of MCP servers to enable. Each server is removed from the persisted disabled list so new sessions spawn it. Unknown or already-enabled names are ignored. - */ - names: string[]; + /** + * Names of MCP servers to enable. Each server is removed from the persisted disabled list so new sessions spawn it. Unknown or already-enabled names are ignored. + */ + names: string[]; } /** * User-configured MCP servers, keyed by server name. @@ -10438,12 +10714,12 @@ export interface McpConfigEnableRequest { */ /** @experimental */ export interface McpConfigList { - /** - * All MCP servers from user config, keyed by name - */ - servers: { - [k: string]: McpSerializableServerConfig; - }; + /** + * All MCP servers from user config, keyed by name + */ + servers: { + [k: string]: McpSerializableServerConfig; + }; } /** * MCP server name to remove from user configuration. @@ -10453,10 +10729,14 @@ export interface McpConfigList { */ /** @experimental */ export interface McpConfigRemoveRequest { - /** - * Name of the MCP server to remove - */ - name: string; + /** + * Name of the MCP server to remove + */ + name: string; + /** + * OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. + */ + authClientIdMetadataUrl?: string; } /** * MCP server name and replacement configuration to write to user configuration. @@ -10466,11 +10746,11 @@ export interface McpConfigRemoveRequest { */ /** @experimental */ export interface McpConfigUpdateRequest { - /** - * Name of the MCP server to update - */ - name: string; - config: McpSerializableServerConfig; + /** + * Name of the MCP server to update + */ + name: string; + config: McpSerializableServerConfig; } /** * Credential-free authentication identity used to configure GitHub MCP. @@ -10481,12 +10761,12 @@ export interface McpConfigUpdateRequest { /** @experimental */ /** @internal */ export interface McpConfigureGitHubRequest { - /** - * Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire). - * - * @internal - */ - authInfo: OpaqueInProcessValue; + /** + * Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire). + * + * @internal + */ + authInfo: OpaqueInProcessValue; } /** * Result of configuring GitHub MCP. @@ -10496,10 +10776,10 @@ export interface McpConfigureGitHubRequest { */ /** @experimental */ export interface McpConfigureGitHubResult { - /** - * Whether GitHub MCP configuration changed. - */ - changed: boolean; + /** + * Whether GitHub MCP configuration changed. + */ + changed: boolean; } /** * Name of the MCP server to disable for the session. @@ -10509,10 +10789,10 @@ export interface McpConfigureGitHubResult { */ /** @experimental */ export interface McpDisableRequest { - /** - * Name of the MCP server to disable - */ - serverName: string; + /** + * Name of the MCP server to disable + */ + serverName: string; } /** * Optional working directory used as context for MCP server discovery. @@ -10522,10 +10802,10 @@ export interface McpDisableRequest { */ /** @experimental */ export interface McpDiscoverRequest { - /** - * Working directory used as context for discovery (e.g., plugin resolution) - */ - workingDirectory?: string; + /** + * Working directory used as context for discovery (e.g., plugin resolution) + */ + workingDirectory?: string; } /** * MCP servers discovered from user, workspace, plugin, and built-in sources. @@ -10535,10 +10815,10 @@ export interface McpDiscoverRequest { */ /** @experimental */ export interface McpDiscoverResult { - /** - * MCP servers discovered from all sources - */ - servers: DiscoveredMcpServer[]; + /** + * MCP servers discovered from all sources + */ + servers: DiscoveredMcpServer[]; } /** * Name of the MCP server to enable for the session. @@ -10548,10 +10828,10 @@ export interface McpDiscoverResult { */ /** @experimental */ export interface McpEnableRequest { - /** - * Name of the MCP server to enable - */ - serverName: string; + /** + * Name of the MCP server to enable + */ + serverName: string; } /** * Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference. @@ -10561,19 +10841,19 @@ export interface McpEnableRequest { */ /** @experimental */ export interface McpExecuteSamplingParams { - /** - * Caller-provided unique identifier for this sampling execution. Use this same ID with cancelSamplingExecution to cancel the in-flight call. Must be unique within the session for the lifetime of the call. - */ - requestId: string; - /** - * Name of the MCP server that initiated the sampling request - */ - serverName: string; - /** - * 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). - */ - mcpRequestId: JsonValue; - request: McpExecuteSamplingRequest; + /** + * Caller-provided unique identifier for this sampling execution. Use this same ID with cancelSamplingExecution to cancel the in-flight call. Must be unique within the session for the lifetime of the call. + */ + requestId: string; + /** + * Name of the MCP server that initiated the sampling request + */ + serverName: string; + /** + * 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). + */ + mcpRequestId: JsonValue; + request: McpExecuteSamplingRequest; } /** * Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally. @@ -10583,7 +10863,7 @@ export interface McpExecuteSamplingParams { */ /** @experimental */ export interface McpExecuteSamplingRequest { - [k: string]: unknown | undefined; + [k: string]: unknown | undefined; } /** * MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape. @@ -10593,7 +10873,7 @@ export interface McpExecuteSamplingRequest { */ /** @experimental */ export interface McpExecuteSamplingResult { - [k: string]: unknown | undefined; + [k: string]: unknown | undefined; } /** * MCP server whose connection attempt failed. @@ -10603,14 +10883,14 @@ export interface McpExecuteSamplingResult { */ /** @experimental */ export interface McpFailedServer { - /** - * The config key of the server that failed to connect. - */ - name: string; - /** - * The captured connection failure detail. - */ - error?: string; + /** + * The config key of the server that failed to connect. + */ + name: string; + /** + * The captured connection failure detail. + */ + error?: string; } /** * MCP server filtered by policy, with name, reason, and optional redacted reason. @@ -10620,23 +10900,23 @@ export interface McpFailedServer { */ /** @experimental */ export interface McpFilteredServer { - /** - * Filtered server name - */ - name: string; - /** - * Human-readable filter reason - */ - reason: string; - /** - * PII-free filter reason - */ - redactedReason?: string; - /** - * @deprecated - * Deprecated. This field is no longer populated. - */ - enterpriseName?: string; + /** + * Filtered server name + */ + name: string; + /** + * Human-readable filter reason + */ + reason: string; + /** + * PII-free filter reason + */ + redactedReason?: string; + /** + * @deprecated + * Deprecated. This field is no longer populated. + */ + enterpriseName?: string; } /** * MCP headers refresh request id and the host response. @@ -10646,11 +10926,11 @@ export interface McpFilteredServer { */ /** @experimental */ export interface McpHeadersHandlePendingHeadersRefreshRequestRequest { - /** - * Headers refresh request identifier from mcp.headers_refresh_required - */ - requestId: string; - result: McpHeadersHandlePendingHeadersRefreshRequest; + /** + * Headers refresh request identifier from mcp.headers_refresh_required + */ + requestId: string; + result: McpHeadersHandlePendingHeadersRefreshRequest; } /** * Indicates whether the pending MCP headers refresh response was accepted. @@ -10660,10 +10940,10 @@ export interface McpHeadersHandlePendingHeadersRefreshRequestRequest { */ /** @experimental */ export interface McpHeadersHandlePendingHeadersRefreshRequestResult { - /** - * Whether the response was accepted. False if the request was unknown, timed out, or already resolved. - */ - success: boolean; + /** + * Whether the response was accepted. False if the request was unknown, timed out, or already resolved. + */ + success: boolean; } /** * Host-level state, omitted when no MCP host is initialized. @@ -10673,38 +10953,38 @@ export interface McpHeadersHandlePendingHeadersRefreshRequestResult { */ /** @experimental */ export interface McpHostState { - /** - * Whether third-party MCP servers are policy-enabled for this session. - */ - mcp3pEnabled: boolean; - /** - * Configured servers that are explicitly disabled. - */ - disabledServers: string[]; - /** - * Configured servers filtered out by MCP server policy. - */ - filteredServers: string[]; - /** - * Names of currently-connected MCP clients. - */ - clients: string[]; - /** - * Names of servers with in-flight connection attempts. - */ - pendingConnections: string[]; - /** - * Map of server name to recorded connection failure. - */ - failedServers: { - [k: string]: McpServerFailureInfo | undefined; - }; - /** - * Map of server name to recorded pending-auth state. - */ - needsAuthServers: { - [k: string]: McpServerNeedsAuthInfo | undefined; - }; + /** + * Whether third-party MCP servers are policy-enabled for this session. + */ + mcp3pEnabled: boolean; + /** + * Configured servers that are explicitly disabled. + */ + disabledServers: string[]; + /** + * Configured servers filtered out by MCP server policy. + */ + filteredServers: string[]; + /** + * Names of currently-connected MCP clients. + */ + clients: string[]; + /** + * Names of servers with in-flight connection attempts. + */ + pendingConnections: string[]; + /** + * Map of server name to recorded connection failure. + */ + failedServers: { + [k: string]: McpServerFailureInfo | undefined; + }; + /** + * Map of server name to recorded pending-auth state. + */ + needsAuthServers: { + [k: string]: McpServerNeedsAuthInfo | undefined; + }; } /** * Recorded MCP server connection failure. @@ -10714,14 +10994,14 @@ export interface McpHostState { */ /** @experimental */ export interface McpServerFailureInfo { - /** - * Failure message produced when the MCP server connection failed. - */ - message: string; - /** - * epoch-ms timestamp at which the failure was recorded. - */ - timestamp: number; + /** + * Failure message produced when the MCP server connection failed. + */ + message: string; + /** + * epoch-ms timestamp at which the failure was recorded. + */ + timestamp: number; } /** * Recorded MCP server pending-auth state. @@ -10731,10 +11011,10 @@ export interface McpServerFailureInfo { */ /** @experimental */ export interface McpServerNeedsAuthInfo { - /** - * epoch-ms timestamp at which the server signalled it needs authentication. - */ - timestamp: number; + /** + * epoch-ms timestamp at which the server signalled it needs authentication. + */ + timestamp: number; } /** * A normalised, inert description of what installing an MCP server would involve. Carries no raw card, no install specification, and no secret value. @@ -10744,41 +11024,41 @@ export interface McpServerNeedsAuthInfo { */ /** @experimental */ export interface McpInstallPlan { - /** - * Opaque, runtime-instance scoped, TTL-bound, single-use handle for this plan. Rejected when stale, replayed, or presented to a different runtime instance. Never logged. - */ - planHandle: string; - /** - * ISO 8601 timestamp after which the plan handle is stale and will be rejected. Abandoning a plan needs no call: an unused handle simply expires, so cancellation before commit is side-effect free. - */ - planHandleExpiresAt: string; - identity: McpPlanResourceIdentity; - provenance: McpPlanProvenance; - /** - * Every eligible transport, so a host can present an explicit choice. A completed plan always has at least one; when none is eligible, planning returns `CatalogUnavailableTransportError` instead. - * - * @minItems 1 - * @maxItems 50 - */ - transportChoices: [McpPlanTransportChoice, ...McpPlanTransportChoice[]]; - /** - * Identifier of the choice the runtime would pick by default. Omitted when there is no eligible transport, or when the runtime expresses no preference. - */ - recommendedTransportChoiceId?: string; - target: McpPlanTarget; - policy: McpPlanPolicyResult; - /** - * The configuration changes installing would make, described rather than serialised, so the mutable configuration payload stays behind the runtime boundary. - */ - configurationChanges: McpPlanConfigurationChange[]; - /** - * Whether applying this plan would require an MCP reload to take effect. Planning itself never reloads. - */ - reloadRequired: boolean; - /** - * Whether the plan cannot be applied without further input, because a required value has no default or a secret must be supplied. - */ - requiresInteractiveConfiguration: boolean; + /** + * Opaque, runtime-instance scoped, TTL-bound, single-use handle for this plan. Rejected when stale, replayed, or presented to a different runtime instance. Never logged. + */ + planHandle: string; + /** + * ISO 8601 timestamp after which the plan handle is stale and will be rejected. Abandoning a plan needs no call: an unused handle simply expires, so cancellation before commit is side-effect free. + */ + planHandleExpiresAt: string; + identity: McpPlanResourceIdentity; + provenance: McpPlanProvenance; + /** + * Every eligible transport, so a host can present an explicit choice. A completed plan always has at least one; when none is eligible, planning returns `CatalogUnavailableTransportError` instead. + * + * @minItems 1 + * @maxItems 50 + */ + transportChoices: [McpPlanTransportChoice, ...McpPlanTransportChoice[]]; + /** + * Identifier of the choice the runtime would pick by default. Omitted when there is no eligible transport, or when the runtime expresses no preference. + */ + recommendedTransportChoiceId?: string; + target: McpPlanTarget; + policy: McpPlanPolicyResult; + /** + * The configuration changes installing would make, described rather than serialised, so the mutable configuration payload stays behind the runtime boundary. + */ + configurationChanges: McpPlanConfigurationChange[]; + /** + * Whether applying this plan would require an MCP reload to take effect. Planning itself never reloads. + */ + reloadRequired: boolean; + /** + * Whether the plan cannot be applied without further input, because a required value has no default or a secret must be supplied. + */ + requiresInteractiveConfiguration: boolean; } /** * Normalised identity of the MCP server a plan targets, independent of how the card spelled it. @@ -10788,22 +11068,22 @@ export interface McpInstallPlan { */ /** @experimental */ export interface McpPlanResourceIdentity { - /** - * Canonical, normalised name of the server, for example `io.github.owner/server`. - */ - canonicalName: string; - /** - * Local configuration key the server would be recorded under. - */ - serverName: string; - /** - * Version advertised by the card, when it declares one. - */ - version?: string; - /** - * Registry identifier of the server, when it came from a registry. - */ - registryId?: string; + /** + * Canonical, normalised name of the server, for example `io.github.owner/server`. + */ + canonicalName: string; + /** + * Local configuration key the server would be recorded under. + */ + serverName: string; + /** + * Version advertised by the card, when it declares one. + */ + version?: string; + /** + * Registry identifier of the server, when it came from a registry. + */ + registryId?: string; } /** * Provenance of the exact validated JSON MCP card content bound privately to a completed plan and its opaque handle. @@ -10813,16 +11093,16 @@ export interface McpPlanResourceIdentity { */ /** @experimental */ export interface McpPlanProvenance { - /** - * Authority associated with the validated card, without path, query, or credentials. Inert untrusted data. - */ - authority: string; - /** - * ISO 8601 timestamp at which the runtime completed strict parsing and schema validation of the card content. - */ - validatedAt: string; - cardDigest: CardDigest; - mediaType: McpServerCardMediaType; + /** + * Authority associated with the validated card, without path, query, or credentials. Inert untrusted data. + */ + authority: string; + /** + * ISO 8601 timestamp at which the runtime completed strict parsing and schema validation of the card content. + */ + validatedAt: string; + cardDigest: CardDigest; + mediaType: McpServerCardMediaType; } /** * An eligible local-package transport choice. Package identity is required and a remote endpoint cannot be represented. @@ -10832,28 +11112,28 @@ export interface McpPlanProvenance { */ /** @experimental */ export interface McpPlanTransportChoicePackage { - /** - * Stable identifier for this choice within the plan, used to select it when the plan is applied. - */ - choiceId: string; - transport: McpPlanPackageTransport; - installMethod: McpPlanPackageInstallMethod; - /** - * Packaging ecosystem, for example `oci` or `npm`. - */ - packageType: string; - /** - * Package identifier. Inert untrusted data. - */ - packageIdentifier: string; - /** - * Typed values this choice requires, excluding secrets. - */ - requiredValues: McpPlanRequiredValue[]; - /** - * Secrets this choice requires, referenced by placeholder only. - */ - secretPlaceholders: McpPlanSecretPlaceholder[]; + /** + * Stable identifier for this choice within the plan, used to select it when the plan is applied. + */ + choiceId: string; + transport: McpPlanPackageTransport; + installMethod: McpPlanPackageInstallMethod; + /** + * Packaging ecosystem, for example `oci` or `npm`. + */ + packageType: string; + /** + * Package identifier. Inert untrusted data. + */ + packageIdentifier: string; + /** + * Typed values this choice requires, excluding secrets. + */ + requiredValues: McpPlanRequiredValue[]; + /** + * Secrets this choice requires, referenced by placeholder only. + */ + secretPlaceholders: McpPlanSecretPlaceholder[]; } /** * One non-secret scalar value a transport choice needs before it can be applied. @@ -10863,33 +11143,33 @@ export interface McpPlanTransportChoicePackage { */ /** @experimental */ export interface McpPlanRequiredValueScalar { - kind: McpPlanRequiredValueScalarKind; - /** - * Key the value is supplied under. Inert untrusted data. - */ - key: string; - category: McpPlanValueCategory; - valueType: McpPlanScalarValueType; - /** - * Whether the value must be present for the plan to be applicable. - */ - required: boolean; - /** - * Default supplied by the card, when the value can be resolved without input. Presence is the authoritative indication that a default exists. Inert untrusted data. - */ - defaultValue?: string; - /** - * Human-readable label from the card. Inert untrusted text. - */ - title?: string; - /** - * Human-readable explanation from the card. Inert untrusted text. - */ - description?: string; - /** - * Whether the value may be supplied more than once. - */ - isRepeated: boolean; + kind: McpPlanRequiredValueScalarKind; + /** + * Key the value is supplied under. Inert untrusted data. + */ + key: string; + category: McpPlanValueCategory; + valueType: McpPlanScalarValueType; + /** + * Whether the value must be present for the plan to be applicable. + */ + required: boolean; + /** + * Default supplied by the card, when the value can be resolved without input. Presence is the authoritative indication that a default exists. Inert untrusted data. + */ + defaultValue?: string; + /** + * Human-readable label from the card. Inert untrusted text. + */ + title?: string; + /** + * Human-readable explanation from the card. Inert untrusted text. + */ + description?: string; + /** + * Whether the value may be supplied more than once. + */ + isRepeated: boolean; } /** * One enumerated non-secret value a transport choice needs before it can be applied. The permitted values are structurally required. @@ -10899,39 +11179,39 @@ export interface McpPlanRequiredValueScalar { */ /** @experimental */ export interface McpPlanRequiredValueEnum { - kind: McpPlanRequiredValueEnumKind; - /** - * Key the value is supplied under. Inert untrusted data. - */ - key: string; - category: McpPlanValueCategory; - valueType: McpPlanEnumValueType; - /** - * Whether the value must be present for the plan to be applicable. - */ - required: boolean; - /** - * Default supplied by the card, when the value can be resolved without input. Presence is the authoritative indication that a default exists. Inert untrusted data. - */ - defaultValue?: string; - /** - * Human-readable label from the card. Inert untrusted text. - */ - title?: string; - /** - * Human-readable explanation from the card. Inert untrusted text. - */ - description?: string; - /** - * Non-empty permitted value set. Inert untrusted data. - * - * @minItems 1 - */ - enumValues: [string, ...string[]]; - /** - * Whether the value may be supplied more than once. - */ - isRepeated: boolean; + kind: McpPlanRequiredValueEnumKind; + /** + * Key the value is supplied under. Inert untrusted data. + */ + key: string; + category: McpPlanValueCategory; + valueType: McpPlanEnumValueType; + /** + * Whether the value must be present for the plan to be applicable. + */ + required: boolean; + /** + * Default supplied by the card, when the value can be resolved without input. Presence is the authoritative indication that a default exists. Inert untrusted data. + */ + defaultValue?: string; + /** + * Human-readable label from the card. Inert untrusted text. + */ + title?: string; + /** + * Human-readable explanation from the card. Inert untrusted text. + */ + description?: string; + /** + * Non-empty permitted value set. Inert untrusted data. + * + * @minItems 1 + */ + enumValues: [string, ...string[]]; + /** + * Whether the value may be supplied more than once. + */ + isRepeated: boolean; } /** * A secret a transport choice needs, referenced by placeholder. No secret value ever appears in a plan, and the placeholder resolves against the keychain only when a plan is applied. @@ -10941,15 +11221,15 @@ export interface McpPlanRequiredValueEnum { */ /** @experimental */ export interface McpPlanSecretPlaceholder { - /** - * Key the secret is supplied under. Inert untrusted data. - */ - key: string; - placeholder: McpPlanSecretReference; - /** - * Human-readable label from the card. Inert untrusted text. - */ - title?: string; + /** + * Key the secret is supplied under. Inert untrusted data. + */ + key: string; + placeholder: McpPlanSecretReference; + /** + * Human-readable label from the card. Inert untrusted text. + */ + title?: string; } /** * An eligible remote-endpoint transport choice. The endpoint is required and package identity cannot be represented. @@ -10959,24 +11239,24 @@ export interface McpPlanSecretPlaceholder { */ /** @experimental */ export interface McpPlanTransportChoiceRemote { - /** - * Stable identifier for this choice within the plan, used to select it when the plan is applied. - */ - choiceId: string; - transport: McpPlanRemoteTransport; - installMethod: McpPlanRemoteInstallMethod; - /** - * Endpoint URL. Inert untrusted data. - */ - endpoint: string; - /** - * Typed values this choice requires, excluding secrets. - */ - requiredValues: McpPlanRequiredValue[]; - /** - * Secrets this choice requires, referenced by placeholder only. - */ - secretPlaceholders: McpPlanSecretPlaceholder[]; + /** + * Stable identifier for this choice within the plan, used to select it when the plan is applied. + */ + choiceId: string; + transport: McpPlanRemoteTransport; + installMethod: McpPlanRemoteInstallMethod; + /** + * Endpoint URL. Inert untrusted data. + */ + endpoint: string; + /** + * Typed values this choice requires, excluding secrets. + */ + requiredValues: McpPlanRequiredValue[]; + /** + * Secrets this choice requires, referenced by placeholder only. + */ + secretPlaceholders: McpPlanSecretPlaceholder[]; } /** * Where a plan would be written. @@ -10986,11 +11266,11 @@ export interface McpPlanTransportChoiceRemote { */ /** @experimental */ export interface McpPlanTarget { - scope: McpPlanScope; - /** - * Configuration key the server would be recorded under within that scope. - */ - configKey: string; + scope: McpPlanScope; + /** + * Configuration key the server would be recorded under within that scope. + */ + configKey: string; } /** * Outcome of evaluating the planned server against registry and enterprise policy. Evaluation is read-only. @@ -11000,12 +11280,12 @@ export interface McpPlanTarget { */ /** @experimental */ export interface McpPlanPolicyResult { - decision: McpPlanPolicyDecision; - source: McpPlanPolicySource; - /** - * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. - */ - reason?: string; + decision: McpPlanPolicyDecision; + source: McpPlanPolicySource; + /** + * Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret. + */ + reason?: string; } /** * One change applying the plan would make, described rather than serialised so the configuration payload stays behind the runtime boundary. @@ -11015,20 +11295,20 @@ export interface McpPlanPolicyResult { */ /** @experimental */ export interface McpPlanConfigurationChange { - operation: McpPlanConfigurationOperation; - scope: McpPlanScope; - /** - * Configuration key the change applies to. - */ - configKey: string; - /** - * Names of the configuration fields the change would set, without their values. - */ - changedFields: string[]; - /** - * Secret placeholders the written configuration would reference. The constrained placeholder type cannot carry a literal secret value. - */ - secretReferences: McpPlanSecretReference[]; + operation: McpPlanConfigurationOperation; + scope: McpPlanScope; + /** + * Configuration key the change applies to. + */ + configKey: string; + /** + * Names of the configuration fields the change would set, without their values. + */ + changedFields: string[]; + /** + * Secret placeholders the written configuration would reference. The constrained placeholder type cannot carry a literal secret value. + */ + secretReferences: McpPlanSecretReference[]; } /** * Server name to check running status for. @@ -11038,10 +11318,10 @@ export interface McpPlanConfigurationChange { */ /** @experimental */ export interface McpIsServerRunningRequest { - /** - * Name of the MCP server to check - */ - serverName: string; + /** + * Name of the MCP server to check + */ + serverName: string; } /** * Whether the named MCP server is running. @@ -11051,10 +11331,10 @@ export interface McpIsServerRunningRequest { */ /** @experimental */ export interface McpIsServerRunningResult { - /** - * True if the server has an active client and transport. - */ - running: boolean; + /** + * True if the server has an active client and transport. + */ + running: boolean; } /** * Server name whose tool list should be returned. @@ -11064,10 +11344,10 @@ export interface McpIsServerRunningResult { */ /** @experimental */ export interface McpListToolsRequest { - /** - * Name of the connected MCP server whose tools to list. - */ - serverName: string; + /** + * Name of the connected MCP server whose tools to list. + */ + serverName: string; } /** * Tools exposed by the connected MCP server. Throws when the server is not connected. @@ -11077,10 +11357,10 @@ export interface McpListToolsRequest { */ /** @experimental */ export interface McpListToolsResult { - /** - * Tools exposed by the server. - */ - tools: McpTools[]; + /** + * Tools exposed by the server. + */ + tools: McpTools[]; } /** * MCP tool metadata with tool name, optional description, and normalized MCP Apps discovery metadata. @@ -11090,15 +11370,15 @@ export interface McpListToolsResult { */ /** @experimental */ export interface McpTools { - /** - * Tool name. - */ - name: string; - /** - * Tool description, when provided. - */ - description?: string; - ui?: McpToolUi; + /** + * Tool name. + */ + name: string; + /** + * Tool description, when provided. + */ + description?: string; + ui?: McpToolUi; } /** * Normalized MCP Apps discovery metadata from a tool's `_meta.ui` block. @@ -11108,14 +11388,14 @@ export interface McpTools { */ /** @experimental */ export interface McpToolUi { - /** - * URI of the tool's MCP App resource, typically a `ui://` resource identifier. Use `session.mcp.resources.read` to fetch its HTML and resource metadata. - */ - resourceUri?: string; - /** - * Tool visibility advertised by the server. When absent, MCP Apps defaults apply. - */ - visibility?: McpToolUiVisibility[]; + /** + * URI of the tool's MCP App resource, typically a `ui://` resource identifier. Use `session.mcp.resources.read` to fetch its HTML and resource metadata. + */ + resourceUri?: string; + /** + * Tool visibility advertised by the server. When absent, MCP Apps defaults apply. + */ + visibility?: McpToolUiVisibility[]; } /** * Identifies the MCP server whose persisted OAuth credentials were updated. @@ -11125,14 +11405,14 @@ export interface McpToolUi { */ /** @experimental */ export interface McpOauthAuthenticationStateChangedRequest { - /** - * Name of the MCP server whose OAuth credentials were updated. Omit only when the host cannot identify the server. - */ - serverName?: string; - /** - * Whether the target session must mint a session-scoped access token instead of reusing a shared access token persisted by another session. - */ - refreshSessionToken?: boolean; + /** + * Name of the MCP server whose OAuth credentials were updated. Omit only when the host cannot identify the server. + */ + serverName?: string; + /** + * Whether the target session must mint a session-scoped access token instead of reusing a shared access token persisted by another session. + */ + refreshSessionToken?: boolean; } /** * Pending MCP OAuth request ID and host-provided token or cancellation response. @@ -11142,11 +11422,11 @@ export interface McpOauthAuthenticationStateChangedRequest { */ /** @experimental */ export interface McpOauthHandlePendingRequest { - /** - * OAuth request identifier from the mcp.oauth_required event - */ - requestId: string; - result: McpOauthPendingRequestResponse; + /** + * OAuth request identifier from the mcp.oauth_required event + */ + requestId: string; + result: McpOauthPendingRequestResponse; } /** * Indicates whether the pending MCP OAuth response was accepted. @@ -11156,10 +11436,10 @@ export interface McpOauthHandlePendingRequest { */ /** @experimental */ export interface McpOauthHandlePendingResult { - /** - * Whether the response was accepted. False if the request was unknown, timed out, or already resolved. - */ - success: boolean; + /** + * Whether the response was accepted. False if the request was unknown, timed out, or already resolved. + */ + success: boolean; } /** * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection. @@ -11169,35 +11449,35 @@ export interface McpOauthHandlePendingResult { */ /** @experimental */ export interface McpOauthLoginRequest { - /** - * Name of the remote MCP server to authenticate - */ - serverName: string; - /** - * When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck. - */ - forceReauth?: boolean; - /** - * Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees. - */ - clientName?: string; - /** - * 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. - */ - callbackSuccessMessage?: string; - /** - * Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration. - */ - clientId?: string; - /** - * 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. - */ - clientSecret?: string; - /** - * 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. - */ - publicClient?: boolean; - grantType?: McpOauthLoginGrantType; + /** + * Name of the remote MCP server to authenticate + */ + serverName: string; + /** + * When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck. + */ + forceReauth?: boolean; + /** + * Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees. + */ + clientName?: string; + /** + * 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. + */ + callbackSuccessMessage?: string; + /** + * Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration. + */ + clientId?: string; + /** + * 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. + */ + clientSecret?: string; + /** + * 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. + */ + publicClient?: boolean; + grantType?: McpOauthLoginGrantType; } /** * OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server. @@ -11207,10 +11487,10 @@ export interface McpOauthLoginRequest { */ /** @experimental */ export interface McpOauthLoginResult { - /** - * URL the caller should open in a browser to complete OAuth. Omitted when cached tokens were still valid and no browser interaction was needed — the server is already reconnected in that case. When present, the runtime starts the callback listener before returning and continues the flow in the background; completion is signaled via session.mcp_server_status_changed. - */ - authorizationUrl?: string; + /** + * URL the caller should open in a browser to complete OAuth. Omitted when cached tokens were still valid and no browser interaction was needed — the server is already reconnected in that case. When present, the runtime starts the callback listener before returning and continues the flow in the background; completion is signaled via session.mcp_server_status_changed. + */ + authorizationUrl?: string; } /** * Remote MCP server name for a passive OAuth status probe. @@ -11220,10 +11500,10 @@ export interface McpOauthLoginResult { */ /** @experimental */ export interface McpOauthProbeRequest { - /** - * Name of the configured remote MCP server to probe. - */ - serverName: string; + /** + * Name of the configured remote MCP server to probe. + */ + serverName: string; } /** * Pending MCP OAuth request id to respond to. @@ -11233,10 +11513,10 @@ export interface McpOauthProbeRequest { */ /** @experimental */ export interface McpOauthRespondRequest { - /** - * OAuth request identifier from the mcp.oauth_required event - */ - requestId: string; + /** + * OAuth request identifier from the mcp.oauth_required event + */ + requestId: string; } /** * Indicates whether the pending MCP OAuth response was accepted. @@ -11246,10 +11526,10 @@ export interface McpOauthRespondRequest { */ /** @experimental */ export interface McpOauthRespondResult { - /** - * Whether the response was accepted. False if the request was unknown, timed out, or already resolved. - */ - success: boolean; + /** + * Whether the response was accepted. False if the request was unknown, timed out, or already resolved. + */ + success: boolean; } /** * A computed MCP install plan. Nothing has been applied: the plan describes what installing would change, and the plan handle is what a later apply operation would consume. @@ -11259,12 +11539,12 @@ export interface McpOauthRespondResult { */ /** @experimental */ export interface McpPlanInstallPlanned { - /** - * Discriminator: a plan was computed and nothing was changed - */ - kind: "planned"; - plan: McpInstallPlan; - negotiated: CatalogNegotiatedContract; + /** + * Discriminator: a plan was computed and nothing was changed + */ + kind: "planned"; + plan: McpInstallPlan; + negotiated: CatalogNegotiatedContract; } /** * A side-effect-free request for an MCP install plan. Computing a plan never writes configuration, stores a secret, or reloads MCP servers. @@ -11274,9 +11554,9 @@ export interface McpPlanInstallPlanned { */ /** @experimental */ export interface McpPlanInstallRequest { - contract: CatalogClientContract; - source: McpPlanInstallSource; - scope?: McpPlanScope; + contract: CatalogClientContract; + source: McpPlanInstallSource; + scope?: McpPlanScope; } /** * Plan from a candidate returned by a previous catalog search. @@ -11286,15 +11566,15 @@ export interface McpPlanInstallRequest { */ /** @experimental */ export interface McpPlanInstallSourceCandidate { - kind: McpPlanInstallSourceCandidateKind; - /** - * Single-use candidate handle. Consumed by this call, so a replay of the same handle is rejected. - */ - candidateHandle: string; - /** - * The runtime- or authority-minted `searchId` returned with the search that produced this candidate. A search implementation binds it to private candidate-handle context; a planning implementation must verify that context before returning a plan. The unavailable planning implementation in this contract layer validates presence but does not claim the verification has occurred. It identifies a search rather than a person and must never be joined with user identity to re-identify anyone. - */ - searchId: string; + kind: McpPlanInstallSourceCandidateKind; + /** + * Single-use candidate handle. Consumed by this call, so a replay of the same handle is rejected. + */ + candidateHandle: string; + /** + * The runtime- or authority-minted `searchId` returned with the search that produced this candidate. A search implementation binds it to private candidate-handle context; a planning implementation must verify that context before returning a plan. The unavailable planning implementation in this contract layer validates presence but does not claim the verification has occurred. It identifies a search rather than a person and must never be joined with user identity to re-identify anyone. + */ + searchId: string; } /** * Plan from a card supplied directly by the caller, without a preceding search. @@ -11304,8 +11584,8 @@ export interface McpPlanInstallSourceCandidate { */ /** @experimental */ export interface McpPlanInstallSourceCard { - kind: McpPlanInstallSourceCardKind; - card: McpServerCardReference; + kind: McpPlanInstallSourceCardKind; + card: McpServerCardReference; } /** * An MCP server card to be retrieved from a URL through the runtime's hardened fetch boundary. @@ -11315,12 +11595,12 @@ export interface McpPlanInstallSourceCard { */ /** @experimental */ export interface McpServerCardUrl { - kind: McpServerCardUrlKind; - mediaType: McpServerCardMediaType; - /** - * Card URL. Retrieved only through the runtime's hardened boundary, with scheme, credential, address-range, redirect, timeout, and response-size controls applied. Never logged. - */ - url: string; + kind: McpServerCardUrlKind; + mediaType: McpServerCardMediaType; + /** + * Card URL. Retrieved only through the runtime's hardened boundary, with scheme, credential, address-range, redirect, timeout, and response-size controls applied. Never logged. + */ + url: string; } /** * An MCP server card supplied inline as an inert document. @@ -11330,12 +11610,12 @@ export interface McpServerCardUrl { */ /** @experimental */ export interface McpServerCardEmbedded { - kind: McpServerCardEmbeddedKind; - mediaType: McpServerCardMediaType; - /** - * The card document verbatim, treated as inert untrusted bytes. The runtime parses and validates it; the host is not expected to interpret it. Never logged. - */ - data: string; + kind: McpServerCardEmbeddedKind; + mediaType: McpServerCardMediaType; + /** + * The card document verbatim, treated as inert untrusted bytes. The runtime parses and validates it; the host is not expected to interpret it. Never logged. + */ + data: string; } /** * Registration parameters for an external MCP client. @@ -11346,28 +11626,28 @@ export interface McpServerCardEmbedded { /** @experimental */ /** @internal */ export interface McpRegisterExternalClientRequest { - /** - * Logical server name for the external client - */ - serverName: string; - /** - * In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary. - * - * @internal - */ - client: OpaqueInProcessValue; - /** - * In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary. - * - * @internal - */ - transport: OpaqueInProcessValue; - /** - * In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions. - * - * @internal - */ - config: OpaqueInProcessValue; + /** + * Logical server name for the external client + */ + serverName: string; + /** + * In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary. + * + * @internal + */ + client: OpaqueInProcessValue; + /** + * In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary. + * + * @internal + */ + transport: OpaqueInProcessValue; + /** + * In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions. + * + * @internal + */ + config: OpaqueInProcessValue; } /** * In-process MCP reload configuration. @@ -11378,24 +11658,24 @@ export interface McpRegisterExternalClientRequest { /** @experimental */ /** @internal */ export interface McpReloadConfig { - mcpServers: { - [k: string]: McpServerConfig | undefined; - }; - disabledServers?: string[]; - enabledServers?: string[]; - /** - * Server names the CLI enabled for this session via `--enable-mcp-server`. - */ - cliEnabledServers?: string[]; - mcp3pEnabled?: boolean; - includeWorkspaceSources?: boolean; - configFilter?: OpaqueInProcessValue; - githubMcpToolOptions?: OpaqueInProcessValue; - githubMcpUserOverride?: boolean; - secretStore?: OpaqueInProcessValue; - activeGitHubToken?: string; - useCachedToolSnapshots?: boolean; - forceRestart?: boolean; + mcpServers: { + [k: string]: McpServerConfig | undefined; + }; + disabledServers?: string[]; + enabledServers?: string[]; + /** + * Server names the CLI enabled for this session via `--enable-mcp-server`. + */ + cliEnabledServers?: string[]; + mcp3pEnabled?: boolean; + includeWorkspaceSources?: boolean; + configFilter?: OpaqueInProcessValue; + githubMcpToolOptions?: OpaqueInProcessValue; + githubMcpUserOverride?: boolean; + secretStore?: OpaqueInProcessValue; + activeGitHubToken?: string; + useCachedToolSnapshots?: boolean; + forceRestart?: boolean; } /** * Opaque MCP reload configuration. @@ -11406,7 +11686,7 @@ export interface McpReloadConfig { /** @experimental */ /** @internal */ export interface McpReloadWithConfigRequest { - config: unknown; + config: unknown; } /** * Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove). @@ -11416,10 +11696,10 @@ export interface McpReloadWithConfigRequest { */ /** @experimental */ export interface McpRemoveGitHubResult { - /** - * True when the auto-managed `github` MCP server was removed; false when no removal happened (e.g. user has explicitly configured a `github` server, or the server was not registered). - */ - removed: boolean; + /** + * True when the auto-managed `github` MCP server was removed; false when no removal happened (e.g. user has explicitly configured a `github` server, or the server was not registered). + */ + removed: boolean; } /** * An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, MIME type, size, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`. @@ -11429,47 +11709,47 @@ export interface McpRemoveGitHubResult { */ /** @experimental */ export interface McpResource { - /** - * The resource URI (e.g. ui://... or file:///...) - */ - uri: string; - /** - * The programmatic name of the resource - */ - name: string; - /** - * Optional human-readable display title - */ - title?: string; - /** - * Optional description of what this resource represents - */ - description?: string; - /** - * MIME type of the resource, if known - */ - mimeType?: string; - /** - * Resource size in bytes, when known - */ - size?: number; - /** - * Icons associated with this resource - */ - icons?: McpResourceIcon[]; - annotations?: McpResourceAnnotations; - /** - * Resource-level metadata - */ - _meta?: { - [k: string]: JsonValue | undefined; - }; - /** - * Server-provided non-standard descriptor fields preserved from the MCP response - */ - additionalProperties?: { - [k: string]: JsonValue | undefined; - }; + /** + * The resource URI (e.g. ui://... or file:///...) + */ + uri: string; + /** + * The programmatic name of the resource + */ + name: string; + /** + * Optional human-readable display title + */ + title?: string; + /** + * Optional description of what this resource represents + */ + description?: string; + /** + * MIME type of the resource, if known + */ + mimeType?: string; + /** + * Resource size in bytes, when known + */ + size?: number; + /** + * Icons associated with this resource + */ + icons?: McpResourceIcon[]; + annotations?: McpResourceAnnotations; + /** + * Resource-level metadata + */ + _meta?: { + [k: string]: JsonValue | undefined; + }; + /** + * Server-provided non-standard descriptor fields preserved from the MCP response + */ + additionalProperties?: { + [k: string]: JsonValue | undefined; + }; } /** * A resource icon descriptor plus preserved non-standard icon fields. @@ -11479,28 +11759,28 @@ export interface McpResource { */ /** @experimental */ export interface McpResourceIcon { - /** - * Icon URI - */ - src: string; - /** - * Icon MIME type, when known - */ - mimeType?: string; - /** - * Icon sizes hint - */ - sizes?: string; - /** - * Theme hint for this icon - */ - theme?: string; - /** - * Server-provided non-standard icon fields preserved from the MCP response - */ - additionalProperties?: { - [k: string]: JsonValue | undefined; - }; + /** + * Icon URI + */ + src: string; + /** + * Icon MIME type, when known + */ + mimeType?: string; + /** + * Icon sizes hint + */ + sizes?: string; + /** + * Theme hint for this icon + */ + theme?: string; + /** + * Server-provided non-standard icon fields preserved from the MCP response + */ + additionalProperties?: { + [k: string]: JsonValue | undefined; + }; } /** * Standard MCP resource annotations plus preserved non-standard annotation fields. @@ -11510,24 +11790,24 @@ export interface McpResourceIcon { */ /** @experimental */ export interface McpResourceAnnotations { - /** - * Intended audience roles for this resource - */ - audience?: string[]; - /** - * Priority hint for model/client use - */ - priority?: number; - /** - * Last-modified timestamp hint - */ - lastModified?: string; - /** - * Server-provided non-standard annotation fields preserved from the MCP response - */ - additionalProperties?: { - [k: string]: JsonValue | undefined; - }; + /** + * Intended audience roles for this resource + */ + audience?: string[]; + /** + * Priority hint for model/client use + */ + priority?: number; + /** + * Last-modified timestamp hint + */ + lastModified?: string; + /** + * Server-provided non-standard annotation fields preserved from the MCP response + */ + additionalProperties?: { + [k: string]: JsonValue | undefined; + }; } /** * MCP resource content with URI, optional MIME type, text or base64 blob, and resource metadata. @@ -11537,28 +11817,28 @@ export interface McpResourceAnnotations { */ /** @experimental */ export interface McpResourceContent { - /** - * The resource URI - */ - uri: string; - /** - * MIME type of the content - */ - mimeType?: string; - /** - * Text content (e.g. HTML) - */ - text?: string; - /** - * Base64-encoded binary content - */ - blob?: string; - /** - * Resource-level metadata (CSP, permissions, etc.) - */ - _meta?: { - [k: string]: JsonValue | undefined; - }; + /** + * The resource URI + */ + uri: string; + /** + * MIME type of the content + */ + mimeType?: string; + /** + * Text content (e.g. HTML) + */ + text?: string; + /** + * Base64-encoded binary content + */ + blob?: string; + /** + * Resource-level metadata (CSP, permissions, etc.) + */ + _meta?: { + [k: string]: JsonValue | undefined; + }; } /** * MCP server whose resources to enumerate. @@ -11568,14 +11848,14 @@ export interface McpResourceContent { */ /** @experimental */ export interface McpResourcesListRequest { - /** - * Name of the MCP server whose resources to enumerate - */ - serverName: string; - /** - * Opaque MCP pagination cursor from a prior `nextCursor` value - */ - cursor?: string; + /** + * Name of the MCP server whose resources to enumerate + */ + serverName: string; + /** + * Opaque MCP pagination cursor from a prior `nextCursor` value + */ + cursor?: string; } /** * One page of resources advertised by the named MCP server. @@ -11585,14 +11865,14 @@ export interface McpResourcesListRequest { */ /** @experimental */ export interface McpResourcesListResult { - /** - * Resources advertised by the server (proxied MCP `resources/list`) - */ - resources: McpResource[]; - /** - * Opaque cursor for the next page, if the server has more resources - */ - nextCursor?: string; + /** + * Resources advertised by the server (proxied MCP `resources/list`) + */ + resources: McpResource[]; + /** + * Opaque cursor for the next page, if the server has more resources + */ + nextCursor?: string; } /** * MCP server whose resource templates to enumerate. @@ -11602,14 +11882,14 @@ export interface McpResourcesListResult { */ /** @experimental */ export interface McpResourcesListTemplatesRequest { - /** - * Name of the MCP server whose resource templates to enumerate - */ - serverName: string; - /** - * Opaque MCP pagination cursor from a prior `nextCursor` value - */ - cursor?: string; + /** + * Name of the MCP server whose resource templates to enumerate + */ + serverName: string; + /** + * Opaque MCP pagination cursor from a prior `nextCursor` value + */ + cursor?: string; } /** * One page of resource templates advertised by the named MCP server. @@ -11619,14 +11899,14 @@ export interface McpResourcesListTemplatesRequest { */ /** @experimental */ export interface McpResourcesListTemplatesResult { - /** - * Resource templates advertised by the server (proxied MCP `resources/templates/list`) - */ - resourceTemplates: McpResourceTemplate[]; - /** - * Opaque cursor for the next page, if the server has more resource templates - */ - nextCursor?: string; + /** + * Resource templates advertised by the server (proxied MCP `resources/templates/list`) + */ + resourceTemplates: McpResourceTemplate[]; + /** + * Opaque cursor for the next page, if the server has more resource templates + */ + nextCursor?: string; } /** * An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, name, and optional title, description, MIME type, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`. @@ -11636,43 +11916,43 @@ export interface McpResourcesListTemplatesResult { */ /** @experimental */ export interface McpResourceTemplate { - /** - * An RFC 6570 URI template for constructing resource URIs - */ - uriTemplate: string; - /** - * The programmatic name of the resource template - */ - name: string; - /** - * Optional human-readable display title - */ - title?: string; - /** - * Optional description of what this template is for - */ - description?: string; - /** - * MIME type for resources matching this template, if uniform - */ - mimeType?: string; - /** - * Icons associated with resources matching this template - */ - icons?: McpResourceIcon[]; - annotations?: McpResourceAnnotations; - /** - * Resource-template-level metadata - */ - _meta?: { - [k: string]: JsonValue | undefined; - }; - /** - * Server-provided non-standard descriptor fields preserved from the MCP response - */ - additionalProperties?: { - [k: string]: JsonValue | undefined; - }; + /** + * An RFC 6570 URI template for constructing resource URIs + */ + uriTemplate: string; + /** + * The programmatic name of the resource template + */ + name: string; + /** + * Optional human-readable display title + */ + title?: string; + /** + * Optional description of what this template is for + */ + description?: string; + /** + * MIME type for resources matching this template, if uniform + */ + mimeType?: string; + /** + * Icons associated with resources matching this template + */ + icons?: McpResourceIcon[]; + annotations?: McpResourceAnnotations; + /** + * Resource-template-level metadata + */ + _meta?: { + [k: string]: JsonValue | undefined; + }; + /** + * Server-provided non-standard descriptor fields preserved from the MCP response + */ + additionalProperties?: { + [k: string]: JsonValue | undefined; + }; } /** * MCP server and resource URI to fetch. @@ -11682,14 +11962,14 @@ export interface McpResourceTemplate { */ /** @experimental */ export interface McpResourcesReadRequest { - /** - * Name of the MCP server hosting the resource - */ - serverName: string; - /** - * Resource URI - */ - uri: string; + /** + * Name of the MCP server hosting the resource + */ + serverName: string; + /** + * Resource URI + */ + uri: string; } /** * Resource contents returned by the MCP server. @@ -11699,10 +11979,10 @@ export interface McpResourcesReadRequest { */ /** @experimental */ export interface McpResourcesReadResult { - /** - * Resource contents returned by the server - */ - contents: McpResourceContent[]; + /** + * Resource contents returned by the server + */ + contents: McpResourceContent[]; } /** * Server name and optional replacement configuration for an individual MCP server restart. Omit `config` for a config-free restart-by-name of an already-configured server. @@ -11712,11 +11992,11 @@ export interface McpResourcesReadResult { */ /** @experimental */ export interface McpRestartServerRequest { - /** - * Name of the MCP server to restart - */ - serverName: string; - config?: McpSerializableServerConfig; + /** + * Name of the MCP server to restart + */ + serverName: string; + config?: McpSerializableServerConfig; } /** * Outcome of an MCP sampling execution: success result, failure error, or cancellation. @@ -11726,12 +12006,12 @@ export interface McpRestartServerRequest { */ /** @experimental */ export interface McpSamplingExecutionResult { - action: McpSamplingExecutionAction; - result?: McpExecuteSamplingResult; - /** - * Error description, present when action='failure'. - */ - error?: string; + action: McpSamplingExecutionAction; + result?: McpExecuteSamplingResult; + /** + * Error description, present when action='failure'. + */ + error?: string; } /** * MCP server status entry, including config source/plugin source and any connection error. @@ -11741,24 +12021,24 @@ export interface McpSamplingExecutionResult { */ /** @experimental */ export interface McpServer { - /** - * Server name (config key) - */ - name: string; - status: McpServerStatus; - source?: McpServerSource; - /** - * Plugin name that provided this server, when source is plugin. - */ - sourcePlugin?: string; - /** - * Plugin version that provided this server, when source is plugin. - */ - sourcePluginVersion?: string; - /** - * Error message if the server failed to connect - */ - error?: string; + /** + * Server name (config key) + */ + name: string; + status: McpServerStatus; + source?: McpServerSource; + /** + * Plugin name that provided this server, when source is plugin. + */ + sourcePlugin?: string; + /** + * Plugin version that provided this server, when source is plugin. + */ + sourcePluginVersion?: string; + /** + * Error message if the server failed to connect + */ + error?: string; } /** * In-process MCP server configuration used by embedded SDK clients. @@ -11769,74 +12049,74 @@ export interface McpServer { /** @experimental */ /** @internal */ export interface McpServerConfigMemory { - type: McpServerConfigMemoryType; - /** - * In-process MCP server instance. This value cannot cross a JSON-RPC boundary. - * - * @internal - */ - serverInstance: OpaqueInProcessValue; - /** - * Tools to include. Defaults to all tools if not specified. - */ - tools?: string[]; - /** - * Optional human-readable server name. - */ - displayName?: string; - /** - * Whether this server is a built-in fallback. - */ - isDefaultServer?: boolean; - filterMapping?: FilterMapping; - safeForTelemetry?: McpSafeForTelemetry; - /** - * Timeout in milliseconds for tool discovery and tool calls. - */ - timeout?: number; - oidc?: McpServerAuthConfig; - deferTools?: McpServerConfigDeferTools; - /** - * Whether persisted tool snapshots are disabled. - */ - disableToolCache?: boolean; - /** - * Whether secret masking is disabled for calls to this server. - */ - disableSecretMasking?: boolean; - /** - * Tool names excluded after the include filter is applied. - */ - excludeTools?: string[]; - /** - * Event types this server receives as Copilot notifications. - */ - events?: string[]; - /** - * Copilot notification types this server may send to the host. - */ - notifications?: string[]; - source?: McpServerSource; - /** - * Plugin that provided this server. - */ - sourcePlugin?: string; - /** - * Version of the plugin that provided this server. - */ - sourcePluginVersion?: string; - /** - * Whether the providing plugin uses the Open Plugin Spec. - */ - sourcePluginSpec?: boolean; - /** - * Source file path recorded while loading the config. - */ - sourcePath?: string; - /** - * Configuration warnings recorded while loading the server. - */ - configWarnings?: string[]; + type: McpServerConfigMemoryType; + /** + * In-process MCP server instance. This value cannot cross a JSON-RPC boundary. + * + * @internal + */ + serverInstance: OpaqueInProcessValue; + /** + * Tools to include. Defaults to all tools if not specified. + */ + tools?: string[]; + /** + * Optional human-readable server name. + */ + displayName?: string; + /** + * Whether this server is a built-in fallback. + */ + isDefaultServer?: boolean; + filterMapping?: FilterMapping; + safeForTelemetry?: McpSafeForTelemetry; + /** + * Timeout in milliseconds for tool discovery and tool calls. + */ + timeout?: number; + oidc?: McpServerAuthConfig; + deferTools?: McpServerConfigDeferTools; + /** + * Whether persisted tool snapshots are disabled. + */ + disableToolCache?: boolean; + /** + * Whether secret masking is disabled for calls to this server. + */ + disableSecretMasking?: boolean; + /** + * Tool names excluded after the include filter is applied. + */ + excludeTools?: string[]; + /** + * Event types this server receives as Copilot notifications. + */ + events?: string[]; + /** + * Copilot notification types this server may send to the host. + */ + notifications?: string[]; + source?: McpServerSource; + /** + * Plugin that provided this server. + */ + sourcePlugin?: string; + /** + * Version of the plugin that provided this server. + */ + sourcePluginVersion?: string; + /** + * Whether the providing plugin uses the Open Plugin Spec. + */ + sourcePluginSpec?: boolean; + /** + * Source file path recorded while loading the config. + */ + sourcePath?: string; + /** + * Configuration warnings recorded while loading the server. + */ + configWarnings?: string[]; } /** * MCP servers configured for the session, with their connection status and host-level state. @@ -11846,11 +12126,11 @@ export interface McpServerConfigMemory { */ /** @experimental */ export interface McpServerList { - /** - * Configured MCP servers - */ - servers: McpServer[]; - host?: McpHostState; + /** + * Configured MCP servers + */ + servers: McpServer[]; + host?: McpHostState; } /** * Mode controlling how MCP server env values are resolved (`direct` or `indirect`). @@ -11860,7 +12140,7 @@ export interface McpServerList { */ /** @experimental */ export interface McpSetEnvValueModeParams { - mode: McpSetEnvValueModeDetails; + mode: McpSetEnvValueModeDetails; } /** * Env-value mode recorded on the session after the update. @@ -11870,7 +12150,7 @@ export interface McpSetEnvValueModeParams { */ /** @experimental */ export interface McpSetEnvValueModeResult { - mode: McpSetEnvValueModeDetails; + mode: McpSetEnvValueModeDetails; } /** * Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server. @@ -11880,11 +12160,11 @@ export interface McpSetEnvValueModeResult { */ /** @experimental */ export interface McpStartServerRequest { - /** - * Name of the MCP server to start - */ - serverName: string; - config?: McpSerializableServerConfig; + /** + * Name of the MCP server to start + */ + serverName: string; + config?: McpSerializableServerConfig; } /** * MCP server startup filtering result. @@ -11894,18 +12174,18 @@ export interface McpStartServerRequest { */ /** @experimental */ export interface McpStartServersResult { - /** - * Servers filtered out before startup - */ - filteredServers: McpFilteredServer[]; - /** - * Non-default servers allowed by policy - */ - allowedServers?: McpAllowedServer[]; - /** - * Servers whose connection attempt failed. - */ - failedServers?: McpFailedServer[]; + /** + * Servers filtered out before startup + */ + filteredServers: McpFilteredServer[]; + /** + * Non-default servers allowed by policy + */ + allowedServers?: McpAllowedServer[]; + /** + * Servers whose connection attempt failed. + */ + failedServers?: McpFailedServer[]; } /** * Server name for an individual MCP server stop. @@ -11915,10 +12195,10 @@ export interface McpStartServersResult { */ /** @experimental */ export interface McpStopServerRequest { - /** - * Name of the MCP server to stop - */ - serverName: string; + /** + * Name of the MCP server to stop + */ + serverName: string; } /** * Metadata controlling an MCP task's lifetime. @@ -11928,10 +12208,10 @@ export interface McpStopServerRequest { */ /** @experimental */ export interface McpTaskMetadata { - /** - * Task time-to-live. - */ - ttl?: number; + /** + * Task time-to-live. + */ + ttl?: number; } /** * Server name identifying the external client to remove. @@ -11942,10 +12222,10 @@ export interface McpTaskMetadata { /** @experimental */ /** @internal */ export interface McpUnregisterExternalClientRequest { - /** - * Server name of the external client to unregister - */ - serverName: string; + /** + * Server name of the external client to unregister + */ + serverName: string; } /** * Memory configuration for this session. @@ -11955,10 +12235,10 @@ export interface McpUnregisterExternalClientRequest { */ /** @experimental */ export interface MemoryConfiguration { - /** - * Whether memory is enabled for the session. - */ - enabled: boolean; + /** + * Whether memory is enabled for the session. + */ + enabled: boolean; } /** * Per-source attribution breakdown for the session's current context window, or null if uninitialized. @@ -11968,10 +12248,10 @@ export interface MemoryConfiguration { */ /** @experimental */ export interface MetadataContextAttributionResult { - /** - * Per-source context-window attribution, or null if the session has not yet been initialized (no system prompt or tool metadata cached). - */ - contextAttribution?: SessionContextAttribution | null; + /** + * Per-source context-window attribution, or null if the session has not yet been initialized (no system prompt or tool metadata cached). + */ + contextAttribution?: SessionContextAttribution | null; } /** * Parameters for the heaviest-messages query. @@ -11981,10 +12261,10 @@ export interface MetadataContextAttributionResult { */ /** @experimental */ export interface MetadataContextHeaviestMessagesRequest { - /** - * Maximum number of messages to return, most-expensive first. Omit for the server default. - */ - limit?: number; + /** + * Maximum number of messages to return, most-expensive first. Omit for the server default. + */ + limit?: number; } /** * The heaviest individual messages in the session's context window, most-expensive first. @@ -11994,14 +12274,14 @@ export interface MetadataContextHeaviestMessagesRequest { */ /** @experimental */ export interface MetadataContextHeaviestMessagesResult { - /** - * Total token count of the current context window, so callers can compute each message's share without a second call. - */ - totalTokens: number; - /** - * Heaviest messages, most-expensive first. - */ - messages: ContextHeaviestMessage[]; + /** + * Total token count of the current context window, so callers can compute each message's share without a second call. + */ + totalTokens: number; + /** + * Heaviest messages, most-expensive first. + */ + messages: ContextHeaviestMessage[]; } /** * Model identifier and token limits used to compute the context-info breakdown. @@ -12011,18 +12291,18 @@ export interface MetadataContextHeaviestMessagesResult { */ /** @experimental */ export interface MetadataContextInfoRequest { - /** - * Maximum prompt tokens allowed by the target model. Pass 0 to use the runtime default. - */ - promptTokenLimit: number; - /** - * Maximum output tokens allowed by the target model. Pass 0 if unknown. - */ - outputTokenLimit: number; - /** - * Model identifier used for tokenization. Omit to use the session default. Used both for token counting and to compute display values. - */ - selectedModel?: string; + /** + * Maximum prompt tokens allowed by the target model. Pass 0 to use the runtime default. + */ + promptTokenLimit: number; + /** + * Maximum output tokens allowed by the target model. Pass 0 if unknown. + */ + outputTokenLimit: number; + /** + * Model identifier used for tokenization. Omit to use the session default. Used both for token counting and to compute display values. + */ + selectedModel?: string; } /** * Token breakdown for the session's current context window, or null if uninitialized. @@ -12032,10 +12312,10 @@ export interface MetadataContextInfoRequest { */ /** @experimental */ export interface MetadataContextInfoResult { - /** - * Token breakdown for the current context window, or null if the session has not yet been initialized (no system prompt or tool metadata cached). - */ - contextInfo?: SessionContextInfo | null; + /** + * Token breakdown for the current context window, or null if the session has not yet been initialized (no system prompt or tool metadata cached). + */ + contextInfo?: SessionContextInfo | null; } /** * Indicates whether the local session is currently processing a turn or background continuation. @@ -12045,10 +12325,10 @@ export interface MetadataContextInfoResult { */ /** @experimental */ export interface MetadataIsProcessingResult { - /** - * Whether the session is currently processing user/agent messages. False for non-local sessions (which don't run a local agentic loop). Reflects an in-flight turn or background continuation. - */ - processing: boolean; + /** + * Whether the session is currently processing user/agent messages. False for non-local sessions (which don't run a local agentic loop). Reflects an in-flight turn or background continuation. + */ + processing: boolean; } /** * Model identifier to use when re-tokenizing the session's existing messages. @@ -12058,10 +12338,10 @@ export interface MetadataIsProcessingResult { */ /** @experimental */ export interface MetadataRecomputeContextTokensRequest { - /** - * Model identifier used for tokenization. The runtime token-counts both chat-context and system-context messages against this model. - */ - modelId: string; + /** + * Model identifier used for tokenization. The runtime token-counts both chat-context and system-context messages against this model. + */ + modelId: string; } /** * Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.context_info_changed` events. Returns zeros for an empty session. @@ -12071,18 +12351,18 @@ export interface MetadataRecomputeContextTokensRequest { */ /** @experimental */ export interface MetadataRecomputeContextTokensResult { - /** - * Sum of tokens across chat-context and system-context messages currently held by the session. - */ - totalTokens: number; - /** - * Tokens contributed by user/assistant/tool messages (excludes system/developer prompts). - */ - messagesTokenCount: number; - /** - * Tokens contributed by system/developer prompt snapshots. - */ - systemTokenCount: number; + /** + * Sum of tokens across chat-context and system-context messages currently held by the session. + */ + totalTokens: number; + /** + * Tokens contributed by user/assistant/tool messages (excludes system/developer prompts). + */ + messagesTokenCount: number; + /** + * Tokens contributed by system/developer prompt snapshots. + */ + systemTokenCount: number; } /** * Updated working-directory/git context to record on the session. @@ -12092,7 +12372,7 @@ export interface MetadataRecomputeContextTokensResult { */ /** @experimental */ export interface MetadataRecordContextChangeRequest { - context: SessionWorkingDirectoryContext; + context: SessionWorkingDirectoryContext; } /** * Updated working directory and git context. Emitted as the new payload of `session.context_changed`. @@ -12102,35 +12382,35 @@ export interface MetadataRecordContextChangeRequest { */ /** @experimental */ export interface SessionWorkingDirectoryContext { - /** - * Current working directory path - */ - cwd: string; - /** - * Root directory of the git repository, resolved via git rev-parse - */ - gitRoot?: string; - /** - * Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps) - */ - repository?: string; - hostType?: SessionWorkingDirectoryContextHostType; - /** - * Raw host string from the git remote URL (e.g. "github.com", "dev.azure.com") - */ - repositoryHost?: string; - /** - * Current git branch name - */ - branch?: string; - /** - * Head commit of the current git branch - */ - headCommit?: string; - /** - * Merge-base commit SHA (fork point from the remote default branch) - */ - baseCommit?: string; + /** + * Current working directory path + */ + cwd: string; + /** + * Root directory of the git repository, resolved via git rev-parse + */ + gitRoot?: string; + /** + * Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps) + */ + repository?: string; + hostType?: SessionWorkingDirectoryContextHostType; + /** + * Raw host string from the git remote URL (e.g. "github.com", "dev.azure.com") + */ + repositoryHost?: string; + /** + * Current git branch name + */ + branch?: string; + /** + * Head commit of the current git branch + */ + headCommit?: string; + /** + * Merge-base commit SHA (fork point from the remote default branch) + */ + baseCommit?: string; } /** * Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead. @@ -12148,10 +12428,10 @@ export interface MetadataRecordContextChangeResult {} */ /** @experimental */ export interface MetadataSetWorkingDirectoryRequest { - /** - * Absolute path to set as the session's working directory. The runtime updates the session's recorded cwd so subsequent operations (shell tools, file lookups, telemetry) anchor to it. - */ - workingDirectory: string; + /** + * Absolute path to set as the session's working directory. The runtime updates the session's recorded cwd so subsequent operations (shell tools, file lookups, telemetry) anchor to it. + */ + workingDirectory: string; } /** * Update the session's working directory. Used by the host when the user explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for any related side-effects (file index, etc.); it does NOT change the process working directory (a session's cwd is per-session, not process-global). For local sessions the runtime validates the target first (an absolute path that exists on disk) and re-bases the permission primary directory; a rejected validation fails the call before anything is mutated, persisted, or emitted. Location-scoped permission rules are then re-keyed to the new directory (best-effort). Remote sessions only record the path. @@ -12161,10 +12441,10 @@ export interface MetadataSetWorkingDirectoryRequest { */ /** @experimental */ export interface MetadataSetWorkingDirectoryResult { - /** - * Working directory after the update - */ - workingDirectory: string; + /** + * Working directory after the update + */ + workingDirectory: string; } /** * Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session. @@ -12174,16 +12454,16 @@ export interface MetadataSetWorkingDirectoryResult { */ /** @experimental */ export interface MetadataSnapshotRemoteMetadata { - /** - * The original resource identifier (task ID or PR node ID), preserved across event-replay reconstructions. Falls back to `sessionId` when absent. - */ - resourceId?: string; - repository: MetadataSnapshotRemoteMetadataRepository; - /** - * The pull request number the remote session is associated with, if any. - */ - pullRequestNumber?: number; - taskType?: MetadataSnapshotRemoteMetadataTaskType; + /** + * The original resource identifier (task ID or PR node ID), preserved across event-replay reconstructions. Falls back to `sessionId` when absent. + */ + resourceId?: string; + repository: MetadataSnapshotRemoteMetadataRepository; + /** + * The pull request number the remote session is associated with, if any. + */ + pullRequestNumber?: number; + taskType?: MetadataSnapshotRemoteMetadataTaskType; } /** * The repository the remote session targets. @@ -12193,18 +12473,18 @@ export interface MetadataSnapshotRemoteMetadata { */ /** @experimental */ export interface MetadataSnapshotRemoteMetadataRepository { - /** - * The GitHub owner (user or organization) of the target repository. - */ - owner: string; - /** - * The GitHub repository name (without owner). - */ - name: string; - /** - * The branch the remote session is operating on. - */ - branch: string; + /** + * The GitHub owner (user or organization) of the target repository. + */ + owner: string; + /** + * The GitHub repository name (without owner). + */ + name: string; + /** + * The branch the remote session is operating on. + */ + branch: string; } /** * Copilot model metadata, including identifier, display name, capabilities, policy, billing, reasoning efforts, and picker categories. @@ -12214,40 +12494,46 @@ export interface MetadataSnapshotRemoteMetadataRepository { */ /** @experimental */ export interface Model { - /** - * Model identifier (e.g., "claude-sonnet-4.5") - */ - id: string; - /** - * Display name - */ - name: string; - capabilities: ModelCapabilities; - policy?: ModelPolicy; - billing?: ModelBilling; - /** - * Supported reasoning effort levels (only present if model supports reasoning effort) - */ - supportedReasoningEfforts?: string[]; - /** - * Default reasoning effort level (only present if model supports reasoning effort) - */ - defaultReasoningEffort?: string; - /** - * Context-window tiers this model offers, when the provider advertises them independently of tiered token pricing. Copilot models carry their tiers in `billing.tokenPrices`; a provider that has no pricing to publish (an agent host reached over AHP, for example) declares them here instead, so the model picker can still offer the tier toggle. - */ - supportedContextTiers?: string[]; - modelPickerCategory?: ModelPickerCategory; - modelPickerPriceCategory?: ModelPickerPriceCategory; - warningText?: ModelWarningText; - /** - * Informational notices the service published for this model, such as an upcoming change or a recommended alternative. Present only when the service published at least one notice. Hosts should surface these without implying anything is wrong with the model. - */ - infoMessages?: ModelMessage[]; - /** - * Warnings the service published for this model, such as a deprecated client version. Present only when the service published at least one warning. The model remains usable; hosts should surface these as advisory rather than blocking. - */ - warningMessages?: ModelMessage[]; + /** + * Model identifier (e.g., "claude-sonnet-4.5") + */ + id: string; + /** + * Display name + */ + name: string; + capabilities: ModelCapabilities; + /** + * Provider-supplied model metadata. Keys and JSON-compatible values are preserved unchanged. This is factual metadata published by the model provider; it carries no picker or UX semantics. + */ + metadata?: { + [k: string]: JsonValue | undefined; + }; + policy?: ModelPolicy; + billing?: ModelBilling; + /** + * Supported reasoning effort levels (only present if model supports reasoning effort) + */ + supportedReasoningEfforts?: string[]; + /** + * Default reasoning effort level (only present if model supports reasoning effort) + */ + defaultReasoningEffort?: string; + /** + * Context-window tiers this model offers, when the provider advertises them independently of tiered token pricing. Copilot models carry their tiers in `billing.tokenPrices`; a provider that has no pricing to publish (an agent host reached over AHP, for example) declares them here instead, so the model picker can still offer the tier toggle. + */ + supportedContextTiers?: string[]; + modelPickerCategory?: ModelPickerCategory; + modelPickerPriceCategory?: ModelPickerPriceCategory; + warningText?: ModelWarningText; + /** + * Informational notices the service published for this model, such as an upcoming change or a recommended alternative. Present only when the service published at least one notice. Hosts should surface these without implying anything is wrong with the model. + */ + infoMessages?: ModelMessage[]; + /** + * Warnings the service published for this model, such as a deprecated client version. Present only when the service published at least one warning. The model remains usable; hosts should surface these as advisory rather than blocking. + */ + warningMessages?: ModelMessage[]; } /** * Model capabilities and limits @@ -12257,8 +12543,8 @@ export interface Model { */ /** @experimental */ export interface ModelCapabilities { - supports?: ModelCapabilitiesSupports; - limits?: ModelCapabilitiesLimits; + supports?: ModelCapabilitiesSupports; + limits?: ModelCapabilitiesLimits; } /** * Feature flags indicating what the model supports @@ -12268,15 +12554,15 @@ export interface ModelCapabilities { */ /** @experimental */ export interface ModelCapabilitiesSupports { - /** - * Whether this model supports vision/image input - */ - vision?: boolean; - /** - * Whether this model supports reasoning effort configuration - */ - reasoningEffort?: boolean; - adaptive_thinking?: AdaptiveThinkingSupport; + /** + * Whether this model supports vision/image input + */ + vision?: boolean; + /** + * Whether this model supports reasoning effort configuration + */ + reasoningEffort?: boolean; + adaptive_thinking?: AdaptiveThinkingSupport; } /** * Token limits for prompts, outputs, and context window @@ -12286,19 +12572,19 @@ export interface ModelCapabilitiesSupports { */ /** @experimental */ export interface ModelCapabilitiesLimits { - /** - * Maximum number of prompt/input tokens - */ - max_prompt_tokens?: number; - /** - * Maximum number of output/completion tokens - */ - max_output_tokens?: number; - /** - * Maximum total context window size in tokens - */ - max_context_window_tokens?: number; - vision?: ModelCapabilitiesLimitsVision; + /** + * Maximum number of prompt/input tokens + */ + max_prompt_tokens?: number; + /** + * Maximum number of output/completion tokens + */ + max_output_tokens?: number; + /** + * Maximum total context window size in tokens + */ + max_context_window_tokens?: number; + vision?: ModelCapabilitiesLimitsVision; } /** * Vision-specific limits @@ -12308,18 +12594,18 @@ export interface ModelCapabilitiesLimits { */ /** @experimental */ export interface ModelCapabilitiesLimitsVision { - /** - * MIME types the model accepts - */ - supported_media_types: string[]; - /** - * Maximum number of images per prompt - */ - max_prompt_images: number; - /** - * Maximum image size in bytes - */ - max_prompt_image_size: number; + /** + * MIME types the model accepts + */ + supported_media_types: string[]; + /** + * Maximum number of images per prompt + */ + max_prompt_images: number; + /** + * Maximum image size in bytes + */ + max_prompt_image_size: number; } /** * Policy state (if applicable) @@ -12329,11 +12615,11 @@ export interface ModelCapabilitiesLimitsVision { */ /** @experimental */ export interface ModelPolicy { - state: ModelPolicyState; - /** - * Usage terms or conditions for this model - */ - terms?: string; + state: ModelPolicyState; + /** + * Usage terms or conditions for this model + */ + terms?: string; } /** * Billing information @@ -12343,16 +12629,16 @@ export interface ModelPolicy { */ /** @experimental */ export interface ModelBilling { - /** - * Billing cost multiplier relative to the base rate - */ - multiplier?: number; - tokenPrices?: ModelBillingTokenPrices; - /** - * Whole-number percentage discount (0-100) applied to usage billed through this model. Populated for the synthetic `auto` model, where requests routed by auto-mode are billed at a reduced rate; absent for concrete models. - */ - discountPercent?: number; - promo?: ModelBillingPromo; + /** + * Billing cost multiplier relative to the base rate + */ + multiplier?: number; + tokenPrices?: ModelBillingTokenPrices; + /** + * Whole-number percentage discount (0-100) applied to usage billed through this model. Populated for the synthetic `auto` model, where requests routed by auto-mode are billed at a reduced rate; absent for concrete models. + */ + discountPercent?: number; + promo?: ModelBillingPromo; } /** * Token-level pricing information for this model @@ -12362,45 +12648,45 @@ export interface ModelBilling { */ /** @experimental */ export interface ModelBillingTokenPrices { - /** - * AI Credits cost per billing batch of input tokens - */ - inputPrice?: number; - /** - * AI Credits cost per billing batch of output tokens - */ - outputPrice?: number; - /** - * @deprecated - * Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens - */ - cachePrice?: number; - /** - * AI Credits cost per billing batch of cached (read) tokens - */ - cacheReadPrice?: number; - /** - * AI Credits cost per billing batch of cache-write (cache creation) tokens. - */ - cacheWritePrice?: number; - /** - * AI Credits cost per billing batch of 1-hour cache-write (cache creation) tokens. - */ - cacheWrite1hPrice?: number; - /** - * Number of tokens per standard billing batch - */ - batchSize?: number; - /** - * @deprecated - * Use maxPromptTokens instead. Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens. - */ - contextMax?: number; - /** - * Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens. - */ - maxPromptTokens?: number; - longContext?: ModelBillingTokenPricesLongContext; + /** + * AI Credits cost per billing batch of input tokens + */ + inputPrice?: number; + /** + * AI Credits cost per billing batch of output tokens + */ + outputPrice?: number; + /** + * @deprecated + * Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens + */ + cachePrice?: number; + /** + * AI Credits cost per billing batch of cached (read) tokens + */ + cacheReadPrice?: number; + /** + * AI Credits cost per billing batch of cache-write (cache creation) tokens. + */ + cacheWritePrice?: number; + /** + * AI Credits cost per billing batch of 1-hour cache-write (cache creation) tokens. + */ + cacheWrite1hPrice?: number; + /** + * Number of tokens per standard billing batch + */ + batchSize?: number; + /** + * @deprecated + * Use maxPromptTokens instead. Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens. + */ + contextMax?: number; + /** + * Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens. + */ + maxPromptTokens?: number; + longContext?: ModelBillingTokenPricesLongContext; } /** * Long context tier pricing (available for models with extended context windows) @@ -12410,40 +12696,40 @@ export interface ModelBillingTokenPrices { */ /** @experimental */ export interface ModelBillingTokenPricesLongContext { - /** - * AI Credits cost per billing batch of input tokens - */ - inputPrice?: number; - /** - * AI Credits cost per billing batch of output tokens - */ - outputPrice?: number; - /** - * @deprecated - * Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens - */ - cachePrice?: number; - /** - * AI Credits cost per billing batch of cached (read) tokens - */ - cacheReadPrice?: number; - /** - * AI Credits cost per billing batch of cache-write (cache creation) tokens. - */ - cacheWritePrice?: number; - /** - * AI Credits cost per billing batch of 1-hour cache-write (cache creation) tokens. - */ - cacheWrite1hPrice?: number; - /** - * @deprecated - * 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. - */ - contextMax?: number; - /** - * Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens. - */ - maxPromptTokens?: number; + /** + * AI Credits cost per billing batch of input tokens + */ + inputPrice?: number; + /** + * AI Credits cost per billing batch of output tokens + */ + outputPrice?: number; + /** + * @deprecated + * Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens + */ + cachePrice?: number; + /** + * AI Credits cost per billing batch of cached (read) tokens + */ + cacheReadPrice?: number; + /** + * AI Credits cost per billing batch of cache-write (cache creation) tokens. + */ + cacheWritePrice?: number; + /** + * AI Credits cost per billing batch of 1-hour cache-write (cache creation) tokens. + */ + cacheWrite1hPrice?: number; + /** + * @deprecated + * 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. + */ + contextMax?: number; + /** + * Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens. + */ + maxPromptTokens?: number; } /** * Active server-driven promotion for a model, including its discount and optional expiry. @@ -12453,26 +12739,26 @@ export interface ModelBillingTokenPricesLongContext { */ /** @experimental */ export interface ModelBillingPromo { - /** - * Stable identifier for the promotion campaign. - */ - id?: string; - /** - * Percentage discount (0-100) applied while the promotion is active. May be fractional. - */ - discountPercent?: number; - /** - * UTC ISO 8601 timestamp marking when the promotion ends. Optional: an open-ended promotion omits this field. When present, the API only surfaces a promo whose expiry parses and is in the future, so consumers should treat a past value as expired. - */ - endsAt?: string; - /** - * Human-readable promotion message. Does not include the expiry timestamp; consumers may format endsAt and append it when present. - */ - message?: string; - /** - * Whether the service asked hosts to give this promotion a prominent surface, such as a dedicated banner, in addition to listing it with the model. `true` requests that surface and `false` asks for the model list only. Absent means the service expressed no preference — for example a response that predates the field — so hosts should apply their own default rather than read it as `false`. - */ - showBanner?: boolean; + /** + * Stable identifier for the promotion campaign. + */ + id?: string; + /** + * Percentage discount (0-100) applied while the promotion is active. May be fractional. + */ + discountPercent?: number; + /** + * UTC ISO 8601 timestamp marking when the promotion ends. Optional: an open-ended promotion omits this field. When present, the API only surfaces a promo whose expiry parses and is in the future, so consumers should treat a past value as expired. + */ + endsAt?: string; + /** + * Human-readable promotion message. Does not include the expiry timestamp; consumers may format endsAt and append it when present. + */ + message?: string; + /** + * Whether the service asked hosts to give this promotion a prominent surface, such as a dedicated banner, in addition to listing it with the model. `true` requests that surface and `false` asks for the model list only. Absent means the service expressed no preference — for example a response that predates the field — so hosts should apply their own default rather than read it as `false`. + */ + showBanner?: boolean; } /** * Service-published warning text that hosts should display when presenting a model. @@ -12482,10 +12768,10 @@ export interface ModelBillingPromo { */ /** @experimental */ export interface ModelWarningText { - /** - * Data-retention warning for the model. The text may contain Markdown links and should be rendered as Markdown when supported. - */ - dataRetention?: string; + /** + * Data-retention warning for the model. The text may contain Markdown links and should be rendered as Markdown when supported. + */ + dataRetention?: string; } /** * A service-published message about a model, carrying a stable machine-readable code alongside human-readable text. @@ -12495,14 +12781,14 @@ export interface ModelWarningText { */ /** @experimental */ export interface ModelMessage { - /** - * Stable machine-readable identifier for the message, such as `client_version_deprecated`. Hosts can key custom presentation off this; unrecognized codes should fall back to displaying `message`. - */ - code: string; - /** - * Human-readable message text intended for display to the user. - */ - message: string; + /** + * Stable machine-readable identifier for the message, such as `client_version_deprecated`. Hosts can key custom presentation off this; unrecognized codes should fall back to displaying `message`. + */ + code: string; + /** + * Human-readable message text intended for display to the user. + */ + message: string; } /** * Managed, repository, and CLI model overrides to overlay onto the session at startup. @@ -12512,38 +12798,38 @@ export interface ModelMessage { */ /** @experimental */ export interface ModelApplyStartupOverlayRequest { - /** - * Model required by device-managed policy, when configured. - */ - deviceManagedModel?: string; - /** - * Model required by server-managed policy, when configured. - */ - serverManagedModel?: string; - /** - * Startup default model from the enterprise policy helper, when configured. Weakest of the managed sources: it applies only when neither device nor server policy names a model, and an explicit user selection still wins. - */ - policyHelperModel?: string; - /** - * Model selected by repository settings, when configured. - */ - repoModel?: string; - /** - * Reasoning effort selected by repository settings, when configured. - */ - repoReasoningEffort?: string; - /** - * Context tier selected by repository settings, when configured. - */ - repoContextTier?: string; - /** - * Model explicitly selected by the CLI, when provided. - */ - cliModel?: string; - /** - * Whether the overlay is being applied while resuming a deferred session. - */ - deferredResume?: boolean; + /** + * Model required by device-managed policy, when configured. + */ + deviceManagedModel?: string; + /** + * Model required by server-managed policy, when configured. + */ + serverManagedModel?: string; + /** + * Startup default model from the enterprise policy helper, when configured. Weakest of the managed sources: it applies only when neither device nor server policy names a model, and an explicit user selection still wins. + */ + policyHelperModel?: string; + /** + * Model selected by repository settings, when configured. + */ + repoModel?: string; + /** + * Reasoning effort selected by repository settings, when configured. + */ + repoReasoningEffort?: string; + /** + * Context tier selected by repository settings, when configured. + */ + repoContextTier?: string; + /** + * Model explicitly selected by the CLI, when provided. + */ + cliModel?: string; + /** + * Whether the overlay is being applied while resuming a deferred session. + */ + deferredResume?: boolean; } /** * Optional capability overrides (vision, tool_calls, reasoning, etc.). @@ -12553,8 +12839,8 @@ export interface ModelApplyStartupOverlayRequest { */ /** @experimental */ export interface ModelCapabilitiesOverride { - supports?: ModelCapabilitiesOverrideSupports; - limits?: ModelCapabilitiesOverrideLimits; + supports?: ModelCapabilitiesOverrideSupports; + limits?: ModelCapabilitiesOverrideLimits; } /** * Feature flags indicating what the model supports @@ -12564,15 +12850,15 @@ export interface ModelCapabilitiesOverride { */ /** @experimental */ export interface ModelCapabilitiesOverrideSupports { - /** - * Whether this model supports vision/image input - */ - vision?: boolean; - /** - * Whether this model supports reasoning effort configuration - */ - reasoningEffort?: boolean; - adaptive_thinking?: AdaptiveThinkingSupport; + /** + * Whether this model supports vision/image input + */ + vision?: boolean; + /** + * Whether this model supports reasoning effort configuration + */ + reasoningEffort?: boolean; + adaptive_thinking?: AdaptiveThinkingSupport; } /** * Token limits for prompts, outputs, and context window @@ -12582,19 +12868,19 @@ export interface ModelCapabilitiesOverrideSupports { */ /** @experimental */ export interface ModelCapabilitiesOverrideLimits { - /** - * Maximum number of prompt/input tokens - */ - max_prompt_tokens?: number; - /** - * Maximum number of output/completion tokens - */ - max_output_tokens?: number; - /** - * Maximum total context window size in tokens - */ - max_context_window_tokens?: number; - vision?: ModelCapabilitiesOverrideLimitsVision; + /** + * Maximum number of prompt/input tokens + */ + max_prompt_tokens?: number; + /** + * Maximum number of output/completion tokens + */ + max_output_tokens?: number; + /** + * Maximum total context window size in tokens + */ + max_context_window_tokens?: number; + vision?: ModelCapabilitiesOverrideLimitsVision; } /** * Vision-specific limits @@ -12604,18 +12890,18 @@ export interface ModelCapabilitiesOverrideLimits { */ /** @experimental */ export interface ModelCapabilitiesOverrideLimitsVision { - /** - * MIME types the model accepts - */ - supported_media_types?: string[]; - /** - * Maximum number of images per prompt - */ - max_prompt_images?: number; - /** - * Maximum image size in bytes - */ - max_prompt_image_size?: number; + /** + * MIME types the model accepts + */ + supported_media_types?: string[]; + /** + * Maximum number of images per prompt + */ + max_prompt_images?: number; + /** + * Maximum image size in bytes + */ + max_prompt_image_size?: number; } /** * List of Copilot models available to the resolved user, including capabilities and billing metadata. @@ -12625,23 +12911,23 @@ export interface ModelCapabilitiesOverrideLimitsVision { */ /** @experimental */ export interface ModelList { - /** - * List of available models with full metadata - */ - models: Model[]; + /** + * List of available models with full metadata + */ + models: Model[]; } /** @experimental */ export interface ModelPickerPersistenceRequest { - settingsContext: ModelPickerSettingsContext; - /** - * Whether reasoning effort was explicitly selected and should be persisted. - */ - reasoningEffortExplicit?: boolean; - /** - * Whether context tier was explicitly selected and should be persisted. - */ - contextTierExplicit?: boolean; + settingsContext: ModelPickerSettingsContext; + /** + * Whether reasoning effort was explicitly selected and should be persisted. + */ + reasoningEffortExplicit?: boolean; + /** + * Whether context tier was explicitly selected and should be persisted. + */ + contextTierExplicit?: boolean; } /** * Filesystem and environment context used to resolve model-picker settings. @@ -12651,18 +12937,18 @@ export interface ModelPickerPersistenceRequest { */ /** @experimental */ export interface ModelPickerSettingsContext { - /** - * Optional Copilot configuration directory containing persisted settings. - */ - configDir?: string; - /** - * User home directory used when resolving persisted settings. - */ - homeDirectory: string; - /** - * Environment variables consulted while resolving model-picker settings. - */ - environment: {}; + /** + * Optional Copilot configuration directory containing persisted settings. + */ + configDir?: string; + /** + * User home directory used when resolving persisted settings. + */ + homeDirectory: string; + /** + * Environment variables consulted while resolving model-picker settings. + */ + environment: {}; } /** * Reasoning effort level to apply to the currently selected model. @@ -12672,10 +12958,10 @@ export interface ModelPickerSettingsContext { */ /** @experimental */ export interface ModelSetReasoningEffortRequest { - /** - * Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling. - */ - reasoningEffort: string; + /** + * Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling. + */ + reasoningEffort: string; } /** * Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns. @@ -12685,38 +12971,75 @@ export interface ModelSetReasoningEffortRequest { */ /** @experimental */ export interface ModelSetReasoningEffortResult { - /** - * Reasoning effort level recorded on the session after the update - */ - reasoningEffort: string; + /** + * Reasoning effort level recorded on the session after the update + */ + reasoningEffort: string; } /** @experimental */ export interface ModelsListRequest { - /** - * Opaque account identifier returned by `account.getAllUsers`. When omitted, the current account is used. - */ - selectionId?: string; - /** - * GitHub token accepted for compatibility with existing SDK clients. When provided, resolves this token instead of using the current account. - */ - gitHubToken?: string; + /** + * Opaque account identifier returned by `account.getAllUsers`. When omitted, the current account is used. + */ + selectionId?: string; + /** + * GitHub token accepted for compatibility with existing SDK clients. When provided, resolves this token instead of using the current account. + */ + gitHubToken?: string; +} +/** + * An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelSwitchAutoTierRequest". + */ +/** @experimental */ +export interface ModelSwitchAutoTierRequest { + /** + * Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. + */ + autoTier: AutoTier | null; + source?: ModelChangeSource; +} +/** + * Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelSwitchAutoTierResult". + */ +/** @experimental */ +export interface ModelSwitchAutoTierResult { + status: ModelSwitchAutoTierStatus; + effectiveAutoTier?: AutoTier; + /** + * Latest unclaimed Auto preference waiting for a future user turn. + */ + pendingAutoTier?: AutoTier | null; + /** + * Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + */ + activatingAutoTier?: AutoTier | null; + /** + * Earlier unclaimed preference replaced by this request. This can be present with either status, including when selecting the effective preference cancels pending work. + */ + supersededAutoTier?: AutoTier | null; } /** @experimental */ export interface ModelSwitchConfirmation { - /** - * Display name of the model that requires compaction confirmation. - */ - targetModelDisplayName: string; - /** - * Current conversation token count before switching models. - */ - currentTokens: number; - /** - * Target model token limit used by the compaction preflight. - */ - targetLimit: number; + /** + * Display name of the model that requires compaction confirmation. + */ + targetModelDisplayName: string; + /** + * Current conversation token count before switching models. + */ + currentTokens: number; + /** + * Target model token limit used by the compaction preflight. + */ + targetLimit: number; } /** * Target model identifier and optional reasoning effort, summary, capability overrides, and context tier. @@ -12726,44 +13049,48 @@ export interface ModelSwitchConfirmation { */ /** @experimental */ export interface ModelSwitchToRequest { - /** - * 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. - */ - modelId: string; - /** - * Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. "none" disables reasoning. When omitted, no effort override is applied. - */ - reasoningEffort?: string; - reasoningSummary?: ReasoningSummary; - verbosity?: Verbosity; - modelCapabilities?: ModelCapabilitiesOverride; - contextTier?: ContextTier; - source?: ModelChangeSource; - /** - * When true, defer this switch (enqueue it) if another model change is already queued, even when no turn is active — so it drains last (FIFO) and wins over the already-queued change. Intended for genuine user-initiated model selections; internal restore/reapply switches omit it and apply immediately when no turn is active. When no other model change is queued this has no effect (a switch still applies immediately unless a turn is active). - */ - deferIfModelChangeQueued?: boolean; - /** - * Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary. - */ - compactionDecision?: string; - /** - * When true, evaluate context-window compaction policy before applying the switch. - */ - runCompactionPreflight?: boolean; - /** - * Optional repository settings scope to persist after the switch commits. - */ - repoScope?: string; - /** - * Settings scope used when persisting the selected model. - */ - modelChangeScope?: string; - /** - * Require the target to be currently available and enabled before applying the switch. - */ - requireAvailable?: boolean; - pickerPersistence?: ModelPickerPersistenceRequest; + /** + * 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. + */ + modelId: string; + /** + * Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`. + */ + autoTier?: AutoTier | null; + /** + * Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. "none" disables reasoning. When omitted, no effort override is applied. + */ + reasoningEffort?: string; + reasoningSummary?: ReasoningSummary; + verbosity?: Verbosity; + modelCapabilities?: ModelCapabilitiesOverride; + contextTier?: ContextTier; + source?: ModelChangeSource; + /** + * When true, defer this switch (enqueue it) if another model change is already queued, even when no turn is active — so it drains last (FIFO) and wins over the already-queued change. Intended for genuine user-initiated model selections; internal restore/reapply switches omit it and apply immediately when no turn is active. When no other model change is queued this has no effect (a switch still applies immediately unless a turn is active). + */ + deferIfModelChangeQueued?: boolean; + /** + * Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary. + */ + compactionDecision?: string; + /** + * When true, evaluate context-window compaction policy before applying the switch. + */ + runCompactionPreflight?: boolean; + /** + * Optional repository settings scope to persist after the switch commits. + */ + repoScope?: string; + /** + * Settings scope used when persisting the selected model. + */ + modelChangeScope?: string; + /** + * Require the target to be currently available and enabled before applying the switch. + */ + requireAvailable?: boolean; + pickerPersistence?: ModelPickerPersistenceRequest; } /** * The model identifier active on the session after the switch. @@ -12773,35 +13100,36 @@ export interface ModelSwitchToRequest { */ /** @experimental */ export interface ModelSwitchToResult { - /** - * Currently active model identifier after the switch - */ - modelId?: string; - /** - * True when the switch was deferred (enqueued as a cancellable `/model` command) because a turn was active or another model change was already queued, rather than applied immediately. When true, the session's live model is unchanged until the queued change drains. - */ - deferred?: boolean; - /** - * Lifecycle result for the requested switch - */ - status?: string; - confirmation?: ModelSwitchConfirmation; - /** - * Persistence failure encountered after applying the model switch. - */ - persistenceError?: string; - /** - * User-facing outcome message for the model switch. - */ - message?: string; - /** - * User-facing warning produced while applying the model switch. - */ - warning?: string; - /** - * Deprecation warnings associated with the selected model or options. - */ - deprecationWarnings?: string[]; + /** + * Currently active model identifier after the switch + */ + modelId?: string; + /** + * True when the switch was deferred (enqueued as a cancellable `/model` command) because a turn was active or another model change was already queued, rather than applied immediately. When true, the session's live model is unchanged until the queued change drains. + */ + deferred?: boolean; + /** + * Lifecycle result for the requested switch + */ + status?: string; + confirmation?: ModelSwitchConfirmation; + /** + * Persistence failure encountered after applying the model switch. + */ + persistenceError?: string; + /** + * User-facing outcome message for the model switch. + */ + message?: string; + /** + * User-facing warning produced while applying the model switch. + */ + warning?: string; + /** + * Deprecation warnings associated with the selected model or options. + */ + deprecationWarnings?: string[]; + modelState?: CurrentModel; } /** * Agent interaction mode to apply to the session. @@ -12811,44 +13139,44 @@ export interface ModelSwitchToResult { */ /** @experimental */ export interface ModeSetRequest { - mode: SessionMode; - /** - * Session whose plan-mode base state should be inherited. - */ - inheritPlanBaseFromSessionId?: string; - /** - * Whether a dedicated plan model is configured. - */ - planModelConfigured?: boolean; - /** - * Dedicated model to use in plan mode, when configured. - */ - planModel?: string; - /** - * Reasoning effort to use with the dedicated plan model. - */ - planReasoningEffort?: string; - /** - * Context tier to use with the dedicated plan model. - */ - planContextTier?: string; - /** - * Explicit response to a model-switch compaction preflight. - */ - compactionDecision?: string; - /** - * Whether leaving plan mode should restore the session's previous model. - */ - restorePlanModel?: boolean; - /** - * Whether the selected plan model should be persisted. - */ - persistPlanSelection?: boolean; - pickerSettingsContext?: ModelPickerSettingsContext; - /** - * Action to perform when leaving plan mode. - */ - planExitAction?: string; + mode: SessionMode; + /** + * Session whose plan-mode base state should be inherited. + */ + inheritPlanBaseFromSessionId?: string; + /** + * Whether a dedicated plan model is configured. + */ + planModelConfigured?: boolean; + /** + * Dedicated model to use in plan mode, when configured. + */ + planModel?: string; + /** + * Reasoning effort to use with the dedicated plan model. + */ + planReasoningEffort?: string; + /** + * Context tier to use with the dedicated plan model. + */ + planContextTier?: string; + /** + * Explicit response to a model-switch compaction preflight. + */ + compactionDecision?: string; + /** + * Whether leaving plan mode should restore the session's previous model. + */ + restorePlanModel?: boolean; + /** + * Whether the selected plan model should be persisted. + */ + persistPlanSelection?: boolean; + pickerSettingsContext?: ModelPickerSettingsContext; + /** + * Action to perform when leaving plan mode. + */ + planExitAction?: string; } /** * Outcome of a session mode change, including any model switch it triggered and follow-up the host must perform. @@ -12858,35 +13186,35 @@ export interface ModeSetRequest { */ /** @experimental */ export interface ModeSetResult { - /** - * Lifecycle status of the requested mode change. - */ - status: string; - /** - * Whether applying the mode changed the active model. - */ - modelChanged: boolean; - confirmation?: ModelSwitchConfirmation; - /** - * User-facing warning produced while applying the mode change. - */ - warning?: string; - /** - * User-facing outcome message for the model switch triggered by the mode change. - */ - message?: string; - /** - * Deprecation warnings associated with the model selected by the mode change. - */ - deprecationWarnings?: string[]; - /** - * Whether the host must defer implementing the requested mode change. - */ - deferImplementation?: boolean; - /** - * Whether the host should arm an interactive continuation after the mode change. - */ - armInteractiveContinuation?: boolean; + /** + * Lifecycle status of the requested mode change. + */ + status: string; + /** + * Whether applying the mode changed the active model. + */ + modelChanged: boolean; + confirmation?: ModelSwitchConfirmation; + /** + * User-facing warning produced while applying the mode change. + */ + warning?: string; + /** + * User-facing outcome message for the model switch triggered by the mode change. + */ + message?: string; + /** + * Deprecation warnings associated with the model selected by the mode change. + */ + deprecationWarnings?: string[]; + /** + * Whether the host must defer implementing the requested mode change. + */ + deferImplementation?: boolean; + /** + * Whether the host should arm an interactive continuation after the mode change. + */ + armInteractiveContinuation?: boolean; } /** * Result of moving in-flight MCP loading to the background. @@ -12896,10 +13224,10 @@ export interface ModeSetResult { */ /** @experimental */ export interface MoveMcpLoadingToBackgroundResult { - /** - * Whether an in-flight MCP load was moved to the background, releasing turns that were waiting on it. False when no MCP load was in flight or the waiting turns had already been released. - */ - movedToBackground: boolean; + /** + * Whether an in-flight MCP load was moved to the background, releasing turns that were waiting on it. False when no MCP load was in flight or the waiting turns had already been released. + */ + movedToBackground: boolean; } /** * External SDK input for a named custom model provider. Ingested by the native protocol boundary before host dispatch. @@ -12909,36 +13237,36 @@ export interface MoveMcpLoadingToBackgroundResult { */ /** @experimental */ export interface NamedProviderConfig { - /** - * Unique provider name used to qualify model selection IDs. - */ - name: string; - type?: ProviderConfigType; - wireApi?: ProviderConfigWireApi; - transport?: ProviderConfigTransport; - /** - * Base URL for provider API requests. - */ - baseUrl: string; - /** - * Static API key used to authenticate provider requests. - */ - apiKey?: string; - /** - * Static bearer token used to authenticate provider requests. - */ - bearerToken?: string; - azure?: ProviderConfigAzure; - /** - * Additional HTTP headers included with provider requests. - */ - headers?: { - [k: string]: string | undefined; - }; - /** - * Whether the host supplies bearer tokens dynamically. - */ - hasBearerTokenProvider?: boolean; + /** + * Unique provider name used to qualify model selection IDs. + */ + name: string; + type?: ProviderConfigType; + wireApi?: ProviderConfigWireApi; + transport?: ProviderConfigTransport; + /** + * Base URL for provider API requests. + */ + baseUrl: string; + /** + * Static API key used to authenticate provider requests. + */ + apiKey?: string; + /** + * Static bearer token used to authenticate provider requests. + */ + bearerToken?: string; + azure?: ProviderConfigAzure; + /** + * Additional HTTP headers included with provider requests. + */ + headers?: { + [k: string]: string | undefined; + }; + /** + * Whether the host supplies bearer tokens dynamically. + */ + hasBearerTokenProvider?: boolean; } /** * Azure-specific provider options. @@ -12948,10 +13276,10 @@ export interface NamedProviderConfig { */ /** @experimental */ export interface ProviderConfigAzure { - /** - * API version. When set, uses the versioned deployment route. When omitted, uses the GA versionless v1 route. - */ - apiVersion?: string; + /** + * API version. When set, uses the versioned deployment route. When omitted, uses the GA versionless v1 route. + */ + apiVersion?: string; } /** * The session's friendly name, or null when not yet set. @@ -12961,10 +13289,10 @@ export interface ProviderConfigAzure { */ /** @experimental */ export interface NameGetResult { - /** - * The session name (user-set or auto-generated), or null if not yet set - */ - name: string | null; + /** + * The session name (user-set or auto-generated), or null if not yet set + */ + name: string | null; } /** * Auto-generated session summary to apply as the session's name when no user-set name exists. @@ -12974,10 +13302,10 @@ export interface NameGetResult { */ /** @experimental */ export interface NameSetAutoRequest { - /** - * Auto-generated session summary. Empty/whitespace-only values are ignored; values are trimmed before persisting. - */ - summary: string; + /** + * Auto-generated session summary. Empty/whitespace-only values are ignored; values are trimmed before persisting. + */ + summary: string; } /** * Indicates whether the auto-generated summary was applied as the session's name. @@ -12987,10 +13315,10 @@ export interface NameSetAutoRequest { */ /** @experimental */ export interface NameSetAutoResult { - /** - * Whether the auto-generated summary was persisted. False if the session already has a user-set name, the summary normalized to empty, or the session does not have a workspace. - */ - applied: boolean; + /** + * Whether the auto-generated summary was persisted. False if the session already has a user-set name, the summary normalized to empty, or the session does not have a workspace. + */ + applied: boolean; } /** * New friendly name to apply to the session. @@ -13000,10 +13328,10 @@ export interface NameSetAutoResult { */ /** @experimental */ export interface NameSetRequest { - /** - * New session name (1–100 characters, trimmed of leading/trailing whitespace) - */ - name: string; + /** + * New session name (1–100 characters, trimmed of leading/trailing whitespace) + */ + name: string; } /** * Content-exclusion policy supplied to `session.options.update`, with rules, last-updated data, and scope. @@ -13013,15 +13341,15 @@ export interface NameSetRequest { */ /** @experimental */ export interface OptionsUpdateAdditionalContentExclusionPolicy { - /** - * Content-exclusion rules to apply. - */ - rules: OptionsUpdateAdditionalContentExclusionPolicyRule[]; - /** - * Opaque policy update timestamp supplied by the host. - */ - last_updated_at: JsonValue; - scope: OptionsUpdateAdditionalContentExclusionPolicyScope; + /** + * Content-exclusion rules to apply. + */ + rules: OptionsUpdateAdditionalContentExclusionPolicyRule[]; + /** + * Opaque policy update timestamp supplied by the host. + */ + last_updated_at: JsonValue; + scope: OptionsUpdateAdditionalContentExclusionPolicyScope; } /** * Single content-exclusion rule supplied to `session.options.update`, with paths, match conditions, and source. @@ -13031,19 +13359,19 @@ export interface OptionsUpdateAdditionalContentExclusionPolicy { */ /** @experimental */ export interface OptionsUpdateAdditionalContentExclusionPolicyRule { - /** - * Path patterns covered by this rule. - */ - paths: string[]; - /** - * Conditions of which at least one must match. - */ - ifAnyMatch?: string[]; - /** - * Conditions none of which may match. - */ - ifNoneMatch?: string[]; - source: OptionsUpdateAdditionalContentExclusionPolicyRuleSource; + /** + * Path patterns covered by this rule. + */ + paths: string[]; + /** + * Conditions of which at least one must match. + */ + ifAnyMatch?: string[]; + /** + * Conditions none of which may match. + */ + ifNoneMatch?: string[]; + source: OptionsUpdateAdditionalContentExclusionPolicyRuleSource; } /** * Source descriptor for a `session.options.update` content-exclusion rule, with source name and type. @@ -13053,14 +13381,14 @@ export interface OptionsUpdateAdditionalContentExclusionPolicyRule { */ /** @experimental */ export interface OptionsUpdateAdditionalContentExclusionPolicyRuleSource { - /** - * Name of the policy source. - */ - name: string; - /** - * Type of the policy source. - */ - type: string; + /** + * Name of the policy source. + */ + name: string; + /** + * Type of the policy source. + */ + type: string; } /** * Pending permission prompt reconstructed from event history, with request ID and user-facing prompt details. @@ -13070,11 +13398,11 @@ export interface OptionsUpdateAdditionalContentExclusionPolicyRuleSource { */ /** @experimental */ export interface PendingPermissionRequest { - /** - * Unique identifier for the pending permission request - */ - requestId: string; - request: PermissionPromptRequest; + /** + * Unique identifier for the pending permission request + */ + requestId: string; + request: PermissionPromptRequest; } /** * List of pending permission requests reconstructed from event history. @@ -13084,10 +13412,10 @@ export interface PendingPermissionRequest { */ /** @experimental */ export interface PendingPermissionRequestList { - /** - * Pending permission prompts reconstructed from the session's event history. Equivalent to the set of `permission.requested` events that have not yet been followed by a matching `permission.completed` event. Used by clients (e.g. the CLI) to hydrate UI for prompts that were emitted before the client attached to the session. - */ - items: PendingPermissionRequest[]; + /** + * Pending permission prompts reconstructed from the session's event history. Equivalent to the set of `permission.requested` events that have not yet been followed by a matching `permission.completed` event. Used by clients (e.g. the CLI) to hydrate UI for prompts that were emitted before the client attached to the session. + */ + items: PendingPermissionRequest[]; } /** * Permission-decision request variant to approve only the current permission request. @@ -13097,14 +13425,14 @@ export interface PendingPermissionRequestList { */ /** @experimental */ export interface PermissionDecisionApproveOnce { - /** - * Approve this single request only - */ - kind: "approve-once"; - /** - * True only when a host surfaced this request to a user who approved it. - */ - approvedInteractively?: boolean; + /** + * Approve this single request only + */ + kind: "approve-once"; + /** + * True only when a host surfaced this request to a user who approved it. + */ + approvedInteractively?: boolean; } /** * Permission-decision request variant to approve for the rest of the session, with optional tool approval or URL domain. @@ -13114,15 +13442,15 @@ export interface PermissionDecisionApproveOnce { */ /** @experimental */ export interface PermissionDecisionApproveForSession { - /** - * Approve and remember for the rest of the session - */ - kind: "approve-for-session"; - approval?: PermissionDecisionApproveForSessionApproval; - /** - * URL domain to approve for the rest of the session (URL prompts only) - */ - domain?: string; + /** + * Approve and remember for the rest of the session + */ + kind: "approve-for-session"; + approval?: PermissionDecisionApproveForSessionApproval; + /** + * URL domain to approve for the rest of the session (URL prompts only) + */ + domain?: string; } /** * Session-scoped approval details for specific command identifiers. @@ -13132,14 +13460,14 @@ export interface PermissionDecisionApproveForSession { */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalCommands { - /** - * Approval scoped to specific command identifiers. - */ - kind: "commands"; - /** - * Command identifiers covered by this approval. - */ - commandIdentifiers: string[]; + /** + * Approval scoped to specific command identifiers. + */ + kind: "commands"; + /** + * Command identifiers covered by this approval. + */ + commandIdentifiers: string[]; } /** * Session-scoped approval details for read-only filesystem operations. @@ -13149,10 +13477,10 @@ export interface PermissionDecisionApproveForSessionApprovalCommands { */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalRead { - /** - * Approval covering read-only filesystem operations. - */ - kind: "read"; + /** + * Approval covering read-only filesystem operations. + */ + kind: "read"; } /** * Session-scoped approval details for filesystem write operations. @@ -13162,10 +13490,10 @@ export interface PermissionDecisionApproveForSessionApprovalRead { */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalWrite { - /** - * Approval covering filesystem write operations. - */ - kind: "write"; + /** + * Approval covering filesystem write operations. + */ + kind: "write"; } /** * Session-scoped approval details for an MCP server tool, or all tools on the server when `toolName` is null. @@ -13175,18 +13503,18 @@ export interface PermissionDecisionApproveForSessionApprovalWrite { */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalMcp { - /** - * Approval covering an MCP tool. - */ - kind: "mcp"; - /** - * MCP server name. - */ - serverName: string; - /** - * MCP tool name, or null to cover every tool on the server. - */ - toolName: string | null; + /** + * Approval covering an MCP tool. + */ + kind: "mcp"; + /** + * MCP server name. + */ + serverName: string; + /** + * MCP tool name, or null to cover every tool on the server. + */ + toolName: string | null; } /** * Session-scoped approval details for MCP sampling requests from a server. @@ -13196,14 +13524,14 @@ export interface PermissionDecisionApproveForSessionApprovalMcp { */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalMcpSampling { - /** - * Approval covering MCP sampling requests for a server. - */ - kind: "mcp-sampling"; - /** - * MCP server name. - */ - serverName: string; + /** + * Approval covering MCP sampling requests for a server. + */ + kind: "mcp-sampling"; + /** + * MCP server name. + */ + serverName: string; } /** * Session-scoped approval details for writes to long-term memory. @@ -13213,10 +13541,10 @@ export interface PermissionDecisionApproveForSessionApprovalMcpSampling { */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalMemory { - /** - * Approval covering writes to long-term memory. - */ - kind: "memory"; + /** + * Approval covering writes to long-term memory. + */ + kind: "memory"; } /** * Session-scoped approval details for a custom tool, keyed by tool name. @@ -13226,14 +13554,14 @@ export interface PermissionDecisionApproveForSessionApprovalMemory { */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalCustomTool { - /** - * Approval covering a custom tool. - */ - kind: "custom-tool"; - /** - * Custom tool name. - */ - toolName: string; + /** + * Approval covering a custom tool. + */ + kind: "custom-tool"; + /** + * Custom tool name. + */ + toolName: string; } /** * Session-scoped approval details for extension-management operations, optionally narrowed by operation. @@ -13243,14 +13571,14 @@ export interface PermissionDecisionApproveForSessionApprovalCustomTool { */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalExtensionManagement { - /** - * Approval covering extension lifecycle operations such as enable, disable, or reload. - */ - kind: "extension-management"; - /** - * Optional operation identifier; when omitted, the approval covers all extension management operations. - */ - operation?: string; + /** + * Approval covering extension lifecycle operations such as enable, disable, or reload. + */ + kind: "extension-management"; + /** + * Optional operation identifier; when omitted, the approval covers all extension management operations. + */ + operation?: string; } /** * Session-scoped factory approval, optionally narrowed by approval key. @@ -13260,14 +13588,14 @@ export interface PermissionDecisionApproveForSessionApprovalExtensionManagement */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalFactory { - /** - * Approval covering factory operations. - */ - kind: "factory"; - /** - * Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. - */ - approvalKey?: string; + /** + * Approval covering factory operations. + */ + kind: "factory"; + /** + * Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + */ + approvalKey?: string; } /** * Session-scoped approval details for an extension's permission-gated capability access, keyed by extension name. @@ -13277,14 +13605,14 @@ export interface PermissionDecisionApproveForSessionApprovalFactory { */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess { - /** - * Approval covering an extension's request to access a permission-gated capability. - */ - kind: "extension-permission-access"; - /** - * Extension name. - */ - extensionName: string; + /** + * Approval covering an extension's request to access a permission-gated capability. + */ + kind: "extension-permission-access"; + /** + * Extension name. + */ + extensionName: string; } /** * Session-scoped approval details for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names. @@ -13294,20 +13622,20 @@ export interface PermissionDecisionApproveForSessionApprovalExtensionPermissionA */ /** @experimental */ export interface PermissionDecisionApproveForSessionApprovalExtensionEnvAccess { - /** - * Approval covering an extension's request to read sensitive environment variables. - */ - kind: "extension-env-access"; - /** - * Extension name. - */ - extensionName: string; - /** - * Names of the sensitive environment variables this approval covers. Values are never persisted. - * - * @minItems 1 - */ - environmentVariables: [string, ...string[]]; + /** + * Approval covering an extension's request to read sensitive environment variables. + */ + kind: "extension-env-access"; + /** + * Extension name. + */ + extensionName: string; + /** + * Names of the sensitive environment variables this approval covers. Values are never persisted. + * + * @minItems 1 + */ + environmentVariables: [string, ...string[]]; } /** * Permission-decision request variant to approve and persist a permission for a project location, with approval details and location key. @@ -13317,15 +13645,15 @@ export interface PermissionDecisionApproveForSessionApprovalExtensionEnvAccess { */ /** @experimental */ export interface PermissionDecisionApproveForLocation { - /** - * Approve and persist for this project location - */ - kind: "approve-for-location"; - approval: PermissionDecisionApproveForLocationApproval; - /** - * Location key (git root or cwd) to persist the approval to - */ - locationKey: string; + /** + * Approve and persist for this project location + */ + kind: "approve-for-location"; + approval: PermissionDecisionApproveForLocationApproval; + /** + * Location key (git root or cwd) to persist the approval to + */ + locationKey: string; } /** * Location-scoped approval details for specific command identifiers. @@ -13335,14 +13663,14 @@ export interface PermissionDecisionApproveForLocation { */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalCommands { - /** - * Approval scoped to specific command identifiers. - */ - kind: "commands"; - /** - * Command identifiers covered by this approval. - */ - commandIdentifiers: string[]; + /** + * Approval scoped to specific command identifiers. + */ + kind: "commands"; + /** + * Command identifiers covered by this approval. + */ + commandIdentifiers: string[]; } /** * Location-scoped approval details for read-only filesystem operations. @@ -13352,10 +13680,10 @@ export interface PermissionDecisionApproveForLocationApprovalCommands { */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalRead { - /** - * Approval covering read-only filesystem operations. - */ - kind: "read"; + /** + * Approval covering read-only filesystem operations. + */ + kind: "read"; } /** * Location-scoped approval details for filesystem write operations. @@ -13365,10 +13693,10 @@ export interface PermissionDecisionApproveForLocationApprovalRead { */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalWrite { - /** - * Approval covering filesystem write operations. - */ - kind: "write"; + /** + * Approval covering filesystem write operations. + */ + kind: "write"; } /** * Location-scoped approval details for an MCP server tool, or all tools on the server when `toolName` is null. @@ -13378,18 +13706,18 @@ export interface PermissionDecisionApproveForLocationApprovalWrite { */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalMcp { - /** - * Approval covering an MCP tool. - */ - kind: "mcp"; - /** - * MCP server name. - */ - serverName: string; - /** - * MCP tool name, or null to cover every tool on the server. - */ - toolName: string | null; + /** + * Approval covering an MCP tool. + */ + kind: "mcp"; + /** + * MCP server name. + */ + serverName: string; + /** + * MCP tool name, or null to cover every tool on the server. + */ + toolName: string | null; } /** * Location-scoped approval details for MCP sampling requests from a server. @@ -13399,14 +13727,14 @@ export interface PermissionDecisionApproveForLocationApprovalMcp { */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalMcpSampling { - /** - * Approval covering MCP sampling requests for a server. - */ - kind: "mcp-sampling"; - /** - * MCP server name. - */ - serverName: string; + /** + * Approval covering MCP sampling requests for a server. + */ + kind: "mcp-sampling"; + /** + * MCP server name. + */ + serverName: string; } /** * Location-scoped approval details for writes to long-term memory. @@ -13416,10 +13744,10 @@ export interface PermissionDecisionApproveForLocationApprovalMcpSampling { */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalMemory { - /** - * Approval covering writes to long-term memory. - */ - kind: "memory"; + /** + * Approval covering writes to long-term memory. + */ + kind: "memory"; } /** * Location-scoped approval details for a custom tool, keyed by tool name. @@ -13429,14 +13757,14 @@ export interface PermissionDecisionApproveForLocationApprovalMemory { */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalCustomTool { - /** - * Approval covering a custom tool. - */ - kind: "custom-tool"; - /** - * Custom tool name. - */ - toolName: string; + /** + * Approval covering a custom tool. + */ + kind: "custom-tool"; + /** + * Custom tool name. + */ + toolName: string; } /** * Location-scoped approval details for extension-management operations, optionally narrowed by operation. @@ -13446,14 +13774,14 @@ export interface PermissionDecisionApproveForLocationApprovalCustomTool { */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalExtensionManagement { - /** - * Approval covering extension lifecycle operations such as enable, disable, or reload. - */ - kind: "extension-management"; - /** - * Optional operation identifier; when omitted, the approval covers all extension management operations. - */ - operation?: string; + /** + * Approval covering extension lifecycle operations such as enable, disable, or reload. + */ + kind: "extension-management"; + /** + * Optional operation identifier; when omitted, the approval covers all extension management operations. + */ + operation?: string; } /** * Location-scoped factory approval, optionally narrowed by approval key. @@ -13463,14 +13791,14 @@ export interface PermissionDecisionApproveForLocationApprovalExtensionManagement */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalFactory { - /** - * Approval covering factory operations. - */ - kind: "factory"; - /** - * Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. - */ - approvalKey?: string; + /** + * Approval covering factory operations. + */ + kind: "factory"; + /** + * Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + */ + approvalKey?: string; } /** * Location-scoped approval details for an extension's permission-gated capability access, keyed by extension name. @@ -13480,14 +13808,14 @@ export interface PermissionDecisionApproveForLocationApprovalFactory { */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess { - /** - * Approval covering an extension's request to access a permission-gated capability. - */ - kind: "extension-permission-access"; - /** - * Extension name. - */ - extensionName: string; + /** + * Approval covering an extension's request to access a permission-gated capability. + */ + kind: "extension-permission-access"; + /** + * Extension name. + */ + extensionName: string; } /** * Location-scoped approval details for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names. @@ -13497,20 +13825,20 @@ export interface PermissionDecisionApproveForLocationApprovalExtensionPermission */ /** @experimental */ export interface PermissionDecisionApproveForLocationApprovalExtensionEnvAccess { - /** - * Approval covering an extension's request to read sensitive environment variables. - */ - kind: "extension-env-access"; - /** - * Extension name. - */ - extensionName: string; - /** - * Names of the sensitive environment variables this approval covers. Values are never persisted. - * - * @minItems 1 - */ - environmentVariables: [string, ...string[]]; + /** + * Approval covering an extension's request to read sensitive environment variables. + */ + kind: "extension-env-access"; + /** + * Extension name. + */ + extensionName: string; + /** + * Names of the sensitive environment variables this approval covers. Values are never persisted. + * + * @minItems 1 + */ + environmentVariables: [string, ...string[]]; } /** * Permission-decision request variant to permanently approve a URL domain across sessions. @@ -13520,14 +13848,14 @@ export interface PermissionDecisionApproveForLocationApprovalExtensionEnvAccess */ /** @experimental */ export interface PermissionDecisionApprovePermanently { - /** - * Approve and persist across sessions (URL prompts only) - */ - kind: "approve-permanently"; - /** - * URL domain to approve permanently - */ - domain: string; + /** + * Approve and persist across sessions (URL prompts only) + */ + kind: "approve-permanently"; + /** + * URL domain to approve permanently + */ + domain: string; } /** * Permission-decision request variant to reject a pending permission request, with optional feedback. @@ -13537,14 +13865,14 @@ export interface PermissionDecisionApprovePermanently { */ /** @experimental */ export interface PermissionDecisionReject { - /** - * Reject the request - */ - kind: "reject"; - /** - * Optional feedback explaining the rejection - */ - feedback?: string; + /** + * Reject the request + */ + kind: "reject"; + /** + * Optional feedback explaining the rejection + */ + feedback?: string; } /** * Permission-decision variant indicating no user was available to confirm the request. @@ -13554,10 +13882,10 @@ export interface PermissionDecisionReject { */ /** @experimental */ export interface PermissionDecisionUserNotAvailable { - /** - * No user is available to confirm the request - */ - kind: "user-not-available"; + /** + * No user is available to confirm the request + */ + kind: "user-not-available"; } /** * Permission-decision variant indicating the request was approved. @@ -13567,10 +13895,10 @@ export interface PermissionDecisionUserNotAvailable { */ /** @experimental */ export interface PermissionDecisionApproved { - /** - * The permission request was approved - */ - kind: "approved"; + /** + * The permission request was approved + */ + kind: "approved"; } /** * Permission-decision variant indicating approval was remembered for the session, with approval details. @@ -13580,11 +13908,11 @@ export interface PermissionDecisionApproved { */ /** @experimental */ export interface PermissionDecisionApprovedForSession { - /** - * Approved and remembered for the rest of the session - */ - kind: "approved-for-session"; - approval: UserToolSessionApproval; + /** + * Approved and remembered for the rest of the session + */ + kind: "approved-for-session"; + approval: UserToolSessionApproval; } /** * Permission-decision variant indicating approval was persisted for a project location, with approval details and location key. @@ -13594,15 +13922,15 @@ export interface PermissionDecisionApprovedForSession { */ /** @experimental */ export interface PermissionDecisionApprovedForLocation { - /** - * Approved and persisted for this project location - */ - kind: "approved-for-location"; - approval: UserToolSessionApproval; - /** - * The location key (git root or cwd) to persist the approval to - */ - locationKey: string; + /** + * Approved and persisted for this project location + */ + kind: "approved-for-location"; + approval: UserToolSessionApproval; + /** + * The location key (git root or cwd) to persist the approval to + */ + locationKey: string; } /** * Permission-decision variant indicating the request was cancelled before use, with an optional reason. @@ -13612,14 +13940,14 @@ export interface PermissionDecisionApprovedForLocation { */ /** @experimental */ export interface PermissionDecisionCancelled { - /** - * The permission request was cancelled before a response was used - */ - kind: "cancelled"; - /** - * Optional explanation of why the request was cancelled - */ - reason?: string; + /** + * The permission request was cancelled before a response was used + */ + kind: "cancelled"; + /** + * Optional explanation of why the request was cancelled + */ + reason?: string; } /** * Permission-decision variant indicating explicit denial by permission rules, with the matching rules. @@ -13629,14 +13957,14 @@ export interface PermissionDecisionCancelled { */ /** @experimental */ export interface PermissionDecisionDeniedByRules { - /** - * Denied because approval rules explicitly blocked it - */ - kind: "denied-by-rules"; - /** - * Rules that denied the request - */ - rules: PermissionRule[]; + /** + * Denied because approval rules explicitly blocked it + */ + kind: "denied-by-rules"; + /** + * Rules that denied the request + */ + rules: PermissionRule[]; } /** * Permission-decision variant indicating no approval rule matched and user confirmation was unavailable. @@ -13646,10 +13974,10 @@ export interface PermissionDecisionDeniedByRules { */ /** @experimental */ export interface PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser { - /** - * Denied because no approval rule matched and user confirmation was unavailable - */ - kind: "denied-no-approval-rule-and-could-not-request-from-user"; + /** + * Denied because no approval rule matched and user confirmation was unavailable + */ + kind: "denied-no-approval-rule-and-could-not-request-from-user"; } /** * Permission-decision variant indicating the user denied an interactive prompt, with optional feedback and force-reject flag. @@ -13659,18 +13987,18 @@ export interface PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUse */ /** @experimental */ export interface PermissionDecisionDeniedInteractivelyByUser { - /** - * Denied by the user during an interactive prompt - */ - kind: "denied-interactively-by-user"; - /** - * Optional feedback from the user explaining the denial - */ - feedback?: string; - /** - * Whether to force-reject the current agent turn - */ - forceReject?: boolean; + /** + * Denied by the user during an interactive prompt + */ + kind: "denied-interactively-by-user"; + /** + * Optional feedback from the user explaining the denial + */ + feedback?: string; + /** + * Whether to force-reject the current agent turn + */ + forceReject?: boolean; } /** * Permission-decision variant indicating denial by content-exclusion policy, with path and message. @@ -13680,18 +14008,18 @@ export interface PermissionDecisionDeniedInteractivelyByUser { */ /** @experimental */ export interface PermissionDecisionDeniedByContentExclusionPolicy { - /** - * Denied by the organization's content exclusion policy - */ - kind: "denied-by-content-exclusion-policy"; - /** - * File path that triggered the exclusion - */ - path: string; - /** - * Human-readable explanation of why the path was excluded - */ - message: string; + /** + * Denied by the organization's content exclusion policy + */ + kind: "denied-by-content-exclusion-policy"; + /** + * File path that triggered the exclusion + */ + path: string; + /** + * Human-readable explanation of why the path was excluded + */ + message: string; } /** * Permission-decision variant indicating denial by a permission request hook, with optional message and interrupt flag. @@ -13701,18 +14029,18 @@ export interface PermissionDecisionDeniedByContentExclusionPolicy { */ /** @experimental */ export interface PermissionDecisionDeniedByPermissionRequestHook { - /** - * Denied by a permission request hook registered by an extension or plugin - */ - kind: "denied-by-permission-request-hook"; - /** - * Optional message from the hook explaining the denial - */ - message?: string; - /** - * Whether to interrupt the current agent turn - */ - interrupt?: boolean; + /** + * Denied by a permission request hook registered by an extension or plugin + */ + kind: "denied-by-permission-request-hook"; + /** + * Optional message from the hook explaining the denial + */ + message?: string; + /** + * Whether to interrupt the current agent turn + */ + interrupt?: boolean; } /** * Optional informational context describing how and where the permission decision was made. This does not affect permission behavior. @@ -13722,10 +14050,10 @@ export interface PermissionDecisionDeniedByPermissionRequestHook { */ /** @experimental */ export interface PermissionDecisionContext { - outcome: PermissionDecisionOutcome; - source: PermissionDecisionSource; - surface: PermissionDecisionSurface; - responseCapability?: PermissionResponseCapability; + outcome: PermissionDecisionOutcome; + source: PermissionDecisionSource; + surface: PermissionDecisionSurface; + responseCapability?: PermissionResponseCapability; } /** * Pending permission request ID and the decision to apply (approve/reject and scope). @@ -13735,12 +14063,12 @@ export interface PermissionDecisionContext { */ /** @experimental */ export interface PermissionDecisionRequest { - /** - * Request ID of the pending permission request - */ - requestId: string; - result: PermissionDecision; - decisionContext?: PermissionDecisionContext; + /** + * Request ID of the pending permission request + */ + requestId: string; + result: PermissionDecision; + decisionContext?: PermissionDecisionContext; } /** * Location-scoped tool approval to persist. @@ -13750,11 +14078,11 @@ export interface PermissionDecisionRequest { */ /** @experimental */ export interface PermissionLocationAddToolApprovalParams { - /** - * Location key (git root or cwd) to persist the approval to - */ - locationKey: string; - approval: PermissionsLocationsAddToolApprovalDetails; + /** + * Location key (git root or cwd) to persist the approval to + */ + locationKey: string; + approval: PermissionsLocationsAddToolApprovalDetails; } /** * Location-persisted tool approval details for specific command identifiers. @@ -13764,14 +14092,14 @@ export interface PermissionLocationAddToolApprovalParams { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsCommands { - /** - * Approval scoped to specific command identifiers. - */ - kind: "commands"; - /** - * Command identifiers covered by this approval. - */ - commandIdentifiers: string[]; + /** + * Approval scoped to specific command identifiers. + */ + kind: "commands"; + /** + * Command identifiers covered by this approval. + */ + commandIdentifiers: string[]; } /** * Location-persisted tool approval details for read-only filesystem operations. @@ -13781,10 +14109,10 @@ export interface PermissionsLocationsAddToolApprovalDetailsCommands { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsRead { - /** - * Approval covering read-only filesystem operations. - */ - kind: "read"; + /** + * Approval covering read-only filesystem operations. + */ + kind: "read"; } /** * Location-persisted tool approval details for filesystem write operations. @@ -13794,10 +14122,10 @@ export interface PermissionsLocationsAddToolApprovalDetailsRead { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsWrite { - /** - * Approval covering filesystem write operations. - */ - kind: "write"; + /** + * Approval covering filesystem write operations. + */ + kind: "write"; } /** * Location-persisted tool approval details for an MCP server tool, or all tools when `toolName` is null. @@ -13807,18 +14135,18 @@ export interface PermissionsLocationsAddToolApprovalDetailsWrite { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsMcp { - /** - * Approval covering an MCP tool. - */ - kind: "mcp"; - /** - * MCP server name. - */ - serverName: string; - /** - * MCP tool name, or null to cover every tool on the server. - */ - toolName: string | null; + /** + * Approval covering an MCP tool. + */ + kind: "mcp"; + /** + * MCP server name. + */ + serverName: string; + /** + * MCP tool name, or null to cover every tool on the server. + */ + toolName: string | null; } /** * Location-persisted tool approval details for MCP sampling requests from a server. @@ -13828,14 +14156,14 @@ export interface PermissionsLocationsAddToolApprovalDetailsMcp { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsMcpSampling { - /** - * Approval covering MCP sampling requests for a server. - */ - kind: "mcp-sampling"; - /** - * MCP server name. - */ - serverName: string; + /** + * Approval covering MCP sampling requests for a server. + */ + kind: "mcp-sampling"; + /** + * MCP server name. + */ + serverName: string; } /** * Location-persisted tool approval details for writes to long-term memory. @@ -13845,10 +14173,10 @@ export interface PermissionsLocationsAddToolApprovalDetailsMcpSampling { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsMemory { - /** - * Approval covering writes to long-term memory. - */ - kind: "memory"; + /** + * Approval covering writes to long-term memory. + */ + kind: "memory"; } /** * Location-persisted tool approval details for a custom tool, keyed by tool name. @@ -13858,14 +14186,14 @@ export interface PermissionsLocationsAddToolApprovalDetailsMemory { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsCustomTool { - /** - * Approval covering a custom tool. - */ - kind: "custom-tool"; - /** - * Custom tool name. - */ - toolName: string; + /** + * Approval covering a custom tool. + */ + kind: "custom-tool"; + /** + * Custom tool name. + */ + toolName: string; } /** * Location-persisted tool approval details for extension-management operations, optionally narrowed by operation. @@ -13875,14 +14203,14 @@ export interface PermissionsLocationsAddToolApprovalDetailsCustomTool { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsExtensionManagement { - /** - * Approval covering extension lifecycle operations such as enable, disable, or reload. - */ - kind: "extension-management"; - /** - * Optional operation identifier; when omitted, the approval covers all extension management operations. - */ - operation?: string; + /** + * Approval covering extension lifecycle operations such as enable, disable, or reload. + */ + kind: "extension-management"; + /** + * Optional operation identifier; when omitted, the approval covers all extension management operations. + */ + operation?: string; } /** * Location-persisted factory approval, optionally narrowed by approval key. @@ -13892,14 +14220,14 @@ export interface PermissionsLocationsAddToolApprovalDetailsExtensionManagement { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsFactory { - /** - * Approval covering factory operations. - */ - kind: "factory"; - /** - * Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. - */ - approvalKey?: string; + /** + * Approval covering factory operations. + */ + kind: "factory"; + /** + * Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations. + */ + approvalKey?: string; } /** * Location-persisted tool approval details for an extension's permission-gated capability access, keyed by extension name. @@ -13909,14 +14237,14 @@ export interface PermissionsLocationsAddToolApprovalDetailsFactory { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess { - /** - * Approval covering an extension's request to access a permission-gated capability. - */ - kind: "extension-permission-access"; - /** - * Extension name. - */ - extensionName: string; + /** + * Approval covering an extension's request to access a permission-gated capability. + */ + kind: "extension-permission-access"; + /** + * Extension name. + */ + extensionName: string; } /** * Location-persisted tool approval details for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names. @@ -13926,20 +14254,20 @@ export interface PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAc */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess { - /** - * Approval covering an extension's request to read sensitive environment variables. - */ - kind: "extension-env-access"; - /** - * Extension name. - */ - extensionName: string; - /** - * Names of the sensitive environment variables this approval covers. Values are never persisted. - * - * @minItems 1 - */ - environmentVariables: [string, ...string[]]; + /** + * Approval covering an extension's request to read sensitive environment variables. + */ + kind: "extension-env-access"; + /** + * Extension name. + */ + extensionName: string; + /** + * Names of the sensitive environment variables this approval covers. Values are never persisted. + * + * @minItems 1 + */ + environmentVariables: [string, ...string[]]; } /** * Working directory to load persisted location permissions for. @@ -13949,10 +14277,10 @@ export interface PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess { */ /** @experimental */ export interface PermissionLocationApplyParams { - /** - * Working directory whose persisted location permissions should be applied - */ - workingDirectory: string; + /** + * Working directory whose persisted location permissions should be applied + */ + workingDirectory: string; } /** * Summary of persisted location permissions applied to the session. @@ -13962,27 +14290,27 @@ export interface PermissionLocationApplyParams { */ /** @experimental */ export interface PermissionLocationApplyResult { - /** - * Location key used in the location-permissions store - */ - locationKey: string; - locationType: PermissionLocationType; - /** - * Whether a different location was applied since the previous apply call - */ - changed: boolean; - /** - * Number of location-scoped rules added to the live permission service - */ - appliedRuleCount: number; - /** - * Number of persisted allowed directories added to the live path manager - */ - appliedDirectoryCount: number; - /** - * Location-scoped rules applied to the live permission service - */ - appliedRules: PermissionRule[]; + /** + * Location key used in the location-permissions store + */ + locationKey: string; + locationType: PermissionLocationType; + /** + * Whether a different location was applied since the previous apply call + */ + changed: boolean; + /** + * Number of location-scoped rules added to the live permission service + */ + appliedRuleCount: number; + /** + * Number of persisted allowed directories added to the live path manager + */ + appliedDirectoryCount: number; + /** + * Location-scoped rules applied to the live permission service + */ + appliedRules: PermissionRule[]; } /** * Working directory to resolve into a location-permissions key. @@ -13992,10 +14320,10 @@ export interface PermissionLocationApplyResult { */ /** @experimental */ export interface PermissionLocationResolveParams { - /** - * Working directory whose permission location should be resolved - */ - workingDirectory: string; + /** + * Working directory whose permission location should be resolved + */ + workingDirectory: string; } /** * Resolved location-permissions key and type. @@ -14005,11 +14333,11 @@ export interface PermissionLocationResolveParams { */ /** @experimental */ export interface PermissionLocationResolveResult { - /** - * Location key used in the location-permissions store - */ - locationKey: string; - locationType: PermissionLocationType; + /** + * Location key used in the location-permissions store + */ + locationKey: string; + locationType: PermissionLocationType; } /** * Directory path to add to the session's allowed directories. @@ -14019,10 +14347,10 @@ export interface PermissionLocationResolveResult { */ /** @experimental */ export interface PermissionPathsAddParams { - /** - * Directory to add to the allow-list. The runtime resolves and validates the path before adding, then loads conventional `.github/skills/` and `.github/agents/` definitions under it when their subsystem gates are enabled. Adding the directory is therefore also a trust decision for configuration stored there. - */ - path: string; + /** + * Directory to add to the allow-list. The runtime resolves and validates the path before adding, then loads conventional `.github/skills/` and `.github/agents/` definitions under it when their subsystem gates are enabled. Adding the directory is therefore also a trust decision for configuration stored there. + */ + path: string; } /** * Path to evaluate against the session's allowed directories. @@ -14032,10 +14360,10 @@ export interface PermissionPathsAddParams { */ /** @experimental */ export interface PermissionPathsAllowedCheckParams { - /** - * Path to check against the session's allowed directories - */ - path: string; + /** + * Path to check against the session's allowed directories + */ + path: string; } /** * Indicates whether the supplied path is within the session's allowed directories. @@ -14045,10 +14373,10 @@ export interface PermissionPathsAllowedCheckParams { */ /** @experimental */ export interface PermissionPathsAllowedCheckResult { - /** - * Whether the path is within the session's allowed directories - */ - allowed: boolean; + /** + * Whether the path is within the session's allowed directories + */ + allowed: boolean; } /** * If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged. @@ -14058,22 +14386,22 @@ export interface PermissionPathsAllowedCheckResult { */ /** @experimental */ export interface PermissionPathsConfig { - /** - * If true, the runtime allows access to all paths without prompting. Equivalent to constructing an UnrestrictedPathManager. - */ - unrestricted?: boolean; - /** - * Additional directories to allow tool access to (in addition to the session's working directory). Conventional `.github/skills/` and `.github/agents/` definitions under them also join the session catalogs when their subsystem gates are enabled, so supplying a directory is a trust decision for configuration stored there. When `unrestricted` is true, these are still pre-populated on the UnrestrictedPathManager so they remain visible via getDirectories() (e.g. for @-mention completion). - */ - additionalDirectories?: string[]; - /** - * Whether to include the system temp directory in the allowed list (defaults to true). Ignored when `unrestricted` is true. - */ - includeTempDirectory?: boolean; - /** - * Workspace root path (special-cased to be allowed even before the directory exists). Ignored when `unrestricted` is true. - */ - workspacePath?: string; + /** + * If true, the runtime allows access to all paths without prompting. Equivalent to constructing an UnrestrictedPathManager. + */ + unrestricted?: boolean; + /** + * Additional directories to allow tool access to (in addition to the session's working directory). Conventional `.github/skills/` and `.github/agents/` definitions under them also join the session catalogs when their subsystem gates are enabled, so supplying a directory is a trust decision for configuration stored there. When `unrestricted` is true, these are still pre-populated on the UnrestrictedPathManager so they remain visible via getDirectories() (e.g. for @-mention completion). + */ + additionalDirectories?: string[]; + /** + * Whether to include the system temp directory in the allowed list (defaults to true). Ignored when `unrestricted` is true. + */ + includeTempDirectory?: boolean; + /** + * Workspace root path (special-cased to be allowed even before the directory exists). Ignored when `unrestricted` is true. + */ + workspacePath?: string; } /** * Snapshot of the session's allow-listed directories and primary working directory. @@ -14083,14 +14411,14 @@ export interface PermissionPathsConfig { */ /** @experimental */ export interface PermissionPathsList { - /** - * All directories currently allowed for tool access on this session. - */ - directories: string[]; - /** - * The primary working directory for this session. - */ - primary: string; + /** + * All directories currently allowed for tool access on this session. + */ + directories: string[]; + /** + * The primary working directory for this session. + */ + primary: string; } /** * Directory path to set as the session's new primary working directory. @@ -14100,10 +14428,10 @@ export interface PermissionPathsList { */ /** @experimental */ export interface PermissionPathsUpdatePrimaryParams { - /** - * Directory to set as the new primary working directory for the session's permission policy. - */ - path: string; + /** + * Directory to set as the new primary working directory for the session's permission policy. + */ + path: string; } /** * Path to evaluate against the session's workspace (primary) directory. @@ -14113,10 +14441,10 @@ export interface PermissionPathsUpdatePrimaryParams { */ /** @experimental */ export interface PermissionPathsWorkspaceCheckParams { - /** - * Path to check against the session workspace directory - */ - path: string; + /** + * Path to check against the session workspace directory + */ + path: string; } /** * Indicates whether the supplied path is within the session's workspace directory. @@ -14126,10 +14454,10 @@ export interface PermissionPathsWorkspaceCheckParams { */ /** @experimental */ export interface PermissionPathsWorkspaceCheckResult { - /** - * Whether the path is within the session workspace directory - */ - allowed: boolean; + /** + * Whether the path is within the session workspace directory + */ + allowed: boolean; } /** * Notification payload describing the permission prompt that the client just rendered. @@ -14139,10 +14467,10 @@ export interface PermissionPathsWorkspaceCheckResult { */ /** @experimental */ export interface PermissionPromptShownNotification { - /** - * Human-readable description of the prompt the user is being asked to approve. Used by the runtime to fire the registered `permission_prompt` notification hook (e.g. terminal bell, desktop notification). - */ - message: string; + /** + * Human-readable description of the prompt the user is being asked to approve. Used by the runtime to fire the registered `permission_prompt` notification hook (e.g. terminal bell, desktop notification). + */ + message: string; } /** * Indicates whether the permission decision was applied; false when the request was already resolved. @@ -14152,10 +14480,10 @@ export interface PermissionPromptShownNotification { */ /** @experimental */ export interface PermissionRequestResult { - /** - * Whether the permission request was handled successfully - */ - success: boolean; + /** + * Whether the permission request was handled successfully + */ + success: boolean; } /** * If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged. @@ -14165,14 +14493,14 @@ export interface PermissionRequestResult { */ /** @experimental */ export interface PermissionRulesSet { - /** - * Rules that auto-approve matching requests - */ - approved: PermissionRule[]; - /** - * Rules that auto-deny matching requests - */ - denied: PermissionRule[]; + /** + * Rules that auto-approve matching requests + */ + approved: PermissionRule[]; + /** + * Rules that auto-deny matching requests + */ + denied: PermissionRule[]; } /** * Content-exclusion policy supplied to `session.permissions.configure`, with rules, last-updated data, and scope. @@ -14182,15 +14510,15 @@ export interface PermissionRulesSet { */ /** @experimental */ export interface PermissionsConfigureAdditionalContentExclusionPolicy { - /** - * Content-exclusion rules to apply. - */ - rules: PermissionsConfigureAdditionalContentExclusionPolicyRule[]; - /** - * Opaque policy update timestamp supplied by the host. - */ - last_updated_at: JsonValue; - scope: PermissionsConfigureAdditionalContentExclusionPolicyScope; + /** + * Content-exclusion rules to apply. + */ + rules: PermissionsConfigureAdditionalContentExclusionPolicyRule[]; + /** + * Opaque policy update timestamp supplied by the host. + */ + last_updated_at: JsonValue; + scope: PermissionsConfigureAdditionalContentExclusionPolicyScope; } /** * Single content-exclusion rule supplied to `session.permissions.configure`, with paths, match conditions, and source. @@ -14200,19 +14528,19 @@ export interface PermissionsConfigureAdditionalContentExclusionPolicy { */ /** @experimental */ export interface PermissionsConfigureAdditionalContentExclusionPolicyRule { - /** - * Path patterns covered by this rule. - */ - paths: string[]; - /** - * Conditions of which at least one must match. - */ - ifAnyMatch?: string[]; - /** - * Conditions none of which may match. - */ - ifNoneMatch?: string[]; - source: PermissionsConfigureAdditionalContentExclusionPolicyRuleSource; + /** + * Path patterns covered by this rule. + */ + paths: string[]; + /** + * Conditions of which at least one must match. + */ + ifAnyMatch?: string[]; + /** + * Conditions none of which may match. + */ + ifNoneMatch?: string[]; + source: PermissionsConfigureAdditionalContentExclusionPolicyRuleSource; } /** * Source descriptor for a `session.permissions.configure` content-exclusion rule, with source name and type. @@ -14222,14 +14550,14 @@ export interface PermissionsConfigureAdditionalContentExclusionPolicyRule { */ /** @experimental */ export interface PermissionsConfigureAdditionalContentExclusionPolicyRuleSource { - /** - * Name of the policy source. - */ - name: string; - /** - * Type of the policy source. - */ - type: string; + /** + * Name of the policy source. + */ + name: string; + /** + * Type of the policy source. + */ + type: string; } /** * Patch of permission policy fields to apply (omit a field to leave it unchanged). @@ -14239,21 +14567,21 @@ export interface PermissionsConfigureAdditionalContentExclusionPolicyRuleSource */ /** @experimental */ export interface PermissionsConfigureParams { - /** - * If specified, sets whether tool permission requests are auto-approved without prompting. Omit to leave the current value unchanged. - */ - approveAllToolPermissionRequests?: boolean; - /** - * If specified, sets whether path/URL read permission requests are auto-approved. Omit to leave the current value unchanged. - */ - approveAllReadPermissionRequests?: boolean; - rules?: PermissionRulesSet; - paths?: PermissionPathsConfig; - urls?: PermissionUrlsConfig; - /** - * 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. - */ - additionalContentExclusionPolicies?: PermissionsConfigureAdditionalContentExclusionPolicy[]; + /** + * If specified, sets whether tool permission requests are auto-approved without prompting. Omit to leave the current value unchanged. + */ + approveAllToolPermissionRequests?: boolean; + /** + * If specified, sets whether path/URL read permission requests are auto-approved. Omit to leave the current value unchanged. + */ + approveAllReadPermissionRequests?: boolean; + rules?: PermissionRulesSet; + paths?: PermissionPathsConfig; + urls?: PermissionUrlsConfig; + /** + * 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. + */ + additionalContentExclusionPolicies?: PermissionsConfigureAdditionalContentExclusionPolicy[]; } /** * If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged. @@ -14263,14 +14591,14 @@ export interface PermissionsConfigureParams { */ /** @experimental */ export interface PermissionUrlsConfig { - /** - * If true, the runtime allows access to all URLs without prompting. Initial allow-list is ignored when this is true. - */ - unrestricted?: boolean; - /** - * Initial list of allowed URL/domain patterns. Patterns may include path components. Ignored when `unrestricted` is true. - */ - initialAllowed?: string[]; + /** + * If true, the runtime allows access to all URLs without prompting. Initial allow-list is ignored when this is true. + */ + unrestricted?: boolean; + /** + * Initial list of allowed URL/domain patterns. Patterns may include path components. Ignored when `unrestricted` is true. + */ + initialAllowed?: string[]; } /** * Indicates whether the operation succeeded. @@ -14280,10 +14608,10 @@ export interface PermissionUrlsConfig { */ /** @experimental */ export interface PermissionsConfigureResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * Indicates whether the operation succeeded. @@ -14293,10 +14621,10 @@ export interface PermissionsConfigureResult { */ /** @experimental */ export interface PermissionsFolderTrustAddTrustedResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * No parameters. @@ -14314,7 +14642,7 @@ export interface PermissionsGetModeRequest {} */ /** @experimental */ export interface PermissionsGetModeResult { - mode: PermissionMode; + mode: PermissionMode; } /** * Indicates whether the operation succeeded. @@ -14324,10 +14652,10 @@ export interface PermissionsGetModeResult { */ /** @experimental */ export interface PermissionsLocationsAddToolApprovalResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * Scope and add/remove instructions for modifying session- or location-scoped permission rules. @@ -14337,19 +14665,19 @@ export interface PermissionsLocationsAddToolApprovalResult { */ /** @experimental */ export interface PermissionsModifyRulesParams { - scope: PermissionsModifyRulesScope; - /** - * Rules to add to the scope. Applied before `remove`/`removeAll`. - */ - add?: PermissionRule[]; - /** - * Specific rules to remove from the scope. Ignored when `removeAll` is true. - */ - remove?: PermissionRule[]; - /** - * When true, removes every rule currently in the scope (after any `add` is applied). Useful for clearing the location scope wholesale. - */ - removeAll?: boolean; + scope: PermissionsModifyRulesScope; + /** + * Rules to add to the scope. Applied before `remove`/`removeAll`. + */ + add?: PermissionRule[]; + /** + * Specific rules to remove from the scope. Ignored when `removeAll` is true. + */ + remove?: PermissionRule[]; + /** + * When true, removes every rule currently in the scope (after any `add` is applied). Useful for clearing the location scope wholesale. + */ + removeAll?: boolean; } /** * Indicates whether the operation succeeded. @@ -14359,10 +14687,10 @@ export interface PermissionsModifyRulesParams { */ /** @experimental */ export interface PermissionsModifyRulesResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * Indicates whether the operation succeeded. @@ -14372,10 +14700,10 @@ export interface PermissionsModifyRulesResult { */ /** @experimental */ export interface PermissionsNotifyPromptShownResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * Indicates whether the operation succeeded. @@ -14385,10 +14713,10 @@ export interface PermissionsNotifyPromptShownResult { */ /** @experimental */ export interface PermissionsPathsAddResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * No parameters; returns the session's allow-listed directories. @@ -14406,10 +14734,10 @@ export interface PermissionsPathsListRequest {} */ /** @experimental */ export interface PermissionsPathsUpdatePrimaryResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * No parameters; returns currently-pending permission requests for the session. @@ -14427,10 +14755,10 @@ export interface PermissionsPendingRequestsRequest {} */ /** @experimental */ export interface PermissionsResetSessionApprovalsRequest { - /** - * Whether location-scoped approvals are cleared too. Defaults to `true`. - */ - includeLocation?: boolean; + /** + * Whether location-scoped approvals are cleared too. Defaults to `true`. + */ + includeLocation?: boolean; } /** * Indicates whether the operation succeeded. @@ -14440,10 +14768,10 @@ export interface PermissionsResetSessionApprovalsRequest { */ /** @experimental */ export interface PermissionsResetSessionApprovalsResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * Allow-all toggle for tool permission requests, with an optional telemetry source. @@ -14453,11 +14781,11 @@ export interface PermissionsResetSessionApprovalsResult { */ /** @experimental */ export interface PermissionsSetApproveAllRequest { - /** - * Whether to auto-approve all tool permission requests - */ - enabled: boolean; - source?: PermissionsSetApproveAllSource; + /** + * Whether to auto-approve all tool permission requests + */ + enabled: boolean; + source?: PermissionsSetApproveAllSource; } /** * Indicates whether the operation succeeded. @@ -14467,10 +14795,10 @@ export interface PermissionsSetApproveAllRequest { */ /** @experimental */ export interface PermissionsSetApproveAllResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * Permission mode to apply for the session. @@ -14480,12 +14808,12 @@ export interface PermissionsSetApproveAllResult { */ /** @experimental */ export interface PermissionsSetModeRequest { - mode: PermissionMode; - /** - * Optional judge model id for assisted mode. When omitted, the session resolves the provider default: `gpt-5.5` for CAPI sessions and the active session model for BYOK sessions. - */ - assistedApprovalModel?: string; - source?: PermissionModeSource; + mode: PermissionMode; + /** + * Optional judge model id for assisted mode. When omitted, the session resolves the provider default: `gpt-5.5` for CAPI sessions and the active session model for BYOK sessions. + */ + assistedApprovalModel?: string; + source?: PermissionModeSource; } /** * Indicates whether the requested permission mode was applied and reports the authoritative post-mutation mode. @@ -14495,11 +14823,11 @@ export interface PermissionsSetModeRequest { */ /** @experimental */ export interface PermissionsSetModeResult { - /** - * Whether the operation succeeded - */ - success: boolean; - mode: PermissionMode; + /** + * Whether the operation succeeded + */ + success: boolean; + mode: PermissionMode; } /** * Toggles whether permission prompts should be bridged into session events for this client. @@ -14509,10 +14837,10 @@ export interface PermissionsSetModeResult { */ /** @experimental */ export interface PermissionsSetRequiredRequest { - /** - * Whether the client wants `permission.requested` events bridged from the session-owned permission service. CLI clients that render prompt UI set this to `true` for as long as their listener is mounted; headless callers leave it unset (the default is `false`). - */ - required: boolean; + /** + * Whether the client wants `permission.requested` events bridged from the session-owned permission service. CLI clients that render prompt UI set this to `true` for as long as their listener is mounted; headless callers leave it unset (the default is `false`). + */ + required: boolean; } /** * Indicates whether the operation succeeded. @@ -14522,10 +14850,10 @@ export interface PermissionsSetRequiredRequest { */ /** @experimental */ export interface PermissionsSetRequiredResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * Indicates whether the operation succeeded. @@ -14535,10 +14863,10 @@ export interface PermissionsSetRequiredResult { */ /** @experimental */ export interface PermissionsUrlsSetUnrestrictedModeResult { - /** - * Whether the operation succeeded - */ - success: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; } /** * Whether the URL-permission policy should run in unrestricted mode. @@ -14548,10 +14876,10 @@ export interface PermissionsUrlsSetUnrestrictedModeResult { */ /** @experimental */ export interface PermissionUrlsSetUnrestrictedModeParams { - /** - * Whether to allow access to all URLs without prompting. Toggles the runtime's URL-permission policy in place. - */ - enabled: boolean; + /** + * Whether to allow access to all URLs without prompting. Toggles the runtime's URL-permission policy in place. + */ + enabled: boolean; } /** * Optional message to echo back to the caller. @@ -14561,10 +14889,10 @@ export interface PermissionUrlsSetUnrestrictedModeParams { */ /** @experimental */ export interface PingRequest { - /** - * Optional message to echo back - */ - message?: string; + /** + * Optional message to echo back + */ + message?: string; } /** * Server liveness response, including the echoed message, current server timestamp, and protocol version. @@ -14574,18 +14902,18 @@ export interface PingRequest { */ /** @experimental */ export interface PingResult { - /** - * Echoed message (or default greeting) - */ - message: string; - /** - * ISO 8601 timestamp when the server handled the ping - */ - timestamp: string; - /** - * Server protocol version number - */ - protocolVersion: number; + /** + * Echoed message (or default greeting) + */ + message: string; + /** + * ISO 8601 timestamp when the server handled the ping + */ + timestamp: string; + /** + * Server protocol version number + */ + protocolVersion: number; } /** * Existence, contents, and resolved path of the session plan file. @@ -14595,18 +14923,18 @@ export interface PingResult { */ /** @experimental */ export interface PlanReadResult { - /** - * Whether the plan file exists in the workspace - */ - exists: boolean; - /** - * The content of the plan file, or null if it does not exist - */ - content: string | null; - /** - * Absolute file path of the plan file, or null if workspace is not enabled - */ - path: string | null; + /** + * Whether the plan file exists in the workspace + */ + exists: boolean; + /** + * The content of the plan file, or null if it does not exist + */ + content: string | null; + /** + * Absolute file path of the plan file, or null if workspace is not enabled + */ + path: string | null; } /** * Todo rows read from the session SQL database. Empty when no session database is available. @@ -14616,10 +14944,10 @@ export interface PlanReadResult { */ /** @experimental */ export interface PlanReadSqlTodosResult { - /** - * Rows from the session SQL todos table, ordered by creation time with insertion order used to break ties when available and id used for WITHOUT ROWID tables. - */ - rows: PlanSqlTodosRow[]; + /** + * Rows from the session SQL todos table, ordered by creation time with insertion order used to break ties when available and id used for WITHOUT ROWID tables. + */ + rows: PlanSqlTodosRow[]; } /** * A single todo row read from the session SQL `todos` table. All fields are optional because the SQL schema is best-effort and the agent may not have populated every column. @@ -14629,26 +14957,26 @@ export interface PlanReadSqlTodosResult { */ /** @experimental */ export interface PlanSqlTodosRow { - /** - * Todo identifier. - */ - id?: string; - /** - * Todo title. - */ - title?: string; - /** - * Todo description. - */ - description?: string; - /** - * Todo status. - */ - status?: string; - /** - * Todo creation time, as stored by the session SQL schema's `datetime('now')` default: `YYYY-MM-DD HH:MM:SS` in UTC. Lets clients attribute todos to the work item that created them (e.g. scoping a goal's progress to the todos it produced) rather than to the whole session. - */ - createdAt?: string; + /** + * Todo identifier. + */ + id?: string; + /** + * Todo title. + */ + title?: string; + /** + * Todo description. + */ + description?: string; + /** + * Todo status. + */ + status?: string; + /** + * Todo creation time, as stored by the session SQL schema's `datetime('now')` default: `YYYY-MM-DD HH:MM:SS` in UTC. Lets clients attribute todos to the work item that created them (e.g. scoping a goal's progress to the todos it produced) rather than to the whole session. + */ + createdAt?: string; } /** * Todo rows + dependency edges read from the session SQL database. @@ -14658,14 +14986,14 @@ export interface PlanSqlTodosRow { */ /** @experimental */ export interface PlanReadSqlTodosWithDependenciesResult { - /** - * Rows from the session SQL todos table, ordered by creation time with insertion order used to break ties when available and id used for WITHOUT ROWID tables. Empty when no database, no todos table, or the SELECT failed. - */ - rows: PlanSqlTodosRow[]; - /** - * Edges from the session SQL todo_deps table. Empty when no database, no todo_deps table, or the SELECT failed. Read independently from `rows`, so a broken todo_deps table does not affect the rows result and vice versa. - */ - dependencies: PlanSqlTodoDependency[]; + /** + * Rows from the session SQL todos table, ordered by creation time with insertion order used to break ties when available and id used for WITHOUT ROWID tables. Empty when no database, no todos table, or the SELECT failed. + */ + rows: PlanSqlTodosRow[]; + /** + * Edges from the session SQL todo_deps table. Empty when no database, no todo_deps table, or the SELECT failed. Read independently from `rows`, so a broken todo_deps table does not affect the rows result and vice versa. + */ + dependencies: PlanSqlTodoDependency[]; } /** * A single dependency edge read from the session SQL `todo_deps` table, indicating that one todo must complete before another. @@ -14675,14 +15003,14 @@ export interface PlanReadSqlTodosWithDependenciesResult { */ /** @experimental */ export interface PlanSqlTodoDependency { - /** - * ID of the todo that has the dependency. - */ - todoId: string; - /** - * ID of the todo it depends on. - */ - dependsOn: string; + /** + * ID of the todo that has the dependency. + */ + todoId: string; + /** + * ID of the todo it depends on. + */ + dependsOn: string; } /** * Replacement contents to write to the session plan file. @@ -14692,10 +15020,10 @@ export interface PlanSqlTodoDependency { */ /** @experimental */ export interface PlanUpdateRequest { - /** - * The new content for the plan file - */ - content: string; + /** + * The new content for the plan file + */ + content: string; } /** * Session plugin metadata, with name, marketplace, optional version, and enabled state. @@ -14705,22 +15033,22 @@ export interface PlanUpdateRequest { */ /** @experimental */ export interface Plugin { - /** - * Plugin name - */ - name: string; - /** - * Marketplace the plugin came from - */ - marketplace: string; - /** - * Installed version - */ - version?: string; - /** - * Whether the plugin is currently enabled - */ - enabled: boolean; + /** + * Plugin name + */ + name: string; + /** + * Marketplace the plugin came from + */ + marketplace: string; + /** + * Installed version + */ + version?: string; + /** + * Whether the plugin is currently enabled + */ + enabled: boolean; } /** * Result of installing a plugin. @@ -14730,19 +15058,19 @@ export interface Plugin { */ /** @experimental */ export interface PluginInstallResult { - plugin: InstalledPluginInfo; - /** - * Number of skills discovered and installed from the plugin - */ - skillsInstalled: number; - /** - * Optional post-install message provided by the plugin (e.g. setup instructions) - */ - postInstallMessage?: string; - /** - * Set when the install path is deprecated (e.g. direct repo / URL / local installs). Callers should surface this to end users. - */ - deprecationWarning?: string; + plugin: InstalledPluginInfo; + /** + * Number of skills discovered and installed from the plugin + */ + skillsInstalled: number; + /** + * Optional post-install message provided by the plugin (e.g. setup instructions) + */ + postInstallMessage?: string; + /** + * Set when the install path is deprecated (e.g. direct repo / URL / local installs). Callers should surface this to end users. + */ + deprecationWarning?: string; } /** * Plugins installed for the session, with their enabled state and version metadata. @@ -14752,10 +15080,10 @@ export interface PluginInstallResult { */ /** @experimental */ export interface PluginList { - /** - * Installed plugins - */ - plugins: Plugin[]; + /** + * Installed plugins + */ + plugins: Plugin[]; } /** * Plugins installed in user/global state. @@ -14765,10 +15093,10 @@ export interface PluginList { */ /** @experimental */ export interface PluginListResult { - /** - * Installed plugins - */ - plugins: InstalledPluginInfo[]; + /** + * Installed plugins + */ + plugins: InstalledPluginInfo[]; } /** * Trusted built-in plugin directories to use for this runtime process. @@ -14778,12 +15106,12 @@ export interface PluginListResult { */ /** @experimental */ export interface PluginsBuiltinSetRequest { - /** - * Complete replacement set of trusted built-in plugin directories. Every entry must be an absolute local filesystem path no longer than 4096 characters. - * - * @maxItems 64 - */ - paths: string[]; + /** + * Complete replacement set of trusted built-in plugin directories. Every entry must be an absolute local filesystem path no longer than 4096 characters. + * + * @maxItems 64 + */ + paths: string[]; } /** * Plugin names (or specs) to disable. @@ -14793,10 +15121,10 @@ export interface PluginsBuiltinSetRequest { */ /** @experimental */ export interface PluginsDisableRequest { - /** - * Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. - */ - names: string[]; + /** + * Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. + */ + names: string[]; } /** * Plugin names (or specs) to enable. @@ -14806,10 +15134,10 @@ export interface PluginsDisableRequest { */ /** @experimental */ export interface PluginsEnableRequest { - /** - * Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. - */ - names: string[]; + /** + * Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. + */ + names: string[]; } /** * Plugin source and optional working directory for relative-path resolution. @@ -14819,14 +15147,14 @@ export interface PluginsEnableRequest { */ /** @experimental */ export interface PluginsInstallRequest { - /** - * Plugin install spec. Accepts the same forms as the CLI: "plugin@marketplace" (marketplace install), "owner/repo" or "owner/repo:subpath" (GitHub direct), an http/https/ssh URL, or a local path. Direct (non-marketplace) installs are deprecated and will produce a deprecationWarning in the result. - */ - source: string; - /** - * Working directory used to resolve relative local paths in `source`. Defaults to the server's current working directory. - */ - workingDirectory?: string; + /** + * Plugin install spec. Accepts the same forms as the CLI: "plugin@marketplace" (marketplace install), "owner/repo" or "owner/repo:subpath" (GitHub direct), an http/https/ssh URL, or a local path. Direct (non-marketplace) installs are deprecated and will produce a deprecationWarning in the result. + */ + source: string; + /** + * Working directory used to resolve relative local paths in `source`. Defaults to the server's current working directory. + */ + workingDirectory?: string; } /** * Marketplace source and optional working directory for relative-path resolution. @@ -14836,14 +15164,14 @@ export interface PluginsInstallRequest { */ /** @experimental */ export interface PluginsMarketplacesAddRequest { - /** - * Marketplace source. Accepts the same forms as the CLI: "owner/repo" or "owner/repo#ref" (GitHub), an http/https/ssh URL (optionally with #ref), a git scp-style URL (user@host:path), or a local path. The marketplace's own name (from its manifest) is used as the registration key. - */ - source: string; - /** - * Working directory used to resolve relative local paths in `source`. Defaults to the server's current working directory. - */ - workingDirectory?: string; + /** + * Marketplace source. Accepts the same forms as the CLI: "owner/repo" or "owner/repo#ref" (GitHub), an http/https/ssh URL (optionally with #ref), a git scp-style URL (user@host:path), or a local path. The marketplace's own name (from its manifest) is used as the registration key. + */ + source: string; + /** + * Working directory used to resolve relative local paths in `source`. Defaults to the server's current working directory. + */ + workingDirectory?: string; } /** * Name of the marketplace whose plugin catalog to fetch. @@ -14853,18 +15181,18 @@ export interface PluginsMarketplacesAddRequest { */ /** @experimental */ export interface PluginsMarketplacesBrowseRequest { - /** - * Marketplace name to browse - */ - name: string; + /** + * Marketplace name to browse + */ + name: string; } /** @experimental */ export interface PluginsMarketplacesRefreshRequest { - /** - * Marketplace name to refresh. When omitted, every registered marketplace is refreshed. - */ - name?: string; + /** + * Marketplace name to refresh. When omitted, every registered marketplace is refreshed. + */ + name?: string; } /** * Name of the marketplace to remove and an optional force flag. @@ -14874,14 +15202,14 @@ export interface PluginsMarketplacesRefreshRequest { */ /** @experimental */ export interface PluginsMarketplacesRemoveRequest { - /** - * Marketplace name to remove - */ - name: string; - /** - * When true, also uninstall every plugin sourced from this marketplace. When false (default), removal is a no-op if any plugin from this marketplace is installed and the dependent plugin names are returned in the result. - */ - force?: boolean; + /** + * Marketplace name to remove + */ + name: string; + /** + * When true, also uninstall every plugin sourced from this marketplace. When false (default), removal is a no-op if any plugin from this marketplace is installed and the dependent plugin names are returned in the result. + */ + force?: boolean; } /** * Name (or spec) of the plugin to uninstall. @@ -14891,14 +15219,14 @@ export interface PluginsMarketplacesRemoveRequest { */ /** @experimental */ export interface PluginsUninstallRequest { - /** - * Plugin name or "plugin@marketplace" spec to uninstall. When ambiguous, prefer the fully-qualified spec. - */ - name: string; - /** - * Stable source identity for a direct (non-marketplace) install. Disambiguates uninstall when multiple installed plugins share the same name. - */ - directSourceId?: string | null; + /** + * Plugin name or "plugin@marketplace" spec to uninstall. When ambiguous, prefer the fully-qualified spec. + */ + name: string; + /** + * Stable source identity for a direct (non-marketplace) install. Disambiguates uninstall when multiple installed plugins share the same name. + */ + directSourceId?: string | null; } /** * Name (or spec) of the plugin to update. @@ -14908,10 +15236,10 @@ export interface PluginsUninstallRequest { */ /** @experimental */ export interface PluginsUpdateRequest { - /** - * Plugin name or "plugin@marketplace" spec to update. - */ - name: string; + /** + * Plugin name or "plugin@marketplace" spec to update. + */ + name: string; } /** * Per-plugin result from updating all plugins, with versions, skills installed, success flag, and optional error. @@ -14921,34 +15249,34 @@ export interface PluginsUpdateRequest { */ /** @experimental */ export interface PluginUpdateAllEntry { - /** - * Plugin name that was updated - */ - name: string; - /** - * Marketplace the plugin came from. Empty string ("") for direct installs. - */ - marketplace: string; - /** - * Whether the update succeeded for this plugin - */ - success: boolean; - /** - * Previously installed version, when available - */ - previousVersion?: string; - /** - * Version after the update, when available - */ - newVersion?: string; - /** - * Number of skills installed after the update (success only) - */ - skillsInstalled?: number; - /** - * Error message (failure only) - */ - error?: string; + /** + * Plugin name that was updated + */ + name: string; + /** + * Marketplace the plugin came from. Empty string ("") for direct installs. + */ + marketplace: string; + /** + * Whether the update succeeded for this plugin + */ + success: boolean; + /** + * Previously installed version, when available + */ + previousVersion?: string; + /** + * Version after the update, when available + */ + newVersion?: string; + /** + * Number of skills installed after the update (success only) + */ + skillsInstalled?: number; + /** + * Error message (failure only) + */ + error?: string; } /** * Result of updating all installed plugins. @@ -14958,10 +15286,10 @@ export interface PluginUpdateAllEntry { */ /** @experimental */ export interface PluginUpdateAllResult { - /** - * Per-plugin update results in deterministic order. - */ - results: PluginUpdateAllEntry[]; + /** + * Per-plugin update results in deterministic order. + */ + results: PluginUpdateAllEntry[]; } /** * Result of updating a single plugin. @@ -14971,18 +15299,18 @@ export interface PluginUpdateAllResult { */ /** @experimental */ export interface PluginUpdateResult { - /** - * Version that was previously installed, when available - */ - previousVersion?: string; - /** - * Version after the update, when reported by the plugin manifest - */ - newVersion?: string; - /** - * Number of skills discovered and installed after the update - */ - skillsInstalled: number; + /** + * Version that was previously installed, when available + */ + previousVersion?: string; + /** + * Version after the update, when reported by the plugin manifest + */ + newVersion?: string; + /** + * Number of skills discovered and installed after the update + */ + skillsInstalled: number; } /** * Serializable definition of a caller-implemented tool whose execution is handled over the SDK connection. @@ -14992,43 +15320,43 @@ export interface PluginUpdateResult { */ /** @experimental */ export interface ProtocolExternalToolDefinition { - /** - * Unique model-visible tool name. - */ - name: string; - /** - * Model-visible explanation of what the tool does. - */ - description: string; - /** - * Optional human-readable display title. - */ - title?: string; - /** - * JSON Schema describing the tool's input arguments. - */ - parameters?: { - [k: string]: JsonValue | undefined; - }; - /** - * Whether this definition replaces a built-in tool with the same name. - */ - overridesBuiltInTool?: boolean; - /** - * Whether execution bypasses the normal tool permission prompt. - */ - skipPermission?: boolean; - defer?: ProtocolExternalToolDefer; - /** - * Whether the tool executes commands in a terminal. - */ - isTerminal?: boolean; - /** - * Optional caller-defined metadata associated with the tool. - */ - metadata?: { - [k: string]: JsonValue | undefined; - }; + /** + * Unique model-visible tool name. + */ + name: string; + /** + * Model-visible explanation of what the tool does. + */ + description: string; + /** + * Optional human-readable display title. + */ + title?: string; + /** + * JSON Schema describing the tool's input arguments. + */ + parameters?: { + [k: string]: JsonValue | undefined; + }; + /** + * Whether this definition replaces a built-in tool with the same name. + */ + overridesBuiltInTool?: boolean; + /** + * Whether execution bypasses the normal tool permission prompt. + */ + skipPermission?: boolean; + defer?: ProtocolExternalToolDefer; + /** + * Whether the tool executes commands in a terminal. + */ + isTerminal?: boolean; + /** + * Optional caller-defined metadata associated with the tool. + */ + metadata?: { + [k: string]: JsonValue | undefined; + }; } /** * BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both. @@ -15038,14 +15366,14 @@ export interface ProtocolExternalToolDefinition { */ /** @experimental */ export interface ProviderAddRequest { - /** - * 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 '/'. - */ - providers?: NamedProviderConfig[]; - /** - * 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. - */ - models?: ProviderModelConfig[]; + /** + * 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 '/'. + */ + providers?: NamedProviderConfig[]; + /** + * 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. + */ + models?: ProviderModelConfig[]; } /** * A BYOK model definition referencing a named provider. @@ -15055,39 +15383,39 @@ export interface ProviderAddRequest { */ /** @experimental */ export interface ProviderModelConfig { - /** - * 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`. - */ - id: string; - /** - * Name of the configured provider that serves this model. - */ - provider: string; - /** - * The model name sent to the provider API for inference. Defaults to `id`. - */ - wireModel?: string; - /** - * Well-known base model id used for behavior/capability/config lookup. Defaults to `id`. - */ - modelId?: string; - /** - * Display name for model pickers. Defaults to the provider-qualified selection id (`provider/id`). - */ - name?: string; - /** - * Maximum prompt/input tokens for the model. - */ - maxPromptTokens?: number; - /** - * Maximum context window tokens for the model. - */ - maxContextWindowTokens?: number; - /** - * Maximum output tokens for the model. - */ - maxOutputTokens?: number; - capabilities?: ModelCapabilitiesOverride; + /** + * 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`. + */ + id: string; + /** + * Name of the configured provider that serves this model. + */ + provider: string; + /** + * The model name sent to the provider API for inference. Defaults to `id`. + */ + wireModel?: string; + /** + * Well-known base model id used for behavior/capability/config lookup. Defaults to `id`. + */ + modelId?: string; + /** + * Display name for model pickers. Defaults to the provider-qualified selection id (`provider/id`). + */ + name?: string; + /** + * Maximum prompt/input tokens for the model. + */ + maxPromptTokens?: number; + /** + * Maximum context window tokens for the model. + */ + maxContextWindowTokens?: number; + /** + * Maximum output tokens for the model. + */ + maxOutputTokens?: number; + capabilities?: ModelCapabilitiesOverride; } /** * The selectable model entries synthesized for the models added by this call. @@ -15097,10 +15425,10 @@ export interface ProviderModelConfig { */ /** @experimental */ export interface ProviderAddResult { - /** - * 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. - */ - models: JsonValue[]; + /** + * 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. + */ + models: JsonValue[]; } /** * Custom model-provider configuration (BYOK). @@ -15110,57 +15438,57 @@ export interface ProviderAddResult { */ /** @experimental */ export interface ProviderConfig { - type?: ProviderConfigType; - wireApi?: ProviderConfigWireApi; - transport?: ProviderConfigTransport; - /** - * API endpoint URL. - */ - baseUrl: string; - /** - * API key. Optional for local providers like Ollama. - */ - apiKey?: string; - /** - * Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set. - */ - bearerToken?: string; - azure?: ProviderConfigAzure; - /** - * Well-known model ID used for capability lookup. When set, agent behavior config and token limits are inferred from this model. - */ - modelId?: string; - modelCapabilities?: ModelCapabilitiesOverride; - /** - * Provider name used for model and telemetry attribution. - */ - providerName?: string; - /** - * The model identifier sent to the provider API for inference (the "wire" model), as opposed to modelId which is the well-known base. - */ - wireModel?: string; - /** - * Maximum prompt/input tokens for the model. - */ - maxPromptTokens?: number; - /** - * Maximum context window tokens for the model. - */ - maxContextWindowTokens?: number; - /** - * Maximum output tokens for the model. - */ - maxOutputTokens?: number; - /** - * Custom HTTP headers to include in all outbound requests to the provider. - */ - headers?: { - [k: string]: string | undefined; - }; - /** - * 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. - */ - hasBearerTokenProvider?: boolean; + type?: ProviderConfigType; + wireApi?: ProviderConfigWireApi; + transport?: ProviderConfigTransport; + /** + * API endpoint URL. + */ + baseUrl: string; + /** + * API key. Optional for local providers like Ollama. + */ + apiKey?: string; + /** + * Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set. + */ + bearerToken?: string; + azure?: ProviderConfigAzure; + /** + * Well-known model ID used for capability lookup. When set, agent behavior config and token limits are inferred from this model. + */ + modelId?: string; + modelCapabilities?: ModelCapabilitiesOverride; + /** + * Provider name used for model and telemetry attribution. + */ + providerName?: string; + /** + * The model identifier sent to the provider API for inference (the "wire" model), as opposed to modelId which is the well-known base. + */ + wireModel?: string; + /** + * Maximum prompt/input tokens for the model. + */ + maxPromptTokens?: number; + /** + * Maximum context window tokens for the model. + */ + maxContextWindowTokens?: number; + /** + * Maximum output tokens for the model. + */ + maxOutputTokens?: number; + /** + * Custom HTTP headers to include in all outbound requests to the provider. + */ + headers?: { + [k: string]: string | undefined; + }; + /** + * 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. + */ + hasBearerTokenProvider?: boolean; } /** * A snapshot of the provider endpoint the session is currently configured to talk to. @@ -15170,24 +15498,24 @@ export interface ProviderConfig { */ /** @experimental */ export interface ProviderEndpoint { - type: ProviderEndpointType; - wireApi?: ProviderEndpointWireApi; - transport?: ProviderEndpointTransport; - /** - * Base URL to pass to the LLM client library. - */ - baseUrl: string; - /** - * A credential the caller should use with this endpoint. Omitted only when the endpoint accepts unauthenticated requests. - */ - apiKey?: string; - /** - * HTTP headers the caller must include on every outbound request. - */ - headers: { - [k: string]: string | undefined; - }; - sessionToken?: ProviderSessionToken; + type: ProviderEndpointType; + wireApi?: ProviderEndpointWireApi; + transport?: ProviderEndpointTransport; + /** + * Base URL to pass to the LLM client library. + */ + baseUrl: string; + /** + * A credential the caller should use with this endpoint. Omitted only when the endpoint accepts unauthenticated requests. + */ + apiKey?: string; + /** + * HTTP headers the caller must include on every outbound request. + */ + headers: { + [k: string]: string | undefined; + }; + sessionToken?: ProviderSessionToken; } /** * 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. @@ -15197,22 +15525,22 @@ export interface ProviderEndpoint { */ /** @experimental */ export interface ProviderSessionToken { - /** - * The short-lived token value. - */ - token: string; - /** - * HTTP header name the token must be sent under. - */ - header: string; - /** - * The model the token is bound to, when applicable. When set, the token is only valid for requests against this model. - */ - model?: string; - /** - * When the token expires, if known. Callers should refresh by calling `getEndpoint` again before this time, or reactively on any 401/403 response from `baseUrl`. - */ - expiresAt?: string; + /** + * The short-lived token value. + */ + token: string; + /** + * HTTP header name the token must be sent under. + */ + header: string; + /** + * The model the token is bound to, when applicable. When set, the token is only valid for requests against this model. + */ + model?: string; + /** + * When the token expires, if known. Callers should refresh by calling `getEndpoint` again before this time, or reactively on any 401/403 response from `baseUrl`. + */ + expiresAt?: string; } /** * 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. @@ -15222,14 +15550,14 @@ export interface ProviderSessionToken { */ /** @experimental */ export interface ProviderTokenAcquireRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * 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 the configured provider name. - */ - providerName: string; + /** + * Target session identifier + */ + sessionId: string; + /** + * 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 the configured provider name. + */ + providerName: string; } /** * 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. @@ -15239,10 +15567,10 @@ export interface ProviderTokenAcquireRequest { */ /** @experimental */ export interface ProviderTokenAcquireResult { - /** - * The bearer token value (without the `Bearer ` prefix). - */ - token: string; + /** + * The bearer token value (without the `Bearer ` prefix). + */ + token: string; } /** * File attachment @@ -15252,19 +15580,19 @@ export interface ProviderTokenAcquireResult { */ /** @experimental */ export interface PushAttachmentFile { - /** - * Attachment type discriminator - */ - type: "file"; - /** - * Absolute file path - */ - path: string; - /** - * User-facing display name for the attachment - */ - displayName: string; - lineRange?: PushAttachmentFileLineRange; + /** + * Attachment type discriminator + */ + type: "file"; + /** + * Absolute file path + */ + path: string; + /** + * User-facing display name for the attachment + */ + displayName: string; + lineRange?: PushAttachmentFileLineRange; } /** * Optional line range to scope the attachment to a specific section of the file @@ -15274,14 +15602,14 @@ export interface PushAttachmentFile { */ /** @experimental */ export interface PushAttachmentFileLineRange { - /** - * Start line number (1-based) - */ - start: number; - /** - * End line number (1-based, inclusive) - */ - end: number; + /** + * Start line number (1-based) + */ + start: number; + /** + * End line number (1-based, inclusive) + */ + end: number; } /** * Directory attachment @@ -15291,18 +15619,18 @@ export interface PushAttachmentFileLineRange { */ /** @experimental */ export interface PushAttachmentDirectory { - /** - * Attachment type discriminator - */ - type: "directory"; - /** - * Absolute directory path - */ - path: string; - /** - * User-facing display name for the attachment - */ - displayName: string; + /** + * Attachment type discriminator + */ + type: "directory"; + /** + * Absolute directory path + */ + path: string; + /** + * User-facing display name for the attachment + */ + displayName: string; } /** * Code selection attachment from an editor @@ -15312,23 +15640,23 @@ export interface PushAttachmentDirectory { */ /** @experimental */ export interface PushAttachmentSelection { - /** - * Attachment type discriminator - */ - type: "selection"; - /** - * Absolute path to the file containing the selection - */ - filePath: string; - /** - * User-facing display name for the selection - */ - displayName: string; - /** - * The selected text content - */ - text: string; - selection: PushAttachmentSelectionDetails; + /** + * Attachment type discriminator + */ + type: "selection"; + /** + * Absolute path to the file containing the selection + */ + filePath: string; + /** + * User-facing display name for the selection + */ + displayName: string; + /** + * The selected text content + */ + text: string; + selection: PushAttachmentSelectionDetails; } /** * Position range of the selection within the file @@ -15338,8 +15666,8 @@ export interface PushAttachmentSelection { */ /** @experimental */ export interface PushAttachmentSelectionDetails { - start: PushAttachmentSelectionDetailsStart; - end: PushAttachmentSelectionDetailsEnd; + start: PushAttachmentSelectionDetailsStart; + end: PushAttachmentSelectionDetailsEnd; } /** * Start position of the selection @@ -15349,14 +15677,14 @@ export interface PushAttachmentSelectionDetails { */ /** @experimental */ export interface PushAttachmentSelectionDetailsStart { - /** - * Start line number (0-based) - */ - line: number; - /** - * Start character offset within the line (0-based) - */ - character: number; + /** + * Start line number (0-based) + */ + line: number; + /** + * Start character offset within the line (0-based) + */ + character: number; } /** * End position of the selection @@ -15366,14 +15694,14 @@ export interface PushAttachmentSelectionDetailsStart { */ /** @experimental */ export interface PushAttachmentSelectionDetailsEnd { - /** - * End line number (0-based) - */ - line: number; - /** - * End character offset within the line (0-based) - */ - character: number; + /** + * End line number (0-based) + */ + line: number; + /** + * End character offset within the line (0-based) + */ + character: number; } /** * GitHub issue, pull request, or discussion reference @@ -15383,27 +15711,27 @@ export interface PushAttachmentSelectionDetailsEnd { */ /** @experimental */ export interface PushAttachmentGitHubReference { - /** - * Attachment type discriminator - */ - type: "github_reference"; - /** - * Issue, pull request, or discussion number - */ - number: number; - /** - * Title of the referenced item - */ - title: string; - referenceType: PushAttachmentGitHubReferenceType; - /** - * Current state of the referenced item (e.g., open, closed, merged) - */ - state: string; - /** - * URL to the referenced item on GitHub - */ - url: string; + /** + * Attachment type discriminator + */ + type: "github_reference"; + /** + * Issue, pull request, or discussion number + */ + number: number; + /** + * Title of the referenced item + */ + title: string; + referenceType: PushAttachmentGitHubReferenceType; + /** + * Current state of the referenced item (e.g., open, closed, merged) + */ + state: string; + /** + * URL to the referenced item on GitHub + */ + url: string; } /** * Pointer to a GitHub commit. @@ -15413,23 +15741,23 @@ export interface PushAttachmentGitHubReference { */ /** @experimental */ export interface PushAttachmentGitHubCommit { - /** - * Attachment type discriminator - */ - type: "github_commit"; - repo: PushGitHubRepoRef; - /** - * Full commit SHA - */ - oid: string; - /** - * First line of the commit message - */ - message: string; - /** - * URL to the commit on GitHub - */ - url: string; + /** + * Attachment type discriminator + */ + type: "github_commit"; + repo: PushGitHubRepoRef; + /** + * Full commit SHA + */ + oid: string; + /** + * First line of the commit message + */ + message: string; + /** + * URL to the commit on GitHub + */ + url: string; } /** * Pointer to a GitHub repository. @@ -15439,18 +15767,18 @@ export interface PushAttachmentGitHubCommit { */ /** @experimental */ export interface PushGitHubRepoRef { - /** - * Numeric GitHub repository id - */ - id?: number; - /** - * Repository name (without owner) - */ - name: string; - /** - * Repository owner login (user or organization) - */ - owner: string; + /** + * Numeric GitHub repository id + */ + id?: number; + /** + * Repository name (without owner) + */ + name: string; + /** + * Repository owner login (user or organization) + */ + owner: string; } /** * Pointer to a GitHub release. @@ -15460,23 +15788,23 @@ export interface PushGitHubRepoRef { */ /** @experimental */ export interface PushAttachmentGitHubRelease { - /** - * Attachment type discriminator - */ - type: "github_release"; - repo: PushGitHubRepoRef; - /** - * Git tag the release is anchored to - */ - tagName: string; - /** - * Human-readable release name - */ - name: string; - /** - * URL to the release on GitHub - */ - url: string; + /** + * Attachment type discriminator + */ + type: "github_release"; + repo: PushGitHubRepoRef; + /** + * Git tag the release is anchored to + */ + tagName: string; + /** + * Human-readable release name + */ + name: string; + /** + * URL to the release on GitHub + */ + url: string; } /** * Pointer to a GitHub Actions job. @@ -15486,31 +15814,31 @@ export interface PushAttachmentGitHubRelease { */ /** @experimental */ export interface PushAttachmentGitHubActionsJob { - /** - * Attachment type discriminator - */ - type: "github_actions_job"; - repo: PushGitHubRepoRef; - /** - * Job id within the workflow run - */ - jobId: number; - /** - * Display name of the job - */ - jobName: string; - /** - * Display name of the workflow the job ran in - */ - workflowName: string; - /** - * URL to the job on GitHub - */ - url: string; - /** - * Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs. - */ - conclusion?: string; + /** + * Attachment type discriminator + */ + type: "github_actions_job"; + repo: PushGitHubRepoRef; + /** + * Job id within the workflow run + */ + jobId: number; + /** + * Display name of the job + */ + jobName: string; + /** + * Display name of the workflow the job ran in + */ + workflowName: string; + /** + * URL to the job on GitHub + */ + url: string; + /** + * Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs. + */ + conclusion?: string; } /** * Pointer to a GitHub repository. @@ -15520,23 +15848,23 @@ export interface PushAttachmentGitHubActionsJob { */ /** @experimental */ export interface PushAttachmentGitHubRepository { - /** - * Attachment type discriminator - */ - type: "github_repository"; - repo: PushGitHubRepoRef; - /** - * URL to the repository on GitHub - */ - url: string; - /** - * Short description of the repository - */ - description?: string; - /** - * Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied. - */ - ref?: string; + /** + * Attachment type discriminator + */ + type: "github_repository"; + repo: PushGitHubRepoRef; + /** + * URL to the repository on GitHub + */ + url: string; + /** + * Short description of the repository + */ + description?: string; + /** + * Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied. + */ + ref?: string; } /** * Pointer to a single-file diff. At least one of `head` and `base` must be present. @@ -15546,16 +15874,16 @@ export interface PushAttachmentGitHubRepository { */ /** @experimental */ export interface PushAttachmentGitHubFileDiff { - /** - * Attachment type discriminator - */ - type: "github_file_diff"; - /** - * URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL) - */ - url: string; - head?: PushAttachmentGitHubFileDiffSide; - base?: PushAttachmentGitHubFileDiffSide; + /** + * Attachment type discriminator + */ + type: "github_file_diff"; + /** + * URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL) + */ + url: string; + head?: PushAttachmentGitHubFileDiffSide; + base?: PushAttachmentGitHubFileDiffSide; } /** * One side of a file diff (head or base) @@ -15565,15 +15893,15 @@ export interface PushAttachmentGitHubFileDiff { */ /** @experimental */ export interface PushAttachmentGitHubFileDiffSide { - repo: PushGitHubRepoRef; - /** - * Git ref (branch, tag, or commit SHA) the file is read at - */ - ref: string; - /** - * Repository-relative path to the file - */ - path: string; + repo: PushGitHubRepoRef; + /** + * Git ref (branch, tag, or commit SHA) the file is read at + */ + ref: string; + /** + * Repository-relative path to the file + */ + path: string; } /** * Pointer to a comparison between two git revisions. @@ -15583,16 +15911,16 @@ export interface PushAttachmentGitHubFileDiffSide { */ /** @experimental */ export interface PushAttachmentGitHubTreeComparison { - /** - * Attachment type discriminator - */ - type: "github_tree_comparison"; - /** - * URL to the comparison on GitHub - */ - url: string; - base: PushAttachmentGitHubTreeComparisonSide; - head: PushAttachmentGitHubTreeComparisonSide; + /** + * Attachment type discriminator + */ + type: "github_tree_comparison"; + /** + * URL to the comparison on GitHub + */ + url: string; + base: PushAttachmentGitHubTreeComparisonSide; + head: PushAttachmentGitHubTreeComparisonSide; } /** * One side of a tree comparison (head or base) @@ -15602,11 +15930,11 @@ export interface PushAttachmentGitHubTreeComparison { */ /** @experimental */ export interface PushAttachmentGitHubTreeComparisonSide { - repo: PushGitHubRepoRef; - /** - * Git revision (branch, tag, or commit SHA) - */ - revision: string; + repo: PushGitHubRepoRef; + /** + * Git revision (branch, tag, or commit SHA) + */ + revision: string; } /** * Generic GitHub URL reference. @@ -15616,14 +15944,14 @@ export interface PushAttachmentGitHubTreeComparisonSide { */ /** @experimental */ export interface PushAttachmentGitHubUrl { - /** - * Attachment type discriminator - */ - type: "github_url"; - /** - * URL to the GitHub resource - */ - url: string; + /** + * Attachment type discriminator + */ + type: "github_url"; + /** + * URL to the GitHub resource + */ + url: string; } /** * Pointer to a file in a GitHub repository at a specific ref. @@ -15633,23 +15961,23 @@ export interface PushAttachmentGitHubUrl { */ /** @experimental */ export interface PushAttachmentGitHubFile { - /** - * Attachment type discriminator - */ - type: "github_file"; - repo: PushGitHubRepoRef; - /** - * Git ref the file is read at (branch, tag, or commit SHA) - */ - ref: string; - /** - * Repository-relative path to the file - */ - path: string; - /** - * URL to the file on GitHub - */ - url: string; + /** + * Attachment type discriminator + */ + type: "github_file"; + repo: PushGitHubRepoRef; + /** + * Git ref the file is read at (branch, tag, or commit SHA) + */ + ref: string; + /** + * Repository-relative path to the file + */ + path: string; + /** + * URL to the file on GitHub + */ + url: string; } /** * Pointer to a line range inside a file in a GitHub repository. @@ -15659,24 +15987,24 @@ export interface PushAttachmentGitHubFile { */ /** @experimental */ export interface PushAttachmentGitHubSnippet { - /** - * Attachment type discriminator - */ - type: "github_snippet"; - repo: PushGitHubRepoRef; - /** - * Git ref the file is read at (branch, tag, or commit SHA) - */ - ref: string; - /** - * Repository-relative path to the file - */ - path: string; - /** - * URL to the snippet on GitHub (with line anchor) - */ - url: string; - lineRange: PushAttachmentFileLineRange; + /** + * Attachment type discriminator + */ + type: "github_snippet"; + repo: PushGitHubRepoRef; + /** + * Git ref the file is read at (branch, tag, or commit SHA) + */ + ref: string; + /** + * Repository-relative path to the file + */ + path: string; + /** + * URL to the snippet on GitHub (with line anchor) + */ + url: string; + lineRange: PushAttachmentFileLineRange; } /** * Blob attachment with inline base64-encoded data @@ -15686,22 +16014,22 @@ export interface PushAttachmentGitHubSnippet { */ /** @experimental */ export interface PushAttachmentBlob { - /** - * Attachment type discriminator - */ - type: "blob"; - /** - * Base64-encoded content - */ - data: string; - /** - * MIME type of the inline data - */ - mimeType: string; - /** - * User-facing display name for the attachment - */ - displayName?: string; + /** + * Attachment type discriminator + */ + type: "blob"; + /** + * Base64-encoded content + */ + data: string; + /** + * MIME type of the inline data + */ + mimeType: string; + /** + * User-facing display name for the attachment + */ + displayName?: string; } /** * Inputs for starting a deferred-idle drain. @@ -15711,10 +16039,10 @@ export interface PushAttachmentBlob { */ /** @experimental */ export interface QueueBeginDeferredIdleDrainRequest { - /** - * Whether the host still has active background work. - */ - activeBackgroundWork: boolean; + /** + * Whether the host still has active background work. + */ + activeBackgroundWork: boolean; } /** * Whether a deferred-idle drain should run. @@ -15724,10 +16052,10 @@ export interface QueueBeginDeferredIdleDrainRequest { */ /** @experimental */ export interface QueueBeginDeferredIdleDrainResult { - /** - * True when the host should run finishDeferredIdleDrain asynchronously. - */ - shouldDrain: boolean; + /** + * True when the host should run finishDeferredIdleDrain asynchronously. + */ + shouldDrain: boolean; } /** * Internal filter for consuming queued system notifications. @@ -15737,10 +16065,10 @@ export interface QueueBeginDeferredIdleDrainResult { */ /** @experimental */ export interface QueueConsumeSystemNotificationsRequest { - /** - * Opaque runtime-owned filter object. - */ - filter: JsonValue; + /** + * Opaque runtime-owned filter object. + */ + filter: JsonValue; } /** * Inputs for marking session.idle deferred in native state. @@ -15750,10 +16078,10 @@ export interface QueueConsumeSystemNotificationsRequest { */ /** @experimental */ export interface QueueDeferSessionIdleRequest { - /** - * Whether the deferred idle was caused by an aborted foreground turn. - */ - aborted: boolean; + /** + * Whether the deferred idle was caused by an aborted foreground turn. + */ + aborted: boolean; } /** * Parameters for duplicating a queued item. @@ -15763,10 +16091,10 @@ export interface QueueDeferSessionIdleRequest { */ /** @experimental */ export interface QueueDuplicateAtRequest { - /** - * Stable opaque ID of the queued item to duplicate. - */ - id: string; + /** + * Stable opaque ID of the queued item to duplicate. + */ + id: string; } /** * Result of duplicating a queued item. @@ -15776,10 +16104,10 @@ export interface QueueDuplicateAtRequest { */ /** @experimental */ export interface QueueDuplicateAtResult { - /** - * Fresh stable opaque id assigned to the duplicate. - */ - id: string; + /** + * Fresh stable opaque id assigned to the duplicate. + */ + id: string; } /** * Result of enqueueing the resume-pending wake item. @@ -15789,10 +16117,10 @@ export interface QueueDuplicateAtResult { */ /** @experimental */ export interface QueueEnqueueResumePendingResult { - /** - * True when a wake item was newly queued. - */ - queued: boolean; + /** + * True when a wake item was newly queued. + */ + queued: boolean; } /** * Inputs for completing a deferred-idle drain. @@ -15802,14 +16130,14 @@ export interface QueueEnqueueResumePendingResult { */ /** @experimental */ export interface QueueFinishDeferredIdleDrainRequest { - /** - * Whether the host still has active background work. - */ - activeBackgroundWork: boolean; - /** - * Whether native queued work remains. - */ - hasPending: boolean; + /** + * Whether the host still has active background work. + */ + activeBackgroundWork: boolean; + /** + * Whether native queued work remains. + */ + hasPending: boolean; } /** * Action selected by the native deferred-idle drain. @@ -15819,14 +16147,14 @@ export interface QueueFinishDeferredIdleDrainRequest { */ /** @experimental */ export interface QueueFinishDeferredIdleDrainResult { - /** - * One of none, processQueue, or emitSessionIdle. - */ - action: string; - /** - * Whether the deferred idle was caused by an aborted foreground turn. - */ - aborted: boolean; + /** + * One of none, processQueue, or emitSessionIdle. + */ + action: string; + /** + * Whether the deferred idle was caused by an aborted foreground turn. + */ + aborted: boolean; } /** * Whether the native queue has pending work. @@ -15836,10 +16164,10 @@ export interface QueueFinishDeferredIdleDrainResult { */ /** @experimental */ export interface QueueHasPendingResult { - /** - * True when queued or immediate native work is pending. - */ - hasPending: boolean; + /** + * True when queued or immediate native work is pending. + */ + hasPending: boolean; } /** * Parameters for inserting a queued message at a public visible position. @@ -15849,11 +16177,11 @@ export interface QueueHasPendingResult { */ /** @experimental */ export interface QueueInsertAtRequest { - /** - * Zero-based position in the public visible queue. Values outside the queue clamp to an end. - */ - position: number; - message: QueueInsertMessage; + /** + * Zero-based position in the public visible queue. Values outside the queue clamp to an end. + */ + position: number; + message: QueueInsertMessage; } /** * Serializable message fields accepted by queue.insertAt. @@ -15863,50 +16191,50 @@ export interface QueueInsertAtRequest { */ /** @experimental */ export interface QueueInsertMessage { - /** - * The user message text. - */ - prompt: string; - /** - * Optional user-facing display text. - */ - displayPrompt?: string; - /** - * Optional attachments for the message. - */ - attachments?: Attachment[]; - agentMode?: SendAgentMode; - /** - * Optional provenance source. `system` is rejected: it would hide the inserted row from `pendingItems` and make it unaddressable while still executing, so inserted items must stay visible. - */ - source?: string; - /** - * Whether the message is billable. - */ - billable?: boolean; - /** - * Required tool name for the turn, when any. - */ - requiredTool?: string; - /** - * Per-turn request headers. - */ - requestHeaders?: { - [k: string]: string | undefined; - }; - mode?: SendMode; - /** - * Accepted for SendOptions compatibility but ignored; the requested public position controls placement. - */ - prepend?: boolean; - /** - * Accepted for SendOptions compatibility but ignored; insertion scheduling is controlled by the queue drain state. - */ - wait?: boolean; - /** - * Accepted for internal SendOptions compatibility but ignored; delivery is derived from current session activity. - */ - delivery?: string; + /** + * The user message text. + */ + prompt: string; + /** + * Optional user-facing display text. + */ + displayPrompt?: string; + /** + * Optional attachments for the message. + */ + attachments?: Attachment[]; + agentMode?: SendAgentMode; + /** + * Optional provenance source. `system` is rejected: it would hide the inserted row from `pendingItems` and make it unaddressable while still executing, so inserted items must stay visible. + */ + source?: string; + /** + * Whether the message is billable. + */ + billable?: boolean; + /** + * Required tool name for the turn, when any. + */ + requiredTool?: string; + /** + * Per-turn request headers. + */ + requestHeaders?: { + [k: string]: string | undefined; + }; + mode?: SendMode; + /** + * Accepted for SendOptions compatibility but ignored; the requested public position controls placement. + */ + prepend?: boolean; + /** + * Accepted for SendOptions compatibility but ignored; insertion scheduling is controlled by the queue drain state. + */ + wait?: boolean; + /** + * Accepted for internal SendOptions compatibility but ignored; delivery is derived from current session activity. + */ + delivery?: string; } /** * Result of inserting a queued message. @@ -15916,10 +16244,10 @@ export interface QueueInsertMessage { */ /** @experimental */ export interface QueueInsertAtResult { - /** - * Fresh stable opaque id assigned to the inserted item. - */ - id: string; + /** + * Fresh stable opaque id assigned to the inserted item. + */ + id: string; } /** * Parameters for moving a queued item by stable id. @@ -15929,14 +16257,14 @@ export interface QueueInsertAtResult { */ /** @experimental */ export interface QueueMoveItemRequest { - /** - * Stable opaque queued-item id. - */ - id: string; - /** - * Zero-based target position in the public visible queue. Values outside the queue clamp to an end. - */ - toPosition: number; + /** + * Stable opaque queued-item id. + */ + id: string; + /** + * Zero-based target position in the public visible queue. Values outside the queue clamp to an end. + */ + toPosition: number; } /** * Result of moving a queued item. @@ -15946,10 +16274,10 @@ export interface QueueMoveItemRequest { */ /** @experimental */ export interface QueueMoveItemResult { - /** - * True when the item changed position; false when it was already at the requested position. - */ - changed: boolean; + /** + * True when the item changed position; false when it was already at the requested position. + */ + changed: boolean; } /** * User-facing pending queue entry, with kind and display text for a queued message, slash command, or model change. @@ -15959,20 +16287,20 @@ export interface QueueMoveItemResult { */ /** @experimental */ export interface QueuePendingItems { - /** - * Stable opaque id for the canonical queued item. Batch rows share one id. - */ - id: string; - /** - * Stable identity of the queued user message. Present for message rows and absent for slash commands and model changes. - */ - messageId?: string; - kind: QueuePendingItemsKind; - /** - * Human-readable text to display for this queue entry in the UI - */ - displayText: string; - agentMode: SendAgentMode; + /** + * Stable opaque id for the canonical queued item. Batch rows share one id. + */ + id: string; + /** + * Stable identity of the queued user message. Present for message rows and absent for slash commands and model changes. + */ + messageId?: string; + kind: QueuePendingItemsKind; + /** + * Human-readable text to display for this queue entry in the UI + */ + displayText: string; + agentMode: SendAgentMode; } /** * Snapshot of the session's pending queued items and immediate-steering messages. @@ -15982,18 +16310,18 @@ export interface QueuePendingItems { */ /** @experimental */ export interface QueuePendingItemsResult { - /** - * Pending queued items in submission order. Includes user messages, queued slash commands, and queued model changes; omits internal system items. - */ - items: QueuePendingItems[]; - /** - * Display text for messages currently in the immediate steering queue (interjections sent during a running turn). - */ - steeringMessages: string[]; - /** - * How many leading entries of `steeringMessages` have already been folded into the running turn (and so have an emitted `user.message`), as opposed to still waiting for one. Absent for hosts that do not distinguish the two. - */ - inFlightSteeringCount?: number; + /** + * Pending queued items in submission order. Includes user messages, queued slash commands, and queued model changes; omits internal system items. + */ + items: QueuePendingItems[]; + /** + * Display text for messages currently in the immediate steering queue (interjections sent during a running turn). + */ + steeringMessages: string[]; + /** + * How many leading entries of `steeringMessages` have already been folded into the running turn (and so have an emitted `user.message`), as opposed to still waiting for one. Absent for hosts that do not distinguish the two. + */ + inFlightSteeringCount?: number; } /** * Parameters for removing a queued item by stable id. @@ -16003,10 +16331,10 @@ export interface QueuePendingItemsResult { */ /** @experimental */ export interface QueueRemoveAtRequest { - /** - * Stable opaque ID of the queued item to remove. - */ - id: string; + /** + * Stable opaque ID of the queued item to remove. + */ + id: string; } /** * Result of removing a queued item. @@ -16016,10 +16344,10 @@ export interface QueueRemoveAtRequest { */ /** @experimental */ export interface QueueRemoveAtResult { - /** - * True when the addressed item was removed. - */ - removed: boolean; + /** + * True when the addressed item was removed. + */ + removed: boolean; } /** * Indicates whether a user-facing pending item was removed. @@ -16029,10 +16357,10 @@ export interface QueueRemoveAtResult { */ /** @experimental */ export interface QueueRemoveMostRecentResult { - /** - * True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. - */ - removed: boolean; + /** + * True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. + */ + removed: boolean; } /** * Parameters for steering a queued message into a live turn. @@ -16042,10 +16370,10 @@ export interface QueueRemoveMostRecentResult { */ /** @experimental */ export interface QueueSendNowRequest { - /** - * Stable opaque ID of the queued item to steer into the live turn. - */ - id: string; + /** + * Stable opaque ID of the queued item to steer into the live turn. + */ + id: string; } /** * Result of trying to steer a queued message into a live turn. @@ -16055,10 +16383,10 @@ export interface QueueSendNowRequest { */ /** @experimental */ export interface QueueSendNowResult { - /** - * True when the item was accepted into the steering lane; false when no main turn was live. - */ - steered: boolean; + /** + * True when the item was accepted into the steering lane; false when no main turn was live. + */ + steered: boolean; } /** * Parameters for acquiring or releasing the queued-lane drain pause. Acquisition is exclusive and non-idempotent: `paused: true` against an already-paused session fails with `queue_already_paused`. The pause is never released automatically — it is not tied to the caller's lifetime, so a client that exits without sending `paused: false` leaves the lane frozen. Release is unowned: `paused: false` clears the pause for any caller, including one that never acquired it. @@ -16068,10 +16396,10 @@ export interface QueueSendNowResult { */ /** @experimental */ export interface QueueSetDrainPausedRequest { - /** - * Whether queued-lane draining should be paused. - */ - paused: boolean; + /** + * Whether queued-lane draining should be paused. + */ + paused: boolean; } /** * Internal snapshot of native queue state for local session orchestration. @@ -16081,22 +16409,22 @@ export interface QueueSetDrainPausedRequest { */ /** @experimental */ export interface QueueSnapshotResult { - /** - * User-facing pending items in FIFO order. - */ - items: QueuePendingItems[]; - /** - * Immediate steering messages waiting for an active turn. - */ - steeringMessages: string[]; - /** - * Insertion orders for queued items, aligned with `items`. - */ - itemOrders?: number[]; - /** - * Insertion orders for immediate steering messages, aligned with `steeringMessages`. - */ - steeringMessageOrders?: number[]; + /** + * User-facing pending items in FIFO order. + */ + items: QueuePendingItems[]; + /** + * Immediate steering messages waiting for an active turn. + */ + steeringMessages: string[]; + /** + * Insertion orders for queued items, aligned with `items`. + */ + itemOrders?: number[]; + /** + * Insertion orders for immediate steering messages, aligned with `steeringMessages`. + */ + steeringMessageOrders?: number[]; } /** * Parameters for editing a single queued message. @@ -16106,18 +16434,18 @@ export interface QueueSnapshotResult { */ /** @experimental */ export interface QueueUpdateTextRequest { - /** - * Stable opaque ID of the queued item to edit. - */ - id: string; - /** - * Replacement prompt sent to the model. - */ - prompt: string; - /** - * Optional replacement prompt displayed to the user. - */ - displayPrompt?: string; + /** + * Stable opaque ID of the queued item to edit. + */ + id: string; + /** + * Replacement prompt sent to the model. + */ + prompt: string; + /** + * Optional replacement prompt displayed to the user. + */ + displayPrompt?: string; } /** * Result of editing a queued message. @@ -16127,10 +16455,10 @@ export interface QueueUpdateTextRequest { */ /** @experimental */ export interface QueueUpdateTextResult { - /** - * True when the stored text changed. - */ - updated: boolean; + /** + * True when the stored text changed. + */ + updated: boolean; } /** * Event type to register consumer interest for, used by runtime gating logic. @@ -16140,10 +16468,10 @@ export interface QueueUpdateTextResult { */ /** @experimental */ export interface RegisterEventInterestParams { - /** - * The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates interactive OAuth token acquisition to the consumer via `mcp.oauth_required` events; when no interest is registered the runtime still attempts non-interactive reconnect from cached or refreshable tokens, and only marks the server `needs-auth` if usable credentials are unavailable — it does not open a browser or start interactive OAuth without a consumer). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. - */ - eventType: string; + /** + * The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates interactive OAuth token acquisition to the consumer via `mcp.oauth_required` events; when no interest is registered the runtime still attempts non-interactive reconnect from cached or refreshable tokens, and only marks the server `needs-auth` if usable credentials are unavailable — it does not open a browser or start interactive OAuth without a consumer). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. + */ + eventType: string; } /** * Opaque handle representing an event-type interest registration. @@ -16153,10 +16481,10 @@ export interface RegisterEventInterestParams { */ /** @experimental */ export interface RegisterEventInterestResult { - /** - * Opaque handle for this registration. Pass to releaseInterest to release. Each call to registerInterest produces a fresh handle, even when the same eventType is registered multiple times. - */ - handle: string; + /** + * Opaque handle for this registration. Pass to releaseInterest to release. Each call to registerInterest produces a fresh handle, even when the same eventType is registered multiple times. + */ + handle: string; } /** * Params to attach an extension loader's tools to a session. @@ -16167,19 +16495,19 @@ export interface RegisterEventInterestResult { /** @experimental */ /** @internal */ export interface RegisterExtensionToolsParams { - /** - * Session to register extension tools on. - */ - sessionId: string; - /** - * In-process ExtensionLoader handle used only by the CLI and excluded from the public SDK surface. - * - * @internal - * - * @internal - */ - loader: OpaqueInProcessValue; - options?: SessionsRegisterExtensionToolsOnSessionOptions; + /** + * Session to register extension tools on. + */ + sessionId: string; + /** + * In-process ExtensionLoader handle used only by the CLI and excluded from the public SDK surface. + * + * @internal + * + * @internal + */ + loader: OpaqueInProcessValue; + options?: SessionsRegisterExtensionToolsOnSessionOptions; } /** * Optional registration options. @@ -16189,12 +16517,12 @@ export interface RegisterExtensionToolsParams { */ /** @experimental */ export interface SessionsRegisterExtensionToolsOnSessionOptions { - /** - * In-process `() => boolean` gating callback used only by the CLI. - * - * @internal - */ - enabled?: OpaqueInProcessValue; + /** + * In-process `() => boolean` gating callback used only by the CLI. + * + * @internal + */ + enabled?: OpaqueInProcessValue; } /** * Handle for releasing the extension tool registration. @@ -16205,14 +16533,14 @@ export interface SessionsRegisterExtensionToolsOnSessionOptions { /** @experimental */ /** @internal */ export interface RegisterExtensionToolsResult { - /** - * In-process unsubscribe function used only by the CLI. - * - * @internal - * - * @internal - */ - unsubscribe: OpaqueInProcessValue; + /** + * In-process unsubscribe function used only by the CLI. + * + * @internal + * + * @internal + */ + unsubscribe: OpaqueInProcessValue; } /** * Opaque handle previously returned by `registerInterest` to release. @@ -16222,10 +16550,10 @@ export interface RegisterExtensionToolsResult { */ /** @experimental */ export interface ReleaseEventInterestParams { - /** - * Handle returned by a previous `registerInterest` call. Idempotent: releasing an unknown or already-released handle is a no-op (returns success). When the last outstanding handle for an event type is released, the runtime reverts to its 'no consumer' code path for that event type. - */ - handle: string; + /** + * Handle returned by a previous `registerInterest` call. Idempotent: releasing an unknown or already-released handle is a no-op (returns success). When the last outstanding handle for an event type is released, the runtime reverts to its 'no consumer' code path for that event type. + */ + handle: string; } /** * Configuration for the runtime-managed remote-control singleton. @@ -16235,27 +16563,27 @@ export interface ReleaseEventInterestParams { */ /** @experimental */ export interface RemoteControlConfig { - /** - * Whether remote export should be enabled. - */ - remote: boolean; - /** - * Whether the MC session may steer the local session (write mode). - */ - steerable: boolean; - /** - * Whether the user explicitly requested remote (vs. implicit session-sync). Controls warning surfacing for missing-repo cases. - */ - explicit: boolean; - /** - * When true, suppresses timeline messages on successful setup. - */ - silent: boolean; - /** - * Existing Mission Control task ID to attach the exported session to. - */ - taskId?: string; - existingMcSession?: RemoteControlConfigExistingMcSession; + /** + * Whether remote export should be enabled. + */ + remote: boolean; + /** + * Whether the MC session may steer the local session (write mode). + */ + steerable: boolean; + /** + * Whether the user explicitly requested remote (vs. implicit session-sync). Controls warning surfacing for missing-repo cases. + */ + explicit: boolean; + /** + * When true, suppresses timeline messages on successful setup. + */ + silent: boolean; + /** + * Existing Mission Control task ID to attach the exported session to. + */ + taskId?: string; + existingMcSession?: RemoteControlConfigExistingMcSession; } /** * Reattach to an existing MC session without creating a new one. @@ -16265,14 +16593,14 @@ export interface RemoteControlConfig { */ /** @experimental */ export interface RemoteControlConfigExistingMcSession { - /** - * Existing MC session ID to reattach to. - */ - mcSessionId: string; - /** - * Existing MC task ID for the reattached session. - */ - mcTaskId: string; + /** + * Existing MC session ID to reattach to. + */ + mcSessionId: string; + /** + * Existing MC task ID for the reattached session. + */ + mcTaskId: string; } /** * Remote control is not connected. @@ -16282,10 +16610,10 @@ export interface RemoteControlConfigExistingMcSession { */ /** @experimental */ export interface RemoteControlStatusOff { - /** - * Remote control state tag: not connected. - */ - state: "off"; + /** + * Remote control state tag: not connected. + */ + state: "off"; } /** * Remote control is in the middle of initial setup. @@ -16295,14 +16623,14 @@ export interface RemoteControlStatusOff { */ /** @experimental */ export interface RemoteControlStatusConnecting { - /** - * Remote control state tag: connecting. - */ - state: "connecting"; - /** - * Session id the connection is attaching to. - */ - attachedSessionId: string; + /** + * Remote control state tag: connecting. + */ + state: "connecting"; + /** + * Session id the connection is attaching to. + */ + attachedSessionId: string; } /** * Remote control is connected to a local session. @@ -16312,34 +16640,34 @@ export interface RemoteControlStatusConnecting { */ /** @experimental */ export interface RemoteControlStatusActive { - /** - * Remote control state tag: active. - */ - state: "active"; - /** - * Session id remote control is pointed at. - */ - attachedSessionId: string; - /** - * MC frontend URL for this session, when known. - */ - frontendUrl?: string; - /** - * Whether the MC session may steer this session. - */ - isSteerable: boolean; - /** - * In-process prompt-manager handle (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. Retained as an optional compatibility field; native remote control does not populate or consume it. - * - * @internal - */ - promptManager?: OpaqueInProcessValue; - /** - * True while a read-only/session-sync export is deferred, awaiting the first `user.message` before its MC session exists. Marked internal: this field is excluded from the public SDK surface and is populated only on the CLI in-process path. - * - * @internal - */ - awaitingFirstMessage?: boolean; + /** + * Remote control state tag: active. + */ + state: "active"; + /** + * Session id remote control is pointed at. + */ + attachedSessionId: string; + /** + * MC frontend URL for this session, when known. + */ + frontendUrl?: string; + /** + * Whether the MC session may steer this session. + */ + isSteerable: boolean; + /** + * In-process prompt-manager handle (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. Retained as an optional compatibility field; native remote control does not populate or consume it. + * + * @internal + */ + promptManager?: OpaqueInProcessValue; + /** + * True while a read-only/session-sync export is deferred, awaiting the first `user.message` before its MC session exists. Marked internal: this field is excluded from the public SDK surface and is populated only on the CLI in-process path. + * + * @internal + */ + awaitingFirstMessage?: boolean; } /** * The last setup attempt failed. The singleton is otherwise off. @@ -16349,18 +16677,18 @@ export interface RemoteControlStatusActive { */ /** @experimental */ export interface RemoteControlStatusError { - /** - * Remote control state tag: setup failed. - */ - state: "error"; - /** - * Human-readable error message from the last setup attempt. - */ - error: string; - /** - * Session id the failing setup attempt targeted, when known. - */ - attachedSessionId?: string; + /** + * Remote control state tag: setup failed. + */ + state: "error"; + /** + * Human-readable error message from the last setup attempt. + */ + error: string; + /** + * Session id the failing setup attempt targeted, when known. + */ + attachedSessionId?: string; } /** * Wrapper for the singleton's current status. @@ -16370,7 +16698,7 @@ export interface RemoteControlStatusError { */ /** @experimental */ export interface RemoteControlStatusResult { - status: RemoteControlStatus; + status: RemoteControlStatus; } /** * Outcome of a stopRemoteControl call. @@ -16380,11 +16708,11 @@ export interface RemoteControlStatusResult { */ /** @experimental */ export interface RemoteControlStopResult { - status: RemoteControlStatus; - /** - * Whether the singleton was actually torn down by this call. - */ - stopped: boolean; + status: RemoteControlStatus; + /** + * Whether the singleton was actually torn down by this call. + */ + stopped: boolean; } /** * Outcome of a transferRemoteControl call. @@ -16394,11 +16722,11 @@ export interface RemoteControlStopResult { */ /** @experimental */ export interface RemoteControlTransferResult { - status: RemoteControlStatus; - /** - * Whether the rebinding actually happened. - */ - transferred: boolean; + status: RemoteControlStatus; + /** + * Whether the rebinding actually happened. + */ + transferred: boolean; } /** * Optional remote session mode ("off", "export", or "on"); defaults to enabling both export and remote steering. @@ -16408,7 +16736,7 @@ export interface RemoteControlTransferResult { */ /** @experimental */ export interface RemoteEnableRequest { - mode?: RemoteSessionMode; + mode?: RemoteSessionMode; } /** * GitHub URL for the session and a flag indicating whether remote steering is enabled. @@ -16418,14 +16746,14 @@ export interface RemoteEnableRequest { */ /** @experimental */ export interface RemoteEnableResult { - /** - * GitHub frontend URL for this session - */ - url?: string; - /** - * Whether remote steering is enabled - */ - remoteSteerable: boolean; + /** + * GitHub frontend URL for this session + */ + url?: string; + /** + * Whether remote steering is enabled + */ + remoteSteerable: boolean; } /** * New remote-steerability state to persist as a `session.remote_steerable_changed` event. @@ -16435,10 +16763,10 @@ export interface RemoteEnableResult { */ /** @experimental */ export interface RemoteNotifySteerableChangedRequest { - /** - * Whether the session now supports remote steering via GitHub. The runtime persists this as a `session.remote_steerable_changed` event so resume/replay sees the up-to-date capability. - */ - remoteSteerable: boolean; + /** + * Whether the session now supports remote steering via GitHub. The runtime persists this as a `session.remote_steerable_changed` event so resume/replay sees the up-to-date capability. + */ + remoteSteerable: boolean; } /** * Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own. @@ -16456,11 +16784,11 @@ export interface RemoteNotifySteerableChangedResult {} */ /** @experimental */ export interface RemoteSessionConnectionResult { - /** - * SDK session ID for the connected remote session. - */ - sessionId: string; - metadata: ConnectedRemoteSessionMetadata; + /** + * SDK session ID for the connected remote session. + */ + sessionId: string; + metadata: ConnectedRemoteSessionMetadata; } /** * GitHub repository the remote session belongs to. @@ -16470,18 +16798,18 @@ export interface RemoteSessionConnectionResult { */ /** @experimental */ export interface RemoteSessionMetadataRepository { - /** - * Repository owner. - */ - owner: string; - /** - * Repository name. - */ - name: string; - /** - * Branch associated with the remote session. - */ - branch: string; + /** + * Repository owner. + */ + owner: string; + /** + * Repository name. + */ + name: string; + /** + * Branch associated with the remote session. + */ + branch: string; } /** * Remote session metadata for the session to hand off (typically obtained from `sessions.list` with `source: "remote"`). @@ -16491,58 +16819,58 @@ export interface RemoteSessionMetadataRepository { */ /** @experimental */ export interface RemoteSessionMetadataValue { - /** - * Stable session identifier. - */ - sessionId: string; - /** - * Session creation time as an ISO 8601 timestamp. - */ - startTime: string; - /** - * Last-modified time as an ISO 8601 timestamp. - */ - modifiedTime: string; - /** - * Short summary of the session, when one has been derived. - */ - summary?: string; - /** - * Optional human-friendly name set via /rename. - */ - name?: string; - /** - * Always true for remote sessions. - */ - isRemote: true; - context?: SessionContext; - repository: RemoteSessionMetadataRepository; - /** - * Backing remote session IDs (most recent first). - */ - remoteSessionIds: string[]; - /** - * Pull request number associated with the session. - */ - pullRequestNumber?: number; - /** - * Original remote resource identifier (task ID or PR node ID). - */ - resourceId?: string; - taskType?: RemoteSessionMetadataTaskType; - /** - * Deadline (ISO 8601) at which a CLI remote session becomes stale without further heartbeats. - */ - staleAt?: string; - /** - * Server-side task state returned by GitHub. - */ - state?: string; - hostStatus?: RemoteSessionHostStatus; - /** - * Host-supplied human description of what the session is doing right now ("running tests", "waiting for approval"). Optional in the protocol and absent on hosts that do not publish it, so never rely on it -- it enriches `hostStatus`, it does not replace it. - */ - hostActivity?: string; + /** + * Stable session identifier. + */ + sessionId: string; + /** + * Session creation time as an ISO 8601 timestamp. + */ + startTime: string; + /** + * Last-modified time as an ISO 8601 timestamp. + */ + modifiedTime: string; + /** + * Short summary of the session, when one has been derived. + */ + summary?: string; + /** + * Optional human-friendly name set via /rename. + */ + name?: string; + /** + * Always true for remote sessions. + */ + isRemote: true; + context?: SessionContext; + repository: RemoteSessionMetadataRepository; + /** + * Backing remote session IDs (most recent first). + */ + remoteSessionIds: string[]; + /** + * Pull request number associated with the session. + */ + pullRequestNumber?: number; + /** + * Original remote resource identifier (task ID or PR node ID). + */ + resourceId?: string; + taskType?: RemoteSessionMetadataTaskType; + /** + * Deadline (ISO 8601) at which a CLI remote session becomes stale without further heartbeats. + */ + staleAt?: string; + /** + * Server-side task state returned by GitHub. + */ + state?: string; + hostStatus?: RemoteSessionHostStatus; + /** + * Host-supplied human description of what the session is doing right now ("running tests", "waiting for approval"). Optional in the protocol and absent on hosts that do not publish it, so never rely on it -- it enriches `hostStatus`, it does not replace it. + */ + hostActivity?: string; } /** * Repository context for the remote session. @@ -16552,18 +16880,18 @@ export interface RemoteSessionMetadataValue { */ /** @experimental */ export interface RemoteSessionRepository { - /** - * Repository owner or organization login. - */ - owner: string; - /** - * Repository name. - */ - name: string; - /** - * Optional branch associated with the remote session. - */ - branch?: string; + /** + * Repository owner or organization login. + */ + owner: string; + /** + * Repository name. + */ + name: string; + /** + * Optional branch associated with the remote session. + */ + branch?: string; } /** * Resolved sandbox configuration. @@ -16573,20 +16901,44 @@ export interface RemoteSessionRepository { */ /** @experimental */ export interface SandboxConfig { - /** - * Whether sandboxing is enabled for the session. - */ - enabled: boolean; - userPolicy?: SandboxConfigUserPolicy; - /** - * Whether to auto-add the current working directory to readwritePaths. Default: true. - */ - addCurrentWorkingDirectory?: boolean; - auth?: SandboxConfigAuth; - /** - * Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out). - */ - allowDevToolAccess?: boolean; + /** + * Whether sandboxing is enabled for the session. + */ + enabled: boolean; + userPolicy?: SandboxConfigUserPolicy; + /** + * Whether to auto-add the current working directory to readwritePaths. Default: true. + */ + addCurrentWorkingDirectory?: boolean; + /** + * Whether MCP servers the session launches are confined by the sandbox. Only an explicit `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and `enabled` are always read together. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + */ + sandboxMcpServers?: boolean; + /** + * Whether language servers the session launches are confined by the sandbox. Only an explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + */ + sandboxLspServers?: boolean; + /** + * Whether the agent may request that an individual command run outside the sandbox, which the host then approves or denies through the usual permission flow. A host capability flag rather than part of the policy: it is stripped from the effective spawn policy and only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this object: omitting it offers no bypass. Default: false (opt-in). + */ + allowBypass?: boolean; + /** + * Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at the administrator instead of a setting the next managed merge would override, and it is ignored when comparing two configs for change. Only the managed merge may set it; a caller-supplied value is stripped. + * + * @internal + */ + managedMcpRoutingLocked?: boolean; + /** + * The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`. + * + * @internal + */ + managedLspRoutingLocked?: boolean; + auth?: SandboxConfigAuth; + /** + * Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out). + */ + allowDevToolAccess?: boolean; } /** * User-managed sandbox policy fragment merged into the auto-discovered base policy. @@ -16596,10 +16948,10 @@ export interface SandboxConfig { */ /** @experimental */ export interface SandboxConfigUserPolicy { - filesystem?: SandboxConfigUserPolicyFilesystem; - network?: SandboxConfigUserPolicyNetwork; - seatbelt?: SandboxConfigUserPolicySeatbelt; - experimental?: SandboxConfigUserPolicyExperimental; + filesystem?: SandboxConfigUserPolicyFilesystem; + network?: SandboxConfigUserPolicyNetwork; + seatbelt?: SandboxConfigUserPolicySeatbelt; + experimental?: SandboxConfigUserPolicyExperimental; } /** * Filesystem rules to merge into the base policy. @@ -16609,22 +16961,22 @@ export interface SandboxConfigUserPolicy { */ /** @experimental */ export interface SandboxConfigUserPolicyFilesystem { - /** - * Paths granted read/write access. - */ - readwritePaths?: string[]; - /** - * Paths granted read-only access. - */ - readonlyPaths?: string[]; - /** - * Paths explicitly denied. - */ - deniedPaths?: string[]; - /** - * Whether to clear the policy when the session exits. - */ - clearPolicyOnExit?: boolean; + /** + * Paths granted read/write access. + */ + readwritePaths?: string[]; + /** + * Paths granted read-only access. + */ + readonlyPaths?: string[]; + /** + * Paths explicitly denied. + */ + deniedPaths?: string[]; + /** + * Whether to clear the policy when the session exits. + */ + clearPolicyOnExit?: boolean; } /** * Network rules to merge into the base policy. @@ -16634,15 +16986,15 @@ export interface SandboxConfigUserPolicyFilesystem { */ /** @experimental */ export interface SandboxConfigUserPolicyNetwork { - /** - * Whether outbound network traffic is allowed at all. - */ - allowOutbound?: boolean; - /** - * Whether traffic to local/loopback addresses is allowed. - */ - allowLocalNetwork?: boolean; - proxy?: SandboxConfigUserPolicyNetworkProxy; + /** + * Whether outbound network traffic is allowed at all. + */ + allowOutbound?: boolean; + /** + * Whether traffic to local/loopback addresses is allowed. + */ + allowLocalNetwork?: boolean; + proxy?: SandboxConfigUserPolicyNetworkProxy; } /** * HTTP proxy configuration for sandboxed traffic. @@ -16652,18 +17004,18 @@ export interface SandboxConfigUserPolicyNetwork { */ /** @experimental */ export interface SandboxConfigUserPolicyNetworkProxy { - /** - * Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted; an explicit port must be between 1 and 65535. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. - */ - url: string; - /** - * Optional username for proxy authentication. Combined with the URL (and `password`) into `user:pass@host` when the sandboxed process routes through the proxy. - */ - username?: string; - /** - * Optional password for proxy authentication, combined with the URL at spawn time. The persisted value may be a literal password, a `${secret:…}` reference resolved from the OS keychain, or a `${VAR}`/`$VAR` environment reference; it is resolved just before the sandboxed process routes through the proxy. The /sandbox dialog stores a real password in the OS keychain and persists only a `${secret:…}` placeholder (never plaintext in settings.json); the field is masked in the dialog and redacted by /settings show. - */ - password?: string; + /** + * Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted; an explicit port must be between 1 and 65535. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is. + */ + url: string; + /** + * Optional username for proxy authentication. Combined with the URL (and `password`) into `user:pass@host` when the sandboxed process routes through the proxy. + */ + username?: string; + /** + * Optional password for proxy authentication, combined with the URL at spawn time. The persisted value may be a literal password, a `${secret:…}` reference resolved from the OS keychain, or a `${VAR}`/`$VAR` environment reference; it is resolved just before the sandboxed process routes through the proxy. The /sandbox dialog stores a real password in the OS keychain and persists only a `${secret:…}` placeholder (never plaintext in settings.json); the field is masked in the dialog and redacted by /settings show. + */ + password?: string; } /** * macOS seatbelt-specific options. @@ -16673,10 +17025,10 @@ export interface SandboxConfigUserPolicyNetworkProxy { */ /** @experimental */ export interface SandboxConfigUserPolicySeatbelt { - /** - * Whether the macOS seatbelt profile may access the keychain. - */ - keychainAccess?: boolean; + /** + * Whether the macOS seatbelt profile may access the keychain. + */ + keychainAccess?: boolean; } /** * Platform-specific experimental policy fields. @@ -16686,7 +17038,7 @@ export interface SandboxConfigUserPolicySeatbelt { */ /** @experimental */ export interface SandboxConfigUserPolicyExperimental { - seatbelt?: SandboxConfigUserPolicyExperimentalSeatbelt; + seatbelt?: SandboxConfigUserPolicyExperimentalSeatbelt; } /** * macOS seatbelt experimental options. @@ -16696,10 +17048,10 @@ export interface SandboxConfigUserPolicyExperimental { */ /** @experimental */ export interface SandboxConfigUserPolicyExperimentalSeatbelt { - /** - * Whether the macOS seatbelt profile may access the keychain. - */ - keychainAccess?: boolean; + /** + * Whether the macOS seatbelt profile may access the keychain. + */ + keychainAccess?: boolean; } /** * Credential-injection capability flags applied while the sandbox is enabled. For the same capability independent of sandboxing, and matched to the credential's GitHub host, see `shell.credentials`; the two are additive. @@ -16709,14 +17061,14 @@ export interface SandboxConfigUserPolicyExperimentalSeatbelt { */ /** @experimental */ export interface SandboxConfigAuth { - /** - * Whether to inject git credentials as an `http..extraheader` so authenticated HTTPS git works inside the sandbox without the shell-based credential helper the sandbox blocks. github.com is served by the Copilot token; every other forge (Azure DevOps, GitHub Enterprise Server, GitLab, ...) by a credential the host resolves from the user's own helper before the sandbox is applied. Default: false (opt-in). - */ - git?: boolean; - /** - * Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the OS keyring the sandbox blocks. Default: false (opt-in). - */ - gh?: boolean; + /** + * Whether to inject git credentials as an `http..extraheader` so authenticated HTTPS git works inside the sandbox without the shell-based credential helper the sandbox blocks. github.com is served by the Copilot token; every other forge (Azure DevOps, GitHub Enterprise Server, GitLab, ...) by a credential the host resolves from the user's own helper before the sandbox is applied. Default: false (opt-in). + */ + git?: boolean; + /** + * Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the OS keyring the sandbox blocks. Default: false (opt-in). + */ + gh?: boolean; } /** * Managed sandbox enforcement state for a session. @@ -16726,18 +17078,18 @@ export interface SandboxConfigAuth { */ /** @experimental */ export interface SandboxEnforcementStatus { - /** - * Whether the effective managed policy requires an available sandbox backend. - */ - required: boolean; - /** - * Whether an enforcement failure has permanently blocked the session. - */ - blocked: boolean; - /** - * The first sandbox enforcement failure that blocked the session. - */ - reason?: string; + /** + * Whether the effective managed policy requires an available sandbox backend. + */ + required: boolean; + /** + * Whether an enforcement failure has permanently blocked the session. + */ + blocked: boolean; + /** + * The first sandbox enforcement failure that blocked the session. + */ + reason?: string; } /** * Register an absolute-time scheduled prompt. @@ -16747,22 +17099,22 @@ export interface SandboxEnforcementStatus { */ /** @experimental */ export interface ScheduleAddAtRequest { - /** - * Epoch milliseconds when the prompt should fire. - */ - at: number; - /** - * Prompt text to enqueue when the schedule fires. - */ - prompt: string; - /** - * Whether the schedule should re-arm after each tick. Defaults to false. - */ - recurring?: boolean; - /** - * Optional display-only prompt label. - */ - displayPrompt?: string; + /** + * Epoch milliseconds when the prompt should fire. + */ + at: number; + /** + * Prompt text to enqueue when the schedule fires. + */ + prompt: string; + /** + * Whether the schedule should re-arm after each tick. Defaults to false. + */ + recurring?: boolean; + /** + * Optional display-only prompt label. + */ + displayPrompt?: string; } /** * Register a cron scheduled prompt. @@ -16772,26 +17124,26 @@ export interface ScheduleAddAtRequest { */ /** @experimental */ export interface ScheduleAddCronRequest { - /** - * 5-field cron expression. - */ - cron: string; - /** - * Prompt text to enqueue when the schedule fires. - */ - prompt: string; - /** - * Whether the schedule should re-arm after each tick. Defaults to true. - */ - recurring?: boolean; - /** - * Optional display-only prompt label. - */ - displayPrompt?: string; - /** - * IANA timezone for evaluating the cron expression. - */ - tz?: string; + /** + * 5-field cron expression. + */ + cron: string; + /** + * Prompt text to enqueue when the schedule fires. + */ + prompt: string; + /** + * Whether the schedule should re-arm after each tick. Defaults to true. + */ + recurring?: boolean; + /** + * Optional display-only prompt label. + */ + displayPrompt?: string; + /** + * IANA timezone for evaluating the cron expression. + */ + tz?: string; } /** * Register a relative-interval scheduled prompt. @@ -16801,22 +17153,22 @@ export interface ScheduleAddCronRequest { */ /** @experimental */ export interface ScheduleAddRequest { - /** - * Human-readable interval such as `30s`, `5m`, or `2h`. - */ - interval: string; - /** - * Prompt text to enqueue when the schedule fires. - */ - prompt: string; - /** - * Whether the schedule should re-arm after each tick. Defaults to true. - */ - recurring?: boolean; - /** - * Optional display-only prompt label. - */ - displayPrompt?: string; + /** + * Human-readable interval such as `30s`, `5m`, or `2h`. + */ + interval: string; + /** + * Prompt text to enqueue when the schedule fires. + */ + prompt: string; + /** + * Whether the schedule should re-arm after each tick. Defaults to true. + */ + recurring?: boolean; + /** + * Optional display-only prompt label. + */ + displayPrompt?: string; } /** * Result of registering or re-arming a scheduled prompt. @@ -16826,11 +17178,11 @@ export interface ScheduleAddRequest { */ /** @experimental */ export interface ScheduleAddResult { - entry?: ScheduleEntry; - /** - * User-facing validation error, when registration failed. - */ - error?: string; + entry?: ScheduleEntry; + /** + * User-facing validation error, when registration failed. + */ + error?: string; } /** * Scheduled prompt entry with ID, timing (`intervalMs`, `cron`, or `at`), prompt text, recurrence, and next run time. @@ -16840,46 +17192,46 @@ export interface ScheduleAddResult { */ /** @experimental */ export interface ScheduleEntry { - /** - * Sequential id assigned by the runtime within the session. Stable across resumes (rebuilt from the event log). - */ - id: number; - /** - * Interval between scheduled ticks, in milliseconds (relative-interval schedules). - */ - intervalMs?: number; - /** - * 5-field cron expression for a recurring calendar schedule, evaluated in `tz`. - */ - cron?: string; - /** - * IANA timezone the `cron` expression is evaluated in. - */ - tz?: string; - /** - * Absolute fire time (epoch milliseconds) for a one-shot calendar schedule. - */ - at?: number; - /** - * Prompt text that gets enqueued on every tick. - */ - prompt: string; - /** - * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`). - */ - recurring: boolean; - /** - * 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. - */ - selfPaced?: boolean; - /** - * 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`. - */ - displayPrompt?: string; - /** - * ISO 8601 timestamp when the next tick is scheduled to fire. - */ - nextRunAt: string; + /** + * Sequential id assigned by the runtime within the session. Stable across resumes (rebuilt from the event log). + */ + id: number; + /** + * Interval between scheduled ticks, in milliseconds (relative-interval schedules). + */ + intervalMs?: number; + /** + * 5-field cron expression for a recurring calendar schedule, evaluated in `tz`. + */ + cron?: string; + /** + * IANA timezone the `cron` expression is evaluated in. + */ + tz?: string; + /** + * Absolute fire time (epoch milliseconds) for a one-shot calendar schedule. + */ + at?: number; + /** + * Prompt text that gets enqueued on every tick. + */ + prompt: string; + /** + * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`). + */ + recurring: boolean; + /** + * 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. + */ + selfPaced?: boolean; + /** + * 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`. + */ + displayPrompt?: string; + /** + * ISO 8601 timestamp when the next tick is scheduled to fire. + */ + nextRunAt: string; } /** * Register a self-paced scheduled prompt. @@ -16889,14 +17241,14 @@ export interface ScheduleEntry { */ /** @experimental */ export interface ScheduleAddSelfPacedRequest { - /** - * Prompt text to enqueue when the schedule fires. - */ - prompt: string; - /** - * Optional display-only prompt label. - */ - displayPrompt?: string; + /** + * Prompt text to enqueue when the schedule fires. + */ + prompt: string; + /** + * Optional display-only prompt label. + */ + displayPrompt?: string; } /** * Whether the session currently has an active self-paced schedule. @@ -16906,10 +17258,10 @@ export interface ScheduleAddSelfPacedRequest { */ /** @experimental */ export interface ScheduleHasSelfPacedResult { - /** - * True when at least one active schedule is self-paced. - */ - hasSelfPaced: boolean; + /** + * True when at least one active schedule is self-paced. + */ + hasSelfPaced: boolean; } /** * Snapshot of the currently active recurring prompts for this session. @@ -16919,10 +17271,10 @@ export interface ScheduleHasSelfPacedResult { */ /** @experimental */ export interface ScheduleList { - /** - * Active scheduled prompts, ordered by id. - */ - entries: ScheduleEntry[]; + /** + * Active scheduled prompts, ordered by id. + */ + entries: ScheduleEntry[]; } /** * Re-arm a self-paced scheduled prompt. @@ -16932,14 +17284,14 @@ export interface ScheduleList { */ /** @experimental */ export interface ScheduleRearmSelfPacedRequest { - /** - * Id of the self-paced scheduled prompt. - */ - id: number; - /** - * Epoch milliseconds when the prompt should next fire. - */ - at: number; + /** + * Id of the self-paced scheduled prompt. + */ + id: number; + /** + * Epoch milliseconds when the prompt should next fire. + */ + at: number; } /** * Identifier of the scheduled prompt to remove. @@ -16949,10 +17301,10 @@ export interface ScheduleRearmSelfPacedRequest { */ /** @experimental */ export interface ScheduleStopRequest { - /** - * Id of the scheduled prompt to remove. - */ - id: number; + /** + * Id of the scheduled prompt to remove. + */ + id: number; } /** * Remove a scheduled prompt by id. The result entry is omitted if the id was unknown. @@ -16962,7 +17314,7 @@ export interface ScheduleStopRequest { */ /** @experimental */ export interface ScheduleStopResult { - entry?: ScheduleEntry; + entry?: ScheduleEntry; } /** * Secret values to add to the redaction filter. @@ -16972,10 +17324,10 @@ export interface ScheduleStopResult { */ /** @experimental */ export interface SecretsAddFilterValuesRequest { - /** - * Raw secret values to register for redaction - */ - values: string[]; + /** + * Raw secret values to register for redaction + */ + values: string[]; } /** * Confirmation that the secret values were registered. @@ -16985,10 +17337,10 @@ export interface SecretsAddFilterValuesRequest { */ /** @experimental */ export interface SecretsAddFilterValuesResult { - /** - * Whether the values were successfully registered - */ - ok: true; + /** + * Whether the values were successfully registered + */ + ok: true; } /** * Parameters for session.extensions.sendAttachmentsToMessage. @@ -16998,14 +17350,14 @@ export interface SecretsAddFilterValuesResult { */ /** @experimental */ export interface SendAttachmentsToMessageParams { - /** - * Optional canvas instance binding the push for provenance. When supplied, the runtime resolves the canvas, verifies it is owned by the calling extension, and stamps canvasId/instanceId onto each extension_context entry. When omitted, no resolution runs and those fields stay unset on the attachment. - */ - instanceId?: string; - /** - * Attachments to push into the next user-message turn. extension_context entries take the slim shape; standard variants take their full AttachmentSchema shape. - */ - attachments: PushAttachment[]; + /** + * Optional canvas instance binding the push for provenance. When supplied, the runtime resolves the canvas, verifies it is owned by the calling extension, and stamps canvasId/instanceId onto each extension_context entry. When omitted, no resolution runs and those fields stay unset on the attachment. + */ + instanceId?: string; + /** + * Attachments to push into the next user-message turn. extension_context entries take the slim shape; standard variants take their full AttachmentSchema shape. + */ + attachments: PushAttachment[]; } /** * A single user message to append to the session as part of a `session.sendMessages` turn @@ -17015,34 +17367,34 @@ export interface SendAttachmentsToMessageParams { */ /** @experimental */ export interface SendMessageItem { - /** - * The user message text - */ - prompt: string; - /** - * If provided, this is shown in the timeline instead of `prompt` - */ - displayPrompt?: string; - /** - * Optional attachments (files, directories, selections, blobs, GitHub references) to include with this message - */ - attachments?: Attachment[]; - /** - * If false, this message will not trigger a Premium Request Unit charge. User messages default to billable. - * - * @internal - */ - billable?: boolean; - /** - * If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange - */ - requiredTool?: string; - /** - * Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-` for command-originated messages, `schedule-` for scheduled prompts, or `agent-` for prompts sent by another agent. - * - * @internal - */ - source?: string; + /** + * The user message text + */ + prompt: string; + /** + * If provided, this is shown in the timeline instead of `prompt` + */ + displayPrompt?: string; + /** + * Optional attachments (files, directories, selections, blobs, GitHub references) to include with this message + */ + attachments?: Attachment[]; + /** + * If false, this message will not trigger a Premium Request Unit charge. User messages default to billable. + * + * @internal + */ + billable?: boolean; + /** + * If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange + */ + requiredTool?: string; + /** + * Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-` for command-originated messages, `schedule-` for scheduled prompts, or `agent-` for prompts sent by another agent. + * + * @internal + */ + source?: string; } /** * Parameters for sending zero or more user messages to the session in a single turn. Remote-backed (Mission Control) sessions do not support this method and will return an error. @@ -17052,34 +17404,34 @@ export interface SendMessageItem { */ /** @experimental */ export interface SendMessagesRequest { - /** - * The user messages to append to the conversation, in order. May be empty, in which case a single turn runs over the existing history with no new user message. - */ - messages: SendMessageItem[]; - mode?: SendMode; - /** - * If true, adds the messages to the front of the queue instead of the end - */ - prepend?: boolean; - agentMode?: SendAgentMode; - /** - * Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. - */ - requestHeaders?: { - [k: string]: string | undefined; - }; - /** - * W3C Trace Context traceparent header for distributed tracing of this agent turn - */ - traceparent?: string; - /** - * W3C Trace Context tracestate header for distributed tracing - */ - tracestate?: string; - /** - * If true, await completion of the agentic loop for this turn before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageIds`; the caller can rely on the agent having processed the messages before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. - */ - wait?: boolean; + /** + * The user messages to append to the conversation, in order. May be empty, in which case a single turn runs over the existing history with no new user message. + */ + messages: SendMessageItem[]; + mode?: SendMode; + /** + * If true, adds the messages to the front of the queue instead of the end + */ + prepend?: boolean; + agentMode?: SendAgentMode; + /** + * Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. + */ + requestHeaders?: { + [k: string]: string | undefined; + }; + /** + * W3C Trace Context traceparent header for distributed tracing of this agent turn + */ + traceparent?: string; + /** + * W3C Trace Context tracestate header for distributed tracing + */ + tracestate?: string; + /** + * If true, await completion of the agentic loop for this turn before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageIds`; the caller can rely on the agent having processed the messages before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. + */ + wait?: boolean; } /** * Result of sending zero or more user messages @@ -17089,10 +17441,10 @@ export interface SendMessagesRequest { */ /** @experimental */ export interface SendMessagesResult { - /** - * Unique identifiers assigned to the messages, one per provided message in order. Empty when no messages were provided. - */ - messageIds: string[]; + /** + * Unique identifiers assigned to the messages, one per provided message in order. Empty when no messages were provided. + */ + messageIds: string[]; } /** * Parameters for sending a user message to the session @@ -17102,56 +17454,56 @@ export interface SendMessagesResult { */ /** @experimental */ export interface SendRequest { - /** - * The user message text - */ - prompt: string; - /** - * If provided, this is shown in the timeline instead of `prompt` - */ - displayPrompt?: string; - /** - * Optional attachments (files, directories, selections, blobs, GitHub references) to include with the message - */ - attachments?: Attachment[]; - mode?: SendMode; - /** - * If true, adds the message to the front of the queue instead of the end - */ - prepend?: boolean; - /** - * If false, this message will not trigger a Premium Request Unit charge. User messages default to billable. - */ - billable?: boolean; - /** - * If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange - */ - requiredTool?: string; - /** - * Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-` for command-originated messages, `schedule-` for scheduled prompts, or `agent-` for prompts sent by another agent. - * - * @internal - */ - source?: string; - agentMode?: SendAgentMode; - /** - * Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. - */ - requestHeaders?: { - [k: string]: string | undefined; - }; - /** - * W3C Trace Context traceparent header for distributed tracing of this agent turn - */ - traceparent?: string; - /** - * W3C Trace Context tracestate header for distributed tracing - */ - tracestate?: string; - /** - * If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. - */ - wait?: boolean; + /** + * The user message text + */ + prompt: string; + /** + * If provided, this is shown in the timeline instead of `prompt` + */ + displayPrompt?: string; + /** + * Optional attachments (files, directories, selections, blobs, GitHub references) to include with the message + */ + attachments?: Attachment[]; + mode?: SendMode; + /** + * If true, adds the message to the front of the queue instead of the end + */ + prepend?: boolean; + /** + * If false, this message will not trigger a Premium Request Unit charge. User messages default to billable. + */ + billable?: boolean; + /** + * If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange + */ + requiredTool?: string; + /** + * Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-` for command-originated messages, `schedule-` for scheduled prompts, or `agent-` for prompts sent by another agent. + * + * @internal + */ + source?: string; + agentMode?: SendAgentMode; + /** + * Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. + */ + requestHeaders?: { + [k: string]: string | undefined; + }; + /** + * W3C Trace Context traceparent header for distributed tracing of this agent turn + */ + traceparent?: string; + /** + * W3C Trace Context tracestate header for distributed tracing + */ + tracestate?: string; + /** + * If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly. + */ + wait?: boolean; } /** * Result of sending a user message @@ -17161,10 +17513,10 @@ export interface SendRequest { */ /** @experimental */ export interface SendResult { - /** - * Unique identifier assigned to the message - */ - messageId: string; + /** + * Unique identifier assigned to the message + */ + messageId: string; } /** * Internal request for sending a system notification. @@ -17174,18 +17526,18 @@ export interface SendResult { */ /** @experimental */ export interface SendSystemNotificationRequest { - /** - * Notification text to deliver to the model. - */ - message: string; - /** - * Optional structured notification kind. - */ - kind?: JsonValue; - /** - * Internal delivery options, including passive policy. - */ - options?: JsonValue; + /** + * Notification text to deliver to the model. + */ + message: string; + /** + * Optional structured notification kind. + */ + kind?: JsonValue; + /** + * Internal delivery options, including passive policy. + */ + options?: JsonValue; } /** * Agents discovered across user, project, plugin, and remote sources. @@ -17195,10 +17547,10 @@ export interface SendSystemNotificationRequest { */ /** @experimental */ export interface ServerAgentList { - /** - * All discovered agents across all sources - */ - agents: AgentInfo[]; + /** + * All discovered agents across all sources + */ + agents: AgentInfo[]; } /** * Instruction sources discovered across user, repository, and plugin sources. @@ -17208,10 +17560,10 @@ export interface ServerAgentList { */ /** @experimental */ export interface ServerInstructionSourceList { - /** - * All discovered instruction sources - */ - sources: InstructionSource[]; + /** + * All discovered instruction sources + */ + sources: InstructionSource[]; } /** * Server-side skill metadata, including name, description, source, enabled/invocable state, path, project path, and argument hint. @@ -17221,39 +17573,39 @@ export interface ServerInstructionSourceList { */ /** @experimental */ export interface ServerSkill { - /** - * Unique identifier for the skill - */ - name: string; - /** - * Canonical slash command name used to invoke the skill, without the leading '/' - */ - commandName?: string; - /** - * Description of what the skill does - */ - description: string; - source: SkillSource; - /** - * Whether the skill can be invoked by the user as a slash command - */ - userInvocable: boolean; - /** - * Whether the skill is currently enabled (based on global config) - */ - enabled: boolean; - /** - * Absolute path to the skill file - */ - path?: string; - /** - * The project path this skill belongs to (only for project/inherited skills) - */ - projectPath?: string; - /** - * Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field - */ - argumentHint?: string; + /** + * Unique identifier for the skill + */ + name: string; + /** + * Canonical slash command name used to invoke the skill, without the leading '/' + */ + commandName?: string; + /** + * Description of what the skill does + */ + description: string; + source: SkillSource; + /** + * Whether the skill can be invoked by the user as a slash command + */ + userInvocable: boolean; + /** + * Whether the skill is currently enabled (based on global config) + */ + enabled: boolean; + /** + * Absolute path to the skill file + */ + path?: string; + /** + * The project path this skill belongs to (only for project/inherited skills) + */ + projectPath?: string; + /** + * Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field + */ + argumentHint?: string; } /** * Skills discovered across global and project sources. @@ -17263,14 +17615,14 @@ export interface ServerSkill { */ /** @experimental */ export interface ServerSkillList { - /** - * All discovered skills across all sources - */ - skills: ServerSkill[]; - /** - * Messages for skills that failed to load (e.g. malformed SKILL.md). Empty when host skills are excluded so host-local paths are not disclosed to multitenant callers. - */ - errors?: string[]; + /** + * All discovered skills across all sources + */ + skills: ServerSkill[]; + /** + * Messages for skills that failed to load (e.g. malformed SKILL.md). Empty when host skills are excluded so host-local paths are not disclosed to multitenant callers. + */ + errors?: string[]; } /** * Current activity flags for the session. @@ -17280,14 +17632,14 @@ export interface ServerSkillList { */ /** @experimental */ export interface SessionActivity { - /** - * Whether an in-flight operation can currently be aborted. - */ - abortable: boolean; - /** - * Whether the session currently has active work, including running turns or tasks. - */ - hasActiveWork: boolean; + /** + * Whether an in-flight operation can currently be aborted. + */ + abortable: boolean; + /** + * Whether the session currently has active work, including running turns or tasks. + */ + hasActiveWork: boolean; } /** * Internal GitHub login parameters. @@ -17297,22 +17649,22 @@ export interface SessionActivity { */ /** @experimental */ export interface SessionAuthLoginRequest { - /** - * GitHub host URL - */ - host: string; - /** - * GitHub login - */ - login: string; - /** - * GitHub authentication token - */ - token: string; - /** - * Whether to persist the token after login - */ - persist?: boolean; + /** + * GitHub host URL + */ + host: string; + /** + * GitHub login + */ + login: string; + /** + * GitHub authentication token + */ + token: string; + /** + * Whether to persist the token after login + */ + persist?: boolean; } /** * Parameters identifying a GitHub authentication to log out. @@ -17322,7 +17674,7 @@ export interface SessionAuthLoginRequest { */ /** @experimental */ export interface SessionAuthLogoutUserRequest { - authInfo: AuthInfo; + authInfo: AuthInfo; } /** * Authentication status and account metadata for the session. @@ -17332,27 +17684,27 @@ export interface SessionAuthLogoutUserRequest { */ /** @experimental */ export interface SessionAuthStatus { - /** - * Whether the session has resolved authentication - */ - isAuthenticated: boolean; - authType?: AuthInfoType; - /** - * Authentication host URL - */ - host?: string; - /** - * Authenticated login/username, if available - */ - login?: string; - /** - * Human-readable authentication status description - */ - statusMessage?: string; - /** - * Copilot plan tier (e.g., individual_pro, business) - */ - copilotPlan?: string; + /** + * Whether the session has resolved authentication + */ + isAuthenticated: boolean; + authType?: AuthInfoType; + /** + * Authentication host URL + */ + host?: string; + /** + * Authenticated login/username, if available + */ + login?: string; + /** + * Human-readable authentication status description + */ + statusMessage?: string; + /** + * Copilot plan tier (e.g., individual_pro, business) + */ + copilotPlan?: string; } /** * Parameters for switching the session's active authentication. @@ -17362,11 +17714,11 @@ export interface SessionAuthStatus { */ /** @experimental */ export interface SessionAuthSwitchRequest { - authInfo: AuthInfo; - /** - * Optional token paired with the authentication information - */ - token?: string; + authInfo: AuthInfo; + /** + * Optional token paired with the authentication information + */ + token?: string; } /** * Map of sessionId -> bytes freed by removing the session's workspace directory. @@ -17376,12 +17728,12 @@ export interface SessionAuthSwitchRequest { */ /** @experimental */ export interface SessionBulkDeleteResult { - /** - * Map of sessionId -> bytes freed by removing the session's workspace directory. Sessions whose deletion failed are omitted from this map (failures are logged on the server but not surfaced per-id; check the map for absent IDs to detect them). - */ - freedBytes: { - [k: string]: number | undefined; - }; + /** + * Map of sessionId -> bytes freed by removing the session's workspace directory. Sessions whose deletion failed are omitted from this map (failures are logged on the server but not surfaced per-id; check the map for absent IDs to detect them). + */ + freedBytes: { + [k: string]: number | undefined; + }; } /** * The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted. @@ -17391,10 +17743,10 @@ export interface SessionBulkDeleteResult { */ /** @experimental */ export interface SessionEnrichMetadataResult { - /** - * Enriched records, with summary and context backfilled. Sessions confirmed empty and unnamed may be omitted. - */ - sessions: LocalSessionMetadataValue[]; + /** + * Enriched records, with summary and context backfilled. Sessions confirmed empty and unnamed may be omitted. + */ + sessions: LocalSessionMetadataValue[]; } /** * File path, content to append, and optional mode for the client-provided session filesystem. @@ -17404,22 +17756,22 @@ export interface SessionEnrichMetadataResult { */ /** @experimental */ export interface SessionFsAppendFileRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Path using SessionFs conventions - */ - path: string; - /** - * Content to append - */ - content: string; - /** - * Optional POSIX-style mode for newly created files - */ - mode?: number; + /** + * Target session identifier + */ + sessionId: string; + /** + * Path using SessionFs conventions + */ + path: string; + /** + * Content to append + */ + content: string; + /** + * Optional POSIX-style mode for newly created files + */ + mode?: number; } /** * Describes a filesystem error. @@ -17429,11 +17781,11 @@ export interface SessionFsAppendFileRequest { */ /** @experimental */ export interface SessionFsError { - code: SessionFsErrorCode; - /** - * Free-form detail about the error, for logging/diagnostics - */ - message?: string; + code: SessionFsErrorCode; + /** + * Free-form detail about the error, for logging/diagnostics + */ + message?: string; } /** * Path to test for existence in the client-provided session filesystem. @@ -17443,14 +17795,14 @@ export interface SessionFsError { */ /** @experimental */ export interface SessionFsExistsRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Path using SessionFs conventions - */ - path: string; + /** + * Target session identifier + */ + sessionId: string; + /** + * Path using SessionFs conventions + */ + path: string; } /** * Indicates whether the requested path exists in the client-provided session filesystem. @@ -17460,10 +17812,10 @@ export interface SessionFsExistsRequest { */ /** @experimental */ export interface SessionFsExistsResult { - /** - * Whether the path exists - */ - exists: boolean; + /** + * Whether the path exists + */ + exists: boolean; } /** * Directory path to create in the client-provided session filesystem, with options for recursive creation and POSIX mode. @@ -17473,22 +17825,22 @@ export interface SessionFsExistsResult { */ /** @experimental */ export interface SessionFsMkdirRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Path using SessionFs conventions - */ - path: string; - /** - * Create parent directories as needed - */ - recursive?: boolean; - /** - * Optional POSIX-style mode for newly created directories - */ - mode?: number; + /** + * Target session identifier + */ + sessionId: string; + /** + * Path using SessionFs conventions + */ + path: string; + /** + * Create parent directories as needed + */ + recursive?: boolean; + /** + * Optional POSIX-style mode for newly created directories + */ + mode?: number; } /** * Directory path whose entries should be listed from the client-provided session filesystem. @@ -17498,14 +17850,14 @@ export interface SessionFsMkdirRequest { */ /** @experimental */ export interface SessionFsReaddirRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Path using SessionFs conventions - */ - path: string; + /** + * Target session identifier + */ + sessionId: string; + /** + * Path using SessionFs conventions + */ + path: string; } /** * Names of entries in the requested directory, or a filesystem error if the read failed. @@ -17515,11 +17867,11 @@ export interface SessionFsReaddirRequest { */ /** @experimental */ export interface SessionFsReaddirResult { - /** - * Entry names in the directory - */ - entries: string[]; - error?: SessionFsError; + /** + * Entry names in the directory + */ + entries: string[]; + error?: SessionFsError; } /** * Directory entry returned by session filesystem `readdirWithTypes`, with name and entry type. @@ -17529,11 +17881,11 @@ export interface SessionFsReaddirResult { */ /** @experimental */ export interface SessionFsReaddirWithTypesEntry { - /** - * Entry name - */ - name: string; - type: SessionFsReaddirWithTypesEntryType; + /** + * Entry name + */ + name: string; + type: SessionFsReaddirWithTypesEntryType; } /** * Directory path whose entries (with type information) should be listed from the client-provided session filesystem. @@ -17543,14 +17895,14 @@ export interface SessionFsReaddirWithTypesEntry { */ /** @experimental */ export interface SessionFsReaddirWithTypesRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Path using SessionFs conventions - */ - path: string; + /** + * Target session identifier + */ + sessionId: string; + /** + * Path using SessionFs conventions + */ + path: string; } /** * Entries in the requested directory paired with file/directory type information, or a filesystem error if the read failed. @@ -17560,11 +17912,11 @@ export interface SessionFsReaddirWithTypesRequest { */ /** @experimental */ export interface SessionFsReaddirWithTypesResult { - /** - * Directory entries with type information - */ - entries: SessionFsReaddirWithTypesEntry[]; - error?: SessionFsError; + /** + * Directory entries with type information + */ + entries: SessionFsReaddirWithTypesEntry[]; + error?: SessionFsError; } /** * Path of the file to read from the client-provided session filesystem. @@ -17574,14 +17926,14 @@ export interface SessionFsReaddirWithTypesResult { */ /** @experimental */ export interface SessionFsReadFileRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Path using SessionFs conventions - */ - path: string; + /** + * Target session identifier + */ + sessionId: string; + /** + * Path using SessionFs conventions + */ + path: string; } /** * File content as a UTF-8 string, or a filesystem error if the read failed. @@ -17591,11 +17943,11 @@ export interface SessionFsReadFileRequest { */ /** @experimental */ export interface SessionFsReadFileResult { - /** - * File content as UTF-8 string - */ - content: string; - error?: SessionFsError; + /** + * File content as UTF-8 string + */ + content: string; + error?: SessionFsError; } /** * Source and destination paths for renaming or moving an entry in the client-provided session filesystem. @@ -17605,18 +17957,18 @@ export interface SessionFsReadFileResult { */ /** @experimental */ export interface SessionFsRenameRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Source path using SessionFs conventions - */ - src: string; - /** - * Destination path using SessionFs conventions - */ - dest: string; + /** + * Target session identifier + */ + sessionId: string; + /** + * Source path using SessionFs conventions + */ + src: string; + /** + * Destination path using SessionFs conventions + */ + dest: string; } /** * Path to remove from the client-provided session filesystem, with options for recursive removal and force. @@ -17626,22 +17978,22 @@ export interface SessionFsRenameRequest { */ /** @experimental */ export interface SessionFsRmRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Path using SessionFs conventions - */ - path: string; - /** - * Remove directories and their contents recursively - */ - recursive?: boolean; - /** - * Ignore errors if the path does not exist - */ - force?: boolean; + /** + * Target session identifier + */ + sessionId: string; + /** + * Path using SessionFs conventions + */ + path: string; + /** + * Remove directories and their contents recursively + */ + recursive?: boolean; + /** + * Ignore errors if the path does not exist + */ + force?: boolean; } /** * Optional capabilities declared by the provider @@ -17651,10 +18003,10 @@ export interface SessionFsRmRequest { */ /** @experimental */ export interface SessionFsSetProviderCapabilities { - /** - * Whether the provider supports SQLite query/exists operations - */ - sqlite?: boolean; + /** + * Whether the provider supports SQLite query/exists operations + */ + sqlite?: boolean; } /** * Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider. @@ -17664,16 +18016,16 @@ export interface SessionFsSetProviderCapabilities { */ /** @experimental */ export interface SessionFsSetProviderRequest { - /** - * Initial working directory for sessions - */ - initialCwd: string; - /** - * Path within each session's SessionFs where the runtime stores files for that session - */ - sessionStatePath: string; - conventions: SessionFsSetProviderConventions; - capabilities?: SessionFsSetProviderCapabilities; + /** + * Initial working directory for sessions + */ + initialCwd: string; + /** + * Path within each session's SessionFs where the runtime stores files for that session + */ + sessionStatePath: string; + conventions: SessionFsSetProviderConventions; + capabilities?: SessionFsSetProviderCapabilities; } /** * Indicates whether the calling client was registered as the session filesystem provider. @@ -17683,10 +18035,10 @@ export interface SessionFsSetProviderRequest { */ /** @experimental */ export interface SessionFsSetProviderResult { - /** - * Whether the provider was set successfully - */ - success: boolean; + /** + * Whether the provider was set successfully + */ + success: boolean; } /** * Indicates whether the per-session SQLite database already exists. @@ -17696,10 +18048,10 @@ export interface SessionFsSetProviderResult { */ /** @experimental */ export interface SessionFsSqliteExistsResult { - /** - * Whether the session database already exists - */ - exists: boolean; + /** + * Whether the session database already exists + */ + exists: boolean; } /** * SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. The provider applies its SQLite busy timeout for every call. @@ -17709,21 +18061,21 @@ export interface SessionFsSqliteExistsResult { */ /** @experimental */ export interface SessionFsSqliteQueryRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * SQL query to execute - */ - query: string; - queryType: SessionFsSqliteQueryType; - /** - * Optional named bind parameters - */ - params?: { - [k: string]: JsonValue | undefined; - }; + /** + * Target session identifier + */ + sessionId: string; + /** + * SQL query to execute + */ + query: string; + queryType: SessionFsSqliteQueryType; + /** + * Optional named bind parameters + */ + params?: { + [k: string]: JsonValue | undefined; + }; } /** * Query results including rows, columns, and rows affected, or a filesystem error if execution failed. @@ -17733,25 +18085,25 @@ export interface SessionFsSqliteQueryRequest { */ /** @experimental */ export interface SessionFsSqliteQueryResult { - /** - * For SELECT: array of row objects. For others: empty array. - */ - rows: { - [k: string]: JsonValue | undefined; - }[]; - /** - * Column names from the result set - */ - columns: string[]; - /** - * Number of rows affected (for INSERT/UPDATE/DELETE) - */ - rowsAffected: number; - /** - * SQLite last_insert_rowid() value for INSERT. - */ - lastInsertRowid?: number; - error?: SessionFsError; + /** + * For SELECT: array of row objects. For others: empty array. + */ + rows: { + [k: string]: JsonValue | undefined; + }[]; + /** + * Column names from the result set + */ + columns: string[]; + /** + * Number of rows affected (for INSERT/UPDATE/DELETE) + */ + rowsAffected: number; + /** + * SQLite last_insert_rowid() value for INSERT. + */ + lastInsertRowid?: number; + error?: SessionFsError; } /** * Classified SQLite transaction failure. busyOrLocked guarantees rollback; postCommitAmbiguous must never be retried. @@ -17761,11 +18113,11 @@ export interface SessionFsSqliteQueryResult { */ /** @experimental */ export interface SessionFsSqliteTransactionError { - errorClass: SessionFsSqliteTransactionErrorClass; - /** - * Human-readable transaction failure message. - */ - message: string; + errorClass: SessionFsSqliteTransactionErrorClass; + /** + * Human-readable transaction failure message. + */ + message: string; } /** * Statements to execute atomically. Providers apply busy handling for every call. @@ -17775,14 +18127,14 @@ export interface SessionFsSqliteTransactionError { */ /** @experimental */ export interface SessionFsSqliteTransactionRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Ordered SQL statements to execute in one transaction. - */ - statements: SessionFsSqliteTransactionStatement[]; + /** + * Target session identifier + */ + sessionId: string; + /** + * Ordered SQL statements to execute in one transaction. + */ + statements: SessionFsSqliteTransactionStatement[]; } /** * One statement in an atomic SQLite transaction. @@ -17792,17 +18144,17 @@ export interface SessionFsSqliteTransactionRequest { */ /** @experimental */ export interface SessionFsSqliteTransactionStatement { - /** - * SQL statement to execute. - */ - query: string; - queryType: SessionFsSqliteQueryType; - /** - * Optional named bind parameters. - */ - params?: { - [k: string]: JsonValue | undefined; - }; + /** + * SQL statement to execute. + */ + query: string; + queryType: SessionFsSqliteQueryType; + /** + * Optional named bind parameters. + */ + params?: { + [k: string]: JsonValue | undefined; + }; } /** * Per-statement results, or a classified transaction error. @@ -17812,11 +18164,11 @@ export interface SessionFsSqliteTransactionStatement { */ /** @experimental */ export interface SessionFsSqliteTransactionResult { - /** - * Per-statement query results in input order. - */ - results: SessionFsSqliteQueryResult[]; - error?: SessionFsSqliteTransactionError; + /** + * Per-statement query results in input order. + */ + results: SessionFsSqliteQueryResult[]; + error?: SessionFsSqliteTransactionError; } /** * Path whose metadata should be returned from the client-provided session filesystem. @@ -17826,14 +18178,14 @@ export interface SessionFsSqliteTransactionResult { */ /** @experimental */ export interface SessionFsStatRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Path using SessionFs conventions - */ - path: string; + /** + * Target session identifier + */ + sessionId: string; + /** + * Path using SessionFs conventions + */ + path: string; } /** * Filesystem metadata for the requested path, or a filesystem error if the stat failed. @@ -17843,27 +18195,27 @@ export interface SessionFsStatRequest { */ /** @experimental */ export interface SessionFsStatResult { - /** - * Whether the path is a file - */ - isFile: boolean; - /** - * Whether the path is a directory - */ - isDirectory: boolean; - /** - * File size in bytes - */ - size: number; - /** - * ISO 8601 timestamp of last modification - */ - mtime: string; - /** - * ISO 8601 timestamp of creation - */ - birthtime: string; - error?: SessionFsError; + /** + * Whether the path is a file + */ + isFile: boolean; + /** + * Whether the path is a directory + */ + isDirectory: boolean; + /** + * File size in bytes + */ + size: number; + /** + * ISO 8601 timestamp of last modification + */ + mtime: string; + /** + * ISO 8601 timestamp of creation + */ + birthtime: string; + error?: SessionFsError; } /** * File path, content to write, and optional mode for the client-provided session filesystem. @@ -17873,22 +18225,22 @@ export interface SessionFsStatResult { */ /** @experimental */ export interface SessionFsWriteFileRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Path using SessionFs conventions - */ - path: string; - /** - * Content to write - */ - content: string; - /** - * Optional POSIX-style mode for newly created files - */ - mode?: number; + /** + * Target session identifier + */ + sessionId: string; + /** + * Path using SessionFs conventions + */ + path: string; + /** + * Content to write + */ + content: string; + /** + * Optional POSIX-style mode for newly created files + */ + mode?: number; } /** * Installed plugin record for a session, with marketplace, version, install time, enabled state, cache path, and source. @@ -17898,39 +18250,39 @@ export interface SessionFsWriteFileRequest { */ /** @experimental */ export interface SessionInstalledPlugin { - /** - * Plugin name - */ - name: string; - /** - * Marketplace the plugin came from (empty string for direct repo installs) - */ - marketplace: string; - /** - * Installed version, if known - */ - version?: string; - /** - * Installation timestamp (ISO-8601) - */ - installed_at: string; - /** - * Whether the plugin is currently enabled - */ - enabled: boolean; - /** - * Path where the plugin is cached locally - */ - cache_path?: string; - source?: SessionInstalledPluginSource; - /** - * Per-plugin source fingerprint (a SHA-256 hash of the plugin's catalog source spec plus its resolved source subtree — NOT a Git commit SHA) captured at marketplace install/update time. Auto-update compares it against the freshly recomputed fingerprint to detect a content change that does not bump the version. Absent for pre-existing installs and for direct (non-marketplace) installs. - */ - source_sha?: string; - /** - * Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — those synthesized at session start for a directory/local marketplace, whose cache_path points at the real plugin directory on disk rather than a copy under the installed-plugins cache. Its presence is what marks a record as live, and no record carrying it is ever written to the persisted installedPlugins key. - */ - installed_from?: string; + /** + * Plugin name + */ + name: string; + /** + * Marketplace the plugin came from (empty string for direct repo installs) + */ + marketplace: string; + /** + * Installed version, if known + */ + version?: string; + /** + * Installation timestamp (ISO-8601) + */ + installed_at: string; + /** + * Whether the plugin is currently enabled + */ + enabled: boolean; + /** + * Path where the plugin is cached locally + */ + cache_path?: string; + source?: SessionInstalledPluginSource; + /** + * Per-plugin source fingerprint (a SHA-256 hash of the plugin's catalog source spec plus its resolved source subtree — NOT a Git commit SHA) captured at marketplace install/update time. Auto-update compares it against the freshly recomputed fingerprint to detect a content change that does not bump the version. Absent for pre-existing installs and for direct (non-marketplace) installs. + */ + source_sha?: string; + /** + * Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — those synthesized at session start for a directory/local marketplace, whose cache_path points at the real plugin directory on disk rather than a copy under the installed-plugins cache. Its presence is what marks a record as live, and no record carrying it is ever written to the persisted installedPlugins key. + */ + installed_from?: string; } /** * Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref or full commit SHA, and optional subpath. @@ -17940,26 +18292,26 @@ export interface SessionInstalledPlugin { */ /** @experimental */ export interface SessionInstalledPluginSourceGitHub { - /** - * Constant value. Always "github". - */ - source: "github"; - /** - * GitHub repository in `owner/repo` form. - */ - repo: string; - /** - * Optional Git ref to resolve. - */ - ref?: string; - /** - * Optional full 40-character hexadecimal commit SHA. - */ - sha?: string; - /** - * Optional repository-relative path to the plugin. - */ - path?: string; + /** + * Constant value. Always "github". + */ + source: "github"; + /** + * GitHub repository in `owner/repo` form. + */ + repo: string; + /** + * Optional Git ref to resolve. + */ + ref?: string; + /** + * Optional full 40-character hexadecimal commit SHA. + */ + sha?: string; + /** + * Optional repository-relative path to the plugin. + */ + path?: string; } /** * Source descriptor for a direct URL plugin install, with URL, optional ref or full commit SHA, and optional subpath. @@ -17969,26 +18321,26 @@ export interface SessionInstalledPluginSourceGitHub { */ /** @experimental */ export interface SessionInstalledPluginSourceUrl { - /** - * Constant value. Always "url". - */ - source: "url"; - /** - * URL of the plugin source. - */ - url: string; - /** - * Optional Git ref to resolve. - */ - ref?: string; - /** - * Optional full 40-character hexadecimal commit SHA. - */ - sha?: string; - /** - * Optional source-relative path to the plugin. - */ - path?: string; + /** + * Constant value. Always "url". + */ + source: "url"; + /** + * URL of the plugin source. + */ + url: string; + /** + * Optional Git ref to resolve. + */ + ref?: string; + /** + * Optional full 40-character hexadecimal commit SHA. + */ + sha?: string; + /** + * Optional source-relative path to the plugin. + */ + path?: string; } /** * Source descriptor for a direct local plugin install, with a local filesystem path. @@ -17998,14 +18350,14 @@ export interface SessionInstalledPluginSourceUrl { */ /** @experimental */ export interface SessionInstalledPluginSourceLocal { - /** - * Constant value. Always "local". - */ - source: "local"; - /** - * Local filesystem path to the plugin. - */ - path: string; + /** + * Constant value. Always "local". + */ + source: "local"; + /** + * Local filesystem path to the plugin. + */ + path: string; } /** * Baseline data provenance for a prediction. @@ -18015,14 +18367,14 @@ export interface SessionInstalledPluginSourceLocal { */ /** @experimental */ export interface SessionLimitPredictionBaselineData { - /** - * Start of the baseline data slice. - */ - windowStart: string; - /** - * End of the baseline data slice. - */ - windowEnd: string; + /** + * Start of the baseline data slice. + */ + windowStart: string; + /** + * End of the baseline data slice. + */ + windowEnd: string; } /** * Explainable AI-credit session-limit prediction. @@ -18032,30 +18384,30 @@ export interface SessionLimitPredictionBaselineData { */ /** @experimental */ export interface SessionLimitPredictionDetails { - clientType: SessionLimitPredictionClientType; - /** - * Model identifier used for lookup. - */ - modelId: string; - source: SessionLimitPredictionSource; - /** - * Key matched at the source level, such as a model id, family id, or `global`. - */ - sourceKey: string; - /** - * Resolved model family when known. - */ - family?: string; - /** - * Ordered usage tiers and their AI-credit caps. - */ - tiers: SessionLimitPredictionTierOption[]; - baselineData: SessionLimitPredictionBaselineData; - recommendedTier: SessionLimitPredictionTier; - /** - * Recommended maximum AI credits for this session. - */ - recommendedCap: number; + clientType: SessionLimitPredictionClientType; + /** + * Model identifier used for lookup. + */ + modelId: string; + source: SessionLimitPredictionSource; + /** + * Key matched at the source level, such as a model id, family id, or `global`. + */ + sourceKey: string; + /** + * Resolved model family when known. + */ + family?: string; + /** + * Ordered usage tiers and their AI-credit caps. + */ + tiers: SessionLimitPredictionTierOption[]; + baselineData: SessionLimitPredictionBaselineData; + recommendedTier: SessionLimitPredictionTier; + /** + * Recommended maximum AI credits for this session. + */ + recommendedCap: number; } /** * Semantic usage tier and its AI-credit cap. @@ -18065,11 +18417,11 @@ export interface SessionLimitPredictionDetails { */ /** @experimental */ export interface SessionLimitPredictionTierOption { - tier: SessionLimitPredictionTier; - /** - * AI-credit cap for this tier. - */ - cap: number; + tier: SessionLimitPredictionTier; + /** + * AI-credit cap for this tier. + */ + cap: number; } /** * Sessions matching the filter, ordered most-recently-modified first. @@ -18079,10 +18431,10 @@ export interface SessionLimitPredictionTierOption { */ /** @experimental */ export interface SessionList { - /** - * Sessions ordered most-recently-modified first. Discriminated by `isRemote`. - */ - sessions: SessionListEntry[]; + /** + * Sessions ordered most-recently-modified first. Discriminated by `isRemote`. + */ + sessions: SessionListEntry[]; } /** * Optional filter applied to the returned sessions @@ -18092,22 +18444,22 @@ export interface SessionList { */ /** @experimental */ export interface SessionListFilter { - /** - * Match sessions whose context.cwd equals this value - */ - cwd?: string; - /** - * Match sessions whose context.gitRoot equals this value - */ - gitRoot?: string; - /** - * Match sessions whose context.repository equals this value - */ - repository?: string; - /** - * Match sessions whose context.branch equals this value - */ - branch?: string; + /** + * Match sessions whose context.cwd equals this value + */ + cwd?: string; + /** + * Match sessions whose context.gitRoot equals this value + */ + gitRoot?: string; + /** + * Match sessions whose context.repository equals this value + */ + repository?: string; + /** + * Match sessions whose context.branch equals this value + */ + branch?: string; } /** * Queued repo-level startup prompts and the total hook command count after loading. @@ -18117,14 +18469,14 @@ export interface SessionListFilter { */ /** @experimental */ export interface SessionLoadDeferredRepoHooksResult { - /** - * Repo-level startup prompts queued from repo hook configs. Empty on resume, when no repo configs were pending, or when disableAllHooks is set. - */ - startupPrompts: string[]; - /** - * Total hook command count (user + plugin + repo) loaded for the session by this call. Captured atomically with startupPrompts so callers don't need to read a separate counter. - */ - hookCount: number; + /** + * Repo-level startup prompts queued from repo hook configs. Empty on resume, when no repo configs were pending, or when disableAllHooks is set. + */ + startupPrompts: string[]; + /** + * Total hook command count (user + plugin + repo) loaded for the session by this call. Captured atomically with startupPrompts so callers don't need to read a separate counter. + */ + hookCount: number; } /** * Enterprise permission policy expressed with the runtime's managed permission-rule syntax. @@ -18134,22 +18486,22 @@ export interface SessionLoadDeferredRepoHooksResult { */ /** @experimental */ export interface SessionManagedPermissions { - /** - * When set to `disable`, prevents bypass/allow-all permission modes. `allow-auto-only` blocks full allow-all but permits advisory auto-approval. Any other value is accepted rather than failing the session, but is enforced as `disable`: the key is only present to restrict something, so a mode this runtime cannot interpret fails closed to the most restrictive one it knows. Omit the key entirely to impose no restriction. - */ - disableBypassPermissionsMode?: string; - /** - * Permission rules that block matching operations. Deny has highest precedence. - */ - deny?: string[]; - /** - * Permission rules that require explicit human approval. - */ - ask?: string[]; - /** - * Permission rules that allow matching operations unless another managed source, deny, or ask rule restricts them. - */ - allow?: string[]; + /** + * When set to `disable`, prevents bypass/allow-all permission modes. `allow-auto-only` blocks full allow-all but permits advisory auto-approval. Any other value is accepted rather than failing the session, but is enforced as `disable`: the key is only present to restrict something, so a mode this runtime cannot interpret fails closed to the most restrictive one it knows. Omit the key entirely to impose no restriction. + */ + disableBypassPermissionsMode?: string; + /** + * Permission rules that block matching operations. Deny has highest precedence. + */ + deny?: string[]; + /** + * Permission rules that require explicit human approval. + */ + ask?: string[]; + /** + * Permission rules that allow matching operations unless another managed source, deny, or ask rule restricts them. + */ + allow?: string[]; } /** * Managed settings an SDK host may inject at session startup. Only permissions are accepted in this initial contract. @@ -18159,7 +18511,7 @@ export interface SessionManagedPermissions { */ /** @experimental */ export interface SessionManagedSettings { - permissions?: SessionManagedPermissions; + permissions?: SessionManagedPermissions; } /** * Point-in-time snapshot of slow-changing session identifier and state fields @@ -18169,60 +18521,60 @@ export interface SessionManagedSettings { */ /** @experimental */ export interface SessionMetadataSnapshot { - /** - * The unique identifier of the session - */ - sessionId: string; - /** - * ISO 8601 timestamp of when the session started - */ - startTime: string; - /** - * ISO 8601 timestamp of when the session's persisted state was last modified on disk. For new sessions, equals startTime. For resumed sessions, reflects the previous modification time at construction. - */ - modifiedTime: string; - /** - * Whether this is a remote session (i.e., one whose runtime executes elsewhere and is steered through this process) - */ - isRemote: boolean; - /** - * True when the session was detected to be in use by another process at construction time. Local consumers may surface a confirmation prompt before fully attaching. Always false for new sessions. - */ - alreadyInUse: boolean; - /** - * Absolute path to the session's workspace directory on disk, or null if the session has no associated workspace - */ - workspacePath: string | null; - /** - * User-provided name supplied at session construction (via `--name`), if any. Immutable after construction. - */ - initialName?: string; - /** - * Runtime client name associated with the session (telemetry identifier). - */ - clientName?: string; - remoteMetadata?: MetadataSnapshotRemoteMetadata; - /** - * Short human-readable summary of the session, if known. Omitted when no summary has been generated. - */ - summary?: string; - /** - * Absolute path to the session's current working directory - */ - workingDirectory: string; - currentMode: MetadataSnapshotCurrentMode; - /** - * Currently selected model identifier, if any - */ - selectedModel?: string; - /** - * Current session limits, or null when no limits are active - */ - sessionLimits: SessionLimitsConfig | null; - /** - * Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags). - */ - workspace?: WorkspaceSummary | null; + /** + * The unique identifier of the session + */ + sessionId: string; + /** + * ISO 8601 timestamp of when the session started + */ + startTime: string; + /** + * ISO 8601 timestamp of when the session's persisted state was last modified on disk. For new sessions, equals startTime. For resumed sessions, reflects the previous modification time at construction. + */ + modifiedTime: string; + /** + * Whether this is a remote session (i.e., one whose runtime executes elsewhere and is steered through this process) + */ + isRemote: boolean; + /** + * True when the session was detected to be in use by another process at construction time. Local consumers may surface a confirmation prompt before fully attaching. Always false for new sessions. + */ + alreadyInUse: boolean; + /** + * Absolute path to the session's workspace directory on disk, or null if the session has no associated workspace + */ + workspacePath: string | null; + /** + * User-provided name supplied at session construction (via `--name`), if any. Immutable after construction. + */ + initialName?: string; + /** + * Runtime client name associated with the session (telemetry identifier). + */ + clientName?: string; + remoteMetadata?: MetadataSnapshotRemoteMetadata; + /** + * Short human-readable summary of the session, if known. Omitted when no summary has been generated. + */ + summary?: string; + /** + * Absolute path to the session's current working directory + */ + workingDirectory: string; + currentMode: MetadataSnapshotCurrentMode; + /** + * Currently selected model identifier, if any + */ + selectedModel?: string; + /** + * Current session limits, or null when no limits are active + */ + sessionLimits: SessionLimitsConfig | null; + /** + * Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags). + */ + workspace?: WorkspaceSummary | null; } /** * The list of models available to this session. @@ -18232,20 +18584,20 @@ export interface SessionMetadataSnapshot { */ /** @experimental */ export interface SessionModelList { - /** - * 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`). - */ - list: JsonValue[]; - /** - * Cost categories for the full CAPI catalog, including picker-disabled models that Auto may select. Metadata only; entries absent from `list` are not manually selectable. - */ - modelPriceCategories?: SessionModelPriceCategory[]; - /** - * Per-quota snapshots returned alongside the model list, keyed by quota type. - */ - quotaSnapshots?: { - [k: string]: JsonValue | undefined; - }; + /** + * 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`). + */ + list: JsonValue[]; + /** + * Cost categories for the full CAPI catalog, including picker-disabled models that Auto may select. Metadata only; entries absent from `list` are not manually selectable. + */ + modelPriceCategories?: SessionModelPriceCategory[]; + /** + * Per-quota snapshots returned alongside the model list, keyed by quota type. + */ + quotaSnapshots?: { + [k: string]: JsonValue | undefined; + }; } /** * Cost-category metadata for a CAPI model. @@ -18255,11 +18607,11 @@ export interface SessionModelList { */ /** @experimental */ export interface SessionModelPriceCategory { - /** - * CAPI model identifier. - */ - id: string; - priceCategory: ModelPickerPriceCategory; + /** + * CAPI model identifier. + */ + id: string; + priceCategory: ModelPickerPriceCategory; } /** * Session construction options. @@ -18269,269 +18621,273 @@ export interface SessionModelPriceCategory { */ /** @experimental */ export interface SessionOpenOptions { - /** - * Optional stable session identifier to use for a new session. - */ - sessionId?: string; - /** - * Optional human-friendly session name. - */ - name?: string; - /** - * Initial model identifier. - */ - model?: string; - /** - * Initial reasoning effort level. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. When omitted, no effort override is applied. - */ - reasoningEffort?: string; - reasoningSummary?: SessionOpenOptionsReasoningSummary; - verbosity?: Verbosity; - /** - * Identifier of the client driving the session. - */ - clientName?: string; - /** - * Structured client kind used for runtime behavior gates. - */ - clientKind?: string; - /** - * Identifier sent to LSP-style integrations. - */ - lspClientName?: string; - /** - * Stable integration identifier for analytics. - */ - integrationId?: string; - /** - * 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. - * - * @internal - */ - expAssignments?: JsonValue; - /** - * Opt-in: self-fetch and enforce enterprise managed settings at session bootstrap. - */ - enableManagedSettings?: boolean; - managedSettings?: SessionManagedSettings; - /** - * Opt in to capturing file changes for session rewind and session diff. Capture cannot reconstruct changes made before it was enabled. On create it starts capture from the first turn. It is also honored on resume: for a session that already has tracked prior turns, tracking continues automatically even if this is omitted; passing it on resume additionally enables tracking for an eligible session that has no prior root turn yet. Resuming a session whose prior root turns were never tracked has no restorable baseline, so tracking stays disabled for it and rewind reports file change tracking as unavailable; the resume itself still succeeds, so sessions that predate tracking remain loadable. The opt-in is only rejected when the session can never track (a subagent session, or one without local session storage). It is intentionally absent from the mutable options update because enabling it after edits have occurred would create an incomplete, misleading baseline. Subagents share the parent session's capture store and are not tracked as separate rewind points: a file a subagent writes is attributed to whichever root user turn was open when the capture was staged, just before the tool body ran. A turn cannot open while a staged capture is still in flight, so a subagent tool that staged under the spawning turn stays attributed to it however late the write lands, while a capture it stages after the user's next message belongs to that later turn. Attribution decides which turn's rewind point counts and file preview include that write; it does not narrow which rewinds revert it, because a rewind restores every capture from the selected turn onward, so the earlier spawning turn reverts it as well. - */ - enableFileChangeTracking?: boolean; - /** - * Feature-flag values resolved by the host. - */ - featureFlags?: { - [k: string]: boolean | undefined; - }; - /** - * Whether experimental behavior is enabled. - */ - isExperimentalMode?: boolean; - authInfo?: AuthInfo; - provider?: ProviderConfig; - capi?: CapiSessionOptions; - /** - * Named BYOK provider connections, additive to CAPI auth. Combining with `provider` is rejected. - * - * @experimental - */ - providers?: NamedProviderConfig[]; - /** - * BYOK model definitions added to the selectable model list, each referencing a provider name. - * - * @experimental - */ - models?: ProviderModelConfig[]; - /** - * Working directory to anchor the session. - */ - workingDirectory?: string; - /** - * Additional directories the agent may access beyond the working directory. Each entry is granted to the session's file-access allow-list and surfaced to the model (system prompt context and `@`-mention completion). Conventional `.github/skills/` and `.github/agents/` definitions under each directory also join the session's project catalogs when their existing subsystem gates are enabled: added-root skills require both `enableConfigDiscovery` and effective `enableSkills`; added-root agents require `enableConfigDiscovery`. Supplying a directory therefore activates configuration from it and should be treated as a trust decision. Absolute paths are recommended; a relative path is resolved against the session's working directory. Nonexistent or unresolvable entries are skipped with a warning. This is applied during session creation and cold resume and is not persisted, so a cold resume must re-supply the directories. - */ - additionalDirectories?: string[]; - workingDirectoryContext?: SessionContext; - /** - * Whether this session supports remote steering. - */ - remoteSteerable?: boolean; - /** - * Telemetry-only remote exporting flag. - */ - remoteExporting?: boolean; - /** - * Telemetry-only remote-defaulted flag. - */ - remoteDefaultedOn?: boolean; - /** - * Parent session ID for detached child telemetry rollup. - */ - detachedFromSpawningParentSessionId?: string; - /** - * Parent engagement ID for detached child telemetry rollup. - */ - detachedFromSpawningParentEngagementId?: string; - /** - * Allowlist of available tool names. - */ - availableTools?: string[]; - /** - * Denylist of tool names. - */ - excludedTools?: string[]; - /** - * Built-in subagent names to include in this session. When specified, only these built-ins are available, subject to runtime availability and exclusions. Custom agents with the same name remain available. - */ - includedBuiltinAgents?: string[]; - /** - * Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. - */ - excludedBuiltinAgents?: string[]; - /** - * Whether shell-script safety heuristics are enabled. - */ - enableScriptSafety?: boolean; - shell?: ShellOptions; - /** - * @deprecated - * Use shell.initProfile instead. Shell init profile. - */ - shellInitProfile?: string; - /** - * PowerShell process flags applied to built-in and user-requested shell commands. - */ - shellProcessFlags?: string[]; - sandboxConfig?: SandboxConfig; - /** - * Origin of the sandbox choice. The runtime uses this only for internal telemetry provenance; managed policy is derived independently. - * - * @internal - */ - sandboxConfigSource?: SandboxConfigSource; - /** - * Whether interactive shell sessions are logged. - */ - logInteractiveShells?: boolean; - envValueMode?: SessionOpenOptionsEnvValueMode; - /** - * MCP server names disabled for this session. Disabled servers are not started or authenticated on create or cold resume. - */ - disabledMcpServers?: string[]; - /** - * Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers. - */ - allowAllMcpServerInstructions?: boolean; - /** - * Additional directories to search for skills. - */ - skillDirectories?: string[]; - /** - * Whether skill loading is enabled. When omitted, an SDK skill provider enables skills by default. - */ - enableSkills?: boolean; - /** - * Whether the requesting SDK session has a skill provider. The provider remains ephemeral and is never persisted in session options or history. When enableSkills is false, it remains bound but dormant and receives no callbacks. Cloud, relay, handoff, and raw sessions.open flows reject it because they cannot safely pre-register the callback handler. - * - * @internal - * @experimental - */ - hasSkillProvider?: boolean; - /** - * Built-in skill names to include in this session. When specified, only these runtime-bundled skills are available. Skills from other sources with the same name remain available. - */ - includedBuiltinSkills?: string[]; - /** - * Skill IDs disabled for this session. - */ - disabledSkills?: string[]; - /** - * Installed plugins visible to the session. - */ - installedPlugins?: InstalledPlugin[]; - /** - * Whether custom agents default to local-only execution. - */ - customAgentsLocalOnly?: boolean; - /** - * Whether to skip custom instruction sources. - */ - skipCustomInstructions?: boolean; - /** - * Instruction source IDs disabled for this session. - */ - disabledInstructionSources?: string[]; - /** - * Whether commit-message coauthor trailers are enabled. - */ - coauthorEnabled?: boolean; - /** - * Optional trajectory output file path. - */ - trajectoryFile?: string; - /** - * Whether model responses stream as delta events. - */ - enableStreaming?: boolean; - /** - * Experimental: enable native model citations for supported Anthropic and OpenAI models, normalized onto the `assistant.message` event. Off by default; may change or be removed while the citations surface is experimental. - * - * @experimental - */ - enableCitations?: boolean; - /** - * Override URL for the Copilot API endpoint. - */ - copilotUrl?: string; - /** - * Whether ask_user is explicitly disabled. - */ - askUserDisabled?: boolean; - /** - * Whether auto-mode continuation is enabled. - */ - continueOnAutoMode?: boolean; - /** - * Whether the host is an interactive UI. - */ - runningInInteractiveMode?: boolean; - /** - * Whether on-demand custom instruction discovery is enabled. - */ - enableOnDemandInstructionDiscovery?: boolean; - /** - * Maximum decoded byte size of a single inline model-facing binary tool result persisted in session events (default 10 MB). - */ - maxInlineBinaryBytes?: number; - modelCapabilitiesOverrides?: ModelCapabilitiesOverride; - sessionLimits?: SessionLimitsConfig; - /** - * Runtime context discriminator for agent filtering. - */ - agentContext?: string; - /** - * Override directory for session event logs. - */ - eventsLogDirectory?: string; - /** - * Whether subagent callback events should be forwarded into the session event log sink. - */ - eventsLogIncludesSubagents?: boolean; - /** - * Override Copilot configuration directory. - */ - configDir?: string; - /** - * Additional content-exclusion policies to merge into the session policy set. - * - * @experimental - */ - additionalContentExclusionPolicies?: SessionOpenOptionsAdditionalContentExclusionPolicy[]; - memory?: MemoryConfiguration; - /** - * Capabilities enabled for this session. - */ - sessionCapabilities?: SessionCapability[]; + /** + * Optional stable session identifier to use for a new session. + */ + sessionId?: string; + /** + * Optional human-friendly session name. + */ + name?: string; + /** + * Initial model identifier. + */ + model?: string; + /** + * Initial reasoning effort level. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. When omitted, no effort override is applied. + */ + reasoningEffort?: string; + reasoningSummary?: SessionOpenOptionsReasoningSummary; + verbosity?: Verbosity; + /** + * Identifier of the client driving the session. + */ + clientName?: string; + /** + * OAuth Client ID Metadata Document URL used by this host for MCP authorization. + */ + authClientIdMetadataUrl?: string; + /** + * Structured client kind used for runtime behavior gates. + */ + clientKind?: string; + /** + * Identifier sent to LSP-style integrations. + */ + lspClientName?: string; + /** + * Stable integration identifier for analytics. + */ + integrationId?: string; + /** + * 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. + * + * @internal + */ + expAssignments?: JsonValue; + /** + * Opt-in: self-fetch and enforce enterprise managed settings at session bootstrap. + */ + enableManagedSettings?: boolean; + managedSettings?: SessionManagedSettings; + /** + * Opt in to capturing file changes for session rewind and session diff. Capture cannot reconstruct changes made before it was enabled. On create it starts capture from the first turn. It is also honored on resume: for a session that already has tracked prior turns, tracking continues automatically even if this is omitted; passing it on resume additionally enables tracking for an eligible session that has no prior root turn yet. Resuming a session whose prior root turns were never tracked has no restorable baseline, so tracking stays disabled for it and rewind reports file change tracking as unavailable; the resume itself still succeeds, so sessions that predate tracking remain loadable. The opt-in is only rejected when the session can never track (a subagent session, or one without local session storage). It is intentionally absent from the mutable options update because enabling it after edits have occurred would create an incomplete, misleading baseline. Subagents share the parent session's capture store and are not tracked as separate rewind points: a file a subagent writes is attributed to whichever root user turn was open when the capture was staged, just before the tool body ran. A turn cannot open while a staged capture is still in flight, so a subagent tool that staged under the spawning turn stays attributed to it however late the write lands, while a capture it stages after the user's next message belongs to that later turn. Attribution decides which turn's rewind point counts and file preview include that write; it does not narrow which rewinds revert it, because a rewind restores every capture from the selected turn onward, so the earlier spawning turn reverts it as well. + */ + enableFileChangeTracking?: boolean; + /** + * Feature-flag values resolved by the host. + */ + featureFlags?: { + [k: string]: boolean | undefined; + }; + /** + * Whether experimental behavior is enabled. + */ + isExperimentalMode?: boolean; + authInfo?: AuthInfo; + provider?: ProviderConfig; + capi?: CapiSessionOptions; + /** + * Named BYOK provider connections, additive to CAPI auth. Combining with `provider` is rejected. + * + * @experimental + */ + providers?: NamedProviderConfig[]; + /** + * BYOK model definitions added to the selectable model list, each referencing a provider name. + * + * @experimental + */ + models?: ProviderModelConfig[]; + /** + * Working directory to anchor the session. + */ + workingDirectory?: string; + /** + * Additional directories the agent may access beyond the working directory. Each entry is granted to the session's file-access allow-list and surfaced to the model (system prompt context and `@`-mention completion). Conventional `.github/skills/` and `.github/agents/` definitions under each directory also join the session's project catalogs when their existing subsystem gates are enabled: added-root skills require both `enableConfigDiscovery` and effective `enableSkills`; added-root agents require `enableConfigDiscovery`. Supplying a directory therefore activates configuration from it and should be treated as a trust decision. Absolute paths are recommended; a relative path is resolved against the session's working directory. Nonexistent or unresolvable entries are skipped with a warning. This is applied during session creation and cold resume and is not persisted, so a cold resume must re-supply the directories. + */ + additionalDirectories?: string[]; + workingDirectoryContext?: SessionContext; + /** + * Whether this session supports remote steering. + */ + remoteSteerable?: boolean; + /** + * Telemetry-only remote exporting flag. + */ + remoteExporting?: boolean; + /** + * Telemetry-only remote-defaulted flag. + */ + remoteDefaultedOn?: boolean; + /** + * Parent session ID for detached child telemetry rollup. + */ + detachedFromSpawningParentSessionId?: string; + /** + * Parent engagement ID for detached child telemetry rollup. + */ + detachedFromSpawningParentEngagementId?: string; + /** + * Allowlist of available tool names. + */ + availableTools?: string[]; + /** + * Denylist of tool names. + */ + excludedTools?: string[]; + /** + * Built-in subagent names to include in this session. When specified, only these built-ins are available, subject to runtime availability and exclusions. Custom agents with the same name remain available. + */ + includedBuiltinAgents?: string[]; + /** + * Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. + */ + excludedBuiltinAgents?: string[]; + /** + * Whether shell-script safety heuristics are enabled. + */ + enableScriptSafety?: boolean; + shell?: ShellOptions; + /** + * @deprecated + * Use shell.initProfile instead. Shell init profile. + */ + shellInitProfile?: string; + /** + * PowerShell process flags applied to built-in and user-requested shell commands. + */ + shellProcessFlags?: string[]; + sandboxConfig?: SandboxConfig; + /** + * Origin of the sandbox choice. The runtime uses this only for internal telemetry provenance; managed policy is derived independently. + * + * @internal + */ + sandboxConfigSource?: SandboxConfigSource; + /** + * Whether interactive shell sessions are logged. + */ + logInteractiveShells?: boolean; + envValueMode?: SessionOpenOptionsEnvValueMode; + /** + * MCP server names disabled for this session. Disabled servers are not started or authenticated on create or cold resume. + */ + disabledMcpServers?: string[]; + /** + * Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers. + */ + allowAllMcpServerInstructions?: boolean; + /** + * Additional directories to search for skills. + */ + skillDirectories?: string[]; + /** + * Whether skill loading is enabled. When omitted, an SDK skill provider enables skills by default. + */ + enableSkills?: boolean; + /** + * Whether the requesting SDK session has a skill provider. The provider remains ephemeral and is never persisted in session options or history. When enableSkills is false, it remains bound but dormant and receives no callbacks. Cloud, relay, handoff, and raw sessions.open flows reject it because they cannot safely pre-register the callback handler. + * + * @internal + * @experimental + */ + hasSkillProvider?: boolean; + /** + * Built-in skill names to include in this session. When specified, only these runtime-bundled skills are available. Skills from other sources with the same name remain available. + */ + includedBuiltinSkills?: string[]; + /** + * Skill IDs disabled for this session. + */ + disabledSkills?: string[]; + /** + * Installed plugins visible to the session. + */ + installedPlugins?: InstalledPlugin[]; + /** + * Whether custom agents default to local-only execution. + */ + customAgentsLocalOnly?: boolean; + /** + * Whether to skip custom instruction sources. + */ + skipCustomInstructions?: boolean; + /** + * Instruction source IDs disabled for this session. + */ + disabledInstructionSources?: string[]; + /** + * Whether commit-message coauthor trailers are enabled. + */ + coauthorEnabled?: boolean; + /** + * Optional trajectory output file path. + */ + trajectoryFile?: string; + /** + * Whether model responses stream as delta events. + */ + enableStreaming?: boolean; + /** + * Experimental: enable native model citations for supported Anthropic and OpenAI models, normalized onto the `assistant.message` event. Off by default; may change or be removed while the citations surface is experimental. + * + * @experimental + */ + enableCitations?: boolean; + /** + * Override URL for the Copilot API endpoint. + */ + copilotUrl?: string; + /** + * Whether ask_user is explicitly disabled. + */ + askUserDisabled?: boolean; + /** + * Whether auto-mode continuation is enabled. + */ + continueOnAutoMode?: boolean; + /** + * Whether the host is an interactive UI. + */ + runningInInteractiveMode?: boolean; + /** + * Whether on-demand custom instruction discovery is enabled. + */ + enableOnDemandInstructionDiscovery?: boolean; + /** + * Maximum decoded byte size of a single inline model-facing binary tool result persisted in session events (default 10 MB). + */ + maxInlineBinaryBytes?: number; + modelCapabilitiesOverrides?: ModelCapabilitiesOverride; + sessionLimits?: SessionLimitsConfig; + /** + * Runtime context discriminator for agent filtering. + */ + agentContext?: string; + /** + * Override directory for session event logs. + */ + eventsLogDirectory?: string; + /** + * Whether subagent callback events should be forwarded into the session event log sink. + */ + eventsLogIncludesSubagents?: boolean; + /** + * Override Copilot configuration directory. + */ + configDir?: string; + /** + * Additional content-exclusion policies to merge into the session policy set. + * + * @experimental + */ + additionalContentExclusionPolicies?: SessionOpenOptionsAdditionalContentExclusionPolicy[]; + memory?: MemoryConfiguration; + /** + * Capabilities enabled for this session. + */ + sessionCapabilities?: SessionCapability[]; } /** * Per-session settings for built-in shell tools. @@ -18541,26 +18897,26 @@ export interface SessionOpenOptions { */ /** @experimental */ export interface ShellOptions { - initProfile?: ShellInitProfile; - /** - * Ordered host-provided script paths sourced before each built-in shell command when the - * entry's shell target matches the active shell. Use these for rc files, environment setup scripts, - * or other custom scripts. A script that returns a nonzero status is reported, and later scripts - * and the user command continue while the shell remains running. Because scripts are sourced into - * the command shell, `exit`, `exec`, failures under `set -e`, or other shell-terminating behavior - * can prevent continuation. Script standard output is preserved; Bash script stderr is discarded, - * PowerShell exception messages are replaced, and runtime-generated failure notices omit - * configured script paths. When sandboxing is enabled, each script must already be readable under - * the active sandbox filesystem policy. Pass an empty array to clear the list. - */ - initScripts?: ShellInitScript[]; - /** - * Flags passed to the active built-in shell process on startup, replacing its default flags. - * When omitted, the built-in Bash shell uses `--norc --noprofile`, - * and the built-in PowerShell shell uses `-NoProfile -NoLogo`. - */ - processFlags?: string[]; - credentials?: ShellCredentials; + initProfile?: ShellInitProfile; + /** + * Ordered host-provided script paths sourced before each built-in shell command when the + * entry's shell target matches the active shell. Use these for rc files, environment setup scripts, + * or other custom scripts. A script that returns a nonzero status is reported, and later scripts + * and the user command continue while the shell remains running. Because scripts are sourced into + * the command shell, `exit`, `exec`, failures under `set -e`, or other shell-terminating behavior + * can prevent continuation. Script standard output is preserved; Bash script stderr is discarded, + * PowerShell exception messages are replaced, and runtime-generated failure notices omit + * configured script paths. When sandboxing is enabled, each script must already be readable under + * the active sandbox filesystem policy. Pass an empty array to clear the list. + */ + initScripts?: ShellInitScript[]; + /** + * Flags passed to the active built-in shell process on startup, replacing its default flags. + * When omitted, the built-in Bash shell uses `--norc --noprofile`, + * and the built-in PowerShell shell uses `-NoProfile -NoLogo`. + */ + processFlags?: string[]; + credentials?: ShellCredentials; } /** * A host-provided script sourced before each built-in shell command when its shell target matches the active shell. @@ -18570,11 +18926,11 @@ export interface ShellOptions { */ /** @experimental */ export interface ShellInitScript { - /** - * Path to the script to source. - */ - path: string; - shell: ShellInitScriptShell; + /** + * Path to the script to source. + */ + path: string; + shell: ShellInitScriptShell; } /** * Command-scoped GitHub credential injection for the shell commands an agent runs. @@ -18600,26 +18956,26 @@ export interface ShellInitScript { */ /** @experimental */ export interface ShellCredentials { - /** - * Whether to authenticate the agent's `git` commands as the session's GitHub credential, by - * injecting an `http..extraheader` (plus `insteadOf` rewrites so SSH-spelled remotes for - * that host use the authenticated HTTPS transport). Applied only to a spawn that runs a - * remote-contacting `git` subcommand. Default: false (opt-in). - */ - git?: boolean; - /** - * Whether to authenticate the agent's `gh` commands as the session's GitHub credential, by - * exporting `GH_TOKEN` to a spawn that runs `gh`. Any inherited `gh` credential is removed from - * spawns that do not, so the credential stays command-scoped. - * - * Applies to a github.com credential only. `gh` picks its credential variable from the host a - * command targets rather than the one the credential belongs to, and the command can choose that - * target, so `GH_ENTERPRISE_TOKEN` would offer a single-tenant enterprise credential to every - * other enterprise host. A session whose credential is enterprise-scoped therefore runs `gh` - * unauthenticated; its `git` commands are unaffected, because `http..extraheader` is scoped - * to one host by construction. Default: false (opt-in). - */ - gh?: boolean; + /** + * Whether to authenticate the agent's `git` commands as the session's GitHub credential, by + * injecting an `http..extraheader` (plus `insteadOf` rewrites so SSH-spelled remotes for + * that host use the authenticated HTTPS transport). Applied only to a spawn that runs a + * remote-contacting `git` subcommand. Default: false (opt-in). + */ + git?: boolean; + /** + * Whether to authenticate the agent's `gh` commands as the session's GitHub credential, by + * exporting `GH_TOKEN` to a spawn that runs `gh`. Any inherited `gh` credential is removed from + * spawns that do not, so the credential stays command-scoped. + * + * Applies to a github.com credential only. `gh` picks its credential variable from the host a + * command targets rather than the one the credential belongs to, and the command can choose that + * target, so `GH_ENTERPRISE_TOKEN` would offer a single-tenant enterprise credential to every + * other enterprise host. A session whose credential is enterprise-scoped therefore runs `gh` + * unauthenticated; its `git` commands are unaffected, because `http..extraheader` is scoped + * to one host by construction. Default: false (opt-in). + */ + gh?: boolean; } /** * Content-exclusion policy supplied to `sessions.open` options, with rules, last-updated data, and scope. @@ -18629,15 +18985,15 @@ export interface ShellCredentials { */ /** @experimental */ export interface SessionOpenOptionsAdditionalContentExclusionPolicy { - /** - * Content-exclusion rules to apply. - */ - rules: SessionOpenOptionsAdditionalContentExclusionPolicyRule[]; - /** - * Opaque policy update timestamp supplied by the host. - */ - last_updated_at: JsonValue; - scope: SessionOpenOptionsAdditionalContentExclusionPolicyScope; + /** + * Content-exclusion rules to apply. + */ + rules: SessionOpenOptionsAdditionalContentExclusionPolicyRule[]; + /** + * Opaque policy update timestamp supplied by the host. + */ + last_updated_at: JsonValue; + scope: SessionOpenOptionsAdditionalContentExclusionPolicyScope; } /** * Single content-exclusion rule supplied to `sessions.open` options, with paths, match conditions, and source. @@ -18647,19 +19003,19 @@ export interface SessionOpenOptionsAdditionalContentExclusionPolicy { */ /** @experimental */ export interface SessionOpenOptionsAdditionalContentExclusionPolicyRule { - /** - * Path patterns covered by this rule. - */ - paths: string[]; - /** - * Conditions of which at least one must match. - */ - ifAnyMatch?: string[]; - /** - * Conditions none of which may match. - */ - ifNoneMatch?: string[]; - source: SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource; + /** + * Path patterns covered by this rule. + */ + paths: string[]; + /** + * Conditions of which at least one must match. + */ + ifAnyMatch?: string[]; + /** + * Conditions none of which may match. + */ + ifNoneMatch?: string[]; + source: SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource; } /** * Source descriptor for a `sessions.open` content-exclusion rule, with source name and type. @@ -18669,14 +19025,14 @@ export interface SessionOpenOptionsAdditionalContentExclusionPolicyRule { */ /** @experimental */ export interface SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource { - /** - * Name of the policy source. - */ - name: string; - /** - * Type of the policy source. - */ - type: string; + /** + * Name of the policy source. + */ + name: string; + /** + * Type of the policy source. + */ + type: string; } /** * Parameters for creating a new local session. @@ -18686,15 +19042,15 @@ export interface SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource { */ /** @experimental */ export interface SessionsOpenCreate { - /** - * Create a new local session. - */ - kind: "create"; - options?: SessionOpenOptions; - /** - * Whether to emit session.start during creation. Defaults to true. - */ - emitStart?: boolean; + /** + * Create a new local session. + */ + kind: "create"; + options?: SessionOpenOptions; + /** + * Whether to emit session.start during creation. Defaults to true. + */ + emitStart?: boolean; } /** * Parameters for resuming a specific local session. @@ -18704,23 +19060,23 @@ export interface SessionsOpenCreate { */ /** @experimental */ export interface SessionsOpenResume { - /** - * Resume a specific local session by ID or prefix. - */ - kind: "resume"; - /** - * Session ID or unique prefix to resume. - */ - sessionId: string; - options?: SessionOpenOptions; - /** - * Whether to emit session.resume after loading. Defaults to true. - */ - resume?: boolean; - /** - * Suppress workspace.yaml metadata writeback when resuming from an incidental cwd. - */ - suppressResumeWorkspaceMetadataWriteback?: boolean; + /** + * Resume a specific local session by ID or prefix. + */ + kind: "resume"; + /** + * Session ID or unique prefix to resume. + */ + sessionId: string; + options?: SessionOpenOptions; + /** + * Whether to emit session.resume after loading. Defaults to true. + */ + resume?: boolean; + /** + * Suppress workspace.yaml metadata writeback when resuming from an incidental cwd. + */ + suppressResumeWorkspaceMetadataWriteback?: boolean; } /** * Parameters for resuming the most relevant local session. @@ -18730,16 +19086,16 @@ export interface SessionsOpenResume { */ /** @experimental */ export interface SessionsOpenResumeLast { - /** - * Resume the most relevant existing local session. - */ - kind: "resumeLast"; - context?: SessionContext; - options?: SessionOpenOptions; - /** - * Suppress workspace.yaml metadata writeback when resuming from an incidental cwd. - */ - suppressResumeWorkspaceMetadataWriteback?: boolean; + /** + * Resume the most relevant existing local session. + */ + kind: "resumeLast"; + context?: SessionContext; + options?: SessionOpenOptions; + /** + * Suppress workspace.yaml metadata writeback when resuming from an incidental cwd. + */ + suppressResumeWorkspaceMetadataWriteback?: boolean; } /** * Parameters for attaching to an already-active session by ID. @@ -18749,14 +19105,14 @@ export interface SessionsOpenResumeLast { */ /** @experimental */ export interface SessionsOpenAttach { - /** - * Attach to an already-active in-process session by ID. Unlike `resume`, this does NOT re-load from disk; the session must already be loaded by an earlier `create`/`resume` call. Returns `status: 'not_found'` when no active session matches the id. Useful for in-process consumers that need a fresh API handle to a session opened elsewhere (e.g., a peer foreground-session switch). - */ - kind: "attach"; - /** - * Session ID to attach to. - */ - sessionId: string; + /** + * Attach to an already-active in-process session by ID. Unlike `resume`, this does NOT re-load from disk; the session must already be loaded by an earlier `create`/`resume` call. Returns `status: 'not_found'` when no active session matches the id. Useful for in-process consumers that need a fresh API handle to a session opened elsewhere (e.g., a peer foreground-session switch). + */ + kind: "attach"; + /** + * Session ID to attach to. + */ + sessionId: string; } /** * Parameters for connecting to a live remote session. @@ -18766,16 +19122,16 @@ export interface SessionsOpenAttach { */ /** @experimental */ export interface SessionsOpenRemote { - /** - * Connect to a live remote session. - */ - kind: "remote"; - /** - * Remote session identifier to connect to. - */ - remoteSessionId: string; - repository?: RemoteSessionRepository; - options?: SessionOpenOptions; + /** + * Connect to a live remote session. + */ + kind: "remote"; + /** + * Remote session identifier to connect to. + */ + remoteSessionId: string; + repository?: RemoteSessionRepository; + options?: SessionOpenOptions; } /** * Parameters for creating a new cloud session. @@ -18785,22 +19141,22 @@ export interface SessionsOpenRemote { */ /** @experimental */ export interface SessionsOpenCloud { - /** - * Create a new cloud (coding-agent) session. - */ - kind: "cloud"; - repository?: RemoteSessionRepository; - /** - * Optional owner (user or organization login) to associate with the cloud session when no repository is provided. Ignored when `repository` is set (the repo's owner takes precedence). - */ - owner?: string; - options?: SessionOpenOptions; - /** - * In-process callback invoked when the cloud task is created, before connection. Internal because function references cannot cross the JSON-RPC boundary. - * - * @internal - */ - onTaskCreated?: OpaqueInProcessValue; + /** + * Create a new cloud (coding-agent) session. + */ + kind: "cloud"; + repository?: RemoteSessionRepository; + /** + * Optional owner (user or organization login) to associate with the cloud session when no repository is provided. Ignored when `repository` is set (the repo's owner takes precedence). + */ + owner?: string; + options?: SessionOpenOptions; + /** + * In-process callback invoked when the cloud task is created, before connection. Internal because function references cannot cross the JSON-RPC boundary. + * + * @internal + */ + onTaskCreated?: OpaqueInProcessValue; } /** * Parameters for fetching a remote session and handing it off to a new local session. @@ -18810,25 +19166,25 @@ export interface SessionsOpenCloud { */ /** @experimental */ export interface SessionsOpenHandoff { - /** - * Fetch a remote session and hand it off to a new local session. - */ - kind: "handoff"; - metadata: RemoteSessionMetadataValue; - options?: SessionOpenOptions; - taskType?: SessionsOpenHandoffTaskType; - /** - * 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. - * - * @internal - */ - onProgress?: OpaqueInProcessValue; - /** - * In-process confirmation callback `(request) => boolean | Promise` invoked when the handoff needs the caller to confirm a non-fatal blocker (e.g. a repository mismatch between the current working directory and the remote session). Returning `true` proceeds with the handoff; returning `false` (or omitting the callback) aborts it. Marked internal because a function reference cannot cross the JSON-RPC boundary, for the same reasons as `onProgress`. - * - * @internal - */ - onConfirm?: OpaqueInProcessValue; + /** + * Fetch a remote session and hand it off to a new local session. + */ + kind: "handoff"; + metadata: RemoteSessionMetadataValue; + options?: SessionOpenOptions; + taskType?: SessionsOpenHandoffTaskType; + /** + * 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. + * + * @internal + */ + onProgress?: OpaqueInProcessValue; + /** + * In-process confirmation callback `(request) => boolean | Promise` invoked when the handoff needs the caller to confirm a non-fatal blocker (e.g. a repository mismatch between the current working directory and the remote session). Returning `true` proceeds with the handoff; returning `false` (or omitting the callback) aborts it. Marked internal because a function reference cannot cross the JSON-RPC boundary, for the same reasons as `onProgress`. + * + * @internal + */ + onConfirm?: OpaqueInProcessValue; } /** * Result of opening a session. @@ -18838,32 +19194,32 @@ export interface SessionsOpenHandoff { */ /** @experimental */ export interface SessionOpenResult { - status: SessionsOpenStatus; - /** - * Opened session ID. Omitted when status is `not_found`. - */ - sessionId?: string; - /** - * 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. - * - * @internal - * - * @internal - */ - sessionApi?: OpaqueInProcessValue; - /** - * Startup prompts queued by user-level hook configs at session creation. Only populated when status is `created`; resumed sessions return an empty array. - */ - startupPrompts?: string[]; - /** - * Remote session ID, present when status is `connected`. - */ - remoteSessionId?: string; - metadata?: RemoteSessionMetadataValue; - /** - * Handoff progress steps, present when status is `handed_off`. - */ - progress?: SessionsOpenProgress[]; + status: SessionsOpenStatus; + /** + * Opened session ID. Omitted when status is `not_found`. + */ + sessionId?: string; + /** + * 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. + * + * @internal + * + * @internal + */ + sessionApi?: OpaqueInProcessValue; + /** + * Startup prompts queued by user-level hook configs at session creation. Only populated when status is `created`; resumed sessions return an empty array. + */ + startupPrompts?: string[]; + /** + * Remote session ID, present when status is `connected`. + */ + remoteSessionId?: string; + metadata?: RemoteSessionMetadataValue; + /** + * Handoff progress steps, present when status is `handed_off`. + */ + progress?: SessionsOpenProgress[]; } /** * `sessions.open` handoff progress update with step, status, and optional message. @@ -18873,12 +19229,12 @@ export interface SessionOpenResult { */ /** @experimental */ export interface SessionsOpenProgress { - step: SessionsOpenProgressStep; - status: SessionsOpenProgressStatus; - /** - * Optional step message. - */ - message?: string; + step: SessionsOpenProgressStep; + status: SessionsOpenProgressStatus; + /** + * Optional step message. + */ + message?: string; } /** * Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag. @@ -18888,26 +19244,26 @@ export interface SessionsOpenProgress { */ /** @experimental */ export interface SessionPruneResult { - /** - * Session IDs that were deleted (always empty in dry-run mode) - */ - deleted: string[]; - /** - * Session IDs that would be deleted in dry-run mode (always empty otherwise) - */ - candidates: string[]; - /** - * Session IDs that were skipped (e.g., named sessions) - */ - skipped: string[]; - /** - * Total bytes freed (actual when not dry-run, projected when dry-run) - */ - freedBytes: number; - /** - * True when no deletions were actually performed - */ - dryRun: boolean; + /** + * Session IDs that were deleted (always empty in dry-run mode) + */ + deleted: string[]; + /** + * Session IDs that would be deleted in dry-run mode (always empty otherwise) + */ + candidates: string[]; + /** + * Session IDs that were skipped (e.g., named sessions) + */ + skipped: string[]; + /** + * Total bytes freed (actual when not dry-run, projected when dry-run) + */ + freedBytes: number; + /** + * True when no deletions were actually performed + */ + dryRun: boolean; } /** * Session IDs to close, deactivate, and delete from disk. @@ -18917,10 +19273,10 @@ export interface SessionPruneResult { */ /** @experimental */ export interface SessionsBulkDeleteRequest { - /** - * Session IDs to close, deactivate, and delete from disk - */ - sessionIds: string[]; + /** + * Session IDs to close, deactivate, and delete from disk + */ + sessionIds: string[]; } /** * Session IDs to test for live in-use locks. @@ -18930,10 +19286,10 @@ export interface SessionsBulkDeleteRequest { */ /** @experimental */ export interface SessionsCheckInUseRequest { - /** - * Session IDs to test for live in-use locks - */ - sessionIds: string[]; + /** + * Session IDs to test for live in-use locks + */ + sessionIds: string[]; } /** * Session IDs from the input set that are currently in use by another process. @@ -18943,10 +19299,10 @@ export interface SessionsCheckInUseRequest { */ /** @experimental */ export interface SessionsCheckInUseResult { - /** - * Session IDs from the input set that are currently held by another running process via an alive lock file - */ - inUse: string[]; + /** + * Session IDs from the input set that are currently held by another running process via an alive lock file + */ + inUse: string[]; } /** * Session ID to close. @@ -18956,10 +19312,10 @@ export interface SessionsCheckInUseResult { */ /** @experimental */ export interface SessionsCloseRequest { - /** - * Session ID to close - */ - sessionId: string; + /** + * Session ID to close + */ + sessionId: string; } /** * Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active. @@ -18977,14 +19333,14 @@ export interface SessionsCloseResult {} */ /** @experimental */ export interface SessionsDeleteRequest { - /** - * Session ID to delete - */ - sessionId: string; - /** - * Internal resolved session directory path to delete - */ - sessionPath?: string | null; + /** + * Session ID to delete + */ + sessionId: string; + /** + * Internal resolved session directory path to delete + */ + sessionPath?: string | null; } /** * Session metadata records to enrich with summary and context information. @@ -18994,10 +19350,10 @@ export interface SessionsDeleteRequest { */ /** @experimental */ export interface SessionsEnrichMetadataRequest { - /** - * Session metadata records to enrich. Records that already have summary and context are returned unchanged. - */ - sessions: LocalSessionMetadataValue[]; + /** + * Session metadata records to enrich. Records that already have summary and context are returned unchanged. + */ + sessions: LocalSessionMetadataValue[]; } /** * New auth credentials to install on the session. Omit to leave credentials unchanged. @@ -19007,7 +19363,7 @@ export interface SessionsEnrichMetadataRequest { */ /** @experimental */ export interface SessionSetCredentialsParams { - credentials?: SettableAuthInfo; + credentials?: SettableAuthInfo; } /** * Token authentication accepted by session.gitHubAuth.setCredentials. @@ -19017,19 +19373,19 @@ export interface SessionSetCredentialsParams { */ /** @experimental */ export interface SettableTokenAuthInfo { - /** - * SDK-side token authentication; the host configured the token directly via the SDK. - */ - type: "token"; - /** - * Authentication host. - */ - host: string; - /** - * The token value itself. Treat as a secret. - */ - token: string; - copilotUser?: CopilotUserResponse; + /** + * SDK-side token authentication; the host configured the token directly via the SDK. + */ + type: "token"; + /** + * Authentication host. + */ + host: string; + /** + * The token value itself. Treat as a secret. + */ + token: string; + copilotUser?: CopilotUserResponse; } /** * Indicates whether the credential update succeeded. @@ -19039,14 +19395,14 @@ export interface SettableTokenAuthInfo { */ /** @experimental */ export interface SessionSetCredentialsResult { - /** - * Whether the operation succeeded - */ - success: boolean; - /** - * Whether the session ended up with a populated `copilotUser` for the installed credentials. `true` when the supplied credential already carried `copilotUser` or it was successfully re-resolved server-side. `false` when the credential is installed without `copilotUser` — either re-resolution failed, or the variant cannot be re-resolved from the credential alone (only the raw-token variants `token`, `env`, and `gh-cli` can). In both `false` cases the token swap still applied, but plan/quota/billing metadata is degraded. Present whenever a credential was supplied; omitted only when no credential was supplied (no-op call). - */ - copilotUserResolved?: boolean; + /** + * Whether the operation succeeded + */ + success: boolean; + /** + * Whether the session ended up with a populated `copilotUser` for the installed credentials. `true` when the supplied credential already carried `copilotUser` or it was successfully re-resolved server-side. `false` when the credential is installed without `copilotUser` — either re-resolution failed, or the variant cannot be re-resolved from the credential alone (only the raw-token variants `token`, `env`, and `gh-cli` can). In both `false` cases the token swap still applied, but plan/quota/billing metadata is degraded. Present whenever a credential was supplied; omitted only when no credential was supplied (no-op call). + */ + copilotUserResolved?: boolean; } /** * Availability of built-in job tools surfaced to boundary consumers. @@ -19056,14 +19412,14 @@ export interface SessionSetCredentialsResult { */ /** @experimental */ export interface SessionSettingsBuiltInToolAvailabilitySnapshot { - /** - * Whether the report-progress tool is available. - */ - reportProgress?: boolean; - /** - * Whether the create-pull-request tool is available. - */ - createPullRequest?: boolean; + /** + * Whether the report-progress tool is available. + */ + reportProgress?: boolean; + /** + * Whether the create-pull-request tool is available. + */ + createPullRequest?: boolean; } /** * Named Rust-owned settings predicate to evaluate for this session. @@ -19073,11 +19429,11 @@ export interface SessionSettingsBuiltInToolAvailabilitySnapshot { */ /** @experimental */ export interface SessionSettingsEvaluatePredicateRequest { - name: SessionSettingsPredicateName; - /** - * Tool name for tool-scoped predicates such as trivial-change handling. - */ - toolName?: string; + name: SessionSettingsPredicateName; + /** + * Tool name for tool-scoped predicates such as trivial-change handling. + */ + toolName?: string; } /** * Result of evaluating a Rust-owned settings predicate. @@ -19087,10 +19443,10 @@ export interface SessionSettingsEvaluatePredicateRequest { */ /** @experimental */ export interface SessionSettingsEvaluatePredicateResult { - /** - * Whether the named settings predicate evaluated to enabled. - */ - enabled: boolean; + /** + * Whether the named settings predicate evaluated to enabled. + */ + enabled: boolean; } /** * Redacted job settings for a session. The job nonce is excluded. @@ -19100,15 +19456,15 @@ export interface SessionSettingsEvaluatePredicateResult { */ /** @experimental */ export interface SessionSettingsJobSnapshot { - /** - * GitHub Actions event type for the job. - */ - eventType?: string; - /** - * Whether this is the workflow's trigger job. - */ - isTriggerJob?: boolean; - builtInToolAvailability?: SessionSettingsBuiltInToolAvailabilitySnapshot; + /** + * GitHub Actions event type for the job. + */ + eventType?: string; + /** + * Whether this is the workflow's trigger job. + */ + isTriggerJob?: boolean; + builtInToolAvailability?: SessionSettingsBuiltInToolAvailabilitySnapshot; } /** * Redacted model routing settings for a session. @@ -19118,22 +19474,22 @@ export interface SessionSettingsJobSnapshot { */ /** @experimental */ export interface SessionSettingsModelSnapshot { - /** - * Selected model identifier. - */ - model?: string; - /** - * Default reasoning effort for the selected model. - */ - defaultReasoningEffort?: string; - /** - * Agent job identifier for the session. - */ - instanceId?: string; - /** - * Agent service callback URL for job and progress updates. - */ - callbackUrl?: string; + /** + * Selected model identifier. + */ + model?: string; + /** + * Default reasoning effort for the selected model. + */ + defaultReasoningEffort?: string; + /** + * Agent job identifier for the session. + */ + instanceId?: string; + /** + * Agent service callback URL for job and progress updates. + */ + callbackUrl?: string; } /** * Online-evaluation settings safe to expose across the SDK boundary. @@ -19143,14 +19499,14 @@ export interface SessionSettingsModelSnapshot { */ /** @experimental */ export interface SessionSettingsOnlineEvaluationSnapshot { - /** - * Whether online evaluation is disabled. - */ - disableOnlineEvaluation?: boolean; - /** - * Whether online-evaluation output-file generation is enabled. - */ - enableOnlineEvaluationOutputFile?: boolean; + /** + * Whether online evaluation is disabled. + */ + disableOnlineEvaluation?: boolean; + /** + * Whether online-evaluation output-file generation is enabled. + */ + enableOnlineEvaluationOutputFile?: boolean; } /** * Redacted repository and GitHub host settings for a session. @@ -19160,54 +19516,54 @@ export interface SessionSettingsOnlineEvaluationSnapshot { */ /** @experimental */ export interface SessionSettingsRepoSnapshot { - /** - * Repository name. - */ - name?: string; - /** - * GitHub repository database ID. - */ - id?: number; - /** - * Checked-out repository branch. - */ - branch?: string; - /** - * Checked-out commit SHA. - */ - commit?: string; - /** - * Whether the repository is writable. - */ - readWrite?: boolean; - /** - * Repository owner login. - */ - ownerName?: string; - /** - * GitHub repository owner database ID. - */ - ownerId?: number; - /** - * GitHub server base URL. - */ - serverUrl?: string; - /** - * GitHub server host name. - */ - host?: string; - /** - * Protocol used to access the GitHub host. - */ - hostProtocol?: string; - /** - * GitHub secret-scanning service URL. - */ - secretScanningUrl?: string; - /** - * Number of commits in the pull request. - */ - prCommitCount?: number; + /** + * Repository name. + */ + name?: string; + /** + * GitHub repository database ID. + */ + id?: number; + /** + * Checked-out repository branch. + */ + branch?: string; + /** + * Checked-out commit SHA. + */ + commit?: string; + /** + * Whether the repository is writable. + */ + readWrite?: boolean; + /** + * Repository owner login. + */ + ownerName?: string; + /** + * GitHub repository owner database ID. + */ + ownerId?: number; + /** + * GitHub server base URL. + */ + serverUrl?: string; + /** + * GitHub server host name. + */ + host?: string; + /** + * Protocol used to access the GitHub host. + */ + hostProtocol?: string; + /** + * GitHub secret-scanning service URL. + */ + secretScanningUrl?: string; + /** + * Number of commits in the pull request. + */ + prCommitCount?: number; } /** * Redacted, serializable view of session runtime settings for SDK boundary consumers. Secrets and raw feature flags are intentionally excluded. @@ -19217,27 +19573,27 @@ export interface SessionSettingsRepoSnapshot { */ /** @experimental */ export interface SessionSettingsSnapshot { - /** - * Agent runtime version selector copied from the session settings, such as `latest` or a runtime release identifier. - */ - version?: string; - /** - * Name of the SDK client that created the session. - */ - clientName?: string; - /** - * Session timeout in milliseconds. - */ - timeoutMs?: number; - /** - * Session start time as Unix epoch milliseconds. - */ - startTimeMs?: number; - repo: SessionSettingsRepoSnapshot; - model: SessionSettingsModelSnapshot; - validation: SessionSettingsValidationSnapshot; - job: SessionSettingsJobSnapshot; - onlineEvaluation: SessionSettingsOnlineEvaluationSnapshot; + /** + * Agent runtime version selector copied from the session settings, such as `latest` or a runtime release identifier. + */ + version?: string; + /** + * Name of the SDK client that created the session. + */ + clientName?: string; + /** + * Session timeout in milliseconds. + */ + timeoutMs?: number; + /** + * Session start time as Unix epoch milliseconds. + */ + startTimeMs?: number; + repo: SessionSettingsRepoSnapshot; + model: SessionSettingsModelSnapshot; + validation: SessionSettingsValidationSnapshot; + job: SessionSettingsJobSnapshot; + onlineEvaluation: SessionSettingsOnlineEvaluationSnapshot; } /** * Redacted validation and memory-tool settings for a session. @@ -19247,42 +19603,42 @@ export interface SessionSettingsSnapshot { */ /** @experimental */ export interface SessionSettingsValidationSnapshot { - /** - * General validation timeout budget in seconds. - */ - timeout?: number; - /** - * Dependabot validation timeout budget in seconds. - */ - dependabotTimeout?: number; - /** - * Whether CodeQL validation is enabled. - */ - codeqlEnabled?: boolean; - /** - * Whether code-review validation is enabled. - */ - codeReviewEnabled?: boolean; - /** - * Model used for code-review validation. - */ - codeReviewModel?: string; - /** - * Whether advisory validation is enabled. - */ - advisoryEnabled?: boolean; - /** - * Whether secret-scanning validation is enabled. - */ - secretScanningEnabled?: boolean; - /** - * Whether the memory-store tool is enabled. - */ - memoryStoreEnabled?: boolean; - /** - * Whether the memory-vote tool is enabled. - */ - memoryVoteEnabled?: boolean; + /** + * General validation timeout budget in seconds. + */ + timeout?: number; + /** + * Dependabot validation timeout budget in seconds. + */ + dependabotTimeout?: number; + /** + * Whether CodeQL validation is enabled. + */ + codeqlEnabled?: boolean; + /** + * Whether code-review validation is enabled. + */ + codeReviewEnabled?: boolean; + /** + * Model used for code-review validation. + */ + codeReviewModel?: string; + /** + * Whether advisory validation is enabled. + */ + advisoryEnabled?: boolean; + /** + * Whether secret-scanning validation is enabled. + */ + secretScanningEnabled?: boolean; + /** + * Whether the memory-store tool is enabled. + */ + memoryStoreEnabled?: boolean; + /** + * Whether the memory-vote tool is enabled. + */ + memoryVoteEnabled?: boolean; } /** * UUID prefix to resolve to a unique session ID. @@ -19292,10 +19648,10 @@ export interface SessionSettingsValidationSnapshot { */ /** @experimental */ export interface SessionsFindByPrefixRequest { - /** - * UUID prefix (>=7 hex chars, <36 chars). Returns the unique session ID, or undefined when there is no match or the prefix matches multiple sessions. - */ - prefix: string; + /** + * UUID prefix (>=7 hex chars, <36 chars). Returns the unique session ID, or undefined when there is no match or the prefix matches multiple sessions. + */ + prefix: string; } /** * Session ID matching the prefix, omitted when no unique match exists. @@ -19305,10 +19661,10 @@ export interface SessionsFindByPrefixRequest { */ /** @experimental */ export interface SessionsFindByPrefixResult { - /** - * Omitted when no unique session matches the prefix (no match or ambiguous) - */ - sessionId?: string; + /** + * Omitted when no unique session matches the prefix (no match or ambiguous) + */ + sessionId?: string; } /** * GitHub task ID to look up. @@ -19318,10 +19674,10 @@ export interface SessionsFindByPrefixResult { */ /** @experimental */ export interface SessionsFindByTaskIDRequest { - /** - * GitHub task ID to look up - */ - taskId: string; + /** + * GitHub task ID to look up + */ + taskId: string; } /** * ID of the local session bound to the given GitHub task, or omitted when none. @@ -19331,10 +19687,10 @@ export interface SessionsFindByTaskIDRequest { */ /** @experimental */ export interface SessionsFindByTaskIDResult { - /** - * Omitted when no local session is bound to that GitHub task - */ - sessionId?: string; + /** + * Omitted when no local session is bound to that GitHub task + */ + sessionId?: string; } /** * Source session identifier to fork from, optional event-ID boundary, and optional friendly name for the new session. @@ -19344,18 +19700,18 @@ export interface SessionsFindByTaskIDResult { */ /** @experimental */ export interface SessionsForkRequest { - /** - * Source session ID to fork from - */ - sessionId: string; - /** - * Optional event ID boundary. When provided, the fork includes only events before this ID (exclusive). When omitted, all events are included. - */ - toEventId?: string; - /** - * Optional friendly name to assign to the forked session. - */ - name?: string; + /** + * Source session ID to fork from + */ + sessionId: string; + /** + * Optional event ID boundary. When provided, the fork includes only events before this ID (exclusive). When omitted, all events are included. + */ + toEventId?: string; + /** + * Optional friendly name to assign to the forked session. + */ + name?: string; } /** * Identifier and optional friendly name assigned to the newly forked session. @@ -19365,14 +19721,14 @@ export interface SessionsForkRequest { */ /** @experimental */ export interface SessionsForkResult { - /** - * The new forked session's ID - */ - sessionId: string; - /** - * Friendly name assigned to the forked session, if any. - */ - name?: string; + /** + * The new forked session's ID + */ + sessionId: string; + /** + * Friendly name assigned to the forked session, if any. + */ + name?: string; } /** * Session ID whose board entry count should be returned. @@ -19382,10 +19738,10 @@ export interface SessionsForkResult { */ /** @experimental */ export interface SessionsGetBoardEntryCountRequest { - /** - * Session ID whose board entry count should be returned. - */ - sessionId: string; + /** + * Session ID whose board entry count should be returned. + */ + sessionId: string; } /** * Dynamic-context board entry count, when available. @@ -19395,10 +19751,10 @@ export interface SessionsGetBoardEntryCountRequest { */ /** @experimental */ export interface SessionsGetBoardEntryCountResult { - /** - * Board entry count, when available. - */ - count?: number; + /** + * Board entry count, when available. + */ + count?: number; } /** * Session ID whose event-log file path to compute. @@ -19408,10 +19764,10 @@ export interface SessionsGetBoardEntryCountResult { */ /** @experimental */ export interface SessionsGetEventFilePathRequest { - /** - * Session ID whose event-log file path to compute - */ - sessionId: string; + /** + * Session ID whose event-log file path to compute + */ + sessionId: string; } /** * Absolute path to the session's events.jsonl file on disk. @@ -19421,10 +19777,10 @@ export interface SessionsGetEventFilePathRequest { */ /** @experimental */ export interface SessionsGetEventFilePathResult { - /** - * Absolute path to the session's events.jsonl file - */ - filePath: string; + /** + * Absolute path to the session's events.jsonl file + */ + filePath: string; } /** * Optional working-directory context used to score session relevance. @@ -19434,7 +19790,7 @@ export interface SessionsGetEventFilePathResult { */ /** @experimental */ export interface SessionsGetLastForContextRequest { - context?: SessionContext; + context?: SessionContext; } /** * Most-relevant session ID for the supplied context, or omitted when no sessions exist. @@ -19444,10 +19800,10 @@ export interface SessionsGetLastForContextRequest { */ /** @experimental */ export interface SessionsGetLastForContextResult { - /** - * Most-relevant session ID for the supplied context, or omitted when no sessions exist - */ - sessionId?: string; + /** + * Most-relevant session ID for the supplied context, or omitted when no sessions exist + */ + sessionId?: string; } /** * Session ID whose persisted metadata should be read. @@ -19457,10 +19813,10 @@ export interface SessionsGetLastForContextResult { */ /** @experimental */ export interface SessionsGetMetadataRequest { - /** - * Session ID to inspect - */ - sessionId: string; + /** + * Session ID to inspect + */ + sessionId: string; } /** * Persisted local session metadata when the session exists. @@ -19470,7 +19826,7 @@ export interface SessionsGetMetadataRequest { */ /** @experimental */ export interface SessionsGetMetadataResult { - session?: LocalSessionMetadataValue; + session?: LocalSessionMetadataValue; } /** * Session ID to look up the persisted remote-steerable flag for. @@ -19480,10 +19836,10 @@ export interface SessionsGetMetadataResult { */ /** @experimental */ export interface SessionsGetPersistedRemoteSteerableRequest { - /** - * Session ID to look up the persisted remote-steerable flag for - */ - sessionId: string; + /** + * Session ID to look up the persisted remote-steerable flag for + */ + sessionId: string; } /** * The session's persisted remote-steerable flag, or omitted when no value has been persisted. @@ -19493,10 +19849,10 @@ export interface SessionsGetPersistedRemoteSteerableRequest { */ /** @experimental */ export interface SessionsGetPersistedRemoteSteerableResult { - /** - * The session's persisted remote-steerable flag if recorded; omitted when no value has been persisted - */ - remoteSteerable?: boolean; + /** + * The session's persisted remote-steerable flag if recorded; omitted when no value has been persisted + */ + remoteSteerable?: boolean; } /** * Map of sessionId -> on-disk size in bytes for each session's workspace directory. @@ -19506,12 +19862,12 @@ export interface SessionsGetPersistedRemoteSteerableResult { */ /** @experimental */ export interface SessionSizes { - /** - * Map of sessionId -> on-disk size in bytes for the session's workspace directory - */ - sizes: { - [k: string]: number | undefined; - }; + /** + * Map of sessionId -> on-disk size in bytes for the session's workspace directory + */ + sizes: { + [k: string]: number | undefined; + }; } /** * Limit for non-empty local session IDs. @@ -19521,10 +19877,10 @@ export interface SessionSizes { */ /** @experimental */ export interface SessionsListNonEmptySessionIdsRequest { - /** - * Maximum number of session IDs to return. - */ - limit?: number; + /** + * Maximum number of session IDs to return. + */ + limit?: number; } /** * Recent local session IDs that contain user-visible history. @@ -19534,10 +19890,10 @@ export interface SessionsListNonEmptySessionIdsRequest { */ /** @experimental */ export interface SessionsListNonEmptySessionIdsResult { - /** - * Session IDs ordered newest-first. - */ - sessionIds: string[]; + /** + * Session IDs ordered newest-first. + */ + sessionIds: string[]; } /** * Optional source filter, metadata-load limit, and context filter applied to the returned sessions. @@ -19547,20 +19903,20 @@ export interface SessionsListNonEmptySessionIdsResult { */ /** @experimental */ export interface SessionsListRequest { - source?: SessionSource; - /** - * When provided, only the first N local sessions (sorted by modification time, newest first) load full metadata; remaining sessions return basic info only. Use 0 to return only basic info for every local session. Has no effect on remote entries (which always carry their full shape). - */ - metadataLimit?: number; - filter?: SessionListFilter; - /** - * When true, include detached maintenance sessions. Defaults to false for user-facing session lists. - */ - includeDetached?: boolean; - /** - * Only meaningful when `source` includes remote. When true, propagates errors from the remote service instead of silently returning an empty remote list. Defaults to false. - */ - throwOnError?: boolean; + source?: SessionSource; + /** + * When provided, only the first N local sessions (sorted by modification time, newest first) load full metadata; remaining sessions return basic info only. Use 0 to return only basic info for every local session. Has no effect on remote entries (which always carry their full shape). + */ + metadataLimit?: number; + filter?: SessionListFilter; + /** + * When true, include detached maintenance sessions. Defaults to false for user-facing session lists. + */ + includeDetached?: boolean; + /** + * Only meaningful when `source` includes remote. When true, propagates errors from the remote service instead of silently returning an empty remote list. Defaults to false. + */ + throwOnError?: boolean; } /** * Active session ID whose deferred repo-level hooks should be loaded. @@ -19570,10 +19926,10 @@ export interface SessionsListRequest { */ /** @experimental */ export interface SessionsLoadDeferredRepoHooksRequest { - /** - * Active session ID whose deferred repo-level hooks should be loaded - */ - sessionId: string; + /** + * Active session ID whose deferred repo-level hooks should be loaded + */ + sessionId: string; } /** * Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true). @@ -19583,22 +19939,22 @@ export interface SessionsLoadDeferredRepoHooksRequest { */ /** @experimental */ export interface SessionsPruneOldRequest { - /** - * Delete sessions whose modifiedTime is at least this many days old - */ - olderThanDays: number; - /** - * When true, only report what would be deleted without performing any deletion - */ - dryRun?: boolean; - /** - * When true, named sessions (set via /rename) are also eligible for pruning - */ - includeNamed?: boolean; - /** - * Session IDs that should never be considered for pruning - */ - excludeSessionIds?: string[]; + /** + * Delete sessions whose modifiedTime is at least this many days old + */ + olderThanDays: number; + /** + * When true, only report what would be deleted without performing any deletion + */ + dryRun?: boolean; + /** + * When true, named sessions (set via /rename) are also eligible for pruning + */ + includeNamed?: boolean; + /** + * Session IDs that should never be considered for pruning + */ + excludeSessionIds?: string[]; } /** * Pagination options for reading an inactive or active local session's persisted event journal. @@ -19608,19 +19964,19 @@ export interface SessionsPruneOldRequest { */ /** @experimental */ export interface SessionsReadPersistedEventsRequest { - /** - * Session ID whose persisted event journal should be read. - */ - sessionId: string; - /** - * Opaque cursor returned by a previous persisted-event read. Omit on the first call. - */ - cursor?: string; - /** - * Maximum number of events to return in this batch (1–1000, default 200). - */ - max?: number; - direction?: EventsReadDirection; + /** + * Session ID whose persisted event journal should be read. + */ + sessionId: string; + /** + * Opaque cursor returned by a previous persisted-event read. Omit on the first call. + */ + cursor?: string; + /** + * Maximum number of events to return in this batch (1–1000, default 200). + */ + max?: number; + direction?: EventsReadDirection; } /** * Session ID whose in-use lock should be released. @@ -19630,10 +19986,10 @@ export interface SessionsReadPersistedEventsRequest { */ /** @experimental */ export interface SessionsReleaseLockRequest { - /** - * Session ID whose in-use lock should be released - */ - sessionId: string; + /** + * Session ID whose in-use lock should be released + */ + sessionId: string; } /** * Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session. @@ -19651,14 +20007,14 @@ export interface SessionsReleaseLockResult {} */ /** @experimental */ export interface SessionsReloadPluginHooksRequest { - /** - * Active session ID to reload hooks for - */ - sessionId: string; - /** - * When true, skip repo-level hooks. Use before folder trust is confirmed; loadDeferredRepoHooks loads them post-trust. - */ - deferRepoHooks?: boolean; + /** + * Active session ID to reload hooks for + */ + sessionId: string; + /** + * When true, skip repo-level hooks. Use before folder trust is confirmed; loadDeferredRepoHooks loads them post-trust. + */ + deferRepoHooks?: boolean; } /** * Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId. @@ -19676,10 +20032,10 @@ export interface SessionsReloadPluginHooksResult {} */ /** @experimental */ export interface SessionsSaveRequest { - /** - * Session ID whose pending events should be flushed to disk - */ - sessionId: string; + /** + * Session ID whose pending events should be flushed to disk + */ + sessionId: string; } /** * Flush a session's pending events to disk. No-op when no writer exists for the session (e.g., already closed). @@ -19697,10 +20053,10 @@ export interface SessionsSaveResult {} */ /** @experimental */ export interface SessionsSetAdditionalPluginsRequest { - /** - * Manager-wide additional plugins to register. Replaces any previously-configured set. Pass an empty array to clear. - */ - plugins: InstalledPlugin[]; + /** + * Manager-wide additional plugins to register. Replaces any previously-configured set. Pass an empty array to clear. + */ + plugins: InstalledPlugin[]; } /** * Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload. @@ -19718,10 +20074,10 @@ export interface SessionsSetAdditionalPluginsResult {} */ /** @experimental */ export interface SessionsSetRemoteControlSteeringRequest { - /** - * Target steering state. Today only `true` is actionable on the underlying exporter; `false` is reserved for future use. - */ - enabled: boolean; + /** + * Target steering state. Today only `true` is actionable on the underlying exporter; `false` is reserved for future use. + */ + enabled: boolean; } /** * Parameters for attaching the remote-control singleton to a session. @@ -19731,23 +20087,23 @@ export interface SessionsSetRemoteControlSteeringRequest { */ /** @experimental */ export interface SessionsStartRemoteControlRequest { - /** - * Local session id to attach remote control to. - */ - sessionId: string; - config: RemoteControlConfig; + /** + * Local session id to attach remote control to. + */ + sessionId: string; + config: RemoteControlConfig; } /** @experimental */ export interface SessionsStopRemoteControlRequest { - /** - * When provided, the stop is rejected unless the singleton currently points at this session id (compare-and-swap semantics). - */ - expectedSessionId?: string; - /** - * When true, the singleton is unconditionally torn down regardless of `expectedSessionId`. Use during shutdown or explicit `/remote off`. - */ - force?: boolean; + /** + * When provided, the stop is rejected unless the singleton currently points at this session id (compare-and-swap semantics). + */ + expectedSessionId?: string; + /** + * When true, the singleton is unconditionally torn down regardless of `expectedSessionId`. Use during shutdown or explicit `/remote off`. + */ + force?: boolean; } /** * Parameters for atomically rebinding the remote-control singleton. @@ -19757,14 +20113,14 @@ export interface SessionsStopRemoteControlRequest { */ /** @experimental */ export interface SessionsTransferRemoteControlRequest { - /** - * Local session id to point remote control at. - */ - toSessionId: string; - /** - * When provided, the transfer is rejected unless the singleton currently points at this session id (compare-and-swap semantics to avoid clobbering newer state). - */ - expectedFromSessionId?: string; + /** + * Local session id to point remote control at. + */ + toSessionId: string; + /** + * When provided, the transfer is rejected unless the singleton currently points at this session id (compare-and-swap semantics to avoid clobbering newer state). + */ + expectedFromSessionId?: string; } /** * Telemetry engagement ID for the session, when available. @@ -19774,10 +20130,10 @@ export interface SessionsTransferRemoteControlRequest { */ /** @experimental */ export interface SessionTelemetryEngagement { - /** - * Current telemetry engagement ID, when available. - */ - engagementId?: string; + /** + * Current telemetry engagement ID, when available. + */ + engagementId?: string; } /** * Patch of mutable session options to apply to the running session. @@ -19787,219 +20143,219 @@ export interface SessionTelemetryEngagement { */ /** @experimental */ export interface SessionUpdateOptionsParams { - /** - * The model ID to use for assistant turns. - */ - model?: string; - modelCapabilitiesOverrides?: ModelCapabilitiesOverride; - /** - * Reasoning effort for the selected model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. When omitted, no effort override is applied. - */ - reasoningEffort?: string; - reasoningSummary?: OptionsUpdateReasoningSummary; - verbosity?: Verbosity; - /** - * Identifier of the client driving the session. - */ - clientName?: string; - /** - * Identifier sent to LSP-style integrations. - */ - lspClientName?: string; - /** - * Stable integration identifier used for analytics and rate-limit attribution. - */ - integrationId?: string; - /** - * Map of feature-flag IDs to their boolean enabled state. - */ - featureFlags?: { - [k: string]: boolean | undefined; - }; - /** - * Whether experimental capabilities are enabled. - */ - isExperimentalMode?: boolean; - provider?: ProviderConfig; - capi?: CapiSessionOptions; - /** - * Absolute working-directory path for shell tools. - */ - workingDirectory?: string; - /** - * Allowlist of tool names available to this session. - */ - availableTools?: string[]; - /** - * Denylist of tool names for this session. - */ - excludedTools?: string[]; - /** - * Built-in subagent names to include in this session. When specified, only these built-ins are available, subject to runtime availability and exclusions. Custom agents with the same name remain available. Set to null to remove the allowlist restriction. - */ - includedBuiltinAgents?: string[] | null; - /** - * Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. - */ - excludedBuiltinAgents?: string[]; - toolFilterPrecedence?: OptionsUpdateToolFilterPrecedence; - /** - * Whether shell-script safety heuristics are enabled. - */ - enableScriptSafety?: boolean; - shell?: ShellOptions; - /** - * @deprecated - * Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`). - */ - shellInitProfile?: string; - /** - * PowerShell process flags applied to built-in and user-requested shell commands. - */ - shellProcessFlags?: string[]; - sandboxConfig?: SandboxConfig; - /** - * Origin of the sandbox choice. The runtime uses this only for internal telemetry provenance; managed policy is derived independently. - * - * @internal - */ - sandboxConfigSource?: SandboxConfigSource; - /** - * Whether interactive shell sessions are logged. - */ - logInteractiveShells?: boolean; - envValueMode?: OptionsUpdateEnvValueMode; - /** - * Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers. - */ - allowAllMcpServerInstructions?: boolean; - /** - * Additional directories to search for skills. - */ - skillDirectories?: string[]; - /** - * Built-in skill names to include in this session. When specified, only these runtime-bundled skills are available. Skills from other sources with the same name remain available. Set to null to remove the allowlist restriction. - */ - includedBuiltinSkills?: string[] | null; - /** - * Skill IDs that should be excluded from this session. - */ - disabledSkills?: string[]; - /** - * Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`. - */ - enableOnDemandInstructionDiscovery?: boolean; - /** - * 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. - */ - maxInlineBinaryBytes?: number; - /** - * Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes. - */ - installedPlugins?: SessionInstalledPlugin[]; - /** - * Whether to default custom agents to local-only execution. - */ - customAgentsLocalOnly?: boolean; - /** - * When true, the selected custom agent's prompt is not injected into the user message (skill context is still injected). Used by automation triggers where the agent prompt is already in the problem statement. - */ - suppressCustomAgentPrompt?: boolean; - /** - * Whether to skip loading custom instruction sources. - */ - skipCustomInstructions?: boolean; - /** - * Instruction source IDs to exclude from the system prompt. - */ - disabledInstructionSources?: string[]; - /** - * Whether to include the `Co-authored-by` trailer in commit messages. - */ - coauthorEnabled?: boolean; - /** - * Optional path for trajectory output. - */ - trajectoryFile?: string; - /** - * Whether to stream model responses. - */ - enableStreaming?: boolean; - /** - * Override URL for the Copilot API endpoint. - */ - copilotUrl?: string; - /** - * Whether to disable the `ask_user` tool (encourages autonomous behavior). - */ - askUserDisabled?: boolean; - /** - * Whether to allow auto-mode continuation across turns. - */ - continueOnAutoMode?: boolean; - /** - * Whether the session is running in an interactive UI. - */ - runningInInteractiveMode?: boolean; - /** - * Whether to surface reasoning-summary events from the model. - */ - enableReasoningSummaries?: boolean; - /** - * Runtime context discriminator (e.g., `cli`, `actions`). - */ - agentContext?: string; - /** - * Override directory for the session-events log. When unset, the runtime's default events log directory is used. - */ - eventsLogDirectory?: string; - /** - * Whether subagent callback events should be forwarded into the session event log sink. - */ - eventsLogIncludesSubagents?: boolean; - /** - * Additional content-exclusion policies to merge into the session's policy set. - * - * @experimental - */ - additionalContentExclusionPolicies?: OptionsUpdateAdditionalContentExclusionPolicy[]; - /** - * Whether to expose the `manage_schedule` tool to the agent. The runtime always owns the per-session schedule registry; this flag only controls tool exposure (typically gated to staff users). - */ - manageScheduleEnabled?: boolean; - /** - * Replaces the session's capability set with the given list. Use to enable or disable capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the field to leave the existing capability set unchanged. - */ - sessionCapabilities?: SessionCapability[]; - /** - * Whether to skip embedding retrieval pipeline initialization and execution. - */ - skipEmbeddingRetrieval?: boolean; - /** - * Organization-level custom instructions to inject into the system prompt. - */ - organizationCustomInstructions?: string; - /** - * Whether to enable loading of `.github/hooks/` filesystem hooks. Separate from the SDK callback hook mechanism. - */ - enableFileHooks?: boolean; - /** - * Whether to enable host git operations (context resolution, child repo scanning, git info in system prompt). - */ - enableHostGitOperations?: boolean; - /** - * Whether to enable cross-session store writes and reads. - */ - enableSessionStore?: boolean; - /** - * Whether skill loading is enabled. Explicit false disables every source, including a bound SDK provider; changing the value invalidates the loaded skill snapshot. When omitted, creation falls back to enableConfigDiscovery unless an SDK skill provider is registered. - */ - enableSkills?: boolean; - contextTier?: OptionsUpdateContextTier; - /** - * Optional session limits. Pass null to clear the session limits. - */ - sessionLimits?: SessionLimitsConfig | null; + /** + * The model ID to use for assistant turns. + */ + model?: string; + modelCapabilitiesOverrides?: ModelCapabilitiesOverride; + /** + * Reasoning effort for the selected model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. When omitted, no effort override is applied. + */ + reasoningEffort?: string; + reasoningSummary?: OptionsUpdateReasoningSummary; + verbosity?: Verbosity; + /** + * Identifier of the client driving the session. + */ + clientName?: string; + /** + * Identifier sent to LSP-style integrations. + */ + lspClientName?: string; + /** + * Stable integration identifier used for analytics and rate-limit attribution. + */ + integrationId?: string; + /** + * Map of feature-flag IDs to their boolean enabled state. + */ + featureFlags?: { + [k: string]: boolean | undefined; + }; + /** + * Whether experimental capabilities are enabled. + */ + isExperimentalMode?: boolean; + provider?: ProviderConfig; + capi?: CapiSessionOptions; + /** + * Absolute working-directory path for shell tools. + */ + workingDirectory?: string; + /** + * Allowlist of tool names available to this session. + */ + availableTools?: string[]; + /** + * Denylist of tool names for this session. + */ + excludedTools?: string[]; + /** + * Built-in subagent names to include in this session. When specified, only these built-ins are available, subject to runtime availability and exclusions. Custom agents with the same name remain available. Set to null to remove the allowlist restriction. + */ + includedBuiltinAgents?: string[] | null; + /** + * Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. + */ + excludedBuiltinAgents?: string[]; + toolFilterPrecedence?: OptionsUpdateToolFilterPrecedence; + /** + * Whether shell-script safety heuristics are enabled. + */ + enableScriptSafety?: boolean; + shell?: ShellOptions; + /** + * @deprecated + * Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`). + */ + shellInitProfile?: string; + /** + * PowerShell process flags applied to built-in and user-requested shell commands. + */ + shellProcessFlags?: string[]; + sandboxConfig?: SandboxConfig; + /** + * Origin of the sandbox choice. The runtime uses this only for internal telemetry provenance; managed policy is derived independently. + * + * @internal + */ + sandboxConfigSource?: SandboxConfigSource; + /** + * Whether interactive shell sessions are logged. + */ + logInteractiveShells?: boolean; + envValueMode?: OptionsUpdateEnvValueMode; + /** + * Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers. + */ + allowAllMcpServerInstructions?: boolean; + /** + * Additional directories to search for skills. + */ + skillDirectories?: string[]; + /** + * Built-in skill names to include in this session. When specified, only these runtime-bundled skills are available. Skills from other sources with the same name remain available. Set to null to remove the allowlist restriction. + */ + includedBuiltinSkills?: string[] | null; + /** + * Skill IDs that should be excluded from this session. + */ + disabledSkills?: string[]; + /** + * Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`. + */ + enableOnDemandInstructionDiscovery?: boolean; + /** + * 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. + */ + maxInlineBinaryBytes?: number; + /** + * Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes. + */ + installedPlugins?: SessionInstalledPlugin[]; + /** + * Whether to default custom agents to local-only execution. + */ + customAgentsLocalOnly?: boolean; + /** + * When true, the selected custom agent's prompt is not injected into the user message (skill context is still injected). Used by automation triggers where the agent prompt is already in the problem statement. + */ + suppressCustomAgentPrompt?: boolean; + /** + * Whether to skip loading custom instruction sources. + */ + skipCustomInstructions?: boolean; + /** + * Instruction source IDs to exclude from the system prompt. + */ + disabledInstructionSources?: string[]; + /** + * Whether to include the `Co-authored-by` trailer in commit messages. + */ + coauthorEnabled?: boolean; + /** + * Optional path for trajectory output. + */ + trajectoryFile?: string; + /** + * Whether to stream model responses. + */ + enableStreaming?: boolean; + /** + * Override URL for the Copilot API endpoint. + */ + copilotUrl?: string; + /** + * Whether to disable the `ask_user` tool (encourages autonomous behavior). + */ + askUserDisabled?: boolean; + /** + * Whether to allow auto-mode continuation across turns. + */ + continueOnAutoMode?: boolean; + /** + * Whether the session is running in an interactive UI. + */ + runningInInteractiveMode?: boolean; + /** + * Whether to surface reasoning-summary events from the model. + */ + enableReasoningSummaries?: boolean; + /** + * Runtime context discriminator (e.g., `cli`, `actions`). + */ + agentContext?: string; + /** + * Override directory for the session-events log. When unset, the runtime's default events log directory is used. + */ + eventsLogDirectory?: string; + /** + * Whether subagent callback events should be forwarded into the session event log sink. + */ + eventsLogIncludesSubagents?: boolean; + /** + * Additional content-exclusion policies to merge into the session's policy set. + * + * @experimental + */ + additionalContentExclusionPolicies?: OptionsUpdateAdditionalContentExclusionPolicy[]; + /** + * Whether to expose the `manage_schedule` tool to the agent. The runtime always owns the per-session schedule registry; this flag only controls tool exposure (typically gated to staff users). + */ + manageScheduleEnabled?: boolean; + /** + * Replaces the session's capability set with the given list. Use to enable or disable capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the field to leave the existing capability set unchanged. + */ + sessionCapabilities?: SessionCapability[]; + /** + * Whether to skip embedding retrieval pipeline initialization and execution. + */ + skipEmbeddingRetrieval?: boolean; + /** + * Organization-level custom instructions to inject into the system prompt. + */ + organizationCustomInstructions?: string; + /** + * Whether to enable loading of `.github/hooks/` filesystem hooks. Separate from the SDK callback hook mechanism. + */ + enableFileHooks?: boolean; + /** + * Whether to enable host git operations (context resolution, child repo scanning, git info in system prompt). + */ + enableHostGitOperations?: boolean; + /** + * Whether to enable cross-session store writes and reads. + */ + enableSessionStore?: boolean; + /** + * Whether skill loading is enabled. Explicit false disables every source, including a bound SDK provider; changing the value invalidates the loaded skill snapshot. When omitted, creation falls back to enableConfigDiscovery unless an SDK skill provider is registered. + */ + enableSkills?: boolean; + contextTier?: OptionsUpdateContextTier; + /** + * Optional session limits. Pass null to clear the session limits. + */ + sessionLimits?: SessionLimitsConfig | null; } /** * Indicates whether the session options patch was applied successfully. @@ -20009,14 +20365,14 @@ export interface SessionUpdateOptionsParams { */ /** @experimental */ export interface SessionUpdateOptionsResult { - /** - * Whether the operation succeeded - */ - success: boolean; - /** - * Number of hooks loaded from installed plugins, returned when installedPlugins is updated - */ - pluginHookCount?: number; + /** + * Whether the operation succeeded + */ + success: boolean; + /** + * Number of hooks loaded from installed plugins, returned when installedPlugins is updated + */ + pluginHookCount?: number; } /** * User-requested shell execution cancellation handle. @@ -20026,10 +20382,10 @@ export interface SessionUpdateOptionsResult { */ /** @experimental */ export interface ShellCancelUserRequestedRequest { - /** - * Request ID previously passed to executeUserRequested - */ - requestId: string; + /** + * Request ID previously passed to executeUserRequested + */ + requestId: string; } /** * Shell command to run, with optional working directory and timeout in milliseconds. @@ -20039,18 +20395,18 @@ export interface ShellCancelUserRequestedRequest { */ /** @experimental */ export interface ShellExecRequest { - /** - * Shell command to execute - */ - command: string; - /** - * Working directory (defaults to session working directory) - */ - cwd?: string; - /** - * Timeout in milliseconds (default: 30000) - */ - timeout?: number; + /** + * Shell command to execute + */ + command: string; + /** + * Working directory (defaults to session working directory) + */ + cwd?: string; + /** + * Timeout in milliseconds (default: 30000) + */ + timeout?: number; } /** * Identifier of the spawned process, used to correlate streamed output and exit notifications. @@ -20060,10 +20416,10 @@ export interface ShellExecRequest { */ /** @experimental */ export interface ShellExecResult { - /** - * Unique identifier for tracking streamed output - */ - processId: string; + /** + * Unique identifier for tracking streamed output + */ + processId: string; } /** * User-requested shell command and cancellation handle. @@ -20073,14 +20429,14 @@ export interface ShellExecResult { */ /** @experimental */ export interface ShellExecuteUserRequestedRequest { - /** - * Caller-provided cancellation handle for this execution - */ - requestId: string; - /** - * Shell command to execute - */ - command: string; + /** + * Caller-provided cancellation handle for this execution + */ + requestId: string; + /** + * Shell command to execute + */ + command: string; } /** * Identifier of a process previously returned by "shell.exec" and the signal to send. @@ -20090,11 +20446,11 @@ export interface ShellExecuteUserRequestedRequest { */ /** @experimental */ export interface ShellKillRequest { - /** - * Process identifier returned by shell.exec - */ - processId: string; - signal?: ShellKillSignal; + /** + * Process identifier returned by shell.exec + */ + processId: string; + signal?: ShellKillSignal; } /** * Indicates whether the signal was delivered; false if the process was unknown or already exited. @@ -20104,10 +20460,10 @@ export interface ShellKillRequest { */ /** @experimental */ export interface ShellKillResult { - /** - * Whether the signal was sent successfully - */ - killed: boolean; + /** + * Whether the signal was sent successfully + */ + killed: boolean; } /** * Parameters for shutting down the session @@ -20117,11 +20473,11 @@ export interface ShellKillResult { */ /** @experimental */ export interface ShutdownRequest { - type?: ShutdownType; - /** - * Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'. - */ - reason?: string; + type?: ShutdownType; + /** + * Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'. + */ + reason?: string; } /** * Skill metadata available to a session, with name, description, source, enabled/invocable state, path, plugin, and argument hint. @@ -20131,39 +20487,39 @@ export interface ShutdownRequest { */ /** @experimental */ export interface Skill { - /** - * Unique identifier for the skill - */ - name: string; - /** - * Canonical slash command name used to invoke the skill, without the leading '/' - */ - commandName?: string; - /** - * Description of what the skill does - */ - description: string; - source: SkillSource; - /** - * Whether the skill can be invoked by the user as a slash command - */ - userInvocable: boolean; - /** - * Whether the skill is currently enabled - */ - enabled: boolean; - /** - * Absolute path to the skill file - */ - path?: string; - /** - * Name of the plugin that provides the skill, when source is 'plugin' - */ - pluginName?: string; - /** - * Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field - */ - argumentHint?: string; + /** + * Unique identifier for the skill + */ + name: string; + /** + * Canonical slash command name used to invoke the skill, without the leading '/' + */ + commandName?: string; + /** + * Description of what the skill does + */ + description: string; + source: SkillSource; + /** + * Whether the skill can be invoked by the user as a slash command + */ + userInvocable: boolean; + /** + * Whether the skill is currently enabled + */ + enabled: boolean; + /** + * Absolute path to the skill file + */ + path?: string; + /** + * Name of the plugin that provides the skill, when source is 'plugin' + */ + pluginName?: string; + /** + * Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field + */ + argumentHint?: string; } /** * Canonical directory where skills can be discovered or created, with scope, preference, and optional project path. @@ -20173,19 +20529,19 @@ export interface Skill { */ /** @experimental */ export interface SkillDiscoveryPath { - /** - * Absolute path of the create/discovery target (may not exist on disk yet) - */ - path: string; - scope: SkillDiscoveryScope; - /** - * 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. - */ - preferredForCreation: boolean; - /** - * The input project path this directory was derived from (only for project scope) - */ - projectPath?: string; + /** + * Absolute path of the create/discovery target (may not exist on disk yet) + */ + path: string; + scope: SkillDiscoveryScope; + /** + * 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. + */ + preferredForCreation: boolean; + /** + * The input project path this directory was derived from (only for project scope) + */ + projectPath?: string; } /** * Canonical locations where skills can be created so the runtime will recognize them. @@ -20195,10 +20551,10 @@ export interface SkillDiscoveryPath { */ /** @experimental */ export interface SkillDiscoveryPathList { - /** - * Canonical skill create/discovery directories, in priority order - */ - paths: SkillDiscoveryPath[]; + /** + * Canonical skill create/discovery directories, in priority order + */ + paths: SkillDiscoveryPath[]; } /** * Skills available to the session, with their enabled state. @@ -20208,10 +20564,10 @@ export interface SkillDiscoveryPathList { */ /** @experimental */ export interface SkillList { - /** - * Available skills - */ - skills: Skill[]; + /** + * Available skills + */ + skills: Skill[]; } /** * Catalog-only metadata for one SDK-provided skill. The complete SKILL.md is fetched separately and lazily. @@ -20221,26 +20577,26 @@ export interface SkillList { */ /** @experimental */ export interface SkillProviderDescriptor { - /** - * Invocation and display name. - */ - name: string; - /** - * Description used in skill catalogs without fetching content. - */ - description: string; - /** - * Whether users may invoke the skill directly. Defaults to true. - */ - userInvocable?: boolean; - /** - * Whether model invocation is disabled. Defaults to false. - */ - disableModelInvocation?: boolean; - /** - * Optional freeform argument hint used by slash-command catalogs. - */ - argumentHint?: string; + /** + * Invocation and display name. + */ + name: string; + /** + * Description used in skill catalogs without fetching content. + */ + description: string; + /** + * Whether users may invoke the skill directly. Defaults to true. + */ + userInvocable?: boolean; + /** + * Whether model invocation is disabled. Defaults to false. + */ + disableModelInvocation?: boolean; + /** + * Optional freeform argument hint used by slash-command catalogs. + */ + argumentHint?: string; } /** * Catalog metadata returned by an SDK session's skill provider. Catalogs are limited to 1024 descriptors and 1 MiB of aggregate metadata. @@ -20251,12 +20607,12 @@ export interface SkillProviderDescriptor { /** @experimental */ /** @internal */ export interface SkillProviderListResult { - /** - * Skill descriptors in provider order. Invocation names must be unique under case-insensitive comparison. - * - * @maxItems 1024 - */ - skills: SkillProviderDescriptor[]; + /** + * Skill descriptors in provider order. Invocation names must be unique under case-insensitive comparison. + * + * @maxItems 1024 + */ + skills: SkillProviderDescriptor[]; } /** * Identifies one SDK-provided skill by invocation name. @@ -20267,14 +20623,14 @@ export interface SkillProviderListResult { /** @experimental */ /** @internal */ export interface SkillProviderReadRequest { - /** - * Target session identifier - */ - sessionId: string; - /** - * Invocation name of the skill to read. - */ - name: string; + /** + * Target session identifier + */ + sessionId: string; + /** + * Invocation name of the skill to read. + */ + name: string; } /** * Complete text-only SKILL.md content returned by an SDK session's skill provider. Related files and assets are not supported. @@ -20285,10 +20641,10 @@ export interface SkillProviderReadRequest { /** @experimental */ /** @internal */ export interface SkillProviderReadResult { - /** - * Complete SKILL.md text. The runtime enforces a 1 MiB UTF-8 byte limit. - */ - markdown: string; + /** + * Complete SKILL.md text. The runtime enforces a 1 MiB UTF-8 byte limit. + */ + markdown: string; } /** * Skill names to mark as disabled in global configuration, replacing any previous list. @@ -20298,10 +20654,10 @@ export interface SkillProviderReadResult { */ /** @experimental */ export interface SkillsConfigSetDisabledSkillsRequest { - /** - * List of skill names to disable - */ - disabledSkills: string[]; + /** + * List of skill names to disable + */ + disabledSkills: string[]; } /** * Adds or removes a single skill from the global disabled list, leaving every other entry untouched. @@ -20311,14 +20667,14 @@ export interface SkillsConfigSetDisabledSkillsRequest { */ /** @experimental */ export interface SkillsConfigSetSkillDisabledRequest { - /** - * Name of the skill to add to or remove from the disabled list - */ - name: string; - /** - * True to disable the skill, false to enable it - */ - disabled: boolean; + /** + * Name of the skill to add to or remove from the disabled list + */ + name: string; + /** + * True to disable the skill, false to enable it + */ + disabled: boolean; } /** * Name of the skill to disable for the session. @@ -20328,10 +20684,10 @@ export interface SkillsConfigSetSkillDisabledRequest { */ /** @experimental */ export interface SkillsDisableRequest { - /** - * Name of the skill to disable - */ - name: string; + /** + * Name of the skill to disable + */ + name: string; } /** * Optional project paths and additional skill directories to include in discovery. @@ -20341,18 +20697,18 @@ export interface SkillsDisableRequest { */ /** @experimental */ export interface SkillsDiscoverRequest { - /** - * Optional list of project directory paths to scan for project-scoped skills - */ - projectPaths?: string[]; - /** - * Optional list of additional skill directory paths to include - */ - skillDirectories?: string[]; - /** - * When true, omit skills from the host's global sources (personal, custom, plugin, and built-in), returning only project-scoped skills. For multitenant deployments. - */ - excludeHostSkills?: boolean; + /** + * Optional list of project directory paths to scan for project-scoped skills + */ + projectPaths?: string[]; + /** + * Optional list of additional skill directory paths to include + */ + skillDirectories?: string[]; + /** + * When true, omit skills from the host's global sources (personal, custom, plugin, and built-in), returning only project-scoped skills. For multitenant deployments. + */ + excludeHostSkills?: boolean; } /** * Name of the skill to enable for the session. @@ -20362,10 +20718,10 @@ export interface SkillsDiscoverRequest { */ /** @experimental */ export interface SkillsEnableRequest { - /** - * Name of the skill to enable - */ - name: string; + /** + * Name of the skill to enable + */ + name: string; } /** * Optional project paths to enumerate. @@ -20375,14 +20731,14 @@ export interface SkillsEnableRequest { */ /** @experimental */ export interface SkillsGetDiscoveryPathsRequest { - /** - * Optional list of project directory paths. When omitted or empty, only personal and custom directories are returned. - */ - projectPaths?: string[]; - /** - * When true, omit the host's personal and custom skill directories, leaving only project directories. For multitenant deployments. - */ - excludeHostSkills?: boolean; + /** + * Optional list of project directory paths. When omitted or empty, only personal and custom directories are returned. + */ + projectPaths?: string[]; + /** + * When true, omit the host's personal and custom skill directories, leaving only project directories. For multitenant deployments. + */ + excludeHostSkills?: boolean; } /** * Skills invoked during this session, ordered by invocation time (most recent last). @@ -20392,10 +20748,10 @@ export interface SkillsGetDiscoveryPathsRequest { */ /** @experimental */ export interface SkillsGetInvokedResult { - /** - * Skills invoked during this session, ordered by invocation time (most recent last) - */ - skills: SkillsInvokedSkill[]; + /** + * Skills invoked during this session, ordered by invocation time (most recent last) + */ + skills: SkillsInvokedSkill[]; } /** * Skill invocation record with name, path, content, allowed tools, and turn number. @@ -20405,30 +20761,30 @@ export interface SkillsGetInvokedResult { */ /** @experimental */ export interface SkillsInvokedSkill { - /** - * Unique identifier for the skill - */ - name: string; - /** - * Path to the SKILL.md file, or an empty string for an SDK-provided skill without a filesystem identity - */ - path: string; - /** - * Full content of the skill file - */ - content: string; - /** - * Tools that should be auto-approved when this skill is active, captured at invocation time - */ - allowedTools?: string[]; - /** - * Whether model invocation was disabled when this skill was invoked - */ - disableModelInvocation?: boolean; - /** - * Turn number when the skill was invoked - */ - invokedAtTurn: number; + /** + * Unique identifier for the skill + */ + name: string; + /** + * Path to the SKILL.md file, or an empty string for an SDK-provided skill without a filesystem identity + */ + path: string; + /** + * Full content of the skill file + */ + content: string; + /** + * Tools that should be auto-approved when this skill is active, captured at invocation time + */ + allowedTools?: string[]; + /** + * Whether model invocation was disabled when this skill was invoked + */ + disableModelInvocation?: boolean; + /** + * Turn number when the skill was invoked + */ + invokedAtTurn: number; } /** * Diagnostics from reloading skill definitions, with warnings and errors as separate lists. @@ -20438,47 +20794,47 @@ export interface SkillsInvokedSkill { */ /** @experimental */ export interface SkillsLoadDiagnostics { - /** - * Warnings emitted while loading skills (e.g. skills that loaded but had issues) - */ - warnings: string[]; - /** - * Errors emitted while loading skills (e.g. skills that failed to load entirely) - */ - errors: string[]; + /** + * Warnings emitted while loading skills (e.g. skills that loaded but had issues) + */ + warnings: string[]; + /** + * Errors emitted while loading skills (e.g. skills that failed to load entirely) + */ + errors: string[]; } /** @experimental */ export interface SlashCommandAddTimelineEntryResult { - /** - * Discriminator for an add-timeline-entry result. - */ - kind: "add-timeline-entry"; - entry: SlashCommandTimelineEntry; - /** - * Optional text the host should prefill into the input editor. - */ - prefillInput?: string; - /** - * Whether command execution changed persisted runtime settings. - */ - runtimeSettingsChanged?: boolean; + /** + * Discriminator for an add-timeline-entry result. + */ + kind: "add-timeline-entry"; + entry: SlashCommandTimelineEntry; + /** + * Optional text the host should prefill into the input editor. + */ + prefillInput?: string; + /** + * Whether command execution changed persisted runtime settings. + */ + runtimeSettingsChanged?: boolean; } /** @experimental */ export interface SlashCommandTimelineEntry { - /** - * Timeline entry presentation type. - */ - type: string; - /** - * Text displayed for the timeline entry. - */ - text: string; - /** - * Optional URL associated with the timeline entry. - */ - url?: string; + /** + * Timeline entry presentation type. + */ + type: string; + /** + * Text displayed for the timeline entry. + */ + text: string; + /** + * Optional URL associated with the timeline entry. + */ + url?: string; } /** * Slash-command invocation result that submits an agent prompt, with display prompt, optional mode, optional user-facing notice, and settings-change flag. @@ -20488,27 +20844,27 @@ export interface SlashCommandTimelineEntry { */ /** @experimental */ export interface SlashCommandAgentPromptResult { - /** - * Agent prompt result discriminator - */ - kind: "agent-prompt"; - /** - * Prompt to submit to the agent - */ - prompt: string; - /** - * Prompt text to display to the user - */ - displayPrompt: string; - mode?: SessionMode; - /** - * Optional user-facing notice to show before the prompt is submitted - */ - notice?: string; - /** - * True when the invocation mutated user runtime settings; consumers caching settings should refresh - */ - runtimeSettingsChanged?: boolean; + /** + * Agent prompt result discriminator + */ + kind: "agent-prompt"; + /** + * Prompt to submit to the agent + */ + prompt: string; + /** + * Prompt text to display to the user + */ + displayPrompt: string; + mode?: SessionMode; + /** + * Optional user-facing notice to show before the prompt is submitted + */ + notice?: string; + /** + * True when the invocation mutated user runtime settings; consumers caching settings should refresh + */ + runtimeSettingsChanged?: boolean; } /** * Slash-command invocation result indicating completion, with optional message and settings-change flag. @@ -20518,19 +20874,19 @@ export interface SlashCommandAgentPromptResult { */ /** @experimental */ export interface SlashCommandCompletedResult { - /** - * Completed result discriminator - */ - kind: "completed"; - /** - * Optional user-facing message describing the completed command - */ - message?: string; - mode?: SessionMode; - /** - * True when the invocation mutated user runtime settings; consumers caching settings should refresh - */ - runtimeSettingsChanged?: boolean; + /** + * Completed result discriminator + */ + kind: "completed"; + /** + * Optional user-facing message describing the completed command + */ + message?: string; + mode?: SessionMode; + /** + * True when the invocation mutated user runtime settings; consumers caching settings should refresh + */ + runtimeSettingsChanged?: boolean; } /** * Slash-command invocation result containing text output plus Markdown/ANSI rendering flags. @@ -20540,26 +20896,26 @@ export interface SlashCommandCompletedResult { */ /** @experimental */ export interface SlashCommandTextResult { - /** - * Text result discriminator - */ - kind: "text"; - /** - * Text output for the client to render - */ - text: string; - /** - * Whether text contains Markdown - */ - markdown?: boolean; - /** - * Whether ANSI sequences should be preserved - */ - preserveAnsi?: boolean; - /** - * True when the invocation mutated user runtime settings; consumers caching settings should refresh - */ - runtimeSettingsChanged?: boolean; + /** + * Text result discriminator + */ + kind: "text"; + /** + * Text output for the client to render + */ + text: string; + /** + * Whether text contains Markdown + */ + markdown?: boolean; + /** + * Whether ANSI sequences should be preserved + */ + preserveAnsi?: boolean; + /** + * True when the invocation mutated user runtime settings; consumers caching settings should refresh + */ + runtimeSettingsChanged?: boolean; } /** * Slash-command invocation result asking the client to present subcommand options for a parent command. @@ -20569,26 +20925,26 @@ export interface SlashCommandTextResult { */ /** @experimental */ export interface SlashCommandSelectSubcommandResult { - /** - * Select subcommand result discriminator - */ - kind: "select-subcommand"; - /** - * Parent command name that requires subcommand selection - */ - command: string; - /** - * Human-readable title for the selection UI - */ - title: string; - /** - * Available subcommand options for the client to present - */ - options: SlashCommandSelectSubcommandOption[]; - /** - * True when the invocation mutated user runtime settings; consumers caching settings should refresh - */ - runtimeSettingsChanged?: boolean; + /** + * Select subcommand result discriminator + */ + kind: "select-subcommand"; + /** + * Parent command name that requires subcommand selection + */ + command: string; + /** + * Human-readable title for the selection UI + */ + title: string; + /** + * Available subcommand options for the client to present + */ + options: SlashCommandSelectSubcommandOption[]; + /** + * True when the invocation mutated user runtime settings; consumers caching settings should refresh + */ + runtimeSettingsChanged?: boolean; } /** * Selectable slash-command subcommand option with name, description, and optional group label. @@ -20598,107 +20954,107 @@ export interface SlashCommandSelectSubcommandResult { */ /** @experimental */ export interface SlashCommandSelectSubcommandOption { - /** - * Subcommand name to invoke - */ - name: string; - /** - * Human-readable description of the subcommand - */ - description: string; - /** - * Optional group label for organizing options - */ - group?: string; + /** + * Subcommand name to invoke + */ + name: string; + /** + * Human-readable description of the subcommand + */ + description: string; + /** + * Optional group label for organizing options + */ + group?: string; } /** @experimental */ export interface SlashCommandShowDialogResult { - /** - * Discriminator for a show-dialog result. - */ - kind: "show-dialog"; - dialog: SlashCommandModelPickerDialog; - /** - * Whether command execution changed persisted runtime settings. - */ - runtimeSettingsChanged?: boolean; + /** + * Discriminator for a show-dialog result. + */ + kind: "show-dialog"; + dialog: SlashCommandModelPickerDialog; + /** + * Whether command execution changed persisted runtime settings. + */ + runtimeSettingsChanged?: boolean; } /** @experimental */ export interface SlashCommandModelPickerDialog { - /** - * Discriminator for a model-picker dialog. - */ - kind: "model-picker"; - /** - * Model that should be enabled before it can be selected. - */ - modelToEnable?: string; - /** - * Settings scope the picker should modify. - */ - scope?: string; - /** - * Model-selection target represented by the picker. - */ - target?: string; + /** + * Discriminator for a model-picker dialog. + */ + kind: "model-picker"; + /** + * Model that should be enabled before it can be selected. + */ + modelToEnable?: string; + /** + * Settings scope the picker should modify. + */ + scope?: string; + /** + * Model-selection target represented by the picker. + */ + target?: string; } /** @experimental */ export interface SlashCommandSetModelResult { - /** - * Discriminator for a set-model result. - */ - kind: "set-model"; - /** - * Model selected by the command. - */ - model: string; - /** - * Settings scope modified by the command. - */ - scope?: string; - /** - * User-facing warning produced while selecting the model. - */ - warning?: string; - /** - * Reasoning effort selected for the model. - */ - reasoningEffort?: string; - /** - * User-settings snapshot to restore if the host cancels the model switch. - */ - revertOnCancel?: {}; - /** - * Repository settings scope modified by the command. - */ - repoScope?: string; - /** - * Whether command execution changed persisted runtime settings. - */ - runtimeSettingsChanged?: boolean; + /** + * Discriminator for a set-model result. + */ + kind: "set-model"; + /** + * Model selected by the command. + */ + model: string; + /** + * Settings scope modified by the command. + */ + scope?: string; + /** + * User-facing warning produced while selecting the model. + */ + warning?: string; + /** + * Reasoning effort selected for the model. + */ + reasoningEffort?: string; + /** + * User-settings snapshot to restore if the host cancels the model switch. + */ + revertOnCancel?: {}; + /** + * Repository settings scope modified by the command. + */ + repoScope?: string; + /** + * Whether command execution changed persisted runtime settings. + */ + runtimeSettingsChanged?: boolean; } /** @experimental */ export interface SlashCommandSetPlanModelResult { - /** - * Discriminator for a set-plan-model result. - */ - kind: "set-plan-model"; - /** - * Dedicated model selected for plan mode. - */ - planModel?: string; - /** - * User-facing confirmation message for the plan-model selection. - */ - message: string; - /** - * Whether command execution changed persisted runtime settings. - */ - runtimeSettingsChanged?: boolean; + /** + * Discriminator for a set-plan-model result. + */ + kind: "set-plan-model"; + /** + * Dedicated model selected for plan mode. + */ + planModel?: string; + /** + * User-facing confirmation message for the plan-model selection. + */ + message: string; + /** + * Whether command execution changed persisted runtime settings. + */ + runtimeSettingsChanged?: boolean; } /** * Subagent model, reasoning effort, and context tier settings @@ -20708,16 +21064,16 @@ export interface SlashCommandSetPlanModelResult { */ /** @experimental */ export interface SubagentSettingsEntry { - /** - * Model override for matching subagents - */ - model?: string; - modelPolicy?: AgentModelPolicy; - /** - * Reasoning effort override for matching subagents - */ - effortLevel?: string; - contextTier?: SubagentSettingsEntryContextTier; + /** + * Model override for matching subagents + */ + model?: string; + modelPolicy?: AgentModelPolicy; + /** + * Reasoning effort override for matching subagents + */ + effortLevel?: string; + contextTier?: SubagentSettingsEntryContextTier; } /** * Tracked background agent task metadata, including IDs, status, timing, agent type, prompt, model, result, and latest response. @@ -20727,147 +21083,298 @@ export interface SubagentSettingsEntry { */ /** @experimental */ export interface TaskAgentInfo { - /** - * Task kind - */ - type: "agent"; - /** - * Unique task identifier - */ - id: string; - /** - * Tool call ID associated with this agent task - */ - toolCallId: string; - /** - * Friendly, non-unique name intended for display - */ - displayName?: string; - /** - * Short description of the task - */ - description: string; - status: TaskStatus; - /** - * ISO 8601 timestamp when the task was started - */ - startedAt: string; - /** - * ISO 8601 timestamp when the task finished - */ - completedAt?: string; - /** - * Accumulated active execution time in milliseconds - */ - activeTimeMs?: number; - /** - * ISO 8601 timestamp when the current active period began - */ - activeStartedAt?: string; - /** - * Error message when the task failed - */ - error?: string; - /** - * Type of agent running this task - */ - agentType: string; - /** - * Most recent prompt delivered to the agent. Updated whenever the agent receives a follow-up message. - */ - prompt: string; - /** - * Result text from the task when available - */ - result?: string; - /** - * Requested model override for the task when specified - */ - model?: string; - /** - * Runtime model resolved for the task when available - */ - resolvedModel?: string; - executionMode?: TaskExecutionMode; - /** - * Whether the task is currently in the original sync wait and can be moved to background mode. False once it is already backgrounded, idle, finished, or no longer has a promotable sync waiter. - */ - canPromoteToBackground?: boolean; - /** - * Most recent response text from the agent - */ - latestResponse?: string; - /** - * ISO 8601 timestamp when the agent entered idle state - */ - idleSince?: string; + /** + * Task kind + */ + type: "agent"; + /** + * Unique task identifier + */ + id: string; + /** + * Tool call ID associated with this agent task + */ + toolCallId: string; + /** + * Friendly, non-unique name intended for display + */ + displayName?: string; + /** + * Short description of the task + */ + description: string; + status: TaskStatus; + /** + * ISO 8601 timestamp when the task was started + */ + startedAt: string; + /** + * ISO 8601 timestamp when the task finished + */ + completedAt?: string; + /** + * Accumulated active execution time in milliseconds + */ + activeTimeMs?: number; + /** + * ISO 8601 timestamp when the current active period began + */ + activeStartedAt?: string; + /** + * Error message when the task failed + */ + error?: string; + /** + * Type of agent running this task + */ + agentType: string; + /** + * Most recent prompt delivered to the agent. Updated whenever the agent receives a follow-up message. + */ + prompt: string; + /** + * Result text from the task when available + */ + result?: string; + /** + * Requested model override for the task when specified + */ + model?: string; + /** + * Runtime model resolved for the task when available + */ + resolvedModel?: string; + executionMode?: TaskExecutionMode; + /** + * Whether the task is currently in the original sync wait and can be moved to background mode. False once it is already backgrounded, idle, finished, or no longer has a promotable sync waiter. + */ + canPromoteToBackground?: boolean; + /** + * Most recent response text from the agent + */ + latestResponse?: string; + /** + * ISO 8601 timestamp when the agent entered idle state + */ + idleSince?: string; +} +/** + * Progress snapshot for an agent task, with recent activity lines and optional latest intent. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskAgentProgress". + */ +/** @experimental */ +export interface TaskAgentProgress { + /** + * Progress kind + */ + type: "agent"; + /** + * Recent tool execution events converted to display lines + */ + recentActivity: TaskProgressLine[]; + /** + * The most recent intent reported by the agent + */ + latestIntent?: string; +} +/** + * Timestamped display line for task progress output or recent agent activity. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskProgressLine". + */ +/** @experimental */ +export interface TaskProgressLine { + /** + * Display message, e.g., "▸ bash", "✓ edit src/foo.ts" + */ + message: string; + /** + * ISO 8601 timestamp when this event occurred + */ + timestamp: string; +} +/** + * Tracked client-owned task metadata. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TaskClientInfo". + */ +/** @experimental */ +export interface TaskClientInfo { + type: TaskClientType; + /** + * Canonical runtime-generated task identifier + */ + id: string; + /** + * Owner-scoped registration and reclaim key + */ + clientTaskId: string; + /** + * Optional task display name + */ + displayName?: string; + /** + * Task description + */ + description: string; + status: TaskClientStatus; + owner: TaskClientOwner; + /** + * ISO 8601 timestamp when the task started + */ + startedAt: string; + /** + * ISO 8601 timestamp of the latest accepted lifecycle change + */ + updatedAt: string; + /** + * ISO 8601 timestamp when the task reached a terminal status + */ + completedAt?: string; + /** + * Accumulated active execution time in milliseconds + */ + activeTimeMs: number; + /** + * ISO 8601 timestamp when the current active segment started + */ + activeStartedAt?: string; + /** + * ISO 8601 timestamp when the connected owner entered idle status + */ + idleSince?: string; + /** + * ISO 8601 timestamp of the most recent orphan transition + */ + orphanedAt?: string; + /** + * ISO 8601 timestamp of the most recent successful reclaim + */ + reclaimedAt?: string; + executionMode: TaskClientExecutionMode; + /** + * Whether the currently bound owner can receive a cancellation request + */ + canCancel: boolean; + /** + * Sequence number of the latest accepted owner update + */ + sequence: number; + /** + * Opaque successful terminal result supplied by the task owner + */ + result?: JsonValue; + /** + * Human-readable terminal failure message + */ + error?: string; + /** + * Optional owner-supplied terminal failure code + */ + errorCode?: string; + /** + * Human-readable reason for terminal cancellation + */ + cancellationReason?: string; } /** - * Progress snapshot for an agent task, with recent activity lines and optional latest intent. + * Public owner attribution for a client-owned task. Identifiers are opaque and never authorize requests. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema - * via the `definition` "TaskAgentProgress". + * via the `definition` "TaskClientOwner". */ /** @experimental */ -export interface TaskAgentProgress { - /** - * Progress kind - */ - type: "agent"; - /** - * Recent tool execution events converted to display lines - */ - recentActivity: TaskProgressLine[]; - /** - * The most recent intent reported by the agent - */ - latestIntent?: string; +export interface TaskClientOwner { + /** + * Opaque session-scoped participant identity + */ + participantId: string; + /** + * Opaque identity of the currently or most recently bound session join + */ + joinId: string; + kind: TaskClientOwnerKind; + /** + * Display-only owner name + */ + displayName?: string; + /** + * Display-only owner source + */ + source?: string; + presence: TaskClientOwnerPresence; + /** + * ISO 8601 timestamp when the bound join disconnected + */ + disconnectedAt?: string; } /** - * Timestamped display line for task progress output or recent agent activity. + * Generic progress for a client-owned task. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema - * via the `definition` "TaskProgressLine". + * via the `definition` "TaskClientProgress". */ /** @experimental */ -export interface TaskProgressLine { - /** - * Display message, e.g., "▸ bash", "✓ edit src/foo.ts" - */ - message: string; - /** - * ISO 8601 timestamp when this event occurred - */ - timestamp: string; +export interface TaskClientProgress { + type: TaskClientType; + status: TaskClientStatus; + /** + * Sequence number of the latest accepted owner update + */ + sequence: number; + /** + * ISO 8601 timestamp of the latest accepted lifecycle change + */ + updatedAt: string; + /** + * Current owner-defined progress phase + */ + phase?: string; + /** + * Current completion percentage from zero through one hundred + */ + percentage?: number; + /** + * Most recent nonempty progress message + */ + lastMessage?: string; + /** + * Recent server-timestamped progress messages + */ + recentActivity: TaskProgressLine[]; } /** @experimental */ export interface TaskCompletionDecision { - outcome: TaskCompletionOutcome; - /** - * Rationale for the completion decision, when one is available. - */ - reason?: string; - /** - * Whether the rationale was derived from completion-reviewer output. - */ - reviewerDerived?: boolean; - /** - * Information-flow metadata captured from the completion reviewer. - */ - reviewerResultMeta?: JsonValue; - /** - * Active autopilot objective evaluated by the completion reviewer. - */ - objectiveId?: number; - /** - * Whether completion was accepted after the reviewer-rejection budget was exhausted. - */ - completionRejectionBudgetExhausted?: boolean; - /** - * Objective eligibility token captured when the decision was evaluated. - */ - completionEligibilityToken?: number; + outcome: TaskCompletionOutcome; + /** + * Rationale for the completion decision, when one is available. + */ + reason?: string; + /** + * Whether the rationale was derived from completion-reviewer output. + */ + reviewerDerived?: boolean; + /** + * Information-flow metadata captured from the completion reviewer. + */ + reviewerResultMeta?: JsonValue; + /** + * Active autopilot objective evaluated by the completion reviewer. + */ + objectiveId?: number; + /** + * Whether completion was accepted after the reviewer-rejection budget was exhausted. + */ + completionRejectionBudgetExhausted?: boolean; + /** + * Objective eligibility token captured when the decision was evaluated. + */ + completionEligibilityToken?: number; } /** * Tracked shell task metadata, including ID, command, status, timing, attachment/execution mode, log path, and PID. @@ -20877,45 +21384,45 @@ export interface TaskCompletionDecision { */ /** @experimental */ export interface TaskShellInfo { - /** - * Task kind - */ - type: "shell"; - /** - * Unique task identifier - */ - id: string; - /** - * Short description of the task - */ - description: string; - status: TaskStatus; - /** - * ISO 8601 timestamp when the task was started - */ - startedAt: string; - /** - * ISO 8601 timestamp when the task finished - */ - completedAt?: string; - /** - * Command being executed - */ - command: string; - attachmentMode: TaskShellInfoAttachmentMode; - executionMode?: TaskExecutionMode; - /** - * Whether this shell task can be promoted to background mode - */ - canPromoteToBackground?: boolean; - /** - * Path to the detached shell log, when available - */ - logPath?: string; - /** - * Process ID when available - */ - pid?: number; + /** + * Task kind + */ + type: "shell"; + /** + * Unique task identifier + */ + id: string; + /** + * Short description of the task + */ + description: string; + status: TaskStatus; + /** + * ISO 8601 timestamp when the task was started + */ + startedAt: string; + /** + * ISO 8601 timestamp when the task finished + */ + completedAt?: string; + /** + * Command being executed + */ + command: string; + attachmentMode: TaskShellInfoAttachmentMode; + executionMode?: TaskExecutionMode; + /** + * Whether this shell task can be promoted to background mode + */ + canPromoteToBackground?: boolean; + /** + * Path to the detached shell log, when available + */ + logPath?: string; + /** + * Process ID when available + */ + pid?: number; } /** * Background tasks currently tracked by the session. @@ -20925,10 +21432,10 @@ export interface TaskShellInfo { */ /** @experimental */ export interface TaskList { - /** - * Currently tracked tasks - */ - tasks: TaskInfo[]; + /** + * Currently tracked tasks + */ + tasks: TaskInfo[]; } /** * Progress snapshot for a shell task, with recent stdout/stderr output and optional process ID. @@ -20938,18 +21445,18 @@ export interface TaskList { */ /** @experimental */ export interface TaskShellProgress { - /** - * Progress kind - */ - type: "shell"; - /** - * Recent stdout/stderr lines from the running shell command - */ - recentOutput: string; - /** - * Process ID when available - */ - pid?: number; + /** + * Progress kind + */ + type: "shell"; + /** + * Recent stdout/stderr lines from the running shell command + */ + recentOutput: string; + /** + * Process ID when available + */ + pid?: number; } /** * Identifier of the background task to cancel. @@ -20959,10 +21466,10 @@ export interface TaskShellProgress { */ /** @experimental */ export interface TasksCancelRequest { - /** - * Task identifier - */ - id: string; + /** + * Task identifier + */ + id: string; } /** * Indicates whether the background task was successfully cancelled. @@ -20972,10 +21479,10 @@ export interface TasksCancelRequest { */ /** @experimental */ export interface TasksCancelResult { - /** - * Whether the task was successfully cancelled - */ - cancelled: boolean; + /** + * Whether the task was successfully cancelled + */ + cancelled: boolean; } /** * The first sync-waiting task that can currently be promoted to background mode. @@ -20985,7 +21492,7 @@ export interface TasksCancelResult { */ /** @experimental */ export interface TasksGetCurrentPromotableResult { - task?: TaskInfo; + task?: TaskInfo; } /** * Identifier of the background task to fetch progress for. @@ -20995,10 +21502,10 @@ export interface TasksGetCurrentPromotableResult { */ /** @experimental */ export interface TasksGetProgressRequest { - /** - * Task identifier (agent ID or shell ID) - */ - id: string; + /** + * Task identifier (agent ID or shell ID) + */ + id: string; } /** * Progress information for the task, or null when no task with that ID is tracked. @@ -21008,10 +21515,10 @@ export interface TasksGetProgressRequest { */ /** @experimental */ export interface TasksGetProgressResult { - /** - * Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. - */ - progress?: TaskProgress | null; + /** + * Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. + */ + progress?: TaskProgress | null; } /** * The promoted task as it now exists in background mode, omitted if no promotable task was waiting. @@ -21021,7 +21528,7 @@ export interface TasksGetProgressResult { */ /** @experimental */ export interface TasksPromoteCurrentToBackgroundResult { - task?: TaskInfo; + task?: TaskInfo; } /** * Identifier of the task to promote to background mode. @@ -21031,10 +21538,10 @@ export interface TasksPromoteCurrentToBackgroundResult { */ /** @experimental */ export interface TasksPromoteToBackgroundRequest { - /** - * Task identifier - */ - id: string; + /** + * Task identifier + */ + id: string; } /** * Indicates whether the task was successfully promoted to background mode. @@ -21044,10 +21551,10 @@ export interface TasksPromoteToBackgroundRequest { */ /** @experimental */ export interface TasksPromoteToBackgroundResult { - /** - * Whether the task was successfully promoted to background mode - */ - promoted: boolean; + /** + * Whether the task was successfully promoted to background mode + */ + promoted: boolean; } /** * Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop. @@ -21057,6 +21564,54 @@ export interface TasksPromoteToBackgroundResult { */ /** @experimental */ export interface TasksRefreshResult {} +/** + * Registers or reclaims a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TasksRegisterRequest". + */ +/** @experimental */ +export interface TasksRegisterRequest { + type: TaskClientType; + /** + * Owner-scoped idempotency key used for registration and reclaim + */ + clientTaskId: string; + /** + * Human-readable description of the external work + */ + description: string; + /** + * Optional short display name for the external work + */ + displayName?: string; + /** + * Whether the owner supports runtime cancellation requests + */ + cancellable: boolean; + /** + * Expected current sequence for idempotent registration or orphan reclaim + */ + expectedSequence?: number; +} +/** + * Result of registering or reclaiming a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TasksRegisterResult". + */ +/** @experimental */ +export interface TasksRegisterResult { + task: TaskClientInfo; + /** + * True only when this invocation created a new task + */ + created: boolean; + /** + * True only when this invocation reclaimed an orphaned task + */ + reclaimed: boolean; +} /** * Identifier of the completed or cancelled task to remove from tracking. * @@ -21065,10 +21620,10 @@ export interface TasksRefreshResult {} */ /** @experimental */ export interface TasksRemoveRequest { - /** - * Task identifier - */ - id: string; + /** + * Task identifier + */ + id: string; } /** * Indicates whether the task was removed. False when the task does not exist or is still running/idle. @@ -21078,10 +21633,10 @@ export interface TasksRemoveRequest { */ /** @experimental */ export interface TasksRemoveResult { - /** - * Whether the task was removed. Returns false if the task does not exist or is still running/idle (cancel it first). - */ - removed: boolean; + /** + * Whether the task was removed. Returns false if the task does not exist or is still running/idle (cancel it first). + */ + removed: boolean; } /** * Identifier of the target agent task, message content, and optional sender agent ID. @@ -21091,18 +21646,18 @@ export interface TasksRemoveResult { */ /** @experimental */ export interface TasksSendMessageRequest { - /** - * Agent task identifier - */ - id: string; - /** - * Message content to send to the agent - */ - message: string; - /** - * Agent ID of the sender, if sent on behalf of another agent - */ - fromAgentId?: string; + /** + * Agent task identifier + */ + id: string; + /** + * Message content to send to the agent + */ + message: string; + /** + * Agent ID of the sender, if sent on behalf of another agent + */ + fromAgentId?: string; } /** * Indicates whether the message was delivered, with an error message when delivery failed. @@ -21112,14 +21667,14 @@ export interface TasksSendMessageRequest { */ /** @experimental */ export interface TasksSendMessageResult { - /** - * Whether the message was successfully delivered or steered - */ - sent: boolean; - /** - * Error message if delivery failed - */ - error?: string; + /** + * Whether the message was successfully delivered or steered + */ + sent: boolean; + /** + * Error message if delivery failed + */ + error?: string; } /** * Agent type, prompt, name, and optional description and model override for the new task. @@ -21129,26 +21684,26 @@ export interface TasksSendMessageResult { */ /** @experimental */ export interface TasksStartAgentRequest { - /** - * Type of agent to start (e.g., 'explore', 'task', 'general-purpose') - */ - agentType: string; - /** - * Task prompt for the agent - */ - prompt: string; - /** - * Friendly, non-unique name used when displaying the agent - */ - name: string; - /** - * Short description of the task - */ - description?: string; - /** - * Optional model override - */ - model?: string; + /** + * Type of agent to start (e.g., 'explore', 'task', 'general-purpose') + */ + agentType: string; + /** + * Task prompt for the agent + */ + prompt: string; + /** + * Friendly, non-unique name used when displaying the agent + */ + name: string; + /** + * Short description of the task + */ + description?: string; + /** + * Optional model override + */ + model?: string; } /** * Identifier assigned to the newly started background agent task. @@ -21158,10 +21713,46 @@ export interface TasksStartAgentRequest { */ /** @experimental */ export interface TasksStartAgentResult { - /** - * Generated agent ID for the background task - */ - agentId: string; + /** + * Generated agent ID for the background task + */ + agentId: string; +} +/** + * Updates a client-owned task. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TasksUpdateRequest". + */ +/** @experimental */ +export interface TasksUpdateRequest { + /** + * Canonical runtime-generated task identifier + */ + id: string; + /** + * Owner update sequence to apply + */ + sequence: number; + update: TaskClientUpdate; +} +/** + * Result of publishing a client-owned task update. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "TasksUpdateResult". + */ +/** @experimental */ +export interface TasksUpdateResult { + task: TaskClientInfo; + /** + * Whether this invocation changed task state + */ + applied: boolean; + /** + * Whether this invocation repeated the latest accepted update + */ + duplicate: boolean; } /** * Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS). @@ -21179,12 +21770,12 @@ export interface TasksWaitForPendingResult {} */ /** @experimental */ export interface TelemetrySetFeatureOverridesRequest { - /** - * Override key/value pairs to attach to subsequent telemetry events from this session. Replaces any previously-set overrides. - */ - features: { - [k: string]: string | undefined; - }; + /** + * Override key/value pairs to attach to subsequent telemetry events from this session. Replaces any previously-set overrides. + */ + features: { + [k: string]: string | undefined; + }; } /** * Built-in tool metadata with identifier, optional namespaced name, description, input-parameter schema, and usage instructions. @@ -21194,28 +21785,28 @@ export interface TelemetrySetFeatureOverridesRequest { */ /** @experimental */ export interface Tool { - /** - * Tool identifier (e.g., "bash", "grep", "str_replace_editor") - */ - name: string; - /** - * Optional namespaced name for declarative filtering (e.g., "playwright/navigate" for MCP tools) - */ - namespacedName?: string; - /** - * Description of what the tool does - */ - description: string; - /** - * JSON Schema for the tool's input parameters - */ - parameters?: { - [k: string]: JsonValue | undefined; - }; - /** - * Optional instructions for how to use this tool effectively - */ - instructions?: string; + /** + * Tool identifier (e.g., "bash", "grep", "str_replace_editor") + */ + name: string; + /** + * Optional namespaced name for declarative filtering (e.g., "playwright/navigate" for MCP tools) + */ + namespacedName?: string; + /** + * Description of what the tool does + */ + description: string; + /** + * JSON Schema for the tool's input parameters + */ + parameters?: { + [k: string]: JsonValue | undefined; + }; + /** + * Optional instructions for how to use this tool effectively + */ + instructions?: string; } /** * Built-in tools available for the requested model, with their parameters and instructions. @@ -21225,10 +21816,10 @@ export interface Tool { */ /** @experimental */ export interface ToolList { - /** - * List of available built-in tools with metadata - */ - tools: Tool[]; + /** + * List of available built-in tools with metadata + */ + tools: Tool[]; } /** * Expanded canonical result returned by a session tool. @@ -21238,70 +21829,70 @@ export interface ToolList { */ /** @experimental */ export interface ToolResultExpanded { - /** - * Text result returned to the model. - */ - textResultForLlm: string; - resultType: ToolResultType; - /** - * Base64-encoded binary results returned to the model. - */ - binaryResultsForLlm?: ExternalToolTextResultForLlmBinaryResultsForLlm[]; - /** - * Detailed log content available for session display. - */ - sessionLog?: string; - /** - * Error message for an unsuccessful execution. - */ - error?: string; - /** - * Tool-specific telemetry payload. - */ - toolTelemetry?: JsonValue; - /** - * Whether large-output post-processing should be skipped. - */ - skipLargeOutputProcessing?: boolean; - /** - * Messages to inject after the tool result. - */ - newMessages?: ToolResultNewMessage[]; - /** - * Structured content blocks returned to the model. - */ - contents?: ExternalToolTextResultForLlmContent[]; - /** - * Deferred tool names made available by this result. - */ - toolReferences?: string[]; - /** - * Sources returned by the tool that the model may cite. - */ - citableSources?: JsonValue[]; - /** - * Skill invocation metadata produced by the tool. - */ - skillInvocation?: JsonValue; - /** - * Whether post-tool-use failure hooks have already processed this result. - */ - postToolUseFailureHooksProcessed?: boolean; - /** - * Optional UI resource produced by the tool. - */ - uiResource?: JsonValue; - /** - * Metadata propagated with the tool result, including information-flow labels. - */ - mcpMeta?: { - [k: string]: JsonValue | undefined; - }; - /** - * Structured result content in addition to the model-facing text. - */ - structuredContent?: JsonValue; - taskCompletionDecision?: TaskCompletionDecision; + /** + * Text result returned to the model. + */ + textResultForLlm: string; + resultType: ToolResultType; + /** + * Base64-encoded binary results returned to the model. + */ + binaryResultsForLlm?: ExternalToolTextResultForLlmBinaryResultsForLlm[]; + /** + * Detailed log content available for session display. + */ + sessionLog?: string; + /** + * Error message for an unsuccessful execution. + */ + error?: string; + /** + * Tool-specific telemetry payload. + */ + toolTelemetry?: JsonValue; + /** + * Whether large-output post-processing should be skipped. + */ + skipLargeOutputProcessing?: boolean; + /** + * Messages to inject after the tool result. + */ + newMessages?: ToolResultNewMessage[]; + /** + * Structured content blocks returned to the model. + */ + contents?: ExternalToolTextResultForLlmContent[]; + /** + * Deferred tool names made available by this result. + */ + toolReferences?: string[]; + /** + * Sources returned by the tool that the model may cite. + */ + citableSources?: JsonValue[]; + /** + * Skill invocation metadata produced by the tool. + */ + skillInvocation?: JsonValue; + /** + * Whether post-tool-use failure hooks have already processed this result. + */ + postToolUseFailureHooksProcessed?: boolean; + /** + * Optional UI resource produced by the tool. + */ + uiResource?: JsonValue; + /** + * Metadata propagated with the tool result, including information-flow labels. + */ + mcpMeta?: { + [k: string]: JsonValue | undefined; + }; + /** + * Structured result content in addition to the model-facing text. + */ + structuredContent?: JsonValue; + taskCompletionDecision?: TaskCompletionDecision; } /** * A message injected by a tool result. @@ -21311,14 +21902,14 @@ export interface ToolResultExpanded { */ /** @experimental */ export interface ToolResultNewMessage { - /** - * Message content to inject after the tool result. - */ - content: string; - /** - * Source attributed to the injected message. - */ - source: string; + /** + * Message content to inject after the tool result. + */ + content: string; + /** + * Source attributed to the injected message. + */ + source: string; } /** * A tool name and arguments to execute through the session's native invocation pipeline. @@ -21328,18 +21919,18 @@ export interface ToolResultNewMessage { */ /** @experimental */ export interface ToolsExecuteRequest { - /** - * Name of the currently offered tool to execute. - */ - name: string; - /** - * Arguments supplied to the tool. - */ - arguments: JsonValue; - /** - * Optional identifier used to correlate this invocation with its tool call. - */ - toolCallId?: string; + /** + * Name of the currently offered tool to execute. + */ + name: string; + /** + * Arguments supplied to the tool. + */ + arguments: JsonValue; + /** + * Optional identifier used to correlate this invocation with its tool call. + */ + toolCallId?: string; } /** * Options controlling how Rust-owned built-in tool descriptors are materialized. @@ -21349,31 +21940,31 @@ export interface ToolsExecuteRequest { */ /** @experimental */ export interface ToolsGetBuiltinDescriptorsRequest { - /** - * Whether descriptors should favor fewer user-intervention prompts. - */ - reduceUserIntervention?: boolean; - /** - * Whether tool descriptors should include authoring metadata. - */ - includeAuthor?: boolean; - /** - * Whether semantic skill lookup is available. - */ - skillEmbeddingEnabled?: boolean; - shellConfig?: ToolsShellDescriptorConfig; - /** - * Whether the configured shell supports PowerShell 7 syntax. - */ - shellSupportsPowerShell7Syntax?: boolean; - /** - * Default shell timeout in milliseconds. - */ - shellTimeoutMs?: number; - /** - * Whether background task completion notifications are enabled. - */ - backgroundTaskNotificationsEnabled?: boolean; + /** + * Whether descriptors should favor fewer user-intervention prompts. + */ + reduceUserIntervention?: boolean; + /** + * Whether tool descriptors should include authoring metadata. + */ + includeAuthor?: boolean; + /** + * Whether semantic skill lookup is available. + */ + skillEmbeddingEnabled?: boolean; + shellConfig?: ToolsShellDescriptorConfig; + /** + * Whether the configured shell supports PowerShell 7 syntax. + */ + shellSupportsPowerShell7Syntax?: boolean; + /** + * Default shell timeout in milliseconds. + */ + shellTimeoutMs?: number; + /** + * Whether background task completion notifications are enabled. + */ + backgroundTaskNotificationsEnabled?: boolean; } /** * Shell-specific names and description lines used to materialize built-in shell tool descriptors. @@ -21383,34 +21974,34 @@ export interface ToolsGetBuiltinDescriptorsRequest { */ /** @experimental */ export interface ToolsShellDescriptorConfig { - /** - * Stable shell type identifier. - */ - shellType: string; - /** - * Human-readable shell name. - */ - displayName: string; - /** - * Tool name used to start shell commands. - */ - shellToolName: string; - /** - * Tool name used to read shell output. - */ - readShellToolName: string; - /** - * Tool name used to stop shell commands. - */ - stopShellToolName: string; - /** - * Tool name used to list active shells. - */ - listShellsToolName: string; - /** - * Additional model-facing shell description lines. - */ - descriptionLines: string[]; + /** + * Stable shell type identifier. + */ + shellType: string; + /** + * Human-readable shell name. + */ + displayName: string; + /** + * Tool name used to start shell commands. + */ + shellToolName: string; + /** + * Tool name used to read shell output. + */ + readShellToolName: string; + /** + * Tool name used to stop shell commands. + */ + stopShellToolName: string; + /** + * Tool name used to list active shells. + */ + listShellsToolName: string; + /** + * Additional model-facing shell description lines. + */ + descriptionLines: string[]; } /** * Rust-owned built-in tool descriptors for the session. @@ -21420,10 +22011,10 @@ export interface ToolsShellDescriptorConfig { */ /** @experimental */ export interface ToolsGetBuiltinDescriptorsResult { - /** - * Built-in tool descriptors materialized for the session. - */ - tools: BuiltinToolDescriptor[]; + /** + * Built-in tool descriptors materialized for the session. + */ + tools: BuiltinToolDescriptor[]; } /** * Current lightweight tool metadata snapshot for the session. @@ -21433,10 +22024,10 @@ export interface ToolsGetBuiltinDescriptorsResult { */ /** @experimental */ export interface ToolsGetCurrentMetadataResult { - /** - * Current tool metadata, or null when tools have not been initialized yet - */ - tools: CurrentToolMetadata[] | null; + /** + * Current tool metadata, or null when tools have not been initialized yet + */ + tools: CurrentToolMetadata[] | null; } /** * Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation. @@ -21454,10 +22045,10 @@ export interface ToolsInitializeAndValidateResult {} */ /** @experimental */ export interface ToolsListRequest { - /** - * Optional model ID — when provided, the returned tool list reflects model-specific overrides - */ - model?: string; + /** + * Optional model ID — when provided, the returned tool list reflects model-specific overrides + */ + model?: string; } /** * Complete externally implemented tool list for the calling connection. An empty list removes every tool previously supplied by that connection. @@ -21467,10 +22058,10 @@ export interface ToolsListRequest { */ /** @experimental */ export interface ToolsSetRequest { - /** - * Complete replacement list for the calling connection. - */ - tools: ProtocolExternalToolDefinition[]; + /** + * Complete replacement list for the calling connection. + */ + tools: ProtocolExternalToolDefinition[]; } /** * Empty result after replacing the calling connection's externally implemented tools. @@ -21488,11 +22079,11 @@ export interface ToolsSetResult {} */ /** @experimental */ export interface ToolsTaskCompleteEventDataRequest { - /** - * Arguments supplied to the completed task_complete tool call. - */ - toolArgs: JsonValue; - finalResult: ToolResultExpanded; + /** + * Arguments supplied to the completed task_complete tool call. + */ + toolArgs: JsonValue; + finalResult: ToolResultExpanded; } /** * Empty result after applying subagent settings @@ -21510,31 +22101,31 @@ export interface ToolsUpdateSubagentSettingsResult {} */ /** @experimental */ export interface UIElicitationArrayAnyOfField { - /** - * Type discriminator. Always "array". - */ - type: "array"; - /** - * Human-readable label for the field. - */ - title?: string; - /** - * Help text describing the field. - */ - description?: string; - /** - * Minimum number of items the user must select. - */ - minItems?: number; - /** - * Maximum number of items the user may select. - */ - maxItems?: number; - items: UIElicitationArrayAnyOfFieldItems; - /** - * Default values selected when the form is first shown. - */ - default?: string[]; + /** + * Type discriminator. Always "array". + */ + type: "array"; + /** + * Human-readable label for the field. + */ + title?: string; + /** + * Help text describing the field. + */ + description?: string; + /** + * Minimum number of items the user must select. + */ + minItems?: number; + /** + * Maximum number of items the user may select. + */ + maxItems?: number; + items: UIElicitationArrayAnyOfFieldItems; + /** + * Default values selected when the form is first shown. + */ + default?: string[]; } /** * Schema applied to each item in the array. @@ -21544,10 +22135,10 @@ export interface UIElicitationArrayAnyOfField { */ /** @experimental */ export interface UIElicitationArrayAnyOfFieldItems { - /** - * Selectable options, each with a value and a display label. - */ - anyOf: UIElicitationArrayAnyOfFieldItemsAnyOf[]; + /** + * Selectable options, each with a value and a display label. + */ + anyOf: UIElicitationArrayAnyOfFieldItemsAnyOf[]; } /** * Selectable option for a UI elicitation multi-select array item, with submitted value and display label. @@ -21557,14 +22148,14 @@ export interface UIElicitationArrayAnyOfFieldItems { */ /** @experimental */ export interface UIElicitationArrayAnyOfFieldItemsAnyOf { - /** - * Value submitted when this option is selected. - */ - const: string; - /** - * Display label for this option. - */ - title: string; + /** + * Value submitted when this option is selected. + */ + const: string; + /** + * Display label for this option. + */ + title: string; } /** * Multi-select string field whose allowed values are defined inline. @@ -21574,31 +22165,31 @@ export interface UIElicitationArrayAnyOfFieldItemsAnyOf { */ /** @experimental */ export interface UIElicitationArrayEnumField { - /** - * Type discriminator. Always "array". - */ - type: "array"; - /** - * Human-readable label for the field. - */ - title?: string; - /** - * Help text describing the field. - */ - description?: string; - /** - * Minimum number of items the user must select. - */ - minItems?: number; - /** - * Maximum number of items the user may select. - */ - maxItems?: number; - items: UIElicitationArrayEnumFieldItems; - /** - * Default values selected when the form is first shown. - */ - default?: string[]; + /** + * Type discriminator. Always "array". + */ + type: "array"; + /** + * Human-readable label for the field. + */ + title?: string; + /** + * Help text describing the field. + */ + description?: string; + /** + * Minimum number of items the user must select. + */ + minItems?: number; + /** + * Maximum number of items the user may select. + */ + maxItems?: number; + items: UIElicitationArrayEnumFieldItems; + /** + * Default values selected when the form is first shown. + */ + default?: string[]; } /** * Schema applied to each item in the array. @@ -21608,14 +22199,14 @@ export interface UIElicitationArrayEnumField { */ /** @experimental */ export interface UIElicitationArrayEnumFieldItems { - /** - * Type discriminator. Always "string". - */ - type: "string"; - /** - * Allowed string values for each selected item. - */ - enum: string[]; + /** + * Type discriminator. Always "string". + */ + type: "string"; + /** + * Allowed string values for each selected item. + */ + enum: string[]; } /** * Prompt message and JSON schema describing the form fields to elicit from the user. @@ -21625,20 +22216,20 @@ export interface UIElicitationArrayEnumFieldItems { */ /** @experimental */ export interface UIElicitationRequest { - mode?: McpElicitationFormMode; - /** - * Message describing what information is needed from the user - */ - message: string; - requestedSchema: UIElicitationSchema; - /** - * MCP request metadata. - */ - _meta?: { + mode?: McpElicitationFormMode; + /** + * Message describing what information is needed from the user + */ + message: string; + requestedSchema: UIElicitationSchema; + /** + * MCP request metadata. + */ + _meta?: { + [k: string]: unknown | undefined; + }; + task?: McpTaskMetadata; [k: string]: unknown | undefined; - }; - task?: McpTaskMetadata; - [k: string]: unknown | undefined; } /** * JSON Schema describing the form fields to present to the user @@ -21648,20 +22239,20 @@ export interface UIElicitationRequest { */ /** @experimental */ export interface UIElicitationSchema { - /** - * Schema type indicator (always 'object') - */ - type: "object"; - /** - * Form field definitions, keyed by field name - */ - properties: { - [k: string]: UIElicitationSchemaProperty | undefined; - }; - /** - * List of required field names - */ - required?: string[]; + /** + * Schema type indicator (always 'object') + */ + type: "object"; + /** + * Form field definitions, keyed by field name + */ + properties: { + [k: string]: UIElicitationSchemaProperty | undefined; + }; + /** + * List of required field names + */ + required?: string[]; } /** * Single-select string field whose allowed values are defined inline. @@ -21671,30 +22262,30 @@ export interface UIElicitationSchema { */ /** @experimental */ export interface UIElicitationStringEnumField { - /** - * Type discriminator. Always "string". - */ - type: "string"; - /** - * Human-readable label for the field. - */ - title?: string; - /** - * Help text describing the field. - */ - description?: string; - /** - * Allowed string values. - */ - enum: string[]; - /** - * Optional display labels for each enum value, in the same order as `enum`. - */ - enumNames?: string[]; - /** - * Default value selected when the form is first shown. - */ - default?: string; + /** + * Type discriminator. Always "string". + */ + type: "string"; + /** + * Human-readable label for the field. + */ + title?: string; + /** + * Help text describing the field. + */ + description?: string; + /** + * Allowed string values. + */ + enum: string[]; + /** + * Optional display labels for each enum value, in the same order as `enum`. + */ + enumNames?: string[]; + /** + * Default value selected when the form is first shown. + */ + default?: string; } /** * Single-select string field where each option pairs a value with a display label. @@ -21704,26 +22295,26 @@ export interface UIElicitationStringEnumField { */ /** @experimental */ export interface UIElicitationStringOneOfField { - /** - * Type discriminator. Always "string". - */ - type: "string"; - /** - * Human-readable label for the field. - */ - title?: string; - /** - * Help text describing the field. - */ - description?: string; - /** - * Selectable options, each with a value and a display label. - */ - oneOf: UIElicitationStringOneOfFieldOneOf[]; - /** - * Default value selected when the form is first shown. - */ - default?: string; + /** + * Type discriminator. Always "string". + */ + type: "string"; + /** + * Human-readable label for the field. + */ + title?: string; + /** + * Help text describing the field. + */ + description?: string; + /** + * Selectable options, each with a value and a display label. + */ + oneOf: UIElicitationStringOneOfFieldOneOf[]; + /** + * Default value selected when the form is first shown. + */ + default?: string; } /** * Selectable option for a UI elicitation single-select string field, with submitted value and display label. @@ -21733,14 +22324,14 @@ export interface UIElicitationStringOneOfField { */ /** @experimental */ export interface UIElicitationStringOneOfFieldOneOf { - /** - * Value submitted when this option is selected. - */ - const: string; - /** - * Display label for this option. - */ - title: string; + /** + * Value submitted when this option is selected. + */ + const: string; + /** + * Display label for this option. + */ + title: string; } /** * Boolean field rendered as a yes/no toggle. @@ -21750,22 +22341,22 @@ export interface UIElicitationStringOneOfFieldOneOf { */ /** @experimental */ export interface UIElicitationSchemaPropertyBoolean { - /** - * Type discriminator. Always "boolean". - */ - type: "boolean"; - /** - * Human-readable label for the field. - */ - title?: string; - /** - * Help text describing the field. - */ - description?: string; - /** - * Default value selected when the form is first shown. - */ - default?: boolean; + /** + * Type discriminator. Always "boolean". + */ + type: "boolean"; + /** + * Human-readable label for the field. + */ + title?: string; + /** + * Help text describing the field. + */ + description?: string; + /** + * Default value selected when the form is first shown. + */ + default?: boolean; } /** * Free-text string field with optional length and format constraints. @@ -21775,31 +22366,31 @@ export interface UIElicitationSchemaPropertyBoolean { */ /** @experimental */ export interface UIElicitationSchemaPropertyString { - /** - * Type discriminator. Always "string". - */ - type: "string"; - /** - * Human-readable label for the field. - */ - title?: string; - /** - * Help text describing the field. - */ - description?: string; - /** - * Minimum number of characters required. - */ - minLength?: number; - /** - * Maximum number of characters allowed. - */ - maxLength?: number; - format?: UIElicitationSchemaPropertyStringFormat; - /** - * Default value populated in the input when the form is first shown. - */ - default?: string; + /** + * Type discriminator. Always "string". + */ + type: "string"; + /** + * Human-readable label for the field. + */ + title?: string; + /** + * Help text describing the field. + */ + description?: string; + /** + * Minimum number of characters required. + */ + minLength?: number; + /** + * Maximum number of characters allowed. + */ + maxLength?: number; + format?: UIElicitationSchemaPropertyStringFormat; + /** + * Default value populated in the input when the form is first shown. + */ + default?: string; } /** * Numeric field accepting either a number or an integer. @@ -21809,27 +22400,27 @@ export interface UIElicitationSchemaPropertyString { */ /** @experimental */ export interface UIElicitationSchemaPropertyNumber { - type: UIElicitationSchemaPropertyNumberType; - /** - * Human-readable label for the field. - */ - title?: string; - /** - * Help text describing the field. - */ - description?: string; - /** - * Minimum allowed value (inclusive). - */ - minimum?: number; - /** - * Maximum allowed value (inclusive). - */ - maximum?: number; - /** - * Default value populated in the input when the form is first shown. - */ - default?: number; + type: UIElicitationSchemaPropertyNumberType; + /** + * Human-readable label for the field. + */ + title?: string; + /** + * Help text describing the field. + */ + description?: string; + /** + * Minimum allowed value (inclusive). + */ + minimum?: number; + /** + * Maximum allowed value (inclusive). + */ + maximum?: number; + /** + * Default value populated in the input when the form is first shown. + */ + default?: number; } /** * The elicitation response (accept with form values, decline, or cancel) @@ -21839,15 +22430,15 @@ export interface UIElicitationSchemaPropertyNumber { */ /** @experimental */ export interface UIElicitationResponse { - action: UIElicitationResponseAction; - content?: UIElicitationResponseContent; - /** - * MCP response metadata. - */ - _meta?: { + action: UIElicitationResponseAction; + content?: UIElicitationResponseContent; + /** + * MCP response metadata. + */ + _meta?: { + [k: string]: unknown | undefined; + }; [k: string]: unknown | undefined; - }; - [k: string]: unknown | undefined; } /** * The form values submitted by the user (present when action is 'accept') @@ -21857,7 +22448,7 @@ export interface UIElicitationResponse { */ /** @experimental */ export interface UIElicitationResponseContent { - [k: string]: UIElicitationFieldValue; + [k: string]: UIElicitationFieldValue; } /** * Indicates whether the elicitation response was accepted; false if it was already resolved by another client. @@ -21867,10 +22458,10 @@ export interface UIElicitationResponseContent { */ /** @experimental */ export interface UIElicitationResult { - /** - * Whether the response was accepted. False if the request was already resolved by another client. - */ - success: boolean; + /** + * Whether the response was accepted. False if the request was already resolved by another client. + */ + success: boolean; } /** * Transient question to answer without adding it to conversation history. @@ -21880,22 +22471,22 @@ export interface UIElicitationResult { */ /** @experimental */ export interface UIEphemeralQueryRequest { - /** - * Question to answer from the current conversation context. - */ - question: string; - /** - * In-process streaming callback `(text) => void` invoked with each token as the model emits it. Internal and excluded from the public SDK surface. - * - * @internal - */ - onChunk?: OpaqueInProcessValue; - /** - * In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Internal and excluded from the public SDK surface. - * - * @internal - */ - abortSignal?: OpaqueInProcessValue; + /** + * Question to answer from the current conversation context. + */ + question: string; + /** + * In-process streaming callback `(text) => void` invoked with each token as the model emits it. Internal and excluded from the public SDK surface. + * + * @internal + */ + onChunk?: OpaqueInProcessValue; + /** + * In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Internal and excluded from the public SDK surface. + * + * @internal + */ + abortSignal?: OpaqueInProcessValue; } /** * Completed transient query. Ordered chunks and the terminal outcome are also delivered through `ui.ephemeral_query` session events while it runs. @@ -21905,10 +22496,10 @@ export interface UIEphemeralQueryRequest { */ /** @experimental */ export interface UIEphemeralQueryResult { - /** - * Answer returned by the model - */ - answer: string; + /** + * Answer returned by the model + */ + answer: string; } /** * User response for a pending exit-plan-mode request, with approval state, selected action, auto-approve flag, and feedback. @@ -21918,23 +22509,23 @@ export interface UIEphemeralQueryResult { */ /** @experimental */ export interface UIExitPlanModeResponse { - /** - * Whether the plan was approved. - */ - approved: boolean; - selectedAction?: UIExitPlanModeAction; - /** - * Whether subsequent edits should be auto-approved without confirmation. - */ - autoApproveEdits?: boolean; - /** - * Feedback from the user when they declined the plan or requested changes. - */ - feedback?: string; - /** - * When true, the agent is instructed to end its turn without starting implementation so the client can restore the session model and auto-submit a fresh implementation turn on it. Set only when a distinct plan configuration (a different model, reasoning effort, or context tier) actually ran the planning turn. - */ - deferImplementation?: boolean; + /** + * Whether the plan was approved. + */ + approved: boolean; + selectedAction?: UIExitPlanModeAction; + /** + * Whether subsequent edits should be auto-approved without confirmation. + */ + autoApproveEdits?: boolean; + /** + * Feedback from the user when they declined the plan or requested changes. + */ + feedback?: string; + /** + * When true, the agent is instructed to end its turn without starting implementation so the client can restore the session model and auto-submit a fresh implementation turn on it. Set only when a distinct plan configuration (a different model, reasoning effort, or context tier) actually ran the planning turn. + */ + deferImplementation?: boolean; } /** * Request ID of a pending `auto_mode_switch.requested` event and the user's response. @@ -21944,11 +22535,11 @@ export interface UIExitPlanModeResponse { */ /** @experimental */ export interface UIHandlePendingAutoModeSwitchRequest { - /** - * The unique request ID from the auto_mode_switch.requested event - */ - requestId: string; - response: UIAutoModeSwitchResponse; + /** + * The unique request ID from the auto_mode_switch.requested event + */ + requestId: string; + response: UIAutoModeSwitchResponse; } /** * Pending elicitation request ID and the user's response (accept/decline/cancel + form values). @@ -21958,11 +22549,11 @@ export interface UIHandlePendingAutoModeSwitchRequest { */ /** @experimental */ export interface UIHandlePendingElicitationRequest { - /** - * The unique request ID from the elicitation.requested event - */ - requestId: string; - result: UIElicitationResponse; + /** + * The unique request ID from the elicitation.requested event + */ + requestId: string; + result: UIElicitationResponse; } /** * Request ID of a pending `exit_plan_mode.requested` event and the user's response. @@ -21972,11 +22563,11 @@ export interface UIHandlePendingElicitationRequest { */ /** @experimental */ export interface UIHandlePendingExitPlanModeRequest { - /** - * The unique request ID from the exit_plan_mode.requested event - */ - requestId: string; - response: UIExitPlanModeResponse; + /** + * The unique request ID from the exit_plan_mode.requested event + */ + requestId: string; + response: UIExitPlanModeResponse; } /** * Indicates whether the pending UI request was resolved by this call. @@ -21986,10 +22577,10 @@ export interface UIHandlePendingExitPlanModeRequest { */ /** @experimental */ export interface UIHandlePendingResult { - /** - * True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending. - */ - success: boolean; + /** + * True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending. + */ + success: boolean; } /** * Request ID of a pending `sampling.requested` event and an optional sampling result payload (omit to reject). @@ -21999,11 +22590,11 @@ export interface UIHandlePendingResult { */ /** @experimental */ export interface UIHandlePendingSamplingRequest { - /** - * The unique request ID from the sampling.requested event - */ - requestId: string; - response?: UIHandlePendingSamplingResponse; + /** + * The unique request ID from the sampling.requested event + */ + requestId: string; + response?: UIHandlePendingSamplingResponse; } /** * Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result. @@ -22013,7 +22604,7 @@ export interface UIHandlePendingSamplingRequest { */ /** @experimental */ export interface UIHandlePendingSamplingResponse { - [k: string]: unknown | undefined; + [k: string]: unknown | undefined; } /** * Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action. @@ -22023,11 +22614,11 @@ export interface UIHandlePendingSamplingResponse { */ /** @experimental */ export interface UIHandlePendingSessionLimitsExhaustedRequest { - /** - * The unique request ID from the session_limits_exhausted.requested event - */ - requestId: string; - response: UISessionLimitsExhaustedResponse; + /** + * The unique request ID from the session_limits_exhausted.requested event + */ + requestId: string; + response: UISessionLimitsExhaustedResponse; } /** * The user's selected action for an exhausted session limit. @@ -22037,15 +22628,15 @@ export interface UIHandlePendingSessionLimitsExhaustedRequest { */ /** @experimental */ export interface UISessionLimitsExhaustedResponse { - action: UISessionLimitsExhaustedResponseAction; - /** - * AI Credits to add to the current max when action is 'add'. - */ - additionalAiCredits?: number; - /** - * New absolute max AI Credits when action is 'set'. - */ - maxAiCredits?: number; + action: UISessionLimitsExhaustedResponseAction; + /** + * AI Credits to add to the current max when action is 'add'. + */ + additionalAiCredits?: number; + /** + * New absolute max AI Credits when action is 'set'. + */ + maxAiCredits?: number; } /** * Request ID of a pending `user_input.requested` event and the user's response. @@ -22055,11 +22646,11 @@ export interface UISessionLimitsExhaustedResponse { */ /** @experimental */ export interface UIHandlePendingUserInputRequest { - /** - * The unique request ID from the user_input.requested event - */ - requestId: string; - response: UIUserInputResponse; + /** + * The unique request ID from the user_input.requested event + */ + requestId: string; + response: UIUserInputResponse; } /** * User response for a pending user-input request, with answer text and whether it was typed freeform. @@ -22069,14 +22660,14 @@ export interface UIHandlePendingUserInputRequest { */ /** @experimental */ export interface UIUserInputResponse { - /** - * The user's answer text - */ - answer: string; - /** - * True if the user typed a freeform response, false if they selected a presented choice. Used by telemetry to differentiate between free text input and choice selection. - */ - wasFreeform: boolean; + /** + * The user's answer text + */ + answer: string; + /** + * True if the user typed a freeform response, false if they selected a presented choice. Used by telemetry to differentiate between free text input and choice selection. + */ + wasFreeform: boolean; } /** * Register an in-process handler for `auto_mode_switch.requested` events. The caller still attaches the actual listener via the standard event-subscription mechanism; this registration solely tells the server bridge to skip its own dispatch (so a remote client doesn't race the in-process handler for the same requestId). @@ -22086,10 +22677,10 @@ export interface UIUserInputResponse { */ /** @experimental */ export interface UIRegisterDirectAutoModeSwitchHandlerResult { - /** - * Opaque handle representing the registration. Pass this same handle to `unregisterDirectAutoModeSwitchHandler` when the in-process handler is no longer active. Multiple registrations are reference-counted; the server bridge will only dispatch auto-mode-switch requests when no handles are active. - */ - handle: string; + /** + * Opaque handle representing the registration. Pass this same handle to `unregisterDirectAutoModeSwitchHandler` when the in-process handler is no longer active. Multiple registrations are reference-counted; the server bridge will only dispatch auto-mode-switch requests when no handles are active. + */ + handle: string; } /** * Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release. @@ -22099,10 +22690,10 @@ export interface UIRegisterDirectAutoModeSwitchHandlerResult { */ /** @experimental */ export interface UIUnregisterDirectAutoModeSwitchHandlerRequest { - /** - * Handle previously returned by `registerDirectAutoModeSwitchHandler` - */ - handle: string; + /** + * Handle previously returned by `registerDirectAutoModeSwitchHandler` + */ + handle: string; } /** * Indicates whether the handle was active and the registration count was decremented. @@ -22112,10 +22703,10 @@ export interface UIUnregisterDirectAutoModeSwitchHandlerRequest { */ /** @experimental */ export interface UIUnregisterDirectAutoModeSwitchHandlerResult { - /** - * True if the handle was active and decremented the counter; false if the handle was unknown. - */ - unregistered: boolean; + /** + * True if the handle was active and decremented the counter; false if the handle was unknown. + */ + unregistered: boolean; } /** * Subagent settings to apply to the current session @@ -22125,10 +22716,10 @@ export interface UIUnregisterDirectAutoModeSwitchHandlerResult { */ /** @experimental */ export interface UpdateSubagentSettingsRequest { - /** - * Subagent settings to apply, or null to clear the live session override - */ - subagents?: SubagentSettings | null; + /** + * Subagent settings to apply, or null to clear the live session override + */ + subagents?: SubagentSettings | null; } /** * Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals. @@ -22138,57 +22729,57 @@ export interface UpdateSubagentSettingsRequest { */ /** @experimental */ export interface UsageGetMetricsResult { - /** - * Total user-initiated premium request cost across all models (may be fractional due to multipliers) - */ - totalPremiumRequestCost: number; - /** - * Raw count of user-initiated API requests - */ - totalUserRequests: number; - /** - * Session-wide accumulated nano-AI units cost - */ - totalNanoAiu?: number; - /** - * Session-wide per-token-type accumulated token counts - */ - tokenDetails?: { - [k: string]: UsageMetricsTokenDetail | undefined; - }; - /** - * Total time spent in model API calls (milliseconds) - */ - totalApiDurationMs: number; - /** - * ISO 8601 timestamp when the session started - */ - sessionStartTime: string; - codeChanges: UsageMetricsCodeChanges; - /** - * Per-model token and request metrics, keyed by model identifier - */ - modelMetrics: { - [k: string]: UsageMetricsModelMetric | undefined; - }; - /** - * Per-agent usage metrics, keyed by agent instance identifier. The main conversation uses the stable key `main`. - */ - agentMetrics?: { - [k: string]: UsageMetricsAgentMetric | undefined; - }; - /** - * Currently active model identifier - */ - currentModel?: string; - /** - * Input tokens from the most recent main-agent API call - */ - lastCallInputTokens: number; - /** - * Output tokens from the most recent main-agent API call - */ - lastCallOutputTokens: number; + /** + * Total user-initiated premium request cost across all models (may be fractional due to multipliers) + */ + totalPremiumRequestCost: number; + /** + * Raw count of user-initiated API requests + */ + totalUserRequests: number; + /** + * Session-wide accumulated nano-AI units cost + */ + totalNanoAiu?: number; + /** + * Session-wide per-token-type accumulated token counts + */ + tokenDetails?: { + [k: string]: UsageMetricsTokenDetail | undefined; + }; + /** + * Total time spent in model API calls (milliseconds) + */ + totalApiDurationMs: number; + /** + * ISO 8601 timestamp when the session started + */ + sessionStartTime: string; + codeChanges: UsageMetricsCodeChanges; + /** + * Per-model token and request metrics, keyed by model identifier + */ + modelMetrics: { + [k: string]: UsageMetricsModelMetric | undefined; + }; + /** + * Per-agent usage metrics, keyed by agent instance identifier. The main conversation uses the stable key `main`. + */ + agentMetrics?: { + [k: string]: UsageMetricsAgentMetric | undefined; + }; + /** + * Currently active model identifier + */ + currentModel?: string; + /** + * Input tokens from the most recent main-agent API call + */ + lastCallInputTokens: number; + /** + * Output tokens from the most recent main-agent API call + */ + lastCallOutputTokens: number; } /** * Session-wide token-detail entry containing the accumulated token count for one token type. @@ -22198,10 +22789,10 @@ export interface UsageGetMetricsResult { */ /** @experimental */ export interface UsageMetricsTokenDetail { - /** - * Accumulated token count for this token type - */ - tokenCount: number; + /** + * Accumulated token count for this token type + */ + tokenCount: number; } /** * Aggregated code change metrics @@ -22211,22 +22802,22 @@ export interface UsageMetricsTokenDetail { */ /** @experimental */ export interface UsageMetricsCodeChanges { - /** - * Total lines of code added - */ - linesAdded: number; - /** - * Total lines of code removed - */ - linesRemoved: number; - /** - * Number of distinct files modified - */ - filesModifiedCount: number; - /** - * Distinct file paths modified during the session - */ - filesModified: string[]; + /** + * Total lines of code added + */ + linesAdded: number; + /** + * Total lines of code removed + */ + linesRemoved: number; + /** + * Number of distinct files modified + */ + filesModifiedCount: number; + /** + * Distinct file paths modified during the session + */ + filesModified: string[]; } /** * Per-model usage metrics, including request counts/costs, token usage, nano-AI units, and per-token-type details. @@ -22236,22 +22827,22 @@ export interface UsageMetricsCodeChanges { */ /** @experimental */ export interface UsageMetricsModelMetric { - requests: UsageMetricsModelMetricRequests; - usage: UsageMetricsModelMetricUsage; - /** - * Latest known prompt-cache expiration for this model. A timestamp in the past indicates that the observed cache has expired. - */ - cacheExpiresAt?: string; - /** - * Accumulated nano-AI units cost for this model - */ - totalNanoAiu?: number; - /** - * Token count details per type - */ - tokenDetails?: { - [k: string]: UsageMetricsModelMetricTokenDetail | undefined; - }; + requests: UsageMetricsModelMetricRequests; + usage: UsageMetricsModelMetricUsage; + /** + * Latest known prompt-cache expiration for this model. A timestamp in the past indicates that the observed cache has expired. + */ + cacheExpiresAt?: string; + /** + * Accumulated nano-AI units cost for this model + */ + totalNanoAiu?: number; + /** + * Token count details per type + */ + tokenDetails?: { + [k: string]: UsageMetricsModelMetricTokenDetail | undefined; + }; } /** * Request count and cost metrics for this model @@ -22261,14 +22852,14 @@ export interface UsageMetricsModelMetric { */ /** @experimental */ export interface UsageMetricsModelMetricRequests { - /** - * Number of API requests made with this model - */ - count: number; - /** - * User-initiated premium request cost (with multiplier applied) - */ - cost: number; + /** + * Number of API requests made with this model + */ + count: number; + /** + * User-initiated premium request cost (with multiplier applied) + */ + cost: number; } /** * Token usage metrics for this model @@ -22278,26 +22869,26 @@ export interface UsageMetricsModelMetricRequests { */ /** @experimental */ export interface UsageMetricsModelMetricUsage { - /** - * Total input tokens consumed - */ - inputTokens: number; - /** - * Total output tokens produced - */ - outputTokens: number; - /** - * Total tokens read from prompt cache - */ - cacheReadTokens: number; - /** - * Total tokens written to prompt cache - */ - cacheWriteTokens: number; - /** - * Total output tokens used for reasoning - */ - reasoningTokens?: number; + /** + * Total input tokens consumed + */ + inputTokens: number; + /** + * Total output tokens produced + */ + outputTokens: number; + /** + * Total tokens read from prompt cache + */ + cacheReadTokens: number; + /** + * Total tokens written to prompt cache + */ + cacheWriteTokens: number; + /** + * Total output tokens used for reasoning + */ + reasoningTokens?: number; } /** * Per-model token-detail entry containing the accumulated token count for one token type. @@ -22307,10 +22898,10 @@ export interface UsageMetricsModelMetricUsage { */ /** @experimental */ export interface UsageMetricsModelMetricTokenDetail { - /** - * Accumulated token count for this token type - */ - tokenCount: number; + /** + * Accumulated token count for this token type + */ + tokenCount: number; } /** * Usage attributed to one agent instance, including its identity, API duration, AI units, and per-model breakdown. @@ -22320,28 +22911,28 @@ export interface UsageMetricsModelMetricTokenDetail { */ /** @experimental */ export interface UsageMetricsAgentMetric { - /** - * Configured agent name, when this is a subagent - */ - agentName?: string; - /** - * Human-readable label for this subagent invocation, copied from the originating `subagent.started` event. For task-tool subagents this is the invocation's task description rather than the agent's configured display name, so group by `agentName` for stable per-agent labels. - */ - agentDisplayName?: string; - /** - * Time spent in model API calls by this agent, in milliseconds - */ - totalApiDurationMs: number; - /** - * Accumulated nano-AI units cost for this agent - */ - totalNanoAiu: number; - /** - * Per-model usage for this agent, keyed by model identifier - */ - modelMetrics: { - [k: string]: UsageMetricsModelMetric | undefined; - }; + /** + * Configured agent name, when this is a subagent + */ + agentName?: string; + /** + * Human-readable label for this subagent invocation, copied from the originating `subagent.started` event. For task-tool subagents this is the invocation's task description rather than the agent's configured display name, so group by `agentName` for stable per-agent labels. + */ + agentDisplayName?: string; + /** + * Time spent in model API calls by this agent, in milliseconds + */ + totalApiDurationMs: number; + /** + * Accumulated nano-AI units cost for this agent + */ + totalNanoAiu: number; + /** + * Per-model usage for this agent, keyed by model identifier + */ + modelMetrics: { + [k: string]: UsageMetricsModelMetric | undefined; + }; } /** * Result of a user-requested shell command. @@ -22351,26 +22942,26 @@ export interface UsageMetricsAgentMetric { */ /** @experimental */ export interface UserRequestedShellCommandResult { - /** - * Tool call id emitted for the shell execution - */ - toolCallId: string; - /** - * Whether the command completed successfully - */ - success: boolean; - /** - * Captured command output - */ - output: string; - /** - * Process exit code, when available - */ - exitCode?: number | null; - /** - * Error output when the execution failed - */ - error?: string; + /** + * Tool call id emitted for the shell execution + */ + toolCallId: string; + /** + * Whether the command completed successfully + */ + success: boolean; + /** + * Captured command output + */ + output: string; + /** + * Process exit code, when available + */ + exitCode?: number | null; + /** + * Error output when the execution failed + */ + error?: string; } /** * A single user setting's effective value alongside its default, so consumers can render settings left at their default. @@ -22380,18 +22971,18 @@ export interface UserRequestedShellCommandResult { */ /** @experimental */ export interface UserSettingMetadata { - /** - * The effective value: the user's value if set, otherwise the default. - */ - value: JsonValue; - /** - * The centrally-known default for this setting (null when no default is registered). - */ - default: JsonValue; - /** - * True when the user has not set an explicit value for this setting (i.e. it is left at its default). Reflects whether the user has overridden the key, not whether the effective value happens to equal the default — a key explicitly set to a value identical to the default still reports false. - */ - isDefault: boolean; + /** + * The effective value: the user's value if set, otherwise the default. + */ + value: JsonValue; + /** + * The centrally-known default for this setting (null when no default is registered). + */ + default: JsonValue; + /** + * True when the user has not set an explicit value for this setting (i.e. it is left at its default). Reflects whether the user has overridden the key, not whether the effective value happens to equal the default — a key explicitly set to a value identical to the default still reports false. + */ + isDefault: boolean; } /** * Per-key metadata for every known user setting (settings.json overlaid with the legacy config.json, config.json wins), including settings left at their default. Excludes repository- and enterprise-managed overrides. @@ -22401,12 +22992,12 @@ export interface UserSettingMetadata { */ /** @experimental */ export interface UserSettingsGetResult { - /** - * Every known user setting keyed by setting name, each with its effective value, default, and whether it is at the default. - */ - settings: { - [k: string]: UserSettingMetadata; - }; + /** + * Every known user setting keyed by setting name, each with its effective value, default, and whether it is at the default. + */ + settings: { + [k: string]: UserSettingMetadata; + }; } /** * Partial user settings to write to settings.json. Each top-level key is written individually, replacing the existing value; a key whose value is null is removed. @@ -22416,10 +23007,10 @@ export interface UserSettingsGetResult { */ /** @experimental */ export interface UserSettingsSetRequest { - /** - * Partial user settings to write, as a free-form object keyed by setting name - */ - settings: JsonValue; + /** + * Partial user settings to write, as a free-form object keyed by setting name + */ + settings: JsonValue; } /** * Outcome of writing user settings. @@ -22429,10 +23020,10 @@ export interface UserSettingsSetRequest { */ /** @experimental */ export interface UserSettingsSetResult { - /** - * Top-level keys whose write landed in settings.json but is shadowed by a value still present in the legacy config.json (config.json wins on read). The write does not take effect until the legacy value is removed. - */ - shadowedKeys: string[]; + /** + * Top-level keys whose write landed in settings.json but is shadowed by a value still present in the legacy config.json (config.json wins on read). The write does not take effect until the legacy value is removed. + */ + shadowedKeys: string[]; } /** * Current sharing status and shareable GitHub URL for a session. @@ -22442,15 +23033,15 @@ export interface UserSettingsSetResult { */ /** @experimental */ export interface VisibilityGetResult { - /** - * Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the session cannot be shared and `status`/`shareUrl` are absent. - */ - synced: boolean; - status?: SessionVisibilityStatus; - /** - * Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved. - */ - shareUrl?: string; + /** + * Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the session cannot be shared and `status`/`shareUrl` are absent. + */ + synced: boolean; + status?: SessionVisibilityStatus; + /** + * Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved. + */ + shareUrl?: string; } /** * Desired sharing status for the session. @@ -22460,7 +23051,7 @@ export interface VisibilityGetResult { */ /** @experimental */ export interface VisibilitySetRequest { - status: SessionVisibilityStatus; + status: SessionVisibilityStatus; } /** * Effective sharing status and shareable GitHub URL after updating session visibility. @@ -22470,15 +23061,15 @@ export interface VisibilitySetRequest { */ /** @experimental */ export interface VisibilitySetResult { - /** - * Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the visibility change could not be applied and `status`/`shareUrl` are absent. - */ - synced: boolean; - status?: SessionVisibilityStatus; - /** - * Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved. - */ - shareUrl?: string; + /** + * Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the visibility change could not be applied and `status`/`shareUrl` are absent. + */ + synced: boolean; + status?: SessionVisibilityStatus; + /** + * Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved. + */ + shareUrl?: string; } /** * A single changed file and its unified diff. @@ -22488,23 +23079,23 @@ export interface VisibilitySetResult { */ /** @experimental */ export interface WorkspaceDiffFileChange { - /** - * Path to the changed file, relative to the workspace root when the file lives under it. A file changed outside the workspace root keeps a `../`-relative path, or an absolute path when no relative path exists (for example a different Windows drive). - */ - path: string; - /** - * Unified diff content for the file. Empty when the diff was truncated. - */ - diff: string; - changeType: WorkspaceDiffFileChangeType; - /** - * Original file path for renamed files. - */ - oldPath?: string; - /** - * Whether the diff content was omitted because it exceeded the per-file size limit. - */ - isTruncated?: boolean; + /** + * Path to the changed file, relative to the workspace root when the file lives under it. A file changed outside the workspace root keeps a `../`-relative path, or an absolute path when no relative path exists (for example a different Windows drive). + */ + path: string; + /** + * Unified diff content for the file. Empty when the diff was truncated. + */ + diff: string; + changeType: WorkspaceDiffFileChangeType; + /** + * Original file path for renamed files. + */ + oldPath?: string; + /** + * Whether the diff content was omitted because it exceeded the per-file size limit. + */ + isTruncated?: boolean; } /** * Workspace diff result for the requested mode. @@ -22514,21 +23105,21 @@ export interface WorkspaceDiffFileChange { */ /** @experimental */ export interface WorkspaceDiffResult { - requestedMode: WorkspaceDiffMode; - mode: WorkspaceDiffMode; - /** - * Changed files and their unified diffs. - */ - changes: WorkspaceDiffFileChange[]; - /** - * Default branch used for a branch diff, when branch mode was requested. - */ - baseBranch?: string; - /** - * Whether the requested diff fell back to unstaged changes, either because branch diff failed or session diff was unavailable. - */ - isFallback: boolean; - unavailableReason?: HistoryRewindUnavailableReason; + requestedMode: WorkspaceDiffMode; + mode: WorkspaceDiffMode; + /** + * Changed files and their unified diffs. + */ + changes: WorkspaceDiffFileChange[]; + /** + * Default branch used for a branch diff, when branch mode was requested. + */ + baseBranch?: string; + /** + * Whether the requested diff fell back to unstaged changes, either because branch diff failed or session diff was unavailable. + */ + isFallback: boolean; + unavailableReason?: HistoryRewindUnavailableReason; } /** * Compaction summary checkpoint to persist. @@ -22538,14 +23129,14 @@ export interface WorkspaceDiffResult { */ /** @experimental */ export interface WorkspacesAddSummaryRequest { - /** - * Summary title shown in checkpoint listings. - */ - title: string; - /** - * Markdown summary content to persist. - */ - content: string; + /** + * Summary title shown in checkpoint listings. + */ + title: string; + /** + * Markdown summary content to persist. + */ + content: string; } /** * Persisted summary metadata and refreshed workspace metadata. @@ -22555,15 +23146,15 @@ export interface WorkspacesAddSummaryRequest { */ /** @experimental */ export interface WorkspacesAddSummaryResult { - /** - * Metadata for the persisted summary. - */ - summary?: {}; - /** - * Refreshed metadata for the containing workspace. - */ - workspace?: {}; - [k: string]: unknown | undefined; + /** + * Metadata for the persisted summary. + */ + summary?: {}; + /** + * Refreshed metadata for the containing workspace. + */ + workspace?: {}; + [k: string]: unknown | undefined; } /** * Whether the autopilot objective file exists. @@ -22573,10 +23164,10 @@ export interface WorkspacesAddSummaryResult { */ /** @experimental */ export interface WorkspacesAutopilotObjectiveExistsResult { - /** - * True when the objective file exists. - */ - exists: boolean; + /** + * True when the objective file exists. + */ + exists: boolean; } /** * Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename. @@ -22586,18 +23177,18 @@ export interface WorkspacesAutopilotObjectiveExistsResult { */ /** @experimental */ export interface WorkspacesCheckpoints { - /** - * Checkpoint number assigned by the workspace manager - */ - number: number; - /** - * Human-readable checkpoint title - */ - title: string; - /** - * Filename of the checkpoint within the workspace checkpoints directory - */ - filename: string; + /** + * Checkpoint number assigned by the workspace manager + */ + number: number; + /** + * Human-readable checkpoint title + */ + title: string; + /** + * Filename of the checkpoint within the workspace checkpoints directory + */ + filename: string; } /** * Relative path and UTF-8 content for the workspace file to create or overwrite. @@ -22607,14 +23198,14 @@ export interface WorkspacesCheckpoints { */ /** @experimental */ export interface WorkspacesCreateFileRequest { - /** - * Relative path within the workspace files directory - */ - path: string; - /** - * File content to write as a UTF-8 string - */ - content: string; + /** + * Relative path within the workspace files directory + */ + path: string; + /** + * File content to write as a UTF-8 string + */ + content: string; } /** * Result of deleting the autopilot objective file. @@ -22624,10 +23215,10 @@ export interface WorkspacesCreateFileRequest { */ /** @experimental */ export interface WorkspacesDeleteAutopilotObjectiveResult { - /** - * True when a file was deleted. - */ - deleted: boolean; + /** + * True when a file was deleted. + */ + deleted: boolean; } /** * Parameters for computing a workspace diff. @@ -22637,11 +23228,11 @@ export interface WorkspacesDeleteAutopilotObjectiveResult { */ /** @experimental */ export interface WorkspacesDiffRequest { - mode: WorkspaceDiffMode; - /** - * When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false. - */ - ignoreWhitespace?: boolean; + mode: WorkspaceDiffMode; + /** + * When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false. + */ + ignoreWhitespace?: boolean; } /** * Optional session context used when creating a local workspace. @@ -22651,10 +23242,10 @@ export interface WorkspacesDiffRequest { */ /** @experimental */ export interface WorkspacesEnsureRequest { - /** - * Opaque workspace context supplied by the session host. - */ - context?: JsonValue; + /** + * Opaque workspace context supplied by the session host. + */ + context?: JsonValue; } /** * Current workspace metadata for the session, including its absolute filesystem path when available. @@ -22664,80 +23255,80 @@ export interface WorkspacesEnsureRequest { */ /** @experimental */ export interface WorkspacesGetWorkspaceResult { - /** - * Current workspace metadata, or null if not available - */ - workspace: { - /** - * Stable workspace identifier. - */ - id: string; - /** - * Current working directory associated with the workspace. - */ - cwd?: string; - /** - * Git repository root associated with the workspace. - */ - git_root?: string; - /** - * Repository identifier associated with the workspace. - */ - repository?: string; - host_type?: WorkspacesWorkspaceDetailsHostType; - /** - * Current Git branch. - */ - branch?: string; - /** - * Workspace display name. - */ - name?: string; - /** - * Name of the client that created the workspace. - */ - client_name?: string; /** - * Whether the workspace name was explicitly chosen by the user. + * Current workspace metadata, or null if not available */ - user_named?: boolean; - /** - * Number of persisted summaries in the workspace. - */ - summary_count?: number; - /** - * Timestamp when the workspace was created. - */ - created_at?: string; - /** - * Timestamp when the workspace was last updated. - */ - updated_at?: string; - /** - * Whether the workspace session can be steered remotely. - */ - remote_steerable?: boolean; - /** - * Mission Control task identifier associated with the workspace. - */ - mc_task_id?: string; - /** - * Mission Control session identifier associated with the workspace. - */ - mc_session_id?: string; - /** - * Most recent Mission Control event identifier observed for the workspace. - */ - mc_last_event_id?: string; + workspace: { + /** + * Stable workspace identifier. + */ + id: string; + /** + * Current working directory associated with the workspace. + */ + cwd?: string; + /** + * Git repository root associated with the workspace. + */ + git_root?: string; + /** + * Repository identifier associated with the workspace. + */ + repository?: string; + host_type?: WorkspacesWorkspaceDetailsHostType; + /** + * Current Git branch. + */ + branch?: string; + /** + * Workspace display name. + */ + name?: string; + /** + * Name of the client that created the workspace. + */ + client_name?: string; + /** + * Whether the workspace name was explicitly chosen by the user. + */ + user_named?: boolean; + /** + * Number of persisted summaries in the workspace. + */ + summary_count?: number; + /** + * Timestamp when the workspace was created. + */ + created_at?: string; + /** + * Timestamp when the workspace was last updated. + */ + updated_at?: string; + /** + * Whether the workspace session can be steered remotely. + */ + remote_steerable?: boolean; + /** + * Mission Control task identifier associated with the workspace. + */ + mc_task_id?: string; + /** + * Mission Control session identifier associated with the workspace. + */ + mc_session_id?: string; + /** + * Most recent Mission Control event identifier observed for the workspace. + */ + mc_last_event_id?: string; + /** + * Whether the per-session Chronicle upgrade prompt was dismissed for the workspace. + */ + chronicle_sync_dismissed?: boolean; + } | null; /** - * Whether the per-session Chronicle upgrade prompt was dismissed for the workspace. + * Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). */ - chronicle_sync_dismissed?: boolean; - } | null; - /** - * Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). - */ - path?: string; + path?: string; } /** * Workspace checkpoints in chronological order; empty when the workspace is not enabled. @@ -22747,10 +23338,10 @@ export interface WorkspacesGetWorkspaceResult { */ /** @experimental */ export interface WorkspacesListCheckpointsResult { - /** - * Workspace checkpoints in chronological order. Empty when workspace is not enabled. - */ - checkpoints: WorkspacesCheckpoints[]; + /** + * Workspace checkpoints in chronological order. Empty when workspace is not enabled. + */ + checkpoints: WorkspacesCheckpoints[]; } /** * Relative paths of files stored in the session workspace files directory. @@ -22760,10 +23351,10 @@ export interface WorkspacesListCheckpointsResult { */ /** @experimental */ export interface WorkspacesListFilesResult { - /** - * Relative file paths in the workspace files directory - */ - files: string[]; + /** + * Relative file paths in the workspace files directory + */ + files: string[]; } /** * Autopilot objective file content, or null when missing. @@ -22773,10 +23364,10 @@ export interface WorkspacesListFilesResult { */ /** @experimental */ export interface WorkspacesReadAutopilotObjectiveResult { - /** - * Autopilot objective file content, or null when missing. - */ - content: string | null; + /** + * Autopilot objective file content, or null when missing. + */ + content: string | null; } /** * Checkpoint number to read. @@ -22786,10 +23377,10 @@ export interface WorkspacesReadAutopilotObjectiveResult { */ /** @experimental */ export interface WorkspacesReadCheckpointRequest { - /** - * Checkpoint number to read - */ - number: number; + /** + * Checkpoint number to read + */ + number: number; } /** * Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. @@ -22799,10 +23390,10 @@ export interface WorkspacesReadCheckpointRequest { */ /** @experimental */ export interface WorkspacesReadCheckpointResult { - /** - * Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing - */ - content: string | null; + /** + * Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing + */ + content: string | null; } /** * Relative path of the workspace file to read. @@ -22812,10 +23403,10 @@ export interface WorkspacesReadCheckpointResult { */ /** @experimental */ export interface WorkspacesReadFileRequest { - /** - * Relative path within the workspace files directory - */ - path: string; + /** + * Relative path within the workspace files directory + */ + path: string; } /** * Contents of the requested workspace file as a UTF-8 string. @@ -22825,10 +23416,10 @@ export interface WorkspacesReadFileRequest { */ /** @experimental */ export interface WorkspacesReadFileResult { - /** - * File content as a UTF-8 string - */ - content: string; + /** + * File content as a UTF-8 string + */ + content: string; } /** * Pasted content to save as a UTF-8 file in the session workspace. @@ -22838,10 +23429,10 @@ export interface WorkspacesReadFileResult { */ /** @experimental */ export interface WorkspacesSaveLargePasteRequest { - /** - * Pasted content to save as a UTF-8 file - */ - content: string; + /** + * Pasted content to save as a UTF-8 file + */ + content: string; } /** * Descriptor for the saved paste file, or null when the workspace is unavailable. @@ -22851,23 +23442,23 @@ export interface WorkspacesSaveLargePasteRequest { */ /** @experimental */ export interface WorkspacesSaveLargePasteResult { - /** - * Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime, non-infinite sessions, remote sessions) - */ - saved: { - /** - * Absolute filesystem path to the saved paste file - */ - filePath: string; /** - * Filename within the workspace files directory + * Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime, non-infinite sessions, remote sessions) */ - filename: string; - /** - * Size of the saved file in bytes - */ - sizeBytes: number; - } | null; + saved: { + /** + * Absolute filesystem path to the saved paste file + */ + filePath: string; + /** + * Filename within the workspace files directory + */ + filename: string; + /** + * Size of the saved file in bytes + */ + sizeBytes: number; + } | null; } /** * Rollback point for local workspace summaries. @@ -22877,10 +23468,10 @@ export interface WorkspacesSaveLargePasteResult { */ /** @experimental */ export interface WorkspacesTruncateSummariesRequest { - /** - * Number of newest summaries to keep. - */ - keepCount: number; + /** + * Number of newest summaries to keep. + */ + keepCount: number; } /** * Workspace metadata fields to update. @@ -22890,14 +23481,14 @@ export interface WorkspacesTruncateSummariesRequest { */ /** @experimental */ export interface WorkspacesUpdateMetadataRequest { - /** - * Opaque workspace context supplied by the session host. - */ - context?: JsonValue; - /** - * Optional workspace display name override. - */ - name?: string; + /** + * Opaque workspace context supplied by the session host. + */ + context?: JsonValue; + /** + * Optional workspace display name override. + */ + name?: string; } /** * Autopilot objective file content to persist. @@ -22907,10 +23498,10 @@ export interface WorkspacesUpdateMetadataRequest { */ /** @experimental */ export interface WorkspacesWriteAutopilotObjectiveRequest { - /** - * Autopilot objective file content. - */ - content: string; + /** + * Autopilot objective file content. + */ + content: string; } /** * Result of writing the autopilot objective file. @@ -22920,30 +23511,30 @@ export interface WorkspacesWriteAutopilotObjectiveRequest { */ /** @experimental */ export interface WorkspacesWriteAutopilotObjectiveResult { - /** - * Filesystem operation performed. - */ - operation: string; + /** + * Filesystem operation performed. + */ + operation: string; } /** @experimental */ export interface SessionModelListRequest { - /** - * If true, bypasses the per-session model list cache and re-fetches from CAPI. - */ - skipCache?: boolean; + /** + * If true, bypasses the per-session model list cache and re-fetches from CAPI. + */ + skipCache?: boolean; } /** @experimental */ export interface SessionAgentListRequest { - /** - * When true, request the session's configured built-in agents alongside custom agents. Listing applies feature, context, inclusion, exclusion, and user-disabled-agent policy, but does not evaluate transient invocation requirements such as model availability. Built-in metadata may be omitted when the session cannot project it, such as a relay session. - */ - includeBuiltInAgents?: boolean; - /** - * When true, request authored base prompt text on each AgentInfo. Prompt text may be omitted when unavailable, such as for agents projected through a relay session. - */ - includePrompt?: boolean; + /** + * When true, request the session's configured built-in agents alongside custom agents. Listing applies feature, context, inclusion, exclusion, and user-disabled-agent policy, but does not evaluate transient invocation requirements such as model availability. Built-in metadata may be omitted when the session cannot project it, such as a relay session. + */ + includeBuiltInAgents?: boolean; + /** + * When true, request authored base prompt text on each AgentInfo. Prompt text may be omitted when unavailable, such as for agents projected through a relay session. + */ + includePrompt?: boolean; } /** * Standard MCP CallToolResult @@ -22953,83 +23544,83 @@ export interface SessionAgentListRequest { */ /** @experimental */ export interface SessionMcpAppsCallToolResult { - [k: string]: JsonValue | undefined; + [k: string]: JsonValue | undefined; } /** @experimental */ export interface SessionPluginsReloadRequest { - /** - * Reload MCP server connections after refreshing plugins. Defaults to true. - */ - reloadMcp?: boolean; - /** - * Re-run custom-agent discovery after refreshing plugins. Defaults to true. - */ - reloadCustomAgents?: boolean; - /** - * Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions). - */ - reloadHooks?: boolean; - /** - * Re-discover and relaunch subprocess extensions (including plugin-shipped extensions) after refreshing plugins. Defaults to true. Has no effect when the session has no active extension controller (e.g. extensions were not requested for the session). - */ - reloadExtensions?: boolean; - /** - * When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`. - */ - deferRepoHooks?: boolean; + /** + * Reload MCP server connections after refreshing plugins. Defaults to true. + */ + reloadMcp?: boolean; + /** + * Re-run custom-agent discovery after refreshing plugins. Defaults to true. + */ + reloadCustomAgents?: boolean; + /** + * Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions). + */ + reloadHooks?: boolean; + /** + * Re-discover and relaunch subprocess extensions (including plugin-shipped extensions) after refreshing plugins. Defaults to true. Has no effect when the session has no active extension controller (e.g. extensions were not requested for the session). + */ + reloadExtensions?: boolean; + /** + * When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`. + */ + deferRepoHooks?: boolean; } /** @experimental */ export interface SessionProviderGetEndpointRequest { - /** - * Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using. - */ - modelId?: string; + /** + * Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using. + */ + modelId?: string; } /** @experimental */ export interface SessionCommandsListRequest { - /** - * Include runtime built-in commands - */ - includeBuiltins?: boolean; - /** - * Include enabled user-invocable skills and commands - */ - includeSkills?: boolean; - /** - * Include commands registered by protocol clients, including SDK clients and extensions - */ - includeClientCommands?: boolean; + /** + * Include runtime built-in commands + */ + includeBuiltins?: boolean; + /** + * Include enabled user-invocable skills and commands + */ + includeSkills?: boolean; + /** + * Include commands registered by protocol clients, including SDK clients and extensions + */ + includeClientCommands?: boolean; } /** @experimental */ export interface SessionHistoryCompactRequest { - /** - * Optional user-provided instructions to focus the compaction summary - */ - customInstructions?: string; - /** - * What initiated this compaction request, recorded as the `trigger` on the persisted `session.compaction_start` / `session.compaction_complete` events. When absent, the compaction is persisted without trigger attribution (initiator unknown). - */ - trigger?: /** User-requested compaction, e.g. the /compact command or a direct history.compact call. */ - | "manual" - /** Compaction requested while switching to a model with a smaller context window. */ - | "model_switch"; - /** - * Context window token limit this compaction is targeting, recorded as the `tokenLimit` on the persisted `session.compaction_start` / `session.compaction_complete` events. Set it when the compaction targets a window other than the compacting model's own, e.g. switching to a model with a smaller context window: the compaction still runs on the current model, so the limit that motivated it would otherwise be lost. When absent, the events record the compacting model's own resolved limit. Attribution metadata only - it does not change how much the compaction removes. - */ - tokenLimit?: number; + /** + * Optional user-provided instructions to focus the compaction summary + */ + customInstructions?: string; + /** + * What initiated this compaction request, recorded as the `trigger` on the persisted `session.compaction_start` / `session.compaction_complete` events. When absent, the compaction is persisted without trigger attribution (initiator unknown). + */ + trigger?: /** User-requested compaction, e.g. the /compact command or a direct history.compact call. */ + | "manual" + /** Compaction requested while switching to a model with a smaller context window. */ + | "model_switch"; + /** + * Context window token limit this compaction is targeting, recorded as the `tokenLimit` on the persisted `session.compaction_start` / `session.compaction_complete` events. Set it when the compaction targets a window other than the compacting model's own, e.g. switching to a model with a smaller context window: the compaction still runs on the current model, so the limit that motivated it would otherwise be lost. When absent, the events record the compacting model's own resolved limit. Attribution metadata only - it does not change how much the compaction removes. + */ + tokenLimit?: number; } /** @experimental */ export interface SessionLimitPredictionPredictRequest { - /** - * Optional model identifier override. If omitted, the session's current model is used. - */ - modelId?: string; - clientType?: SessionLimitPredictionClientType; + /** + * Optional model identifier override. If omitted, the session's current model is used. + */ + modelId?: string; + clientType?: SessionLimitPredictionClientType; } /** * Identifies the target session. @@ -23039,10 +23630,10 @@ export interface SessionLimitPredictionPredictRequest { */ /** @experimental */ export interface SkillProviderListRequest { - /** - * Target session identifier - */ - sessionId: string; + /** + * Target session identifier + */ + sessionId: string; } /** * Identifies the target session. @@ -23052,10 +23643,10 @@ export interface SkillProviderListRequest { */ /** @experimental */ export interface SessionFsSqliteExistsRequest { - /** - * Target session identifier - */ - sessionId: string; + /** + * Target session identifier + */ + sessionId: string; } /** Create typed server-scoped RPC methods (no session required). */ @@ -23168,7 +23759,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Confirmation that the secret values were registered. */ - addFilterValues: async (params: SecretsAddFilterValuesRequest): Promise => + addFilterValues: async ( + params: SecretsAddFilterValuesRequest + ): Promise => connection.sendRequest("secrets.addFilterValues", params), }, /** @experimental */ @@ -23220,8 +23813,7 @@ export function createServerRpc(connection: MessageConnection) { /** * Drops this runtime process's in-memory MCP server-definition cache so the next MCP config read observes disk. */ - reload: async (): Promise => - connection.sendRequest("mcp.config.reload", {}), + reload: async (): Promise => connection.sendRequest("mcp.config.reload", {}), }, /** * Discovers MCP servers from user, workspace, plugin, and builtin sources. @@ -23292,8 +23884,7 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Plugins installed in user/global state. */ - list: async (): Promise => - connection.sendRequest("plugins.list", {}), + list: async (): Promise => connection.sendRequest("plugins.list", {}), /** * Installs a plugin from a marketplace, GitHub repo, URL, or local path. * @@ -23375,7 +23966,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Outcome of the remove attempt, including dependent-plugin info when applicable. */ - remove: async (params: PluginsMarketplacesRemoveRequest): Promise => + remove: async ( + params: PluginsMarketplacesRemoveRequest + ): Promise => connection.sendRequest("plugins.marketplaces.remove", params), /** * Lists plugins advertised by a registered marketplace. @@ -23384,7 +23977,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Plugins advertised by the marketplace. */ - browse: async (params: PluginsMarketplacesBrowseRequest): Promise => + browse: async ( + params: PluginsMarketplacesBrowseRequest + ): Promise => connection.sendRequest("plugins.marketplaces.browse", params), /** * Re-fetches one or all registered marketplace catalogs. @@ -23393,7 +23988,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Result of refreshing one or more marketplace catalogs. */ - refresh: async (params: PluginsMarketplacesRefreshRequest): Promise => + refresh: async ( + params: PluginsMarketplacesRefreshRequest + ): Promise => connection.sendRequest("plugins.marketplaces.refresh", params), }, }, @@ -23406,14 +24003,18 @@ export function createServerRpc(connection: MessageConnection) { * * @param params Skill names to mark as disabled in global configuration, replacing any previous list. */ - setDisabledSkills: async (params: SkillsConfigSetDisabledSkillsRequest): Promise => + setDisabledSkills: async ( + params: SkillsConfigSetDisabledSkillsRequest + ): Promise => connection.sendRequest("skills.config.setDisabledSkills", params), /** * Atomically adds or removes one skill from the disabled list. * * @param params Adds or removes a single skill from the global disabled list, leaving every other entry untouched. */ - setSkillDisabled: async (params: SkillsConfigSetSkillDisabledRequest): Promise => + setSkillDisabled: async ( + params: SkillsConfigSetSkillDisabledRequest + ): Promise => connection.sendRequest("skills.config.setSkillDisabled", params), }, /** @@ -23432,7 +24033,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Canonical locations where skills can be created so the runtime will recognize them. */ - getDiscoveryPaths: async (params: SkillsGetDiscoveryPathsRequest): Promise => + getDiscoveryPaths: async ( + params: SkillsGetDiscoveryPathsRequest + ): Promise => connection.sendRequest("skills.getDiscoveryPaths", params), }, /** @experimental */ @@ -23453,7 +24056,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Canonical locations where custom agents can be created so the runtime will recognize them. */ - getDiscoveryPaths: async (params: AgentsGetDiscoveryPathsRequest): Promise => + getDiscoveryPaths: async ( + params: AgentsGetDiscoveryPathsRequest + ): Promise => connection.sendRequest("agents.getDiscoveryPaths", params), }, /** @experimental */ @@ -23465,7 +24070,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Instruction sources discovered across user, repository, and plugin sources. */ - discover: async (params: InstructionsDiscoverRequest): Promise => + discover: async ( + params: InstructionsDiscoverRequest + ): Promise => connection.sendRequest("instructions.discover", params), /** * 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. @@ -23474,7 +24081,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Canonical files and directories where custom instructions can be created so the runtime will recognize them. */ - getDiscoveryPaths: async (params: InstructionsGetDiscoveryPathsRequest): Promise => + getDiscoveryPaths: async ( + params: InstructionsGetDiscoveryPathsRequest + ): Promise => connection.sendRequest("instructions.getDiscoveryPaths", params), }, /** @experimental */ @@ -23484,8 +24093,7 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Slash commands available in the session, after applying any include/exclude filters. */ - list: async (): Promise => - connection.sendRequest("commands.list", {}), + list: async (): Promise => connection.sendRequest("commands.list", {}), }, /** @experimental */ user: { @@ -23534,8 +24142,7 @@ export function createServerRpc(connection: MessageConnection) { /** * Gracefully shuts down an SDK-owned runtime. The response is sent only after cleanup completes; callers may then terminate the owned runtime process. */ - shutdown: async (): Promise => - connection.sendRequest("runtime.shutdown", {}), + shutdown: async (): Promise => connection.sendRequest("runtime.shutdown", {}), }, /** @experimental */ sessionFs: { @@ -23546,7 +24153,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Indicates whether the calling client was registered as the session filesystem provider. */ - setProvider: async (params: SessionFsSetProviderRequest): Promise => + setProvider: async ( + params: SessionFsSetProviderRequest + ): Promise => connection.sendRequest("sessionFs.setProvider", params), }, /** @experimental */ @@ -23565,7 +24174,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Whether the start frame was accepted. */ - httpResponseStart: async (params: LlmInferenceHttpResponseStartRequest): Promise => + httpResponseStart: async ( + params: LlmInferenceHttpResponseStartRequest + ): Promise => connection.sendRequest("llmInference.httpResponseStart", params), /** * 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. @@ -23574,7 +24185,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Whether the chunk was accepted. */ - httpResponseChunk: async (params: LlmInferenceHttpResponseChunkRequest): Promise => + httpResponseChunk: async ( + params: LlmInferenceHttpResponseChunkRequest + ): Promise => connection.sendRequest("llmInference.httpResponseChunk", params), }, /** @experimental */ @@ -23604,7 +24217,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Remote session connection result. */ - connect: async (params: ConnectRemoteSessionParams): Promise => + connect: async ( + params: ConnectRemoteSessionParams + ): Promise => connection.sendRequest("sessions.connect", params), /** * Lists sessions, optionally filtered by source and working-directory context. Returned entries are discriminated by `isRemote`: local entries carry only the lightweight `LocalSessionMetadataValue` shape; remote entries carry the full `RemoteSessionMetadataValue` shape (repository, PR number, taskType, etc.). @@ -23622,7 +24237,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Batch of session events returned by a read, with cursor and continuation metadata. */ - readPersistedEvents: async (params: SessionsReadPersistedEventsRequest): Promise => + readPersistedEvents: async ( + params: SessionsReadPersistedEventsRequest + ): Promise => connection.sendRequest("sessions.readPersistedEvents", params), /** * Finds the local session bound to a GitHub task ID, if any. @@ -23631,7 +24248,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns ID of the local session bound to the given GitHub task, or omitted when none. */ - findByTaskId: async (params: SessionsFindByTaskIDRequest): Promise => + findByTaskId: async ( + params: SessionsFindByTaskIDRequest + ): Promise => connection.sendRequest("sessions.findByTaskId", params), /** * Resolves a UUID prefix to a unique session ID, if exactly one session matches. @@ -23640,7 +24259,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Session ID matching the prefix, omitted when no unique match exists. */ - findByPrefix: async (params: SessionsFindByPrefixRequest): Promise => + findByPrefix: async ( + params: SessionsFindByPrefixRequest + ): Promise => connection.sendRequest("sessions.findByPrefix", params), /** * Returns the most-relevant prior session for a given working-directory context. @@ -23649,7 +24270,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Most-relevant session ID for the supplied context, or omitted when no sessions exist. */ - getLastForContext: async (params: SessionsGetLastForContextRequest): Promise => + getLastForContext: async ( + params: SessionsGetLastForContextRequest + ): Promise => connection.sendRequest("sessions.getLastForContext", params), /** * Returns the on-disk byte size of each session's workspace directory. @@ -23665,7 +24288,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Session IDs from the input set that are currently in use by another process. */ - checkInUse: async (params: SessionsCheckInUseRequest): Promise => + checkInUse: async ( + params: SessionsCheckInUseRequest + ): Promise => connection.sendRequest("sessions.checkInUse", params), /** * Closes a session: emits shutdown, flushes pending events, releases the in-use lock, and disposes the active session. @@ -23683,7 +24308,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Map of sessionId -> bytes freed by removing the session's workspace directory. */ - bulkDelete: async (params: SessionsBulkDeleteRequest): Promise => + bulkDelete: async ( + params: SessionsBulkDeleteRequest + ): Promise => connection.sendRequest("sessions.bulkDelete", params), /** * Deletes sessions older than the given threshold, with optional dry-run and exclusion list. @@ -23710,7 +24337,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session. */ - releaseLock: async (params: SessionsReleaseLockRequest): Promise => + releaseLock: async ( + params: SessionsReleaseLockRequest + ): Promise => connection.sendRequest("sessions.releaseLock", params), /** * Backfills missing summary and context fields on the supplied session metadata records. @@ -23719,7 +24348,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted. */ - enrichMetadata: async (params: SessionsEnrichMetadataRequest): Promise => + enrichMetadata: async ( + params: SessionsEnrichMetadataRequest + ): Promise => connection.sendRequest("sessions.enrichMetadata", params), /** * Reloads user, plugin, and (optionally) repo hooks on the active session. @@ -23728,7 +24359,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId. */ - reloadPluginHooks: async (params: SessionsReloadPluginHooksRequest): Promise => + reloadPluginHooks: async ( + params: SessionsReloadPluginHooksRequest + ): Promise => connection.sendRequest("sessions.reloadPluginHooks", params), /** * Loads previously-deferred repo-level hooks on the active session, returning queued startup prompts. @@ -23737,7 +24370,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Queued repo-level startup prompts and the total hook command count after loading. */ - loadDeferredRepoHooks: async (params: SessionsLoadDeferredRepoHooksRequest): Promise => + loadDeferredRepoHooks: async ( + params: SessionsLoadDeferredRepoHooksRequest + ): Promise => connection.sendRequest("sessions.loadDeferredRepoHooks", params), /** * Replaces the manager-wide additional plugins registered with the session manager. @@ -23746,7 +24381,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload. */ - setAdditionalPlugins: async (params: SessionsSetAdditionalPluginsRequest): Promise => + setAdditionalPlugins: async ( + params: SessionsSetAdditionalPluginsRequest + ): Promise => connection.sendRequest("sessions.setAdditionalPlugins", params), /** * Attaches the runtime-managed remote-control singleton to a session, awaiting initial setup. If remote control is already attached to a different session, the singleton is transferred (preserving the underlying Mission Control connection). Returns the final status. @@ -23755,7 +24392,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Wrapper for the singleton's current status. */ - startRemoteControl: async (params: SessionsStartRemoteControlRequest): Promise => + startRemoteControl: async ( + params: SessionsStartRemoteControlRequest + ): Promise => connection.sendRequest("sessions.startRemoteControl", params), /** * Atomically rebinds the remote-control singleton to a different session, preserving the underlying Mission Control connection. When `expectedFromSessionId` is provided and does not match the singleton's current `attachedSessionId`, the transfer is rejected with `transferred: false` and the current status is returned unchanged. @@ -23764,7 +24403,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Outcome of a transferRemoteControl call. */ - transferRemoteControl: async (params: SessionsTransferRemoteControlRequest): Promise => + transferRemoteControl: async ( + params: SessionsTransferRemoteControlRequest + ): Promise => connection.sendRequest("sessions.transferRemoteControl", params), /** * Patches the steering state of the active remote-control singleton. When remote control is off, this is a no-op and the off status is returned. Today only `enabled: true` is actionable on the underlying exporter; passing `false` is reserved for future use. @@ -23773,7 +24414,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Wrapper for the singleton's current status. */ - setRemoteControlSteering: async (params: SessionsSetRemoteControlSteeringRequest): Promise => + setRemoteControlSteering: async ( + params: SessionsSetRemoteControlSteeringRequest + ): Promise => connection.sendRequest("sessions.setRemoteControlSteering", params), /** * Stops the remote-control singleton. When `expectedSessionId` is provided and does not match the singleton's current `attachedSessionId`, the stop is rejected with `stopped: false` and the current status is returned unchanged (unless `force` is set, in which case the singleton is unconditionally torn down). @@ -23782,7 +24425,9 @@ export function createServerRpc(connection: MessageConnection) { * * @returns Outcome of a stopRemoteControl call. */ - stopRemoteControl: async (params: SessionsStopRemoteControlRequest): Promise => + stopRemoteControl: async ( + params: SessionsStopRemoteControlRequest + ): Promise => connection.sendRequest("sessions.stopRemoteControl", params), /** * Returns the current state of the remote-control singleton, including the attached session id and frontend URL when active. @@ -23834,7 +24479,9 @@ export function createInternalServerRpc(connection: MessageConnection) { * * @returns Persisted local session metadata when the session exists. */ - getMetadata: async (params: SessionsGetMetadataRequest): Promise => + getMetadata: async ( + params: SessionsGetMetadataRequest + ): Promise => connection.sendRequest("sessions.getMetadata", params), /** * Lists recent local session IDs that contain user-visible history, omitting housekeeping-only sessions. @@ -23843,7 +24490,9 @@ export function createInternalServerRpc(connection: MessageConnection) { * * @returns Recent local session IDs that contain user-visible history. */ - listNonEmptySessionIds: async (params: SessionsListNonEmptySessionIdsRequest): Promise => + listNonEmptySessionIds: async ( + params: SessionsListNonEmptySessionIdsRequest + ): Promise => connection.sendRequest("sessions.listNonEmptySessionIds", params), /** * Computes the absolute path to a session's persisted events.jsonl file. Internal: filesystem paths are only meaningful in-process (CLI and runtime share a filesystem). Currently used by the CLI's contribution-graph feature to read historical events directly. Remote SDK consumers must not depend on this; a proper event-query API would replace it if the contribution graph ever needed to work over the wire. @@ -23852,7 +24501,9 @@ export function createInternalServerRpc(connection: MessageConnection) { * * @returns Absolute path to the session's events.jsonl file on disk. */ - getEventFilePath: async (params: SessionsGetEventFilePathRequest): Promise => + getEventFilePath: async ( + params: SessionsGetEventFilePathRequest + ): Promise => connection.sendRequest("sessions.getEventFilePath", params), /** * Returns a session's persisted remote-steerable flag, if any has been recorded. Internal: this is CLI-specific book-keeping used by `--continue` / `--resume` to inherit the prior session's remote-steerable preference. SDK consumers that want similar behavior should manage their own persistence around start/stop calls rather than relying on this runtime-side flag. @@ -23861,7 +24512,9 @@ export function createInternalServerRpc(connection: MessageConnection) { * * @returns The session's persisted remote-steerable flag, or omitted when no value has been persisted. */ - getPersistedRemoteSteerable: async (params: SessionsGetPersistedRemoteSteerableRequest): Promise => + getPersistedRemoteSteerable: async ( + params: SessionsGetPersistedRemoteSteerableRequest + ): Promise => connection.sendRequest("sessions.getPersistedRemoteSteerable", params), /** * Deletes one local session from disk after running the same lifecycle hooks as the session manager. @@ -23877,7 +24530,9 @@ export function createInternalServerRpc(connection: MessageConnection) { * * @returns Dynamic-context board entry count, when available. */ - getBoardEntryCount: async (params: SessionsGetBoardEntryCountRequest): Promise => + getBoardEntryCount: async ( + params: SessionsGetBoardEntryCountRequest + ): Promise => connection.sendRequest("sessions.getBoardEntryCount", params), /** * Registers extension-provided tools on the given session, gated by an optional `enabled` callback. Returns an opaque unsubscribe function the caller must invoke to deregister the tools when the extension is torn down. Marked internal because `loader`, `enabled`, and the returned `unsubscribe` are in-process handles that cannot cross the JSON-RPC boundary. Disappears once extension discovery / launch / tool registration are owned by the runtime: SDK consumers will pass pure config (search paths, disabled ids) via `SessionOptions` and the runtime will resolve, launch, register, and tear down extensions itself. @@ -23886,14 +24541,18 @@ export function createInternalServerRpc(connection: MessageConnection) { * * @returns Handle for releasing the extension tool registration. */ - registerExtensionToolsOnSession: async (params: RegisterExtensionToolsParams): Promise => + registerExtensionToolsOnSession: async ( + params: RegisterExtensionToolsParams + ): Promise => connection.sendRequest("sessions.registerExtensionToolsOnSession", params), /** * Attaches (or detaches) an in-process ExtensionController delegate for the given session, used by shared-API surfaces that need to query or modify the session's extension state. Pass `controller: undefined` to detach. Marked internal because the controller is an in-process object that cannot cross the JSON-RPC boundary. Disappears alongside `registerExtensionToolsOnSession`: once the runtime owns extension management, the public surface exposes list/enable/disable/reload as dedicated RPCs served by the runtime. * * @param params Params to attach or detach an in-process ExtensionController delegate. */ - configureSessionExtensions: async (params: ConfigureSessionExtensionsParams): Promise => + configureSessionExtensions: async ( + params: ConfigureSessionExtensionsParams + ): Promise => connection.sendRequest("sessions.configureSessionExtensions", params), }, }; @@ -23961,7 +24620,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @experimental */ - interruptMainTurn: async (params: InterruptMainTurnRequest): Promise => + interruptMainTurn: async ( + params: InterruptMainTurnRequest + ): Promise => connection.sendRequest("session.interruptMainTurn", { sessionId, ...params }), /** * Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running. @@ -23997,8 +24658,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the credential update succeeded. */ - setCredentials: async (params: SessionSetCredentialsParams): Promise => - connection.sendRequest("session.gitHubAuth.setCredentials", { sessionId, ...params }), + setCredentials: async ( + params: SessionSetCredentialsParams + ): Promise => + connection.sendRequest("session.gitHubAuth.setCredentials", { + sessionId, + ...params, + }), }, /** @experimental */ debug: { @@ -24053,8 +24719,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Canvas action invocation result. */ - invoke: async (params: CanvasActionInvokeRequest): Promise => - connection.sendRequest("session.canvas.action.invoke", { sessionId, ...params }), + invoke: async ( + params: CanvasActionInvokeRequest + ): Promise => + connection.sendRequest("session.canvas.action.invoke", { + sessionId, + ...params, + }), }, }, /** @experimental */ @@ -24111,7 +24782,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns A bidirectional page of factory progress. */ - getRunProgress: async (params: FactoryGetRunProgressRequest): Promise => + getRunProgress: async ( + params: FactoryGetRunProgressRequest + ): Promise => connection.sendRequest("session.factory.getRunProgress", { sessionId, ...params }), /** * Requests cancellation of a factory run and returns its run envelope. @@ -24165,9 +24838,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin /** @experimental */ model: { /** - * Gets the currently selected model for the session. + * Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn. * - * @returns The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + * @returns The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. */ getCurrent: async (): Promise => connection.sendRequest("session.model.getCurrent", { sessionId }), @@ -24180,6 +24853,17 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ switchTo: async (params: ModelSwitchToRequest): Promise => connection.sendRequest("session.model.switchTo", { sessionId, ...params }), + /** + * Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`. + * + * @param params An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. + * + * @returns Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. + */ + switchAutoTier: async ( + params: ModelSwitchAutoTierRequest + ): Promise => + connection.sendRequest("session.model.switchAutoTier", { sessionId, ...params }), /** * Updates the session's reasoning effort without changing the selected model. * @@ -24187,8 +24871,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns. */ - setReasoningEffort: async (params: ModelSetReasoningEffortRequest): Promise => - connection.sendRequest("session.model.setReasoningEffort", { sessionId, ...params }), + setReasoningEffort: async ( + params: ModelSetReasoningEffortRequest + ): Promise => + connection.sendRequest("session.model.setReasoningEffort", { + sessionId, + ...params, + }), /** * Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's. * @@ -24277,8 +24966,11 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Todo rows + dependency edges read from the session SQL database. */ - readSqlTodosWithDependencies: async (): Promise => - connection.sendRequest("session.plan.readSqlTodosWithDependencies", { sessionId }), + readSqlTodosWithDependencies: + async (): Promise => + connection.sendRequest("session.plan.readSqlTodosWithDependencies", { + sessionId, + }), }, /** @experimental */ workspaces: { @@ -24296,8 +24988,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Current workspace metadata for the session, including its absolute filesystem path when available. */ - updateMetadata: async (params: WorkspacesUpdateMetadataRequest): Promise => - connection.sendRequest("session.workspaces.updateMetadata", { sessionId, ...params }), + updateMetadata: async ( + params: WorkspacesUpdateMetadataRequest + ): Promise => + connection.sendRequest("session.workspaces.updateMetadata", { + sessionId, + ...params, + }), /** * Ensures a local session workspace exists and returns it. * @@ -24305,7 +25002,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Current workspace metadata for the session, including its absolute filesystem path when available. */ - ensure: async (params: WorkspacesEnsureRequest): Promise => + ensure: async ( + params: WorkspacesEnsureRequest + ): Promise => connection.sendRequest("session.workspaces.ensure", { sessionId, ...params }), /** * Lists files stored in the session workspace files directory. @@ -24321,7 +25020,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Contents of the requested workspace file as a UTF-8 string. */ - readFile: async (params: WorkspacesReadFileRequest): Promise => + readFile: async ( + params: WorkspacesReadFileRequest + ): Promise => connection.sendRequest("session.workspaces.readFile", { sessionId, ...params }), /** * Creates or overwrites a file in the session workspace files directory. @@ -24344,8 +25045,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. */ - readCheckpoint: async (params: WorkspacesReadCheckpointRequest): Promise => - connection.sendRequest("session.workspaces.readCheckpoint", { sessionId, ...params }), + readCheckpoint: async ( + params: WorkspacesReadCheckpointRequest + ): Promise => + connection.sendRequest("session.workspaces.readCheckpoint", { + sessionId, + ...params, + }), /** * Adds a compaction summary checkpoint to the local session workspace. * @@ -24353,7 +25059,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Persisted summary metadata and refreshed workspace metadata. */ - addSummary: async (params: WorkspacesAddSummaryRequest): Promise => + addSummary: async ( + params: WorkspacesAddSummaryRequest + ): Promise => connection.sendRequest("session.workspaces.addSummary", { sessionId, ...params }), /** * Truncates local workspace compaction summaries after a rollback. @@ -24362,8 +25070,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Current workspace metadata for the session, including its absolute filesystem path when available. */ - truncateSummaries: async (params: WorkspacesTruncateSummariesRequest): Promise => - connection.sendRequest("session.workspaces.truncateSummaries", { sessionId, ...params }), + truncateSummaries: async ( + params: WorkspacesTruncateSummariesRequest + ): Promise => + connection.sendRequest("session.workspaces.truncateSummaries", { + sessionId, + ...params, + }), /** * Reads the autopilot objective state file from the local session workspace. * @@ -24378,22 +25091,31 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Result of writing the autopilot objective file. */ - writeAutopilotObjective: async (params: WorkspacesWriteAutopilotObjectiveRequest): Promise => - connection.sendRequest("session.workspaces.writeAutopilotObjective", { sessionId, ...params }), + writeAutopilotObjective: async ( + params: WorkspacesWriteAutopilotObjectiveRequest + ): Promise => + connection.sendRequest("session.workspaces.writeAutopilotObjective", { + sessionId, + ...params, + }), /** * Deletes the autopilot objective state file from the local session workspace. * * @returns Result of deleting the autopilot objective file. */ deleteAutopilotObjective: async (): Promise => - connection.sendRequest("session.workspaces.deleteAutopilotObjective", { sessionId }), + connection.sendRequest("session.workspaces.deleteAutopilotObjective", { + sessionId, + }), /** * Checks whether the local session workspace has an autopilot objective state file. * * @returns Whether the autopilot objective file exists. */ autopilotObjectiveExists: async (): Promise => - connection.sendRequest("session.workspaces.autopilotObjectiveExists", { sessionId }), + connection.sendRequest("session.workspaces.autopilotObjectiveExists", { + sessionId, + }), /** * Saves pasted content as a UTF-8 file in the session workspace. * @@ -24401,8 +25123,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Descriptor for the saved paste file, or null when the workspace is unavailable. */ - saveLargePaste: async (params: WorkspacesSaveLargePasteRequest): Promise => - connection.sendRequest("session.workspaces.saveLargePaste", { sessionId, ...params }), + saveLargePaste: async ( + params: WorkspacesSaveLargePasteRequest + ): Promise => + connection.sendRequest("session.workspaces.saveLargePaste", { + sessionId, + ...params, + }), /** * Computes a diff for the session workspace. Never rejects for a busy session: a `session`-mode diff that cannot read the session's file-change captures falls back to an unstaged git diff with `isFallback: true` and reports why in `unavailableReason`. * @@ -24519,6 +25246,24 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ list: async (): Promise => connection.sendRequest("session.tasks.list", { sessionId }), + /** + * Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal. + * + * @param params Registers or reclaims a client-owned task. + * + * @returns Result of registering or reclaiming a client-owned task. + */ + register: async (params: TasksRegisterRequest): Promise => + connection.sendRequest("session.tasks.register", { sessionId, ...params }), + /** + * Publishes generic progress or a terminal outcome for a client-owned task. + * + * @param params Updates a client-owned task. + * + * @returns Result of publishing a client-owned task update. + */ + update: async (params: TasksUpdateRequest): Promise => + connection.sendRequest("session.tasks.update", { sessionId, ...params }), /** * Refreshes metadata for any detached background shells the runtime knows about. * @@ -24556,8 +25301,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the task was successfully promoted to background mode. */ - promoteToBackground: async (params: TasksPromoteToBackgroundRequest): Promise => - connection.sendRequest("session.tasks.promoteToBackground", { sessionId, ...params }), + promoteToBackground: async ( + params: TasksPromoteToBackgroundRequest + ): Promise => + connection.sendRequest("session.tasks.promoteToBackground", { + sessionId, + ...params, + }), /** * Atomically promotes the first promotable sync-waiting task to background mode and returns it. * @@ -24687,7 +25437,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Outcome of an MCP sampling execution: success result, failure error, or cancellation. */ - executeSampling: async (params: McpExecuteSamplingParams): Promise => + executeSampling: async ( + params: McpExecuteSamplingParams + ): Promise => connection.sendRequest("session.mcp.executeSampling", { sessionId, ...params }), /** * Cancels an in-flight MCP sampling execution by request ID. @@ -24696,8 +25448,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether an in-flight sampling execution with the given requestId was found and cancelled. */ - cancelSamplingExecution: async (params: McpCancelSamplingExecutionParams): Promise => - connection.sendRequest("session.mcp.cancelSamplingExecution", { sessionId, ...params }), + cancelSamplingExecution: async ( + params: McpCancelSamplingExecutionParams + ): Promise => + connection.sendRequest("session.mcp.cancelSamplingExecution", { + sessionId, + ...params, + }), /** * Sets how environment-variable values supplied to MCP servers are resolved (direct or indirect). * @@ -24705,7 +25462,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Env-value mode recorded on the session after the update. */ - setEnvValueMode: async (params: McpSetEnvValueModeParams): Promise => + setEnvValueMode: async ( + params: McpSetEnvValueModeParams + ): Promise => connection.sendRequest("session.mcp.setEnvValueMode", { sessionId, ...params }), /** * Removes the auto-managed `github` MCP server when present. @@ -24742,7 +25501,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Whether the named MCP server is running. */ - isServerRunning: async (params: McpIsServerRunningRequest): Promise => + isServerRunning: async ( + params: McpIsServerRunningRequest + ): Promise => connection.sendRequest("session.mcp.isServerRunning", { sessionId, ...params }), /** @experimental */ oauth: { @@ -24753,15 +25514,25 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the pending MCP OAuth response was accepted. */ - handlePendingRequest: async (params: McpOauthHandlePendingRequest): Promise => - connection.sendRequest("session.mcp.oauth.handlePendingRequest", { sessionId, ...params }), + handlePendingRequest: async ( + params: McpOauthHandlePendingRequest + ): Promise => + connection.sendRequest("session.mcp.oauth.handlePendingRequest", { + sessionId, + ...params, + }), /** * Notifies the session that MCP OAuth authentication succeeded and updated credentials were persisted, so cached tool definitions can be refreshed. * * @param params Identifies the MCP server whose persisted OAuth credentials were updated. */ - authenticationStateChanged: async (params: McpOauthAuthenticationStateChangedRequest): Promise => - connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { sessionId, ...params }), + authenticationStateChanged: async ( + params: McpOauthAuthenticationStateChangedRequest + ): Promise => + connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { + sessionId, + ...params, + }), /** * Starts OAuth authentication for a remote MCP server. * @@ -24799,8 +25570,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the pending MCP headers refresh response was accepted. */ - handlePendingHeadersRefreshRequest: async (params: McpHeadersHandlePendingHeadersRefreshRequestRequest): Promise => - connection.sendRequest("session.mcp.headers.handlePendingHeadersRefreshRequest", { sessionId, ...params }), + handlePendingHeadersRefreshRequest: async ( + params: McpHeadersHandlePendingHeadersRefreshRequestRequest + ): Promise => + connection.sendRequest( + "session.mcp.headers.handlePendingHeadersRefreshRequest", + { sessionId, ...params } + ), }, /** @experimental */ apps: { @@ -24811,8 +25587,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Resource contents returned by the MCP server. */ - readResource: async (params: McpAppsReadResourceRequest): Promise => - connection.sendRequest("session.mcp.apps.readResource", { sessionId, ...params }), + readResource: async ( + params: McpAppsReadResourceRequest + ): Promise => + connection.sendRequest("session.mcp.apps.readResource", { + sessionId, + ...params, + }), /** * List tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `["model","app"]`) or includes `"app"`. * @@ -24820,7 +25601,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns App-callable tools from the named MCP server. */ - listTools: async (params: McpAppsListToolsRequest): Promise => + listTools: async ( + params: McpAppsListToolsRequest + ): Promise => connection.sendRequest("session.mcp.apps.listTools", { sessionId, ...params }), /** * Call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`. @@ -24829,7 +25612,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Standard MCP CallToolResult */ - callTool: async (params: McpAppsCallToolRequest): Promise => + callTool: async ( + params: McpAppsCallToolRequest + ): Promise => connection.sendRequest("session.mcp.apps.callTool", { sessionId, ...params }), /** * Replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI. @@ -24837,7 +25622,10 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * @param params Host context to advertise to MCP App guests. */ setHostContext: async (params: McpAppsSetHostContextRequest): Promise => - connection.sendRequest("session.mcp.apps.setHostContext", { sessionId, ...params }), + connection.sendRequest("session.mcp.apps.setHostContext", { + sessionId, + ...params, + }), /** * Read the current host context advertised to MCP App guests. * @@ -24882,8 +25670,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns One page of resource templates advertised by the named MCP server. */ - listTemplates: async (params: McpResourcesListTemplatesRequest): Promise => - connection.sendRequest("session.mcp.resources.listTemplates", { sessionId, ...params }), + listTemplates: async ( + params: McpResourcesListTemplatesRequest + ): Promise => + connection.sendRequest("session.mcp.resources.listTemplates", { + sessionId, + ...params, + }), }, }, /** @experimental */ @@ -24912,7 +25705,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns A snapshot of the provider endpoint the session is currently configured to talk to. */ - getEndpoint: async (params?: SessionProviderGetEndpointRequest): Promise => + getEndpoint: async ( + params?: SessionProviderGetEndpointRequest + ): Promise => connection.sendRequest("session.provider.getEndpoint", { sessionId, ...params }), /** * 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. @@ -24933,7 +25728,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the session options patch was applied successfully. */ - update: async (params: SessionUpdateOptionsParams): Promise => + update: async ( + params: SessionUpdateOptionsParams + ): Promise => connection.sendRequest("session.options.update", { sessionId, ...params }), }, /** @experimental */ @@ -24979,8 +25776,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @param params Parameters for session.extensions.sendAttachmentsToMessage. */ - sendAttachmentsToMessage: async (params: SendAttachmentsToMessageParams): Promise => - connection.sendRequest("session.extensions.sendAttachmentsToMessage", { sessionId, ...params }), + sendAttachmentsToMessage: async ( + params: SendAttachmentsToMessageParams + ): Promise => + connection.sendRequest("session.extensions.sendAttachmentsToMessage", { + sessionId, + ...params, + }), }, /** @experimental */ tools: { @@ -25000,8 +25802,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Rust-owned built-in tool descriptors for the session. */ - getBuiltinDescriptors: async (params: ToolsGetBuiltinDescriptorsRequest): Promise => - connection.sendRequest("session.tools.getBuiltinDescriptors", { sessionId, ...params }), + getBuiltinDescriptors: async ( + params: ToolsGetBuiltinDescriptorsRequest + ): Promise => + connection.sendRequest("session.tools.getBuiltinDescriptors", { + sessionId, + ...params, + }), /** * Projects a completed task_complete tool call into its label-safe session event payload. * @@ -25009,8 +25816,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Task completion notification with summary from the agent */ - taskCompleteEventData: async (params: ToolsTaskCompleteEventDataRequest): Promise => - connection.sendRequest("session.tools.taskCompleteEventData", { sessionId, ...params }), + taskCompleteEventData: async ( + params: ToolsTaskCompleteEventDataRequest + ): Promise => + connection.sendRequest("session.tools.taskCompleteEventData", { + sessionId, + ...params, + }), /** * Provides the result for a pending external tool call. * @@ -25018,8 +25830,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the external tool call result was handled successfully. */ - handlePendingToolCall: async (params: HandlePendingToolCallRequest): Promise => - connection.sendRequest("session.tools.handlePendingToolCall", { sessionId, ...params }), + handlePendingToolCall: async ( + params: HandlePendingToolCallRequest + ): Promise => + connection.sendRequest("session.tools.handlePendingToolCall", { + sessionId, + ...params, + }), /** * Resolves, builds, and validates the runtime tool list for the session. * @@ -25050,8 +25867,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Empty result after applying subagent settings */ - updateSubagentSettings: async (params: UpdateSubagentSettingsRequest): Promise => - connection.sendRequest("session.tools.updateSubagentSettings", { sessionId, ...params }), + updateSubagentSettings: async ( + params: UpdateSubagentSettingsRequest + ): Promise => + connection.sendRequest("session.tools.updateSubagentSettings", { + sessionId, + ...params, + }), }, /** @experimental */ commands: { @@ -25080,8 +25902,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the pending client-handled command was completed successfully. */ - handlePendingCommand: async (params: CommandsHandlePendingCommandRequest): Promise => - connection.sendRequest("session.commands.handlePendingCommand", { sessionId, ...params }), + handlePendingCommand: async ( + params: CommandsHandlePendingCommandRequest + ): Promise => + connection.sendRequest("session.commands.handlePendingCommand", { + sessionId, + ...params, + }), /** * Executes a slash command synchronously and returns any error. * @@ -25107,8 +25934,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the queued-command response was matched to a pending request. */ - respondToQueuedCommand: async (params: CommandsRespondToQueuedCommandRequest): Promise => - connection.sendRequest("session.commands.respondToQueuedCommand", { sessionId, ...params }), + respondToQueuedCommand: async ( + params: CommandsRespondToQueuedCommandRequest + ): Promise => + connection.sendRequest("session.commands.respondToQueuedCommand", { + sessionId, + ...params, + }), }, /** @experimental */ telemetry: { @@ -25124,8 +25956,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @param params Feature override key/value pairs to attach to subsequent telemetry events from this session. */ - setFeatureOverrides: async (params: TelemetrySetFeatureOverridesRequest): Promise => - connection.sendRequest("session.telemetry.setFeatureOverrides", { sessionId, ...params }), + setFeatureOverrides: async ( + params: TelemetrySetFeatureOverridesRequest + ): Promise => + connection.sendRequest("session.telemetry.setFeatureOverrides", { + sessionId, + ...params, + }), }, /** @experimental */ ui: { @@ -25136,7 +25973,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Completed transient query. Ordered chunks and the terminal outcome are also delivered through `ui.ephemeral_query` session events while it runs. */ - ephemeralQuery: async (params: UIEphemeralQueryRequest): Promise => + ephemeralQuery: async ( + params: UIEphemeralQueryRequest + ): Promise => connection.sendRequest("session.ui.ephemeralQuery", { sessionId, ...params }), /** * Requests structured input from a UI-capable client. @@ -25154,8 +25993,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the elicitation response was accepted; false if it was already resolved by another client. */ - handlePendingElicitation: async (params: UIHandlePendingElicitationRequest): Promise => - connection.sendRequest("session.ui.handlePendingElicitation", { sessionId, ...params }), + handlePendingElicitation: async ( + params: UIHandlePendingElicitationRequest + ): Promise => + connection.sendRequest("session.ui.handlePendingElicitation", { + sessionId, + ...params, + }), /** * Resolves a pending `user_input.requested` event with the user's response. * @@ -25163,8 +26007,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the pending UI request was resolved by this call. */ - handlePendingUserInput: async (params: UIHandlePendingUserInputRequest): Promise => - connection.sendRequest("session.ui.handlePendingUserInput", { sessionId, ...params }), + handlePendingUserInput: async ( + params: UIHandlePendingUserInputRequest + ): Promise => + connection.sendRequest("session.ui.handlePendingUserInput", { + sessionId, + ...params, + }), /** * Resolves a pending `sampling.requested` event with a sampling result, or rejects it. * @@ -25172,8 +26021,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the pending UI request was resolved by this call. */ - handlePendingSampling: async (params: UIHandlePendingSamplingRequest): Promise => - connection.sendRequest("session.ui.handlePendingSampling", { sessionId, ...params }), + handlePendingSampling: async ( + params: UIHandlePendingSamplingRequest + ): Promise => + connection.sendRequest("session.ui.handlePendingSampling", { + sessionId, + ...params, + }), /** * Resolves a pending `auto_mode_switch.requested` event with the user's accept/decline decision. * @@ -25181,8 +26035,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the pending UI request was resolved by this call. */ - handlePendingAutoModeSwitch: async (params: UIHandlePendingAutoModeSwitchRequest): Promise => - connection.sendRequest("session.ui.handlePendingAutoModeSwitch", { sessionId, ...params }), + handlePendingAutoModeSwitch: async ( + params: UIHandlePendingAutoModeSwitchRequest + ): Promise => + connection.sendRequest("session.ui.handlePendingAutoModeSwitch", { + sessionId, + ...params, + }), /** * Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action. * @@ -25190,8 +26049,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the pending UI request was resolved by this call. */ - handlePendingSessionLimitsExhausted: async (params: UIHandlePendingSessionLimitsExhaustedRequest): Promise => - connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", { sessionId, ...params }), + handlePendingSessionLimitsExhausted: async ( + params: UIHandlePendingSessionLimitsExhaustedRequest + ): Promise => + connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", { + sessionId, + ...params, + }), /** * Resolves a pending `exit_plan_mode.requested` event with the user's response. * @@ -25199,15 +26063,23 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the pending UI request was resolved by this call. */ - handlePendingExitPlanMode: async (params: UIHandlePendingExitPlanModeRequest): Promise => - connection.sendRequest("session.ui.handlePendingExitPlanMode", { sessionId, ...params }), + handlePendingExitPlanMode: async ( + params: UIHandlePendingExitPlanModeRequest + ): Promise => + connection.sendRequest("session.ui.handlePendingExitPlanMode", { + sessionId, + ...params, + }), /** * Registers an in-process handler for auto-mode-switch requests so the server bridge skips dispatch. * * @returns Register an in-process handler for `auto_mode_switch.requested` events. The caller still attaches the actual listener via the standard event-subscription mechanism; this registration solely tells the server bridge to skip its own dispatch (so a remote client doesn't race the in-process handler for the same requestId). */ - registerDirectAutoModeSwitchHandler: async (): Promise => - connection.sendRequest("session.ui.registerDirectAutoModeSwitchHandler", { sessionId }), + registerDirectAutoModeSwitchHandler: + async (): Promise => + connection.sendRequest("session.ui.registerDirectAutoModeSwitchHandler", { + sessionId, + }), /** * Unregisters a previously-registered in-process auto-mode-switch handler by its opaque handle. * @@ -25215,8 +26087,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the handle was active and the registration count was decremented. */ - unregisterDirectAutoModeSwitchHandler: async (params: UIUnregisterDirectAutoModeSwitchHandlerRequest): Promise => - connection.sendRequest("session.ui.unregisterDirectAutoModeSwitchHandler", { sessionId, ...params }), + unregisterDirectAutoModeSwitchHandler: async ( + params: UIUnregisterDirectAutoModeSwitchHandlerRequest + ): Promise => + connection.sendRequest("session.ui.unregisterDirectAutoModeSwitchHandler", { + sessionId, + ...params, + }), }, /** @experimental */ permissions: { @@ -25227,7 +26104,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - configure: async (params: PermissionsConfigureParams): Promise => + configure: async ( + params: PermissionsConfigureParams + ): Promise => connection.sendRequest("session.permissions.configure", { sessionId, ...params }), /** * Provides a decision for a pending tool permission request. @@ -25236,8 +26115,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the permission decision was applied; false when the request was already resolved. */ - handlePendingPermissionRequest: async (params: PermissionDecisionRequest): Promise => - connection.sendRequest("session.permissions.handlePendingPermissionRequest", { sessionId, ...params }), + handlePendingPermissionRequest: async ( + params: PermissionDecisionRequest + ): Promise => + connection.sendRequest("session.permissions.handlePendingPermissionRequest", { + sessionId, + ...params, + }), /** * Reconstructs the set of pending tool permission requests from the session's event history. * @@ -25252,8 +26136,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - setApproveAll: async (params: PermissionsSetApproveAllRequest): Promise => - connection.sendRequest("session.permissions.setApproveAll", { sessionId, ...params }), + setApproveAll: async ( + params: PermissionsSetApproveAllRequest + ): Promise => + connection.sendRequest("session.permissions.setApproveAll", { + sessionId, + ...params, + }), /** * Sets the permission mode for the session. `manual` follows the normal approval flow, `assisted` attaches LLM safety recommendations, and `allow-all` automatically approves permission requests. The result returns the authoritative post-mutation mode so callers can update local state without racing the `session.permissions_changed` notification. * @@ -25277,7 +26166,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - modifyRules: async (params: PermissionsModifyRulesParams): Promise => + modifyRules: async ( + params: PermissionsModifyRulesParams + ): Promise => connection.sendRequest("session.permissions.modifyRules", { sessionId, ...params }), /** * Sets whether the client wants permission prompts bridged into session events. @@ -25286,7 +26177,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - setRequired: async (params: PermissionsSetRequiredRequest): Promise => + setRequired: async ( + params: PermissionsSetRequiredRequest + ): Promise => connection.sendRequest("session.permissions.setRequired", { sessionId, ...params }), /** * Clears session-scoped tool permission approvals. @@ -25295,8 +26188,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - resetSessionApprovals: async (params: PermissionsResetSessionApprovalsRequest): Promise => - connection.sendRequest("session.permissions.resetSessionApprovals", { sessionId, ...params }), + resetSessionApprovals: async ( + params: PermissionsResetSessionApprovalsRequest + ): Promise => + connection.sendRequest("session.permissions.resetSessionApprovals", { + sessionId, + ...params, + }), /** * Notifies the runtime that a permission prompt UI has been shown to the user. * @@ -25304,8 +26202,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - notifyPromptShown: async (params: PermissionPromptShownNotification): Promise => - connection.sendRequest("session.permissions.notifyPromptShown", { sessionId, ...params }), + notifyPromptShown: async ( + params: PermissionPromptShownNotification + ): Promise => + connection.sendRequest("session.permissions.notifyPromptShown", { + sessionId, + ...params, + }), /** @experimental */ paths: { /** @@ -25323,7 +26226,10 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * @returns Indicates whether the operation succeeded. */ add: async (params: PermissionPathsAddParams): Promise => - connection.sendRequest("session.permissions.paths.add", { sessionId, ...params }), + connection.sendRequest("session.permissions.paths.add", { + sessionId, + ...params, + }), /** * Updates the session's primary working directory used by the permission policy. * @@ -25331,8 +26237,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - updatePrimary: async (params: PermissionPathsUpdatePrimaryParams): Promise => - connection.sendRequest("session.permissions.paths.updatePrimary", { sessionId, ...params }), + updatePrimary: async ( + params: PermissionPathsUpdatePrimaryParams + ): Promise => + connection.sendRequest("session.permissions.paths.updatePrimary", { + sessionId, + ...params, + }), /** * Reports whether a path falls within any of the session's allowed directories. * @@ -25340,8 +26251,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the supplied path is within the session's allowed directories. */ - isPathWithinAllowedDirectories: async (params: PermissionPathsAllowedCheckParams): Promise => - connection.sendRequest("session.permissions.paths.isPathWithinAllowedDirectories", { sessionId, ...params }), + isPathWithinAllowedDirectories: async ( + params: PermissionPathsAllowedCheckParams + ): Promise => + connection.sendRequest( + "session.permissions.paths.isPathWithinAllowedDirectories", + { sessionId, ...params } + ), /** * Reports whether a path falls within the session's workspace (primary) directory. * @@ -25349,8 +26265,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the supplied path is within the session's workspace directory. */ - isPathWithinWorkspace: async (params: PermissionPathsWorkspaceCheckParams): Promise => - connection.sendRequest("session.permissions.paths.isPathWithinWorkspace", { sessionId, ...params }), + isPathWithinWorkspace: async ( + params: PermissionPathsWorkspaceCheckParams + ): Promise => + connection.sendRequest("session.permissions.paths.isPathWithinWorkspace", { + sessionId, + ...params, + }), }, /** @experimental */ locations: { @@ -25361,8 +26282,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Resolved location-permissions key and type. */ - resolve: async (params: PermissionLocationResolveParams): Promise => - connection.sendRequest("session.permissions.locations.resolve", { sessionId, ...params }), + resolve: async ( + params: PermissionLocationResolveParams + ): Promise => + connection.sendRequest("session.permissions.locations.resolve", { + sessionId, + ...params, + }), /** * Applies persisted location-scoped tool approvals and allowed directories for a working directory to this session's permission service. * @@ -25370,8 +26296,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Summary of persisted location permissions applied to the session. */ - apply: async (params: PermissionLocationApplyParams): Promise => - connection.sendRequest("session.permissions.locations.apply", { sessionId, ...params }), + apply: async ( + params: PermissionLocationApplyParams + ): Promise => + connection.sendRequest("session.permissions.locations.apply", { + sessionId, + ...params, + }), /** * Persists a tool approval for a permission location and applies its rules to this session's live permission service. * @@ -25379,8 +26310,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - addToolApproval: async (params: PermissionLocationAddToolApprovalParams): Promise => - connection.sendRequest("session.permissions.locations.addToolApproval", { sessionId, ...params }), + addToolApproval: async ( + params: PermissionLocationAddToolApprovalParams + ): Promise => + connection.sendRequest("session.permissions.locations.addToolApproval", { + sessionId, + ...params, + }), }, /** @experimental */ folderTrust: { @@ -25391,8 +26327,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Folder trust check result. */ - isTrusted: async (params: FolderTrustCheckParams): Promise => - connection.sendRequest("session.permissions.folderTrust.isTrusted", { sessionId, ...params }), + isTrusted: async ( + params: FolderTrustCheckParams + ): Promise => + connection.sendRequest("session.permissions.folderTrust.isTrusted", { + sessionId, + ...params, + }), /** * Adds a folder to the user's trusted folders list. * @@ -25400,8 +26341,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - addTrusted: async (params: FolderTrustAddParams): Promise => - connection.sendRequest("session.permissions.folderTrust.addTrusted", { sessionId, ...params }), + addTrusted: async ( + params: FolderTrustAddParams + ): Promise => + connection.sendRequest("session.permissions.folderTrust.addTrusted", { + sessionId, + ...params, + }), }, /** @experimental */ urls: { @@ -25412,8 +26358,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - setUnrestrictedMode: async (params: PermissionUrlsSetUnrestrictedModeParams): Promise => - connection.sendRequest("session.permissions.urls.setUnrestrictedMode", { sessionId, ...params }), + setUnrestrictedMode: async ( + params: PermissionUrlsSetUnrestrictedModeParams + ): Promise => + connection.sendRequest("session.permissions.urls.setUnrestrictedMode", { + sessionId, + ...params, + }), }, }, /** @@ -25457,7 +26408,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Token breakdown for the session's current context window, or null if uninitialized. */ - contextInfo: async (params: MetadataContextInfoRequest): Promise => + contextInfo: async ( + params: MetadataContextInfoRequest + ): Promise => connection.sendRequest("session.metadata.contextInfo", { sessionId, ...params }), /** * Returns the experimental per-source attribution breakdown of the session's current context window as a flat list of entries (skills, subagents, MCP servers, built-in tools, plugin rollups, system/tool-definition costs, with nesting via parentId), plus the successful compaction count. The heaviest individual messages are available separately via `metadata.getContextHeaviestMessages`. Returns null until the session has initialized its system prompt and tool metadata. @@ -25473,8 +26426,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns The heaviest individual messages in the session's context window, most-expensive first. */ - getContextHeaviestMessages: async (params: MetadataContextHeaviestMessagesRequest): Promise => - connection.sendRequest("session.metadata.getContextHeaviestMessages", { sessionId, ...params }), + getContextHeaviestMessages: async ( + params: MetadataContextHeaviestMessagesRequest + ): Promise => + connection.sendRequest("session.metadata.getContextHeaviestMessages", { + sessionId, + ...params, + }), /** * Records a working-directory/git context change and emits a `session.context_changed` event. For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event): a local session's working directory is authoritative and is moved via `metadata.setWorkingDirectory` (or an SDK `session.resume` that supplies a `workingDirectory`), not by this method. * @@ -25482,8 +26440,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead. */ - recordContextChange: async (params: MetadataRecordContextChangeRequest): Promise => - connection.sendRequest("session.metadata.recordContextChange", { sessionId, ...params }), + recordContextChange: async ( + params: MetadataRecordContextChangeRequest + ): Promise => + connection.sendRequest("session.metadata.recordContextChange", { + sessionId, + ...params, + }), /** * Updates the session's working directory. For local sessions the target is validated first (an absolute path that exists on disk) and the permission primary directory is re-based; a rejected validation fails the call before any session state changes. * @@ -25491,8 +26454,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Update the session's working directory. Used by the host when the user explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for any related side-effects (file index, etc.); it does NOT change the process working directory (a session's cwd is per-session, not process-global). For local sessions the runtime validates the target first (an absolute path that exists on disk) and re-bases the permission primary directory; a rejected validation fails the call before anything is mutated, persisted, or emitted. Location-scoped permission rules are then re-keyed to the new directory (best-effort). Remote sessions only record the path. */ - setWorkingDirectory: async (params: MetadataSetWorkingDirectoryRequest): Promise => - connection.sendRequest("session.metadata.setWorkingDirectory", { sessionId, ...params }), + setWorkingDirectory: async ( + params: MetadataSetWorkingDirectoryRequest + ): Promise => + connection.sendRequest("session.metadata.setWorkingDirectory", { + sessionId, + ...params, + }), /** * Re-tokenizes the session's existing messages against a model and returns aggregate token totals. * @@ -25500,8 +26468,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.context_info_changed` events. Returns zeros for an empty session. */ - recomputeContextTokens: async (params: MetadataRecomputeContextTokensRequest): Promise => - connection.sendRequest("session.metadata.recomputeContextTokens", { sessionId, ...params }), + recomputeContextTokens: async ( + params: MetadataRecomputeContextTokensRequest + ): Promise => + connection.sendRequest("session.metadata.recomputeContextTokens", { + sessionId, + ...params, + }), }, /** @experimental */ contentExclusion: { @@ -25512,8 +26485,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable. */ - checkPaths: async (params: ContentExclusionCheckPathsRequest): Promise => - connection.sendRequest("session.contentExclusion.checkPaths", { sessionId, ...params }), + checkPaths: async ( + params: ContentExclusionCheckPathsRequest + ): Promise => + connection.sendRequest("session.contentExclusion.checkPaths", { + sessionId, + ...params, + }), }, /** @experimental */ shell: { @@ -25542,8 +26520,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Result of a user-requested shell command. */ - executeUserRequested: async (params: ShellExecuteUserRequestedRequest): Promise => - connection.sendRequest("session.shell.executeUserRequested", { sessionId, ...params }), + executeUserRequested: async ( + params: ShellExecuteUserRequestedRequest + ): Promise => + connection.sendRequest("session.shell.executeUserRequested", { + sessionId, + ...params, + }), /** * Cancels a user-requested shell command by request ID. * @@ -25551,8 +26534,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Cancellation result for a user-requested shell command. */ - cancelUserRequested: async (params: ShellCancelUserRequestedRequest): Promise => - connection.sendRequest("session.shell.cancelUserRequested", { sessionId, ...params }), + cancelUserRequested: async ( + params: ShellCancelUserRequestedRequest + ): Promise => + connection.sendRequest("session.shell.cancelUserRequested", { + sessionId, + ...params, + }), }, /** @experimental */ history: { @@ -25588,7 +26576,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Files and aggregate changes for a prospective rewind. */ - previewRewind: async (params: HistoryPreviewRewindRequest): Promise => + previewRewind: async ( + params: HistoryPreviewRewindRequest + ): Promise => connection.sendRequest("session.history.previewRewind", { sessionId, ...params }), /** * Rewinds the session conversation, optionally restoring files changed by the discarded turns. Not crash-atomic: file restore and conversation truncation are separate stores, applied in that order, so a process crash between them can leave the workspace rewound while the conversation still contains the discarded turns. There is no recovery journal; re-running the same rewind is the recovery path for a crash before truncation lands, since file restore is idempotent (already-restored files are reported as skipped) and truncation is re-derived from the still-retained boundary event. After truncation lands that boundary no longer exists, so the same request is rejected; the only stage that can still be outstanding is snapshot pruning, whose failure leaves orphan snapshots the capture store tolerates. The reverse inconsistency cannot occur, because truncation is never applied before file restore succeeds. @@ -25604,8 +26594,11 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether an in-progress background compaction was cancelled. */ - cancelBackgroundCompaction: async (): Promise => - connection.sendRequest("session.history.cancelBackgroundCompaction", { sessionId }), + cancelBackgroundCompaction: + async (): Promise => + connection.sendRequest("session.history.cancelBackgroundCompaction", { + sessionId, + }), /** * Aborts any in-progress manual compaction on a local session. * @@ -25627,7 +26620,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns What a successful clear removed. A clear that could not be applied rejects instead of reporting a count. */ - clearContext: async (params: HistoryClearContextRequest): Promise => + clearContext: async ( + params: HistoryClearContextRequest + ): Promise => connection.sendRequest("session.history.clearContext", { sessionId, ...params }), }, /** @experimental */ @@ -25738,8 +26733,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Opaque handle representing an event-type interest registration. */ - registerInterest: async (params: RegisterEventInterestParams): Promise => - connection.sendRequest("session.eventLog.registerInterest", { sessionId, ...params }), + registerInterest: async ( + params: RegisterEventInterestParams + ): Promise => + connection.sendRequest("session.eventLog.registerInterest", { + sessionId, + ...params, + }), /** * Releases a consumer's previously-registered interest in an event type. * @@ -25747,8 +26747,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Indicates whether the operation succeeded. */ - releaseInterest: async (params: ReleaseEventInterestParams): Promise => - connection.sendRequest("session.eventLog.releaseInterest", { sessionId, ...params }), + releaseInterest: async ( + params: ReleaseEventInterestParams + ): Promise => + connection.sendRequest("session.eventLog.releaseInterest", { + sessionId, + ...params, + }), }, /** @experimental */ usage: { @@ -25769,7 +26774,9 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Prediction result. Available results include prediction details; unavailable results include an explicit reason. */ - predict: async (params?: SessionLimitPredictionPredictRequest): Promise => + predict: async ( + params?: SessionLimitPredictionPredictRequest + ): Promise => connection.sendRequest("session.limitPrediction.predict", { sessionId, ...params }), }, /** @experimental */ @@ -25795,8 +26802,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin * * @returns Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own. */ - notifySteerableChanged: async (params: RemoteNotifySteerableChangedRequest): Promise => - connection.sendRequest("session.remote.notifySteerableChanged", { sessionId, ...params }), + notifySteerableChanged: async ( + params: RemoteNotifySteerableChangedRequest + ): Promise => + connection.sendRequest("session.remote.notifySteerableChanged", { + sessionId, + ...params, + }), }, /** @experimental */ visibility: { @@ -25908,7 +26920,9 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns Whether the requested authentication was logged out. */ - logoutUser: async (params: SessionAuthLogoutUserRequest): Promise => + logoutUser: async ( + params: SessionAuthLogoutUserRequest + ): Promise => connection.sendRequest("session.gitHubAuth.logoutUser", { sessionId, ...params }), /** * Gets validation errors from the most recent authentication attempt. @@ -25928,14 +26942,20 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * @param params Internal canvas provider registration parameters. */ register: async (params: CanvasProviderRegisterRequest): Promise => - connection.sendRequest("session.canvas.provider.register", { sessionId, ...params }), + connection.sendRequest("session.canvas.provider.register", { + sessionId, + ...params, + }), /** * Unregisters an internal canvas provider connection. * * @param params Internal canvas provider unregistration parameters. */ unregister: async (params: CanvasProviderUnregisterRequest): Promise => - connection.sendRequest("session.canvas.provider.unregister", { sessionId, ...params }), + connection.sendRequest("session.canvas.provider.unregister", { + sessionId, + ...params, + }), }, }, /** @experimental */ @@ -25956,7 +26976,9 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns Resolved persisted factory identity and resumed run envelope. */ - resumeFromTool: async (params: FactoryToolResumeRequest): Promise => + resumeFromTool: async ( + params: FactoryToolResumeRequest + ): Promise => connection.sendRequest("session.factory.resumeFromTool", { sessionId, ...params }), }, /** @experimental */ @@ -25968,8 +26990,13 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns The model identifier active on the session after the switch. */ - applyStartupOverlay: async (params: ModelApplyStartupOverlayRequest): Promise => - connection.sendRequest("session.model.applyStartupOverlay", { sessionId, ...params }), + applyStartupOverlay: async ( + params: ModelApplyStartupOverlayRequest + ): Promise => + connection.sendRequest("session.model.applyStartupOverlay", { + sessionId, + ...params, + }), }, /** @experimental */ mcp: { @@ -25980,7 +27007,9 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns MCP server startup filtering result. */ - reloadWithConfig: async (params: McpReloadWithConfigRequest): Promise => + reloadWithConfig: async ( + params: McpReloadWithConfigRequest + ): Promise => connection.sendRequest("session.mcp.reloadWithConfig", { sessionId, ...params }), /** * Configures the built-in GitHub MCP server for the session's current auth context. @@ -25989,22 +27018,34 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns Result of configuring GitHub MCP. */ - configureGitHub: async (params: McpConfigureGitHubRequest): Promise => + configureGitHub: async ( + params: McpConfigureGitHubRequest + ): Promise => connection.sendRequest("session.mcp.configureGitHub", { sessionId, ...params }), /** * Registers a pre-connected external MCP client (e.g. IDE) on the session's host. The caller retains lifecycle ownership of the client and transport. Marked internal because the `client` and `transport` arguments are in-process MCP SDK instances that cannot be serialized across the JSON-RPC boundary; once the CLI moves on top of the SDK, external clients will be expressed as transport configs the runtime can construct itself. * * @param params Registration parameters for an external MCP client. */ - registerExternalClient: async (params: McpRegisterExternalClientRequest): Promise => - connection.sendRequest("session.mcp.registerExternalClient", { sessionId, ...params }), + registerExternalClient: async ( + params: McpRegisterExternalClientRequest + ): Promise => + connection.sendRequest("session.mcp.registerExternalClient", { + sessionId, + ...params, + }), /** * Unregisters a previously registered external MCP client by server name. Marked internal as the paired companion of `registerExternalClient`: only in-process callers that registered a client this way can meaningfully unregister it. Disappears alongside `registerExternalClient`: once external clients are described to the runtime as config rather than handed in as instances, lifecycle (including deregistration) is owned entirely by the runtime. * * @param params Server name identifying the external client to remove. */ - unregisterExternalClient: async (params: McpUnregisterExternalClientRequest): Promise => - connection.sendRequest("session.mcp.unregisterExternalClient", { sessionId, ...params }), + unregisterExternalClient: async ( + params: McpUnregisterExternalClientRequest + ): Promise => + connection.sendRequest("session.mcp.unregisterExternalClient", { + sessionId, + ...params, + }), }, /** @experimental */ commands: { @@ -26015,8 +27056,13 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns Whether finalizing the invocation effect succeeded, and the failure reason when it did not. */ - finalizeInvocationEffect: async (params: CommandsFinalizeInvocationEffectRequest): Promise => - connection.sendRequest("session.commands.finalizeInvocationEffect", { sessionId, ...params }), + finalizeInvocationEffect: async ( + params: CommandsFinalizeInvocationEffectRequest + ): Promise => + connection.sendRequest("session.commands.finalizeInvocationEffect", { + sessionId, + ...params, + }), }, /** @experimental */ settings: { @@ -26034,8 +27080,13 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns Result of evaluating a Rust-owned settings predicate. */ - evaluatePredicate: async (params: SessionSettingsEvaluatePredicateRequest): Promise => - connection.sendRequest("session.settings.evaluatePredicate", { sessionId, ...params }), + evaluatePredicate: async ( + params: SessionSettingsEvaluatePredicateRequest + ): Promise => + connection.sendRequest("session.settings.evaluatePredicate", { + sessionId, + ...params, + }), }, /** @experimental */ queue: { @@ -26060,8 +27111,13 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns Whether a deferred-idle drain should run. */ - beginDeferredIdleDrain: async (params: QueueBeginDeferredIdleDrainRequest): Promise => - connection.sendRequest("session.queue.beginDeferredIdleDrain", { sessionId, ...params }), + beginDeferredIdleDrain: async ( + params: QueueBeginDeferredIdleDrainRequest + ): Promise => + connection.sendRequest("session.queue.beginDeferredIdleDrain", { + sessionId, + ...params, + }), /** * Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle. * @@ -26069,8 +27125,13 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns Action selected by the native deferred-idle drain. */ - finishDeferredIdleDrain: async (params: QueueFinishDeferredIdleDrainRequest): Promise => - connection.sendRequest("session.queue.finishDeferredIdleDrain", { sessionId, ...params }), + finishDeferredIdleDrain: async ( + params: QueueFinishDeferredIdleDrainRequest + ): Promise => + connection.sendRequest("session.queue.finishDeferredIdleDrain", { + sessionId, + ...params, + }), /** * Marks session.idle as deferred by native background work state. * @@ -26085,8 +27146,13 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns Indicates whether a user-facing pending item was removed. */ - consumeSystemNotifications: async (params: QueueConsumeSystemNotificationsRequest): Promise => - connection.sendRequest("session.queue.consumeSystemNotifications", { sessionId, ...params }), + consumeSystemNotifications: async ( + params: QueueConsumeSystemNotificationsRequest + ): Promise => + connection.sendRequest("session.queue.consumeSystemNotifications", { + sessionId, + ...params, + }), /** * Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn. * @@ -26157,7 +27223,9 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI * * @returns Result of registering or re-arming a scheduled prompt. */ - rearmSelfPaced: async (params: ScheduleRearmSelfPacedRequest): Promise => + rearmSelfPaced: async ( + params: ScheduleRearmSelfPacedRequest + ): Promise => connection.sendRequest("session.schedule.rearmSelfPaced", { sessionId, ...params }), }, }; @@ -26197,6 +27265,19 @@ export interface FactoryHandler { abort(params: FactoryAbortRequest): Promise; } +/** Handler for `tasks` client session API methods. */ +/** @experimental */ +export interface TasksHandler { + /** + * Asks the client currently bound to a client-owned session task to confirm that its external work stopped. + * + * @param params Runtime-to-owner cancellation request for a client-owned task. + * + * @returns Whether the client authoritatively confirmed its external work stopped. + */ + cancel(params: ClientTaskCancelRequest): Promise; +} + /** Handler for `sessionFs` client session API methods. */ /** @experimental */ export interface SessionFsHandler { @@ -26263,7 +27344,9 @@ export interface SessionFsHandler { * * @returns Entries in the requested directory paired with file/directory type information, or a filesystem error if the read failed. */ - readdirWithTypes(params: SessionFsReaddirWithTypesRequest): Promise; + readdirWithTypes( + params: SessionFsReaddirWithTypesRequest + ): Promise; /** * Removes a file or directory from the client-provided session filesystem. * @@ -26295,7 +27378,9 @@ export interface SessionFsHandler { * * @returns Per-statement results, or a classified transaction error. */ - sqliteTransaction(params: SessionFsSqliteTransactionRequest): Promise; + sqliteTransaction( + params: SessionFsSqliteTransactionRequest + ): Promise; /** * Checks whether the per-session SQLite database already exists, without creating it. * @@ -26337,6 +27422,7 @@ export interface CanvasHandler { export interface ClientSessionApiHandlers { providerToken?: ProviderTokenHandler; factory?: FactoryHandler; + tasks?: TasksHandler; sessionFs?: SessionFsHandler; canvas?: CanvasHandler; } @@ -26349,103 +27435,137 @@ export interface ClientSessionApiHandlers { */ export function registerClientSessionApiHandlers( connection: MessageConnection, - getHandlers: (sessionId: string) => ClientSessionApiHandlers, + getHandlers: (sessionId: string) => ClientSessionApiHandlers ): void { connection.onRequest("providerToken.getToken", async (params: ProviderTokenAcquireRequest) => { const handler = getHandlers(params.sessionId).providerToken; - if (!handler) throw new Error(`No providerToken handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No providerToken handler registered for session: ${params.sessionId}`); return handler.getToken(params); }); connection.onRequest("factory.execute", async (params: FactoryExecuteRequest) => { const handler = getHandlers(params.sessionId).factory; - if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No factory handler registered for session: ${params.sessionId}`); return handler.execute(params); }); connection.onRequest("factory.abort", async (params: FactoryAbortRequest) => { const handler = getHandlers(params.sessionId).factory; - if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No factory handler registered for session: ${params.sessionId}`); return handler.abort(params); }); + connection.onRequest("tasks.cancel", async (params: ClientTaskCancelRequest) => { + const handler = getHandlers(params.sessionId).tasks; + if (!handler) + throw new Error(`No tasks handler registered for session: ${params.sessionId}`); + return handler.cancel(params); + }); connection.onRequest("sessionFs.readFile", async (params: SessionFsReadFileRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.readFile(params); }); connection.onRequest("sessionFs.writeFile", async (params: SessionFsWriteFileRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.writeFile(params); }); connection.onRequest("sessionFs.appendFile", async (params: SessionFsAppendFileRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.appendFile(params); }); connection.onRequest("sessionFs.exists", async (params: SessionFsExistsRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.exists(params); }); connection.onRequest("sessionFs.stat", async (params: SessionFsStatRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.stat(params); }); connection.onRequest("sessionFs.mkdir", async (params: SessionFsMkdirRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.mkdir(params); }); connection.onRequest("sessionFs.readdir", async (params: SessionFsReaddirRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.readdir(params); }); - connection.onRequest("sessionFs.readdirWithTypes", async (params: SessionFsReaddirWithTypesRequest) => { - const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); - return handler.readdirWithTypes(params); - }); + connection.onRequest( + "sessionFs.readdirWithTypes", + async (params: SessionFsReaddirWithTypesRequest) => { + const handler = getHandlers(params.sessionId).sessionFs; + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + return handler.readdirWithTypes(params); + } + ); connection.onRequest("sessionFs.rm", async (params: SessionFsRmRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.rm(params); }); connection.onRequest("sessionFs.rename", async (params: SessionFsRenameRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.rename(params); }); connection.onRequest("sessionFs.sqliteQuery", async (params: SessionFsSqliteQueryRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.sqliteQuery(params); }); - connection.onRequest("sessionFs.sqliteTransaction", async (params: SessionFsSqliteTransactionRequest) => { - const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); - return handler.sqliteTransaction(params); - }); + connection.onRequest( + "sessionFs.sqliteTransaction", + async (params: SessionFsSqliteTransactionRequest) => { + const handler = getHandlers(params.sessionId).sessionFs; + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + return handler.sqliteTransaction(params); + } + ); connection.onRequest("sessionFs.sqliteExists", async (params: SessionFsSqliteExistsRequest) => { const handler = getHandlers(params.sessionId).sessionFs; - if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); return handler.sqliteExists(params); }); connection.onRequest("canvas.open", async (params: CanvasProviderOpenRequest) => { const handler = getHandlers(params.sessionId).canvas; - if (!handler) throw new Error(`No canvas handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No canvas handler registered for session: ${params.sessionId}`); return handler.open(params); }); connection.onRequest("canvas.close", async (params: CanvasProviderCloseRequest) => { const handler = getHandlers(params.sessionId).canvas; - if (!handler) throw new Error(`No canvas handler registered for session: ${params.sessionId}`); + if (!handler) + throw new Error(`No canvas handler registered for session: ${params.sessionId}`); return handler.close(params); }); - connection.onRequest("canvas.action.invoke", async (params: CanvasProviderInvokeActionRequest) => { - const handler = getHandlers(params.sessionId).canvas; - if (!handler) throw new Error(`No canvas handler registered for session: ${params.sessionId}`); - return handler.invoke(params); - }); + connection.onRequest( + "canvas.action.invoke", + async (params: CanvasProviderInvokeActionRequest) => { + const handler = getHandlers(params.sessionId).canvas; + if (!handler) + throw new Error(`No canvas handler registered for session: ${params.sessionId}`); + return handler.invoke(params); + } + ); } /** Handler for `extensionLaunchProvider` client global API methods. */ @@ -26458,7 +27578,9 @@ export interface ExtensionLaunchProviderHandler { * * @returns The launch profile for a supported entrypoint. Omit launch when the provider does not support the entrypoint. */ - resolve(params: ExtensionLaunchProviderResolveRequest): Promise; + resolve( + params: ExtensionLaunchProviderResolveRequest + ): Promise; } /** Handler for `llmInference` client global API methods. */ @@ -26471,7 +27593,9 @@ export interface LlmInferenceHandler { * * @returns Acknowledgement. Returning successfully simply means the SDK accepted the start frame; it does not imply the request will succeed. */ - httpRequestStart(params: LlmInferenceHttpRequestStartRequest): Promise; + httpRequestStart( + params: LlmInferenceHttpRequestStartRequest + ): Promise; /** * 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. * @@ -26479,7 +27603,9 @@ export interface LlmInferenceHandler { * * @returns Acknowledgement. The SDK is free to ignore the ack and treat chunk delivery as fire-and-forget. */ - httpRequestChunk(params: LlmInferenceHttpRequestChunkRequest): Promise; + httpRequestChunk( + params: LlmInferenceHttpRequestChunkRequest + ): Promise; } /** Handler for `gitHubTelemetry` client global API methods. */ @@ -26523,28 +27649,41 @@ export interface ClientGlobalApiHandlers { */ export function registerClientGlobalApiHandlers( connection: MessageConnection, - handlers: ClientGlobalApiHandlers, + handlers: ClientGlobalApiHandlers ): void { - connection.onRequest("extensionLaunchProvider.resolve", async (params: ExtensionLaunchProviderResolveRequest) => { - const handler = handlers.extensionLaunchProvider; - if (!handler) throw new Error("No extensionLaunchProvider client-global handler registered"); - return handler.resolve(params); - }); - connection.onRequest("llmInference.httpRequestStart", async (params: LlmInferenceHttpRequestStartRequest) => { - const handler = handlers.llmInference; - if (!handler) throw new Error("No llmInference client-global handler registered"); - return handler.httpRequestStart(params); - }); - connection.onRequest("llmInference.httpRequestChunk", async (params: LlmInferenceHttpRequestChunkRequest) => { - const handler = handlers.llmInference; - if (!handler) throw new Error("No llmInference client-global handler registered"); - return handler.httpRequestChunk(params); - }); - connection.onNotification("gitHubTelemetry.event", async (params: GitHubTelemetryNotification) => { - const handler = handlers.gitHubTelemetry; - if (!handler) return; - await handler.event(params); - }); + connection.onRequest( + "extensionLaunchProvider.resolve", + async (params: ExtensionLaunchProviderResolveRequest) => { + const handler = handlers.extensionLaunchProvider; + if (!handler) + throw new Error("No extensionLaunchProvider client-global handler registered"); + return handler.resolve(params); + } + ); + connection.onRequest( + "llmInference.httpRequestStart", + async (params: LlmInferenceHttpRequestStartRequest) => { + const handler = handlers.llmInference; + if (!handler) throw new Error("No llmInference client-global handler registered"); + return handler.httpRequestStart(params); + } + ); + connection.onRequest( + "llmInference.httpRequestChunk", + async (params: LlmInferenceHttpRequestChunkRequest) => { + const handler = handlers.llmInference; + if (!handler) throw new Error("No llmInference client-global handler registered"); + return handler.httpRequestChunk(params); + } + ); + connection.onNotification( + "gitHubTelemetry.event", + async (params: GitHubTelemetryNotification) => { + const handler = handlers.gitHubTelemetry; + if (!handler) return; + await handler.event(params); + } + ); connection.onRequest("gitHubToken.getToken", async (params: GitHubTokenAcquireRequest) => { const handler = handlers.gitHubToken; if (!handler) throw new Error("No gitHubToken client-global handler registered"); diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 7d734bf491..4204542ea0 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -4,514 +4,535 @@ */ /** A value that can be represented losslessly on the SDK JSON wire. */ -export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue }; +export type JsonValue = + | null + | boolean + | number + | string + | JsonValue[] + | { [key: string]: JsonValue }; /** * Union of all session event variants emitted by the Copilot CLI runtime. */ export type SessionEvent = - | StartEvent - | ResumeEvent - | RemoteSteerableChangedEvent - | ErrorEvent - | IdleEvent - | TitleChangedEvent - | ScheduleCreatedEvent - | ScheduleCancelledEvent - | ScheduleRearmedEvent - | AutopilotObjectiveChangedEvent - | InfoEvent - | WarningEvent - | ModelChangeEvent - | ModeChangedEvent - | ModeNoticeDeliveredEvent - | SessionLimitsChangedEvent - | PermissionsChangedEvent - | PlanChangedEvent - | TodosChangedEvent - | WorkspaceFileChangedEvent - | HandoffEvent - | TruncationEvent - | SnapshotRewindEvent - | ShutdownEvent - | UsageCheckpointEvent - | ContextChangedEvent - | UsageInfoEvent - | ContextClearedEvent - | CompactionStartEvent - | CompactionCompleteEvent - | TaskCompleteEvent - | CompletionReceiptEvent - | FusionRouteStartedEvent - | FusionRouteFailedEvent - | FusionResolvedEvent - | FusionCompletedEvent - | UserMessageEvent - | PendingMessagesModifiedEvent - | AssistantTurnStartEvent - | AssistantIntentEvent - | AssistantFusionPhaseStartedEvent - | AssistantFusionPhaseActivityEvent - | AssistantFusionPhaseCompletedEvent - | AssistantFusionPhaseFailedEvent - | AssistantServerToolProgressEvent - | AssistantReasoningEvent - | AssistantReasoningDeltaEvent - | AssistantToolCallDeltaEvent - | AssistantStreamingDeltaEvent - | AssistantMessageEvent - | AssistantMessageStartEvent - | AssistantMessageDeltaEvent - | AssistantTurnEndEvent - | AssistantIdleEvent - | AssistantUsageEvent - | ModelCallFailureEvent - | ModelCallFinishedEvent - | AbortEvent - | ToolUserRequestedEvent - | ToolExecutionStartEvent - | ToolExecutionPartialResultEvent - | ToolExecutionProgressEvent - | ToolExecutionCompleteEvent - | ToolSearchActivatedEvent - | SkillInvokedEvent - | SubagentStartedEvent - | SubagentConfiguredEvent - | SubagentCompletedEvent - | SubagentFailedEvent - | SubagentSelectedEvent - | SubagentDeselectedEvent - | HookStartEvent - | HookEndEvent - | HookProgressEvent - | BinaryAssetEvent - | SystemMessageEvent - | SystemNotificationEvent - | PermissionRequestedEvent - | PermissionCompletedEvent - | UserInputRequestedEvent - | UserInputCompletedEvent - | ElicitationRequestedEvent - | ElicitationCompletedEvent - | SamplingRequestedEvent - | SamplingCompletedEvent - | McpOauthRequiredEvent - | McpOauthCompletedEvent - | McpHeadersRefreshRequiredEvent - | McpHeadersRefreshCompletedEvent - | CustomNotificationEvent - | UIEphemeralQueryEvent - | ExternalToolRequestedEvent - | ExternalToolCompletedEvent - | CommandQueuedEvent - | CommandExecuteEvent - | CommandCompletedEvent - | AutoModeSwitchRequestedEvent - | AutoModeSwitchCompletedEvent - | SessionLimitsExhaustedRequestedEvent - | SessionLimitsExhaustedCompletedEvent - | AutoModeResolvedEvent - | ManagedSettingsResolvedEvent - | ManagedSettingsEnforcedEvent - | CommandsChangedEvent - | CapabilitiesChangedEvent - | ExitPlanModeRequestedEvent - | ExitPlanModeCompletedEvent - | ToolsUpdatedEvent - | BackgroundTasksChangedEvent - | FactoryRunUpdatedEvent - | FactoryRunStartedEvent - | FactoryRunSettledEvent - | SkillsLoadedEvent - | CustomAgentsUpdatedEvent - | McpServersLoadedEvent - | McpServerStatusChangedEvent - | McpToolsListChangedEvent - | McpResourcesListChangedEvent - | McpPromptsListChangedEvent - | ExtensionsLoadedEvent - | CanvasOpenedEvent - | CanvasRegistryChangedEvent - | CanvasClosedEvent - | CanvasUnavailableEvent - | CanvasRecordedEvent - | CanvasRemovedEvent - | ExtensionsAttachmentsPushedEvent - | McpAppToolCallCompleteEvent; + | StartEvent + | ResumeEvent + | RemoteSteerableChangedEvent + | ErrorEvent + | IdleEvent + | TitleChangedEvent + | ScheduleCreatedEvent + | ScheduleCancelledEvent + | ScheduleRearmedEvent + | AutopilotObjectiveChangedEvent + | InfoEvent + | WarningEvent + | ModelChangeEvent + | AutoTierSwitchFailedEvent + | ModeChangedEvent + | ModeNoticeDeliveredEvent + | SessionLimitsChangedEvent + | PermissionsChangedEvent + | PlanChangedEvent + | TodosChangedEvent + | WorkspaceFileChangedEvent + | HandoffEvent + | TruncationEvent + | SnapshotRewindEvent + | ShutdownEvent + | UsageCheckpointEvent + | ContextChangedEvent + | UsageInfoEvent + | ContextClearedEvent + | CompactionStartEvent + | CompactionCompleteEvent + | TaskCompleteEvent + | CompletionReceiptEvent + | FusionRouteStartedEvent + | FusionRouteFailedEvent + | FusionResolvedEvent + | FusionCompletedEvent + | UserMessageEvent + | PendingMessagesModifiedEvent + | AssistantTurnStartEvent + | AssistantIntentEvent + | AssistantFusionPhaseStartedEvent + | AssistantFusionPhaseActivityEvent + | AssistantFusionPhaseCompletedEvent + | AssistantFusionPhaseFailedEvent + | AssistantServerToolProgressEvent + | AssistantReasoningEvent + | AssistantReasoningDeltaEvent + | AssistantToolCallDeltaEvent + | AssistantStreamingDeltaEvent + | AssistantMessageEvent + | AssistantMessageStartEvent + | AssistantMessageDeltaEvent + | AssistantTurnEndEvent + | AssistantIdleEvent + | AssistantUsageEvent + | ModelCallFailureEvent + | ModelCallFinishedEvent + | AbortEvent + | ToolUserRequestedEvent + | ToolExecutionStartEvent + | ToolExecutionPartialResultEvent + | ToolExecutionProgressEvent + | ToolExecutionCompleteEvent + | ToolSearchActivatedEvent + | SkillInvokedEvent + | SubagentStartedEvent + | SubagentConfiguredEvent + | SubagentCompletedEvent + | SubagentFailedEvent + | SubagentSelectedEvent + | SubagentDeselectedEvent + | HookStartEvent + | HookEndEvent + | HookProgressEvent + | BinaryAssetEvent + | SystemMessageEvent + | SystemNotificationEvent + | PermissionRequestedEvent + | PermissionCompletedEvent + | UserInputRequestedEvent + | UserInputCompletedEvent + | ElicitationRequestedEvent + | ElicitationCompletedEvent + | SamplingRequestedEvent + | SamplingCompletedEvent + | McpOauthRequiredEvent + | McpOauthCompletedEvent + | McpHeadersRefreshRequiredEvent + | McpHeadersRefreshCompletedEvent + | CustomNotificationEvent + | UIEphemeralQueryEvent + | ExternalToolRequestedEvent + | ExternalToolCompletedEvent + | CommandQueuedEvent + | CommandExecuteEvent + | CommandCompletedEvent + | AutoModeSwitchRequestedEvent + | AutoModeSwitchCompletedEvent + | SessionLimitsExhaustedRequestedEvent + | SessionLimitsExhaustedCompletedEvent + | AutoModeResolvedEvent + | ManagedSettingsResolvedEvent + | ManagedSettingsEnforcedEvent + | CommandsChangedEvent + | CapabilitiesChangedEvent + | ExitPlanModeRequestedEvent + | ExitPlanModeCompletedEvent + | ToolsUpdatedEvent + | BackgroundTasksChangedEvent + | FactoryRunUpdatedEvent + | FactoryRunStartedEvent + | FactoryRunSettledEvent + | SkillsLoadedEvent + | CustomAgentsUpdatedEvent + | McpServersLoadedEvent + | McpServerStatusChangedEvent + | McpServerRemovedEvent + | McpServerNeedsReconnectEvent + | McpToolsListChangedEvent + | McpResourcesListChangedEvent + | McpPromptsListChangedEvent + | ExtensionsLoadedEvent + | CanvasOpenedEvent + | CanvasRegistryChangedEvent + | CanvasClosedEvent + | CanvasUnavailableEvent + | CanvasRecordedEvent + | CanvasRemovedEvent + | ExtensionsAttachmentsPushedEvent + | McpAppToolCallCompleteEvent; /** * Routing preference used when the session model is `auto`. */ export type AutoTier = - /** Optimize for efficiency. */ - | "efficiency" - /** Balance efficiency and intelligence. */ - | "balance" - /** Optimize for intelligence. */ - | "intelligence"; + /** Optimize for efficiency. */ + | "efficiency" + /** Balance efficiency and intelligence. */ + | "balance" + /** Optimize for intelligence. */ + | "intelligence"; /** * Hosting platform type of the repository (github or ado) */ export type WorkingDirectoryContextHostType = - /** Repository is hosted on GitHub. */ - | "github" - /** Repository is hosted on Azure DevOps. */ - | "ado"; + /** Repository is hosted on GitHub. */ + | "github" + /** Repository is hosted on Azure DevOps. */ + | "ado"; /** * Allowed values for the `ContextTier` enumeration. */ export type ContextTier = - /** Default context tier with standard context window size. */ - | "default" - /** Extended context tier with a larger context window. */ - | "long_context"; + /** Default context tier with standard context window size. */ + | "default" + /** Extended context tier with a larger context window. */ + | "long_context"; /** * Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed") */ export type ReasoningSummary = - /** Do not request reasoning summaries from the model. */ - | "none" - /** Request a concise summary of the model's reasoning. */ - | "concise" - /** Request a detailed summary of the model's reasoning. */ - | "detailed"; + /** Do not request reasoning summaries from the model. */ + | "none" + /** Request a concise summary of the model's reasoning. */ + | "concise" + /** Request a detailed summary of the model's reasoning. */ + | "detailed"; /** * Output verbosity level used for supported model calls (e.g. "low", "medium", "high") */ export type Verbosity = - /** A terse response was requested. */ - | "low" - /** A medium amount of response detail was requested. */ - | "medium" - /** A more detailed response was requested. */ - | "high"; + /** A terse response was requested. */ + | "low" + /** A medium amount of response detail was requested. */ + | "medium" + /** A more detailed response was requested. */ + | "high"; /** * The session mode the agent is operating in */ export type SessionMode = - /** The agent is responding interactively to the user. */ - | "interactive" - /** The agent is preparing a plan before making changes. */ - | "plan" - /** The agent is working autonomously toward task completion. */ - | "autopilot"; + /** The agent is responding interactively to the user. */ + | "interactive" + /** The agent is preparing a plan before making changes. */ + | "plan" + /** The agent is working autonomously toward task completion. */ + | "autopilot"; /** * Who created the schedule: `user` (an explicit user action such as `/every` or `/after`) or `model` (the agent via the `manage_schedule` tool). Gates whether a scheduled skill that opted out of model invocation may fire: only user-created schedules may. */ export type ScheduleOrigin = - /** The schedule was created by an explicit user action, such as `/every` or `/after`. */ - | "user" - /** The schedule was created by the agent via the `manage_schedule` tool. */ - | "model"; + /** The schedule was created by an explicit user action, such as `/every` or `/after`. */ + | "user" + /** The schedule was created by the agent via the `manage_schedule` tool. */ + | "model"; /** * The type of operation performed on the autopilot objective state file */ export type AutopilotObjectiveChangedOperation = - /** Autopilot objective state file was created for a new objective. */ - | "create" - /** Autopilot objective state file was updated for an existing objective. */ - | "update" - /** Autopilot objective state file was deleted or cleared. */ - | "delete"; + /** Autopilot objective state file was created for a new objective. */ + | "create" + /** Autopilot objective state file was updated for an existing objective. */ + | "update" + /** Autopilot objective state file was deleted or cleared. */ + | "delete"; /** * Current autopilot objective status, if one exists */ export type AutopilotObjectiveChangedStatus = - /** Objective is active and can drive autopilot continuations. */ - | "active" - /** Objective is paused and will not drive autopilot continuations. */ - | "paused" - /** Legacy objective state indicating the previous continuation cap was reached. */ - | "cap_reached" - /** Objective was completed by the agent. */ - | "completed"; + /** Objective is active and can drive autopilot continuations. */ + | "active" + /** Objective is paused and will not drive autopilot continuations. */ + | "paused" + /** Legacy objective state indicating the previous continuation cap was reached. */ + | "cap_reached" + /** Objective was completed by the agent. */ + | "completed"; /** * Origin of an effective session model change. */ export type ModelChangeSource = - /** The user selected a model directly with `/model `. */ - | "model_command" - /** The user selected the model with `/settings`. */ - | "settings_command" - /** The user selected the model with the `/config` alias. */ - | "config_command" - /** The user selected the model in the model picker, including the picker opened by bare `/model`. */ - | "model_picker" - /** Organization-managed settings selected the model. */ - | "managed_settings" - /** Repository settings selected the model. */ - | "repo_settings" - /** Startup model resolution selected the model. */ - | "startup" - /** Selecting an agent selected its configured model. */ - | "agent" - /** Entering, leaving, or reconfiguring plan mode selected the model. */ - | "plan_mode" - /** The runtime selected the model automatically, such as rate-limit recovery or refusal fallback. */ - | "automatic" - /** An SDK or RPC caller selected the model. */ - | "sdk"; + /** The user selected a model directly with `/model `. */ + | "model_command" + /** The user selected the model with `/settings`. */ + | "settings_command" + /** The user selected the model with the `/config` alias. */ + | "config_command" + /** The user selected the model in the model picker, including the picker opened by bare `/model`. */ + | "model_picker" + /** Organization-managed settings selected the model. */ + | "managed_settings" + /** Repository settings selected the model. */ + | "repo_settings" + /** Startup model resolution selected the model. */ + | "startup" + /** Selecting an agent selected its configured model. */ + | "agent" + /** Entering, leaving, or reconfiguring plan mode selected the model. */ + | "plan_mode" + /** The runtime selected the model automatically, such as rate-limit recovery or refusal fallback. */ + | "automatic" + /** An SDK or RPC caller selected the model. */ + | "sdk"; +/** + * Terminal reason an Auto preference activation failed. + */ +export type AutoTierSwitchFailureReason = + /** The candidate model was rejected by model policy. */ + | "policy_rejected" + /** The Auto routing request failed or returned an unusable response. */ + | "request_failed" + /** The runtime could not prepare the Auto routing request. */ + | "setup_failed" + /** The provider does not support Auto routing. */ + | "unsupported"; /** * Permission mode for the session. */ /** @experimental */ export type PermissionMode = - /** Permission requests follow the normal approval flow. */ - | "manual" - /** Permission requests include an LLM safety recommendation; clients may automatically approve requests judged acceptable. */ - | "assisted" - /** Tool, path, and URL permission requests are automatically approved. */ - | "allow-all"; + /** Permission requests follow the normal approval flow. */ + | "manual" + /** Permission requests include an LLM safety recommendation; clients may automatically approve requests judged acceptable. */ + | "assisted" + /** Tool, path, and URL permission requests are automatically approved. */ + | "allow-all"; /** * The type of operation performed on the plan file */ export type PlanChangedOperation = - /** The plan file was created. */ - | "create" - /** The plan file was updated. */ - | "update" - /** The plan file was deleted. */ - | "delete"; + /** The plan file was created. */ + | "create" + /** The plan file was updated. */ + | "update" + /** The plan file was deleted. */ + | "delete"; /** * Whether the file was newly created or updated */ export type WorkspaceFileChangedOperation = - /** The workspace file was created. */ - | "create" - /** The workspace file was updated. */ - | "update"; + /** The workspace file was created. */ + | "create" + /** The workspace file was updated. */ + | "update"; /** * Origin type of the session being handed off */ export type HandoffSourceType = - /** The handoff originated from a remote session. */ - | "remote" - /** The handoff originated from a local session. */ - | "local"; + /** The handoff originated from a remote session. */ + | "remote" + /** The handoff originated from a local session. */ + | "local"; /** * Whether the session ended normally ("routine") or due to a crash/fatal error ("error") */ export type ShutdownType = - /** The session ended normally. */ - | "routine" - /** The session ended because of a crash or fatal error. */ - | "error"; + /** The session ended normally. */ + | "routine" + /** The session ended because of a crash or fatal error. */ + | "error"; /** * What initiated a conversation compaction */ export type CompactionTrigger = - /** Background compaction started automatically because context utilization crossed the background threshold. */ - | "threshold" - /** Compaction forced by a context-limit model response (e.g. HTTP 413) before retrying the request. */ - | "context_limit_retry" - /** User-requested compaction, e.g. the /compact command or the history.compact API. */ - | "manual" - /** Emergency compaction triggered by high process memory usage. */ - | "memory_pressure" - /** Compaction requested while switching to a model with a smaller context window. */ - | "model_switch"; + /** Background compaction started automatically because context utilization crossed the background threshold. */ + | "threshold" + /** Compaction forced by a context-limit model response (e.g. HTTP 413) before retrying the request. */ + | "context_limit_retry" + /** User-requested compaction, e.g. the /compact command or the history.compact API. */ + | "manual" + /** Emergency compaction triggered by high process memory usage. */ + | "memory_pressure" + /** Compaction requested while switching to a model with a smaller context window. */ + | "model_switch"; /** * Semantic result of evaluating a task completion request */ export type TaskCompletionOutcome = - /** The completion request was accepted and the objective is complete. */ - | "completed" - /** The completion request was rejected because more work or validation remains. */ - | "continue" - /** Completion cannot proceed without intervention; the active objective is paused when one is identified. */ - | "blocked"; + /** The completion request was accepted and the objective is complete. */ + | "completed" + /** The completion request was rejected because more work or validation remains. */ + | "continue" + /** Completion cannot proceed without intervention; the active objective is paused when one is identified. */ + | "blocked"; /** * Structured terminal status from a tool completion event. */ export type CompletionReceiptToolStatus = - /** The tool completed successfully. */ - | "success" - /** The tool failed without a more specific structured status. */ - | "failure" - /** The tool exceeded its time budget. */ - | "timeout" - /** The user rejected the tool call. */ - | "rejected" - /** The permissions service denied the tool call. */ - | "denied"; + /** The tool completed successfully. */ + | "success" + /** The tool failed without a more specific structured status. */ + | "failure" + /** The tool exceeded its time budget. */ + | "timeout" + /** The user rejected the tool call. */ + | "rejected" + /** The permissions service denied the tool call. */ + | "denied"; /** * Runtime reason the completion decision was accepted. */ export type CompletionReceiptStopReason = - /** The model reached a natural terminal response. */ - | "natural" - /** A terminal tool ended the interaction. */ - | "terminal_tool" - /** The configured agentStop continuation limit was reached. */ - | "agent_stop_block_limit"; + /** The model reached a natural terminal response. */ + | "natural" + /** A terminal tool ended the interaction. */ + | "terminal_tool" + /** The configured agentStop continuation limit was reached. */ + | "agent_stop_block_limit"; /** * Kind of turn for which HydraFusion routing is running. */ /** @experimental */ export type FusionTurnKind = - /** A user-message turn. */ - | "user" - /** A conversation-compaction turn. */ - | "compaction"; + /** A user-message turn. */ + | "user" + /** A conversation-compaction turn. */ + | "compaction"; /** * Server-recommended routing behavior for a later HydraFusion turn. */ /** @experimental */ export type FusionFollowUpAction = - /** Reuse the durable primary model without routing. */ - | "reuse_primary" - /** Request a new routing decision. */ - | "reroute"; + /** Reuse the durable primary model without routing. */ + | "reuse_primary" + /** Request a new routing decision. */ + | "reroute"; /** * Validated HydraFusion execution pattern. */ /** @experimental */ export type FusionPattern = - /** Run one primary solver phase. */ - | "single" - /** Run a primary phase, a judge, and an optional repair. */ - | "cascade" - /** Run a primary draft, a read-only critique, and a revision. */ - | "critique"; + /** Run one primary solver phase. */ + | "single" + /** Run a primary phase, a judge, and an optional repair. */ + | "cascade" + /** Run a primary draft, a read-only critique, and a revision. */ + | "critique"; /** * HydraFusion phase kind. */ /** @experimental */ export type FusionPhaseKind = - /** Primary solver phase. */ - | "primary" - /** Read-only cascade judge phase. */ - | "judge" - /** Cascade repair phase. */ - | "repair" - /** Initial critique-pattern draft phase. */ - | "draft" - /** Read-only critique phase. */ - | "critic" - /** Critique-pattern revision phase. */ - | "revision" - /** Follow-up phase continuing from the resolved model. */ - | "follow_up"; + /** Primary solver phase. */ + | "primary" + /** Read-only cascade judge phase. */ + | "judge" + /** Cascade repair phase. */ + | "repair" + /** Initial critique-pattern draft phase. */ + | "draft" + /** Read-only critique phase. */ + | "critic" + /** Critique-pattern revision phase. */ + | "revision" + /** Follow-up phase continuing from the resolved model. */ + | "follow_up"; /** * Conversation scope in which a HydraFusion phase executes. */ /** @experimental */ export type FusionConversationScope = - /** Canonical root conversation history. */ - | "root" - /** Isolated read-only review history that does not enter the root conversation. */ - | "review"; + /** Canonical root conversation history. */ + | "root" + /** Isolated read-only review history that does not enter the root conversation. */ + | "review"; /** * The agent mode that was active when this message was sent */ export type UserMessageAgentMode = - /** The agent is responding interactively to the user. */ - | "interactive" - /** The agent is preparing a plan before making changes. */ - | "plan" - /** The agent is working autonomously toward task completion. */ - | "autopilot" - /** The agent is in shell-focused UI mode. */ - | "shell"; + /** The agent is responding interactively to the user. */ + | "interactive" + /** The agent is preparing a plan before making changes. */ + | "plan" + /** The agent is working autonomously toward task completion. */ + | "autopilot" + /** The agent is in shell-focused UI mode. */ + | "shell"; /** * A user message attachment — a file, directory, code selection, blob, GitHub reference, GitHub-anchored pointer, or extension-supplied context payload */ export type Attachment = - | AttachmentFile - | AttachmentDirectory - | AttachmentSelection - | AttachmentGitHubReference - | AttachmentGitHubCommit - | AttachmentGitHubRelease - | AttachmentGitHubActionsJob - | AttachmentGitHubRepository - | AttachmentGitHubFileDiff - | AttachmentGitHubTreeComparison - | AttachmentGitHubUrl - | AttachmentGitHubFile - | AttachmentGitHubSnippet - | AttachmentBlob - | AttachmentExtensionContext; + | AttachmentFile + | AttachmentDirectory + | AttachmentSelection + | AttachmentGitHubReference + | AttachmentGitHubCommit + | AttachmentGitHubRelease + | AttachmentGitHubActionsJob + | AttachmentGitHubRepository + | AttachmentGitHubFileDiff + | AttachmentGitHubTreeComparison + | AttachmentGitHubUrl + | AttachmentGitHubFile + | AttachmentGitHubSnippet + | AttachmentBlob + | AttachmentExtensionContext; /** * Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable */ export type OmittedBinaryOmittedReason = - /** Bytes exceeded the session's inline size limit. */ - | "too_large" - /** The referenced binary asset could not be found (e.g. a truncated log). */ - | "asset_unavailable"; + /** Bytes exceeded the session's inline size limit. */ + | "too_large" + /** The referenced binary asset could not be found (e.g. a truncated log). */ + | "asset_unavailable"; /** * Type of GitHub reference */ export type AttachmentGitHubReferenceType = - /** GitHub issue reference. */ - | "issue" - /** GitHub pull request reference. */ - | "pr" - /** GitHub discussion reference. */ - | "discussion"; + /** GitHub issue reference. */ + | "issue" + /** GitHub pull request reference. */ + | "pr" + /** GitHub discussion reference. */ + | "discussion"; /** * How this user message was delivered to the agentic loop, relative to whether the loop was already running. This is the timing axis only; the message's origin (human vs. system/command/schedule/skill/etc.) is carried separately by `source`. A system-injected message has a delivery too — e.g. a background-task notification waking an idle agent is `idle`, the same mechanism as a human starting a fresh turn. */ export type UserMessageDelivery = - /** Delivered while the loop was idle; starts its own run immediately (a human's fresh turn, or a system notification waking an idle agent). */ - | "idle" - /** Injected into the current in-flight run while the agent was busy (immediate mode). */ - | "steering" - /** Enqueued while the agent was busy; processed as its own run afterward. */ - | "queued"; + /** Delivered while the loop was idle; starts its own run immediately (a human's fresh turn, or a system notification waking an idle agent). */ + | "idle" + /** Injected into the current in-flight run while the agent was busy (immediate mode). */ + | "steering" + /** Enqueued while the agent was busy; processed as its own run afterward. */ + | "queued"; /** * Content-safe activity observed while a HydraFusion phase is running. */ /** @experimental */ export type FusionPhaseActivityKind = - /** The provider produced additional private output bytes. */ - | "model_output" - /** A tool began executing inside the phase. */ - | "tool_started" - /** A tool finished executing inside the phase. */ - | "tool_completed"; + /** The provider produced additional private output bytes. */ + | "model_output" + /** A tool began executing inside the phase. */ + | "tool_started" + /** A tool finished executing inside the phase. */ + | "tool_completed"; /** * How a durable phase checkpoint contributes its exact message to canonical root history. */ /** @experimental */ /** @internal */ export type FusionProjectionMode = - /** Append the exact root message immediately. */ - | "append" - /** Hold a terminal message outside canonical history until the final commit selects it. */ - | "staged" - /** Do not project the checkpoint into root history. */ - | "none"; + /** Append the exact root message immediately. */ + | "append" + /** Hold a terminal message outside canonical history until the final commit selects it. */ + | "staged" + /** Do not project the checkpoint into root history. */ + | "none"; /** * Durable outcome status of a HydraFusion phase. */ /** @experimental */ export type FusionPhaseStatus = - /** The phase completed successfully. */ - | "succeeded" - /** The phase failed. */ - | "failed" - /** The phase was cancelled. */ - | "cancelled"; + /** The phase completed successfully. */ + | "succeeded" + /** The phase failed. */ + | "failed" + /** The phase was cancelled. */ + | "cancelled"; /** * Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent. */ export type AssistantMessageToolRequestType = - /** Standard function-style tool call. */ - | "function" - /** Custom grammar-based tool call. */ - | "custom"; + /** Standard function-style tool call. */ + | "function" + /** Custom grammar-based tool call. */ + | "custom"; /** * The system that produced a citation. */ /** @experimental */ export type CitationProvider = - /** Citation produced by an Anthropic (Claude) model response. */ - | "anthropic" - /** Citation produced by an OpenAI model response. */ - | "openai" - /** Citation synthesized client-side by the runtime from tool output. */ - | "client"; + /** Citation produced by an Anthropic (Claude) model response. */ + | "anthropic" + /** Citation produced by an OpenAI model response. */ + | "openai" + /** Citation synthesized client-side by the runtime from tool output. */ + | "client"; /** * Location within a cited source (character, page, or content-block range) that supports a span. */ @@ -525,361 +546,366 @@ export type AssistantMessageToolRequestCallerType = "program"; * API endpoint used for this model call, matching CAPI supported_endpoints vocabulary */ export type AssistantUsageApiEndpoint = - /** Chat Completions API endpoint. */ - | "/chat/completions" - /** Anthropic Messages API endpoint. */ - | "/v1/messages" - /** Responses API endpoint. */ - | "/responses" - /** WebSocket Responses API endpoint. */ - | "ws:/responses"; + /** Chat Completions API endpoint. */ + | "/chat/completions" + /** Anthropic Messages API endpoint. */ + | "/v1/messages" + /** Responses API endpoint. */ + | "/responses" + /** WebSocket Responses API endpoint. */ + | "ws:/responses"; /** * Transport used for a successful model call */ export type AssistantUsageTransport = - /** HTTP transport, including SSE streams. */ - | "http" - /** WebSocket transport. */ - | "websocket"; + /** HTTP transport, including SSE streams. */ + | "http" + /** WebSocket transport. */ + | "websocket"; /** * 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. */ export type ModelCallFailureBadRequestKind = - /** The 400 response carried no error body (transient gateway/proxy signature). */ - | "bodyless" - /** The 400 response carried a structured CAPI error envelope (deterministic validation failure). */ - | "structured_error"; + /** The 400 response carried no error body (transient gateway/proxy signature). */ + | "bodyless" + /** The 400 response carried a structured CAPI error envelope (deterministic validation failure). */ + | "structured_error"; /** * Boundary that produced a model call failure */ export type ModelCallFailureKind = - /** The provider returned an API error response. */ - | "api" - /** The request transport failed before a usable API response completed. */ - | "transport"; + /** The provider returned an API error response. */ + | "api" + /** The request transport failed before a usable API response completed. */ + | "transport"; /** * Where the failed model call originated */ export type ModelCallFailureSource = - /** Model call from the top-level agent. */ - | "top_level" - /** Model call from a sub-agent. */ - | "subagent" - /** Model call from MCP sampling. */ - | "mcp_sampling"; + /** Model call from the top-level agent. */ + | "top_level" + /** Model call from a sub-agent. */ + | "subagent" + /** Model call from MCP sampling. */ + | "mcp_sampling"; /** * Transport used for a failed model call */ export type ModelCallFailureTransport = - /** HTTP transport, including SSE streams. */ - | "http" - /** WebSocket transport. */ - | "websocket"; + /** HTTP transport, including SSE streams. */ + | "http" + /** WebSocket transport. */ + | "websocket"; /** * Final outcome of one logical model dispatch after response acceptance processing */ export type ModelCallFinishedOutcome = - /** The provider response was accepted for continued agent processing. */ - | "success" - /** The dispatch ended with a provider or transport error. */ - | "error" - /** The dispatch was cancelled before an accepted response was produced. */ - | "cancelled" - /** The provider response was rejected during post-response acceptance processing. */ - | "rejected"; + /** The provider response was accepted for continued agent processing. */ + | "success" + /** The dispatch ended with a provider or transport error. */ + | "error" + /** The dispatch was cancelled before an accepted response was produced. */ + | "cancelled" + /** The provider response was rejected during post-response acceptance processing. */ + | "rejected"; /** * Finite reason code describing why the current turn was aborted */ export type AbortReason = - /** The local user requested the abort, for example by pressing Ctrl+C in the CLI. */ - | "user_initiated" - /** A remote command requested the abort. */ - | "remote_command" - /** An MCP server delivered a user.abort notification. */ - | "user_abort" - /** Autopilot stopped the run because the active objective reached its user-set --max-ai-credits limit. */ - | "autopilot_credit_limit"; + /** The local user requested the abort, for example by pressing Ctrl+C in the CLI. */ + | "user_initiated" + /** A remote command requested the abort. */ + | "remote_command" + /** An MCP server delivered a user.abort notification. */ + | "user_abort" + /** Autopilot stopped the run because the active objective reached its user-set --max-ai-credits limit. */ + | "autopilot_credit_limit"; /** * Allowed values for the `ToolExecutionStartToolDescriptionMetaUIVisibility` enumeration. */ export type ToolExecutionStartToolDescriptionMetaUIVisibility = - /** Tool is callable by the model (LLM tool surface) */ - | "model" - /** Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool */ - | "app"; + /** Tool is callable by the model (LLM tool surface) */ + | "model" + /** Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool */ + | "app"; /** * A model-facing binary result as persisted: full inline data, a size-omitted marker, or a deduplicated asset reference */ /** @experimental */ -export type PersistedBinaryResult = PersistedBinaryImage | OmittedBinaryResult | BinaryAssetReference; +export type PersistedBinaryResult = + | PersistedBinaryImage + | OmittedBinaryResult + | BinaryAssetReference; /** * Binary result type discriminator. Use "image" for images and "resource" for other binary data. */ export type PersistedBinaryImageType = - /** Binary image data. */ - | "image" - /** Other binary resource data. */ - | "resource"; + /** Binary image data. */ + | "image" + /** Other binary resource data. */ + | "resource"; /** * Binary result type discriminator. Use "image" for images and "resource" for other binary data. */ export type OmittedBinaryType = - /** Binary image data. */ - | "image" - /** Other binary resource data. */ - | "resource"; + /** Binary image data. */ + | "image" + /** Other binary resource data. */ + | "resource"; /** * Binary result type discriminator. Use "image" for images and "resource" for other binary data. */ export type BinaryAssetReferenceType = - /** Binary image data. */ - | "image" - /** Other binary resource data. */ - | "resource"; + /** Binary image data. */ + | "image" + /** Other binary resource data. */ + | "resource"; /** * A content block within a tool result, which may be text, terminal output, image, audio, or a resource */ export type ToolExecutionCompleteContent = - | ToolExecutionCompleteContentText - | ToolExecutionCompleteContentTerminal - | ToolExecutionCompleteContentShellExit - | ToolExecutionCompleteContentImage - | ToolExecutionCompleteContentAudio - | ToolExecutionCompleteContentResourceLink - | ToolExecutionCompleteContentResource; + | ToolExecutionCompleteContentText + | ToolExecutionCompleteContentTerminal + | ToolExecutionCompleteContentShellExit + | ToolExecutionCompleteContentImage + | ToolExecutionCompleteContentAudio + | ToolExecutionCompleteContentResourceLink + | ToolExecutionCompleteContentResource; /** * Theme variant this icon is intended for */ export type ToolExecutionCompleteContentResourceLinkIconTheme = - /** Icon intended for light themes. */ - | "light" - /** Icon intended for dark themes. */ - | "dark"; + /** Icon intended for light themes. */ + | "light" + /** Icon intended for dark themes. */ + | "dark"; /** * The embedded resource contents, either text or base64-encoded binary */ -export type ToolExecutionCompleteContentResourceDetails = EmbeddedTextResourceContents | EmbeddedBlobResourceContents; +export type ToolExecutionCompleteContentResourceDetails = + | EmbeddedTextResourceContents + | EmbeddedBlobResourceContents; /** * Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration. */ export type ToolExecutionCompleteToolDescriptionMetaUIVisibility = - /** Tool is callable by the model (LLM tool surface) */ - | "model" - /** Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool */ - | "app"; + /** Tool is callable by the model (LLM tool surface) */ + | "model" + /** Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool */ + | "app"; /** * What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent) */ export type SkillInvokedTrigger = - /** Skill invocation requested explicitly by the user, such as via a slash command or UI affordance. */ - | "user-invoked" - /** Skill invocation requested by the agent. */ - | "agent-invoked" - /** Skill content loaded as part of another context, such as a configured custom agent or subagent. */ - | "context-load"; + /** Skill invocation requested explicitly by the user, such as via a slash command or UI affordance. */ + | "user-invoked" + /** Skill invocation requested by the agent. */ + | "agent-invoked" + /** Skill content loaded as part of another context, such as a configured custom agent or subagent. */ + | "context-load"; /** * Binary asset type discriminator. Use "image" for images and "resource" otherwise. */ export type BinaryAssetType = - /** Binary image data. */ - | "image" - /** Other binary resource data. */ - | "resource"; + /** Binary image data. */ + | "image" + /** Other binary resource data. */ + | "resource"; /** * Message role: "system" for system prompts, "developer" for developer-injected instructions */ export type SystemMessageRole = - /** System prompt message. */ - | "system" - /** Developer instruction message. */ - | "developer"; + /** System prompt message. */ + | "system" + /** Developer instruction message. */ + | "developer"; /** * Structured metadata identifying what triggered this notification */ export type SystemNotification = - | SystemNotificationAgentCompleted - | SystemNotificationAgentIdle - | SystemNotificationNewInboxMessage - | SystemNotificationShellCompleted - | SystemNotificationShellDetachedCompleted - | SystemNotificationInstructionDiscovered - | SystemNotificationFactoryCompleted - | SystemNotificationUnclassified; + | SystemNotificationAgentCompleted + | SystemNotificationAgentIdle + | SystemNotificationNewInboxMessage + | SystemNotificationShellCompleted + | SystemNotificationShellDetachedCompleted + | SystemNotificationInstructionDiscovered + | SystemNotificationFactoryCompleted + | SystemNotificationUnclassified; /** * Whether the agent completed successfully or failed */ export type SystemNotificationAgentCompletedStatus = - /** The agent completed successfully. */ - | "completed" - /** The agent failed. */ - | "failed"; + /** The agent completed successfully. */ + | "completed" + /** The agent failed. */ + | "failed"; /** * Terminal status reached by a factory execution attempt. */ export type SystemNotificationFactoryCompletedStatus = - /** The factory completed successfully. */ - | "completed" - /** The factory was halted. */ - | "halted" - /** The factory was cancelled. */ - | "cancelled" - /** The factory failed. */ - | "error"; + /** The factory completed successfully. */ + | "completed" + /** The factory was halted. */ + | "halted" + /** The factory was cancelled. */ + | "cancelled" + /** The factory failed. */ + | "error"; /** * Details of the permission being requested */ export type PermissionRequest = - | PermissionRequestShell - | PermissionRequestWrite - | PermissionRequestRead - | PermissionRequestMcp - | PermissionRequestUrl - | PermissionRequestMemory - | PermissionRequestCustomTool - | PermissionRequestHook - | PermissionRequestExtensionManagement - | PermissionRequestFactory - | PermissionRequestExtensionPermissionAccess - | PermissionRequestExtensionEnvAccess; + | PermissionRequestShell + | PermissionRequestWrite + | PermissionRequestRead + | PermissionRequestMcp + | PermissionRequestUrl + | PermissionRequestMemory + | PermissionRequestCustomTool + | PermissionRequestHook + | PermissionRequestExtensionManagement + | PermissionRequestFactory + | PermissionRequestExtensionPermissionAccess + | PermissionRequestExtensionEnvAccess; /** * Advisory recommendation the runtime attaches to a permission request whose origin it can vouch for by construction. Unlike the auto-approval judge this does not depend on auto mode and does not evaluate what the tool call does; its absence simply means the runtime has no opinion and the request follows the host's normal approval flow. */ /** @experimental */ export type PermissionRecommendation = - /** The runtime vouches for the request's origin and recommends approving it without prompting. The host still owns the decision and may deny it; deny rules, managed policy, and the auto-approval safety judge all outrank this recommendation. */ - "approve"; + /** The runtime vouches for the request's origin and recommends approving it without prompting. The host still owns the decision and may deny it; deny rules, managed policy, and the auto-approval safety judge all outrank this recommendation. */ + "approve"; /** * Whether this is a store or vote memory operation */ export type PermissionRequestMemoryAction = - /** Store a new memory. */ - | "store" - /** Vote on an existing memory. */ - | "vote"; + /** Store a new memory. */ + | "store" + /** Vote on an existing memory. */ + | "vote"; /** * Why the assisted-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs. */ /** @experimental */ export type AssistedApprovalJudgeFailureReason = - /** The judge model call exceeded its deadline. */ - | "timeout" - /** The judge model call was cancelled before it returned. */ - | "abort" - /** The judge model call completed but returned no content. */ - | "empty_response" - /** The judge model call failed (for example a transport, authentication, or rate-limit error). */ - | "model_error" - /** The judge model replied, but the reply carried no ALLOW/DENY verdict. */ - | "parse_error"; + /** The judge model call exceeded its deadline. */ + | "timeout" + /** The judge model call was cancelled before it returned. */ + | "abort" + /** The judge model call completed but returned no content. */ + | "empty_response" + /** The judge model call failed (for example a transport, authentication, or rate-limit error). */ + | "model_error" + /** The judge model replied, but the reply carried no ALLOW/DENY verdict. */ + | "parse_error"; /** * Outcome of the assisted-approval safety judge for a permission request. Present only in assisted mode; its absence means the judge did not evaluate the request. */ /** @experimental */ export type AssistedApprovalRecommendation = - /** The judge evaluated the request and recommends automatically approving it. */ - | "approve" - /** The judge evaluated the request and does not recommend automatically approving it; explicit approval is required. Whether that means prompting, denying, or something else is the consumer's decision. */ - | "requireApproval" - /** Assisted mode is enabled, but this request category is never automatically approvable (for example, sandbox-bypass requests), so the judge was not consulted. */ - | "excluded" - /** The judge was consulted but did not return a usable recommendation, so the request requires explicit approval. */ - | "error"; + /** The judge evaluated the request and recommends automatically approving it. */ + | "approve" + /** The judge evaluated the request and does not recommend automatically approving it; explicit approval is required. Whether that means prompting, denying, or something else is the consumer's decision. */ + | "requireApproval" + /** Assisted mode is enabled, but this request category is never automatically approvable (for example, sandbox-bypass requests), so the judge was not consulted. */ + | "excluded" + /** The judge was consulted but did not return a usable recommendation, so the request requires explicit approval. */ + | "error"; /** * Vote direction (vote only) */ export type PermissionRequestMemoryDirection = - /** Vote that the memory is useful or accurate. */ - | "upvote" - /** Vote that the memory is incorrect or outdated. */ - | "downvote"; + /** Vote that the memory is useful or accurate. */ + | "upvote" + /** Vote that the memory is incorrect or outdated. */ + | "downvote"; /** * Scope of a stored memory. */ export type PermissionRequestMemoryScope = - /** Store the memory for the current repository. */ - | "repository" - /** Store the memory for the current user. */ - | "user"; + /** Store the memory for the current repository. */ + | "repository" + /** Store the memory for the current user. */ + | "user"; /** * Operation gated by a factory permission request. */ export type FactoryPermissionOperation = - /** Running a registered factory, which spends subagents, active time, and AI credits under the approved limits. */ - | "run" - /** Authoring a factory, which writes JavaScript into a session-scoped extension and loads it. */ - | "author"; + /** Running a registered factory, which spends subagents, active time, and AI credits under the approved limits. */ + | "run" + /** Authoring a factory, which writes JavaScript into a session-scoped extension and loads it. */ + | "author"; /** * Derived user-facing permission prompt details for UI consumers */ export type PermissionPromptRequest = - | PermissionPromptRequestCommands - | PermissionPromptRequestWrite - | PermissionPromptRequestRead - | PermissionPromptRequestMcp - | PermissionPromptRequestUrl - | PermissionPromptRequestMemory - | PermissionPromptRequestCustomTool - | PermissionPromptRequestPath - | PermissionPromptRequestHook - | PermissionPromptRequestExtensionManagement - | PermissionPromptRequestFactory - | PermissionPromptRequestExtensionPermissionAccess - | PermissionPromptRequestExtensionEnvAccess; + | PermissionPromptRequestCommands + | PermissionPromptRequestWrite + | PermissionPromptRequestRead + | PermissionPromptRequestMcp + | PermissionPromptRequestUrl + | PermissionPromptRequestMemory + | PermissionPromptRequestCustomTool + | PermissionPromptRequestPath + | PermissionPromptRequestHook + | PermissionPromptRequestExtensionManagement + | PermissionPromptRequestFactory + | PermissionPromptRequestExtensionPermissionAccess + | PermissionPromptRequestExtensionEnvAccess; /** * Underlying permission kind that needs path approval */ export type PermissionPromptRequestPathAccessKind = - /** Read access to a filesystem path. */ - | "read" - /** Shell command access involving a filesystem path. */ - | "shell" - /** Write access to a filesystem path. */ - | "write"; + /** Read access to a filesystem path. */ + | "read" + /** Shell command access involving a filesystem path. */ + | "shell" + /** Write access to a filesystem path. */ + | "write"; /** * The result of the permission request */ export type PermissionResult = - | PermissionApproved - | PermissionApprovedForSession - | PermissionApprovedForLocation - | PermissionCancelled - | PermissionDeniedByRules - | PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser - | PermissionDeniedInteractivelyByUser - | PermissionDeniedByContentExclusionPolicy - | PermissionDeniedByPermissionRequestHook; + | PermissionApproved + | PermissionApprovedForSession + | PermissionApprovedForLocation + | PermissionCancelled + | PermissionDeniedByRules + | PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser + | PermissionDeniedInteractivelyByUser + | PermissionDeniedByContentExclusionPolicy + | PermissionDeniedByPermissionRequestHook; /** * The approval to add as a session-scoped rule */ export type UserToolSessionApproval = - | UserToolSessionApprovalCommands - | UserToolSessionApprovalRead - | UserToolSessionApprovalWrite - | UserToolSessionApprovalMcp - | UserToolSessionApprovalMemory - | UserToolSessionApprovalCustomTool - | UserToolSessionApprovalExtensionManagement - | UserToolSessionApprovalFactory - | UserToolSessionApprovalExtensionPermissionAccess - | UserToolSessionApprovalExtensionEnvAccess; + | UserToolSessionApprovalCommands + | UserToolSessionApprovalRead + | UserToolSessionApprovalWrite + | UserToolSessionApprovalMcp + | UserToolSessionApprovalMemory + | UserToolSessionApprovalCustomTool + | UserToolSessionApprovalExtensionManagement + | UserToolSessionApprovalFactory + | UserToolSessionApprovalExtensionPermissionAccess + | UserToolSessionApprovalExtensionEnvAccess; /** * Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent. */ export type ElicitationRequestedMode = - /** Structured form-based elicitation. */ - | "form" - /** Browser URL-based elicitation. */ - | "url"; + /** Structured form-based elicitation. */ + | "form" + /** Browser URL-based elicitation. */ + | "url"; /** * The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed) */ export type ElicitationCompletedAction = - /** The user submitted the requested form. */ - | "accept" - /** The user explicitly declined the request. */ - | "decline" - /** The user dismissed the request. */ - | "cancel"; + /** The user submitted the requested form. */ + | "accept" + /** The user explicitly declined the request. */ + | "decline" + /** The user dismissed the request. */ + | "cancel"; /** * Opaque JSON value submitted for one field in accepted `elicitation.completed` form content. */ @@ -888,42 +914,42 @@ export type ElicitationCompletedContent = JsonValue | undefined; * Reason the runtime is requesting host-provided MCP OAuth credentials */ export type McpOauthRequestReason = - /** Initial credentials are required before connecting to the MCP server. */ - | "initial" - /** The current host-provided credential was rejected and a replacement is requested. */ - | "refresh" - /** The server requires a new host authorization flow before continuing. */ - | "reauth" - /** The server requires a credential with additional scope or audience. */ - | "upscope"; + /** Initial credentials are required before connecting to the MCP server. */ + | "initial" + /** The current host-provided credential was rejected and a replacement is requested. */ + | "refresh" + /** The server requires a new host authorization flow before continuing. */ + | "reauth" + /** The server requires a credential with additional scope or audience. */ + | "upscope"; /** * How the pending MCP OAuth request was completed */ export type McpOauthCompletionOutcome = - /** The request completed with a token-backed OAuth provider. */ - | "token" - /** The request completed without an OAuth provider. */ - | "cancelled"; + /** The request completed with a token-backed OAuth provider. */ + | "token" + /** The request completed without an OAuth provider. */ + | "cancelled"; /** * Why dynamic headers are being requested. */ export type McpHeadersRefreshRequiredReason = - /** The transport is making its first dynamic header request for this server. */ - | "startup" - /** The previously cached dynamic headers expired. */ - | "ttl-expired" - /** The server returned 401 and stale dynamic headers were invalidated. */ - | "auth-failed"; + /** The transport is making its first dynamic header request for this server. */ + | "startup" + /** The previously cached dynamic headers expired. */ + | "ttl-expired" + /** The server returned 401 and stale dynamic headers were invalidated. */ + | "auth-failed"; /** * How the pending MCP headers refresh request resolved. */ export type McpHeadersRefreshCompletedOutcome = - /** The host supplied dynamic headers. */ - | "headers" - /** The host responded with no dynamic headers. */ - | "none" - /** No response arrived within the bounded window. */ - | "timeout"; + /** The host supplied dynamic headers. */ + | "headers" + /** The host responded with no dynamic headers. */ + | "none" + /** No response arrived within the bounded window. */ + | "timeout"; /** * Source-defined JSON payload for the custom notification */ @@ -933,1223 +959,1269 @@ export type CustomNotificationPayload = JsonValue; */ /** @experimental */ export type UIEphemeralQueryPhase = - /** The ephemeral query stream has begun. */ - | "started" - /** A partial result chunk was produced by the stream. */ - | "chunk" - /** The ephemeral query stream finished successfully. */ - | "completed" - /** The ephemeral query stream ended with an error. */ - | "failed" - /** The ephemeral query stream was cancelled before completing. */ - | "aborted"; + /** The ephemeral query stream has begun. */ + | "started" + /** A partial result chunk was produced by the stream. */ + | "chunk" + /** The ephemeral query stream finished successfully. */ + | "completed" + /** The ephemeral query stream ended with an error. */ + | "failed" + /** The ephemeral query stream was cancelled before completing. */ + | "aborted"; /** * The user's auto-mode-switch choice */ export type AutoModeSwitchResponse = - /** Switch models for this request. */ - | "yes" - /** Switch models now and keep using the replacement automatically. */ - | "yes_always" - /** Do not switch models. */ - | "no"; + /** Switch models for this request. */ + | "yes" + /** Switch models now and keep using the replacement automatically. */ + | "yes_always" + /** Do not switch models. */ + | "no"; /** * User action selected for an exhausted session limit. */ export type SessionLimitsExhaustedResponseAction = - /** Increase the current max by an exact AI Credits amount. */ - | "add" - /** Set a new absolute max AI Credits value. */ - | "set" - /** Remove the current session limit. */ - | "unset" - /** Leave the limit unchanged and cancel the blocked model request. */ - | "cancel"; + /** Increase the current max by an exact AI Credits amount. */ + | "add" + /** Set a new absolute max AI Credits value. */ + | "set" + /** Remove the current session limit. */ + | "unset" + /** Leave the limit unchanged and cancel the blocked model request. */ + | "cancel"; /** * Coarse request-difficulty bucket for UX explainability */ export type AutoModeResolvedReasoningBucket = - /** The request looks low-reasoning; a lighter model is appropriate. */ - | "low" - /** The request needs a moderate amount of reasoning. */ - | "medium" - /** The request looks high-reasoning; a stronger model is appropriate. */ - | "high"; + /** The request looks low-reasoning; a lighter model is appropriate. */ + | "low" + /** The request needs a moderate amount of reasoning. */ + | "medium" + /** The request looks high-reasoning; a stronger model is appropriate. */ + | "high"; /** * Summary of which managed-settings channels contributed to the effective session policy. Use the per-channel booleans for exact provenance. */ export type ManagedSettingsResolvedSource = - /** Only the server/account channel contributed. */ - | "server" - /** Only the device MDM/plist/registry/file channel contributed. */ - | "device" - /** Only session-local SDK-host injection contributed. */ - | "client" - /** A policy helper registered by device or server policy contributed. Device registration takes priority when present. */ - | "policyHelper" - /** More than one channel contributed. Ordinary keys resolve device over server over policy helper per key, while permissions compose restrictively across all present layers. */ - | "mixed" - /** No managed policy is in force (no channel contributed). */ - | "none"; + /** Only the server/account channel contributed. */ + | "server" + /** Only the device MDM/plist/registry/file channel contributed. */ + | "device" + /** Only session-local SDK-host injection contributed. */ + | "client" + /** A policy helper registered by device or server policy contributed. Device registration takes priority when present. */ + | "policyHelper" + /** More than one channel contributed. Ordinary keys resolve device over server over policy helper per key, while permissions compose restrictively across all present layers. */ + | "mixed" + /** No managed policy is in force (no channel contributed). */ + | "none"; /** * The category of runtime action that enterprise managed settings governed (blocked or capped) */ export type ManagedSettingsEnforcedAction = - /** An attempt to turn on a bypass-permissions ("yolo") escalation was refused or capped because policy disables bypass-permissions mode. */ - "bypass_permissions_blocked"; + /** An attempt to turn on a bypass-permissions ("yolo") escalation was refused or capped because policy disables bypass-permissions mode. */ + "bypass_permissions_blocked"; /** * For a `bypass_permissions_blocked` action, which permission-escalation primitive was refused */ export type ManagedSettingsEnforcedEscalation = - /** Full allow-all permissions — automatically approving tools, paths, and URLs. */ - | "allow_all" - /** Automatic approval of all tool permission requests. */ - | "approve_all" - /** Assisted mode — keeps normal prompt paths and adds an LLM recommendation, distinct from allow-all. */ - | "assisted_approval" - /** Unrestricted filesystem access outside the session's allowed directories. */ - | "unrestricted_paths" - /** Unrestricted URL fetch access. */ - | "unrestricted_urls" - /** A server-wide MCP "Always Allow" (or `--allow-tool `) blanket that would auto-approve every tool from an MCP server. Capped to per-tool approval; each tool still prompts. */ - | "server_wide_mcp_approval"; + /** Full allow-all permissions — automatically approving tools, paths, and URLs. */ + | "allow_all" + /** Automatic approval of all tool permission requests. */ + | "approve_all" + /** Assisted mode — keeps normal prompt paths and adds an LLM recommendation, distinct from allow-all. */ + | "assisted_approval" + /** Unrestricted filesystem access outside the session's allowed directories. */ + | "unrestricted_paths" + /** Unrestricted URL fetch access. */ + | "unrestricted_urls" + /** A server-wide MCP "Always Allow" (or `--allow-tool `) blanket that would auto-approve every tool from an MCP server. Capped to per-tool approval; each tool still prompts. */ + | "server_wide_mcp_approval"; /** * Exit plan mode action */ export type ExitPlanModeAction = - /** Exit plan mode without starting implementation. */ - | "exit_only" - /** Exit plan mode and continue in interactive mode. */ - | "interactive" - /** Exit plan mode and continue autonomously. */ - | "autopilot" - /** Exit plan mode and continue with parallel autonomous workers. */ - | "autopilot_fleet"; + /** Exit plan mode without starting implementation. */ + | "exit_only" + /** Exit plan mode and continue in interactive mode. */ + | "interactive" + /** Exit plan mode and continue autonomously. */ + | "autopilot" + /** Exit plan mode and continue with parallel autonomous workers. */ + | "autopilot_fleet"; /** * Terminal status a factory run committed. A settled run is never `pending` or `running`, so those two members of the run-status domain are deliberately absent. */ export type FactoryRunSettledStatus = - /** The factory body resolved and its result was committed. */ - | "completed" - /** The run was stopped by a limit, an approval refusal or another policy decision. */ - | "halted" - /** The run was cancelled by its caller or by session disposal. */ - | "cancelled" - /** The run failed, with `failureType` carrying the class when it has one. */ - | "error"; + /** The factory body resolved and its result was committed. */ + | "completed" + /** The run was stopped by a limit, an approval refusal or another policy decision. */ + | "halted" + /** The run was cancelled by its caller or by session disposal. */ + | "cancelled" + /** The run failed, with `failureType` carrying the class when it has one. */ + | "error"; /** * Source location type (e.g., project, personal-copilot, plugin, builtin, sdk) */ export type SkillSource = - /** Skill defined in the current project's skill directories. */ - | "project" - /** Skill discovered from a parent directory in the current workspace tree. */ - | "inherited" - /** Skill defined in the user's Copilot skill directory. */ - | "personal-copilot" - /** Skill defined in the user's personal agents skill directory. */ - | "personal-agents" - /** Skill provided by an installed plugin. */ - | "plugin" - /** Skill loaded from a configured custom skill directory. */ - | "custom" - /** Skill bundled with the runtime. */ - | "builtin" - /** Pathless skill supplied lazily by an SDK skill provider. */ - | "sdk"; + /** Skill defined in the current project's skill directories. */ + | "project" + /** Skill discovered from a parent directory in the current workspace tree. */ + | "inherited" + /** Skill defined in the user's Copilot skill directory. */ + | "personal-copilot" + /** Skill defined in the user's personal agents skill directory. */ + | "personal-agents" + /** Skill provided by an installed plugin. */ + | "plugin" + /** Skill loaded from a configured custom skill directory. */ + | "custom" + /** Skill bundled with the runtime. */ + | "builtin" + /** Pathless skill supplied lazily by an SDK skill provider. */ + | "sdk"; /** * Whether configured models are advisory preferences or required constraints */ export type AgentModelPolicy = - /** Treat the authored models as advisory preferences that callers may override. */ - | "preferred" - /** Require subagent execution to use one of the authored models. */ - | "required"; + /** Treat the authored models as advisory preferences that callers may override. */ + | "preferred" + /** Require subagent execution to use one of the authored models. */ + | "required"; /** * Configuration source: user, workspace, plugin, or builtin */ export type McpServerSource = - /** Server configured in the user's global MCP configuration. */ - | "user" - /** Server configured by the current workspace. */ - | "workspace" - /** Server contributed by an installed plugin. */ - | "plugin" - /** Server bundled with the runtime. */ - | "builtin"; + /** Server configured in the user's global MCP configuration. */ + | "user" + /** Server configured by the current workspace. */ + | "workspace" + /** Server contributed by an installed plugin. */ + | "plugin" + /** Server bundled with the runtime. */ + | "builtin"; /** * Connection status: connected, failed, needs-auth, pending, disabled, stopped, or not_configured */ export type McpServerStatus = - /** The server is connected and available. */ - | "connected" - /** The server failed to connect or initialize. */ - | "failed" - /** The server requires authentication before it can connect. */ - | "needs-auth" - /** The server connection is still being established. */ - | "pending" - /** The server is configured but disabled. */ - | "disabled" - /** The server was intentionally stopped and can be restarted on demand when policy permits; a server quarantined by restrictive managed policy stays stopped and cannot be restarted until the policy allows it. */ - | "stopped" - /** The server is not configured for this session. */ - | "not_configured"; + /** The server is connected and available. */ + | "connected" + /** The server failed to connect or initialize. */ + | "failed" + /** The server requires authentication before it can connect. */ + | "needs-auth" + /** The server connection is still being established. */ + | "pending" + /** The server is configured but disabled. */ + | "disabled" + /** The server was intentionally stopped and can be restarted on demand when policy permits; a server quarantined by restrictive managed policy stays stopped and cannot be restarted until the policy allows it. */ + | "stopped" + /** The server is not configured for this session. */ + | "not_configured"; /** * Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) */ export type McpServerTransport = - /** Server communicates over stdio with a local child process. */ - | "stdio" - /** Server communicates over streamable HTTP. */ - | "http" - /** Server communicates over Server-Sent Events (deprecated). */ - | "sse" - /** Server is backed by an in-memory runtime implementation. */ - | "memory"; + /** Server communicates over stdio with a local child process. */ + | "stdio" + /** Server communicates over streamable HTTP. */ + | "http" + /** Server communicates over Server-Sent Events (deprecated). */ + | "sse" + /** Server is backed by an in-memory runtime implementation. */ + | "memory"; /** * Discovery source */ export type ExtensionsLoadedExtensionSource = - /** Extension discovered from the current project. */ - | "project" - /** Extension discovered from the user's extension directory. */ - | "user" - /** Extension contributed by an installed plugin. */ - | "plugin" - /** Extension discovered from the current session's state directory. */ - | "session"; + /** Extension discovered from the current project. */ + | "project" + /** Extension discovered from the user's extension directory. */ + | "user" + /** Extension contributed by an installed plugin. */ + | "plugin" + /** Extension discovered from the current session's state directory. */ + | "session"; /** * Current status: running, disabled, failed, or starting */ export type ExtensionsLoadedExtensionStatus = - /** The extension process is running. */ - | "running" - /** The extension is installed but disabled. */ - | "disabled" - /** The extension failed to start or crashed. */ - | "failed" - /** The extension process is starting. */ - | "starting"; + /** The extension process is running. */ + | "running" + /** The extension is installed but disabled. */ + | "disabled" + /** The extension failed to start or crashed. */ + | "failed" + /** The extension process is starting. */ + | "starting"; /** * Session event "session.start". Session initialization metadata including context and configuration */ export interface StartEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: StartData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.start". - */ - type: "session.start"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: StartData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.start". + */ + type: "session.start"; } /** * Session initialization metadata including context and configuration */ export interface StartData { - /** - * Whether the session was already in use by another client at start time - */ - alreadyInUse?: boolean; - autoTier?: AutoTier; - context?: WorkingDirectoryContext; - /** - * Context tier selected at session creation time for models with tiered context pricing; null when no tier is selected (e.g., non-tiered model) - */ - contextTier?: ContextTier | null; - /** - * Version string of the Copilot application - */ - copilotVersion: string; - /** - * When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id. - */ - detachedFromSpawningParentSessionId?: string; - githubMcpToolConfig?: GitHubMcpToolConfig; - /** - * Identifier of the software producing the events (e.g., "copilot-agent") - */ - producer: string; - /** - * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") - */ - reasoningEffort?: string; - reasoningSummary?: ReasoningSummary; - /** - * Whether this session supports remote steering via GitHub - */ - remoteSteerable?: boolean; - /** - * Model selected at session creation time, if any - */ - selectedModel?: string; - /** - * Unique identifier for the session - */ - sessionId: string; - sessionLimits?: SessionLimitsConfig; - /** - * ISO 8601 timestamp when the session was created - */ - startTime: string; - verbosity?: Verbosity; - /** - * Schema version number for the session event format - */ - version: number; + /** + * Whether the session was already in use by another client at start time + */ + alreadyInUse?: boolean; + autoTier?: AutoTier; + context?: WorkingDirectoryContext; + /** + * Context tier selected at session creation time for models with tiered context pricing; null when no tier is selected (e.g., non-tiered model) + */ + contextTier?: ContextTier | null; + /** + * Version string of the Copilot application + */ + copilotVersion: string; + /** + * When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id. + */ + detachedFromSpawningParentSessionId?: string; + githubMcpToolConfig?: GitHubMcpToolConfig; + /** + * Identifier of the software producing the events (e.g., "copilot-agent") + */ + producer: string; + /** + * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") + */ + reasoningEffort?: string; + reasoningSummary?: ReasoningSummary; + /** + * Whether this session supports remote steering via GitHub + */ + remoteSteerable?: boolean; + /** + * Model selected at session creation time, if any + */ + selectedModel?: string; + /** + * Unique identifier for the session + */ + sessionId: string; + sessionLimits?: SessionLimitsConfig; + /** + * ISO 8601 timestamp when the session was created + */ + startTime: string; + verbosity?: Verbosity; + /** + * Schema version number for the session event format + */ + version: number; } /** * Working directory and git context at session start */ export interface WorkingDirectoryContext { - /** - * Base commit of current git branch at session start time - */ - baseCommit?: string; - /** - * Current git branch name - */ - branch?: string; - /** - * Current working directory path - */ - cwd: string; - /** - * Root directory of the git repository, resolved via git rev-parse - */ - gitRoot?: string; - /** - * Head commit of current git branch at session start time - */ - headCommit?: string; - hostType?: WorkingDirectoryContextHostType; - /** - * Set on the immediate preliminary event of a working-directory change, before the git context is resolved. A settled follow-up event (enriched with git context, or cwd-only for a non-repository) is always emitted afterward, so observers may defer to it. Absent on standalone/final events (e.g. relay context changes). - */ - pendingGitContext?: boolean; - /** - * Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps) - */ - repository?: string; - /** - * Raw host string from the git remote URL (e.g. "github.com", "mycompany.ghe.com", "dev.azure.com") - */ - repositoryHost?: string; + /** + * Base commit of current git branch at session start time + */ + baseCommit?: string; + /** + * Current git branch name + */ + branch?: string; + /** + * Current working directory path + */ + cwd: string; + /** + * Root directory of the git repository, resolved via git rev-parse + */ + gitRoot?: string; + /** + * Head commit of current git branch at session start time + */ + headCommit?: string; + hostType?: WorkingDirectoryContextHostType; + /** + * Set on the immediate preliminary event of a working-directory change, before the git context is resolved. A settled follow-up event (enriched with git context, or cwd-only for a non-repository) is always emitted afterward, so observers may defer to it. Absent on standalone/final events (e.g. relay context changes). + */ + pendingGitContext?: boolean; + /** + * Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps) + */ + repository?: string; + /** + * Raw host string from the git remote URL (e.g. "github.com", "mycompany.ghe.com", "dev.azure.com") + */ + repositoryHost?: string; } /** * Per-session configuration for the built-in GitHub MCP server */ export interface GitHubMcpToolConfig { - /** - * Additional GitHub MCP tools requested by the session - */ - additionalTools?: string[]; - /** - * Additional GitHub MCP toolsets requested by the session - */ - additionalToolsets?: string[]; - /** - * Whether to use the read-write endpoint and request all toolsets - */ - enableAllTools?: boolean; - /** - * Whether to request the GitHub MCP insiders build - */ - enableInsidersMode?: boolean; + /** + * Additional GitHub MCP tools requested by the session + */ + additionalTools?: string[]; + /** + * Additional GitHub MCP toolsets requested by the session + */ + additionalToolsets?: string[]; + /** + * Whether to use the read-write endpoint and request all toolsets + */ + enableAllTools?: boolean; + /** + * Whether to request the GitHub MCP insiders build + */ + enableInsidersMode?: boolean; } /** * Optional session limits. */ export interface SessionLimitsConfig { - /** - * Maximum AI Credits allowed across the session's current accounting window. - */ - maxAiCredits?: number; + /** + * Maximum AI Credits allowed across the session's current accounting window. + */ + maxAiCredits?: number; } /** * Session event "session.resume". Session resume metadata including current context and event count */ export interface ResumeEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ResumeData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.resume". - */ - type: "session.resume"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ResumeData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.resume". + */ + type: "session.resume"; } /** * Session resume metadata including current context and event count */ export interface ResumeData { - /** - * Whether the session was already in use by another client at resume time - */ - alreadyInUse?: boolean; - autoTier?: AutoTier; - context?: WorkingDirectoryContext; - /** - * Context tier currently selected at resume time; null when no tier is active - */ - contextTier?: ContextTier | null; - /** - * When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false or omitted, pending work is normally marked as interrupted unless the resume passively joined live work owned by another client; sessionWasActive distinguishes that case. - */ - continuePendingWork?: boolean; - /** - * Total number of persisted events in the session at the time of resume - */ - eventCount: number; - /** - * On-disk byte size of the session's persisted events.jsonl file at resume time; omitted when the file does not exist or cannot be stat'd - */ - eventsFileSizeBytes?: number; - /** - * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") - */ - reasoningEffort?: string; - reasoningSummary?: ReasoningSummary; - /** - * Whether this session supports remote steering via GitHub - */ - remoteSteerable?: boolean; - /** - * ISO 8601 timestamp when the session was resumed - */ - resumeTime: string; - /** - * Model currently selected at resume time - */ - selectedModel?: string; - /** - * Session limits currently configured at resume time; null when no limits are active - */ - sessionLimits?: SessionLimitsConfig | null; - /** - * True when this resume passively joined a session that already had live work running in the runtime - an agent turn, a native queue run, a queued resume continuation, or an in-flight send (for example, an extension joining a session another client was actively driving). False (or omitted) when the session had no live work or when the resume explicitly abandoned pending work, including cold resumes and suspended sessions that remain resident in memory. - */ - sessionWasActive?: boolean; - verbosity?: Verbosity; + /** + * Whether the session was already in use by another client at resume time + */ + alreadyInUse?: boolean; + autoTier?: AutoTier; + context?: WorkingDirectoryContext; + /** + * Context tier currently selected at resume time; null when no tier is active + */ + contextTier?: ContextTier | null; + /** + * When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false or omitted, pending work is normally marked as interrupted unless the resume passively joined live work owned by another client; sessionWasActive distinguishes that case. + */ + continuePendingWork?: boolean; + /** + * Total number of persisted events in the session at the time of resume + */ + eventCount: number; + /** + * On-disk byte size of the session's persisted events.jsonl file at resume time; omitted when the file does not exist or cannot be stat'd + */ + eventsFileSizeBytes?: number; + /** + * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") + */ + reasoningEffort?: string; + reasoningSummary?: ReasoningSummary; + /** + * Whether this session supports remote steering via GitHub + */ + remoteSteerable?: boolean; + /** + * ISO 8601 timestamp when the session was resumed + */ + resumeTime: string; + /** + * Model currently selected at resume time + */ + selectedModel?: string; + /** + * Session limits currently configured at resume time; null when no limits are active + */ + sessionLimits?: SessionLimitsConfig | null; + /** + * True when this resume passively joined a session that already had live work running in the runtime - an agent turn, a native queue run, a queued resume continuation, or an in-flight send (for example, an extension joining a session another client was actively driving). False (or omitted) when the session had no live work or when the resume explicitly abandoned pending work, including cold resumes and suspended sessions that remain resident in memory. + */ + sessionWasActive?: boolean; + verbosity?: Verbosity; } /** * Session event "session.remote_steerable_changed". Notifies that the session's remote steering capability has changed */ export interface RemoteSteerableChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: RemoteSteerableChangedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.remote_steerable_changed". - */ - type: "session.remote_steerable_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: RemoteSteerableChangedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.remote_steerable_changed". + */ + type: "session.remote_steerable_changed"; } /** * Notifies that the session's remote steering capability has changed */ export interface RemoteSteerableChangedData { - /** - * Whether this session now supports remote steering via GitHub - */ - remoteSteerable: boolean; + /** + * Whether this session now supports remote steering via GitHub + */ + remoteSteerable: boolean; } /** * Session event "session.error". Error details for timeline display including message and optional diagnostic information */ export interface ErrorEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ErrorData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.error". - */ - type: "session.error"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ErrorData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.error". + */ + type: "session.error"; } /** * Error details for timeline display including message and optional diagnostic information */ export interface ErrorData { - /** - * Only set on `errorType: "rate_limit"`. When `true`, the runtime will follow this error with an `auto_mode_switch.requested` event (or silently switch if `continueOnAutoMode` is enabled). UI clients can use this flag to suppress duplicate rendering of the rate-limit error when they show their own auto-mode-switch prompt. - */ - eligibleForAutoSwitch?: boolean; - /** - * Fine-grained error code from the upstream provider, when available. For `errorType: "rate_limit"`, this is one of the `RateLimitErrorCode` values (e.g., `"user_weekly_rate_limited"`, `"user_global_rate_limited"`, `"rate_limited"`, `"user_model_rate_limited"`, `"integration_rate_limited"`). For `errorType: "quota"`, this is the CAPI quota error code (e.g., `"quota_exceeded"`, `"session_quota_exceeded"`, `"billing_not_configured"`). - */ - errorCode?: string; - /** - * Category of error (e.g., "authentication", "authorization", "quota", "rate_limit", "context_limit", "query") - */ - errorType: string; - /** - * Human-readable error message - */ - message: string; - /** - * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs - */ - providerCallId?: string; - /** - * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation - */ - serviceRequestId?: string; - /** - * Error stack trace, when available - */ - stack?: string; - /** - * HTTP status code from the upstream request, if applicable - */ - statusCode?: number; - /** - * Optional URL associated with this error that the user can open in a browser - */ - url?: string; + /** + * Only set on `errorType: "rate_limit"`. When `true`, the runtime will follow this error with an `auto_mode_switch.requested` event (or silently switch if `continueOnAutoMode` is enabled). UI clients can use this flag to suppress duplicate rendering of the rate-limit error when they show their own auto-mode-switch prompt. + */ + eligibleForAutoSwitch?: boolean; + /** + * Fine-grained error code from the upstream provider, when available. For `errorType: "rate_limit"`, this is one of the `RateLimitErrorCode` values (e.g., `"user_weekly_rate_limited"`, `"user_global_rate_limited"`, `"rate_limited"`, `"user_model_rate_limited"`, `"integration_rate_limited"`). For `errorType: "quota"`, this is the CAPI quota error code (e.g., `"quota_exceeded"`, `"session_quota_exceeded"`, `"billing_not_configured"`). + */ + errorCode?: string; + /** + * Category of error (e.g., "authentication", "authorization", "quota", "rate_limit", "context_limit", "query") + */ + errorType: string; + /** + * Human-readable error message + */ + message: string; + /** + * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs + */ + providerCallId?: string; + /** + * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + */ + serviceRequestId?: string; + /** + * Error stack trace, when available + */ + stack?: string; + /** + * HTTP status code from the upstream request, if applicable + */ + statusCode?: number; + /** + * Optional URL associated with this error that the user can open in a browser + */ + url?: string; } /** * Session event "session.idle". Payload indicating the session is idle with no background agents or attached shell commands in flight */ export interface IdleEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: IdleData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.idle". - */ - type: "session.idle"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: IdleData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.idle". + */ + type: "session.idle"; } /** * Payload indicating the session is idle with no background agents or attached shell commands in flight */ export interface IdleData { - /** - * True when the preceding agentic loop was cancelled via abort signal - */ - aborted?: boolean; - mode?: SessionMode; + /** + * True when the preceding agentic loop was cancelled via abort signal + */ + aborted?: boolean; + mode?: SessionMode; } /** * Session event "session.title_changed". Session title change payload containing the new display title */ export interface TitleChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: TitleChangedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.title_changed". - */ - type: "session.title_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: TitleChangedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.title_changed". + */ + type: "session.title_changed"; } /** * Session title change payload containing the new display title */ export interface TitleChangedData { - /** - * The new display title for the session - */ - title: string; + /** + * The new display title for the session + */ + title: string; } /** * Session event "session.schedule_created". Scheduled prompt registered via /every or /after */ export interface ScheduleCreatedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ScheduleCreatedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.schedule_created". - */ - type: "session.schedule_created"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ScheduleCreatedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.schedule_created". + */ + type: "session.schedule_created"; } /** * Scheduled prompt registered via /every or /after */ export interface ScheduleCreatedData { - /** - * Absolute fire time (epoch milliseconds) for a one-shot calendar schedule - */ - at?: number; - /** - * 5-field cron expression for a recurring calendar schedule, evaluated in `tz` - */ - cron?: string; - /** - * 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) - */ - displayPrompt?: string; - /** - * Sequential id assigned to the scheduled prompt within the session - */ - id: number; - /** - * Interval between ticks in milliseconds (relative-interval schedules) - */ - intervalMs?: number; - origin?: ScheduleOrigin; - /** - * Prompt text that gets enqueued on every tick - */ - prompt: string; - /** - * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`) - */ - recurring?: boolean; - /** - * 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. - */ - selfPaced?: boolean; - /** - * IANA timezone the `cron` expression is evaluated in - */ - tz?: string; + /** + * Absolute fire time (epoch milliseconds) for a one-shot calendar schedule + */ + at?: number; + /** + * 5-field cron expression for a recurring calendar schedule, evaluated in `tz` + */ + cron?: string; + /** + * 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) + */ + displayPrompt?: string; + /** + * Sequential id assigned to the scheduled prompt within the session + */ + id: number; + /** + * Interval between ticks in milliseconds (relative-interval schedules) + */ + intervalMs?: number; + origin?: ScheduleOrigin; + /** + * Prompt text that gets enqueued on every tick + */ + prompt: string; + /** + * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`) + */ + recurring?: boolean; + /** + * 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. + */ + selfPaced?: boolean; + /** + * IANA timezone the `cron` expression is evaluated in + */ + tz?: string; } /** * Session event "session.schedule_cancelled". Scheduled prompt cancelled from the schedule manager dialog */ export interface ScheduleCancelledEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ScheduleCancelledData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.schedule_cancelled". - */ - type: "session.schedule_cancelled"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ScheduleCancelledData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.schedule_cancelled". + */ + type: "session.schedule_cancelled"; } /** * Scheduled prompt cancelled from the schedule manager dialog */ export interface ScheduleCancelledData { - /** - * Id of the scheduled prompt that was cancelled - */ - id: number; + /** + * Id of the scheduled prompt that was cancelled + */ + id: number; } /** * Session event "session.schedule_rearmed". Self-paced schedule re-armed for its next run */ export interface ScheduleRearmedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ScheduleRearmedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.schedule_rearmed". - */ - type: "session.schedule_rearmed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ScheduleRearmedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.schedule_rearmed". + */ + type: "session.schedule_rearmed"; } /** * Self-paced schedule re-armed for its next run */ export interface ScheduleRearmedData { - /** - * Id of the self-paced schedule that was re-armed - */ - id: number; - /** - * Absolute time (epoch milliseconds) the model armed the next run to fire - */ - nextRunAt: number; + /** + * Id of the self-paced schedule that was re-armed + */ + id: number; + /** + * Absolute time (epoch milliseconds) the model armed the next run to fire + */ + nextRunAt: number; } /** * Session event "session.autopilot_objective_changed". Autopilot objective state file operation details indicating what changed */ export interface AutopilotObjectiveChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AutopilotObjectiveChangedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.autopilot_objective_changed". - */ - type: "session.autopilot_objective_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AutopilotObjectiveChangedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.autopilot_objective_changed". + */ + type: "session.autopilot_objective_changed"; } /** * Autopilot objective state file operation details indicating what changed */ export interface AutopilotObjectiveChangedData { - /** - * Current autopilot objective id, if one exists - */ - id?: number; - operation: AutopilotObjectiveChangedOperation; - status?: AutopilotObjectiveChangedStatus; + /** + * Current autopilot objective id, if one exists + */ + id?: number; + operation: AutopilotObjectiveChangedOperation; + status?: AutopilotObjectiveChangedStatus; } /** * Session event "session.info". Informational message for timeline display with categorization */ export interface InfoEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: InfoData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.info". - */ - type: "session.info"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: InfoData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.info". + */ + type: "session.info"; } /** * Informational message for timeline display with categorization */ export interface InfoData { - /** - * Category of informational message (e.g., "notification", "timing", "context_window", "mcp", "snapshot", "configuration", "authentication", "model") - */ - infoType: string; - /** - * Human-readable informational message for display in the timeline - */ - message: string; - /** - * Optional actionable tip displayed with this message - */ - tip?: string; - /** - * Optional URL associated with this message that the user can open in a browser - */ - url?: string; + /** + * Category of informational message (e.g., "notification", "timing", "context_window", "mcp", "snapshot", "configuration", "authentication", "model") + */ + infoType: string; + /** + * Human-readable informational message for display in the timeline + */ + message: string; + /** + * Optional actionable tip displayed with this message + */ + tip?: string; + /** + * Optional URL associated with this message that the user can open in a browser + */ + url?: string; } /** * Session event "session.warning". Warning message for timeline display with categorization */ export interface WarningEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: WarningData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.warning". - */ - type: "session.warning"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: WarningData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.warning". + */ + type: "session.warning"; } /** * Warning message for timeline display with categorization */ export interface WarningData { - /** - * Human-readable warning message for display in the timeline - */ - message: string; - /** - * Optional URL associated with this warning that the user can open in a browser - */ - url?: string; - /** - * Category of warning (e.g., "subscription", "policy", "mcp") - */ - warningType: string; + /** + * Human-readable warning message for display in the timeline + */ + message: string; + /** + * Optional URL associated with this warning that the user can open in a browser + */ + url?: string; + /** + * Category of warning (e.g., "subscription", "policy", "mcp") + */ + warningType: string; } /** * Session event "session.model_change". Model change details including previous and new model identifiers */ export interface ModelChangeEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ModelChangeData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.model_change". - */ - type: "session.model_change"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ModelChangeData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.model_change". + */ + type: "session.model_change"; } /** * Model change details including previous and new model identifiers */ export interface ModelChangeData { - /** - * Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. - */ - cause?: string; - /** - * Context tier after the model change; null explicitly clears a previously selected tier - */ - contextTier?: ContextTier | null; - /** - * Newly selected model identifier - */ - newModel: string; - /** - * Model that was previously selected, if any - */ - previousModel?: string; - /** - * Reasoning effort level before the model change, if applicable - */ - previousReasoningEffort?: string; - previousReasoningSummary?: ReasoningSummary; - previousVerbosity?: Verbosity; - /** - * Reasoning effort level after the model change, if applicable - */ - reasoningEffort?: string | null; - reasoningSummary?: ReasoningSummary; - source?: ModelChangeSource; - verbosity?: Verbosity; + /** + * Committed Auto preference after the model configuration change, when applicable. + */ + autoTier?: AutoTier | null; + /** + * Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. + */ + cause?: string; + /** + * Context tier after the model change; null explicitly clears a previously selected tier + */ + contextTier?: ContextTier | null; + /** + * Newly selected model identifier + */ + newModel: string; + previousAutoTier?: AutoTier; + /** + * Model that was previously selected, if any + */ + previousModel?: string; + /** + * Reasoning effort level before the model change, if applicable + */ + previousReasoningEffort?: string; + previousReasoningSummary?: ReasoningSummary; + previousVerbosity?: Verbosity; + /** + * Reasoning effort level after the model change, if applicable + */ + reasoningEffort?: string | null; + reasoningSummary?: ReasoningSummary; + source?: ModelChangeSource; + verbosity?: Verbosity; +} +/** + * Session event "session.auto_tier_switch_failed". A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. + */ +export interface AutoTierSwitchFailedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AutoTierSwitchFailedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.auto_tier_switch_failed". + */ + type: "session.auto_tier_switch_failed"; +} +/** + * A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. + */ +export interface AutoTierSwitchFailedData { + effectiveAutoTier?: AutoTier; + reason: AutoTierSwitchFailureReason; + /** + * Auto preference that failed to activate, or null when returning to provider-default routing failed. + */ + requestedAutoTier: AutoTier | null; } /** * Session event "session.mode_changed". Agent mode change details including previous and new modes */ export interface ModeChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ModeChangedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.mode_changed". - */ - type: "session.mode_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ModeChangedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.mode_changed". + */ + type: "session.mode_changed"; } /** * Agent mode change details including previous and new modes */ export interface ModeChangedData { - newMode: SessionMode; - previousMode: SessionMode; + newMode: SessionMode; + previousMode: SessionMode; } /** * Session event "session.mode_notice_delivered". Records that a mode transition notice reached the model so cache-stable mode tools can remain offered across resume. */ export interface ModeNoticeDeliveredEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ModeNoticeDeliveredData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.mode_notice_delivered". - */ - type: "session.mode_notice_delivered"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ModeNoticeDeliveredData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.mode_notice_delivered". + */ + type: "session.mode_notice_delivered"; } /** * Records that a mode transition notice reached the model so cache-stable mode tools can remain offered across resume. */ export interface ModeNoticeDeliveredData { - /** - * Model-visible transition notice persisted for a mid-turn delivery - */ - content?: string; - mode: SessionMode; + /** + * Model-visible transition notice persisted for a mid-turn delivery + */ + content?: string; + mode: SessionMode; } /** * Session event "session.session_limits_changed". Session limits update details. Null clears the limits. */ export interface SessionLimitsChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SessionLimitsChangedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.session_limits_changed". - */ - type: "session.session_limits_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SessionLimitsChangedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.session_limits_changed". + */ + type: "session.session_limits_changed"; } /** * Session limits update details. Null clears the limits. */ export interface SessionLimitsChangedData { - /** - * Current session limits, or null when no limits are active - */ - sessionLimits: SessionLimitsConfig | null; + /** + * Current session limits, or null when no limits are active + */ + sessionLimits: SessionLimitsConfig | null; } /** * Session event "session.permissions_changed". Permission-mode transition details. */ /** @experimental */ export interface PermissionsChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: PermissionsChangedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.permissions_changed". - */ - type: "session.permissions_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: PermissionsChangedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.permissions_changed". + */ + type: "session.permissions_changed"; } /** * Permission-mode transition details. */ /** @experimental */ export interface PermissionsChangedData { - /** - * Explicit LLM judge model override used by assisted mode; omitted when the provider default applies - * - * @experimental - */ - assistedApprovalModel?: string; - /** - * Permission mode after the change - * - * @experimental - */ - mode: PermissionMode; - /** - * Permission mode before the change - * - * @experimental - */ - previousMode: PermissionMode; + /** + * Explicit LLM judge model override used by assisted mode; omitted when the provider default applies + * + * @experimental + */ + assistedApprovalModel?: string; + /** + * Permission mode after the change + * + * @experimental + */ + mode: PermissionMode; + /** + * Permission mode before the change + * + * @experimental + */ + previousMode: PermissionMode; } /** * Session event "session.plan_changed". Plan file operation details indicating what changed */ export interface PlanChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: PlanChangedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.plan_changed". - */ - type: "session.plan_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: PlanChangedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.plan_changed". + */ + type: "session.plan_changed"; } /** * Plan file operation details indicating what changed */ export interface PlanChangedData { - operation: PlanChangedOperation; + operation: PlanChangedOperation; } /** * Session event "session.todos_changed". Signal-only event: the agent's todos or todo_deps table was written to. No payload — clients should call session.plan.readSqlTodosWithDependencies() to fetch the current state. Events arrive in order; clients can debounce on arrival if needed. */ export interface TodosChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: TodosChangedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.todos_changed". - */ - type: "session.todos_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: TodosChangedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.todos_changed". + */ + type: "session.todos_changed"; } /** * Signal-only event: the agent's todos or todo_deps table was written to. No payload — clients should call session.plan.readSqlTodosWithDependencies() to fetch the current state. Events arrive in order; clients can debounce on arrival if needed. @@ -2159,1982 +2231,1982 @@ export interface TodosChangedData {} * Session event "session.workspace_file_changed". Workspace file change details including path and operation type */ export interface WorkspaceFileChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: WorkspaceFileChangedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.workspace_file_changed". - */ - type: "session.workspace_file_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: WorkspaceFileChangedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.workspace_file_changed". + */ + type: "session.workspace_file_changed"; } /** * Workspace file change details including path and operation type */ export interface WorkspaceFileChangedData { - operation: WorkspaceFileChangedOperation; - /** - * Relative path within the session workspace files directory - */ - path: string; + operation: WorkspaceFileChangedOperation; + /** + * Relative path within the session workspace files directory + */ + path: string; } /** * Session event "session.handoff". Session handoff metadata including source, context, and repository information */ export interface HandoffEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: HandoffData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.handoff". - */ - type: "session.handoff"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: HandoffData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.handoff". + */ + type: "session.handoff"; } /** * Session handoff metadata including source, context, and repository information */ export interface HandoffData { - /** - * Additional context information for the handoff - */ - context?: string; - /** - * ISO 8601 timestamp when the handoff occurred - */ - handoffTime: string; - /** - * GitHub host URL for the source session (e.g., https://github.com or https://tenant.ghe.com) - */ - host?: string; - /** - * Session ID of the remote session being handed off - */ - remoteSessionId?: string; - repository?: HandoffRepository; - sourceType: HandoffSourceType; - /** - * Summary of the work done in the source session - */ - summary?: string; + /** + * Additional context information for the handoff + */ + context?: string; + /** + * ISO 8601 timestamp when the handoff occurred + */ + handoffTime: string; + /** + * GitHub host URL for the source session (e.g., https://github.com or https://tenant.ghe.com) + */ + host?: string; + /** + * Session ID of the remote session being handed off + */ + remoteSessionId?: string; + repository?: HandoffRepository; + sourceType: HandoffSourceType; + /** + * Summary of the work done in the source session + */ + summary?: string; } /** * Repository context for the handed-off session */ export interface HandoffRepository { - /** - * Git branch name, if applicable - */ - branch?: string; - /** - * Repository name - */ - name: string; - /** - * Repository owner (user or organization) - */ - owner: string; + /** + * Git branch name, if applicable + */ + branch?: string; + /** + * Repository name + */ + name: string; + /** + * Repository owner (user or organization) + */ + owner: string; } /** * Session event "session.truncation". Conversation truncation statistics including token counts and removed content metrics */ export interface TruncationEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: TruncationData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.truncation". - */ - type: "session.truncation"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: TruncationData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.truncation". + */ + type: "session.truncation"; } /** * Conversation truncation statistics including token counts and removed content metrics */ export interface TruncationData { - /** - * Number of messages removed by truncation - */ - messagesRemovedDuringTruncation: number; - /** - * Identifier of the component that performed truncation (e.g., "BasicTruncator") - */ - performedBy: string; - /** - * Number of conversation messages after truncation - */ - postTruncationMessagesLength: number; - /** - * Total tokens in conversation messages after truncation - */ - postTruncationTokensInMessages: number; - /** - * Number of conversation messages before truncation - */ - preTruncationMessagesLength: number; - /** - * Total tokens in conversation messages before truncation - */ - preTruncationTokensInMessages: number; - /** - * Maximum token count for the model's context window - */ - tokenLimit: number; - /** - * Number of tokens removed by truncation - */ - tokensRemovedDuringTruncation: number; + /** + * Number of messages removed by truncation + */ + messagesRemovedDuringTruncation: number; + /** + * Identifier of the component that performed truncation (e.g., "BasicTruncator") + */ + performedBy: string; + /** + * Number of conversation messages after truncation + */ + postTruncationMessagesLength: number; + /** + * Total tokens in conversation messages after truncation + */ + postTruncationTokensInMessages: number; + /** + * Number of conversation messages before truncation + */ + preTruncationMessagesLength: number; + /** + * Total tokens in conversation messages before truncation + */ + preTruncationTokensInMessages: number; + /** + * Maximum token count for the model's context window + */ + tokenLimit: number; + /** + * Number of tokens removed by truncation + */ + tokensRemovedDuringTruncation: number; } /** * Session event "session.snapshot_rewind". Session rewind details including target event and count of removed events */ export interface SnapshotRewindEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SnapshotRewindData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.snapshot_rewind". - */ - type: "session.snapshot_rewind"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SnapshotRewindData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.snapshot_rewind". + */ + type: "session.snapshot_rewind"; } /** * Session rewind details including target event and count of removed events */ export interface SnapshotRewindData { - /** - * Number of events that were removed by the rewind - */ - eventsRemoved: number; - /** - * Event ID that was rewound to; this event and all after it were removed - */ - upToEventId: string; + /** + * Number of events that were removed by the rewind + */ + eventsRemoved: number; + /** + * Event ID that was rewound to; this event and all after it were removed + */ + upToEventId: string; } /** * Session event "session.shutdown". Session termination metrics including usage statistics, code changes, and shutdown reason */ export interface ShutdownEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ShutdownData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.shutdown". - */ - type: "session.shutdown"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ShutdownData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.shutdown". + */ + type: "session.shutdown"; } /** * Session termination metrics including usage statistics, code changes, and shutdown reason */ export interface ShutdownData { - /** - * Per-agent usage breakdown, keyed by agent instance identifier. The main conversation uses the stable key `main`. - */ - agentMetrics?: { - [k: string]: ShutdownAgentMetric | undefined; - }; - codeChanges: ShutdownCodeChanges; - /** - * Non-system message token count at shutdown - */ - conversationTokens?: number; - /** - * Model that was selected at the time of shutdown - */ - currentModel?: string; - /** - * Total tokens in context window at shutdown - */ - currentTokens?: number; - /** - * Error description when shutdownType is "error" - */ - errorReason?: string; - /** - * On-disk byte size of the session's persisted events.jsonl file at shutdown time; omitted when the file does not exist or cannot be stat'd - */ - eventsFileSizeBytes?: number; - /** - * Per-model usage breakdown, keyed by model identifier - */ - modelMetrics: { - [k: string]: ShutdownModelMetric | undefined; - }; - /** - * Unix timestamp (milliseconds) when the session started - */ - sessionStartTime: number; - shutdownType: ShutdownType; - /** - * System message token count at shutdown - */ - systemTokens?: number; - /** - * Session-wide per-token-type accumulated token counts - */ - tokenDetails?: { - [k: string]: ShutdownTokenDetail | undefined; - }; - /** - * Tool definitions token count at shutdown - */ - toolDefinitionsTokens?: number; - /** - * Cumulative time spent in API calls during the session, in milliseconds - */ - totalApiDurationMs: number; - /** - * Session-wide accumulated nano-AI units cost - * - * @experimental - */ - totalNanoAiu?: number; - /** - * Total number of premium API requests used during the session - * - * @internal - */ - totalPremiumRequests?: number; + /** + * Per-agent usage breakdown, keyed by agent instance identifier. The main conversation uses the stable key `main`. + */ + agentMetrics?: { + [k: string]: ShutdownAgentMetric | undefined; + }; + codeChanges: ShutdownCodeChanges; + /** + * Non-system message token count at shutdown + */ + conversationTokens?: number; + /** + * Model that was selected at the time of shutdown + */ + currentModel?: string; + /** + * Total tokens in context window at shutdown + */ + currentTokens?: number; + /** + * Error description when shutdownType is "error" + */ + errorReason?: string; + /** + * On-disk byte size of the session's persisted events.jsonl file at shutdown time; omitted when the file does not exist or cannot be stat'd + */ + eventsFileSizeBytes?: number; + /** + * Per-model usage breakdown, keyed by model identifier + */ + modelMetrics: { + [k: string]: ShutdownModelMetric | undefined; + }; + /** + * Unix timestamp (milliseconds) when the session started + */ + sessionStartTime: number; + shutdownType: ShutdownType; + /** + * System message token count at shutdown + */ + systemTokens?: number; + /** + * Session-wide per-token-type accumulated token counts + */ + tokenDetails?: { + [k: string]: ShutdownTokenDetail | undefined; + }; + /** + * Tool definitions token count at shutdown + */ + toolDefinitionsTokens?: number; + /** + * Cumulative time spent in API calls during the session, in milliseconds + */ + totalApiDurationMs: number; + /** + * Session-wide accumulated nano-AI units cost + * + * @experimental + */ + totalNanoAiu?: number; + /** + * Total number of premium API requests used during the session + * + * @internal + */ + totalPremiumRequests?: number; } /** * Usage attributed to one agent instance at session shutdown. */ export interface ShutdownAgentMetric { - /** - * Human-readable label for this subagent invocation, copied from the originating `subagent.started` event. For task-tool subagents this is the invocation's task description rather than the agent's configured display name, so group by `agentName` for stable per-agent labels. - */ - agentDisplayName?: string; - /** - * Configured agent name, when this is a subagent - */ - agentName?: string; - /** - * Per-model usage for this agent, keyed by model identifier - */ - modelMetrics: { - [k: string]: ShutdownModelMetric | undefined; - }; - /** - * Time spent in model API calls by this agent, in milliseconds - */ - totalApiDurationMs: number; - /** - * Accumulated nano-AI units cost for this agent - */ - totalNanoAiu: number; + /** + * Human-readable label for this subagent invocation, copied from the originating `subagent.started` event. For task-tool subagents this is the invocation's task description rather than the agent's configured display name, so group by `agentName` for stable per-agent labels. + */ + agentDisplayName?: string; + /** + * Configured agent name, when this is a subagent + */ + agentName?: string; + /** + * Per-model usage for this agent, keyed by model identifier + */ + modelMetrics: { + [k: string]: ShutdownModelMetric | undefined; + }; + /** + * Time spent in model API calls by this agent, in milliseconds + */ + totalApiDurationMs: number; + /** + * Accumulated nano-AI units cost for this agent + */ + totalNanoAiu: number; } /** * Per-model shutdown metrics with request counts, token usage, nano-AI units, and token details. */ export interface ShutdownModelMetric { - requests: ShutdownModelMetricRequests; - /** - * Token count details per type - */ - tokenDetails?: { - [k: string]: ShutdownModelMetricTokenDetail | undefined; - }; - /** - * Accumulated nano-AI units cost for this model - * - * @experimental - */ - totalNanoAiu?: number; - usage: ShutdownModelMetricUsage; + requests: ShutdownModelMetricRequests; + /** + * Token count details per type + */ + tokenDetails?: { + [k: string]: ShutdownModelMetricTokenDetail | undefined; + }; + /** + * Accumulated nano-AI units cost for this model + * + * @experimental + */ + totalNanoAiu?: number; + usage: ShutdownModelMetricUsage; } /** * Request count and cost metrics */ export interface ShutdownModelMetricRequests { - /** - * Cumulative cost multiplier for requests to this model - * - * @experimental - */ - cost?: number; - /** - * Total number of API requests made to this model - * - * @experimental - */ - count?: number; + /** + * Cumulative cost multiplier for requests to this model + * + * @experimental + */ + cost?: number; + /** + * Total number of API requests made to this model + * + * @experimental + */ + count?: number; } /** * A token-type entry in a shutdown model metric, storing the accumulated token count. */ export interface ShutdownModelMetricTokenDetail { - /** - * Accumulated token count for this token type - */ - tokenCount: number; + /** + * Accumulated token count for this token type + */ + tokenCount: number; } /** * Token usage breakdown */ export interface ShutdownModelMetricUsage { - /** - * Total tokens read from prompt cache across all requests - */ - cacheReadTokens: number; - /** - * Total tokens written to prompt cache across all requests - */ - cacheWriteTokens: number; - /** - * Total input tokens consumed across all requests to this model - */ - inputTokens: number; - /** - * Total output tokens produced across all requests to this model - */ - outputTokens: number; - /** - * Total reasoning tokens produced across all requests to this model - */ - reasoningTokens?: number; + /** + * Total tokens read from prompt cache across all requests + */ + cacheReadTokens: number; + /** + * Total tokens written to prompt cache across all requests + */ + cacheWriteTokens: number; + /** + * Total input tokens consumed across all requests to this model + */ + inputTokens: number; + /** + * Total output tokens produced across all requests to this model + */ + outputTokens: number; + /** + * Total reasoning tokens produced across all requests to this model + */ + reasoningTokens?: number; } /** * Aggregate code change metrics for the session */ export interface ShutdownCodeChanges { - /** - * List of file paths that were modified during the session - */ - filesModified: string[]; - /** - * Total number of lines added during the session - */ - linesAdded: number; - /** - * Total number of lines removed during the session - */ - linesRemoved: number; + /** + * List of file paths that were modified during the session + */ + filesModified: string[]; + /** + * Total number of lines added during the session + */ + linesAdded: number; + /** + * Total number of lines removed during the session + */ + linesRemoved: number; } /** * A session-wide shutdown token-type entry storing the accumulated token count. */ export interface ShutdownTokenDetail { - /** - * Accumulated token count for this token type - */ - tokenCount: number; + /** + * Accumulated token count for this token type + */ + tokenCount: number; } /** * Session event "session.usage_checkpoint". Durable session usage checkpoint for reconstructing aggregate accounting on resume */ export interface UsageCheckpointEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: UsageCheckpointData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.usage_checkpoint". - */ - type: "session.usage_checkpoint"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: UsageCheckpointData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.usage_checkpoint". + */ + type: "session.usage_checkpoint"; } /** * Durable session usage checkpoint for reconstructing aggregate accounting on resume */ export interface UsageCheckpointData { - /** - * Internal per-model prompt-cache state used to restore expiration tracking on resume - * - * @internal - */ - modelCacheState?: UsageCheckpointModelCacheState[]; - /** - * Internal per-conversation prompt-cache-break detector baselines restored on resume - * - * @internal - */ - promptCacheBreakState?: JsonValue[]; - /** - * Session-wide accumulated nano-AI units cost at checkpoint time - */ - totalNanoAiu: number; - /** - * Total number of premium API requests used at checkpoint time - * - * @internal - */ - totalPremiumRequests?: number; + /** + * Internal per-model prompt-cache state used to restore expiration tracking on resume + * + * @internal + */ + modelCacheState?: UsageCheckpointModelCacheState[]; + /** + * Internal per-conversation prompt-cache-break detector baselines restored on resume + * + * @internal + */ + promptCacheBreakState?: JsonValue[]; + /** + * Session-wide accumulated nano-AI units cost at checkpoint time + */ + totalNanoAiu: number; + /** + * Total number of premium API requests used at checkpoint time + * + * @internal + */ + totalPremiumRequests?: number; } /** * Internal prompt-cache expiration state for one model */ /** @internal */ export interface UsageCheckpointModelCacheState { - /** - * Latest known prompt-cache expiration - */ - cacheExpiresAt: string; - /** - * Retained cache lifetime in seconds, used to refresh expiration after a cache read - * - * @internal - */ - cacheTtlSeconds: number; - /** - * Model identifier associated with this cache state - */ - modelId: string; + /** + * Latest known prompt-cache expiration + */ + cacheExpiresAt: string; + /** + * Retained cache lifetime in seconds, used to refresh expiration after a cache read + * + * @internal + */ + cacheTtlSeconds: number; + /** + * Model identifier associated with this cache state + */ + modelId: string; } /** * Session event "session.context_changed". Updated working directory and git context after the change */ export interface ContextChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: WorkingDirectoryContext; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.context_changed". - */ - type: "session.context_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: WorkingDirectoryContext; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.context_changed". + */ + type: "session.context_changed"; } /** * Session event "session.usage_info". Current context window usage statistics including token and message counts */ export interface UsageInfoEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: UsageInfoData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.usage_info". - */ - type: "session.usage_info"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: UsageInfoData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.usage_info". + */ + type: "session.usage_info"; } /** * Current context window usage statistics including token and message counts */ export interface UsageInfoData { - /** - * Token count from non-system messages (user, assistant, tool) - */ - conversationTokens?: number; - /** - * Current number of tokens in the context window - */ - currentTokens: number; - /** - * Whether this is the first usage_info event emitted in this session - */ - isInitial?: boolean; - /** - * Current number of messages in the conversation - */ - messagesLength: number; - /** - * Token count from system message(s) - */ - systemTokens?: number; - /** - * Maximum token count for the model's context window - */ - tokenLimit: number; - /** - * Token count from tool definitions - */ - toolDefinitionsTokens?: number; + /** + * Token count from non-system messages (user, assistant, tool) + */ + conversationTokens?: number; + /** + * Current number of tokens in the context window + */ + currentTokens: number; + /** + * Whether this is the first usage_info event emitted in this session + */ + isInitial?: boolean; + /** + * Current number of messages in the conversation + */ + messagesLength: number; + /** + * Token count from system message(s) + */ + systemTokens?: number; + /** + * Maximum token count for the model's context window + */ + tokenLimit: number; + /** + * Token count from tool definitions + */ + toolDefinitionsTokens?: number; } /** * Session event "session.context_cleared". Context-cleared details emitted when the host clears the conversation (the session.history.clearContext RPC / Session.clearContextMessages) */ export interface ContextClearedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ContextClearedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.context_cleared". - */ - type: "session.context_cleared"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ContextClearedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.context_cleared". + */ + type: "session.context_cleared"; } /** * Context-cleared details emitted when the host clears the conversation (the session.history.clearContext RPC / Session.clearContextMessages) */ export interface ContextClearedData { - /** - * Optional initial message set after clearing - */ - initialMessage?: string; - /** - * Number of conversation messages that were cleared - */ - messagesCleared: number; + /** + * Optional initial message set after clearing + */ + initialMessage?: string; + /** + * Number of conversation messages that were cleared + */ + messagesCleared: number; } /** * Session event "session.compaction_start". Context window breakdown at the start of LLM-powered conversation compaction */ export interface CompactionStartEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CompactionStartData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.compaction_start". - */ - type: "session.compaction_start"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CompactionStartData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.compaction_start". + */ + type: "session.compaction_start"; } /** * Context window breakdown at the start of LLM-powered conversation compaction */ export interface CompactionStartData { - /** - * Token count from non-system messages (user, assistant, tool) at compaction start - */ - conversationTokens?: number; - /** - * Total context tokens (system + conversation + tool definitions) at compaction start, when known - */ - currentTokens?: number; - /** - * Model identifier used for compaction, when known - */ - model?: string; - /** - * Token count from system message(s) at compaction start - */ - systemTokens?: number; - /** - * Model context window token limit the compaction is targeting, when known - */ - tokenLimit?: number; - /** - * Token count from tool definitions at compaction start - */ - toolDefinitionsTokens?: number; - trigger?: CompactionTrigger; + /** + * Token count from non-system messages (user, assistant, tool) at compaction start + */ + conversationTokens?: number; + /** + * Total context tokens (system + conversation + tool definitions) at compaction start, when known + */ + currentTokens?: number; + /** + * Model identifier used for compaction, when known + */ + model?: string; + /** + * Token count from system message(s) at compaction start + */ + systemTokens?: number; + /** + * Model context window token limit the compaction is targeting, when known + */ + tokenLimit?: number; + /** + * Token count from tool definitions at compaction start + */ + toolDefinitionsTokens?: number; + trigger?: CompactionTrigger; } /** * Session event "session.compaction_complete". Conversation compaction results including success status, metrics, and optional error details */ export interface CompactionCompleteEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CompactionCompleteData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.compaction_complete". - */ - type: "session.compaction_complete"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CompactionCompleteData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.compaction_complete". + */ + type: "session.compaction_complete"; } /** * Conversation compaction results including success status, metrics, and optional error details */ export interface CompactionCompleteData { - /** - * Canonical model identifier used for model-specific behavior when replaying compaction - */ - behaviorModelId?: string; - /** - * Checkpoint snapshot number created for recovery - */ - checkpointNumber?: number; - /** - * File path where the checkpoint was stored - */ - checkpointPath?: string; - compactionTokensUsed?: CompactionCompleteCompactionTokensUsed; - /** - * Token count from non-system messages (user, assistant, tool) after compaction - */ - conversationTokens?: number; - /** - * User-supplied focus instructions provided to a manual `/compact` invocation. Omitted for automatic compaction and for manual compaction with no focus text. - */ - customInstructions?: string; - /** - * Error message if compaction failed - */ - error?: string; - /** - * Number of messages removed during compaction - */ - messagesRemoved?: number; - /** - * Total tokens in conversation after compaction - */ - postCompactionTokens?: number; - /** - * Number of messages before compaction - */ - preCompactionMessagesLength?: number; - /** - * Total tokens in conversation before compaction - */ - preCompactionTokens?: number; - /** - * GitHub request tracing ID (x-github-request-id header) for the compaction LLM call - */ - requestId?: string; - /** - * Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call - */ - serviceRequestId?: string; - /** - * 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). - */ - statusCode?: number; - /** - * Whether compaction completed successfully - */ - success: boolean; - /** - * LLM-generated summary of the compacted conversation history - */ - summaryContent?: string; - /** - * Token count from system message(s) after compaction - */ - systemTokens?: number; - /** - * Model context window token limit the compaction was targeting, when known - */ - tokenLimit?: number; - /** - * Number of tokens removed during compaction - */ - tokensRemoved?: number; - /** - * Token count from tool definitions after compaction - */ - toolDefinitionsTokens?: number; - trigger?: CompactionTrigger; + /** + * Canonical model identifier used for model-specific behavior when replaying compaction + */ + behaviorModelId?: string; + /** + * Checkpoint snapshot number created for recovery + */ + checkpointNumber?: number; + /** + * File path where the checkpoint was stored + */ + checkpointPath?: string; + compactionTokensUsed?: CompactionCompleteCompactionTokensUsed; + /** + * Token count from non-system messages (user, assistant, tool) after compaction + */ + conversationTokens?: number; + /** + * User-supplied focus instructions provided to a manual `/compact` invocation. Omitted for automatic compaction and for manual compaction with no focus text. + */ + customInstructions?: string; + /** + * Error message if compaction failed + */ + error?: string; + /** + * Number of messages removed during compaction + */ + messagesRemoved?: number; + /** + * Total tokens in conversation after compaction + */ + postCompactionTokens?: number; + /** + * Number of messages before compaction + */ + preCompactionMessagesLength?: number; + /** + * Total tokens in conversation before compaction + */ + preCompactionTokens?: number; + /** + * GitHub request tracing ID (x-github-request-id header) for the compaction LLM call + */ + requestId?: string; + /** + * Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call + */ + serviceRequestId?: string; + /** + * 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). + */ + statusCode?: number; + /** + * Whether compaction completed successfully + */ + success: boolean; + /** + * LLM-generated summary of the compacted conversation history + */ + summaryContent?: string; + /** + * Token count from system message(s) after compaction + */ + systemTokens?: number; + /** + * Model context window token limit the compaction was targeting, when known + */ + tokenLimit?: number; + /** + * Number of tokens removed during compaction + */ + tokensRemoved?: number; + /** + * Token count from tool definitions after compaction + */ + toolDefinitionsTokens?: number; + trigger?: CompactionTrigger; } /** * Token usage breakdown for the compaction LLM call (aligned with assistant.usage format) */ export interface CompactionCompleteCompactionTokensUsed { - /** - * Cached input tokens reused in the compaction LLM call - */ - cacheReadTokens?: number; - /** - * Tokens written to prompt cache in the compaction LLM call - */ - cacheWriteTokens?: number; - /** - * Per-request cost and usage data from the CAPI copilot_usage response field - * - * @internal - */ - copilotUsage?: CompactionCompleteCompactionTokensUsedCopilotUsage; - /** - * Duration of the compaction LLM call in milliseconds - */ - duration?: number; - /** - * Input tokens consumed by the compaction LLM call - */ - inputTokens?: number; - /** - * Model identifier used for the compaction LLM call - */ - model?: string; - /** - * Output tokens produced by the compaction LLM call - */ - outputTokens?: number; + /** + * Cached input tokens reused in the compaction LLM call + */ + cacheReadTokens?: number; + /** + * Tokens written to prompt cache in the compaction LLM call + */ + cacheWriteTokens?: number; + /** + * Per-request cost and usage data from the CAPI copilot_usage response field + * + * @internal + */ + copilotUsage?: CompactionCompleteCompactionTokensUsedCopilotUsage; + /** + * Duration of the compaction LLM call in milliseconds + */ + duration?: number; + /** + * Input tokens consumed by the compaction LLM call + */ + inputTokens?: number; + /** + * Model identifier used for the compaction LLM call + */ + model?: string; + /** + * Output tokens produced by the compaction LLM call + */ + outputTokens?: number; } /** * Per-request cost and usage data from the CAPI copilot_usage response field */ /** @internal */ export interface CompactionCompleteCompactionTokensUsedCopilotUsage { - /** - * Itemized token usage breakdown - * - * @internal - */ - tokenDetails?: CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail[]; - /** - * Total cost in nano-AI units for this request - */ - totalNanoAiu: number; + /** + * Itemized token usage breakdown + * + * @internal + */ + tokenDetails?: CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail[]; + /** + * Total cost in nano-AI units for this request + */ + totalNanoAiu: number; } /** * Token usage detail for a single billing category */ export interface CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail { - /** - * Number of tokens in this billing batch - */ - batchSize: number; - /** - * Cost per batch of tokens - */ - costPerBatch: number; - /** - * Total token count for this entry - */ - tokenCount: number; - /** - * Token category (e.g., "input", "output") - */ - tokenType: string; + /** + * Number of tokens in this billing batch + */ + batchSize: number; + /** + * Cost per batch of tokens + */ + costPerBatch: number; + /** + * Total token count for this entry + */ + tokenCount: number; + /** + * Token category (e.g., "input", "output") + */ + tokenType: string; } /** * Session event "session.task_complete". Task completion notification with summary from the agent */ export interface TaskCompleteEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: TaskCompleteData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.task_complete". - */ - type: "session.task_complete"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: TaskCompleteData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.task_complete". + */ + type: "session.task_complete"; } /** * Task completion notification with summary from the agent */ export interface TaskCompleteData { - /** - * Active autopilot objective ID evaluated by the completion reviewer - */ - objectiveId?: number; - outcome?: TaskCompletionOutcome; - /** - * Label-safe runtime rationale for the completion decision (e.g. a cancellation or pause/resume downgrade), when one applies. Reviewer-authored rationale is intentionally omitted here because this event has no IFC label channel; the reviewer's findings remain available through its own labeled sub-agent events - */ - reason?: string; - /** - * Whether the task was accepted as complete. False when validation failed or completion was rejected or blocked by the reviewer - */ - success?: boolean; - /** - * Summary of the completed task, provided by the agent - */ - summary?: string; + /** + * Active autopilot objective ID evaluated by the completion reviewer + */ + objectiveId?: number; + outcome?: TaskCompletionOutcome; + /** + * Label-safe runtime rationale for the completion decision (e.g. a cancellation or pause/resume downgrade), when one applies. Reviewer-authored rationale is intentionally omitted here because this event has no IFC label channel; the reviewer's findings remain available through its own labeled sub-agent events + */ + reason?: string; + /** + * Whether the task was accepted as complete. False when validation failed or completion was rejected or blocked by the reviewer + */ + success?: boolean; + /** + * Summary of the completed task, provided by the agent + */ + summary?: string; } /** * Session event "session.completion_receipt". Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted. */ /** @experimental */ export interface CompletionReceiptEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CompletionReceiptData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.completion_receipt". - */ - type: "session.completion_receipt"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CompletionReceiptData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.completion_receipt". + */ + type: "session.completion_receipt"; } /** * Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted. */ /** @experimental */ export interface CompletionReceiptData { - /** - * One-based accepted completion receipt ordinal in the durable session history. - */ - attempt: number; - eventRange: CompletionReceiptEventRange; - /** - * Number of failed structured tool completions in the covered range. - */ - failedToolCount: number; - finalTool?: CompletionReceiptFinalTool; - /** - * Version of the completion receipt payload. - */ - schemaVersion: number; - /** - * Identifier of the assistant turn-end event that supplied the accepted completion boundary. This is the receipt's idempotency key, and always equals eventRange.endEventId. - */ - sourceEventId: string; - stopReason: CompletionReceiptStopReason; - /** - * Number of successful structured tool completions in the covered range. - */ - successfulToolCount: number; + /** + * One-based accepted completion receipt ordinal in the durable session history. + */ + attempt: number; + eventRange: CompletionReceiptEventRange; + /** + * Number of failed structured tool completions in the covered range. + */ + failedToolCount: number; + finalTool?: CompletionReceiptFinalTool; + /** + * Version of the completion receipt payload. + */ + schemaVersion: number; + /** + * Identifier of the assistant turn-end event that supplied the accepted completion boundary. This is the receipt's idempotency key, and always equals eventRange.endEventId. + */ + sourceEventId: string; + stopReason: CompletionReceiptStopReason; + /** + * Number of successful structured tool completions in the covered range. + */ + successfulToolCount: number; } /** * Inclusive durable event range summarized by a completion receipt. */ export interface CompletionReceiptEventRange { - /** - * Identifier of the assistant turn-end event that ends the covered exchange. Always equals the receipt's sourceEventId, so either field is a valid join key. - */ - endEventId: string; - /** - * Identifier of the user message that starts the covered exchange. - */ - startEventId: string; + /** + * Identifier of the assistant turn-end event that ends the covered exchange. Always equals the receipt's sourceEventId, so either field is a valid join key. + */ + endEventId: string; + /** + * Identifier of the user message that starts the covered exchange. + */ + startEventId: string; } /** * Final structured tool completion in the covered event range. */ export interface CompletionReceiptFinalTool { - /** - * Process exit code from a structured shell result, when available. - */ - exitCode?: number; - status: CompletionReceiptToolStatus; - /** - * Unique identifier of the completed tool call. - */ - toolCallId: string; - /** - * Tool name from the matching tool execution start event, when available. - */ - toolName?: string; + /** + * Process exit code from a structured shell result, when available. + */ + exitCode?: number; + status: CompletionReceiptToolStatus; + /** + * Unique identifier of the completed tool call. + */ + toolCallId: string; + /** + * Tool name from the matching tool execution start event, when available. + */ + toolName?: string; } /** * Session event "session.fusion_route_started". Experimental transient signal that HydraFusion routing has started for an eligible turn. */ /** @experimental */ export interface FusionRouteStartedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FusionRouteStartedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.fusion_route_started". - */ - type: "session.fusion_route_started"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionRouteStartedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.fusion_route_started". + */ + type: "session.fusion_route_started"; } /** * Experimental transient signal that HydraFusion routing has started for an eligible turn. */ /** @experimental */ export interface FusionRouteStartedData { - /** - * Identifier for this routing attempt before a durable Fusion turn exists. - */ - attemptId: string; - /** - * HydraFusion routing policy requested for the turn. - */ - policy?: string; - /** - * Synthetic HydraFusion model selected for the session. - */ - syntheticModel?: string; - turnKind: FusionTurnKind; + /** + * Identifier for this routing attempt before a durable Fusion turn exists. + */ + attemptId: string; + /** + * HydraFusion routing policy requested for the turn. + */ + policy?: string; + /** + * Synthetic HydraFusion model selected for the session. + */ + syntheticModel?: string; + turnKind: FusionTurnKind; } /** * Session event "session.fusion_route_failed". Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn. */ /** @experimental */ export interface FusionRouteFailedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FusionRouteFailedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.fusion_route_failed". - */ - type: "session.fusion_route_failed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionRouteFailedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.fusion_route_failed". + */ + type: "session.fusion_route_failed"; } /** * Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn. */ /** @experimental */ export interface FusionRouteFailedData { - /** - * Identifier of the routing attempt that failed. - */ - attemptId: string; - /** - * Provider or validation error detail, when available. - */ - errorMessage?: string; - /** - * Concrete model selected as the deterministic fallback. - */ - fallbackModel: string; - /** - * HydraFusion routing policy requested for the turn. - */ - policy: string; - /** - * Stable machine-readable reason for the routing failure. - */ - reason: string; - /** - * Elapsed routing time in milliseconds before the failure. - */ - routingLatencyMs?: number; - /** - * Synthetic HydraFusion model selected for the session. - */ - syntheticModel: string; + /** + * Identifier of the routing attempt that failed. + */ + attemptId: string; + /** + * Provider or validation error detail, when available. + */ + errorMessage?: string; + /** + * Concrete model selected as the deterministic fallback. + */ + fallbackModel: string; + /** + * HydraFusion routing policy requested for the turn. + */ + policy: string; + /** + * Stable machine-readable reason for the routing failure. + */ + reason: string; + /** + * Elapsed routing time in milliseconds before the failure. + */ + routingLatencyMs?: number; + /** + * Synthetic HydraFusion model selected for the session. + */ + syntheticModel: string; } /** * Session event "session.fusion_resolved". Experimental durable validated HydraFusion route and turn policy. */ /** @experimental */ export interface FusionResolvedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FusionResolvedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.fusion_resolved". - */ - type: "session.fusion_resolved"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionResolvedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.fusion_resolved". + */ + type: "session.fusion_resolved"; } /** * Experimental durable validated HydraFusion route and turn policy. */ /** @experimental */ export interface FusionResolvedData { - /** - * Version of the validated HydraFusion event contract. - */ - contractVersion: number; - /** - * Concrete model used when the planned primary model cannot execute. - */ - fallbackModel: string; - followUp?: FusionFollowUpRecommendation; - /** - * Concrete model recommended for eligible follow-up turns. - */ - followUpModel: string; - /** - * Stable identifier for the resolved HydraFusion turn. - */ - fusionId: string; - /** - * Version of the executable model universe used for selection. - */ - modelUniverseVersion?: string; - pattern: FusionPattern; - /** - * Presentation-neutral phase plan for clients that render workflow progress. - * - * @experimental - */ - phasePlan?: FusionPhasePlanStep[]; - /** - * Version of the validated execution-plan format. - */ - planVersion?: string; - /** - * HydraFusion routing policy used to resolve the plan. - */ - policy: string; - /** - * Version of the local routing policy. - */ - policyVersion?: string; - /** - * Concrete model selected for the primary solver phase. - */ - primaryModel: string; - /** - * Router implementation that supplied the plan. - */ - routeSource?: string; - /** - * Elapsed time in milliseconds required to resolve and validate the route. - */ - routingLatencyMs?: number; - /** - * Identifier of the local policy rule that matched. - */ - ruleId?: string; - /** - * Zero-based index of the local policy rule that matched. - */ - ruleIndex?: number; - /** - * Human-readable name of the local policy rule that matched. - */ - ruleName?: string; - scores?: FusionScores; - /** - * Concrete model selected for the review or judge phase, when required. - */ - secondaryModel: string | null; - /** - * Synthetic HydraFusion model selected for the session. - */ - syntheticModel: string; - /** - * Identifier of the session turn associated with the route. - */ - turnId: string; + /** + * Version of the validated HydraFusion event contract. + */ + contractVersion: number; + /** + * Concrete model used when the planned primary model cannot execute. + */ + fallbackModel: string; + followUp?: FusionFollowUpRecommendation; + /** + * Concrete model recommended for eligible follow-up turns. + */ + followUpModel: string; + /** + * Stable identifier for the resolved HydraFusion turn. + */ + fusionId: string; + /** + * Version of the executable model universe used for selection. + */ + modelUniverseVersion?: string; + pattern: FusionPattern; + /** + * Presentation-neutral phase plan for clients that render workflow progress. + * + * @experimental + */ + phasePlan?: FusionPhasePlanStep[]; + /** + * Version of the validated execution-plan format. + */ + planVersion?: string; + /** + * HydraFusion routing policy used to resolve the plan. + */ + policy: string; + /** + * Version of the local routing policy. + */ + policyVersion?: string; + /** + * Concrete model selected for the primary solver phase. + */ + primaryModel: string; + /** + * Router implementation that supplied the plan. + */ + routeSource?: string; + /** + * Elapsed time in milliseconds required to resolve and validate the route. + */ + routingLatencyMs?: number; + /** + * Identifier of the local policy rule that matched. + */ + ruleId?: string; + /** + * Zero-based index of the local policy rule that matched. + */ + ruleIndex?: number; + /** + * Human-readable name of the local policy rule that matched. + */ + ruleName?: string; + scores?: FusionScores; + /** + * Concrete model selected for the review or judge phase, when required. + */ + secondaryModel: string | null; + /** + * Synthetic HydraFusion model selected for the session. + */ + syntheticModel: string; + /** + * Identifier of the session turn associated with the route. + */ + turnId: string; } /** * Durable server recommendation for subsequent HydraFusion turns. */ /** @experimental */ export interface FusionFollowUpRecommendation { - compactionTurn: FusionFollowUpAction; - userTurn: FusionFollowUpAction; + compactionTurn: FusionFollowUpAction; + userTurn: FusionFollowUpAction; } /** * Presentation-neutral phase planned for a HydraFusion turn. */ /** @experimental */ export interface FusionPhasePlanStep { - /** - * Whether the phase executes only when an earlier phase requests it. - */ - conditional: boolean; - kind: FusionPhaseKind; - /** - * Semantic role assigned to the phase. - */ - role: string; - scope: FusionConversationScope; + /** + * Whether the phase executes only when an earlier phase requests it. + */ + conditional: boolean; + kind: FusionPhaseKind; + /** + * Semantic role assigned to the phase. + */ + role: string; + scope: FusionConversationScope; } /** * Validated HydraFusion routing capability scores. */ /** @experimental */ export interface FusionScores { - /** - * Code-generation capability score returned by the authenticated router. - */ - codeGen: number; - /** - * Debugging capability score returned by the authenticated router. - */ - debugging: number; - /** - * Reasoning capability score returned by the authenticated router. - */ - reasoning: number; - /** - * Tool-use capability score returned by the authenticated router. - */ - toolUse: number; + /** + * Code-generation capability score returned by the authenticated router. + */ + codeGen: number; + /** + * Debugging capability score returned by the authenticated router. + */ + debugging: number; + /** + * Reasoning capability score returned by the authenticated router. + */ + reasoning: number; + /** + * Tool-use capability score returned by the authenticated router. + */ + toolUse: number; } /** * Session event "session.fusion_completed". Experimental durable aggregate outcome of a HydraFusion turn. */ /** @experimental */ export interface FusionCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FusionCompletedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.fusion_completed". - */ - type: "session.fusion_completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionCompletedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.fusion_completed". + */ + type: "session.fusion_completed"; } /** * Experimental durable aggregate outcome of a HydraFusion turn. */ /** @experimental */ export interface FusionCompletedData { - /** - * Total cached input tokens reported across all phases. - */ - cachedTokens: number; - /** - * Total tokens written to prompt cache across all phases. - */ - cacheWriteTokens?: number; - /** - * Idempotency identifier for the authoritative final commit. - */ - commitId: string; - /** - * Reason the turn used a degraded route, when applicable. - */ - degradedReason: string | null; - /** - * Total elapsed execution time for the HydraFusion turn in milliseconds. - */ - durationMs: number; - /** - * Concrete model that supplied the authoritative final content. - */ - finalSourceModel: string | null; - /** - * Phase whose output supplied the authoritative final content. - */ - finalSourcePhaseId: string | null; - /** - * Concrete model recommended for eligible follow-up turns. - */ - followUpModel: string; - /** - * Stable identifier for the completed HydraFusion turn. - */ - fusionId: string; - /** - * Total input tokens consumed across all phases. - */ - inputTokens: number; - /** - * Stable aggregate outcome of the HydraFusion turn. - */ - outcome: string; - /** - * Total output tokens produced across all phases. - */ - outputTokens: number; - pattern: FusionPattern; - /** - * Number of concrete phases attempted by the turn. - */ - phaseCount: number; - /** - * Total concrete model requests made across all phases. - */ - requestCount: number; - /** - * Synthetic HydraFusion model selected for the session. - */ - syntheticModel: string; - /** - * Total normalized AI-unit cost reported across all phases, in nano-AIU. - */ - totalNanoAiu: number; - /** - * Identifier of the session turn associated with the completion. - */ - turnId: string; + /** + * Total cached input tokens reported across all phases. + */ + cachedTokens: number; + /** + * Total tokens written to prompt cache across all phases. + */ + cacheWriteTokens?: number; + /** + * Idempotency identifier for the authoritative final commit. + */ + commitId: string; + /** + * Reason the turn used a degraded route, when applicable. + */ + degradedReason: string | null; + /** + * Total elapsed execution time for the HydraFusion turn in milliseconds. + */ + durationMs: number; + /** + * Concrete model that supplied the authoritative final content. + */ + finalSourceModel: string | null; + /** + * Phase whose output supplied the authoritative final content. + */ + finalSourcePhaseId: string | null; + /** + * Concrete model recommended for eligible follow-up turns. + */ + followUpModel: string; + /** + * Stable identifier for the completed HydraFusion turn. + */ + fusionId: string; + /** + * Total input tokens consumed across all phases. + */ + inputTokens: number; + /** + * Stable aggregate outcome of the HydraFusion turn. + */ + outcome: string; + /** + * Total output tokens produced across all phases. + */ + outputTokens: number; + pattern: FusionPattern; + /** + * Number of concrete phases attempted by the turn. + */ + phaseCount: number; + /** + * Total concrete model requests made across all phases. + */ + requestCount: number; + /** + * Synthetic HydraFusion model selected for the session. + */ + syntheticModel: string; + /** + * Total normalized AI-unit cost reported across all phases, in nano-AIU. + */ + totalNanoAiu: number; + /** + * Identifier of the session turn associated with the completion. + */ + turnId: string; } /** * Session event "user.message". Payload of `user.message` with displayed and model-transformed content, attachments, source/delivery metadata, mode, and telemetry IDs. */ export interface UserMessageEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: UserMessageData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "user.message". - */ - type: "user.message"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: UserMessageData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "user.message". + */ + type: "user.message"; } /** * Payload of `user.message` with displayed and model-transformed content, attachments, source/delivery metadata, mode, and telemetry IDs. */ export interface UserMessageData { - agentMode?: UserMessageAgentMode; - /** - * Files, selections, or GitHub references attached to the message - */ - attachments?: Attachment[]; - /** - * The user's message text as displayed in the timeline - */ - content: string; - delivery?: UserMessageDelivery; - /** - * CAPI interaction ID for correlating this user message with its turn - */ - interactionId?: string; - /** - * True when this user message was auto-injected by autopilot's continuation loop rather than typed by the user; used to distinguish autopilot-driven turns in telemetry. - */ - isAutopilotContinuation?: boolean; - /** - * Stable identity of the logical user message, matching the ID returned by send and retained by pending queue snapshots - */ - messageId?: string; - /** - * Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit - */ - nativeDocumentPathFallbackPaths?: string[]; - /** - * Parent agent task ID for background telemetry correlated to this user turn - */ - parentAgentTaskId?: string; - /** - * Origin of this message, used for timeline filtering and attribution (e.g., `skill-pdf` for hidden skill injection or `agent-` for an inter-agent prompt) - */ - source?: string; - /** - * Normalized document MIME types that were sent natively instead of through tagged_files XML - */ - supportedNativeDocumentMimeTypes?: string[]; - /** - * Transformed version of the message sent to the model, with XML wrapping, timestamps, and other augmentations for prompt caching - */ - transformedContent?: string; - /** - * The agent-loop turn ID that consumed this message; absent when no agent-loop turn consumed it - */ - turnId?: string; + agentMode?: UserMessageAgentMode; + /** + * Files, selections, or GitHub references attached to the message + */ + attachments?: Attachment[]; + /** + * The user's message text as displayed in the timeline + */ + content: string; + delivery?: UserMessageDelivery; + /** + * CAPI interaction ID for correlating this user message with its turn + */ + interactionId?: string; + /** + * True when this user message was auto-injected by autopilot's continuation loop rather than typed by the user; used to distinguish autopilot-driven turns in telemetry. + */ + isAutopilotContinuation?: boolean; + /** + * Stable identity of the logical user message, matching the ID returned by send and retained by pending queue snapshots + */ + messageId?: string; + /** + * Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit + */ + nativeDocumentPathFallbackPaths?: string[]; + /** + * Parent agent task ID for background telemetry correlated to this user turn + */ + parentAgentTaskId?: string; + /** + * Origin of this message, used for timeline filtering and attribution (e.g., `skill-pdf` for hidden skill injection or `agent-` for an inter-agent prompt) + */ + source?: string; + /** + * Normalized document MIME types that were sent natively instead of through tagged_files XML + */ + supportedNativeDocumentMimeTypes?: string[]; + /** + * Transformed version of the message sent to the model, with XML wrapping, timestamps, and other augmentations for prompt caching + */ + transformedContent?: string; + /** + * The agent-loop turn ID that consumed this message; absent when no agent-loop turn consumed it + */ + turnId?: string; } /** * File attachment */ export interface AttachmentFile { - /** - * Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. "sha256:..."). Absent externally. - */ - assetId?: string; - /** - * Internal: decoded byte length of the attachment's model-facing bytes. Absent externally. - */ - byteLength?: number; - /** - * User-facing display name for the attachment - */ - displayName: string; - lineRange?: AttachmentFileLineRange; - /** - * 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. - */ - mimeType?: string; - omittedReason?: OmittedBinaryOmittedReason; - /** - * Absolute file path - */ - path: string; - /** - * 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). - */ - taggedFilesEntry?: string; - /** - * Attachment type discriminator - */ - type: "file"; + /** + * Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. "sha256:..."). Absent externally. + */ + assetId?: string; + /** + * Internal: decoded byte length of the attachment's model-facing bytes. Absent externally. + */ + byteLength?: number; + /** + * User-facing display name for the attachment + */ + displayName: string; + lineRange?: AttachmentFileLineRange; + /** + * 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. + */ + mimeType?: string; + omittedReason?: OmittedBinaryOmittedReason; + /** + * Absolute file path + */ + path: string; + /** + * 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). + */ + taggedFilesEntry?: string; + /** + * Attachment type discriminator + */ + type: "file"; } /** * Optional line range to scope the attachment to a specific section of the file */ export interface AttachmentFileLineRange { - /** - * End line number (1-based, inclusive) - */ - end: number; - /** - * Start line number (1-based) - */ - start: number; + /** + * End line number (1-based, inclusive) + */ + end: number; + /** + * Start line number (1-based) + */ + start: number; } /** * Directory attachment */ export interface AttachmentDirectory { - /** - * User-facing display name for the attachment - */ - displayName: string; - /** - * Absolute directory path - */ - path: string; - /** - * 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. - */ - taggedFilesEntry?: string; - /** - * Attachment type discriminator - */ - type: "directory"; + /** + * User-facing display name for the attachment + */ + displayName: string; + /** + * Absolute directory path + */ + path: string; + /** + * 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. + */ + taggedFilesEntry?: string; + /** + * Attachment type discriminator + */ + type: "directory"; } /** * Code selection attachment from an editor */ export interface AttachmentSelection { - /** - * User-facing display name for the selection - */ - displayName: string; - /** - * Absolute path to the file containing the selection - */ - filePath: string; - selection: AttachmentSelectionDetails; - /** - * The selected text content - */ - text: string; - /** - * Attachment type discriminator - */ - type: "selection"; + /** + * User-facing display name for the selection + */ + displayName: string; + /** + * Absolute path to the file containing the selection + */ + filePath: string; + selection: AttachmentSelectionDetails; + /** + * The selected text content + */ + text: string; + /** + * Attachment type discriminator + */ + type: "selection"; } /** * Position range of the selection within the file */ export interface AttachmentSelectionDetails { - end: AttachmentSelectionDetailsEnd; - start: AttachmentSelectionDetailsStart; + end: AttachmentSelectionDetailsEnd; + start: AttachmentSelectionDetailsStart; } /** * End position of the selection */ export interface AttachmentSelectionDetailsEnd { - /** - * End character offset within the line (0-based) - */ - character: number; - /** - * End line number (0-based) - */ - line: number; + /** + * End character offset within the line (0-based) + */ + character: number; + /** + * End line number (0-based) + */ + line: number; } /** * Start position of the selection */ export interface AttachmentSelectionDetailsStart { - /** - * Start character offset within the line (0-based) - */ - character: number; - /** - * Start line number (0-based) - */ - line: number; + /** + * Start character offset within the line (0-based) + */ + character: number; + /** + * Start line number (0-based) + */ + line: number; } /** * GitHub issue, pull request, or discussion reference */ export interface AttachmentGitHubReference { - /** - * Issue, pull request, or discussion number - */ - number: number; - referenceType: AttachmentGitHubReferenceType; - /** - * Current state of the referenced item (e.g., open, closed, merged) - */ - state: string; - /** - * Title of the referenced item - */ - title: string; - /** - * Attachment type discriminator - */ - type: "github_reference"; - /** - * URL to the referenced item on GitHub - */ - url: string; + /** + * Issue, pull request, or discussion number + */ + number: number; + referenceType: AttachmentGitHubReferenceType; + /** + * Current state of the referenced item (e.g., open, closed, merged) + */ + state: string; + /** + * Title of the referenced item + */ + title: string; + /** + * Attachment type discriminator + */ + type: "github_reference"; + /** + * URL to the referenced item on GitHub + */ + url: string; } /** * Pointer to a GitHub commit. */ export interface AttachmentGitHubCommit { - /** - * First line of the commit message - */ - message: string; - /** - * Full commit SHA - */ - oid: string; - repo: GitHubRepoRef; - /** - * Attachment type discriminator - */ - type: "github_commit"; - /** - * URL to the commit on GitHub - */ - url: string; + /** + * First line of the commit message + */ + message: string; + /** + * Full commit SHA + */ + oid: string; + repo: GitHubRepoRef; + /** + * Attachment type discriminator + */ + type: "github_commit"; + /** + * URL to the commit on GitHub + */ + url: string; } /** * Pointer to a GitHub repository. */ export interface GitHubRepoRef { - /** - * Numeric GitHub repository id - */ - id?: number; - /** - * Repository name (without owner) - */ - name: string; - /** - * Repository owner login (user or organization) - */ - owner: string; + /** + * Numeric GitHub repository id + */ + id?: number; + /** + * Repository name (without owner) + */ + name: string; + /** + * Repository owner login (user or organization) + */ + owner: string; } /** * Pointer to a GitHub release. */ export interface AttachmentGitHubRelease { - /** - * Human-readable release name - */ - name: string; - repo: GitHubRepoRef; - /** - * Git tag the release is anchored to - */ - tagName: string; - /** - * Attachment type discriminator - */ - type: "github_release"; - /** - * URL to the release on GitHub - */ - url: string; + /** + * Human-readable release name + */ + name: string; + repo: GitHubRepoRef; + /** + * Git tag the release is anchored to + */ + tagName: string; + /** + * Attachment type discriminator + */ + type: "github_release"; + /** + * URL to the release on GitHub + */ + url: string; } /** * Pointer to a GitHub Actions job. */ export interface AttachmentGitHubActionsJob { - /** - * Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs. - */ - conclusion?: string; - /** - * Job id within the workflow run - */ - jobId: number; - /** - * Display name of the job - */ - jobName: string; - repo: GitHubRepoRef; - /** - * Attachment type discriminator - */ - type: "github_actions_job"; - /** - * URL to the job on GitHub - */ - url: string; - /** - * Display name of the workflow the job ran in - */ - workflowName: string; + /** + * Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs. + */ + conclusion?: string; + /** + * Job id within the workflow run + */ + jobId: number; + /** + * Display name of the job + */ + jobName: string; + repo: GitHubRepoRef; + /** + * Attachment type discriminator + */ + type: "github_actions_job"; + /** + * URL to the job on GitHub + */ + url: string; + /** + * Display name of the workflow the job ran in + */ + workflowName: string; } /** * Pointer to a GitHub repository. */ export interface AttachmentGitHubRepository { - /** - * Short description of the repository - */ - description?: string; - /** - * Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied. - */ - ref?: string; - repo: GitHubRepoRef; - /** - * Attachment type discriminator - */ - type: "github_repository"; - /** - * URL to the repository on GitHub - */ - url: string; + /** + * Short description of the repository + */ + description?: string; + /** + * Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied. + */ + ref?: string; + repo: GitHubRepoRef; + /** + * Attachment type discriminator + */ + type: "github_repository"; + /** + * URL to the repository on GitHub + */ + url: string; } /** * Pointer to a single-file diff. At least one of `head` and `base` must be present. */ export interface AttachmentGitHubFileDiff { - base?: AttachmentGitHubFileDiffSide; - head?: AttachmentGitHubFileDiffSide; - /** - * Attachment type discriminator - */ - type: "github_file_diff"; - /** - * URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL) - */ - url: string; + base?: AttachmentGitHubFileDiffSide; + head?: AttachmentGitHubFileDiffSide; + /** + * Attachment type discriminator + */ + type: "github_file_diff"; + /** + * URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL) + */ + url: string; } /** * One side of a file diff (head or base) */ export interface AttachmentGitHubFileDiffSide { - /** - * Repository-relative path to the file - */ - path: string; - /** - * Git ref (branch, tag, or commit SHA) the file is read at - */ - ref: string; - repo: GitHubRepoRef; + /** + * Repository-relative path to the file + */ + path: string; + /** + * Git ref (branch, tag, or commit SHA) the file is read at + */ + ref: string; + repo: GitHubRepoRef; } /** * Pointer to a comparison between two git revisions. */ export interface AttachmentGitHubTreeComparison { - base: AttachmentGitHubTreeComparisonSide; - head: AttachmentGitHubTreeComparisonSide; - /** - * Attachment type discriminator - */ - type: "github_tree_comparison"; - /** - * URL to the comparison on GitHub - */ - url: string; + base: AttachmentGitHubTreeComparisonSide; + head: AttachmentGitHubTreeComparisonSide; + /** + * Attachment type discriminator + */ + type: "github_tree_comparison"; + /** + * URL to the comparison on GitHub + */ + url: string; } /** * One side of a tree comparison (head or base) */ export interface AttachmentGitHubTreeComparisonSide { - repo: GitHubRepoRef; - /** - * Git revision (branch, tag, or commit SHA) - */ - revision: string; + repo: GitHubRepoRef; + /** + * Git revision (branch, tag, or commit SHA) + */ + revision: string; } /** * Generic GitHub URL reference. */ export interface AttachmentGitHubUrl { - /** - * Attachment type discriminator - */ - type: "github_url"; - /** - * URL to the GitHub resource - */ - url: string; + /** + * Attachment type discriminator + */ + type: "github_url"; + /** + * URL to the GitHub resource + */ + url: string; } /** * Pointer to a file in a GitHub repository at a specific ref. */ export interface AttachmentGitHubFile { - /** - * Repository-relative path to the file - */ - path: string; - /** - * Git ref the file is read at (branch, tag, or commit SHA) - */ - ref: string; - repo: GitHubRepoRef; - /** - * Attachment type discriminator - */ - type: "github_file"; - /** - * URL to the file on GitHub - */ - url: string; + /** + * Repository-relative path to the file + */ + path: string; + /** + * Git ref the file is read at (branch, tag, or commit SHA) + */ + ref: string; + repo: GitHubRepoRef; + /** + * Attachment type discriminator + */ + type: "github_file"; + /** + * URL to the file on GitHub + */ + url: string; } /** * Pointer to a line range inside a file in a GitHub repository. */ export interface AttachmentGitHubSnippet { - lineRange: AttachmentFileLineRange; - /** - * Repository-relative path to the file - */ - path: string; - /** - * Git ref the file is read at (branch, tag, or commit SHA) - */ - ref: string; - repo: GitHubRepoRef; - /** - * Attachment type discriminator - */ - type: "github_snippet"; - /** - * URL to the snippet on GitHub (with line anchor) - */ - url: string; + lineRange: AttachmentFileLineRange; + /** + * Repository-relative path to the file + */ + path: string; + /** + * Git ref the file is read at (branch, tag, or commit SHA) + */ + ref: string; + repo: GitHubRepoRef; + /** + * Attachment type discriminator + */ + type: "github_snippet"; + /** + * URL to the snippet on GitHub (with line anchor) + */ + url: string; } /** * Blob attachment with inline base64-encoded data */ export interface AttachmentBlob { - /** - * Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. "sha256:..."). Absent externally. - */ - assetId?: string; - /** - * Internal: decoded byte length of the attachment's model-facing bytes. Absent externally. - */ - byteLength?: number; - /** - * 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. - */ - data?: string; - /** - * User-facing display name for the attachment - */ - displayName?: string; - /** - * MIME type of the inline data - */ - mimeType: string; - omittedReason?: OmittedBinaryOmittedReason; - /** - * Attachment type discriminator - */ - type: "blob"; + /** + * Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. "sha256:..."). Absent externally. + */ + assetId?: string; + /** + * Internal: decoded byte length of the attachment's model-facing bytes. Absent externally. + */ + byteLength?: number; + /** + * 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. + */ + data?: string; + /** + * User-facing display name for the attachment + */ + displayName?: string; + /** + * MIME type of the inline data + */ + mimeType: string; + omittedReason?: OmittedBinaryOmittedReason; + /** + * Attachment type discriminator + */ + type: "blob"; } /** * Structured context contributed by an extension. Composer pills displayed in the host are forwarded back through session.send.attachments, then rendered into the model prompt as an XML block. */ export interface AttachmentExtensionContext { - /** - * Provider-local canvas identifier when the push was bound to a canvas instance - */ - canvasId?: string; - /** - * ISO 8601 timestamp captured by the runtime when the push was accepted - */ - capturedAt: string; - /** - * Owning extension identifier. Runtime-derived from the caller's connection when produced via session.extensions.sendAttachmentsToMessage; preserved verbatim on subsequent transports. - */ - extensionId: string; - /** - * Open canvas instance identifier when the push was bound to a canvas instance - */ - instanceId?: string; - /** - * Caller-supplied JSON payload - */ - payload?: JsonValue; - /** - * Human-readable composer pill label - */ - title: string; - /** - * Attachment type discriminator - */ - type: "extension_context"; + /** + * Provider-local canvas identifier when the push was bound to a canvas instance + */ + canvasId?: string; + /** + * ISO 8601 timestamp captured by the runtime when the push was accepted + */ + capturedAt: string; + /** + * Owning extension identifier. Runtime-derived from the caller's connection when produced via session.extensions.sendAttachmentsToMessage; preserved verbatim on subsequent transports. + */ + extensionId: string; + /** + * Open canvas instance identifier when the push was bound to a canvas instance + */ + instanceId?: string; + /** + * Caller-supplied JSON payload + */ + payload?: JsonValue; + /** + * Human-readable composer pill label + */ + title: string; + /** + * Attachment type discriminator + */ + type: "extension_context"; } /** * Session event "pending_messages.modified". Empty payload; the event signals that the pending message queue has changed */ export interface PendingMessagesModifiedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: PendingMessagesModifiedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "pending_messages.modified". - */ - type: "pending_messages.modified"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: PendingMessagesModifiedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "pending_messages.modified". + */ + type: "pending_messages.modified"; } /** * Empty payload; the event signals that the pending message queue has changed @@ -4144,291 +4216,291 @@ export interface PendingMessagesModifiedData {} * Session event "assistant.turn_start". Turn initialization metadata including identifier and interaction tracking */ export interface AssistantTurnStartEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantTurnStartData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.turn_start". - */ - type: "assistant.turn_start"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantTurnStartData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.turn_start". + */ + type: "assistant.turn_start"; } /** * Turn initialization metadata including identifier and interaction tracking */ export interface AssistantTurnStartData { - /** - * CAPI interaction ID for correlating this turn with upstream telemetry - */ - interactionId?: string; - /** - * Model identifier used for this turn, when known - */ - model?: string; - /** - * Identifier for this turn within the agentic loop, typically a stringified turn number - */ - turnId: string; + /** + * CAPI interaction ID for correlating this turn with upstream telemetry + */ + interactionId?: string; + /** + * Model identifier used for this turn, when known + */ + model?: string; + /** + * Identifier for this turn within the agentic loop, typically a stringified turn number + */ + turnId: string; } /** * Session event "assistant.intent". Agent intent description for current activity or plan */ export interface AssistantIntentEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantIntentData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.intent". - */ - type: "assistant.intent"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantIntentData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.intent". + */ + type: "assistant.intent"; } /** * Agent intent description for current activity or plan */ export interface AssistantIntentData { - /** - * Short description of what the agent is currently doing or planning to do - */ - intent: string; + /** + * Short description of what the agent is currently doing or planning to do + */ + intent: string; } /** * Session event "assistant.fusion_phase_started". Experimental transient HydraFusion phase/model/role signal. */ /** @experimental */ export interface AssistantFusionPhaseStartedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FusionPhaseStartedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.fusion_phase_started". - */ - type: "assistant.fusion_phase_started"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionPhaseStartedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.fusion_phase_started". + */ + type: "assistant.fusion_phase_started"; } /** * Experimental transient HydraFusion phase/model/role signal. */ /** @experimental */ export interface FusionPhaseStartedData { - conversationScope: FusionConversationScope; - /** - * Identifier of the HydraFusion turn containing the phase. - */ - fusionId: string; - /** - * Concrete model executing the phase. - */ - model: string; - pattern: FusionPattern; - /** - * Stable identifier for the concrete phase. - */ - phaseId: string; - phaseKind: FusionPhaseKind; - /** - * Semantic role assigned to the phase. - */ - role: string; + conversationScope: FusionConversationScope; + /** + * Identifier of the HydraFusion turn containing the phase. + */ + fusionId: string; + /** + * Concrete model executing the phase. + */ + model: string; + pattern: FusionPattern; + /** + * Stable identifier for the concrete phase. + */ + phaseId: string; + phaseKind: FusionPhaseKind; + /** + * Semantic role assigned to the phase. + */ + role: string; } /** * Session event "assistant.fusion_phase_activity". Experimental content-safe activity signal for a running HydraFusion phase. */ /** @experimental */ export interface AssistantFusionPhaseActivityEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FusionPhaseActivityData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.fusion_phase_activity". - */ - type: "assistant.fusion_phase_activity"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionPhaseActivityData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.fusion_phase_activity". + */ + type: "assistant.fusion_phase_activity"; } /** * Experimental content-safe activity signal for a running HydraFusion phase. */ /** @experimental */ export interface FusionPhaseActivityData { - activity: FusionPhaseActivityKind; - conversationScope: FusionConversationScope; - /** - * Identifier of the HydraFusion turn containing the phase. - */ - fusionId: string; - pattern: FusionPattern; - /** - * Stable identifier for the concrete phase. - */ - phaseId: string; - phaseKind: FusionPhaseKind; - /** - * Semantic role assigned to the phase. - */ - role: string; - /** - * Opaque hashed correlation token for matching tool-started and tool-completed activity within this Fusion activity stream. It is not the tool call identifier exposed by tool lifecycle events. - */ - toolCallId?: string; - /** - * Cumulative private response bytes observed for this model call. The event never includes response text. - */ - totalResponseSizeBytes?: number; + activity: FusionPhaseActivityKind; + conversationScope: FusionConversationScope; + /** + * Identifier of the HydraFusion turn containing the phase. + */ + fusionId: string; + pattern: FusionPattern; + /** + * Stable identifier for the concrete phase. + */ + phaseId: string; + phaseKind: FusionPhaseKind; + /** + * Semantic role assigned to the phase. + */ + role: string; + /** + * Opaque hashed correlation token for matching tool-started and tool-completed activity within this Fusion activity stream. It is not the tool call identifier exposed by tool lifecycle events. + */ + toolCallId?: string; + /** + * Cumulative private response bytes observed for this model call. The event never includes response text. + */ + totalResponseSizeBytes?: number; } /** * Session event "assistant.fusion_phase_completed". Experimental durable HydraFusion phase output and lossless replay checkpoint. */ /** @experimental */ export interface AssistantFusionPhaseCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FusionPhaseCompletedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.fusion_phase_completed". - */ - type: "assistant.fusion_phase_completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionPhaseCompletedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.fusion_phase_completed". + */ + type: "assistant.fusion_phase_completed"; } /** * Experimental durable HydraFusion phase output and lossless replay checkpoint. */ /** @experimental */ export interface FusionPhaseCompletedData { - /** - * Provider-normalized textual output produced by the phase. - */ - content: string; - conversationScope: FusionConversationScope; - /** - * Elapsed execution time for the phase in milliseconds. - */ - durationMs: number; - /** - * Identifier of the HydraFusion turn containing the phase. - */ - fusionId: string; - /** - * Concrete model that executed the phase. - */ - model: string; - /** - * Stable identifier for the completed phase. - */ - phaseId: string; - phaseKind: FusionPhaseKind; - /** - * Exact provider-normalized message used to reconstruct canonical model history. - * - * @internal - */ - projectionMessage?: JsonValue; - /** - * Projection action for the exact internal message. - * - * @internal - */ - projectionMode?: FusionProjectionMode; - /** - * Semantic role assigned to the completed phase. - */ - role: string; - /** - * Terminal request held outside canonical state until selected by the final commit. - * - * @internal - */ - stagedTerminal?: FusionStagedTerminal; - status: FusionPhaseStatus; - usage: FusionPhaseUsage; - /** - * Structured judge or critic verdict, when the phase produces one. - */ - verdict: string | null; + /** + * Provider-normalized textual output produced by the phase. + */ + content: string; + conversationScope: FusionConversationScope; + /** + * Elapsed execution time for the phase in milliseconds. + */ + durationMs: number; + /** + * Identifier of the HydraFusion turn containing the phase. + */ + fusionId: string; + /** + * Concrete model that executed the phase. + */ + model: string; + /** + * Stable identifier for the completed phase. + */ + phaseId: string; + phaseKind: FusionPhaseKind; + /** + * Exact provider-normalized message used to reconstruct canonical model history. + * + * @internal + */ + projectionMessage?: JsonValue; + /** + * Projection action for the exact internal message. + * + * @internal + */ + projectionMode?: FusionProjectionMode; + /** + * Semantic role assigned to the completed phase. + */ + role: string; + /** + * Terminal request held outside canonical state until selected by the final commit. + * + * @internal + */ + stagedTerminal?: FusionStagedTerminal; + status: FusionPhaseStatus; + usage: FusionPhaseUsage; + /** + * Structured judge or critic verdict, when the phase produces one. + */ + verdict: string | null; } /** * Internal durable terminal request staged by a HydraFusion phase until an idempotent final commit selects it. @@ -4436,2268 +4508,2268 @@ export interface FusionPhaseCompletedData { /** @experimental */ /** @internal */ export interface FusionStagedTerminal { - arguments: string; - assistantMessage: JsonValue; - phaseId: string; - toolCallId: string; - toolName: string; + arguments: string; + assistantMessage: JsonValue; + phaseId: string; + toolCallId: string; + toolName: string; } /** * Aggregate concrete-model usage for one HydraFusion phase. */ /** @experimental */ export interface FusionPhaseUsage { - /** - * Total cached input tokens reported for the phase. - */ - cachedTokens: number; - /** - * Total tokens written to prompt cache during the phase. - */ - cacheWriteTokens?: number; - /** - * Total input tokens consumed by the phase. - */ - inputTokens: number; - /** - * Total output tokens produced by the phase. - */ - outputTokens: number; - /** - * Number of concrete model requests made by the phase. - */ - requestCount: number; - /** - * Total normalized AI-unit cost reported for the phase, in nano-AIU. - */ - totalNanoAiu: number; + /** + * Total cached input tokens reported for the phase. + */ + cachedTokens: number; + /** + * Total tokens written to prompt cache during the phase. + */ + cacheWriteTokens?: number; + /** + * Total input tokens consumed by the phase. + */ + inputTokens: number; + /** + * Total output tokens produced by the phase. + */ + outputTokens: number; + /** + * Number of concrete model requests made by the phase. + */ + requestCount: number; + /** + * Total normalized AI-unit cost reported for the phase, in nano-AIU. + */ + totalNanoAiu: number; } /** * Session event "assistant.fusion_phase_failed". Experimental durable typed HydraFusion phase failure and degradation transition. */ /** @experimental */ export interface AssistantFusionPhaseFailedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FusionPhaseFailedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.fusion_phase_failed". - */ - type: "assistant.fusion_phase_failed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FusionPhaseFailedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.fusion_phase_failed". + */ + type: "assistant.fusion_phase_failed"; } /** * Experimental durable typed HydraFusion phase failure and degradation transition. */ /** @experimental */ export interface FusionPhaseFailedData { - conversationScope: FusionConversationScope; - /** - * Identifier of the fallback phase used to continue the turn after degradation. - */ - degradedToPhaseId?: string; - /** - * Elapsed execution time before the phase failed, in milliseconds. - */ - durationMs: number; - /** - * Provider or execution error detail, when available. - */ - errorMessage?: string; - /** - * Identifier of the HydraFusion turn containing the phase. - */ - fusionId: string; - /** - * Concrete model that attempted the phase. - */ - model: string; - /** - * Stable identifier for the failed phase. - */ - phaseId: string; - phaseKind: FusionPhaseKind; - /** - * Stable machine-readable reason for the phase failure. - */ - reason: string; - /** - * Semantic role assigned to the failed phase. - */ - role: string; - status: FusionPhaseStatus; - usage: FusionPhaseUsage; + conversationScope: FusionConversationScope; + /** + * Identifier of the fallback phase used to continue the turn after degradation. + */ + degradedToPhaseId?: string; + /** + * Elapsed execution time before the phase failed, in milliseconds. + */ + durationMs: number; + /** + * Provider or execution error detail, when available. + */ + errorMessage?: string; + /** + * Identifier of the HydraFusion turn containing the phase. + */ + fusionId: string; + /** + * Concrete model that attempted the phase. + */ + model: string; + /** + * Stable identifier for the failed phase. + */ + phaseId: string; + phaseKind: FusionPhaseKind; + /** + * Stable machine-readable reason for the phase failure. + */ + reason: string; + /** + * Semantic role assigned to the failed phase. + */ + role: string; + status: FusionPhaseStatus; + usage: FusionPhaseUsage; } /** * Session event "assistant.server_tool_progress". Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message */ export interface AssistantServerToolProgressEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantServerToolProgressData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.server_tool_progress". - */ - type: "assistant.server_tool_progress"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantServerToolProgressData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.server_tool_progress". + */ + type: "assistant.server_tool_progress"; } /** * Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message */ export interface AssistantServerToolProgressData { - /** - * Kind of hosted server tool that is running. Only `web_search` is emitted today. - */ - kind: string; - /** - * Position of the hosted tool call in the response output. Stable across the call's lifecycle events (unlike the provider's per-event item id, which CAPI rotates), so the host keys the live in-progress row on it. - */ - outputIndex: number; - /** - * Lifecycle status of the hosted call: `in_progress`, `searching`, or `completed`. - */ - status: string; + /** + * Kind of hosted server tool that is running. Only `web_search` is emitted today. + */ + kind: string; + /** + * Position of the hosted tool call in the response output. Stable across the call's lifecycle events (unlike the provider's per-event item id, which CAPI rotates), so the host keys the live in-progress row on it. + */ + outputIndex: number; + /** + * Lifecycle status of the hosted call: `in_progress`, `searching`, or `completed`. + */ + status: string; } /** * Session event "assistant.reasoning". Assistant reasoning content for timeline display with complete thinking text */ export interface AssistantReasoningEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantReasoningData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.reasoning". - */ - type: "assistant.reasoning"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantReasoningData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.reasoning". + */ + type: "assistant.reasoning"; } /** * Assistant reasoning content for timeline display with complete thinking text */ export interface AssistantReasoningData { - /** - * The complete extended thinking text from the model - */ - content: string; - /** - * Unique identifier for this reasoning block - */ - reasoningId: string; - /** - * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. - */ - rte?: boolean; + /** + * The complete extended thinking text from the model + */ + content: string; + /** + * Unique identifier for this reasoning block + */ + reasoningId: string; + /** + * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. + */ + rte?: boolean; } /** * Session event "assistant.reasoning_delta". Streaming reasoning delta for incremental extended thinking updates */ export interface AssistantReasoningDeltaEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantReasoningDeltaData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.reasoning_delta". - */ - type: "assistant.reasoning_delta"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantReasoningDeltaData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.reasoning_delta". + */ + type: "assistant.reasoning_delta"; } /** * Streaming reasoning delta for incremental extended thinking updates */ export interface AssistantReasoningDeltaData { - /** - * Incremental text chunk to append to the reasoning content - */ - deltaContent: string; - /** - * Reasoning block ID this delta belongs to, matching the corresponding assistant.reasoning event - */ - reasoningId: string; + /** + * Incremental text chunk to append to the reasoning content + */ + deltaContent: string; + /** + * Reasoning block ID this delta belongs to, matching the corresponding assistant.reasoning event + */ + reasoningId: string; } /** * Session event "assistant.tool_call_delta". Streaming tool-call input delta for incremental tool-call updates */ export interface AssistantToolCallDeltaEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantToolCallDeltaData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.tool_call_delta". - */ - type: "assistant.tool_call_delta"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantToolCallDeltaData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.tool_call_delta". + */ + type: "assistant.tool_call_delta"; } /** * Streaming tool-call input delta for incremental tool-call updates */ export interface AssistantToolCallDeltaData { - /** - * Raw provider tool input fragment to append for this tool call. Function/tool-use providers stream serialized JSON argument text (so newlines inside JSON string values may appear as escaped `\n` until the accumulated JSON is parsed); custom tool calls stream raw custom input. - */ - inputDelta: string; - /** - * Tool call ID this delta belongs to, matching the corresponding assistant.message tool request - */ - toolCallId: string; - /** - * Name of the tool being invoked, when known from the stream - */ - toolName?: string; - toolType?: AssistantMessageToolRequestType; + /** + * Raw provider tool input fragment to append for this tool call. Function/tool-use providers stream serialized JSON argument text (so newlines inside JSON string values may appear as escaped `\n` until the accumulated JSON is parsed); custom tool calls stream raw custom input. + */ + inputDelta: string; + /** + * Tool call ID this delta belongs to, matching the corresponding assistant.message tool request + */ + toolCallId: string; + /** + * Name of the tool being invoked, when known from the stream + */ + toolName?: string; + toolType?: AssistantMessageToolRequestType; } /** * Session event "assistant.streaming_delta". Streaming response progress with cumulative byte count */ export interface AssistantStreamingDeltaEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantStreamingDeltaData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.streaming_delta". - */ - type: "assistant.streaming_delta"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantStreamingDeltaData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.streaming_delta". + */ + type: "assistant.streaming_delta"; } /** * Streaming response progress with cumulative byte count */ export interface AssistantStreamingDeltaData { - /** - * Cumulative total bytes received from the streaming response so far - */ - totalResponseSizeBytes: number; + /** + * Cumulative total bytes received from the streaming response so far + */ + totalResponseSizeBytes: number; } /** * Session event "assistant.message". Assistant response containing text content, optional tool requests, and interaction metadata */ export interface AssistantMessageEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantMessageData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.message". - */ - type: "assistant.message"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantMessageData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.message". + */ + type: "assistant.message"; } /** * Assistant response containing text content, optional tool requests, and interaction metadata */ export interface AssistantMessageData { - /** - * Provider's completion / response identifier; shared across all chunks of a single API call. Used to group multi-chunk assistant utterances. - */ - apiCallId?: string; - /** - * Total messages the model call's response was split into, one per reasoning boundary. Absent for a single-message response; the last chunk is the one where chunkIndex is chunkCount - 1. - */ - chunkCount?: number; - /** - * Zero-based position of this message within its model call's response. Absent when the response was not split into chunks. - */ - chunkIndex?: number; - /** - * Provider-agnostic citations linking spans of this message's content to the sources that support them. Experimental; only populated when citation emission is enabled. - * - * @experimental - */ - citations?: Citations; - /** - * Client-minted request id (x-request-id header) echoed by the server. Distinct from requestId (x-github-request-id) and serviceRequestId (x-copilot-service-request-id). - */ - clientRequestId?: string; - /** - * The assistant's text response content - */ - content: string; - /** - * Encrypted reasoning content from OpenAI models. Session-bound and stripped on resume. - */ - encryptedContent?: string; - /** - * Experimental HydraFusion source attribution for this ordinary authoritative assistant message. - * - * @experimental - */ - fusion?: FusionAttribution; - /** - * CAPI interaction ID for correlating this message with upstream telemetry - */ - interactionId?: string; - /** - * Unique identifier for this assistant message - */ - messageId: string; - /** - * Model that produced this assistant message, if known - */ - model?: string; - /** - * Actual output token count from the API response (completion_tokens), used for accurate token accounting - */ - outputTokens?: number; - /** - * @deprecated - * Tool call ID of the parent tool invocation when this event originates from a sub-agent - */ - parentToolCallId?: string; - /** - * Generation phase for phased-output models (e.g., thinking vs. response phases) - */ - phase?: string; - reasoningBlocks?: AssistantMessageReasoningBlocks; - /** - * Opaque/encrypted extended thinking data from Anthropic models. Session-bound and stripped on resume. - */ - reasoningOpaque?: string; - /** - * Readable reasoning text from the model's extended thinking - */ - reasoningText?: string; - /** - * OpenAI-compatible wire field the provider used for reasoning (e.g. reasoning_content/reasoning). Populated only when non-canonical, so the dialect round-trips across turns. - */ - reasoningWireField?: string; - /** - * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs - */ - requestId?: string; - /** - * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. - */ - rte?: boolean; - serverTools?: AssistantMessageServerTools; - /** - * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation - */ - serviceRequestId?: string; - /** - * Tool invocations requested by the assistant in this message - */ - toolRequests?: AssistantMessageToolRequest[]; - /** - * Identifier for the agent loop turn that produced this message, matching the corresponding assistant.turn_start event - */ - turnId?: string; + /** + * Provider's completion / response identifier; shared across all chunks of a single API call. Used to group multi-chunk assistant utterances. + */ + apiCallId?: string; + /** + * Total messages the model call's response was split into, one per reasoning boundary. Absent for a single-message response; the last chunk is the one where chunkIndex is chunkCount - 1. + */ + chunkCount?: number; + /** + * Zero-based position of this message within its model call's response. Absent when the response was not split into chunks. + */ + chunkIndex?: number; + /** + * Provider-agnostic citations linking spans of this message's content to the sources that support them. Experimental; only populated when citation emission is enabled. + * + * @experimental + */ + citations?: Citations; + /** + * Client-minted request id (x-request-id header) echoed by the server. Distinct from requestId (x-github-request-id) and serviceRequestId (x-copilot-service-request-id). + */ + clientRequestId?: string; + /** + * The assistant's text response content + */ + content: string; + /** + * Encrypted reasoning content from OpenAI models. Session-bound and stripped on resume. + */ + encryptedContent?: string; + /** + * Experimental HydraFusion source attribution for this ordinary authoritative assistant message. + * + * @experimental + */ + fusion?: FusionAttribution; + /** + * CAPI interaction ID for correlating this message with upstream telemetry + */ + interactionId?: string; + /** + * Unique identifier for this assistant message + */ + messageId: string; + /** + * Model that produced this assistant message, if known + */ + model?: string; + /** + * Actual output token count from the API response (completion_tokens), used for accurate token accounting + */ + outputTokens?: number; + /** + * @deprecated + * Tool call ID of the parent tool invocation when this event originates from a sub-agent + */ + parentToolCallId?: string; + /** + * Generation phase for phased-output models (e.g., thinking vs. response phases) + */ + phase?: string; + reasoningBlocks?: AssistantMessageReasoningBlocks; + /** + * Opaque/encrypted extended thinking data from Anthropic models. Session-bound and stripped on resume. + */ + reasoningOpaque?: string; + /** + * Readable reasoning text from the model's extended thinking + */ + reasoningText?: string; + /** + * OpenAI-compatible wire field the provider used for reasoning (e.g. reasoning_content/reasoning). Populated only when non-canonical, so the dialect round-trips across turns. + */ + reasoningWireField?: string; + /** + * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs + */ + requestId?: string; + /** + * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. + */ + rte?: boolean; + serverTools?: AssistantMessageServerTools; + /** + * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + */ + serviceRequestId?: string; + /** + * Tool invocations requested by the assistant in this message + */ + toolRequests?: AssistantMessageToolRequest[]; + /** + * Identifier for the agent loop turn that produced this message, matching the corresponding assistant.turn_start event + */ + turnId?: string; } /** * Provider-agnostic citations linking spans of the assistant's response to their supporting sources. */ /** @experimental */ export interface Citations { - /** - * Deduplicated set of sources referenced by the citation spans. - */ - sources: CitationSource[]; - /** - * Spans of generated text annotated with the sources that support them. - */ - spans: CitationSpan[]; + /** + * Deduplicated set of sources referenced by the citation spans. + */ + sources: CitationSource[]; + /** + * Spans of generated text annotated with the sources that support them. + */ + spans: CitationSpan[]; } /** * A source that backs one or more cited spans in the assistant's response. */ /** @experimental */ export interface CitationSource { - /** - * Stable, turn-scoped identifier for this source, referenced by CitationReference.sourceId. - */ - id: string; - /** - * File path relative to the agent's workspace root, when the source is a file. - */ - path?: string; - provider: CitationProvider; - /** - * Human-readable title of the source. - */ - title?: string; - /** - * URL of the source, when it is a web resource. - */ - url?: string; + /** + * Stable, turn-scoped identifier for this source, referenced by CitationReference.sourceId. + */ + id: string; + /** + * File path relative to the agent's workspace root, when the source is a file. + */ + path?: string; + provider: CitationProvider; + /** + * Human-readable title of the source. + */ + title?: string; + /** + * URL of the source, when it is a web resource. + */ + url?: string; } /** * A contiguous span of generated assistant text and the source references that support it. */ /** @experimental */ export interface CitationSpan { - /** - * End offset of the cited span within the final assistant message content (UTF-16 code units, zero-based, exclusive). - */ - endIndex: number; - /** - * The sources that support this span of generated text. - */ - references: CitationReference[]; - /** - * Start offset of the cited span within the final assistant message content (UTF-16 code units, zero-based, inclusive). - */ - startIndex: number; + /** + * End offset of the cited span within the final assistant message content (UTF-16 code units, zero-based, exclusive). + */ + endIndex: number; + /** + * The sources that support this span of generated text. + */ + references: CitationReference[]; + /** + * Start offset of the cited span within the final assistant message content (UTF-16 code units, zero-based, inclusive). + */ + startIndex: number; } /** * A single citation occurrence linking a span of generated text to a supporting source. */ /** @experimental */ export interface CitationReference { - /** - * The exact text from the source that supports the cited span, when provided by the model. - */ - citedText?: string; - location?: CitationLocation; - /** - * Provider-native citation correlation data (e.g. Anthropic search_result_index / document_index), passed through opaquely for debugging and forward compatibility. - */ - providerMetadata?: JsonValue; - /** - * Identifier of the CitationSource this reference points to (CitationSource.id). - */ - sourceId: string; + /** + * The exact text from the source that supports the cited span, when provided by the model. + */ + citedText?: string; + location?: CitationLocation; + /** + * Provider-native citation correlation data (e.g. Anthropic search_result_index / document_index), passed through opaquely for debugging and forward compatibility. + */ + providerMetadata?: JsonValue; + /** + * Identifier of the CitationSource this reference points to (CitationSource.id). + */ + sourceId: string; } /** * A character range within the source's text content. */ /** @experimental */ export interface CitationLocationChar { - /** - * End character offset within the source text (zero-based, exclusive). - */ - endIndex: number; - /** - * Start character offset within the source text (zero-based, inclusive). - */ - startIndex: number; - /** - * Citation location type discriminator - */ - type: "char"; + /** + * End character offset within the source text (zero-based, exclusive). + */ + endIndex: number; + /** + * Start character offset within the source text (zero-based, inclusive). + */ + startIndex: number; + /** + * Citation location type discriminator + */ + type: "char"; } /** * A page range within a paginated source document. */ /** @experimental */ export interface CitationLocationPage { - /** - * Last page number of the cited range (inclusive). - */ - endPage: number; - /** - * First page number of the cited range. - */ - startPage: number; - /** - * Citation location type discriminator - */ - type: "page"; + /** + * Last page number of the cited range (inclusive). + */ + endPage: number; + /** + * First page number of the cited range. + */ + startPage: number; + /** + * Citation location type discriminator + */ + type: "page"; } /** * A content-block range within a structured source document. */ /** @experimental */ export interface CitationLocationBlock { - /** - * Index of the last content block of the cited range (zero-based, exclusive). - */ - endBlock: number; - /** - * Index of the first content block of the cited range (zero-based, inclusive). - */ - startBlock: number; - /** - * Citation location type discriminator - */ - type: "block"; + /** + * Index of the last content block of the cited range (zero-based, exclusive). + */ + endBlock: number; + /** + * Index of the first content block of the cited range (zero-based, inclusive). + */ + startBlock: number; + /** + * Citation location type discriminator + */ + type: "block"; } /** * Experimental attribution linking an ordinary event to the HydraFusion turn, phase, and concrete source that produced it. */ /** @experimental */ export interface FusionAttribution { - /** - * Idempotency identifier for the authoritative commit, when the event belongs to the selected output. - */ - commitId?: string; - /** - * Conversation scope in which the concrete phase executed. - */ - conversationScope?: string; - /** - * Stable identifier for the HydraFusion turn that produced the event. - */ - fusionId: string; - /** - * HydraFusion orchestration pattern selected for the turn. - */ - pattern: string; - /** - * Identifier of the concrete phase that produced the event. - */ - phaseId?: string; - /** - * Kind of concrete phase that produced the event. - */ - phaseKind?: string; - /** - * HydraFusion routing policy used for the turn. - */ - policy: string; - /** - * Semantic role assigned to the concrete phase. - */ - role?: string; - /** - * Concrete model that produced the attributed event. - */ - sourceModel?: string; - /** - * Phase whose output supplied the authoritative content, when different from the executing phase. - */ - sourcePhaseId?: string; - /** - * Synthetic HydraFusion model selected for the session. - */ - syntheticModel: string; + /** + * Idempotency identifier for the authoritative commit, when the event belongs to the selected output. + */ + commitId?: string; + /** + * Conversation scope in which the concrete phase executed. + */ + conversationScope?: string; + /** + * Stable identifier for the HydraFusion turn that produced the event. + */ + fusionId: string; + /** + * HydraFusion orchestration pattern selected for the turn. + */ + pattern: string; + /** + * Identifier of the concrete phase that produced the event. + */ + phaseId?: string; + /** + * Kind of concrete phase that produced the event. + */ + phaseKind?: string; + /** + * HydraFusion routing policy used for the turn. + */ + policy: string; + /** + * Semantic role assigned to the concrete phase. + */ + role?: string; + /** + * Concrete model that produced the attributed event. + */ + sourceModel?: string; + /** + * Phase whose output supplied the authoritative content, when different from the executing phase. + */ + sourcePhaseId?: string; + /** + * Synthetic HydraFusion model selected for the session. + */ + syntheticModel: string; } /** * Neutral provider-tagged reasoning content blocks preserved verbatim for round-tripping */ /** @experimental */ export interface AssistantMessageReasoningBlocks { - /** - * Provider-native reasoning items or content blocks preserved verbatim, in order. A single response can carry several, and provider signatures or identifiers may depend on their exact content and ordering. - */ - blocks?: JsonValue[]; - /** - * Model provider that produced these reasoning blocks. - */ - provider: string; + /** + * Provider-native reasoning items or content blocks preserved verbatim, in order. A single response can carry several, and provider signatures or identifiers may depend on their exact content and ordering. + */ + blocks?: JsonValue[]; + /** + * Model provider that produced these reasoning blocks. + */ + provider: string; } /** * Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping */ /** @experimental */ export interface AssistantMessageServerTools { - /** - * Advisor model identifier associated with the server-tool payload. - */ - advisorModel?: string; - /** - * Provider function-call namespaces keyed by function-call identifier. - */ - functionCallNamespaces?: { - [k: string]: string | undefined; - }; - /** - * Provider-native server-tool call and output items preserved verbatim for replay. - */ - items?: JsonValue[]; - /** - * Model provider that produced this server-tool payload. - */ - provider: string; - /** - * Raw provider content blocks retained for verbatim round-tripping. - */ - rawContentBlocks?: JsonValue[]; + /** + * Advisor model identifier associated with the server-tool payload. + */ + advisorModel?: string; + /** + * Provider function-call namespaces keyed by function-call identifier. + */ + functionCallNamespaces?: { + [k: string]: string | undefined; + }; + /** + * Provider-native server-tool call and output items preserved verbatim for replay. + */ + items?: JsonValue[]; + /** + * Model provider that produced this server-tool payload. + */ + provider: string; + /** + * Raw provider content blocks retained for verbatim round-tripping. + */ + rawContentBlocks?: JsonValue[]; } /** * A tool invocation request from the assistant */ export interface AssistantMessageToolRequest { - /** - * Arguments to pass to the tool, format depends on the tool - */ - arguments?: JsonValue; - caller?: AssistantMessageToolRequestCaller; - /** - * Resolved intention summary describing what this specific call does - */ - intentionSummary?: string | null; - /** - * Name of the MCP server hosting this tool, when the tool is an MCP tool - */ - mcpServerName?: string; - /** - * Original tool name on the MCP server, when the tool is an MCP tool - */ - mcpToolName?: string; - /** - * Name of the tool being invoked - */ - name: string; - /** - * Unique identifier for this tool call - */ - toolCallId: string; - /** - * Human-readable display title for the tool - */ - toolTitle?: string; - type?: AssistantMessageToolRequestType; + /** + * Arguments to pass to the tool, format depends on the tool + */ + arguments?: JsonValue; + caller?: AssistantMessageToolRequestCaller; + /** + * Resolved intention summary describing what this specific call does + */ + intentionSummary?: string | null; + /** + * Name of the MCP server hosting this tool, when the tool is an MCP tool + */ + mcpServerName?: string; + /** + * Original tool name on the MCP server, when the tool is an MCP tool + */ + mcpToolName?: string; + /** + * Name of the tool being invoked + */ + name: string; + /** + * Unique identifier for this tool call + */ + toolCallId: string; + /** + * Human-readable display title for the tool + */ + toolTitle?: string; + type?: AssistantMessageToolRequestType; } /** * Hosted program that requested this client tool call */ export interface AssistantMessageToolRequestCaller { - /** - * Provider-assigned identifier for the hosted caller. - */ - callerId: string; - type: AssistantMessageToolRequestCallerType; + /** + * Provider-assigned identifier for the hosted caller. + */ + callerId: string; + type: AssistantMessageToolRequestCallerType; } /** * Session event "assistant.message_start". Streaming assistant message start metadata */ export interface AssistantMessageStartEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantMessageStartData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.message_start". - */ - type: "assistant.message_start"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantMessageStartData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.message_start". + */ + type: "assistant.message_start"; } /** * Streaming assistant message start metadata */ export interface AssistantMessageStartData { - /** - * Message ID this start event belongs to, matching subsequent deltas and assistant.message - */ - messageId: string; - /** - * Generation phase this message belongs to for phased-output models - */ - phase?: string; + /** + * Message ID this start event belongs to, matching subsequent deltas and assistant.message + */ + messageId: string; + /** + * Generation phase this message belongs to for phased-output models + */ + phase?: string; } /** * Session event "assistant.message_delta". Streaming assistant message delta for incremental response updates */ export interface AssistantMessageDeltaEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantMessageDeltaData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.message_delta". - */ - type: "assistant.message_delta"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantMessageDeltaData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.message_delta". + */ + type: "assistant.message_delta"; } /** * Streaming assistant message delta for incremental response updates */ export interface AssistantMessageDeltaData { - /** - * Incremental text chunk to append to the message content - */ - deltaContent: string; - /** - * Message ID this delta belongs to, matching the corresponding assistant.message event - */ - messageId: string; - /** - * @deprecated - * Tool call ID of the parent tool invocation when this event originates from a sub-agent - */ - parentToolCallId?: string; + /** + * Incremental text chunk to append to the message content + */ + deltaContent: string; + /** + * Message ID this delta belongs to, matching the corresponding assistant.message event + */ + messageId: string; + /** + * @deprecated + * Tool call ID of the parent tool invocation when this event originates from a sub-agent + */ + parentToolCallId?: string; } /** * Session event "assistant.turn_end". Turn completion metadata including the turn identifier */ export interface AssistantTurnEndEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantTurnEndData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.turn_end". - */ - type: "assistant.turn_end"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantTurnEndData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.turn_end". + */ + type: "assistant.turn_end"; } /** * Turn completion metadata including the turn identifier */ export interface AssistantTurnEndData { - /** - * Model identifier used for this turn, when known - */ - model?: string; - /** - * Identifier of the turn that has ended, matching the corresponding assistant.turn_start event - */ - turnId: string; + /** + * Model identifier used for this turn, when known + */ + model?: string; + /** + * Identifier of the turn that has ended, matching the corresponding assistant.turn_start event + */ + turnId: string; } /** * Session event "assistant.idle". Payload emitted whenever the main agent's processing loop goes idle, including while related background work (running agents or in-flight attached shell commands) is still pending and the session-level idle event is therefore deferred */ export interface AssistantIdleEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantIdleData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.idle". - */ - type: "assistant.idle"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantIdleData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.idle". + */ + type: "assistant.idle"; } /** * Payload emitted whenever the main agent's processing loop goes idle, including while related background work (running agents or in-flight attached shell commands) is still pending and the session-level idle event is therefore deferred */ export interface AssistantIdleData { - /** - * True when the preceding agentic loop was cancelled via abort signal - */ - aborted?: boolean; + /** + * True when the preceding agentic loop was cancelled via abort signal + */ + aborted?: boolean; } /** * Session event "assistant.usage". LLM API call usage metrics including tokens, costs, quotas, and billing information */ export interface AssistantUsageEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AssistantUsageData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "assistant.usage". - */ - type: "assistant.usage"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AssistantUsageData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "assistant.usage". + */ + type: "assistant.usage"; } /** * LLM API call usage metrics including tokens, costs, quotas, and billing information */ export interface AssistantUsageData { - /** - * Number of accepted speculative prediction tokens - */ - acceptedPredictionTokens?: number; - /** - * Completion ID from the model provider (e.g., chatcmpl-abc123) - */ - apiCallId?: string; - apiEndpoint?: AssistantUsageApiEndpoint; - /** - * Number of tools available to the model for this call - * - * @internal - */ - availableToolCount?: number; - /** - * Whether the provider reported prompt-cache usage details for this call - * - * @internal - */ - cacheDetailsReported?: boolean; - /** - * Updated prompt-cache expiration for this model call. Present only when the call establishes or refreshes known cache state. - */ - cacheExpiresAt?: string; - /** - * Number of tokens read from prompt cache - */ - cacheReadTokens?: number; - /** - * Effective prompt-cache lifetime in seconds for this call - * - * @internal - */ - cacheTtlSeconds?: number; - /** - * Number of tokens written to prompt cache - */ - cacheWriteTokens?: number; - /** - * Whether the model response was blocked or truncated by content filtering (finish_reason === 'content_filter'). For Anthropic models this corresponds to a 'refusal' stop reason. - */ - contentFilterTriggered?: boolean; - copilotUsage?: AssistantUsageCopilotUsage; - /** - * Model multiplier cost for billing purposes - * - * @experimental - */ - cost?: number; - /** - * Duration of the API call in milliseconds - */ - duration?: number; - /** - * Finish reason reported by the model for this API call (e.g. "stop", "length", "tool_calls", "content_filter"). Normalized to OpenAI vocabulary; for Anthropic models a "refusal" stop reason maps to "content_filter". - */ - finishReason?: string; - /** - * How the prompt-cache frontier was determined for this call - * - * @internal - */ - frontierSource?: string; - /** - * Experimental HydraFusion attribution for this concrete model call's usage. - * - * @experimental - */ - fusion?: FusionAttribution; - /** - * What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls - */ - initiator?: string; - /** - * Number of input tokens consumed - */ - inputTokens?: number; - /** - * Coarse classification of the interaction that produced this call, mirroring the session's per-request agent context (e.g. `conversation-agent`, `conversation-subagent`, `conversation-sampling`, `conversation-background`, `conversation-compaction`, `conversation-user`). Non-billing; lets consumers attribute a model call to a call class (e.g. sub-agent/sidekick) independently of the billing initiator. Absent when the runtime did not classify the request. - */ - interactionType?: string; - /** - * Average inter-token latency in milliseconds. Only available for streaming requests - */ - interTokenLatencyMs?: number; - /** - * Whether Auto mode was selected for this model call - */ - isAuto?: boolean; - /** - * Whether this model call used a bring-your-own-key provider - */ - isByok?: boolean; - /** - * Requested maximum output tokens used for this model call - */ - maxOutputTokens?: number; - /** - * Effective maximum prompt-token limit used for this model call - */ - maxPromptTokens?: number; - /** - * Model identifier used for this API call - */ - model: string; - /** - * Number of tool calls returned by the model - * - * @internal - */ - numToolCalls?: number; - /** - * Number of output tokens produced - */ - outputTokens?: number; - /** - * Time to first observable model output in milliseconds. Includes text, reasoning, and tool-call output; only available for streaming requests that produce observable output. - */ - outputTtftMs?: number; - /** - * @deprecated - * Parent tool call ID when this usage originates from a sub-agent - */ - parentToolCallId?: string; - /** - * GitHub request tracing ID (x-github-request-id header) for server-side log correlation - */ - providerCallId?: string; - /** - * Per-quota resource usage snapshots, keyed by quota identifier - * - * @internal - */ - quotaSnapshots?: { - [k: string]: AssistantUsageQuotaSnapshot | undefined; - }; - /** - * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") - */ - reasoningEffort?: string; - reasoningSummary?: ReasoningSummary; - /** - * Number of output tokens used for reasoning (e.g., chain-of-thought) - */ - reasoningTokens?: number; - /** - * Number of rejected speculative prediction tokens - */ - rejectedPredictionTokens?: number; - /** - * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. - */ - rte?: boolean; - /** - * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation - */ - serviceRequestId?: string; - /** - * Time to first token in milliseconds. Only available for streaming requests - */ - timeToFirstTokenMs?: number; - /** - * Tool-call counts keyed by tool name - * - * @internal - */ - toolCounts?: { - [k: string]: number | undefined; - }; - /** - * Number of tokens used by tool definitions for this call - * - * @internal - */ - toolTokenCount?: number; - transport?: AssistantUsageTransport; + /** + * Number of accepted speculative prediction tokens + */ + acceptedPredictionTokens?: number; + /** + * Completion ID from the model provider (e.g., chatcmpl-abc123) + */ + apiCallId?: string; + apiEndpoint?: AssistantUsageApiEndpoint; + /** + * Number of tools available to the model for this call + * + * @internal + */ + availableToolCount?: number; + /** + * Whether the provider reported prompt-cache usage details for this call + * + * @internal + */ + cacheDetailsReported?: boolean; + /** + * Updated prompt-cache expiration for this model call. Present only when the call establishes or refreshes known cache state. + */ + cacheExpiresAt?: string; + /** + * Number of tokens read from prompt cache + */ + cacheReadTokens?: number; + /** + * Effective prompt-cache lifetime in seconds for this call + * + * @internal + */ + cacheTtlSeconds?: number; + /** + * Number of tokens written to prompt cache + */ + cacheWriteTokens?: number; + /** + * Whether the model response was blocked or truncated by content filtering (finish_reason === 'content_filter'). For Anthropic models this corresponds to a 'refusal' stop reason. + */ + contentFilterTriggered?: boolean; + copilotUsage?: AssistantUsageCopilotUsage; + /** + * Model multiplier cost for billing purposes + * + * @experimental + */ + cost?: number; + /** + * Duration of the API call in milliseconds + */ + duration?: number; + /** + * Finish reason reported by the model for this API call (e.g. "stop", "length", "tool_calls", "content_filter"). Normalized to OpenAI vocabulary; for Anthropic models a "refusal" stop reason maps to "content_filter". + */ + finishReason?: string; + /** + * How the prompt-cache frontier was determined for this call + * + * @internal + */ + frontierSource?: string; + /** + * Experimental HydraFusion attribution for this concrete model call's usage. + * + * @experimental + */ + fusion?: FusionAttribution; + /** + * What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls + */ + initiator?: string; + /** + * Number of input tokens consumed + */ + inputTokens?: number; + /** + * Coarse classification of the interaction that produced this call, mirroring the session's per-request agent context (e.g. `conversation-agent`, `conversation-subagent`, `conversation-sampling`, `conversation-background`, `conversation-compaction`, `conversation-user`). Non-billing; lets consumers attribute a model call to a call class (e.g. sub-agent/sidekick) independently of the billing initiator. Absent when the runtime did not classify the request. + */ + interactionType?: string; + /** + * Average inter-token latency in milliseconds. Only available for streaming requests + */ + interTokenLatencyMs?: number; + /** + * Whether Auto mode was selected for this model call + */ + isAuto?: boolean; + /** + * Whether this model call used a bring-your-own-key provider + */ + isByok?: boolean; + /** + * Requested maximum output tokens used for this model call + */ + maxOutputTokens?: number; + /** + * Effective maximum prompt-token limit used for this model call + */ + maxPromptTokens?: number; + /** + * Model identifier used for this API call + */ + model: string; + /** + * Number of tool calls returned by the model + * + * @internal + */ + numToolCalls?: number; + /** + * Number of output tokens produced + */ + outputTokens?: number; + /** + * Time to first observable model output in milliseconds. Includes text, reasoning, and tool-call output; only available for streaming requests that produce observable output. + */ + outputTtftMs?: number; + /** + * @deprecated + * Parent tool call ID when this usage originates from a sub-agent + */ + parentToolCallId?: string; + /** + * GitHub request tracing ID (x-github-request-id header) for server-side log correlation + */ + providerCallId?: string; + /** + * Per-quota resource usage snapshots, keyed by quota identifier + * + * @internal + */ + quotaSnapshots?: { + [k: string]: AssistantUsageQuotaSnapshot | undefined; + }; + /** + * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max") + */ + reasoningEffort?: string; + reasoningSummary?: ReasoningSummary; + /** + * Number of output tokens used for reasoning (e.g., chain-of-thought) + */ + reasoningTokens?: number; + /** + * Number of rejected speculative prediction tokens + */ + rejectedPredictionTokens?: number; + /** + * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. + */ + rte?: boolean; + /** + * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + */ + serviceRequestId?: string; + /** + * Time to first token in milliseconds. Only available for streaming requests + */ + timeToFirstTokenMs?: number; + /** + * Tool-call counts keyed by tool name + * + * @internal + */ + toolCounts?: { + [k: string]: number | undefined; + }; + /** + * Number of tokens used by tool definitions for this call + * + * @internal + */ + toolTokenCount?: number; + transport?: AssistantUsageTransport; } /** * Per-request cost and usage data from the CAPI copilot_usage response field */ export interface AssistantUsageCopilotUsage { - /** - * Itemized token usage breakdown - * - * @internal - */ - tokenDetails?: AssistantUsageCopilotUsageTokenDetail[]; - /** - * Total cost in nano-AI units for this request - */ - totalNanoAiu: number; + /** + * Itemized token usage breakdown + * + * @internal + */ + tokenDetails?: AssistantUsageCopilotUsageTokenDetail[]; + /** + * Total cost in nano-AI units for this request + */ + totalNanoAiu: number; } /** * Token usage detail for a single billing category */ export interface AssistantUsageCopilotUsageTokenDetail { - /** - * Number of tokens in this billing batch - */ - batchSize: number; - /** - * Cost per batch of tokens - */ - costPerBatch: number; - /** - * Total token count for this entry - */ - tokenCount: number; - /** - * Token category (e.g., "input", "output") - */ - tokenType: string; + /** + * Number of tokens in this billing batch + */ + batchSize: number; + /** + * Cost per batch of tokens + */ + costPerBatch: number; + /** + * Total token count for this entry + */ + tokenCount: number; + /** + * Token category (e.g., "input", "output") + */ + tokenType: string; } /** * Internal per-quota snapshot for assistant usage, including entitlement, consumed requests, overage, reset date, and remaining quota. */ /** @internal */ export interface AssistantUsageQuotaSnapshot { - /** - * Total requests allowed by the entitlement - * - * @internal - */ - entitlementRequests: number; - /** - * Whether the user currently has quota available for use - * - * @internal - */ - hasQuota?: boolean; - /** - * Whether the user has an unlimited usage entitlement - * - * @internal - */ - isUnlimitedEntitlement: boolean; - /** - * Number of additional usage requests made this period - * - * @internal - */ - overage: number; - /** - * Whether additional usage is allowed when quota is exhausted - * - * @internal - */ - overageAllowedWithExhaustedQuota: boolean; - /** - * Pay-as-you-go additional-usage budget cap in AI credits (1 credit = $0.01); present only when CAPI emits a finite value - * - * @internal - */ - overageEntitlement?: number; - /** - * Percentage of quota remaining (0 to 100) - * - * @internal - */ - remainingPercentage: number; - /** - * Date when the quota resets - * - * @internal - */ - resetDate?: string; - /** - * Whether this snapshot uses token-based billing (AI-credits allocation) - * - * @internal - */ - tokenBasedBilling?: boolean; - /** - * Whether usage is still permitted after quota exhaustion - * - * @internal - */ - usageAllowedWithExhaustedQuota: boolean; - /** - * Number of requests already consumed - * - * @internal - */ - usedRequests: number; + /** + * Total requests allowed by the entitlement + * + * @internal + */ + entitlementRequests: number; + /** + * Whether the user currently has quota available for use + * + * @internal + */ + hasQuota?: boolean; + /** + * Whether the user has an unlimited usage entitlement + * + * @internal + */ + isUnlimitedEntitlement: boolean; + /** + * Number of additional usage requests made this period + * + * @internal + */ + overage: number; + /** + * Whether additional usage is allowed when quota is exhausted + * + * @internal + */ + overageAllowedWithExhaustedQuota: boolean; + /** + * Pay-as-you-go additional-usage budget cap in AI credits (1 credit = $0.01); present only when CAPI emits a finite value + * + * @internal + */ + overageEntitlement?: number; + /** + * Percentage of quota remaining (0 to 100) + * + * @internal + */ + remainingPercentage: number; + /** + * Date when the quota resets + * + * @internal + */ + resetDate?: string; + /** + * Whether this snapshot uses token-based billing (AI-credits allocation) + * + * @internal + */ + tokenBasedBilling?: boolean; + /** + * Whether usage is still permitted after quota exhaustion + * + * @internal + */ + usageAllowedWithExhaustedQuota: boolean; + /** + * Number of requests already consumed + * + * @internal + */ + usedRequests: number; } /** * Session event "model.call_failure". Failed LLM API call metadata for telemetry */ export interface ModelCallFailureEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ModelCallFailureData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "model.call_failure". - */ - type: "model.call_failure"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ModelCallFailureData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "model.call_failure". + */ + type: "model.call_failure"; } /** * Failed LLM API call metadata for telemetry */ export interface ModelCallFailureData { - /** - * Completion ID from the model provider (e.g., chatcmpl-abc123) - */ - apiCallId?: string; - apiEndpoint?: AssistantUsageApiEndpoint; - badRequestKind?: ModelCallFailureBadRequestKind; - /** - * Duration of the failed API call in milliseconds - */ - durationMs?: number; - /** - * 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. - */ - errorCode?: string; - /** - * Raw provider/runtime error message for restricted telemetry - */ - errorMessage?: string; - /** - * 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. - */ - errorType?: string; - failureKind?: ModelCallFailureKind; - /** - * Experimental HydraFusion attribution for this failed concrete model call. - * - * @experimental - */ - fusion?: FusionAttribution; - /** - * What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls - */ - initiator?: string; - /** - * Authoritative interaction classification for the failed call, matching `assistant.usage.interactionType` (for example `conversation-agent`, `conversation-subagent`, or `conversation-sampling`). Absent when the producer cannot classify the interaction. - */ - interactionType?: string; - /** - * Whether the session selected Auto mode for the failed call - */ - isAuto?: boolean; - /** - * Whether the failed call used a bring-your-own-key provider - */ - isByok?: boolean; - /** - * Effective maximum output-token limit for the failed call - */ - maxOutputTokens?: number; - /** - * Effective maximum prompt-token limit for the failed call - */ - maxPromptTokens?: number; - /** - * Model identifier used for the failed API call - */ - model?: string; - /** - * GitHub request tracing ID (x-github-request-id header) for server-side log correlation - */ - providerCallId?: string; - /** - * 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. - * - * @internal - */ - quotaSnapshots?: { - [k: string]: AssistantUsageQuotaSnapshot | undefined; - }; - /** - * Reasoning effort level used for the failed model call, if applicable - */ - reasoningEffort?: string; - requestFingerprint?: ModelCallFailureRequestFingerprint; - /** - * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. - */ - rte?: boolean; - /** - * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation - */ - serviceRequestId?: string; - source: ModelCallFailureSource; - /** - * HTTP status code from the failed request - */ - statusCode?: number; - transport?: ModelCallFailureTransport; + /** + * Completion ID from the model provider (e.g., chatcmpl-abc123) + */ + apiCallId?: string; + apiEndpoint?: AssistantUsageApiEndpoint; + badRequestKind?: ModelCallFailureBadRequestKind; + /** + * Duration of the failed API call in milliseconds + */ + durationMs?: number; + /** + * 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. + */ + errorCode?: string; + /** + * Raw provider/runtime error message for restricted telemetry + */ + errorMessage?: string; + /** + * 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. + */ + errorType?: string; + failureKind?: ModelCallFailureKind; + /** + * Experimental HydraFusion attribution for this failed concrete model call. + * + * @experimental + */ + fusion?: FusionAttribution; + /** + * What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls + */ + initiator?: string; + /** + * Authoritative interaction classification for the failed call, matching `assistant.usage.interactionType` (for example `conversation-agent`, `conversation-subagent`, or `conversation-sampling`). Absent when the producer cannot classify the interaction. + */ + interactionType?: string; + /** + * Whether the session selected Auto mode for the failed call + */ + isAuto?: boolean; + /** + * Whether the failed call used a bring-your-own-key provider + */ + isByok?: boolean; + /** + * Effective maximum output-token limit for the failed call + */ + maxOutputTokens?: number; + /** + * Effective maximum prompt-token limit for the failed call + */ + maxPromptTokens?: number; + /** + * Model identifier used for the failed API call + */ + model?: string; + /** + * GitHub request tracing ID (x-github-request-id header) for server-side log correlation + */ + providerCallId?: string; + /** + * 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. + * + * @internal + */ + quotaSnapshots?: { + [k: string]: AssistantUsageQuotaSnapshot | undefined; + }; + /** + * Reasoning effort level used for the failed model call, if applicable + */ + reasoningEffort?: string; + requestFingerprint?: ModelCallFailureRequestFingerprint; + /** + * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. + */ + rte?: boolean; + /** + * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + */ + serviceRequestId?: string; + source: ModelCallFailureSource; + /** + * HTTP status code from the failed request + */ + statusCode?: number; + transport?: ModelCallFailureTransport; } /** * Content-free structural summary of the failing request for diagnosing malformed 4xx calls */ export interface ModelCallFailureRequestFingerprint { - /** - * Total number of image content parts - */ - imagePartCount: number; - /** - * Image parts whose media type cannot be determined (rejected by strict providers) - */ - imagePartsMissingMediaType: number; - /** - * Role of the final message in the request - */ - lastMessageRole?: string; - /** - * Total number of messages in the request - */ - messageCount: number; - /** - * Tool calls whose name is missing or empty (rejected by strict providers) - */ - namelessToolCallCount: number; - /** - * Total number of tool calls across assistant messages - */ - toolCallCount: number; - /** - * Number of "tool" result messages in the request - */ - toolResultMessageCount: number; + /** + * Total number of image content parts + */ + imagePartCount: number; + /** + * Image parts whose media type cannot be determined (rejected by strict providers) + */ + imagePartsMissingMediaType: number; + /** + * Role of the final message in the request + */ + lastMessageRole?: string; + /** + * Total number of messages in the request + */ + messageCount: number; + /** + * Tool calls whose name is missing or empty (rejected by strict providers) + */ + namelessToolCallCount: number; + /** + * Total number of tool calls across assistant messages + */ + toolCallCount: number; + /** + * Number of "tool" result messages in the request + */ + toolResultMessageCount: number; } /** * Session event "model.call_finished". Final lifecycle outcome for one logical model dispatch. A logical dispatch may include internal reconnect or fallback work, so event count is not provider HTTP-request count. */ export interface ModelCallFinishedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ModelCallFinishedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "model.call_finished". - */ - type: "model.call_finished"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ModelCallFinishedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "model.call_finished". + */ + type: "model.call_finished"; } /** * Final lifecycle outcome for one logical model dispatch. A logical dispatch may include internal reconnect or fallback work, so event count is not provider HTTP-request count. */ export interface ModelCallFinishedData { - /** - * Whether an accepted successful response requested the exact name and command semantics of a built-in file edit tool, including an external tool explicitly replacing that built-in name. Absent when the logical dispatch did not produce an accepted response. - */ - containsBuiltInFileEditRequest?: boolean; - /** - * Monotonic elapsed time spent in the logical model dispatch, including any internal transport reconnect or fallback and excluding orchestrator retry backoff, tool execution, confirmations, and post-response processing - */ - dispatchDurationMs: number; - /** - * Version of the built-in file-edit semantic classifier used for this event - */ - editClassifierVersion: number; - /** - * Identifier of the user interaction that owns the model dispatch, matching assistant.turn_start.interactionId when available - */ - interactionId?: string; - outcome: ModelCallFinishedOutcome; - /** - * Agent-loop iteration within the interaction that initiated the model dispatch - */ - turnId: string; + /** + * Whether an accepted successful response requested the exact name and command semantics of a built-in file edit tool, including an external tool explicitly replacing that built-in name. Absent when the logical dispatch did not produce an accepted response. + */ + containsBuiltInFileEditRequest?: boolean; + /** + * Monotonic elapsed time spent in the logical model dispatch, including any internal transport reconnect or fallback and excluding orchestrator retry backoff, tool execution, confirmations, and post-response processing + */ + dispatchDurationMs: number; + /** + * Version of the built-in file-edit semantic classifier used for this event + */ + editClassifierVersion: number; + /** + * Identifier of the user interaction that owns the model dispatch, matching assistant.turn_start.interactionId when available + */ + interactionId?: string; + outcome: ModelCallFinishedOutcome; + /** + * Agent-loop iteration within the interaction that initiated the model dispatch + */ + turnId: string; } /** * Session event "abort". Turn abort information including the reason for termination */ export interface AbortEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AbortData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "abort". - */ - type: "abort"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AbortData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "abort". + */ + type: "abort"; } /** * Turn abort information including the reason for termination */ export interface AbortData { - reason: AbortReason; + reason: AbortReason; } /** * Session event "tool.user_requested". User-initiated tool invocation request with tool name and arguments */ export interface ToolUserRequestedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ToolUserRequestedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "tool.user_requested". - */ - type: "tool.user_requested"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ToolUserRequestedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "tool.user_requested". + */ + type: "tool.user_requested"; } /** * User-initiated tool invocation request with tool name and arguments */ export interface ToolUserRequestedData { - /** - * Arguments for the tool invocation - */ - arguments?: JsonValue; - /** - * Unique identifier for this tool call - */ - toolCallId: string; - /** - * Name of the tool the user wants to invoke - */ - toolName: string; + /** + * Arguments for the tool invocation + */ + arguments?: JsonValue; + /** + * Unique identifier for this tool call + */ + toolCallId: string; + /** + * Name of the tool the user wants to invoke + */ + toolName: string; } /** * Session event "tool.execution_start". Tool execution startup details including MCP server information when applicable */ export interface ToolExecutionStartEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ToolExecutionStartData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "tool.execution_start". - */ - type: "tool.execution_start"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ToolExecutionStartData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "tool.execution_start". + */ + type: "tool.execution_start"; } /** * Tool execution startup details including MCP server information when applicable */ export interface ToolExecutionStartData { - /** - * Arguments passed to the tool - */ - arguments?: JsonValue; - /** - * When true, the tool output should be displayed expanded (verbatim) in the CLI timeline - */ - displayVerbatim?: boolean; - /** - * Experimental HydraFusion attribution for this tool execution. - * - * @experimental - */ - fusion?: FusionAttribution; - /** - * Name of the MCP server hosting this tool, when the tool is an MCP tool - */ - mcpServerName?: string; - /** - * Original tool name on the MCP server, when the tool is an MCP tool - */ - mcpToolName?: string; - /** - * Model identifier that generated this tool call - */ - model?: string; - /** - * @deprecated - * Tool call ID of the parent tool invocation when this event originates from a sub-agent - */ - parentToolCallId?: string; - /** - * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. - */ - rte?: boolean; - shellToolInfo?: ToolExecutionStartShellToolInfo; - /** - * Unique identifier for this tool call - */ - toolCallId: string; - toolDescription?: ToolExecutionStartToolDescription; - /** - * Name of the tool being executed - */ - toolName: string; - /** - * Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event - */ - turnId?: string; + /** + * Arguments passed to the tool + */ + arguments?: JsonValue; + /** + * When true, the tool output should be displayed expanded (verbatim) in the CLI timeline + */ + displayVerbatim?: boolean; + /** + * Experimental HydraFusion attribution for this tool execution. + * + * @experimental + */ + fusion?: FusionAttribution; + /** + * Name of the MCP server hosting this tool, when the tool is an MCP tool + */ + mcpServerName?: string; + /** + * Original tool name on the MCP server, when the tool is an MCP tool + */ + mcpToolName?: string; + /** + * Model identifier that generated this tool call + */ + model?: string; + /** + * @deprecated + * Tool call ID of the parent tool invocation when this event originates from a sub-agent + */ + parentToolCallId?: string; + /** + * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. + */ + rte?: boolean; + shellToolInfo?: ToolExecutionStartShellToolInfo; + /** + * Unique identifier for this tool call + */ + toolCallId: string; + toolDescription?: ToolExecutionStartToolDescription; + /** + * Name of the tool being executed + */ + toolName: string; + /** + * Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event + */ + turnId?: string; } /** * Shell-aware path hints for a shell tool's command, captured at start time so consumers can snapshot a file's pre-image before the tool runs. */ export interface ToolExecutionStartShellToolInfo { - /** - * The command with a redundant leading `cd` into the working directory removed, present only when there was one to remove. Computed with the same routine the shell driver applies before spawning, so a surface that renders this shows the text that actually runs. Consumers that display it should keep the original tool arguments available on demand. - * - * @experimental - */ - displayCommand?: string; - /** - * Whether the command includes a file write redirection (e.g., > or >>). - */ - hasWriteFileRedirection: boolean; - /** - * File paths the command may read or write, derived from the command at start time. Produced by the same shell-aware extractor as PermissionRequestShell.possiblePaths, so it is present even when the command is auto-approved and no permission request fires. - */ - possiblePaths: string[]; + /** + * The command with a redundant leading `cd` into the working directory removed, present only when there was one to remove. Computed with the same routine the shell driver applies before spawning, so a surface that renders this shows the text that actually runs. Consumers that display it should keep the original tool arguments available on demand. + * + * @experimental + */ + displayCommand?: string; + /** + * Whether the command includes a file write redirection (e.g., > or >>). + */ + hasWriteFileRedirection: boolean; + /** + * File paths the command may read or write, derived from the command at start time. Produced by the same shell-aware extractor as PermissionRequestShell.possiblePaths, so it is present even when the command is auto-approved and no permission request fires. + */ + possiblePaths: string[]; } /** * Tool definition metadata, present for MCP tools with MCP Apps support */ export interface ToolExecutionStartToolDescription { - _meta?: ToolExecutionStartToolDescriptionMeta; - /** - * Tool description - */ - description?: string; - /** - * Tool name - */ - name: string; + _meta?: ToolExecutionStartToolDescriptionMeta; + /** + * Tool description + */ + description?: string; + /** + * Tool name + */ + name: string; } /** * MCP Apps metadata for UI resource association */ export interface ToolExecutionStartToolDescriptionMeta { - ui?: ToolExecutionStartToolDescriptionMetaUI; + ui?: ToolExecutionStartToolDescriptionMetaUI; } /** * MCP Apps tool `_meta.ui` resource URI and visibility captured on `tool.execution_start`. */ export interface ToolExecutionStartToolDescriptionMetaUI { - /** - * URI of the UI resource - */ - resourceUri?: string; - /** - * Who can access this tool - */ - visibility?: ToolExecutionStartToolDescriptionMetaUIVisibility[]; + /** + * URI of the UI resource + */ + resourceUri?: string; + /** + * Who can access this tool + */ + visibility?: ToolExecutionStartToolDescriptionMetaUIVisibility[]; } /** * Session event "tool.execution_partial_result". Streaming tool execution output for incremental result display */ export interface ToolExecutionPartialResultEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ToolExecutionPartialData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "tool.execution_partial_result". - */ - type: "tool.execution_partial_result"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ToolExecutionPartialData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "tool.execution_partial_result". + */ + type: "tool.execution_partial_result"; } /** * Streaming tool execution output for incremental result display */ export interface ToolExecutionPartialData { - /** - * Incremental output chunk from the running tool - */ - partialOutput: string; - /** - * Tool call ID this partial result belongs to - */ - toolCallId: string; + /** + * Incremental output chunk from the running tool + */ + partialOutput: string; + /** + * Tool call ID this partial result belongs to + */ + toolCallId: string; } /** * Session event "tool.execution_progress". Tool execution progress notification with status message */ export interface ToolExecutionProgressEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ToolExecutionProgressData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "tool.execution_progress". - */ - type: "tool.execution_progress"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ToolExecutionProgressData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "tool.execution_progress". + */ + type: "tool.execution_progress"; } /** * Tool execution progress notification with status message */ export interface ToolExecutionProgressData { - /** - * Human-readable progress status message (e.g., from an MCP server) - */ - progressMessage: string; - /** - * Tool call ID this progress notification belongs to - */ - toolCallId: string; + /** + * Human-readable progress status message (e.g., from an MCP server) + */ + progressMessage: string; + /** + * Tool call ID this progress notification belongs to + */ + toolCallId: string; } /** * Session event "tool.execution_complete". Tool execution completion results including success status, detailed output, and error information */ export interface ToolExecutionCompleteEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ToolExecutionCompleteData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "tool.execution_complete". - */ - type: "tool.execution_complete"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ToolExecutionCompleteData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "tool.execution_complete". + */ + type: "tool.execution_complete"; } /** * Tool execution completion results including success status, detailed output, and error information */ export interface ToolExecutionCompleteData { - error?: ToolExecutionCompleteError; - /** - * Experimental HydraFusion attribution for this tool completion. - * - * @experimental - */ - fusion?: FusionAttribution; - /** - * CAPI interaction ID for correlating this tool execution with upstream telemetry - */ - interactionId?: string; - /** - * Whether this tool call was explicitly requested by the user rather than the assistant - */ - isUserRequested?: boolean; - /** - * FIDES IFC label projected from tool ingress metadata (MCP `CallToolResult._meta` or synthesized built-in ingress labels). Persisted as `{ ifc: ... }` so the label survives session resume, including model-visible failure results. Experimental. - * - * @experimental - */ - mcpMeta?: JsonValue; - /** - * Model identifier that generated this tool call - */ - model?: string; - /** - * @deprecated - * Tool call ID of the parent tool invocation when this event originates from a sub-agent - */ - parentToolCallId?: string; - result?: ToolExecutionCompleteResult; - /** - * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. - */ - rte?: boolean; - /** - * Whether this tool execution ran inside a sandbox container - */ - sandboxed?: boolean; - /** - * Whether the tool execution completed successfully - */ - success: boolean; - /** - * Unique identifier for the completed tool call - */ - toolCallId: string; - toolDescription?: ToolExecutionCompleteToolDescription; - /** - * Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts) - */ - toolTelemetry?: { - [k: string]: JsonValue | undefined; - }; - /** - * Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event - */ - turnId?: string; + error?: ToolExecutionCompleteError; + /** + * Experimental HydraFusion attribution for this tool completion. + * + * @experimental + */ + fusion?: FusionAttribution; + /** + * CAPI interaction ID for correlating this tool execution with upstream telemetry + */ + interactionId?: string; + /** + * Whether this tool call was explicitly requested by the user rather than the assistant + */ + isUserRequested?: boolean; + /** + * FIDES IFC label projected from tool ingress metadata (MCP `CallToolResult._meta` or synthesized built-in ingress labels). Persisted as `{ ifc: ... }` so the label survives session resume, including model-visible failure results. Experimental. + * + * @experimental + */ + mcpMeta?: JsonValue; + /** + * Model identifier that generated this tool call + */ + model?: string; + /** + * @deprecated + * Tool call ID of the parent tool invocation when this event originates from a sub-agent + */ + parentToolCallId?: string; + result?: ToolExecutionCompleteResult; + /** + * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable. + */ + rte?: boolean; + /** + * Whether this tool execution ran inside a sandbox container + */ + sandboxed?: boolean; + /** + * Whether the tool execution completed successfully + */ + success: boolean; + /** + * Unique identifier for the completed tool call + */ + toolCallId: string; + toolDescription?: ToolExecutionCompleteToolDescription; + /** + * Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts) + */ + toolTelemetry?: { + [k: string]: JsonValue | undefined; + }; + /** + * Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event + */ + turnId?: string; } /** * Error details when the tool execution failed */ export interface ToolExecutionCompleteError { - /** - * Machine-readable error code - */ - code?: string; - /** - * Human-readable error message - */ - message: string; + /** + * Machine-readable error code + */ + code?: string; + /** + * Human-readable error message + */ + message: string; } /** * Tool execution result on success */ export interface ToolExecutionCompleteResult { - /** - * Model-facing binary results (base64 inline or size-omitted markers) sent to the LLM for this tool call - * - * @experimental - */ - binaryResultsForLlm?: PersistedBinaryResult[]; - /** - * Provider-neutral source material this tool makes available to the model as citable content. Persisted so it survives session resume. Experimental. - * - * @experimental - */ - citableSources?: CitableSource[]; - /** - * Concise tool result text sent to the LLM for chat completion, potentially truncated for token efficiency - */ - content: string; - /** - * Structured content blocks (text, images, audio, resources) returned by the tool in their native format - */ - contents?: ToolExecutionCompleteContent[]; - /** - * Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent. - */ - detailedContent?: string; - /** - * FIDES IFC label projected from tool ingress metadata (MCP `CallToolResult._meta` or synthesized built-in ingress labels) — persisted as `{ ifc: ... }` (only the `ifc` key, not the whole `_meta`). Persisted so the FIDES IFC label survives session resume: the engine rehydrates accumulated taint by replaying these on load. Populated for ingress sources when FIDES IFC is on. Experimental. - * - * @experimental - */ - mcpMeta?: JsonValue; - /** - * Structured content (arbitrary JSON) returned verbatim by the MCP tool - */ - structuredContent?: JsonValue; - uiResource?: ToolExecutionCompleteUIResource; + /** + * Model-facing binary results (base64 inline or size-omitted markers) sent to the LLM for this tool call + * + * @experimental + */ + binaryResultsForLlm?: PersistedBinaryResult[]; + /** + * Provider-neutral source material this tool makes available to the model as citable content. Persisted so it survives session resume. Experimental. + * + * @experimental + */ + citableSources?: CitableSource[]; + /** + * Concise tool result text sent to the LLM for chat completion, potentially truncated for token efficiency + */ + content: string; + /** + * Structured content blocks (text, images, audio, resources) returned by the tool in their native format + */ + contents?: ToolExecutionCompleteContent[]; + /** + * Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent. + */ + detailedContent?: string; + /** + * FIDES IFC label projected from tool ingress metadata (MCP `CallToolResult._meta` or synthesized built-in ingress labels) — persisted as `{ ifc: ... }` (only the `ifc` key, not the whole `_meta`). Persisted so the FIDES IFC label survives session resume: the engine rehydrates accumulated taint by replaying these on load. Populated for ingress sources when FIDES IFC is on. Experimental. + * + * @experimental + */ + mcpMeta?: JsonValue; + /** + * Structured content (arbitrary JSON) returned verbatim by the MCP tool + */ + structuredContent?: JsonValue; + uiResource?: ToolExecutionCompleteUIResource; } /** * Binary result returned by a tool for the model */ export interface PersistedBinaryImage { - /** - * Base64-encoded binary data - */ - data: string; - /** - * Human-readable description of the binary data - */ - description?: string; - /** - * Optional metadata from the producing tool. - */ - metadata?: { - [k: string]: JsonValue | undefined; - }; - /** - * MIME type of the binary data - */ - mimeType: string; - type: PersistedBinaryImageType; + /** + * Base64-encoded binary data + */ + data: string; + /** + * Human-readable description of the binary data + */ + description?: string; + /** + * Optional metadata from the producing tool. + */ + metadata?: { + [k: string]: JsonValue | undefined; + }; + /** + * MIME type of the binary data + */ + mimeType: string; + type: PersistedBinaryImageType; } /** * A binary result whose data was omitted from persistence due to the inline size limit */ /** @experimental */ export interface OmittedBinaryResult { - /** - * Decoded byte length of the omitted binary data - */ - byteLength: number; - /** - * Human-readable description of the binary data - */ - description?: string; - /** - * Optional metadata from the producing tool. - */ - metadata?: { - [k: string]: JsonValue | undefined; - }; - /** - * MIME type of the omitted binary data - */ - mimeType: string; - omittedReason: OmittedBinaryOmittedReason; - type: OmittedBinaryType; + /** + * Decoded byte length of the omitted binary data + */ + byteLength: number; + /** + * Human-readable description of the binary data + */ + description?: string; + /** + * Optional metadata from the producing tool. + */ + metadata?: { + [k: string]: JsonValue | undefined; + }; + /** + * MIME type of the omitted binary data + */ + mimeType: string; + omittedReason: OmittedBinaryOmittedReason; + type: OmittedBinaryType; } /** * A reference to binary data persisted once on a session.binary_asset event and shared by id */ /** @experimental */ export interface BinaryAssetReference { - /** - * Content-addressed id of the session.binary_asset event that holds this binary's bytes (e.g. "sha256:..."). - */ - assetId: string; - /** - * Decoded byte length of the referenced binary data - */ - byteLength: number; - /** - * Human-readable description of the binary data - */ - description?: string; - /** - * Optional metadata from the producing tool. - */ - metadata?: { - [k: string]: JsonValue | undefined; - }; - /** - * MIME type of the referenced binary data - */ - mimeType: string; - type: BinaryAssetReferenceType; + /** + * Content-addressed id of the session.binary_asset event that holds this binary's bytes (e.g. "sha256:..."). + */ + assetId: string; + /** + * Decoded byte length of the referenced binary data + */ + byteLength: number; + /** + * Human-readable description of the binary data + */ + description?: string; + /** + * Optional metadata from the producing tool. + */ + metadata?: { + [k: string]: JsonValue | undefined; + }; + /** + * MIME type of the referenced binary data + */ + mimeType: string; + type: BinaryAssetReferenceType; } /** * A source supplied by a tool that should be made available to the model as citable content. */ /** @experimental */ export interface CitableSource { - /** - * The source text made available to the model as citable content. - */ - content: string; - /** - * 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. - */ - id: string; - /** - * File path relative to the agent's workspace root, when the source is a file. - */ - path?: string; - /** - * Human-readable title of the source. - */ - title?: string; - /** - * URL of the source, when it is a web resource. - */ - url?: string; + /** + * The source text made available to the model as citable content. + */ + content: string; + /** + * 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. + */ + id: string; + /** + * File path relative to the agent's workspace root, when the source is a file. + */ + path?: string; + /** + * Human-readable title of the source. + */ + title?: string; + /** + * URL of the source, when it is a web resource. + */ + url?: string; } /** * Plain text content block */ export interface ToolExecutionCompleteContentText { - /** - * The text content - */ - text: string; - /** - * Content block type discriminator - */ - type: "text"; + /** + * The text content + */ + text: string; + /** + * Content block type discriminator + */ + type: "text"; } /** * @deprecated * Deprecated for shell command exit metadata. Use ToolExecutionCompleteContentShellExit instead. */ export interface ToolExecutionCompleteContentTerminal { - /** - * Working directory where the command was executed - */ - cwd?: string; - /** - * Process exit code, if the command has completed - */ - exitCode?: number; - /** - * Terminal/shell output text - */ - text: string; - /** - * Content block type discriminator - */ - type: "terminal"; + /** + * Working directory where the command was executed + */ + cwd?: string; + /** + * Process exit code, if the command has completed + */ + exitCode?: number; + /** + * Terminal/shell output text + */ + text: string; + /** + * Content block type discriminator + */ + type: "terminal"; } /** * Shell command exit metadata with optional output preview */ export interface ToolExecutionCompleteContentShellExit { - /** - * Working directory where the shell command was executed - */ - cwd?: string; - /** - * Exit code from the completed shell command - */ - exitCode: number; - /** - * Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. - */ - outputFilePath?: string; - /** - * Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. - */ - outputPreview?: string; - /** - * Whether outputPreview is known to be incomplete or truncated - */ - outputTruncated?: boolean; - /** - * Shell id, as assigned by Copilot runtime - */ - shellId: string; - /** - * Content block type discriminator - */ - type: "shell_exit"; + /** + * Working directory where the shell command was executed + */ + cwd?: string; + /** + * Exit code from the completed shell command + */ + exitCode: number; + /** + * Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold. + */ + outputFilePath?: string; + /** + * Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output. + */ + outputPreview?: string; + /** + * Whether outputPreview is known to be incomplete or truncated + */ + outputTruncated?: boolean; + /** + * Shell id, as assigned by Copilot runtime + */ + shellId: string; + /** + * Content block type discriminator + */ + type: "shell_exit"; } /** * Image content block with base64-encoded data */ export interface ToolExecutionCompleteContentImage { - /** - * Base64-encoded image data - */ - data: string; - /** - * MIME type of the image (e.g., image/png, image/jpeg) - */ - mimeType: string; - /** - * Content block type discriminator - */ - type: "image"; + /** + * Base64-encoded image data + */ + data: string; + /** + * MIME type of the image (e.g., image/png, image/jpeg) + */ + mimeType: string; + /** + * Content block type discriminator + */ + type: "image"; } /** * Audio content block with base64-encoded data */ export interface ToolExecutionCompleteContentAudio { - /** - * Base64-encoded audio data - */ - data: string; - /** - * MIME type of the audio (e.g., audio/wav, audio/mpeg) - */ - mimeType: string; - /** - * Content block type discriminator - */ - type: "audio"; + /** + * Base64-encoded audio data + */ + data: string; + /** + * MIME type of the audio (e.g., audio/wav, audio/mpeg) + */ + mimeType: string; + /** + * Content block type discriminator + */ + type: "audio"; } /** * Resource link content block referencing an external resource */ export interface ToolExecutionCompleteContentResourceLink { - /** - * Human-readable description of the resource - */ - description?: string; - /** - * Icons associated with this resource - */ - icons?: ToolExecutionCompleteContentResourceLinkIcon[]; - /** - * MIME type of the resource content - */ - mimeType?: string; - /** - * Resource name identifier - */ - name: string; - /** - * Size of the resource in bytes - */ - size?: number; - /** - * Human-readable display title for the resource - */ - title?: string; - /** - * Content block type discriminator - */ - type: "resource_link"; - /** - * URI identifying the resource - */ - uri: string; + /** + * Human-readable description of the resource + */ + description?: string; + /** + * Icons associated with this resource + */ + icons?: ToolExecutionCompleteContentResourceLinkIcon[]; + /** + * MIME type of the resource content + */ + mimeType?: string; + /** + * Resource name identifier + */ + name: string; + /** + * Size of the resource in bytes + */ + size?: number; + /** + * Human-readable display title for the resource + */ + title?: string; + /** + * Content block type discriminator + */ + type: "resource_link"; + /** + * URI identifying the resource + */ + uri: string; } /** * Icon image for a resource */ export interface ToolExecutionCompleteContentResourceLinkIcon { - /** - * MIME type of the icon image - */ - mimeType?: string; - /** - * Available icon sizes (e.g., ['16x16', '32x32']) - */ - sizes?: string[]; - /** - * URL or path to the icon image - */ - src: string; - theme?: ToolExecutionCompleteContentResourceLinkIconTheme; + /** + * MIME type of the icon image + */ + mimeType?: string; + /** + * Available icon sizes (e.g., ['16x16', '32x32']) + */ + sizes?: string[]; + /** + * URL or path to the icon image + */ + src: string; + theme?: ToolExecutionCompleteContentResourceLinkIconTheme; } /** * Embedded resource content block with inline text or binary data */ export interface ToolExecutionCompleteContentResource { - resource: ToolExecutionCompleteContentResourceDetails; - /** - * Content block type discriminator - */ - type: "resource"; + resource: ToolExecutionCompleteContentResourceDetails; + /** + * Content block type discriminator + */ + type: "resource"; } /** * Embedded text resource contents identified by a URI, with an optional MIME type and a text payload. */ export interface EmbeddedTextResourceContents { - /** - * MIME type of the text content - */ - mimeType?: string; - /** - * Text content of the resource - */ - text: string; - /** - * URI identifying the resource - */ - uri: string; + /** + * MIME type of the text content + */ + mimeType?: string; + /** + * Text content of the resource + */ + text: string; + /** + * URI identifying the resource + */ + uri: string; } /** * Embedded binary resource contents identified by a URI, with an optional MIME type and a base64-encoded blob. */ export interface EmbeddedBlobResourceContents { - /** - * Base64-encoded binary content of the resource - */ - blob: string; - /** - * MIME type of the blob content - */ - mimeType?: string; - /** - * URI identifying the resource - */ - uri: string; + /** + * Base64-encoded binary content of the resource + */ + blob: string; + /** + * MIME type of the blob content + */ + mimeType?: string; + /** + * URI identifying the resource + */ + uri: string; } /** * MCP Apps UI resource content for rendering in a sandboxed iframe */ export interface ToolExecutionCompleteUIResource { - _meta?: ToolExecutionCompleteUIResourceMeta; - /** - * Base64-encoded HTML content - */ - blob?: string; - /** - * MIME type of the content - */ - mimeType: string; - /** - * HTML content as a string - */ - text?: string; - /** - * The ui:// URI of the resource - */ - uri: string; + _meta?: ToolExecutionCompleteUIResourceMeta; + /** + * Base64-encoded HTML content + */ + blob?: string; + /** + * MIME type of the content + */ + mimeType: string; + /** + * HTML content as a string + */ + text?: string; + /** + * The ui:// URI of the resource + */ + uri: string; } /** * Resource-level UI metadata (CSP, permissions, visual preferences) */ export interface ToolExecutionCompleteUIResourceMeta { - ui?: ToolExecutionCompleteUIResourceMetaUI; + ui?: ToolExecutionCompleteUIResourceMetaUI; } /** * MCP Apps UI resource metadata for a completed tool result, including CSP, permissions, domain, and border preference. */ export interface ToolExecutionCompleteUIResourceMetaUI { - csp?: ToolExecutionCompleteUIResourceMetaUICsp; - /** - * Optional dedicated origin for the rendered MCP Apps UI resource. - */ - domain?: string; - permissions?: ToolExecutionCompleteUIResourceMetaUIPermissions; - /** - * Whether the host should render a border around the MCP Apps UI resource. - */ - prefersBorder?: boolean; + csp?: ToolExecutionCompleteUIResourceMetaUICsp; + /** + * Optional dedicated origin for the rendered MCP Apps UI resource. + */ + domain?: string; + permissions?: ToolExecutionCompleteUIResourceMetaUIPermissions; + /** + * Whether the host should render a border around the MCP Apps UI resource. + */ + prefersBorder?: boolean; } /** * CSP domain allowlists for an MCP Apps UI resource, including connect, resource, frame, and base URI domains. */ export interface ToolExecutionCompleteUIResourceMetaUICsp { - /** - * Domains the UI resource may use as document base URIs. - */ - baseUriDomains?: string[]; - /** - * Domains the UI resource may connect to. - */ - connectDomains?: string[]; - /** - * Domains the UI resource may embed as nested frames. - */ - frameDomains?: string[]; - /** - * Domains from which the UI resource may load scripts, styles, images, and other resources. - */ - resourceDomains?: string[]; + /** + * Domains the UI resource may use as document base URIs. + */ + baseUriDomains?: string[]; + /** + * Domains the UI resource may connect to. + */ + connectDomains?: string[]; + /** + * Domains the UI resource may embed as nested frames. + */ + frameDomains?: string[]; + /** + * Domains from which the UI resource may load scripts, styles, images, and other resources. + */ + resourceDomains?: string[]; } /** * Browser permission metadata for an MCP Apps UI resource, including camera, microphone, geolocation, and clipboard-write. */ export interface ToolExecutionCompleteUIResourceMetaUIPermissions { - camera?: ToolExecutionCompleteUIResourceMetaUIPermissionsCamera; - clipboardWrite?: ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite; - geolocation?: ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation; - microphone?: ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone; + camera?: ToolExecutionCompleteUIResourceMetaUIPermissionsCamera; + clipboardWrite?: ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite; + geolocation?: ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation; + microphone?: ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone; } /** * Marker object for camera permission on an MCP Apps UI resource. @@ -6719,538 +6791,538 @@ export interface ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone {} * Tool definition metadata, present for MCP tools with MCP Apps support */ export interface ToolExecutionCompleteToolDescription { - _meta?: ToolExecutionCompleteToolDescriptionMeta; - /** - * Tool description - */ - description?: string; - /** - * Tool name - */ - name: string; + _meta?: ToolExecutionCompleteToolDescriptionMeta; + /** + * Tool description + */ + description?: string; + /** + * Tool name + */ + name: string; } /** * MCP Apps metadata for UI resource association */ export interface ToolExecutionCompleteToolDescriptionMeta { - ui?: ToolExecutionCompleteToolDescriptionMetaUI; + ui?: ToolExecutionCompleteToolDescriptionMetaUI; } /** * MCP Apps tool `_meta.ui` resource URI and visibility captured on `tool.execution_complete`. */ export interface ToolExecutionCompleteToolDescriptionMetaUI { - /** - * URI of the UI resource - */ - resourceUri?: string; - /** - * Who can access this tool - */ - visibility?: ToolExecutionCompleteToolDescriptionMetaUIVisibility[]; + /** + * URI of the UI resource + */ + resourceUri?: string; + /** + * Who can access this tool + */ + visibility?: ToolExecutionCompleteToolDescriptionMetaUIVisibility[]; } /** * Session event "tool_search.activated". Persisted generic client-side tool activations restored when a session resumes. */ export interface ToolSearchActivatedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ToolSearchActivatedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "tool_search.activated". - */ - type: "tool_search.activated"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ToolSearchActivatedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "tool_search.activated". + */ + type: "tool_search.activated"; } /** * Persisted generic client-side tool activations restored when a session resumes. */ export interface ToolSearchActivatedData { - /** - * Tool-search strategy that activated the definitions. - */ - strategy: string; - /** - * Names of tool definitions activated by this search invocation. - */ - toolNames: string[]; + /** + * Tool-search strategy that activated the definitions. + */ + strategy: string; + /** + * Names of tool definitions activated by this search invocation. + */ + toolNames: string[]; } /** * Session event "skill.invoked". Skill invocation details including content, allowed tools, and plugin metadata */ export interface SkillInvokedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SkillInvokedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "skill.invoked". - */ - type: "skill.invoked"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SkillInvokedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "skill.invoked". + */ + type: "skill.invoked"; } /** * Skill invocation details including content, allowed tools, and plugin metadata */ export interface SkillInvokedData { - /** - * Tool names that should be auto-approved when this skill is active - */ - allowedTools?: string[]; - /** - * Full content of the skill file, injected into the conversation for the model - */ - content: string; - /** - * Description of the skill from its SKILL.md frontmatter - */ - description?: string; - /** - * Whether model invocation is disabled for this skill - */ - disableModelInvocation?: boolean; - /** - * Model identifier active when the skill was invoked, when known - */ - model?: string; - /** - * Name of the invoked skill - */ - name: string; - /** - * File path to the SKILL.md definition, or an empty string for an SDK-provided skill without a filesystem identity - */ - path: string; - /** - * Name of the plugin this skill originated from, when applicable - */ - pluginName?: string; - /** - * Version of the plugin this skill originated from, when applicable - */ - pluginVersion?: string; - /** - * Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), remote (org/enterprise skill), and sdk (SDK-provided skill) - */ - source?: string; - trigger?: SkillInvokedTrigger; + /** + * Tool names that should be auto-approved when this skill is active + */ + allowedTools?: string[]; + /** + * Full content of the skill file, injected into the conversation for the model + */ + content: string; + /** + * Description of the skill from its SKILL.md frontmatter + */ + description?: string; + /** + * Whether model invocation is disabled for this skill + */ + disableModelInvocation?: boolean; + /** + * Model identifier active when the skill was invoked, when known + */ + model?: string; + /** + * Name of the invoked skill + */ + name: string; + /** + * File path to the SKILL.md definition, or an empty string for an SDK-provided skill without a filesystem identity + */ + path: string; + /** + * Name of the plugin this skill originated from, when applicable + */ + pluginName?: string; + /** + * Version of the plugin this skill originated from, when applicable + */ + pluginVersion?: string; + /** + * Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), remote (org/enterprise skill), and sdk (SDK-provided skill) + */ + source?: string; + trigger?: SkillInvokedTrigger; } /** * Session event "subagent.started". Sub-agent startup details including parent tool call and agent information */ export interface SubagentStartedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SubagentStartedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "subagent.started". - */ - type: "subagent.started"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SubagentStartedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "subagent.started". + */ + type: "subagent.started"; } /** * Sub-agent startup details including parent tool call and agent information */ export interface SubagentStartedData { - /** - * Description of what the sub-agent does - */ - agentDescription: string; - /** - * Human-readable display name of the sub-agent - */ - agentDisplayName: string; - /** - * Internal name of the sub-agent - */ - agentName: string; - /** - * Type of the sub-agent selected at spawn time. - */ - agentType?: string; - /** - * Whether the sub-agent runs synchronously or in the background. - */ - executionMode?: string; - /** - * Root id of the factory run that spawned this sub-agent, when it was spawned by one. - */ - factoryRunId?: string; - /** - * Model the sub-agent will run with, when known at start. - */ - model?: string; - /** - * Task-registry ID of the spawning sub-agent. Absent when the root session spawned this child. - */ - parentId?: string; - /** - * Whether this sub-agent can be resumed. Currently always false. - */ - resumable?: boolean; - /** - * Tool call ID of the parent tool invocation that spawned this sub-agent - */ - toolCallId: string; + /** + * Description of what the sub-agent does + */ + agentDescription: string; + /** + * Human-readable display name of the sub-agent + */ + agentDisplayName: string; + /** + * Internal name of the sub-agent + */ + agentName: string; + /** + * Type of the sub-agent selected at spawn time. + */ + agentType?: string; + /** + * Whether the sub-agent runs synchronously or in the background. + */ + executionMode?: string; + /** + * Root id of the factory run that spawned this sub-agent, when it was spawned by one. + */ + factoryRunId?: string; + /** + * Model the sub-agent will run with, when known at start. + */ + model?: string; + /** + * Task-registry ID of the spawning sub-agent. Absent when the root session spawned this child. + */ + parentId?: string; + /** + * Whether this sub-agent can be resumed. Currently always false. + */ + resumable?: boolean; + /** + * Tool call ID of the parent tool invocation that spawned this sub-agent + */ + toolCallId: string; } /** * Session event "subagent.configured". Resolved runtime configuration for a configured sub-agent */ export interface SubagentConfiguredEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SubagentConfiguredData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "subagent.configured". - */ - type: "subagent.configured"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SubagentConfiguredData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "subagent.configured". + */ + type: "subagent.configured"; } /** * Resolved runtime configuration for a configured sub-agent */ export interface SubagentConfiguredData { - /** - * Resolved context tier, when configured for the model - */ - contextTier?: string; - /** - * Resolved model the sub-agent will run with - */ - model: string; - /** - * Whether the sub-agent accepts follow-up turns - */ - multiTurn: boolean; - /** - * Resolved reasoning effort, when configured for the model - */ - reasoningEffort?: string; + /** + * Resolved context tier, when configured for the model + */ + contextTier?: string; + /** + * Resolved model the sub-agent will run with + */ + model: string; + /** + * Whether the sub-agent accepts follow-up turns + */ + multiTurn: boolean; + /** + * Resolved reasoning effort, when configured for the model + */ + reasoningEffort?: string; } /** * Session event "subagent.completed". Sub-agent completion details for successful execution */ export interface SubagentCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SubagentCompletedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "subagent.completed". - */ - type: "subagent.completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SubagentCompletedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "subagent.completed". + */ + type: "subagent.completed"; } /** * Sub-agent completion details for successful execution */ export interface SubagentCompletedData { - /** - * Human-readable display name of the sub-agent - */ - agentDisplayName: string; - /** - * Internal name of the sub-agent - */ - agentName: string; - /** - * Whether the sub-agent was torn down by cancellation - its own abort, or an ancestor being killed - instead of finishing its work. Cancellation is not a failure, so the run still reports completion; this distinguishes a torn-down sub-agent from one that ran to the end. - */ - cancelled?: boolean; - /** - * Whether the first model actually dispatched matched the user's configured preference - */ - configuredModelMatchesActual?: boolean; - /** - * Concrete model the user configured for this sub-agent via `/subagents`, when present - */ - configuredModelPreference?: string; - /** - * Wall-clock duration of the sub-agent execution in milliseconds - */ - durationMs?: number; - /** - * Whether the explicit task-call model matched the user's configured preference - */ - explicitModelMatchesPreference?: boolean; - /** - * Explicit model supplied by the parent agent on the task call, when present - */ - explicitModelOverride?: string; - /** - * First model for which the sub-agent started an inference request, when one was dispatched - */ - firstDispatchedModel?: string; - /** - * Model used by the sub-agent - */ - model?: string; - /** - * Why an explicit task-call model did not become the effective model - */ - modelOverrideReason?: string; - /** - * Tool call ID of the parent tool invocation that spawned this sub-agent - */ - toolCallId: string; - /** - * Total tokens (input + output) consumed by the sub-agent - */ - totalTokens?: number; - /** - * Total number of tool calls made by the sub-agent - */ - totalToolCalls?: number; + /** + * Human-readable display name of the sub-agent + */ + agentDisplayName: string; + /** + * Internal name of the sub-agent + */ + agentName: string; + /** + * Whether the sub-agent was torn down by cancellation - its own abort, or an ancestor being killed - instead of finishing its work. Cancellation is not a failure, so the run still reports completion; this distinguishes a torn-down sub-agent from one that ran to the end. + */ + cancelled?: boolean; + /** + * Whether the first model actually dispatched matched the user's configured preference + */ + configuredModelMatchesActual?: boolean; + /** + * Concrete model the user configured for this sub-agent via `/subagents`, when present + */ + configuredModelPreference?: string; + /** + * Wall-clock duration of the sub-agent execution in milliseconds + */ + durationMs?: number; + /** + * Whether the explicit task-call model matched the user's configured preference + */ + explicitModelMatchesPreference?: boolean; + /** + * Explicit model supplied by the parent agent on the task call, when present + */ + explicitModelOverride?: string; + /** + * First model for which the sub-agent started an inference request, when one was dispatched + */ + firstDispatchedModel?: string; + /** + * Model used by the sub-agent + */ + model?: string; + /** + * Why an explicit task-call model did not become the effective model + */ + modelOverrideReason?: string; + /** + * Tool call ID of the parent tool invocation that spawned this sub-agent + */ + toolCallId: string; + /** + * Total tokens (input + output) consumed by the sub-agent + */ + totalTokens?: number; + /** + * Total number of tool calls made by the sub-agent + */ + totalToolCalls?: number; } /** * Session event "subagent.failed". Sub-agent failure details including error message and agent information */ export interface SubagentFailedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SubagentFailedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "subagent.failed". - */ - type: "subagent.failed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SubagentFailedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "subagent.failed". + */ + type: "subagent.failed"; } /** * Sub-agent failure details including error message and agent information */ export interface SubagentFailedData { - /** - * Human-readable display name of the sub-agent - */ - agentDisplayName: string; - /** - * Internal name of the sub-agent - */ - agentName: string; - /** - * Whether the first model actually dispatched matched the user's configured preference - */ - configuredModelMatchesActual?: boolean; - /** - * Concrete model the user configured for this sub-agent via `/subagents`, when present - */ - configuredModelPreference?: string; - /** - * Wall-clock duration of the sub-agent execution in milliseconds - */ - durationMs?: number; - /** - * Error message describing why the sub-agent failed - */ - error: string; - /** - * Whether the explicit task-call model matched the user's configured preference - */ - explicitModelMatchesPreference?: boolean; - /** - * Explicit model supplied by the parent agent on the task call, when present - */ - explicitModelOverride?: string; - /** - * First model for which the sub-agent started an inference request, when one was dispatched - */ - firstDispatchedModel?: string; - /** - * Model selected for the sub-agent, when known - */ - model?: string; - /** - * Why an explicit task-call model did not become the effective model - */ - modelOverrideReason?: string; - /** - * Tool call ID of the parent tool invocation that spawned this sub-agent - */ - toolCallId: string; - /** - * Total tokens (input + output) consumed before the sub-agent failed - */ - totalTokens?: number; - /** - * Total number of tool calls made before the sub-agent failed - */ - totalToolCalls?: number; + /** + * Human-readable display name of the sub-agent + */ + agentDisplayName: string; + /** + * Internal name of the sub-agent + */ + agentName: string; + /** + * Whether the first model actually dispatched matched the user's configured preference + */ + configuredModelMatchesActual?: boolean; + /** + * Concrete model the user configured for this sub-agent via `/subagents`, when present + */ + configuredModelPreference?: string; + /** + * Wall-clock duration of the sub-agent execution in milliseconds + */ + durationMs?: number; + /** + * Error message describing why the sub-agent failed + */ + error: string; + /** + * Whether the explicit task-call model matched the user's configured preference + */ + explicitModelMatchesPreference?: boolean; + /** + * Explicit model supplied by the parent agent on the task call, when present + */ + explicitModelOverride?: string; + /** + * First model for which the sub-agent started an inference request, when one was dispatched + */ + firstDispatchedModel?: string; + /** + * Model selected for the sub-agent, when known + */ + model?: string; + /** + * Why an explicit task-call model did not become the effective model + */ + modelOverrideReason?: string; + /** + * Tool call ID of the parent tool invocation that spawned this sub-agent + */ + toolCallId: string; + /** + * Total tokens (input + output) consumed before the sub-agent failed + */ + totalTokens?: number; + /** + * Total number of tool calls made before the sub-agent failed + */ + totalToolCalls?: number; } /** * Session event "subagent.selected". Custom agent selection details including name and available tools */ export interface SubagentSelectedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SubagentSelectedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "subagent.selected". - */ - type: "subagent.selected"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SubagentSelectedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "subagent.selected". + */ + type: "subagent.selected"; } /** * Custom agent selection details including name and available tools */ export interface SubagentSelectedData { - /** - * Human-readable display name of the selected custom agent - */ - agentDisplayName: string; - /** - * Internal name of the selected custom agent - */ - agentName: string; - /** - * List of tool names available to this agent, or null for all tools - */ - tools: string[] | null; + /** + * Human-readable display name of the selected custom agent + */ + agentDisplayName: string; + /** + * Internal name of the selected custom agent + */ + agentName: string; + /** + * List of tool names available to this agent, or null for all tools + */ + tools: string[] | null; } /** * Session event "subagent.deselected". Empty payload; the event signals that the custom agent was deselected, returning to the default agent */ export interface SubagentDeselectedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SubagentDeselectedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "subagent.deselected". - */ - type: "subagent.deselected"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SubagentDeselectedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "subagent.deselected". + */ + type: "subagent.deselected"; } /** * Empty payload; the event signals that the custom agent was deselected, returning to the default agent @@ -7260,3504 +7332,3504 @@ export interface SubagentDeselectedData {} * Session event "hook.start". Hook invocation start details including type and input data */ export interface HookStartEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: HookStartData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "hook.start". - */ - type: "hook.start"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: HookStartData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "hook.start". + */ + type: "hook.start"; } /** * Hook invocation start details including type and input data */ export interface HookStartData { - /** - * Unique identifier for this hook invocation - */ - hookInvocationId: string; - /** - * Type of hook being invoked (e.g., "preToolUse", "postToolUse", "sessionStart") - */ - hookType: string; - /** - * Input data passed to the hook. For postToolUse hooks the retained copy served by session.eventLog.read (and by a resumed session) elides the tool result's inline `contents`/`uiResource` and replaces an over-long `textResultForLlm` with a `[copilot:elided ...]` marker, to keep a multi-megabyte payload out of the durable event log; the live subscription stream still delivers the full value. Read the adjacent tool.execution_complete event for the tool result itself. - */ - input?: JsonValue; - /** - * Tool call ID of the parent tool invocation when this event originates from a sub-agent - */ - parentToolCallId?: string; + /** + * Unique identifier for this hook invocation + */ + hookInvocationId: string; + /** + * Type of hook being invoked (e.g., "preToolUse", "postToolUse", "sessionStart") + */ + hookType: string; + /** + * Input data passed to the hook. For postToolUse hooks the retained copy served by session.eventLog.read (and by a resumed session) elides the tool result's inline `contents`/`uiResource` and replaces an over-long `textResultForLlm` with a `[copilot:elided ...]` marker, to keep a multi-megabyte payload out of the durable event log; the live subscription stream still delivers the full value. Read the adjacent tool.execution_complete event for the tool result itself. + */ + input?: JsonValue; + /** + * Tool call ID of the parent tool invocation when this event originates from a sub-agent + */ + parentToolCallId?: string; } /** * Session event "hook.end". Hook invocation completion details including output, success status, and error information */ export interface HookEndEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: HookEndData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "hook.end". - */ - type: "hook.end"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: HookEndData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "hook.end". + */ + type: "hook.end"; } /** * Hook invocation completion details including output, success status, and error information */ export interface HookEndData { - error?: HookEndError; - /** - * Identifier matching the corresponding hook.start event - */ - hookInvocationId: string; - /** - * Type of hook that was invoked (e.g., "preToolUse", "postToolUse", "sessionStart") - */ - hookType: string; - /** - * Output data produced by the hook - */ - output?: JsonValue; - /** - * Tool call ID of the parent tool invocation when this event originates from a sub-agent - */ - parentToolCallId?: string; - /** - * Whether the hook completed successfully - */ - success: boolean; + error?: HookEndError; + /** + * Identifier matching the corresponding hook.start event + */ + hookInvocationId: string; + /** + * Type of hook that was invoked (e.g., "preToolUse", "postToolUse", "sessionStart") + */ + hookType: string; + /** + * Output data produced by the hook + */ + output?: JsonValue; + /** + * Tool call ID of the parent tool invocation when this event originates from a sub-agent + */ + parentToolCallId?: string; + /** + * Whether the hook completed successfully + */ + success: boolean; } /** * Error details when the hook failed */ export interface HookEndError { - /** - * Human-readable error message - */ - message: string; - /** - * Source label of the hook that errored (e.g. the plugin it was loaded from), when known - */ - source?: string; - /** - * Error stack trace, when available - */ - stack?: string; + /** + * Human-readable error message + */ + message: string; + /** + * Source label of the hook that errored (e.g. the plugin it was loaded from), when known + */ + source?: string; + /** + * Error stack trace, when available + */ + stack?: string; } /** * Session event "hook.progress". Ephemeral progress update from a running hook process */ export interface HookProgressEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: HookProgressData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "hook.progress". - */ - type: "hook.progress"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: HookProgressData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "hook.progress". + */ + type: "hook.progress"; } /** * Ephemeral progress update from a running hook process */ export interface HookProgressData { - /** - * Human-readable progress message from the hook process - */ - message: string; - /** - * When true, this status message replaces the previous temporary one instead of accumulating - */ - temporary?: boolean; + /** + * Human-readable progress message from the hook process + */ + message: string; + /** + * When true, this status message replaces the previous temporary one instead of accumulating + */ + temporary?: boolean; } /** * Session event "session.binary_asset". Canonical bytes for a content-addressed binary asset shared by reference across events */ /** @experimental */ export interface BinaryAssetEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: BinaryAssetData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.binary_asset". - */ - type: "session.binary_asset"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: BinaryAssetData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.binary_asset". + */ + type: "session.binary_asset"; } /** * Canonical bytes for a content-addressed binary asset shared by reference across events */ export interface BinaryAssetData { - /** - * Content-addressed id for this binary asset (e.g. "sha256:..."). - */ - assetId: string; - /** - * Decoded byte length of the binary asset - */ - byteLength: number; - /** - * Base64-encoded binary data - */ - data: string; - /** - * Human-readable description of the binary data - */ - description?: string; - /** - * Optional metadata from the producing tool. - */ - metadata?: { - [k: string]: JsonValue | undefined; - }; - /** - * MIME type of the binary asset - */ - mimeType: string; - type: BinaryAssetType; + /** + * Content-addressed id for this binary asset (e.g. "sha256:..."). + */ + assetId: string; + /** + * Decoded byte length of the binary asset + */ + byteLength: number; + /** + * Base64-encoded binary data + */ + data: string; + /** + * Human-readable description of the binary data + */ + description?: string; + /** + * Optional metadata from the producing tool. + */ + metadata?: { + [k: string]: JsonValue | undefined; + }; + /** + * MIME type of the binary asset + */ + mimeType: string; + type: BinaryAssetType; } /** * Session event "system.message". System/developer instruction content with role and optional template metadata */ export interface SystemMessageEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SystemMessageData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "system.message". - */ - type: "system.message"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SystemMessageData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "system.message". + */ + type: "system.message"; } /** * System/developer instruction content with role and optional template metadata */ export interface SystemMessageData { - /** - * The system or developer prompt text sent as model input - */ - content: string; - /** - * Logical interaction identifier for the model run receiving this prompt - */ - interactionId?: string; - metadata?: SystemMessageMetadata; - /** - * Optional name identifier for the message source - */ - name?: string; - role: SystemMessageRole; + /** + * The system or developer prompt text sent as model input + */ + content: string; + /** + * Logical interaction identifier for the model run receiving this prompt + */ + interactionId?: string; + metadata?: SystemMessageMetadata; + /** + * Optional name identifier for the message source + */ + name?: string; + role: SystemMessageRole; } /** * Metadata about the prompt template and its construction */ export interface SystemMessageMetadata { - /** - * Version identifier of the prompt template used - */ - promptVersion?: string; - /** - * Template variables used when constructing the prompt - */ - variables?: { - [k: string]: JsonValue | undefined; - }; + /** + * Version identifier of the prompt template used + */ + promptVersion?: string; + /** + * Template variables used when constructing the prompt + */ + variables?: { + [k: string]: JsonValue | undefined; + }; } /** * Session event "system.notification". System-generated notification for runtime events like background task completion */ export interface SystemNotificationEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SystemNotificationData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "system.notification". - */ - type: "system.notification"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SystemNotificationData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "system.notification". + */ + type: "system.notification"; } /** * System-generated notification for runtime events like background task completion */ export interface SystemNotificationData { - /** - * The notification text, typically wrapped in XML tags - */ - content: string; - kind: SystemNotification; + /** + * The notification text, typically wrapped in XML tags + */ + content: string; + kind: SystemNotification; } /** * System notification metadata for a background agent that completed or failed, including agent ID, type, status, description, and prompt. */ export interface SystemNotificationAgentCompleted { - /** - * Unique task identifier - */ - agentId: string; - /** - * Type of the agent (e.g., explore, task, general-purpose) - */ - agentType: string; - /** - * Human-readable description of the agent task - */ - description?: string; - /** - * Friendly, non-unique name intended for display - */ - displayName?: string; - /** - * The full prompt given to the background agent - */ - prompt?: string; - status: SystemNotificationAgentCompletedStatus; - /** - * Type discriminator. Always "agent_completed". - */ - type: "agent_completed"; + /** + * Unique task identifier + */ + agentId: string; + /** + * Type of the agent (e.g., explore, task, general-purpose) + */ + agentType: string; + /** + * Human-readable description of the agent task + */ + description?: string; + /** + * Friendly, non-unique name intended for display + */ + displayName?: string; + /** + * The full prompt given to the background agent + */ + prompt?: string; + status: SystemNotificationAgentCompletedStatus; + /** + * Type discriminator. Always "agent_completed". + */ + type: "agent_completed"; } /** * System notification metadata for a background agent that became idle, including agent ID, type, and description. */ export interface SystemNotificationAgentIdle { - /** - * Unique task identifier - */ - agentId: string; - /** - * Type of the agent (e.g., explore, task, general-purpose) - */ - agentType: string; - /** - * Human-readable description of the agent task - */ - description?: string; - /** - * Friendly, non-unique name intended for display - */ - displayName?: string; - /** - * Type discriminator. Always "agent_idle". - */ - type: "agent_idle"; + /** + * Unique task identifier + */ + agentId: string; + /** + * Type of the agent (e.g., explore, task, general-purpose) + */ + agentType: string; + /** + * Human-readable description of the agent task + */ + description?: string; + /** + * Friendly, non-unique name intended for display + */ + displayName?: string; + /** + * Type discriminator. Always "agent_idle". + */ + type: "agent_idle"; } /** * System notification metadata for a new inbox message, including entry ID, sender details, and summary. */ export interface SystemNotificationNewInboxMessage { - /** - * Unique identifier of the inbox entry - */ - entryId: string; - /** - * Human-readable name of the sender - */ - senderName: string; - /** - * Category of the sender (e.g., sidekick-agent, plugin, hook) - */ - senderType: string; - /** - * Short summary shown before the agent decides whether to read the inbox - */ - summary: string; - /** - * Type discriminator. Always "new_inbox_message". - */ - type: "new_inbox_message"; + /** + * Unique identifier of the inbox entry + */ + entryId: string; + /** + * Human-readable name of the sender + */ + senderName: string; + /** + * Category of the sender (e.g., sidekick-agent, plugin, hook) + */ + senderType: string; + /** + * Short summary shown before the agent decides whether to read the inbox + */ + summary: string; + /** + * Type discriminator. Always "new_inbox_message". + */ + type: "new_inbox_message"; } /** * System notification metadata for a shell session that completed, including shell ID, optional exit code, and description. */ export interface SystemNotificationShellCompleted { - /** - * Human-readable description of the command - */ - description?: string; - /** - * Exit code of the shell command, if available - */ - exitCode?: number; - /** - * Unique identifier of the shell session - */ - shellId: string; - /** - * Type discriminator. Always "shell_completed". - */ - type: "shell_completed"; + /** + * Human-readable description of the command + */ + description?: string; + /** + * Exit code of the shell command, if available + */ + exitCode?: number; + /** + * Unique identifier of the shell session + */ + shellId: string; + /** + * Type discriminator. Always "shell_completed". + */ + type: "shell_completed"; } /** * System notification metadata for a detached shell session that completed, including shell ID and description. */ export interface SystemNotificationShellDetachedCompleted { - /** - * Human-readable description of the command - */ - description?: string; - /** - * Unique identifier of the detached shell session - */ - shellId: string; - /** - * Type discriminator. Always "shell_detached_completed". - */ - type: "shell_detached_completed"; + /** + * Human-readable description of the command + */ + description?: string; + /** + * Unique identifier of the detached shell session + */ + shellId: string; + /** + * Type discriminator. Always "shell_detached_completed". + */ + type: "shell_detached_completed"; } /** * System notification metadata for an instruction file discovered during tool access, including source, trigger file, and tool. */ export interface SystemNotificationInstructionDiscovered { - /** - * Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/') - */ - description?: string; - /** - * Relative path to the discovered instruction file - */ - sourcePath: string; - /** - * Path of the file access that triggered discovery - */ - triggerFile: string; - /** - * Tool command that triggered discovery (currently always 'view') - */ - triggerTool: string; - /** - * Type discriminator. Always "instruction_discovered". - */ - type: "instruction_discovered"; + /** + * Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/') + */ + description?: string; + /** + * Relative path to the discovered instruction file + */ + sourcePath: string; + /** + * Path of the file access that triggered discovery + */ + triggerFile: string; + /** + * Tool command that triggered discovery (currently always 'view') + */ + triggerTool: string; + /** + * Type discriminator. Always "instruction_discovered". + */ + type: "instruction_discovered"; } /** * System notification metadata for a factory execution attempt that reached a terminal state. */ export interface SystemNotificationFactoryCompleted { - /** - * Execution attempt that reached this terminal state. - */ - attempt: number; - /** - * Consumed AI usage in nano-AIU. - */ - consumedNanoAiu: number; - /** - * Subagents consumed by the run across all attempts. - */ - consumedSubagents: number; - /** - * Accumulated active execution time in milliseconds. - */ - elapsedMs: number; - /** - * Persisted factory name. - */ - factoryName: string; - /** - * Machine-readable terminal failure details, when present. - */ - failure?: JsonValue; - /** - * Bounded prompt-safe preview of the completed result. - */ - resultPreview?: string; - /** - * Actionable run_factory resume guidance for a resource-limit failure. - */ - retryGuidance?: string; - /** - * Factory run identifier. - */ - runId: string; - status: SystemNotificationFactoryCompletedStatus; - /** - * Type discriminator. Always "factory_completed". - */ - type: "factory_completed"; + /** + * Execution attempt that reached this terminal state. + */ + attempt: number; + /** + * Consumed AI usage in nano-AIU. + */ + consumedNanoAiu: number; + /** + * Subagents consumed by the run across all attempts. + */ + consumedSubagents: number; + /** + * Accumulated active execution time in milliseconds. + */ + elapsedMs: number; + /** + * Persisted factory name. + */ + factoryName: string; + /** + * Machine-readable terminal failure details, when present. + */ + failure?: JsonValue; + /** + * Bounded prompt-safe preview of the completed result. + */ + resultPreview?: string; + /** + * Actionable run_factory resume guidance for a resource-limit failure. + */ + retryGuidance?: string; + /** + * Factory run identifier. + */ + runId: string; + status: SystemNotificationFactoryCompletedStatus; + /** + * Type discriminator. Always "factory_completed". + */ + type: "factory_completed"; } /** * System notification metadata from an external host that does not match a runtime-owned notification kind. */ export interface SystemNotificationUnclassified { - /** - * Opaque metadata supplied by the external host, when present. - */ - metadata?: JsonValue; - /** - * Type discriminator. Always "unclassified". - */ - type: "unclassified"; + /** + * Opaque metadata supplied by the external host, when present. + */ + metadata?: JsonValue; + /** + * Type discriminator. Always "unclassified". + */ + type: "unclassified"; } /** * Session event "permission.requested". Permission request notification requiring client approval with request details */ export interface PermissionRequestedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: PermissionRequestedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "permission.requested". - */ - type: "permission.requested"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: PermissionRequestedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "permission.requested". + */ + type: "permission.requested"; } /** * Permission request notification requiring client approval with request details */ export interface PermissionRequestedData { - agentMode?: SessionMode; - permissionRequest: PermissionRequest; - promptRequest?: PermissionPromptRequest; - /** - * Unique identifier for this permission request; used to respond via session.respondToPermission() - */ - requestId: string; - /** - * When true, this permission was already resolved by a permissionRequest hook and requires no client action - */ - resolvedByHook?: boolean; - /** - * Neutral risk metadata supplied by the tool host. Consumers may display this value but must not use it to bypass the permission decision. - */ - riskAssessment?: JsonValue; + agentMode?: SessionMode; + permissionRequest: PermissionRequest; + promptRequest?: PermissionPromptRequest; + /** + * Unique identifier for this permission request; used to respond via session.respondToPermission() + */ + requestId: string; + /** + * When true, this permission was already resolved by a permissionRequest hook and requires no client action + */ + resolvedByHook?: boolean; + /** + * Neutral risk metadata supplied by the tool host. Consumers may display this value but must not use it to bypass the permission decision. + */ + riskAssessment?: JsonValue; } /** * Shell command permission request */ export interface PermissionRequestShell { - /** - * Whether the UI can offer session-wide approval for this command pattern - */ - canOfferSessionApproval: boolean; - /** - * Parsed command identifiers found in the command text - */ - commands: PermissionRequestShellCommand[]; - /** - * Parsed command segments, including arguments, used for managed policy matching - */ - commandSegments?: PermissionRequestShellCommandSegment[]; - /** - * The complete shell command text to be executed - */ - fullCommandText: string; - /** - * Whether the command includes a file write redirection (e.g., > or >>) - */ - hasWriteFileRedirection: boolean; - /** - * Human-readable description of what the command intends to do - */ - intention: string; - /** - * Permission kind discriminator - */ - kind: "shell"; - /** - * Whether managed policy requires a human response and forbids host auto-approval - */ - managedApprovalRequired?: boolean; - /** - * File paths that may be read or written by the command - */ - possiblePaths: string[]; - /** - * URLs that may be accessed by the command - */ - possibleUrls: PermissionRequestShellPossibleUrl[]; - /** - * 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. - */ - requestSandboxBypass?: boolean; - /** - * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. - */ - requestSandboxBypassReason?: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; - /** - * Optional warning message about risks of running this command - */ - warning?: string; + /** + * Whether the UI can offer session-wide approval for this command pattern + */ + canOfferSessionApproval: boolean; + /** + * Parsed command identifiers found in the command text + */ + commands: PermissionRequestShellCommand[]; + /** + * Parsed command segments, including arguments, used for managed policy matching + */ + commandSegments?: PermissionRequestShellCommandSegment[]; + /** + * The complete shell command text to be executed + */ + fullCommandText: string; + /** + * Whether the command includes a file write redirection (e.g., > or >>) + */ + hasWriteFileRedirection: boolean; + /** + * Human-readable description of what the command intends to do + */ + intention: string; + /** + * Permission kind discriminator + */ + kind: "shell"; + /** + * Whether managed policy requires a human response and forbids host auto-approval + */ + managedApprovalRequired?: boolean; + /** + * File paths that may be read or written by the command + */ + possiblePaths: string[]; + /** + * URLs that may be accessed by the command + */ + possibleUrls: PermissionRequestShellPossibleUrl[]; + /** + * 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. + */ + requestSandboxBypass?: boolean; + /** + * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + */ + requestSandboxBypassReason?: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; + /** + * Optional warning message about risks of running this command + */ + warning?: string; } /** * A parsed command identifier in a shell permission request, including whether it is read-only. */ export interface PermissionRequestShellCommand { - /** - * Command identifier (e.g., executable name) - */ - identifier: string; - /** - * Whether this command is read-only (no side effects) - */ - readOnly: boolean; + /** + * Command identifier (e.g., executable name) + */ + identifier: string; + /** + * Whether this command is read-only (no side effects) + */ + readOnly: boolean; } /** * A parsed shell command segment used for argument-aware managed policy matching. */ export interface PermissionRequestShellCommandSegment { - /** - * Full text of this command segment, including arguments - */ - fullCommandText: string; - /** - * Command identifier (e.g., executable name) - */ - identifier: string; + /** + * Full text of this command segment, including arguments + */ + fullCommandText: string; + /** + * Command identifier (e.g., executable name) + */ + identifier: string; } /** * A URL that may be accessed by a command in a shell permission request. */ export interface PermissionRequestShellPossibleUrl { - /** - * URL that may be accessed by the command - */ - url: string; + /** + * URL that may be accessed by the command + */ + url: string; } /** * File write permission request */ export interface PermissionRequestWrite { - /** - * Whether the UI can offer session-wide approval for file write operations - */ - canOfferSessionApproval: boolean; - /** - * Unified diff showing the proposed changes - */ - diff: string; - /** - * Path of the file being written to - */ - fileName: string; - /** - * Human-readable description of the intended file change - */ - intention: string; - /** - * Permission kind discriminator - */ - kind: "write"; - /** - * Whether managed policy requires a human response and forbids host auto-approval - */ - managedApprovalRequired?: boolean; - /** - * Complete new file contents for newly created files - */ - newFileContents?: string; - /** - * True when a built-in file tool (apply_patch / str_replace_editor) asked to write a path the sandbox filesystem policy would block, and the host opted in via sandbox.allowBypass. This is a request, not a grant: the write happens unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. - */ - requestSandboxBypass?: boolean; - /** - * Justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. - */ - requestSandboxBypassReason?: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Whether the UI can offer session-wide approval for file write operations + */ + canOfferSessionApproval: boolean; + /** + * Unified diff showing the proposed changes + */ + diff: string; + /** + * Path of the file being written to + */ + fileName: string; + /** + * Human-readable description of the intended file change + */ + intention: string; + /** + * Permission kind discriminator + */ + kind: "write"; + /** + * Whether managed policy requires a human response and forbids host auto-approval + */ + managedApprovalRequired?: boolean; + /** + * Complete new file contents for newly created files + */ + newFileContents?: string; + /** + * True when a built-in file tool (apply_patch / str_replace_editor) asked to write a path the sandbox filesystem policy would block, and the host opted in via sandbox.allowBypass. This is a request, not a grant: the write happens unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + */ + requestSandboxBypass?: boolean; + /** + * Justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + */ + requestSandboxBypassReason?: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * File or directory read permission request */ export interface PermissionRequestRead { - /** - * Human-readable description of why the file is being read - */ - intention: string; - /** - * Permission kind discriminator - */ - kind: "read"; - /** - * Whether managed policy requires a human response and forbids host auto-approval - */ - managedApprovalRequired?: boolean; - /** - * Path of the file or directory being read - */ - path: string; - /** - * True when the model has requested to run this search outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the search runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. - */ - requestSandboxBypass?: boolean; - /** - * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. - */ - requestSandboxBypassReason?: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Human-readable description of why the file is being read + */ + intention: string; + /** + * Permission kind discriminator + */ + kind: "read"; + /** + * Whether managed policy requires a human response and forbids host auto-approval + */ + managedApprovalRequired?: boolean; + /** + * Path of the file or directory being read + */ + path: string; + /** + * True when the model has requested to run this search outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the search runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + */ + requestSandboxBypass?: boolean; + /** + * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + */ + requestSandboxBypassReason?: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * MCP tool invocation permission request */ export interface PermissionRequestMcp { - /** - * Arguments to pass to the MCP tool - */ - args?: JsonValue; - /** - * Permission kind discriminator - */ - kind: "mcp"; - /** - * Advisory runtime permission recommendation. The SDK host remains responsible for deciding the request and may reject it. - * - * @experimental - */ - permissionRecommendation?: PermissionRecommendation; - /** - * Whether this MCP tool is read-only (no side effects) - */ - readOnly: boolean; - /** - * Name of the MCP server providing the tool - */ - serverName: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; - /** - * Internal name of the MCP tool - */ - toolName: string; - /** - * Human-readable title of the MCP tool - */ - toolTitle: string; + /** + * Arguments to pass to the MCP tool + */ + args?: JsonValue; + /** + * Permission kind discriminator + */ + kind: "mcp"; + /** + * Advisory runtime permission recommendation. The SDK host remains responsible for deciding the request and may reject it. + * + * @experimental + */ + permissionRecommendation?: PermissionRecommendation; + /** + * Whether this MCP tool is read-only (no side effects) + */ + readOnly: boolean; + /** + * Name of the MCP server providing the tool + */ + serverName: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; + /** + * Internal name of the MCP tool + */ + toolName: string; + /** + * Human-readable title of the MCP tool + */ + toolTitle: string; } /** * URL access permission request */ export interface PermissionRequestUrl { - /** - * Human-readable description of why the URL is being accessed - */ - intention: string; - /** - * Permission kind discriminator - */ - kind: "url"; - /** - * Whether managed policy requires a human response and forbids host auto-approval - */ - managedApprovalRequired?: boolean; - /** - * Immediately preceding URL when this request is for a redirect target - */ - redirectedFrom?: string; - /** - * True when this URL fetch is requesting to bypass the sandbox network policy: either the model set requestSandboxBypass: true, or the tool re-issued the request as an interactive bypass after the network policy denied the approved URL (host opted in via sandbox.allowBypass). This is a request, not a grant: the fetch runs only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. - */ - requestSandboxBypass?: boolean; - /** - * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. - */ - requestSandboxBypassReason?: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; - /** - * URL to be fetched - */ - url: string; + /** + * Human-readable description of why the URL is being accessed + */ + intention: string; + /** + * Permission kind discriminator + */ + kind: "url"; + /** + * Whether managed policy requires a human response and forbids host auto-approval + */ + managedApprovalRequired?: boolean; + /** + * Immediately preceding URL when this request is for a redirect target + */ + redirectedFrom?: string; + /** + * True when this URL fetch is requesting to bypass the sandbox network policy: either the model set requestSandboxBypass: true, or the tool re-issued the request as an interactive bypass after the network policy denied the approved URL (host opted in via sandbox.allowBypass). This is a request, not a grant: the fetch runs only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + */ + requestSandboxBypass?: boolean; + /** + * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + */ + requestSandboxBypassReason?: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; + /** + * URL to be fetched + */ + url: string; } /** * Memory operation permission request */ export interface PermissionRequestMemory { - action?: PermissionRequestMemoryAction; - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Source references for the stored fact (store only) - */ - citations?: string; - direction?: PermissionRequestMemoryDirection; - /** - * The fact being stored or voted on - */ - fact: string; - /** - * Permission kind discriminator - */ - kind: "memory"; - /** - * Reason for the vote (vote only) - */ - reason?: string; - /** - * Repository name with owner associated with the stored memory (store only) - */ - repoNwo?: string; - scope?: PermissionRequestMemoryScope; - /** - * Topic or subject of the memory (store only) - */ - subject?: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + action?: PermissionRequestMemoryAction; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Source references for the stored fact (store only) + */ + citations?: string; + direction?: PermissionRequestMemoryDirection; + /** + * The fact being stored or voted on + */ + fact: string; + /** + * Permission kind discriminator + */ + kind: "memory"; + /** + * Reason for the vote (vote only) + */ + reason?: string; + /** + * Repository name with owner associated with the stored memory (store only) + */ + repoNwo?: string; + scope?: PermissionRequestMemoryScope; + /** + * Topic or subject of the memory (store only) + */ + subject?: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * Assisted-approval judge information attached to a permission request. Present only in assisted mode; its absence means the judge did not evaluate the request. The `recommendation` conveys the judge's disposition for this request. */ /** @experimental */ export interface PermissionAssistedApproval { - failureReason?: AssistedApprovalJudgeFailureReason; - /** - * Model id that produced the recommendation, when the judge was consulted and reported one. Absent for `excluded` (the judge was not consulted) and for failures that occurred before a model was selected. - */ - model?: string; - /** - * Human-readable reason for the judge's recommendation, when available. - */ - reason?: string; - recommendation: AssistedApprovalRecommendation; + failureReason?: AssistedApprovalJudgeFailureReason; + /** + * Model id that produced the recommendation, when the judge was consulted and reported one. Absent for `excluded` (the judge was not consulted) and for failures that occurred before a model was selected. + */ + model?: string; + /** + * Human-readable reason for the judge's recommendation, when available. + */ + reason?: string; + recommendation: AssistedApprovalRecommendation; } /** * Custom tool invocation permission request */ export interface PermissionRequestCustomTool { - /** - * Arguments to pass to the custom tool - */ - args?: JsonValue; - /** - * Permission kind discriminator - */ - kind: "custom-tool"; - /** - * Whether the tool declared that permission may be skipped unless a deny rule matches - */ - skipPermission?: boolean; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; - /** - * Description of what the custom tool does - */ - toolDescription: string; - /** - * Name of the custom tool - */ - toolName: string; + /** + * Arguments to pass to the custom tool + */ + args?: JsonValue; + /** + * Permission kind discriminator + */ + kind: "custom-tool"; + /** + * Whether the tool declared that permission may be skipped unless a deny rule matches + */ + skipPermission?: boolean; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; + /** + * Description of what the custom tool does + */ + toolDescription: string; + /** + * Name of the custom tool + */ + toolName: string; } /** * Hook confirmation permission request */ export interface PermissionRequestHook { - /** - * Optional message from the hook explaining why confirmation is needed - */ - hookMessage?: string; - /** - * Permission kind discriminator - */ - kind: "hook"; - /** - * Arguments of the tool call being gated - */ - toolArgs?: JsonValue; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; - /** - * Name of the tool the hook is gating - */ - toolName: string; + /** + * Optional message from the hook explaining why confirmation is needed + */ + hookMessage?: string; + /** + * Permission kind discriminator + */ + kind: "hook"; + /** + * Arguments of the tool call being gated + */ + toolArgs?: JsonValue; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; + /** + * Name of the tool the hook is gating + */ + toolName: string; } /** * Extension management permission request */ export interface PermissionRequestExtensionManagement { - /** - * Name of the extension being managed - */ - extensionName?: string; - /** - * Permission kind discriminator - */ - kind: "extension-management"; - /** - * The extension management operation (scaffold, reload) - */ - operation: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Name of the extension being managed + */ + extensionName?: string; + /** + * Permission kind discriminator + */ + kind: "extension-management"; + /** + * The extension management operation (scaffold, reload) + */ + operation: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * Factory run or authoring permission request */ export interface PermissionRequestFactory { - /** - * Canonical key used for scoped factory approvals - */ - approvalKey: string; - /** - * Whether this factory is eligible for persistent approval - */ - canPersistApproval: boolean; - /** - * Factory-declared AI-credit limit before any run/resume caller override is applied. - */ - declaredMaxAiCredits?: number; - /** - * Factory-declared concurrent-subagent limit before any run/resume caller override is applied. - */ - declaredMaxConcurrentSubagents?: number; - /** - * Factory-declared total-subagent limit before any run/resume caller override is applied. - */ - declaredMaxTotalSubagents?: number; - /** - * Factory-declared active-time limit in seconds before any run/resume caller override is applied. - */ - declaredTimeoutSeconds?: number; - /** - * Factory description - */ - description: string; - /** - * Permission kind discriminator - */ - kind: "factory"; - /** - * Effective AI-credit limit; omitted means unlimited - */ - maxAiCredits?: number; - /** - * Effective concurrent-subagent limit; omitted means unlimited - */ - maxConcurrentSubagents?: number; - /** - * Effective total-subagent limit; omitted means unlimited - */ - maxTotalSubagents?: number; - /** - * Factory name - */ - name: string; - operation: FactoryPermissionOperation; - /** - * Declared factory phases - */ - phases: FactoryPermissionPhase[]; - /** - * Effective active-time limit in seconds; omitted means unlimited - */ - timeoutSeconds?: number; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Canonical key used for scoped factory approvals + */ + approvalKey: string; + /** + * Whether this factory is eligible for persistent approval + */ + canPersistApproval: boolean; + /** + * Factory-declared AI-credit limit before any run/resume caller override is applied. + */ + declaredMaxAiCredits?: number; + /** + * Factory-declared concurrent-subagent limit before any run/resume caller override is applied. + */ + declaredMaxConcurrentSubagents?: number; + /** + * Factory-declared total-subagent limit before any run/resume caller override is applied. + */ + declaredMaxTotalSubagents?: number; + /** + * Factory-declared active-time limit in seconds before any run/resume caller override is applied. + */ + declaredTimeoutSeconds?: number; + /** + * Factory description + */ + description: string; + /** + * Permission kind discriminator + */ + kind: "factory"; + /** + * Effective AI-credit limit; omitted means unlimited + */ + maxAiCredits?: number; + /** + * Effective concurrent-subagent limit; omitted means unlimited + */ + maxConcurrentSubagents?: number; + /** + * Effective total-subagent limit; omitted means unlimited + */ + maxTotalSubagents?: number; + /** + * Factory name + */ + name: string; + operation: FactoryPermissionOperation; + /** + * Declared factory phases + */ + phases: FactoryPermissionPhase[]; + /** + * Effective active-time limit in seconds; omitted means unlimited + */ + timeoutSeconds?: number; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * A declared phase shown in a factory permission prompt. */ export interface FactoryPermissionPhase { - /** - * Optional phase detail - */ - detail?: string; - /** - * Phase title - */ - title: string; + /** + * Optional phase detail + */ + detail?: string; + /** + * Phase title + */ + title: string; } /** * Extension permission access request */ export interface PermissionRequestExtensionPermissionAccess { - /** - * Capabilities the extension is requesting - */ - capabilities: string[]; - /** - * Name of the extension requesting permission access - */ - extensionName: string; - /** - * Permission kind discriminator - */ - kind: "extension-permission-access"; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Capabilities the extension is requesting + */ + capabilities: string[]; + /** + * Name of the extension requesting permission access + */ + extensionName: string; + /** + * Permission kind discriminator + */ + kind: "extension-permission-access"; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * Extension sensitive environment variable access request */ export interface PermissionRequestExtensionEnvAccess { - /** - * Names of the sensitive environment variables the extension is requesting. Values never appear here. - * - * @minItems 1 - */ - environmentVariables: [string, ...string[]]; - /** - * Name of the extension requesting environment variable access - */ - extensionName: string; - /** - * Permission kind discriminator - */ - kind: "extension-env-access"; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Names of the sensitive environment variables the extension is requesting. Values never appear here. + * + * @minItems 1 + */ + environmentVariables: [string, ...string[]]; + /** + * Name of the extension requesting environment variable access + */ + extensionName: string; + /** + * Permission kind discriminator + */ + kind: "extension-env-access"; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * Shell command permission prompt */ export interface PermissionPromptRequestCommands { - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Whether the UI can offer session-wide approval for this command pattern - */ - canOfferSessionApproval: boolean; - /** - * Command identifiers covered by this approval prompt - */ - commandIdentifiers: string[]; - /** - * The complete shell command text to be executed - */ - fullCommandText: string; - /** - * Human-readable description of what the command intends to do - */ - intention: string; - /** - * Prompt kind discriminator - */ - kind: "commands"; - /** - * Whether managed policy requires a human response and forbids host auto-approval - */ - managedApprovalRequired?: boolean; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; - /** - * Optional warning message about risks of running this command - */ - warning?: string; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Whether the UI can offer session-wide approval for this command pattern + */ + canOfferSessionApproval: boolean; + /** + * Command identifiers covered by this approval prompt + */ + commandIdentifiers: string[]; + /** + * The complete shell command text to be executed + */ + fullCommandText: string; + /** + * Human-readable description of what the command intends to do + */ + intention: string; + /** + * Prompt kind discriminator + */ + kind: "commands"; + /** + * Whether managed policy requires a human response and forbids host auto-approval + */ + managedApprovalRequired?: boolean; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; + /** + * Optional warning message about risks of running this command + */ + warning?: string; } /** * File write permission prompt */ export interface PermissionPromptRequestWrite { - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Whether the UI can offer session-wide approval for file write operations - */ - canOfferSessionApproval: boolean; - /** - * Unified diff showing the proposed changes - */ - diff: string; - /** - * Path of the file being written to - */ - fileName: string; - /** - * Human-readable description of the intended file change - */ - intention: string; - /** - * Prompt kind discriminator - */ - kind: "write"; - /** - * Whether managed policy requires a human response and forbids host auto-approval - */ - managedApprovalRequired?: boolean; - /** - * Complete new file contents for newly created files - */ - newFileContents?: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Whether the UI can offer session-wide approval for file write operations + */ + canOfferSessionApproval: boolean; + /** + * Unified diff showing the proposed changes + */ + diff: string; + /** + * Path of the file being written to + */ + fileName: string; + /** + * Human-readable description of the intended file change + */ + intention: string; + /** + * Prompt kind discriminator + */ + kind: "write"; + /** + * Whether managed policy requires a human response and forbids host auto-approval + */ + managedApprovalRequired?: boolean; + /** + * Complete new file contents for newly created files + */ + newFileContents?: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * File read permission prompt */ export interface PermissionPromptRequestRead { - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Human-readable description of why the file is being read - */ - intention: string; - /** - * Prompt kind discriminator - */ - kind: "read"; - /** - * Whether managed policy requires a human response and forbids host auto-approval - */ - managedApprovalRequired?: boolean; - /** - * Path of the file or directory being read - */ - path: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Human-readable description of why the file is being read + */ + intention: string; + /** + * Prompt kind discriminator + */ + kind: "read"; + /** + * Whether managed policy requires a human response and forbids host auto-approval + */ + managedApprovalRequired?: boolean; + /** + * Path of the file or directory being read + */ + path: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * MCP tool invocation permission prompt */ export interface PermissionPromptRequestMcp { - /** - * Arguments to pass to the MCP tool - */ - args?: JsonValue; - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Whether the host may offer a server-wide "approve all tools from this server" blanket. Absent is treated as true; the runtime sends false when managed policy disables bypass-permissions mode, which forbids the server-wide escalation while still allowing per-tool approval. - */ - canOfferServerWideApproval?: boolean; - /** - * Prompt kind discriminator - */ - kind: "mcp"; - /** - * Advisory runtime permission recommendation. The host remains responsible for deciding the request and may reject it. - * - * @experimental - */ - permissionRecommendation?: PermissionRecommendation; - /** - * Name of the MCP server providing the tool - */ - serverName: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; - /** - * Internal name of the MCP tool - */ - toolName: string; - /** - * Human-readable title of the MCP tool - */ - toolTitle: string; + /** + * Arguments to pass to the MCP tool + */ + args?: JsonValue; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Whether the host may offer a server-wide "approve all tools from this server" blanket. Absent is treated as true; the runtime sends false when managed policy disables bypass-permissions mode, which forbids the server-wide escalation while still allowing per-tool approval. + */ + canOfferServerWideApproval?: boolean; + /** + * Prompt kind discriminator + */ + kind: "mcp"; + /** + * Advisory runtime permission recommendation. The host remains responsible for deciding the request and may reject it. + * + * @experimental + */ + permissionRecommendation?: PermissionRecommendation; + /** + * Name of the MCP server providing the tool + */ + serverName: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; + /** + * Internal name of the MCP tool + */ + toolName: string; + /** + * Human-readable title of the MCP tool + */ + toolTitle: string; } /** * URL access permission prompt */ export interface PermissionPromptRequestUrl { - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Human-readable description of why the URL is being accessed - */ - intention: string; - /** - * Prompt kind discriminator - */ - kind: "url"; - /** - * Whether managed policy requires a human response and forbids host auto-approval - */ - managedApprovalRequired?: boolean; - /** - * Immediately preceding URL when this prompt is for a redirect target - */ - redirectedFrom?: string; - /** - * True when this URL fetch is requesting to bypass the sandbox network policy: either the model set requestSandboxBypass: true, or the tool re-issued the request as an interactive bypass after the network policy denied the approved URL (host opted in via sandbox.allowBypass). This is a request, not a grant: the fetch runs only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. - */ - requestSandboxBypass?: boolean; - /** - * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. - */ - requestSandboxBypassReason?: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; - /** - * URL to be fetched - */ - url: string; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Human-readable description of why the URL is being accessed + */ + intention: string; + /** + * Prompt kind discriminator + */ + kind: "url"; + /** + * Whether managed policy requires a human response and forbids host auto-approval + */ + managedApprovalRequired?: boolean; + /** + * Immediately preceding URL when this prompt is for a redirect target + */ + redirectedFrom?: string; + /** + * True when this URL fetch is requesting to bypass the sandbox network policy: either the model set requestSandboxBypass: true, or the tool re-issued the request as an interactive bypass after the network policy denied the approved URL (host opted in via sandbox.allowBypass). This is a request, not a grant: the fetch runs only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + */ + requestSandboxBypass?: boolean; + /** + * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + */ + requestSandboxBypassReason?: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; + /** + * URL to be fetched + */ + url: string; } /** * Memory operation permission prompt */ export interface PermissionPromptRequestMemory { - action?: PermissionRequestMemoryAction; - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Source references for the stored fact (store only) - */ - citations?: string; - direction?: PermissionRequestMemoryDirection; - /** - * The fact being stored or voted on - */ - fact: string; - /** - * Prompt kind discriminator - */ - kind: "memory"; - /** - * Reason for the vote (vote only) - */ - reason?: string; - /** - * Topic or subject of the memory (store only) - */ - subject?: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + action?: PermissionRequestMemoryAction; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Source references for the stored fact (store only) + */ + citations?: string; + direction?: PermissionRequestMemoryDirection; + /** + * The fact being stored or voted on + */ + fact: string; + /** + * Prompt kind discriminator + */ + kind: "memory"; + /** + * Reason for the vote (vote only) + */ + reason?: string; + /** + * Topic or subject of the memory (store only) + */ + subject?: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * Custom tool invocation permission prompt */ export interface PermissionPromptRequestCustomTool { - /** - * Arguments to pass to the custom tool - */ - args?: JsonValue; - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Prompt kind discriminator - */ - kind: "custom-tool"; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; - /** - * Description of what the custom tool does - */ - toolDescription: string; - /** - * Name of the custom tool - */ - toolName: string; + /** + * Arguments to pass to the custom tool + */ + args?: JsonValue; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Prompt kind discriminator + */ + kind: "custom-tool"; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; + /** + * Description of what the custom tool does + */ + toolDescription: string; + /** + * Name of the custom tool + */ + toolName: string; } /** * Path access permission prompt */ export interface PermissionPromptRequestPath { - accessKind: PermissionPromptRequestPathAccessKind; - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Prompt kind discriminator - */ - kind: "path"; - /** - * File paths that require explicit approval - */ - paths: string[]; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + accessKind: PermissionPromptRequestPathAccessKind; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Prompt kind discriminator + */ + kind: "path"; + /** + * File paths that require explicit approval + */ + paths: string[]; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * Hook confirmation permission prompt */ export interface PermissionPromptRequestHook { - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Optional message from the hook explaining why confirmation is needed - */ - hookMessage?: string; - /** - * Prompt kind discriminator - */ - kind: "hook"; - /** - * Arguments of the tool call being gated - */ - toolArgs?: JsonValue; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; - /** - * Name of the tool the hook is gating - */ - toolName: string; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Optional message from the hook explaining why confirmation is needed + */ + hookMessage?: string; + /** + * Prompt kind discriminator + */ + kind: "hook"; + /** + * Arguments of the tool call being gated + */ + toolArgs?: JsonValue; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; + /** + * Name of the tool the hook is gating + */ + toolName: string; } /** * Extension management permission prompt */ export interface PermissionPromptRequestExtensionManagement { - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Name of the extension being managed - */ - extensionName?: string; - /** - * Prompt kind discriminator - */ - kind: "extension-management"; - /** - * The extension management operation (scaffold, reload) - */ - operation: string; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Name of the extension being managed + */ + extensionName?: string; + /** + * Prompt kind discriminator + */ + kind: "extension-management"; + /** + * The extension management operation (scaffold, reload) + */ + operation: string; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * Factory run or authoring permission prompt */ export interface PermissionPromptRequestFactory { - /** - * Canonical key used for scoped factory approvals - */ - approvalKey: string; - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Whether this factory is eligible for persistent approval - */ - canPersistApproval: boolean; - /** - * Factory-declared AI-credit limit before any run/resume caller override is applied. - */ - declaredMaxAiCredits?: number; - /** - * Factory-declared concurrent-subagent limit before any run/resume caller override is applied. - */ - declaredMaxConcurrentSubagents?: number; - /** - * Factory-declared total-subagent limit before any run/resume caller override is applied. - */ - declaredMaxTotalSubagents?: number; - /** - * Factory-declared active-time limit in seconds before any run/resume caller override is applied. - */ - declaredTimeoutSeconds?: number; - /** - * Factory description - */ - description: string; - /** - * Prompt kind discriminator - */ - kind: "factory"; - /** - * Whether managed policy requires a human response and forbids host auto-approval - */ - managedApprovalRequired?: boolean; - /** - * Effective AI-credit limit; omitted means unlimited - */ - maxAiCredits?: number; - /** - * Effective concurrent-subagent limit; omitted means unlimited - */ - maxConcurrentSubagents?: number; - /** - * Effective total-subagent limit; omitted means unlimited - */ - maxTotalSubagents?: number; - /** - * Factory name - */ - name: string; - operation: FactoryPermissionOperation; - /** - * Declared factory phases - */ - phases: FactoryPermissionPhase[]; - /** - * Effective active-time limit in seconds; omitted means unlimited - */ - timeoutSeconds?: number; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Canonical key used for scoped factory approvals + */ + approvalKey: string; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Whether this factory is eligible for persistent approval + */ + canPersistApproval: boolean; + /** + * Factory-declared AI-credit limit before any run/resume caller override is applied. + */ + declaredMaxAiCredits?: number; + /** + * Factory-declared concurrent-subagent limit before any run/resume caller override is applied. + */ + declaredMaxConcurrentSubagents?: number; + /** + * Factory-declared total-subagent limit before any run/resume caller override is applied. + */ + declaredMaxTotalSubagents?: number; + /** + * Factory-declared active-time limit in seconds before any run/resume caller override is applied. + */ + declaredTimeoutSeconds?: number; + /** + * Factory description + */ + description: string; + /** + * Prompt kind discriminator + */ + kind: "factory"; + /** + * Whether managed policy requires a human response and forbids host auto-approval + */ + managedApprovalRequired?: boolean; + /** + * Effective AI-credit limit; omitted means unlimited + */ + maxAiCredits?: number; + /** + * Effective concurrent-subagent limit; omitted means unlimited + */ + maxConcurrentSubagents?: number; + /** + * Effective total-subagent limit; omitted means unlimited + */ + maxTotalSubagents?: number; + /** + * Factory name + */ + name: string; + operation: FactoryPermissionOperation; + /** + * Declared factory phases + */ + phases: FactoryPermissionPhase[]; + /** + * Effective active-time limit in seconds; omitted means unlimited + */ + timeoutSeconds?: number; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * Extension permission access prompt */ export interface PermissionPromptRequestExtensionPermissionAccess { - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Capabilities the extension is requesting - */ - capabilities: string[]; - /** - * Name of the extension requesting permission access - */ - extensionName: string; - /** - * Prompt kind discriminator - */ - kind: "extension-permission-access"; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Capabilities the extension is requesting + */ + capabilities: string[]; + /** + * Name of the extension requesting permission access + */ + extensionName: string; + /** + * Prompt kind discriminator + */ + kind: "extension-permission-access"; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * Extension sensitive environment variable access prompt */ export interface PermissionPromptRequestExtensionEnvAccess { - /** - * Assisted-approval judge information for this request; present only in assisted mode. - * - * @experimental - */ - assistedApproval?: PermissionAssistedApproval; - /** - * Names of the sensitive environment variables the extension is requesting. Values never appear here. - * - * @minItems 1 - */ - environmentVariables: [string, ...string[]]; - /** - * Name of the extension requesting environment variable access - */ - extensionName: string; - /** - * Prompt kind discriminator - */ - kind: "extension-env-access"; - /** - * Tool call ID that triggered this permission request - */ - toolCallId?: string; + /** + * Assisted-approval judge information for this request; present only in assisted mode. + * + * @experimental + */ + assistedApproval?: PermissionAssistedApproval; + /** + * Names of the sensitive environment variables the extension is requesting. Values never appear here. + * + * @minItems 1 + */ + environmentVariables: [string, ...string[]]; + /** + * Name of the extension requesting environment variable access + */ + extensionName: string; + /** + * Prompt kind discriminator + */ + kind: "extension-env-access"; + /** + * Tool call ID that triggered this permission request + */ + toolCallId?: string; } /** * Session event "permission.completed". Permission request completion notification signaling UI dismissal */ export interface PermissionCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: PermissionCompletedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "permission.completed". - */ - type: "permission.completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: PermissionCompletedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "permission.completed". + */ + type: "permission.completed"; } /** * Permission request completion notification signaling UI dismissal */ export interface PermissionCompletedData { - /** - * Request ID of the resolved permission request; clients should dismiss any UI for this request - */ - requestId: string; - result: PermissionResult; - /** - * Optional tool call ID associated with this permission prompt; clients may use it to correlate UI created from tool-scoped prompts - */ - toolCallId?: string; + /** + * Request ID of the resolved permission request; clients should dismiss any UI for this request + */ + requestId: string; + result: PermissionResult; + /** + * Optional tool call ID associated with this permission prompt; clients may use it to correlate UI created from tool-scoped prompts + */ + toolCallId?: string; } /** * Permission response variant indicating the request was approved without persisting an approval rule. */ export interface PermissionApproved { - /** - * The permission request was approved - */ - kind: "approved"; - /** - * Whether a managed approval policy already handled this request - */ - managedApprovalHandled?: boolean; + /** + * The permission request was approved + */ + kind: "approved"; + /** + * Whether a managed approval policy already handled this request + */ + managedApprovalHandled?: boolean; } /** * Permission response variant that approves a request and remembers the provided approval for the rest of the session. */ export interface PermissionApprovedForSession { - approval: UserToolSessionApproval; - /** - * Approved and remembered for the rest of the session - */ - kind: "approved-for-session"; - /** - * Whether a managed approval policy already handled this request - */ - managedApprovalHandled?: boolean; + approval: UserToolSessionApproval; + /** + * Approved and remembered for the rest of the session + */ + kind: "approved-for-session"; + /** + * Whether a managed approval policy already handled this request + */ + managedApprovalHandled?: boolean; } /** * Session-scoped tool-approval rule for specific shell command identifiers. */ export interface UserToolSessionApprovalCommands { - /** - * Command identifiers approved by the user - */ - commandIdentifiers: string[]; - /** - * Command approval kind - */ - kind: "commands"; + /** + * Command identifiers approved by the user + */ + commandIdentifiers: string[]; + /** + * Command approval kind + */ + kind: "commands"; } /** * Session-scoped tool-approval rule for read-only filesystem operations. */ export interface UserToolSessionApprovalRead { - /** - * Read approval kind - */ - kind: "read"; + /** + * Read approval kind + */ + kind: "read"; } /** * Session-scoped tool-approval rule for filesystem write operations. */ export interface UserToolSessionApprovalWrite { - /** - * Write approval kind - */ - kind: "write"; + /** + * Write approval kind + */ + kind: "write"; } /** * Session-scoped tool-approval rule for an MCP server tool, or all tools on the server when `toolName` is null. */ export interface UserToolSessionApprovalMcp { - /** - * MCP tool approval kind - */ - kind: "mcp"; - /** - * MCP server name - */ - serverName: string; - /** - * Optional MCP tool name, or null for all tools on the server - */ - toolName: string | null; + /** + * MCP tool approval kind + */ + kind: "mcp"; + /** + * MCP server name + */ + serverName: string; + /** + * Optional MCP tool name, or null for all tools on the server + */ + toolName: string | null; } /** * Session-scoped tool-approval rule for writes to long-term memory. */ export interface UserToolSessionApprovalMemory { - /** - * Memory approval kind - */ - kind: "memory"; + /** + * Memory approval kind + */ + kind: "memory"; } /** * Session-scoped tool-approval rule for a custom tool, keyed by tool name. */ export interface UserToolSessionApprovalCustomTool { - /** - * Custom tool approval kind - */ - kind: "custom-tool"; - /** - * Custom tool name - */ - toolName: string; + /** + * Custom tool approval kind + */ + kind: "custom-tool"; + /** + * Custom tool name + */ + toolName: string; } /** * Session-scoped tool-approval rule for extension-management operations, optionally narrowed by operation. */ export interface UserToolSessionApprovalExtensionManagement { - /** - * Extension management approval kind - */ - kind: "extension-management"; - /** - * Optional operation identifier - */ - operation?: string; + /** + * Extension management approval kind + */ + kind: "extension-management"; + /** + * Optional operation identifier + */ + operation?: string; } /** * Session-scoped factory approval, optionally narrowed by approval key. */ export interface UserToolSessionApprovalFactory { - /** - * Optional factory operation name or canonical approval key - */ - approvalKey?: string; - /** - * Factory approval kind - */ - kind: "factory"; + /** + * Optional factory operation name or canonical approval key + */ + approvalKey?: string; + /** + * Factory approval kind + */ + kind: "factory"; } /** * Session-scoped tool-approval rule for an extension's permission-gated capability access, keyed by extension name. */ export interface UserToolSessionApprovalExtensionPermissionAccess { - /** - * Extension name - */ - extensionName: string; - /** - * Extension permission access approval kind - */ - kind: "extension-permission-access"; + /** + * Extension name + */ + extensionName: string; + /** + * Extension permission access approval kind + */ + kind: "extension-permission-access"; } /** * Session-scoped tool-approval rule for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names. */ export interface UserToolSessionApprovalExtensionEnvAccess { - /** - * Names of the sensitive environment variables this approval covers. Values are never persisted. - * - * @minItems 1 - */ - environmentVariables: [string, ...string[]]; - /** - * Extension name - */ - extensionName: string; - /** - * Extension environment access approval kind - */ - kind: "extension-env-access"; + /** + * Names of the sensitive environment variables this approval covers. Values are never persisted. + * + * @minItems 1 + */ + environmentVariables: [string, ...string[]]; + /** + * Extension name + */ + extensionName: string; + /** + * Extension environment access approval kind + */ + kind: "extension-env-access"; } /** * Permission response variant that approves a request and persists the provided approval to a project location key. */ export interface PermissionApprovedForLocation { - approval: UserToolSessionApproval; - /** - * Approved and persisted for this project location - */ - kind: "approved-for-location"; - /** - * The location key (git root or cwd) to persist the approval to - */ - locationKey: string; - /** - * Whether a managed approval policy already handled this request - */ - managedApprovalHandled?: boolean; + approval: UserToolSessionApproval; + /** + * Approved and persisted for this project location + */ + kind: "approved-for-location"; + /** + * The location key (git root or cwd) to persist the approval to + */ + locationKey: string; + /** + * Whether a managed approval policy already handled this request + */ + managedApprovalHandled?: boolean; } /** * Permission response variant indicating the request was cancelled before use, with an optional reason. */ export interface PermissionCancelled { - /** - * The permission request was cancelled before a response was used - */ - kind: "cancelled"; - /** - * Optional explanation of why the request was cancelled - */ - reason?: string; + /** + * The permission request was cancelled before a response was used + */ + kind: "cancelled"; + /** + * Optional explanation of why the request was cancelled + */ + reason?: string; } /** * Permission response variant denied because matching approval rules explicitly blocked the request. */ export interface PermissionDeniedByRules { - /** - * Denied because approval rules explicitly blocked it - */ - kind: "denied-by-rules"; - /** - * Rules that denied the request - */ - rules: PermissionRule[]; + /** + * Denied because approval rules explicitly blocked it + */ + kind: "denied-by-rules"; + /** + * Rules that denied the request + */ + rules: PermissionRule[]; } /** * A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value. */ export interface PermissionRule { - /** - * Argument value matched against the request, or null when the rule kind has no argument (e.g. 'read', 'write', 'memory'). - */ - argument: string | null; - /** - * The rule kind, such as Shell or GitHubMCP - */ - kind: string; + /** + * Argument value matched against the request, or null when the rule kind has no argument (e.g. 'read', 'write', 'memory'). + */ + argument: string | null; + /** + * The rule kind, such as Shell or GitHubMCP + */ + kind: string; } /** * Permission response variant denied because no approval rule matched and user confirmation was unavailable. */ export interface PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser { - /** - * Denied because no approval rule matched and user confirmation was unavailable - */ - kind: "denied-no-approval-rule-and-could-not-request-from-user"; + /** + * Denied because no approval rule matched and user confirmation was unavailable + */ + kind: "denied-no-approval-rule-and-could-not-request-from-user"; } /** * Permission response variant denied in an interactive user prompt, with optional feedback and force-reject flag. */ export interface PermissionDeniedInteractivelyByUser { - /** - * Optional feedback from the user explaining the denial - */ - feedback?: string; - /** - * Whether to force-reject the current agent turn - */ - forceReject?: boolean; - /** - * Denied by the user during an interactive prompt - */ - kind: "denied-interactively-by-user"; + /** + * Optional feedback from the user explaining the denial + */ + feedback?: string; + /** + * Whether to force-reject the current agent turn + */ + forceReject?: boolean; + /** + * Denied by the user during an interactive prompt + */ + kind: "denied-interactively-by-user"; } /** * Permission response variant denying a path under content exclusion policy, with the path and message. */ export interface PermissionDeniedByContentExclusionPolicy { - /** - * Denied by the organization's content exclusion policy - */ - kind: "denied-by-content-exclusion-policy"; - /** - * Human-readable explanation of why the path was excluded - */ - message: string; - /** - * File path that triggered the exclusion - */ - path: string; + /** + * Denied by the organization's content exclusion policy + */ + kind: "denied-by-content-exclusion-policy"; + /** + * Human-readable explanation of why the path was excluded + */ + message: string; + /** + * File path that triggered the exclusion + */ + path: string; } /** * Permission response variant denied by a permission-request hook, with optional message and interrupt flag. */ export interface PermissionDeniedByPermissionRequestHook { - /** - * Whether to interrupt the current agent turn - */ - interrupt?: boolean; - /** - * Denied by a permission request hook registered by an extension or plugin - */ - kind: "denied-by-permission-request-hook"; - /** - * Optional message from the hook explaining the denial - */ - message?: string; + /** + * Whether to interrupt the current agent turn + */ + interrupt?: boolean; + /** + * Denied by a permission request hook registered by an extension or plugin + */ + kind: "denied-by-permission-request-hook"; + /** + * Optional message from the hook explaining the denial + */ + message?: string; } /** * Session event "user_input.requested". User input request notification with question and optional predefined choices */ export interface UserInputRequestedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: UserInputRequestedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "user_input.requested". - */ - type: "user_input.requested"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: UserInputRequestedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "user_input.requested". + */ + type: "user_input.requested"; } /** * User input request notification with question and optional predefined choices */ export interface UserInputRequestedData { - /** - * Whether the user can provide a free-form text response in addition to predefined choices - */ - allowFreeform?: boolean; - /** - * Predefined choices for the user to select from, if applicable - */ - choices?: string[]; - /** - * The question or prompt to present to the user - */ - question: string; - /** - * Unique identifier for this input request; used to respond via session.respondToUserInput() - */ - requestId: string; - /** - * The LLM-assigned tool call ID that triggered this request; used by remote UIs to correlate responses - */ - toolCallId?: string; + /** + * Whether the user can provide a free-form text response in addition to predefined choices + */ + allowFreeform?: boolean; + /** + * Predefined choices for the user to select from, if applicable + */ + choices?: string[]; + /** + * The question or prompt to present to the user + */ + question: string; + /** + * Unique identifier for this input request; used to respond via session.respondToUserInput() + */ + requestId: string; + /** + * The LLM-assigned tool call ID that triggered this request; used by remote UIs to correlate responses + */ + toolCallId?: string; } /** * Session event "user_input.completed". User input request completion with the user's response */ export interface UserInputCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: UserInputCompletedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "user_input.completed". - */ - type: "user_input.completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: UserInputCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "user_input.completed". + */ + type: "user_input.completed"; } /** * User input request completion with the user's response */ export interface UserInputCompletedData { - /** - * The user's answer to the input request - */ - answer?: string; - /** - * Request ID of the resolved user input request; clients should dismiss any UI for this request - */ - requestId: string; - /** - * Whether the answer was typed as free-form text rather than selected from choices - */ - wasFreeform?: boolean; + /** + * The user's answer to the input request + */ + answer?: string; + /** + * Request ID of the resolved user input request; clients should dismiss any UI for this request + */ + requestId: string; + /** + * Whether the answer was typed as free-form text rather than selected from choices + */ + wasFreeform?: boolean; } /** * Session event "elicitation.requested". Elicitation request; may be form-based (structured input) or URL-based (browser redirect) */ export interface ElicitationRequestedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ElicitationRequestedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "elicitation.requested". - */ - type: "elicitation.requested"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ElicitationRequestedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "elicitation.requested". + */ + type: "elicitation.requested"; } /** * Elicitation request; may be form-based (structured input) or URL-based (browser redirect) */ export interface ElicitationRequestedData { - /** - * The source that initiated the request (MCP server name, or absent for agent-initiated) - */ - elicitationSource?: string; - /** - * Message describing what information is needed from the user - */ - message: string; - mode?: ElicitationRequestedMode; - requestedSchema?: ElicitationRequestedSchema; - /** - * Unique identifier for this elicitation request; used to respond via session.respondToElicitation() - */ - requestId: string; - /** - * Tool call ID from the LLM completion; used to correlate with CompletionChunk.toolCall.id for remote UIs - */ - toolCallId?: string; - /** - * URL to open in the user's browser (url mode only) - */ - url?: string; + /** + * The source that initiated the request (MCP server name, or absent for agent-initiated) + */ + elicitationSource?: string; + /** + * Message describing what information is needed from the user + */ + message: string; + mode?: ElicitationRequestedMode; + requestedSchema?: ElicitationRequestedSchema; + /** + * Unique identifier for this elicitation request; used to respond via session.respondToElicitation() + */ + requestId: string; + /** + * Tool call ID from the LLM completion; used to correlate with CompletionChunk.toolCall.id for remote UIs + */ + toolCallId?: string; + /** + * URL to open in the user's browser (url mode only) + */ + url?: string; } /** * JSON Schema describing the form fields to present to the user (form mode only) */ export interface ElicitationRequestedSchema { - /** - * Form field definitions, keyed by field name - */ - properties: { - [k: string]: JsonValue | undefined; - }; - /** - * List of required field names - */ - required?: string[]; - /** - * Schema type indicator (always 'object') - */ - type: "object"; + /** + * Form field definitions, keyed by field name + */ + properties: { + [k: string]: JsonValue | undefined; + }; + /** + * List of required field names + */ + required?: string[]; + /** + * Schema type indicator (always 'object') + */ + type: "object"; } /** * Session event "elicitation.completed". Elicitation request completion with the user's response */ export interface ElicitationCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ElicitationCompletedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "elicitation.completed". - */ - type: "elicitation.completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ElicitationCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "elicitation.completed". + */ + type: "elicitation.completed"; } /** * Elicitation request completion with the user's response */ export interface ElicitationCompletedData { - action?: ElicitationCompletedAction; - /** - * The submitted form data when action is 'accept'; keys match the requested schema fields - */ - content?: { - [k: string]: ElicitationCompletedContent | undefined; - }; - /** - * Request ID of the resolved elicitation request; clients should dismiss any UI for this request - */ - requestId: string; + action?: ElicitationCompletedAction; + /** + * The submitted form data when action is 'accept'; keys match the requested schema fields + */ + content?: { + [k: string]: ElicitationCompletedContent | undefined; + }; + /** + * Request ID of the resolved elicitation request; clients should dismiss any UI for this request + */ + requestId: string; } /** * Session event "sampling.requested". Sampling request from an MCP server; contains the server name and a requestId for correlation */ export interface SamplingRequestedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SamplingRequestedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "sampling.requested". - */ - type: "sampling.requested"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SamplingRequestedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "sampling.requested". + */ + type: "sampling.requested"; } /** * Sampling request from an MCP server; contains the server name and a requestId for correlation */ export interface SamplingRequestedData { - /** - * The JSON-RPC request ID from the MCP protocol - */ - mcpRequestId: JsonValue; - /** - * Unique identifier for this sampling request; used to respond via session.respondToSampling() - */ - requestId: string; - /** - * Name of the MCP server that initiated the sampling request - */ - serverName: string; + /** + * The JSON-RPC request ID from the MCP protocol + */ + mcpRequestId: JsonValue; + /** + * Unique identifier for this sampling request; used to respond via session.respondToSampling() + */ + requestId: string; + /** + * Name of the MCP server that initiated the sampling request + */ + serverName: string; } /** * Session event "sampling.completed". Sampling request completion notification signaling UI dismissal */ export interface SamplingCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SamplingCompletedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "sampling.completed". - */ - type: "sampling.completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SamplingCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "sampling.completed". + */ + type: "sampling.completed"; } /** * Sampling request completion notification signaling UI dismissal */ export interface SamplingCompletedData { - /** - * Request ID of the resolved sampling request; clients should dismiss any UI for this request - */ - requestId: string; + /** + * Request ID of the resolved sampling request; clients should dismiss any UI for this request + */ + requestId: string; } /** * Session event "mcp.oauth_required". OAuth authentication request for an MCP server */ export interface McpOauthRequiredEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: McpOauthRequiredData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "mcp.oauth_required". - */ - type: "mcp.oauth_required"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpOauthRequiredData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "mcp.oauth_required". + */ + type: "mcp.oauth_required"; } /** * OAuth authentication request for an MCP server */ export interface McpOauthRequiredData { - httpResponse?: McpOauthHttpResponse; - reason: McpOauthRequestReason; - /** - * Unique identifier for this OAuth request; used to respond via session.mcp.oauth.handlePendingRequest - */ - requestId: string; - /** - * Raw OAuth protected-resource metadata document fetched for the MCP server, if available - */ - resourceMetadata?: string; - /** - * Display name of the MCP server that requires OAuth - */ - serverName: string; - /** - * URL of the MCP server that requires OAuth - */ - serverUrl: string; - staticClientConfig?: McpOauthRequiredStaticClientConfig; - wwwAuthenticateParams?: McpOauthWWWAuthenticateParams; + httpResponse?: McpOauthHttpResponse; + reason: McpOauthRequestReason; + /** + * Unique identifier for this OAuth request; used to respond via session.mcp.oauth.handlePendingRequest + */ + requestId: string; + /** + * Raw OAuth protected-resource metadata document fetched for the MCP server, if available + */ + resourceMetadata?: string; + /** + * Display name of the MCP server that requires OAuth + */ + serverName: string; + /** + * URL of the MCP server that requires OAuth + */ + serverUrl: string; + staticClientConfig?: McpOauthRequiredStaticClientConfig; + wwwAuthenticateParams?: McpOauthWWWAuthenticateParams; } /** * Raw HTTP response details from the OAuth auth challenge, as observed by the runtime. */ export interface McpOauthHttpResponse { - /** - * Complete UTF-8 response body for host-specific challenge handling, including an empty string for an empty body. Omitted when the complete body is not valid UTF-8; body read failures fail the HTTP operation rather than exposing a partial response. - */ - body?: string; - /** - * HTTP response headers as observed by the runtime. Order and casing are transport-dependent, and duplicate header names may appear multiple times. - */ - headers: HeaderEntry[]; - /** - * HTTP status code returned with the auth challenge. - */ - statusCode: number; + /** + * Complete UTF-8 response body for host-specific challenge handling, including an empty string for an empty body. Omitted when the complete body is not valid UTF-8; body read failures fail the HTTP operation rather than exposing a partial response. + */ + body?: string; + /** + * HTTP response headers as observed by the runtime. Order and casing are transport-dependent, and duplicate header names may appear multiple times. + */ + headers: HeaderEntry[]; + /** + * HTTP status code returned with the auth challenge. + */ + statusCode: number; } /** * Single HTTP header entry as a name/value pair. */ export interface HeaderEntry { - /** - * HTTP response header name as observed by the runtime. - */ - name: string; - /** - * HTTP response header value as observed by the runtime. - */ - value: string; + /** + * HTTP response header name as observed by the runtime. + */ + name: string; + /** + * HTTP response header value as observed by the runtime. + */ + value: string; } /** * Static OAuth client configuration, if the server specifies one */ export interface McpOauthRequiredStaticClientConfig { - /** - * OAuth client ID for the server - */ - clientId: string; - /** - * Optional OAuth client secret for confidential static clients, when the runtime can resolve one - */ - clientSecret?: string; - /** - * Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server). - */ - grantType?: "client_credentials"; - /** - * Whether this is a public OAuth client - */ - publicClient?: boolean; + /** + * OAuth client ID for the server + */ + clientId: string; + /** + * Optional OAuth client secret for confidential static clients, when the runtime can resolve one + */ + clientSecret?: string; + /** + * Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server). + */ + grantType?: "client_credentials"; + /** + * Whether this is a public OAuth client + */ + publicClient?: boolean; } /** * OAuth WWW-Authenticate parameters parsed from an MCP auth challenge */ export interface McpOauthWWWAuthenticateParams { - /** - * OAuth error from the WWW-Authenticate error parameter, if present - */ - error?: string; - /** - * Protected resource metadata URL from the WWW-Authenticate resource_metadata parameter, if present - */ - resourceMetadataUrl?: string; - /** - * Requested OAuth scopes from the WWW-Authenticate scope parameter, if present - */ - scope?: string; + /** + * OAuth error from the WWW-Authenticate error parameter, if present + */ + error?: string; + /** + * Protected resource metadata URL from the WWW-Authenticate resource_metadata parameter, if present + */ + resourceMetadataUrl?: string; + /** + * Requested OAuth scopes from the WWW-Authenticate scope parameter, if present + */ + scope?: string; } /** * Session event "mcp.oauth_completed". MCP OAuth request completion notification */ export interface McpOauthCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: McpOauthCompletedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "mcp.oauth_completed". - */ - type: "mcp.oauth_completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpOauthCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "mcp.oauth_completed". + */ + type: "mcp.oauth_completed"; } /** * MCP OAuth request completion notification */ export interface McpOauthCompletedData { - outcome: McpOauthCompletionOutcome; - /** - * Request ID of the resolved OAuth request - */ - requestId: string; + outcome: McpOauthCompletionOutcome; + /** + * Request ID of the resolved OAuth request + */ + requestId: string; } /** * Session event "mcp.headers_refresh_required". Dynamic headers refresh request for a remote MCP server */ export interface McpHeadersRefreshRequiredEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: McpHeadersRefreshRequiredData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "mcp.headers_refresh_required". - */ - type: "mcp.headers_refresh_required"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpHeadersRefreshRequiredData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "mcp.headers_refresh_required". + */ + type: "mcp.headers_refresh_required"; } /** * Dynamic headers refresh request for a remote MCP server */ export interface McpHeadersRefreshRequiredData { - reason: McpHeadersRefreshRequiredReason; - /** - * Unique identifier for this headers refresh request; used to respond via session.mcp.headers.handlePendingHeadersRefreshRequest() - */ - requestId: string; - /** - * Display name of the remote MCP server requesting headers - */ - serverName: string; - /** - * URL of the remote MCP server requesting headers - */ - serverUrl: string; + reason: McpHeadersRefreshRequiredReason; + /** + * Unique identifier for this headers refresh request; used to respond via session.mcp.headers.handlePendingHeadersRefreshRequest() + */ + requestId: string; + /** + * Display name of the remote MCP server requesting headers + */ + serverName: string; + /** + * URL of the remote MCP server requesting headers + */ + serverUrl: string; } /** * Session event "mcp.headers_refresh_completed". MCP headers refresh request completion notification */ export interface McpHeadersRefreshCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: McpHeadersRefreshCompletedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "mcp.headers_refresh_completed". - */ - type: "mcp.headers_refresh_completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpHeadersRefreshCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "mcp.headers_refresh_completed". + */ + type: "mcp.headers_refresh_completed"; } /** * MCP headers refresh request completion notification */ export interface McpHeadersRefreshCompletedData { - outcome: McpHeadersRefreshCompletedOutcome; - /** - * Request ID of the resolved headers refresh request - */ - requestId: string; + outcome: McpHeadersRefreshCompletedOutcome; + /** + * Request ID of the resolved headers refresh request + */ + requestId: string; } /** * Session event "session.custom_notification". Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined. */ export interface CustomNotificationEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CustomNotificationData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.custom_notification". - */ - type: "session.custom_notification"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CustomNotificationData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.custom_notification". + */ + type: "session.custom_notification"; } /** * Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined. */ export interface CustomNotificationData { - /** - * Source-defined custom notification name - */ - name: string; - payload: CustomNotificationPayload; - /** - * Namespace for the custom notification producer - */ - source: string; - subject?: CustomNotificationSubject; - /** - * Optional source-defined payload schema version - */ - version?: number; + /** + * Source-defined custom notification name + */ + name: string; + payload: CustomNotificationPayload; + /** + * Namespace for the custom notification producer + */ + source: string; + subject?: CustomNotificationSubject; + /** + * Optional source-defined payload schema version + */ + version?: number; } /** * Optional source-defined string identifiers describing the payload subject */ export interface CustomNotificationSubject { - [k: string]: string | undefined; + [k: string]: string | undefined; } /** * Session event "ui.ephemeral_query". Ordered output and terminal state for a transient query that does not modify conversation history. */ /** @experimental */ export interface UIEphemeralQueryEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: UIEphemeralQueryData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "ui.ephemeral_query". - */ - type: "ui.ephemeral_query"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: UIEphemeralQueryData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "ui.ephemeral_query". + */ + type: "ui.ephemeral_query"; } /** * Ordered output and terminal state for a transient query that does not modify conversation history. */ /** @experimental */ export interface UIEphemeralQueryData { - /** - * Full response text, present for the `completed` phase. - */ - answer?: string; - /** - * Ordered text delta, present for the `chunk` phase. - */ - chunk?: string; - /** - * Model or transport failure message, present for the `failed` phase. - */ - error?: string; - phase: UIEphemeralQueryPhase; - /** - * Runtime-minted query identifier. - */ - requestId: string; + /** + * Full response text, present for the `completed` phase. + */ + answer?: string; + /** + * Ordered text delta, present for the `chunk` phase. + */ + chunk?: string; + /** + * Model or transport failure message, present for the `failed` phase. + */ + error?: string; + phase: UIEphemeralQueryPhase; + /** + * Runtime-minted query identifier. + */ + requestId: string; } /** * Session event "external_tool.requested". External tool invocation request for client-side tool execution */ export interface ExternalToolRequestedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ExternalToolRequestedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "external_tool.requested". - */ - type: "external_tool.requested"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ExternalToolRequestedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "external_tool.requested". + */ + type: "external_tool.requested"; } /** * External tool invocation request for client-side tool execution */ export interface ExternalToolRequestedData { - /** - * Arguments to pass to the external tool - */ - arguments?: JsonValue; - /** - * Stable provider identity captured with an extension-owned tool definition; hosts use it to route the request to the same provider that was offered to the model - */ - providerId?: string | null; - /** - * Unique identifier for this request; used to respond via session.respondToExternalTool() - */ - requestId: string; - /** - * Session ID that this external tool request belongs to - */ - sessionId: string; - /** - * Tool call ID assigned to this external tool invocation - */ - toolCallId: string; - /** - * Name of the external tool to invoke - */ - toolName: string; - /** - * W3C Trace Context traceparent header for the execute_tool span - */ - traceparent?: string; - /** - * W3C Trace Context tracestate header for the execute_tool span - */ - tracestate?: string; - /** - * Active session working directory, when known. - */ - workingDirectory?: string; + /** + * Arguments to pass to the external tool + */ + arguments?: JsonValue; + /** + * Stable provider identity captured with an extension-owned tool definition; hosts use it to route the request to the same provider that was offered to the model + */ + providerId?: string | null; + /** + * Unique identifier for this request; used to respond via session.respondToExternalTool() + */ + requestId: string; + /** + * Session ID that this external tool request belongs to + */ + sessionId: string; + /** + * Tool call ID assigned to this external tool invocation + */ + toolCallId: string; + /** + * Name of the external tool to invoke + */ + toolName: string; + /** + * W3C Trace Context traceparent header for the execute_tool span + */ + traceparent?: string; + /** + * W3C Trace Context tracestate header for the execute_tool span + */ + tracestate?: string; + /** + * Active session working directory, when known. + */ + workingDirectory?: string; } /** * Session event "external_tool.completed". External tool completion notification signaling UI dismissal */ export interface ExternalToolCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ExternalToolCompletedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral?: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "external_tool.completed". - */ - type: "external_tool.completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ExternalToolCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral?: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "external_tool.completed". + */ + type: "external_tool.completed"; } /** * External tool completion notification signaling UI dismissal */ export interface ExternalToolCompletedData { - /** - * Request ID of the resolved external tool request; clients should dismiss any UI for this request - */ - requestId: string; + /** + * Request ID of the resolved external tool request; clients should dismiss any UI for this request + */ + requestId: string; } /** * Session event "command.queued". Queued slash command dispatch request for client execution */ export interface CommandQueuedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CommandQueuedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "command.queued". - */ - type: "command.queued"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CommandQueuedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "command.queued". + */ + type: "command.queued"; } /** * Queued slash command dispatch request for client execution */ export interface CommandQueuedData { - /** - * The slash command text to be executed (e.g., /help, /clear) - */ - command: string; - /** - * Unique identifier for this request; used to respond via session.respondToQueuedCommand() - */ - requestId: string; + /** + * The slash command text to be executed (e.g., /help, /clear) + */ + command: string; + /** + * Unique identifier for this request; used to respond via session.respondToQueuedCommand() + */ + requestId: string; } /** * Session event "command.execute". Registered command dispatch request routed to the owning client */ export interface CommandExecuteEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CommandExecuteData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "command.execute". - */ - type: "command.execute"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CommandExecuteData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "command.execute". + */ + type: "command.execute"; } /** * Registered command dispatch request routed to the owning client */ export interface CommandExecuteData { - /** - * Raw argument string after the command name - */ - args: string; - /** - * The full command text (e.g., /deploy production) - */ - command: string; - /** - * Command name without leading / - */ - commandName: string; - /** - * Unique identifier; used to respond via session.commands.handlePendingCommand() - */ - requestId: string; + /** + * Raw argument string after the command name + */ + args: string; + /** + * The full command text (e.g., /deploy production) + */ + command: string; + /** + * Command name without leading / + */ + commandName: string; + /** + * Unique identifier; used to respond via session.commands.handlePendingCommand() + */ + requestId: string; } /** * Session event "command.completed". Queued command completion notification signaling UI dismissal */ export interface CommandCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CommandCompletedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "command.completed". - */ - type: "command.completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CommandCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "command.completed". + */ + type: "command.completed"; } /** * Queued command completion notification signaling UI dismissal */ export interface CommandCompletedData { - /** - * Request ID of the resolved command request; clients should dismiss any UI for this request - */ - requestId: string; + /** + * Request ID of the resolved command request; clients should dismiss any UI for this request + */ + requestId: string; } /** * Session event "auto_mode_switch.requested". Auto mode switch request notification requiring user approval */ export interface AutoModeSwitchRequestedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AutoModeSwitchRequestedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "auto_mode_switch.requested". - */ - type: "auto_mode_switch.requested"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AutoModeSwitchRequestedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "auto_mode_switch.requested". + */ + type: "auto_mode_switch.requested"; } /** * Auto mode switch request notification requiring user approval */ export interface AutoModeSwitchRequestedData { - /** - * The rate limit error code that triggered this request - */ - errorCode?: string; - /** - * Unique identifier for this request; used to respond via session.respondToAutoModeSwitch() - */ - requestId: string; - /** - * Seconds until the rate limit resets, when known. Lets clients render a humanized reset time alongside the prompt. - */ - retryAfterSeconds?: number; + /** + * The rate limit error code that triggered this request + */ + errorCode?: string; + /** + * Unique identifier for this request; used to respond via session.respondToAutoModeSwitch() + */ + requestId: string; + /** + * Seconds until the rate limit resets, when known. Lets clients render a humanized reset time alongside the prompt. + */ + retryAfterSeconds?: number; } /** * Session event "auto_mode_switch.completed". Auto mode switch completion notification */ export interface AutoModeSwitchCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AutoModeSwitchCompletedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "auto_mode_switch.completed". - */ - type: "auto_mode_switch.completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AutoModeSwitchCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "auto_mode_switch.completed". + */ + type: "auto_mode_switch.completed"; } /** * Auto mode switch completion notification */ export interface AutoModeSwitchCompletedData { - /** - * Request ID of the resolved request; clients should dismiss any UI for this request - */ - requestId: string; - response: AutoModeSwitchResponse; + /** + * Request ID of the resolved request; clients should dismiss any UI for this request + */ + requestId: string; + response: AutoModeSwitchResponse; } /** * Session event "session_limits_exhausted.requested". Session limit exhaustion notification requiring user action. */ export interface SessionLimitsExhaustedRequestedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SessionLimitsExhaustedRequestedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session_limits_exhausted.requested". - */ - type: "session_limits_exhausted.requested"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SessionLimitsExhaustedRequestedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session_limits_exhausted.requested". + */ + type: "session_limits_exhausted.requested"; } /** * Session limit exhaustion notification requiring user action. */ export interface SessionLimitsExhaustedRequestedData { - /** - * Configured max AI Credits for the current accounting window. - */ - maxAiCredits: number; - /** - * Unique identifier for this request; used to respond via session.ui.handlePendingSessionLimitsExhausted(). - */ - requestId: string; - /** - * AI Credits already consumed in the current accounting window. - */ - usedAiCredits: number; + /** + * Configured max AI Credits for the current accounting window. + */ + maxAiCredits: number; + /** + * Unique identifier for this request; used to respond via session.ui.handlePendingSessionLimitsExhausted(). + */ + requestId: string; + /** + * AI Credits already consumed in the current accounting window. + */ + usedAiCredits: number; } /** * Session event "session_limits_exhausted.completed". Session limit exhaustion prompt completion notification. */ export interface SessionLimitsExhaustedCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SessionLimitsExhaustedCompletedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session_limits_exhausted.completed". - */ - type: "session_limits_exhausted.completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SessionLimitsExhaustedCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session_limits_exhausted.completed". + */ + type: "session_limits_exhausted.completed"; } /** * Session limit exhaustion prompt completion notification. */ export interface SessionLimitsExhaustedCompletedData { - /** - * Request ID of the resolved request; clients should dismiss any UI for this request. - */ - requestId: string; - response: SessionLimitsExhaustedResponse; + /** + * Request ID of the resolved request; clients should dismiss any UI for this request. + */ + requestId: string; + response: SessionLimitsExhaustedResponse; } /** * The user's selected action for an exhausted session limit. */ export interface SessionLimitsExhaustedResponse { - action: SessionLimitsExhaustedResponseAction; - /** - * AI Credits to add to the current max when action is 'add'. - */ - additionalAiCredits?: number; - /** - * New absolute max AI Credits when action is 'set'. - */ - maxAiCredits?: number; + action: SessionLimitsExhaustedResponseAction; + /** + * AI Credits to add to the current max when action is 'add'. + */ + additionalAiCredits?: number; + /** + * New absolute max AI Credits when action is 'set'. + */ + maxAiCredits?: number; } /** * Session event "session.auto_mode_resolved". Auto Intent resolution: the concrete model the session settled on for the first prompt of an auto-mode session, and why. Lets SDK clients render the chosen model and the full reason it was picked. The core selection fields (chosenModel/reasoningBucket/categoryScores) are stable; the routing-analytics fields (predictedLabel/confidence/candidateModels) mirror the upstream intent service and may evolve, hence the event's experimental stability. */ /** @experimental */ export interface AutoModeResolvedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: AutoModeResolvedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.auto_mode_resolved". - */ - type: "session.auto_mode_resolved"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: AutoModeResolvedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.auto_mode_resolved". + */ + type: "session.auto_mode_resolved"; } /** * Auto Intent resolution: the concrete model the session settled on for the first prompt of an auto-mode session, and why. Lets SDK clients render the chosen model and the full reason it was picked. The core selection fields (chosenModel/reasoningBucket/categoryScores) are stable; the routing-analytics fields (predictedLabel/confidence/candidateModels) mirror the upstream intent service and may evolve, hence the event's experimental stability. */ /** @experimental */ export interface AutoModeResolvedData { - /** - * Models offered to the router for this resolution - */ - availableModels?: string[]; - /** - * Ordered candidate model list the router returned, when not a fallback - */ - candidateModels?: string[]; - /** - * Per-category classifier scores (0-1) behind the bucket: the granular HYDRA capability scores (reasoning, code_gen, debugging, tool_use), or the binary needs_reasoning/no_reasoning scores when HYDRA didn't run. Lets clients show a breakdown rather than just the bucket. - */ - categoryScores?: { - [k: string]: number | undefined; - }; - /** - * The concrete model the session will use after any intent refinement - */ - chosenModel: string; - /** - * The chosen model's score shortfall relative to the top candidate - */ - chosenShortfall?: number; - /** - * Classifier confidence for the predicted label, when available - */ - confidence?: number; - /** - * End-to-end client wait time for the router request in milliseconds - */ - endToEndLatencyMs?: number; - /** - * Whether the router fell back to the standard Auto selection - */ - fallback?: boolean; - /** - * Server-provided reason for falling back, when available - */ - fallbackReason?: string; - /** - * Whether the routed prompt contained an image - */ - hasImage?: boolean; - /** - * The predicted classifier label (e.g. `needs_reasoning`), when available - */ - predictedLabel?: string; - reasoningBucket?: AutoModeResolvedReasoningBucket; - /** - * Server-reported router processing time in milliseconds - */ - routerLatencyMs?: number; - /** - * The routing method the server applied, when Auto Intent ran - */ - routingMethod?: string; - /** - * Whether a sticky model choice overrode the router result - */ - stickyOverride?: boolean; + /** + * Models offered to the router for this resolution + */ + availableModels?: string[]; + /** + * Ordered candidate model list the router returned, when not a fallback + */ + candidateModels?: string[]; + /** + * Per-category classifier scores (0-1) behind the bucket: the granular HYDRA capability scores (reasoning, code_gen, debugging, tool_use), or the binary needs_reasoning/no_reasoning scores when HYDRA didn't run. Lets clients show a breakdown rather than just the bucket. + */ + categoryScores?: { + [k: string]: number | undefined; + }; + /** + * The concrete model the session will use after any intent refinement + */ + chosenModel: string; + /** + * The chosen model's score shortfall relative to the top candidate + */ + chosenShortfall?: number; + /** + * Classifier confidence for the predicted label, when available + */ + confidence?: number; + /** + * End-to-end client wait time for the router request in milliseconds + */ + endToEndLatencyMs?: number; + /** + * Whether the router fell back to the standard Auto selection + */ + fallback?: boolean; + /** + * Server-provided reason for falling back, when available + */ + fallbackReason?: string; + /** + * Whether the routed prompt contained an image + */ + hasImage?: boolean; + /** + * The predicted classifier label (e.g. `needs_reasoning`), when available + */ + predictedLabel?: string; + reasoningBucket?: AutoModeResolvedReasoningBucket; + /** + * Server-reported router processing time in milliseconds + */ + routerLatencyMs?: number; + /** + * The routing method the server applied, when Auto Intent ran + */ + routingMethod?: string; + /** + * Whether a sticky model choice overrode the router result + */ + stickyOverride?: boolean; } /** * Session event "session.managed_settings_resolved". Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values, then the policy helper, per ordinary key, while permissions compose restrictively across device, server, policy-helper, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes. */ /** @experimental */ export interface ManagedSettingsResolvedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ManagedSettingsResolvedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.managed_settings_resolved". - */ - type: "session.managed_settings_resolved"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ManagedSettingsResolvedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.managed_settings_resolved". + */ + type: "session.managed_settings_resolved"; } /** * Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values, then the policy helper, per ordinary key, while permissions compose restrictively across device, server, policy-helper, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes. */ /** @experimental */ export interface ManagedSettingsResolvedData { - /** - * Whether enterprise policy disables bypass-permissions ("yolo") mode for this session. Deny-wins across layers, and forced on when `failClosed` is true. - */ - bypassPermissionsDisabled: boolean; - /** - * Whether a session-local permissions layer injected by the SDK host was present - */ - clientManaged?: boolean; - /** - * Whether an actual device MDM/plist/registry/file managed-settings layer was present - */ - deviceManaged: boolean; - /** - * Whether managed policy could not be determined (e.g. a failed server fetch) and the session fell back to the fail-closed restriction. When true, restrictions such as disabling bypass-permissions are enforced even though `settings` may be absent. - */ - failClosed: boolean; - /** - * The setting keys under enterprise management in the effective managed settings (e.g. `model`, `enabledPlugins`, `permissions`). Empty when no managed settings are in force. - */ - managedKeys: string[]; - /** - * Whether at least two managed sources supplied permission allowlists, so enforcement intersects them and the flattened settings payload omits `permissions.allow`. - */ - permissionsAllowIntersected?: boolean; - /** - * Whether the policy-helper managed-settings layer was present. The policy helper is the weakest channel: it fills keys no enterprise source set and can never replace one. - */ - policyHelperManaged?: boolean; - /** - * Whether the effective sandbox policy forces the sandbox on *only* because managed policy could not be determined, rather than because the policy requires it. Lets clients tell a user whose `--no-sandbox` was overridden that the sandbox stayed on as a fail-closed fallback, instead of attributing it to an administrator who set no such policy. - */ - sandboxEnabledByUndeterminedPolicy?: boolean; - /** - * Whether the server (account/org) managed-settings layer was present - */ - serverManaged: boolean; - /** - * The effective (resolved) managed settings values, so clients can render exactly what is enforced. Absent when no managed policy is in force. - */ - settings?: JsonValue; - source: ManagedSettingsResolvedSource; + /** + * Whether enterprise policy disables bypass-permissions ("yolo") mode for this session. Deny-wins across layers, and forced on when `failClosed` is true. + */ + bypassPermissionsDisabled: boolean; + /** + * Whether a session-local permissions layer injected by the SDK host was present + */ + clientManaged?: boolean; + /** + * Whether an actual device MDM/plist/registry/file managed-settings layer was present + */ + deviceManaged: boolean; + /** + * Whether managed policy could not be determined (e.g. a failed server fetch) and the session fell back to the fail-closed restriction. When true, restrictions such as disabling bypass-permissions are enforced even though `settings` may be absent. + */ + failClosed: boolean; + /** + * The setting keys under enterprise management in the effective managed settings (e.g. `model`, `enabledPlugins`, `permissions`). Empty when no managed settings are in force. + */ + managedKeys: string[]; + /** + * Whether at least two managed sources supplied permission allowlists, so enforcement intersects them and the flattened settings payload omits `permissions.allow`. + */ + permissionsAllowIntersected?: boolean; + /** + * Whether the policy-helper managed-settings layer was present. The policy helper is the weakest channel: it fills keys no enterprise source set and can never replace one. + */ + policyHelperManaged?: boolean; + /** + * Whether the effective sandbox policy forces the sandbox on *only* because managed policy could not be determined, rather than because the policy requires it. Lets clients tell a user whose `--no-sandbox` was overridden that the sandbox stayed on as a fail-closed fallback, instead of attributing it to an administrator who set no such policy. + */ + sandboxEnabledByUndeterminedPolicy?: boolean; + /** + * Whether the server (account/org) managed-settings layer was present + */ + serverManaged: boolean; + /** + * The effective (resolved) managed settings values, so clients can render exactly what is enforced. Absent when no managed policy is in force. + */ + settings?: JsonValue; + source: ManagedSettingsResolvedSource; } /** * Session event "session.managed_settings_enforced". Runtime enforcement of enterprise managed settings: fires when the session blocks or caps a runtime action because enterprise policy governs it, so SDK clients can explain *why* an action was governed. Unlike `session.managed_settings_resolved` (which reports *what* is managed), this reports a concrete governed action — e.g. a user or host tried to turn on a bypass-permissions escalation while policy disables it. Emitted live (not persisted to the session event log) on user/host-initiated attempts only, never for silent policy application. Marked experimental while the managed-settings surface stabilizes. */ /** @experimental */ export interface ManagedSettingsEnforcedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ManagedSettingsEnforcedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.managed_settings_enforced". - */ - type: "session.managed_settings_enforced"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ManagedSettingsEnforcedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.managed_settings_enforced". + */ + type: "session.managed_settings_enforced"; } /** * Runtime enforcement of enterprise managed settings: fires when the session blocks or caps a runtime action because enterprise policy governs it, so SDK clients can explain *why* an action was governed. Unlike `session.managed_settings_resolved` (which reports *what* is managed), this reports a concrete governed action — e.g. a user or host tried to turn on a bypass-permissions escalation while policy disables it. Emitted live (not persisted to the session event log) on user/host-initiated attempts only, never for silent policy application. Marked experimental while the managed-settings surface stabilizes. */ /** @experimental */ export interface ManagedSettingsEnforcedData { - action: ManagedSettingsEnforcedAction; - escalation?: ManagedSettingsEnforcedEscalation; - /** - * Whether the enforcement was forced by fail-closed handling (managed policy could not be determined) rather than an explicit managed setting. When true, `setting` still names the restriction that was applied. - */ - failClosed: boolean; - /** - * A human-readable explanation of why the action was governed, suitable for surfacing to the user. - */ - message: string; - /** - * The managed setting key responsible for the enforcement (e.g. `permissions.disableBypassPermissionsMode`). - */ - setting: string; + action: ManagedSettingsEnforcedAction; + escalation?: ManagedSettingsEnforcedEscalation; + /** + * Whether the enforcement was forced by fail-closed handling (managed policy could not be determined) rather than an explicit managed setting. When true, `setting` still names the restriction that was applied. + */ + failClosed: boolean; + /** + * A human-readable explanation of why the action was governed, suitable for surfacing to the user. + */ + message: string; + /** + * The managed setting key responsible for the enforcement (e.g. `permissions.disableBypassPermissionsMode`). + */ + setting: string; } /** * Session event "commands.changed". SDK command registration change notification */ export interface CommandsChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CommandsChangedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "commands.changed". - */ - type: "commands.changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CommandsChangedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "commands.changed". + */ + type: "commands.changed"; } /** * SDK command registration change notification */ export interface CommandsChangedData { - /** - * Current list of registered SDK commands - */ - commands: CommandsChangedCommand[]; + /** + * Current list of registered SDK commands + */ + commands: CommandsChangedCommand[]; } /** * A single slash command available in the session, as listed by the `commands.changed` event. */ export interface CommandsChangedCommand { - /** - * Optional human-readable command description. - */ - description?: string; - /** - * Slash command name without the leading slash. - */ - name: string; + /** + * Optional human-readable command description. + */ + description?: string; + /** + * Slash command name without the leading slash. + */ + name: string; } /** * Session event "capabilities.changed". Session capability change notification */ export interface CapabilitiesChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CapabilitiesChangedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "capabilities.changed". - */ - type: "capabilities.changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CapabilitiesChangedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "capabilities.changed". + */ + type: "capabilities.changed"; } /** * Session capability change notification */ export interface CapabilitiesChangedData { - ui?: CapabilitiesChangedUI; + ui?: CapabilitiesChangedUI; } /** * UI capability changes */ export interface CapabilitiesChangedUI { - /** - * Whether canvas rendering is now supported - */ - canvases?: boolean; - /** - * Whether elicitation is now supported - */ - elicitation?: boolean; - /** - * Whether MCP Apps (SEP-1865) UI passthrough is now supported - */ - mcpApps?: boolean; + /** + * Whether canvas rendering is now supported + */ + canvases?: boolean; + /** + * Whether elicitation is now supported + */ + elicitation?: boolean; + /** + * Whether MCP Apps (SEP-1865) UI passthrough is now supported + */ + mcpApps?: boolean; } /** * Session event "exit_plan_mode.requested". Plan approval request with plan content and available user actions */ export interface ExitPlanModeRequestedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ExitPlanModeRequestedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "exit_plan_mode.requested". - */ - type: "exit_plan_mode.requested"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ExitPlanModeRequestedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "exit_plan_mode.requested". + */ + type: "exit_plan_mode.requested"; } /** * Plan approval request with plan content and available user actions */ export interface ExitPlanModeRequestedData { - /** - * Available actions the user can take - */ - actions: ExitPlanModeAction[]; - /** - * Model the session had selected when the plan was authored, when one is known - */ - model?: string; - /** - * Full content of the plan file - */ - planContent: string; - recommendedAction: ExitPlanModeAction; - /** - * Unique identifier for this request; used to respond via session.respondToExitPlanMode() - */ - requestId: string; - /** - * Summary of the plan that was created - */ - summary: string; + /** + * Available actions the user can take + */ + actions: ExitPlanModeAction[]; + /** + * Model the session had selected when the plan was authored, when one is known + */ + model?: string; + /** + * Full content of the plan file + */ + planContent: string; + recommendedAction: ExitPlanModeAction; + /** + * Unique identifier for this request; used to respond via session.respondToExitPlanMode() + */ + requestId: string; + /** + * Summary of the plan that was created + */ + summary: string; } /** * Session event "exit_plan_mode.completed". Plan mode exit completion with the user's approval decision and optional feedback */ export interface ExitPlanModeCompletedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ExitPlanModeCompletedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "exit_plan_mode.completed". - */ - type: "exit_plan_mode.completed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ExitPlanModeCompletedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "exit_plan_mode.completed". + */ + type: "exit_plan_mode.completed"; } /** * Plan mode exit completion with the user's approval decision and optional feedback */ export interface ExitPlanModeCompletedData { - /** - * Whether the plan was approved by the user - */ - approved?: boolean; - /** - * Whether edits should be auto-approved without confirmation - */ - autoApproveEdits?: boolean; - /** - * Free-form feedback from the user if they requested changes to the plan - */ - feedback?: string; - /** - * Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request - */ - requestId: string; - selectedAction?: ExitPlanModeAction; + /** + * Whether the plan was approved by the user + */ + approved?: boolean; + /** + * Whether edits should be auto-approved without confirmation + */ + autoApproveEdits?: boolean; + /** + * Free-form feedback from the user if they requested changes to the plan + */ + feedback?: string; + /** + * Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request + */ + requestId: string; + selectedAction?: ExitPlanModeAction; } /** * Session event "session.tools_updated". Payload of `session.tools_updated` identifying the model whose resolved tools were updated. */ export interface ToolsUpdatedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ToolsUpdatedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.tools_updated". - */ - type: "session.tools_updated"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ToolsUpdatedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.tools_updated". + */ + type: "session.tools_updated"; } /** * Payload of `session.tools_updated` identifying the model whose resolved tools were updated. */ export interface ToolsUpdatedData { - /** - * Identifier of the model the resolved tools apply to. - */ - model: string; + /** + * Identifier of the model the resolved tools apply to. + */ + model: string; } /** * Session event "session.background_tasks_changed". Empty payload for `session.background_tasks_changed`, indicating background task state changed. */ export interface BackgroundTasksChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: BackgroundTasksChangedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.background_tasks_changed". - */ - type: "session.background_tasks_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: BackgroundTasksChangedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.background_tasks_changed". + */ + type: "session.background_tasks_changed"; } /** * Empty payload for `session.background_tasks_changed`, indicating background task state changed. @@ -10768,1078 +10840,1156 @@ export interface BackgroundTasksChangedData {} */ /** @experimental */ export interface FactoryRunUpdatedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FactoryRunUpdatedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "factory.run_updated". - */ - type: "factory.run_updated"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FactoryRunUpdatedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "factory.run_updated". + */ + type: "factory.run_updated"; } /** * Ephemeral invalidation signal for a changed factory run. */ /** @experimental */ export interface FactoryRunUpdatedData { - /** - * Monotonic revision now available for the run. - */ - revision: number; - /** - * Factory run identifier. - */ - runId: string; + /** + * Monotonic revision now available for the run. + */ + revision: number; + /** + * Factory run identifier. + */ + runId: string; } /** * Session event "factory.run_started". Ephemeral signal that a factory run attempt began executing. */ /** @experimental */ export interface FactoryRunStartedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FactoryRunStartedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "factory.run_started". - */ - type: "factory.run_started"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FactoryRunStartedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "factory.run_started". + */ + type: "factory.run_started"; } /** * Ephemeral signal that a factory run attempt began executing. */ /** @experimental */ export interface FactoryRunStartedData { - /** - * Attempt number this start committed; a resumed run increments it. - */ - attempt: number; - /** - * Name of the factory this run executes. Low cardinality by construction. - */ - factoryName: string; - /** - * Identifier of the factory run that started. - */ - runId: string; + /** + * Attempt number this start committed; a resumed run increments it. + */ + attempt: number; + /** + * Name of the factory this run executes. Low cardinality by construction. + */ + factoryName: string; + /** + * Identifier of the factory run that started. + */ + runId: string; } /** * Session event "factory.run_settled". Ephemeral signal that a factory run reached a terminal status. */ /** @experimental */ export interface FactoryRunSettledEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: FactoryRunSettledData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "factory.run_settled". - */ - type: "factory.run_settled"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: FactoryRunSettledData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "factory.run_settled". + */ + type: "factory.run_settled"; } /** * Ephemeral signal that a factory run reached a terminal status. */ /** @experimental */ export interface FactoryRunSettledData { - /** - * AI credits this run consumed, in nano-AIU. - */ - consumedNanoAiu: number; - /** - * Subagents this run consumed against its limits. - */ - consumedSubagents: number; - /** - * Active milliseconds accumulated across every attempt of this run. - */ - elapsedMs: number; - /** - * Typed failure class recorded on the run, when it failed with one (e.g. `factory_limit_reached`). - */ - failureType?: string; - /** - * Identifier of the factory run that settled. - */ - runId: string; - status: FactoryRunSettledStatus; + /** + * AI credits this run consumed, in nano-AIU. + */ + consumedNanoAiu: number; + /** + * Subagents this run consumed against its limits. + */ + consumedSubagents: number; + /** + * Active milliseconds accumulated across every attempt of this run. + */ + elapsedMs: number; + /** + * Typed failure class recorded on the run, when it failed with one (e.g. `factory_limit_reached`). + */ + failureType?: string; + /** + * Identifier of the factory run that settled. + */ + runId: string; + status: FactoryRunSettledStatus; } /** * Session event "session.skills_loaded". Payload of `session.skills_loaded` listing resolved skill metadata. */ export interface SkillsLoadedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: SkillsLoadedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.skills_loaded". - */ - type: "session.skills_loaded"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: SkillsLoadedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.skills_loaded". + */ + type: "session.skills_loaded"; } /** * Payload of `session.skills_loaded` listing resolved skill metadata. */ export interface SkillsLoadedData { - /** - * Array of resolved skill metadata - */ - skills: SkillsLoadedSkill[]; + /** + * Array of resolved skill metadata + */ + skills: SkillsLoadedSkill[]; } /** * A single resolved skill in `session.skills_loaded`, including source, invocability, enabled state, path, and argument hint. */ export interface SkillsLoadedSkill { - /** - * Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field - */ - argumentHint?: string; - /** - * Canonical slash command name used to invoke the skill, without the leading '/' - */ - commandName?: string; - /** - * Description of what the skill does - */ - description: string; - /** - * Whether the skill is currently enabled - */ - enabled: boolean; - /** - * Unique identifier for the skill - */ - name: string; - /** - * Absolute path to the skill file, if available - */ - path?: string; - source: SkillSource; - /** - * Whether the skill can be invoked by the user as a slash command - */ - userInvocable: boolean; + /** + * Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field + */ + argumentHint?: string; + /** + * Canonical slash command name used to invoke the skill, without the leading '/' + */ + commandName?: string; + /** + * Description of what the skill does + */ + description: string; + /** + * Whether the skill is currently enabled + */ + enabled: boolean; + /** + * Unique identifier for the skill + */ + name: string; + /** + * Absolute path to the skill file, if available + */ + path?: string; + source: SkillSource; + /** + * Whether the skill can be invoked by the user as a slash command + */ + userInvocable: boolean; } /** * Session event "session.custom_agents_updated". Payload of `session.custom_agents_updated` with loaded custom agents plus non-fatal warnings and fatal errors. */ export interface CustomAgentsUpdatedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CustomAgentsUpdatedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.custom_agents_updated". - */ - type: "session.custom_agents_updated"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CustomAgentsUpdatedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.custom_agents_updated". + */ + type: "session.custom_agents_updated"; } /** * Payload of `session.custom_agents_updated` with loaded custom agents plus non-fatal warnings and fatal errors. */ export interface CustomAgentsUpdatedData { - /** - * Array of loaded custom agent metadata - */ - agents: CustomAgentsUpdatedAgent[]; - /** - * Fatal errors from agent loading - */ - errors: string[]; - /** - * Non-fatal warnings from agent loading - */ - warnings: string[]; + /** + * Array of loaded custom agent metadata + */ + agents: CustomAgentsUpdatedAgent[]; + /** + * Fatal errors from agent loading + */ + errors: string[]; + /** + * Non-fatal warnings from agent loading + */ + warnings: string[]; } /** * A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and authored model configuration. */ export interface CustomAgentsUpdatedAgent { - /** - * Description of what the agent does - */ - description: string; - /** - * Human-readable display name - */ - displayName: string; - /** - * Unique identifier for the agent - */ - id: string; - /** - * Model override for this agent, if set - */ - model?: string; - modelPolicy?: AgentModelPolicy; - /** - * Authored model ids in priority order, if configured - */ - models?: string[]; - /** - * Internal name of the agent - */ - name: string; - /** - * Source location: user, project, inherited, remote, or plugin - */ - source: string; - /** - * List of tool names available to this agent, or null when all tools are available - */ - tools: string[] | null; - /** - * Whether the agent can be selected by the user - */ - userInvocable: boolean; + /** + * Description of what the agent does + */ + description: string; + /** + * Human-readable display name + */ + displayName: string; + /** + * Unique identifier for the agent + */ + id: string; + /** + * Model override for this agent, if set + */ + model?: string; + modelPolicy?: AgentModelPolicy; + /** + * Authored model ids in priority order, if configured + */ + models?: string[]; + /** + * Internal name of the agent + */ + name: string; + /** + * Source location: user, project, inherited, remote, or plugin + */ + source: string; + /** + * List of tool names available to this agent, or null when all tools are available + */ + tools: string[] | null; + /** + * Whether the agent can be selected by the user + */ + userInvocable: boolean; } /** * Session event "session.mcp_servers_loaded". Payload of `session.mcp_servers_loaded` listing MCP server status summaries. */ export interface McpServersLoadedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: McpServersLoadedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.mcp_servers_loaded". - */ - type: "session.mcp_servers_loaded"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpServersLoadedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.mcp_servers_loaded". + */ + type: "session.mcp_servers_loaded"; } /** * Payload of `session.mcp_servers_loaded` listing MCP server status summaries. */ export interface McpServersLoadedData { - /** - * Array of MCP server status summaries - */ - servers: McpServersLoadedServer[]; + /** + * Array of MCP server status summaries + */ + servers: McpServersLoadedServer[]; } /** * A single MCP server status summary in `session.mcp_servers_loaded`, including name, status, source, transport, and plugin metadata. */ export interface McpServersLoadedServer { - /** - * Error message if the server failed to connect - */ - error?: string; - /** - * Server name (config key) - */ - name: string; - /** - * Name of the plugin that supplied the effective MCP server config, only when source is plugin - */ - pluginName?: string; - /** - * Version of the plugin that supplied the effective MCP server config, only when source is plugin - */ - pluginVersion?: string; - source?: McpServerSource; - status: McpServerStatus; - transport?: McpServerTransport; + /** + * Error message if the server failed to connect + */ + error?: string; + /** + * Server name (config key) + */ + name: string; + /** + * Name of the plugin that supplied the effective MCP server config, only when source is plugin + */ + pluginName?: string; + /** + * Version of the plugin that supplied the effective MCP server config, only when source is plugin + */ + pluginVersion?: string; + source?: McpServerSource; + status: McpServerStatus; + transport?: McpServerTransport; } /** * Session event "session.mcp_server_status_changed". Payload of `session.mcp_server_status_changed` for one MCP server's status and optional failure error. */ export interface McpServerStatusChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: McpServerStatusChangedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.mcp_server_status_changed". - */ - type: "session.mcp_server_status_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpServerStatusChangedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.mcp_server_status_changed". + */ + type: "session.mcp_server_status_changed"; } /** * Payload of `session.mcp_server_status_changed` for one MCP server's status and optional failure error. */ export interface McpServerStatusChangedData { - /** - * Error message if the server entered a failed state - */ - error?: string; - /** - * Name of the MCP server whose status changed - */ - serverName: string; - status: McpServerStatus; + /** + * Error message if the server entered a failed state + */ + error?: string; + /** + * Name of the MCP server whose status changed + */ + serverName: string; + status: McpServerStatus; +} +/** + * Session event "session.mcp_server_removed". Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. + */ +export interface McpServerRemovedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpServerRemovedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.mcp_server_removed". + */ + type: "session.mcp_server_removed"; +} +/** + * Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. + */ +export interface McpServerRemovedData { + /** + * Name of the MCP server that was removed from the graph + */ + serverName: string; +} +/** + * Session event "session.mcp_server_needs_reconnect". Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. + */ +export interface McpServerNeedsReconnectEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpServerNeedsReconnectData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.mcp_server_needs_reconnect". + */ + type: "session.mcp_server_needs_reconnect"; +} +/** + * Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. + */ +export interface McpServerNeedsReconnectData { + /** + * Name of the MCP server that needs to reconnect + */ + serverName: string; } /** * Session event "mcp.tools.list_changed". Payload identifying the MCP server associated with a list change. */ export interface McpToolsListChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: McpListChangedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "mcp.tools.list_changed". - */ - type: "mcp.tools.list_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpListChangedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "mcp.tools.list_changed". + */ + type: "mcp.tools.list_changed"; } /** * Payload identifying the MCP server associated with a list change. */ export interface McpListChangedData { - /** - * Name of the MCP server whose list changed - */ - serverName: string; + /** + * Name of the MCP server whose list changed + */ + serverName: string; } /** * Session event "mcp.resources.list_changed". Payload identifying the MCP server associated with a list change. */ export interface McpResourcesListChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: McpListChangedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "mcp.resources.list_changed". - */ - type: "mcp.resources.list_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpListChangedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "mcp.resources.list_changed". + */ + type: "mcp.resources.list_changed"; } /** * Session event "mcp.prompts.list_changed". Payload identifying the MCP server associated with a list change. */ export interface McpPromptsListChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: McpListChangedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "mcp.prompts.list_changed". - */ - type: "mcp.prompts.list_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpListChangedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "mcp.prompts.list_changed". + */ + type: "mcp.prompts.list_changed"; } /** * Session event "session.extensions_loaded". Payload of `session.extensions_loaded` listing discovered extensions and their statuses. */ export interface ExtensionsLoadedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ExtensionsLoadedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.extensions_loaded". - */ - type: "session.extensions_loaded"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ExtensionsLoadedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.extensions_loaded". + */ + type: "session.extensions_loaded"; } /** * Payload of `session.extensions_loaded` listing discovered extensions and their statuses. */ export interface ExtensionsLoadedData { - /** - * Array of discovered extensions and their status - */ - extensions: ExtensionsLoadedExtension[]; + /** + * Array of discovered extensions and their status + */ + extensions: ExtensionsLoadedExtension[]; } /** * A single extension discovered by `session.extensions_loaded`, including qualified ID, source, and current status. */ export interface ExtensionsLoadedExtension { - /** - * Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper', 'plugin:my-plugin:my-ext') - */ - id: string; - /** - * Extension name (directory name) - */ - name: string; - source: ExtensionsLoadedExtensionSource; - status: ExtensionsLoadedExtensionStatus; + /** + * Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper', 'plugin:my-plugin:my-ext') + */ + id: string; + /** + * Extension name (directory name) + */ + name: string; + source: ExtensionsLoadedExtensionSource; + status: ExtensionsLoadedExtensionStatus; } /** * Session event "session.canvas.opened". Payload of `session.canvas.opened` with canvas instance and provider IDs plus optional icon, title, status, URL, and input. */ /** @experimental */ export interface CanvasOpenedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CanvasOpenedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.canvas.opened". - */ - type: "session.canvas.opened"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CanvasOpenedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.canvas.opened". + */ + type: "session.canvas.opened"; } /** * Payload of `session.canvas.opened` with canvas instance and provider IDs plus optional icon, title, status, URL, and input. */ /** @experimental */ export interface CanvasOpenedData { - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Owning extension display name, when available - */ - extensionName?: string; - /** - * Host-local PNG path for the canvas icon, when supplied - */ - icon?: string; - /** - * Input supplied when the instance was opened - */ - input?: JsonValue; - /** - * Stable caller-supplied canvas instance identifier - */ - instanceId: string; - /** - * Provider-supplied status text - */ - status?: string; - /** - * Rendered title - */ - title?: string; - /** - * URL for web-rendered canvases - */ - url?: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Owning extension display name, when available + */ + extensionName?: string; + /** + * Host-local PNG path for the canvas icon, when supplied + */ + icon?: string; + /** + * Input supplied when the instance was opened + */ + input?: JsonValue; + /** + * Stable caller-supplied canvas instance identifier + */ + instanceId: string; + /** + * Provider-supplied status text + */ + status?: string; + /** + * Rendered title + */ + title?: string; + /** + * URL for web-rendered canvases + */ + url?: string; } /** * Session event "session.canvas.registry_changed". Payload of `session.canvas.registry_changed` listing the canvas declarations currently available. */ /** @experimental */ export interface CanvasRegistryChangedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CanvasRegistryChangedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.canvas.registry_changed". - */ - type: "session.canvas.registry_changed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CanvasRegistryChangedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.canvas.registry_changed". + */ + type: "session.canvas.registry_changed"; } /** * Payload of `session.canvas.registry_changed` listing the canvas declarations currently available. */ /** @experimental */ export interface CanvasRegistryChangedData { - /** - * Canvas declarations currently available - */ - canvases: CanvasRegistryChangedCanvas[]; + /** + * Canvas declarations currently available + */ + canvases: CanvasRegistryChangedCanvas[]; } /** * A single canvas declaration in `session.canvas.registry_changed`, including provider IDs, display metadata, input schema, and actions. */ /** @experimental */ export interface CanvasRegistryChangedCanvas { - /** - * Actions the agent or host may invoke - */ - actions?: CanvasRegistryChangedCanvasAction[]; - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Short, single-sentence description shown to the agent in canvas catalogs. - */ - description: string; - /** - * Human-readable canvas name - */ - displayName: string; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Owning extension display name, when available - */ - extensionName?: string; - /** - * Host-local PNG path for the canvas icon, when supplied - */ - icon?: string; - /** - * JSON Schema for canvas open input - */ - inputSchema?: JsonValue; + /** + * Actions the agent or host may invoke + */ + actions?: CanvasRegistryChangedCanvasAction[]; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Short, single-sentence description shown to the agent in canvas catalogs. + */ + description: string; + /** + * Human-readable canvas name + */ + displayName: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Owning extension display name, when available + */ + extensionName?: string; + /** + * Host-local PNG path for the canvas icon, when supplied + */ + icon?: string; + /** + * JSON Schema for canvas open input + */ + inputSchema?: JsonValue; } /** * A single action within a canvas declaration, with its name, optional description, and optional input schema. */ /** @experimental */ export interface CanvasRegistryChangedCanvasAction { - /** - * Action description - */ - description?: string; - /** - * JSON Schema for action input - */ - inputSchema?: JsonValue; - /** - * Action name - */ - name: string; + /** + * Action description + */ + description?: string; + /** + * JSON Schema for action input + */ + inputSchema?: JsonValue; + /** + * Action name + */ + name: string; } /** * Session event "session.canvas.closed". Payload of `session.canvas.closed` with the closed canvas instance ID, provider ID, and canvas ID. */ /** @experimental */ export interface CanvasClosedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CanvasClosedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.canvas.closed". - */ - type: "session.canvas.closed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CanvasClosedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.canvas.closed". + */ + type: "session.canvas.closed"; } /** * Payload of `session.canvas.closed` with the closed canvas instance ID, provider ID, and canvas ID. */ /** @experimental */ export interface CanvasClosedData { - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Stable caller-supplied identifier of the canvas instance that was closed - */ - instanceId: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Stable caller-supplied identifier of the canvas instance that was closed + */ + instanceId: string; } /** * 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. */ /** @experimental */ export interface CanvasUnavailableEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CanvasUnavailableData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.canvas.unavailable". - */ - type: "session.canvas.unavailable"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CanvasUnavailableData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.canvas.unavailable". + */ + type: "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. */ /** @experimental */ export interface CanvasUnavailableData { - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Stable caller-supplied identifier of the canvas instance whose provider became unavailable - */ - instanceId: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Stable caller-supplied identifier of the canvas instance whose provider became unavailable + */ + instanceId: string; } /** * 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. */ /** @experimental */ export interface CanvasRecordedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CanvasRecordedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.canvas.recorded". - */ - type: "session.canvas.recorded"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CanvasRecordedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.canvas.recorded". + */ + type: "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. */ /** @experimental */ export interface CanvasRecordedData { - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Input supplied when the instance was opened - */ - input?: JsonValue; - /** - * Stable caller-supplied canvas instance identifier - */ - instanceId: string; - /** - * Rendered title - */ - title?: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Input supplied when the instance was opened + */ + input?: JsonValue; + /** + * Stable caller-supplied canvas instance identifier + */ + instanceId: string; + /** + * Rendered title + */ + title?: string; } /** * Session event "session.canvas.removed". Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay. */ /** @experimental */ export interface CanvasRemovedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: CanvasRemovedData; - /** - * When true, the event is transient and not persisted to the session event log on disk - */ - ephemeral?: boolean; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.canvas.removed". - */ - type: "session.canvas.removed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CanvasRemovedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.canvas.removed". + */ + type: "session.canvas.removed"; } /** * Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay. */ /** @experimental */ export interface CanvasRemovedData { - /** - * Provider-local canvas identifier - */ - canvasId: string; - /** - * Owning provider identifier - */ - extensionId: string; - /** - * Stable caller-supplied identifier of the canvas instance that was closed - */ - instanceId: string; + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Stable caller-supplied identifier of the canvas instance that was closed + */ + instanceId: string; } /** * Session event "session.extensions.attachments_pushed". Payload of `session.extensions.attachments_pushed` with extension-contributed attachments for the next send. */ export interface ExtensionsAttachmentsPushedEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: ExtensionsAttachmentsPushedData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "session.extensions.attachments_pushed". - */ - type: "session.extensions.attachments_pushed"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ExtensionsAttachmentsPushedData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.extensions.attachments_pushed". + */ + type: "session.extensions.attachments_pushed"; } /** * Payload of `session.extensions.attachments_pushed` with extension-contributed attachments for the next send. */ export interface ExtensionsAttachmentsPushedData { - /** - * Attachments contributed by an extension; the host should surface these as composer pills and forward them via the next session.send call. - */ - attachments: Attachment[]; + /** + * Attachments contributed by an extension; the host should surface these as composer pills and forward them via the next session.send call. + */ + attachments: Attachment[]; } /** * Session event "mcp_app.tool_call_complete". MCP App view called a tool on a connected MCP server (SEP-1865) */ export interface McpAppToolCallCompleteEvent { - /** - * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. - */ - agentId?: string; - data: McpAppToolCallCompleteData; - /** - * Always true for events that are transient and not persisted to the session event log on disk. - */ - ephemeral: true; - /** - * Unique event identifier (UUID v4), generated when the event is emitted - */ - id: string; - /** - * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. - */ - parentId: string | null; - /** - * ISO 8601 timestamp when the event was created - */ - timestamp: string; - /** - * Type discriminator. Always "mcp_app.tool_call_complete". - */ - type: "mcp_app.tool_call_complete"; + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpAppToolCallCompleteData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "mcp_app.tool_call_complete". + */ + type: "mcp_app.tool_call_complete"; } /** * MCP App view called a tool on a connected MCP server (SEP-1865) */ export interface McpAppToolCallCompleteData { - /** - * Arguments passed to the tool by the app view, if any - */ - arguments?: { - [k: string]: JsonValue | undefined; - }; - /** - * Wall-clock duration of the underlying tools/call in milliseconds - */ - durationMs: number; - error?: McpAppToolCallCompleteError; - /** - * Standard MCP CallToolResult returned by the server. Present whether or not the call set isError. - */ - result?: { - [k: string]: JsonValue | undefined; - }; - /** - * Name of the MCP server hosting the tool - */ - serverName: string; - /** - * True when the call completed without throwing AND the MCP CallToolResult did not set isError - */ - success: boolean; - toolMeta?: McpAppToolCallCompleteToolMeta; - /** - * MCP tool name that was invoked - */ - toolName: string; + /** + * Arguments passed to the tool by the app view, if any + */ + arguments?: { + [k: string]: JsonValue | undefined; + }; + /** + * Wall-clock duration of the underlying tools/call in milliseconds + */ + durationMs: number; + error?: McpAppToolCallCompleteError; + /** + * Standard MCP CallToolResult returned by the server. Present whether or not the call set isError. + */ + result?: { + [k: string]: JsonValue | undefined; + }; + /** + * Name of the MCP server hosting the tool + */ + serverName: string; + /** + * True when the call completed without throwing AND the MCP CallToolResult did not set isError + */ + success: boolean; + toolMeta?: McpAppToolCallCompleteToolMeta; + /** + * MCP tool name that was invoked + */ + toolName: string; } /** * Set when the underlying tools/call threw an error before returning a CallToolResult */ export interface McpAppToolCallCompleteError { - /** - * Human-readable error message - */ - message: string; + /** + * Human-readable error message + */ + message: string; } /** * 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. */ export interface McpAppToolCallCompleteToolMeta { - ui?: McpAppToolCallCompleteToolMetaUI; + ui?: McpAppToolCallCompleteToolMetaUI; } /** * MCP App tool `_meta.ui` resource URI and SEP-1865 visibility captured with an `mcp_app.tool_call_complete` result. */ export interface McpAppToolCallCompleteToolMetaUI { - /** - * `ui://` URI declared by the tool's `_meta.ui.resourceUri` - */ - resourceUri?: string; - /** - * Tool visibility per SEP-1865 (typically a subset of `["model","app"]`) - */ - visibility?: string[]; + /** + * `ui://` URI declared by the tool's `_meta.ui.resourceUri` + */ + resourceUri?: string; + /** + * Tool visibility per SEP-1865 (typically a subset of `["model","app"]`) + */ + visibility?: string[]; } diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 90d80591b9..d14fb4f561 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -1052,9 +1052,12 @@ class CapiSessionOptions: """Options scoped to the built-in CAPI (Copilot API) provider.""" auto_tier: AutoTier | None = None - """Routing preference used when the session model is `auto`. The runtime persists the - preference across cold resume. When omitted, the default routing behavior is used. - Resuming an already-resident session cannot change its preference. + """Routing preference for sessions whose model is `auto`. On create or cold resume, this + establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold + resume, the runtime restores the last committed preference. On resident resume, a + different value requests a safe switch after resume succeeds and cannot change an + in-flight turn. Successful switches are persisted for later cold resume. When no + preference is supplied or restored, CAPI default routing is used. """ enable_web_socket_responses: bool | None = None """Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when @@ -1497,6 +1500,34 @@ class CatalogUnsafeRetrievalReason(Enum): class CatalogUnsupportedKindErrorKind(Enum): UNSUPPORTED_KIND = "unsupported-kind" +# Experimental: this type is part of an experimental API and may change or be removed. +class ClientTaskCancelReason(Enum): + """Why the runtime requests client-task cancellation. + + Reason the runtime requests cancellation + """ + CANCEL_REQUESTED = "cancel_requested" + SESSION_SHUTDOWN = "session_shutdown" + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ClientTaskCancelResult: + """Whether the client authoritatively confirmed its external work stopped.""" + + cancelled: bool + """True only when the owner confirms that external work stopped before responding""" + + @staticmethod + def from_dict(obj: Any) -> 'ClientTaskCancelResult': + assert isinstance(obj, dict) + cancelled = from_bool(obj.get("cancelled")) + return ClientTaskCancelResult(cancelled) + + def to_dict(self) -> dict: + result: dict = {} + result["cancelled"] = from_bool(self.cancelled) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SlashCommandInputChoice: @@ -1832,34 +1863,14 @@ def to_dict(self) -> dict: return result # Experimental: this type is part of an experimental API and may change or be removed. -# Internal: this type is an internal SDK API and is not part of the public surface. -@dataclass -class _ConnectResult: - """Handshake result reporting the server's protocol version and package version on success.""" +class TaskKind(Enum): + """Closed set of public task kinds a connection can negotiate. - ok: bool - """Always true on success""" - - protocol_version: int - """Server protocol version number""" - - version: str - """Server package version""" - - @staticmethod - def from_dict(obj: Any) -> '_ConnectResult': - assert isinstance(obj, dict) - ok = from_bool(obj.get("ok")) - protocol_version = from_int(obj.get("protocolVersion")) - version = from_str(obj.get("version")) - return _ConnectResult(ok, protocol_version, version) - - def to_dict(self) -> dict: - result: dict = {} - result["ok"] = from_bool(self.ok) - result["protocolVersion"] = from_int(self.protocol_version) - result["version"] = from_str(self.version) - return result + Discriminator for a client-owned task. + """ + AGENT = "agent" + CLIENT = "client" + SHELL = "shell" # Experimental: this type is part of an experimental API and may change or be removed. class ConnectedRemoteSessionMetadataKind(Enum): @@ -2266,9 +2277,20 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class CurrentModel: - """The currently selected model, reasoning effort, and context tier for the session. The - context tier reflects `Session.getContextTier()`, restored from the session journal on - resume. + """The session's authoritative model snapshot. Auto preference fields are configuration for + the virtual `auto` model and do not change the selected model identifier. The context + tier reflects `Session.getContextTier()`, restored from the session journal on resume. + + Authoritative model and Auto preference state after an immediate switch. For deferred + switches this remains the current state until the queued change drains. + """ + activating_auto_tier: AutoTier | None = None + """Auto preference currently claimed by an in-progress activation. Null means the activation + is returning to provider-default routing. + """ + auto_tier: AutoTier | None = None + """Auto preference currently committed for the session. This can remain available while + another model is selected so a later switch to `auto` can reuse it. """ context_tier: ContextTier | None = None """Context tier for models that support multiple context-window sizes.""" @@ -2276,6 +2298,10 @@ class CurrentModel: model_id: str | None = None """Currently active model identifier""" + pending_auto_tier: AutoTier | None = None + """Latest unclaimed Auto preference waiting for a future user turn. Null means the pending + request is returning to provider-default routing. + """ reasoning_effort: str | None = None """Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the @@ -2285,17 +2311,26 @@ class CurrentModel: @staticmethod def from_dict(obj: Any) -> 'CurrentModel': assert isinstance(obj, dict) + activating_auto_tier = from_union([AutoTier, from_none], obj.get("activatingAutoTier")) + auto_tier = from_union([AutoTier, from_none], obj.get("autoTier")) context_tier = from_union([ContextTier, from_none], obj.get("contextTier")) model_id = from_union([from_str, from_none], obj.get("modelId")) + pending_auto_tier = from_union([AutoTier, from_none], obj.get("pendingAutoTier")) reasoning_effort = from_union([from_str, from_none], obj.get("reasoningEffort")) - return CurrentModel(context_tier, model_id, reasoning_effort) + return CurrentModel(activating_auto_tier, auto_tier, context_tier, model_id, pending_auto_tier, reasoning_effort) def to_dict(self) -> dict: result: dict = {} + if self.activating_auto_tier is not None: + result["activatingAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.activating_auto_tier) + if self.auto_tier is not None: + result["autoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.auto_tier) if self.context_tier is not None: result["contextTier"] = from_union([lambda x: to_enum(ContextTier, x), from_none], self.context_tier) if self.model_id is not None: result["modelId"] = from_union([from_str, from_none], self.model_id) + if self.pending_auto_tier is not None: + result["pendingAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.pending_auto_tier) if self.reasoning_effort is not None: result["reasoningEffort"] = from_union([from_str, from_none], self.reasoning_effort) return result @@ -5071,15 +5106,21 @@ class MCPConfigRemoveRequest: name: str """Name of the MCP server to remove""" + auth_client_id_metadata_url: str | None = None + """OAuth Client ID Metadata Document URL whose persisted credentials should also be removed.""" + @staticmethod def from_dict(obj: Any) -> 'MCPConfigRemoveRequest': assert isinstance(obj, dict) name = from_str(obj.get("name")) - return MCPConfigRemoveRequest(name) + auth_client_id_metadata_url = from_union([from_str, from_none], obj.get("authClientIdMetadataUrl")) + return MCPConfigRemoveRequest(name, auth_client_id_metadata_url) def to_dict(self) -> dict: result: dict = {} result["name"] = from_str(self.name) + if self.auth_client_id_metadata_url is not None: + result["authClientIdMetadataUrl"] = from_union([from_str, from_none], self.auth_client_id_metadata_url) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -6925,6 +6966,45 @@ def to_dict(self) -> dict: result["reasoningEffort"] = from_str(self.reasoning_effort) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ModelSwitchAutoTierRequest: + """An Auto preference request for the session. This updates Auto configuration only; it does + not change the selected model to `auto`. + """ + auto_tier: AutoTier | None = None + """Auto preference to activate when a future user turn using the `auto` model safely mints a + replacement model and token pair. Pass null to return to provider-default Auto routing. + """ + source: ModelChangeSource | None = None + """Origin to record on the effective `session.model_change` event. Defaults to `sdk` when + omitted. + """ + + @staticmethod + def from_dict(obj: Any) -> 'ModelSwitchAutoTierRequest': + assert isinstance(obj, dict) + auto_tier = from_union([AutoTier, from_none], obj.get("autoTier")) + source = from_union([ModelChangeSource, from_none], obj.get("source")) + return ModelSwitchAutoTierRequest(auto_tier, source) + + def to_dict(self) -> dict: + result: dict = {} + result["autoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.auto_tier) + if self.source is not None: + result["source"] = from_union([lambda x: to_enum(ModelChangeSource, x), from_none], self.source) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +class ModelSwitchAutoTierStatus(Enum): + """Immediate request status. `pending` means accepted but not committed. + + Whether the requested preference was already effective or was accepted for later + transactional activation. + """ + PENDING = "pending" + UNCHANGED = "unchanged" + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ModelsListRequest: @@ -13087,8 +13167,12 @@ class SubagentSettingsEntryContextTier(Enum): # Experimental: this type is part of an experimental API and may change or be removed. class TaskExecutionMode(Enum): - """Whether task execution is synchronously awaited or managed in the background""" + """Whether task execution is synchronously awaited or managed in the background + Client-owned tasks always execute outside the runtime in background mode. + + Execution mode, which is always background for client-owned tasks + """ BACKGROUND = "background" SYNC = "sync" @@ -13129,6 +13213,70 @@ def to_dict(self) -> dict: result["timestamp"] = self.timestamp.isoformat() return result +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientActiveStatus(Enum): + """Active status a client owner may publish with a progress update. + + Optional active status transition + """ + IDLE = "idle" + RUNNING = "running" + +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientExecutionMode(Enum): + """Client-owned tasks always execute outside the runtime in background mode. + + Execution mode, which is always background for client-owned tasks + """ + BACKGROUND = "background" + +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientOwnerKind(Enum): + """Class of the task owner + + Connection class owning a client task. + """ + EXTENSION = "extension" + SDK = "sdk" + +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientOwnerPresence(Enum): + """Whether this task's bound join is currently connected + + Presence of the task's bound join. + """ + CONNECTED = "connected" + DISCONNECTED = "disconnected" + +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientStatus(Enum): + """Client task lifecycle status + + Lifecycle status of a client-owned task. + + Current client task lifecycle status + + Current lifecycle status of the task + """ + CANCELLED = "cancelled" + COMPLETED = "completed" + FAILED = "failed" + IDLE = "idle" + ORPHANED = "orphaned" + RUNNING = "running" + +# Experimental: this type is part of an experimental API and may change or be removed. +class TaskClientType(Enum): + """Discriminator for a client-owned task.""" + + CLIENT = "client" + +class TaskClientUpdateKind(Enum): + CANCELLED = "cancelled" + COMPLETED = "completed" + FAILED = "failed" + PROGRESS = "progress" + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class TaskCompleteData: @@ -13240,10 +13388,6 @@ class TaskShellInfoAttachmentMode(Enum): ATTACHED = "attached" DETACHED = "detached" -class TaskInfoType(Enum): - AGENT = "agent" - SHELL = "shell" - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class TaskList: @@ -15795,6 +15939,45 @@ def to_dict(self) -> dict: result["supportedKinds"] = from_list(lambda x: to_enum(CatalogCandidateKind, x), self.supported_kinds) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ClientTaskCancelRequest: + """Runtime-to-owner cancellation request for a client-owned task.""" + + cancellation_id: str + """Opaque identifier shared by coalesced cancellation callers""" + + client_task_id: str + """Owner-scoped task key included for correlation""" + + id: str + """Canonical runtime-generated task identifier""" + + reason: ClientTaskCancelReason + """Reason the runtime requests cancellation""" + + session_id: str + """Session that owns the client task""" + + @staticmethod + def from_dict(obj: Any) -> 'ClientTaskCancelRequest': + assert isinstance(obj, dict) + cancellation_id = from_str(obj.get("cancellationId")) + client_task_id = from_str(obj.get("clientTaskId")) + id = from_str(obj.get("id")) + reason = ClientTaskCancelReason(obj.get("reason")) + session_id = from_str(obj.get("sessionId")) + return ClientTaskCancelRequest(cancellation_id, client_task_id, id, reason, session_id) + + def to_dict(self) -> dict: + result: dict = {} + result["cancellationId"] = from_str(self.cancellation_id) + result["clientTaskId"] = from_str(self.client_task_id) + result["id"] = from_str(self.id) + result["reason"] = to_enum(ClientTaskCancelReason, self.reason) + result["sessionId"] = from_str(self.session_id) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SlashCommandInput: @@ -15948,6 +16131,10 @@ class _ConnectRequest: using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events. """ + supported_task_kinds: list[TaskKind] | None = None + """Task kinds this connection can decode when observing session tasks. Omit to retain agent + and shell compatibility. + """ token: str | None = None """Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN""" @@ -15956,8 +16143,9 @@ def from_dict(obj: Any) -> '_ConnectRequest': assert isinstance(obj, dict) client_info = from_union([_ConnectClientInfo.from_dict, from_none], obj.get("clientInfo")) enable_git_hub_telemetry_forwarding = from_union([from_bool, from_none], obj.get("enableGitHubTelemetryForwarding")) + supported_task_kinds = from_union([lambda x: from_list(TaskKind, x), from_none], obj.get("supportedTaskKinds")) token = from_union([from_str, from_none], obj.get("token")) - return _ConnectRequest(client_info, enable_git_hub_telemetry_forwarding, token) + return _ConnectRequest(client_info, enable_git_hub_telemetry_forwarding, supported_task_kinds, token) def to_dict(self) -> dict: result: dict = {} @@ -15965,10 +16153,48 @@ def to_dict(self) -> dict: result["clientInfo"] = from_union([lambda x: to_class(_ConnectClientInfo, x), from_none], self.client_info) if self.enable_git_hub_telemetry_forwarding is not None: result["enableGitHubTelemetryForwarding"] = from_union([from_bool, from_none], self.enable_git_hub_telemetry_forwarding) + if self.supported_task_kinds is not None: + result["supportedTaskKinds"] = from_union([lambda x: from_list(lambda x: to_enum(TaskKind, x), x), from_none], self.supported_task_kinds) if self.token is not None: result["token"] = from_union([from_str, from_none], self.token) return result +# Experimental: this type is part of an experimental API and may change or be removed. +# Internal: this type is an internal SDK API and is not part of the public surface. +@dataclass +class _ConnectResult: + """Handshake result reporting the server's protocol version and package version on success.""" + + ok: bool + """Always true on success""" + + protocol_version: int + """Server protocol version number""" + + version: str + """Server package version""" + + task_kinds: list[TaskKind] | None = None + """Task kinds the server may return to this connection.""" + + @staticmethod + def from_dict(obj: Any) -> '_ConnectResult': + assert isinstance(obj, dict) + ok = from_bool(obj.get("ok")) + protocol_version = from_int(obj.get("protocolVersion")) + version = from_str(obj.get("version")) + task_kinds = from_union([lambda x: from_list(TaskKind, x), from_none], obj.get("taskKinds")) + return _ConnectResult(ok, protocol_version, version, task_kinds) + + def to_dict(self) -> dict: + result: dict = {} + result["ok"] = from_bool(self.ok) + result["protocolVersion"] = from_int(self.protocol_version) + result["version"] = from_str(self.version) + if self.task_kinds is not None: + result["taskKinds"] = from_union([lambda x: from_list(lambda x: to_enum(TaskKind, x), x), from_none], self.task_kinds) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ConnectedRemoteSessionMetadata: @@ -19945,6 +20171,10 @@ class ModelSwitchToResult: model_id: str | None = None """Currently active model identifier after the switch""" + model_state: CurrentModel | None = None + """Authoritative model and Auto preference state after an immediate switch. For deferred + switches this remains the current state until the queued change drains. + """ persistence_error: str | None = None """Persistence failure encountered after applying the model switch.""" @@ -19962,10 +20192,11 @@ def from_dict(obj: Any) -> 'ModelSwitchToResult': deprecation_warnings = from_union([lambda x: from_list(from_str, x), from_none], obj.get("deprecationWarnings")) message = from_union([from_str, from_none], obj.get("message")) model_id = from_union([from_str, from_none], obj.get("modelId")) + model_state = from_union([CurrentModel.from_dict, from_none], obj.get("modelState")) persistence_error = from_union([from_str, from_none], obj.get("persistenceError")) status = from_union([from_str, from_none], obj.get("status")) warning = from_union([from_str, from_none], obj.get("warning")) - return ModelSwitchToResult(confirmation, deferred, deprecation_warnings, message, model_id, persistence_error, status, warning) + return ModelSwitchToResult(confirmation, deferred, deprecation_warnings, message, model_id, model_state, persistence_error, status, warning) def to_dict(self) -> dict: result: dict = {} @@ -19979,6 +20210,8 @@ def to_dict(self) -> dict: result["message"] = from_union([from_str, from_none], self.message) if self.model_id is not None: result["modelId"] = from_union([from_str, from_none], self.model_id) + if self.model_state is not None: + result["modelState"] = from_union([lambda x: to_class(CurrentModel, x), from_none], self.model_state) if self.persistence_error is not None: result["persistenceError"] = from_union([from_str, from_none], self.persistence_error) if self.status is not None: @@ -20188,6 +20421,53 @@ def to_dict(self) -> dict: result["vision"] = from_union([lambda x: to_class(ModelCapabilitiesOverrideLimitsVision, x), from_none], self.vision) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ModelSwitchAutoTierResult: + """Immediate acknowledgement and Auto preference snapshot after a switch request. This + result never implies that a pending preference committed. + """ + status: ModelSwitchAutoTierStatus + """Immediate request status. `pending` means accepted but not committed.""" + + activating_auto_tier: AutoTier | None = None + """Auto preference currently claimed by an in-progress activation. Null means the activation + is returning to provider-default routing. + """ + effective_auto_tier: AutoTier | None = None + """Auto preference currently committed for the session.""" + + pending_auto_tier: AutoTier | None = None + """Latest unclaimed Auto preference waiting for a future user turn.""" + + superseded_auto_tier: AutoTier | None = None + """Earlier unclaimed preference replaced by this request. This can be present with either + status, including when selecting the effective preference cancels pending work. + """ + + @staticmethod + def from_dict(obj: Any) -> 'ModelSwitchAutoTierResult': + assert isinstance(obj, dict) + status = ModelSwitchAutoTierStatus(obj.get("status")) + activating_auto_tier = from_union([AutoTier, from_none], obj.get("activatingAutoTier")) + effective_auto_tier = from_union([AutoTier, from_none], obj.get("effectiveAutoTier")) + pending_auto_tier = from_union([AutoTier, from_none], obj.get("pendingAutoTier")) + superseded_auto_tier = from_union([AutoTier, from_none], obj.get("supersededAutoTier")) + return ModelSwitchAutoTierResult(status, activating_auto_tier, effective_auto_tier, pending_auto_tier, superseded_auto_tier) + + def to_dict(self) -> dict: + result: dict = {} + result["status"] = to_enum(ModelSwitchAutoTierStatus, self.status) + if self.activating_auto_tier is not None: + result["activatingAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.activating_auto_tier) + if self.effective_auto_tier is not None: + result["effectiveAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.effective_auto_tier) + if self.pending_auto_tier is not None: + result["pendingAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.pending_auto_tier) + if self.superseded_auto_tier is not None: + result["supersededAutoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.superseded_auto_tier) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class NamedProviderConfig: @@ -24218,23 +24498,100 @@ def to_dict(self) -> dict: result["latestIntent"] = from_union([from_str, from_none], self.latest_intent) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TaskClientOwner: + """Public attribution and presence for the task owner + + Public owner attribution for a client-owned task. Identifiers are opaque and never + authorize requests. + """ + join_id: str + """Opaque identity of the currently or most recently bound session join""" + + kind: TaskClientOwnerKind + """Class of the task owner""" + + participant_id: str + """Opaque session-scoped participant identity""" + + presence: TaskClientOwnerPresence + """Whether this task's bound join is currently connected""" + + disconnected_at: datetime | None = None + """ISO 8601 timestamp when the bound join disconnected""" + + display_name: str | None = None + """Display-only owner name""" + + source: str | None = None + """Display-only owner source""" + + @staticmethod + def from_dict(obj: Any) -> 'TaskClientOwner': + assert isinstance(obj, dict) + join_id = from_str(obj.get("joinId")) + kind = TaskClientOwnerKind(obj.get("kind")) + participant_id = from_str(obj.get("participantId")) + presence = TaskClientOwnerPresence(obj.get("presence")) + disconnected_at = from_union([from_datetime, from_none], obj.get("disconnectedAt")) + display_name = from_union([from_str, from_none], obj.get("displayName")) + source = from_union([from_str, from_none], obj.get("source")) + return TaskClientOwner(join_id, kind, participant_id, presence, disconnected_at, display_name, source) + + def to_dict(self) -> dict: + result: dict = {} + result["joinId"] = from_str(self.join_id) + result["kind"] = to_enum(TaskClientOwnerKind, self.kind) + result["participantId"] = from_str(self.participant_id) + result["presence"] = to_enum(TaskClientOwnerPresence, self.presence) + if self.disconnected_at is not None: + result["disconnectedAt"] = from_union([lambda x: x.isoformat(), from_none], self.disconnected_at) + if self.display_name is not None: + result["displayName"] = from_union([from_str, from_none], self.display_name) + if self.source is not None: + result["source"] = from_union([from_str, from_none], self.source) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class TaskProgress: """Progress snapshot for an agent task, with recent activity lines and optional latest intent. + Generic progress for a client-owned task. + Progress snapshot for a shell task, with recent stdout/stderr output and optional process ID. """ - type: TaskInfoType + type: TaskKind """Progress kind""" latest_intent: str | None = None """The most recent intent reported by the agent""" recent_activity: list[TaskProgressLine] | None = None - """Recent tool execution events converted to display lines""" + """Recent tool execution events converted to display lines + + Recent server-timestamped progress messages + """ + last_message: str | None = None + """Most recent nonempty progress message""" + + percentage: float | None = None + """Current completion percentage from zero through one hundred""" + + phase: str | None = None + """Current owner-defined progress phase""" + + sequence: int | None = None + """Sequence number of the latest accepted owner update""" + + status: TaskClientStatus | None = None + """Current client task lifecycle status""" + + updated_at: datetime | None = None + """ISO 8601 timestamp of the latest accepted lifecycle change""" pid: int | None = None """Process ID when available""" @@ -24245,26 +24602,226 @@ class TaskProgress: @staticmethod def from_dict(obj: Any) -> 'TaskProgress': assert isinstance(obj, dict) - type = TaskInfoType(obj.get("type")) + type = TaskKind(obj.get("type")) latest_intent = from_union([from_str, from_none], obj.get("latestIntent")) recent_activity = from_union([lambda x: from_list(TaskProgressLine.from_dict, x), from_none], obj.get("recentActivity")) + last_message = from_union([from_str, from_none], obj.get("lastMessage")) + percentage = from_union([from_float, from_none], obj.get("percentage")) + phase = from_union([from_str, from_none], obj.get("phase")) + sequence = from_union([from_int, from_none], obj.get("sequence")) + status = from_union([TaskClientStatus, from_none], obj.get("status")) + updated_at = from_union([from_datetime, from_none], obj.get("updatedAt")) pid = from_union([from_int, from_none], obj.get("pid")) recent_output = from_union([from_str, from_none], obj.get("recentOutput")) - return TaskProgress(type, latest_intent, recent_activity, pid, recent_output) + return TaskProgress(type, latest_intent, recent_activity, last_message, percentage, phase, sequence, status, updated_at, pid, recent_output) def to_dict(self) -> dict: result: dict = {} - result["type"] = to_enum(TaskInfoType, self.type) + result["type"] = to_enum(TaskKind, self.type) if self.latest_intent is not None: result["latestIntent"] = from_union([from_str, from_none], self.latest_intent) if self.recent_activity is not None: result["recentActivity"] = from_union([lambda x: from_list(lambda x: to_class(TaskProgressLine, x), x), from_none], self.recent_activity) + if self.last_message is not None: + result["lastMessage"] = from_union([from_str, from_none], self.last_message) + if self.percentage is not None: + result["percentage"] = from_union([to_float, from_none], self.percentage) + if self.phase is not None: + result["phase"] = from_union([from_str, from_none], self.phase) + if self.sequence is not None: + result["sequence"] = from_union([from_int, from_none], self.sequence) + if self.status is not None: + result["status"] = from_union([lambda x: to_enum(TaskClientStatus, x), from_none], self.status) + if self.updated_at is not None: + result["updatedAt"] = from_union([lambda x: x.isoformat(), from_none], self.updated_at) if self.pid is not None: result["pid"] = from_union([from_int, from_none], self.pid) if self.recent_output is not None: result["recentOutput"] = from_union([from_str, from_none], self.recent_output) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TaskClientProgress: + """Generic progress for a client-owned task.""" + + recent_activity: list[TaskProgressLine] + """Recent server-timestamped progress messages""" + + sequence: int + """Sequence number of the latest accepted owner update""" + + status: TaskClientStatus + """Current client task lifecycle status""" + + type: TaskClientType + """Progress kind""" + + updated_at: datetime + """ISO 8601 timestamp of the latest accepted lifecycle change""" + + last_message: str | None = None + """Most recent nonempty progress message""" + + percentage: float | None = None + """Current completion percentage from zero through one hundred""" + + phase: str | None = None + """Current owner-defined progress phase""" + + @staticmethod + def from_dict(obj: Any) -> 'TaskClientProgress': + assert isinstance(obj, dict) + recent_activity = from_list(TaskProgressLine.from_dict, obj.get("recentActivity")) + sequence = from_int(obj.get("sequence")) + status = TaskClientStatus(obj.get("status")) + type = TaskClientType(obj.get("type")) + updated_at = from_datetime(obj.get("updatedAt")) + last_message = from_union([from_str, from_none], obj.get("lastMessage")) + percentage = from_union([from_float, from_none], obj.get("percentage")) + phase = from_union([from_str, from_none], obj.get("phase")) + return TaskClientProgress(recent_activity, sequence, status, type, updated_at, last_message, percentage, phase) + + def to_dict(self) -> dict: + result: dict = {} + result["recentActivity"] = from_list(lambda x: to_class(TaskProgressLine, x), self.recent_activity) + result["sequence"] = from_int(self.sequence) + result["status"] = to_enum(TaskClientStatus, self.status) + result["type"] = to_enum(TaskClientType, self.type) + result["updatedAt"] = self.updated_at.isoformat() + if self.last_message is not None: + result["lastMessage"] = from_union([from_str, from_none], self.last_message) + if self.percentage is not None: + result["percentage"] = from_union([to_float, from_none], self.percentage) + if self.phase is not None: + result["phase"] = from_union([from_str, from_none], self.phase) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TasksRegisterRequest: + """Registers or reclaims a client-owned task.""" + + cancellable: bool + """Whether the owner supports runtime cancellation requests""" + + client_task_id: str + """Owner-scoped idempotency key used for registration and reclaim""" + + description: str + """Human-readable description of the external work""" + + type: TaskClientType + """Task kind""" + + display_name: str | None = None + """Optional short display name for the external work""" + + expected_sequence: int | None = None + """Expected current sequence for idempotent registration or orphan reclaim""" + + @staticmethod + def from_dict(obj: Any) -> 'TasksRegisterRequest': + assert isinstance(obj, dict) + cancellable = from_bool(obj.get("cancellable")) + client_task_id = from_str(obj.get("clientTaskId")) + description = from_str(obj.get("description")) + type = TaskClientType(obj.get("type")) + display_name = from_union([from_str, from_none], obj.get("displayName")) + expected_sequence = from_union([from_int, from_none], obj.get("expectedSequence")) + return TasksRegisterRequest(cancellable, client_task_id, description, type, display_name, expected_sequence) + + def to_dict(self) -> dict: + result: dict = {} + result["cancellable"] = from_bool(self.cancellable) + result["clientTaskId"] = from_str(self.client_task_id) + result["description"] = from_str(self.description) + result["type"] = to_enum(TaskClientType, self.type) + if self.display_name is not None: + result["displayName"] = from_union([from_str, from_none], self.display_name) + if self.expected_sequence is not None: + result["expectedSequence"] = from_union([from_int, from_none], self.expected_sequence) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TaskClientUpdate: + """Progress or terminal update for a client-owned task. + + Progress or terminal update payload + + Publishes nonterminal progress for a running or idle client task. + + Reports successful terminal completion. + + Reports terminal failure. + + Reports terminal cancellation after external work stopped. + """ + kind: TaskClientUpdateKind + """Client task update variant discriminator.""" + + message: str | None = None + """Optional progress message appended to recent activity when nonempty + + Optional final progress message + """ + percentage: float | None = None + """Optional completion percentage; null clears the current percentage""" + + phase: str | None = None + """Optional progress phase; null clears the current phase""" + + status: TaskClientActiveStatus | None = None + """Optional active status transition""" + + result: Any = None + """Optional opaque successful terminal result""" + + code: str | None = None + """Optional owner-supplied terminal failure code""" + + error: str | None = None + """Human-readable terminal failure message""" + + reason: str | None = None + """Optional human-readable cancellation reason""" + + @staticmethod + def from_dict(obj: Any) -> 'TaskClientUpdate': + assert isinstance(obj, dict) + kind = TaskClientUpdateKind(obj.get("kind")) + message = from_union([from_str, from_none], obj.get("message")) + percentage = from_union([from_float, from_none], obj.get("percentage")) + phase = from_union([from_none, from_str], obj.get("phase")) + status = from_union([TaskClientActiveStatus, from_none], obj.get("status")) + result = obj.get("result") + code = from_union([from_str, from_none], obj.get("code")) + error = from_union([from_str, from_none], obj.get("error")) + reason = from_union([from_str, from_none], obj.get("reason")) + return TaskClientUpdate(kind, message, percentage, phase, status, result, code, error, reason) + + def to_dict(self) -> dict: + result: dict = {} + result["kind"] = to_enum(TaskClientUpdateKind, self.kind) + if self.message is not None: + result["message"] = from_union([from_str, from_none], self.message) + if self.percentage is not None: + result["percentage"] = from_union([to_float, from_none], self.percentage) + if self.phase is not None: + result["phase"] = from_union([from_none, from_str], self.phase) + if self.status is not None: + result["status"] = from_union([lambda x: to_enum(TaskClientActiveStatus, x), from_none], self.status) + if self.result is not None: + result["result"] = self.result + if self.code is not None: + result["code"] = from_union([from_str, from_none], self.code) + if self.error is not None: + result["error"] = from_union([from_str, from_none], self.error) + if self.reason is not None: + result["reason"] = from_union([from_str, from_none], self.reason) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class TaskShellInfo: @@ -28541,6 +29098,143 @@ def to_dict(self) -> dict: result["paths"] = from_list(lambda x: to_class(SkillDiscoveryPath, x), self.paths) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TaskClientInfo: + """Tracked client-owned task metadata. + + Authoritative registered or reclaimed task + + Authoritative task after processing the update + """ + active_time_ms: int + """Accumulated active execution time in milliseconds""" + + can_cancel: bool + """Whether the currently bound owner can receive a cancellation request""" + + client_task_id: str + """Owner-scoped registration and reclaim key""" + + description: str + """Task description""" + + execution_mode: TaskClientExecutionMode + """Execution mode, which is always background for client-owned tasks""" + + id: str + """Canonical runtime-generated task identifier""" + + owner: TaskClientOwner + """Public attribution and presence for the task owner""" + + sequence: int + """Sequence number of the latest accepted owner update""" + + started_at: datetime + """ISO 8601 timestamp when the task started""" + + status: TaskClientStatus + """Client task lifecycle status""" + + type: ClassVar[str] = "client" + """Task kind""" + + updated_at: datetime + """ISO 8601 timestamp of the latest accepted lifecycle change""" + + active_started_at: datetime | None = None + """ISO 8601 timestamp when the current active segment started""" + + cancellation_reason: str | None = None + """Human-readable reason for terminal cancellation""" + + completed_at: datetime | None = None + """ISO 8601 timestamp when the task reached a terminal status""" + + display_name: str | None = None + """Optional task display name""" + + error: str | None = None + """Human-readable terminal failure message""" + + error_code: str | None = None + """Optional owner-supplied terminal failure code""" + + idle_since: datetime | None = None + """ISO 8601 timestamp when the connected owner entered idle status""" + + orphaned_at: datetime | None = None + """ISO 8601 timestamp of the most recent orphan transition""" + + reclaimed_at: datetime | None = None + """ISO 8601 timestamp of the most recent successful reclaim""" + + result: Any = None + """Opaque successful terminal result supplied by the task owner""" + + @staticmethod + def from_dict(obj: Any) -> 'TaskClientInfo': + assert isinstance(obj, dict) + active_time_ms = from_int(obj.get("activeTimeMs")) + can_cancel = from_bool(obj.get("canCancel")) + client_task_id = from_str(obj.get("clientTaskId")) + description = from_str(obj.get("description")) + execution_mode = TaskClientExecutionMode(obj.get("executionMode")) + id = from_str(obj.get("id")) + owner = TaskClientOwner.from_dict(obj.get("owner")) + sequence = from_int(obj.get("sequence")) + started_at = from_datetime(obj.get("startedAt")) + status = TaskClientStatus(obj.get("status")) + updated_at = from_datetime(obj.get("updatedAt")) + active_started_at = from_union([from_datetime, from_none], obj.get("activeStartedAt")) + cancellation_reason = from_union([from_str, from_none], obj.get("cancellationReason")) + completed_at = from_union([from_datetime, from_none], obj.get("completedAt")) + display_name = from_union([from_str, from_none], obj.get("displayName")) + error = from_union([from_str, from_none], obj.get("error")) + error_code = from_union([from_str, from_none], obj.get("errorCode")) + idle_since = from_union([from_datetime, from_none], obj.get("idleSince")) + orphaned_at = from_union([from_datetime, from_none], obj.get("orphanedAt")) + reclaimed_at = from_union([from_datetime, from_none], obj.get("reclaimedAt")) + result = obj.get("result") + return TaskClientInfo(active_time_ms, can_cancel, client_task_id, description, execution_mode, id, owner, sequence, started_at, status, updated_at, active_started_at, cancellation_reason, completed_at, display_name, error, error_code, idle_since, orphaned_at, reclaimed_at, result) + + def to_dict(self) -> dict: + result: dict = {} + result["activeTimeMs"] = from_int(self.active_time_ms) + result["canCancel"] = from_bool(self.can_cancel) + result["clientTaskId"] = from_str(self.client_task_id) + result["description"] = from_str(self.description) + result["executionMode"] = to_enum(TaskClientExecutionMode, self.execution_mode) + result["id"] = from_str(self.id) + result["owner"] = to_class(TaskClientOwner, self.owner) + result["sequence"] = from_int(self.sequence) + result["startedAt"] = self.started_at.isoformat() + result["status"] = to_enum(TaskClientStatus, self.status) + result["type"] = self.type + result["updatedAt"] = self.updated_at.isoformat() + if self.active_started_at is not None: + result["activeStartedAt"] = from_union([lambda x: x.isoformat(), from_none], self.active_started_at) + if self.cancellation_reason is not None: + result["cancellationReason"] = from_union([from_str, from_none], self.cancellation_reason) + if self.completed_at is not None: + result["completedAt"] = from_union([lambda x: x.isoformat(), from_none], self.completed_at) + if self.display_name is not None: + result["displayName"] = from_union([from_str, from_none], self.display_name) + if self.error is not None: + result["error"] = from_union([from_str, from_none], self.error) + if self.error_code is not None: + result["errorCode"] = from_union([from_str, from_none], self.error_code) + if self.idle_since is not None: + result["idleSince"] = from_union([lambda x: x.isoformat(), from_none], self.idle_since) + if self.orphaned_at is not None: + result["orphanedAt"] = from_union([lambda x: x.isoformat(), from_none], self.orphaned_at) + if self.reclaimed_at is not None: + result["reclaimedAt"] = from_union([lambda x: x.isoformat(), from_none], self.reclaimed_at) + if self.result is not None: + result["result"] = self.result + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class TasksGetProgressResult: @@ -28563,6 +29257,35 @@ def to_dict(self) -> dict: result["progress"] = from_union([lambda x: to_class(TaskProgress, x), from_none], self.progress) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TasksUpdateRequest: + """Updates a client-owned task.""" + + id: str + """Canonical runtime-generated task identifier""" + + sequence: int + """Owner update sequence to apply""" + + update: TaskClientUpdate + """Progress or terminal update payload""" + + @staticmethod + def from_dict(obj: Any) -> 'TasksUpdateRequest': + assert isinstance(obj, dict) + id = from_str(obj.get("id")) + sequence = from_int(obj.get("sequence")) + update = TaskClientUpdate.from_dict(obj.get("update")) + return TasksUpdateRequest(id, sequence, update) + + def to_dict(self) -> dict: + result: dict = {} + result["id"] = from_str(self.id) + result["sequence"] = from_int(self.sequence) + result["update"] = to_class(TaskClientUpdate, self.update) + return result + # Experimental: this type is part of an experimental API and may change or be removed. # Internal: this type is an internal SDK API and is not part of the public surface. @dataclass @@ -30767,6 +31490,13 @@ class SandboxConfig: add_current_working_directory: bool | None = None """Whether to auto-add the current working directory to readwritePaths. Default: true.""" + allow_bypass: bool | None = None + """Whether the agent may request that an individual command run outside the sandbox, which + the host then approves or denies through the usual permission flow. A host capability + flag rather than part of the policy: it is stripped from the effective spawn policy and + only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this + object: omitting it offers no bypass. Default: false (opt-in). + """ allow_dev_tool_access: bool | None = None """Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common @@ -30783,6 +31513,29 @@ class SandboxConfig: auth: SandboxConfigAuth | None = None """Credential-injection capability flags.""" + # Internal: this field is an internal SDK API and is not part of the public surface. + managed_lsp_routing_locked: bool | None = None + """The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`.""" + + # Internal: this field is an internal SDK API and is not part of the public surface. + managed_mcp_routing_locked: bool | None = None + """Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local + opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at + the administrator instead of a setting the next managed merge would override, and it is + ignored when comparing two configs for change. Only the managed merge may set it; a + caller-supplied value is stripped. + """ + sandbox_lsp_servers: bool | None = None + """Whether language servers the session launches are confined by the sandbox. Only an + explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by + default; set to false to opt out). + """ + sandbox_mcp_servers: bool | None = None + """Whether MCP servers the session launches are confined by the sandbox. Only an explicit + `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and + `enabled` are always read together. Ignored while `enabled` is false. Default: true + (enabled by default; set to false to opt out). + """ user_policy: SandboxConfigUserPolicy | None = None """User-managed sandbox policy fragment merged into the auto-discovered base policy.""" @@ -30791,20 +31544,35 @@ def from_dict(obj: Any) -> 'SandboxConfig': assert isinstance(obj, dict) enabled = from_bool(obj.get("enabled")) add_current_working_directory = from_union([from_bool, from_none], obj.get("addCurrentWorkingDirectory")) + allow_bypass = from_union([from_bool, from_none], obj.get("allowBypass")) allow_dev_tool_access = from_union([from_bool, from_none], obj.get("allowDevToolAccess")) auth = from_union([SandboxConfigAuth.from_dict, from_none], obj.get("auth")) + managed_lsp_routing_locked = from_union([from_bool, from_none], obj.get("managedLspRoutingLocked")) + managed_mcp_routing_locked = from_union([from_bool, from_none], obj.get("managedMcpRoutingLocked")) + sandbox_lsp_servers = from_union([from_bool, from_none], obj.get("sandboxLspServers")) + sandbox_mcp_servers = from_union([from_bool, from_none], obj.get("sandboxMcpServers")) user_policy = from_union([SandboxConfigUserPolicy.from_dict, from_none], obj.get("userPolicy")) - return SandboxConfig(enabled, add_current_working_directory, allow_dev_tool_access, auth, user_policy) + return SandboxConfig(enabled, add_current_working_directory, allow_bypass, allow_dev_tool_access, auth, managed_lsp_routing_locked, managed_mcp_routing_locked, sandbox_lsp_servers, sandbox_mcp_servers, user_policy) def to_dict(self) -> dict: result: dict = {} result["enabled"] = from_bool(self.enabled) if self.add_current_working_directory is not None: result["addCurrentWorkingDirectory"] = from_union([from_bool, from_none], self.add_current_working_directory) + if self.allow_bypass is not None: + result["allowBypass"] = from_union([from_bool, from_none], self.allow_bypass) if self.allow_dev_tool_access is not None: result["allowDevToolAccess"] = from_union([from_bool, from_none], self.allow_dev_tool_access) if self.auth is not None: result["auth"] = from_union([lambda x: to_class(SandboxConfigAuth, x), from_none], self.auth) + if self.managed_lsp_routing_locked is not None: + result["managedLspRoutingLocked"] = from_union([from_bool, from_none], self.managed_lsp_routing_locked) + if self.managed_mcp_routing_locked is not None: + result["managedMcpRoutingLocked"] = from_union([from_bool, from_none], self.managed_mcp_routing_locked) + if self.sandbox_lsp_servers is not None: + result["sandboxLspServers"] = from_union([from_bool, from_none], self.sandbox_lsp_servers) + if self.sandbox_mcp_servers is not None: + result["sandboxMcpServers"] = from_union([from_bool, from_none], self.sandbox_mcp_servers) if self.user_policy is not None: result["userPolicy"] = from_union([lambda x: to_class(SandboxConfigUserPolicy, x), from_none], self.user_policy) return result @@ -30834,6 +31602,64 @@ def to_dict(self) -> dict: result["error"] = from_union([lambda x: to_class(SessionFSSqliteTransactionError, x), from_none], self.error) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TasksRegisterResult: + """Result of registering or reclaiming a client-owned task.""" + + created: bool + """True only when this invocation created a new task""" + + reclaimed: bool + """True only when this invocation reclaimed an orphaned task""" + + task: TaskClientInfo + """Authoritative registered or reclaimed task""" + + @staticmethod + def from_dict(obj: Any) -> 'TasksRegisterResult': + assert isinstance(obj, dict) + created = from_bool(obj.get("created")) + reclaimed = from_bool(obj.get("reclaimed")) + task = TaskClientInfo.from_dict(obj.get("task")) + return TasksRegisterResult(created, reclaimed, task) + + def to_dict(self) -> dict: + result: dict = {} + result["created"] = from_bool(self.created) + result["reclaimed"] = from_bool(self.reclaimed) + result["task"] = to_class(TaskClientInfo, self.task) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class TasksUpdateResult: + """Result of publishing a client-owned task update.""" + + applied: bool + """Whether this invocation changed task state""" + + duplicate: bool + """Whether this invocation repeated the latest accepted update""" + + task: TaskClientInfo + """Authoritative task after processing the update""" + + @staticmethod + def from_dict(obj: Any) -> 'TasksUpdateResult': + assert isinstance(obj, dict) + applied = from_bool(obj.get("applied")) + duplicate = from_bool(obj.get("duplicate")) + task = TaskClientInfo.from_dict(obj.get("task")) + return TasksUpdateResult(applied, duplicate, task) + + def to_dict(self) -> dict: + result: dict = {} + result["applied"] = from_bool(self.applied) + result["duplicate"] = from_bool(self.duplicate) + result["task"] = to_class(TaskClientInfo, self.task) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPConfigAddRequest: @@ -31229,6 +32055,9 @@ class SessionOpenOptions: ask_user_disabled: bool | None = None """Whether ask_user is explicitly disabled.""" + auth_client_id_metadata_url: str | None = None + """OAuth Client ID Metadata Document URL used by this host for MCP authorization.""" + auth_info: AuthInfo | None = None """Initial authentication info for the session.""" @@ -31481,6 +32310,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': agent_context = from_union([from_str, from_none], obj.get("agentContext")) allow_all_mcp_server_instructions = from_union([from_bool, from_none], obj.get("allowAllMcpServerInstructions")) ask_user_disabled = from_union([from_bool, from_none], obj.get("askUserDisabled")) + auth_client_id_metadata_url = from_union([from_str, from_none], obj.get("authClientIdMetadataUrl")) auth_info = from_union([_load_AuthInfo, from_none], obj.get("authInfo")) available_tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("availableTools")) capi = from_union([CapiSessionOptions.from_dict, from_none], obj.get("capi")) @@ -31547,7 +32377,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': verbosity = from_union([Verbosity, from_none], obj.get("verbosity")) working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) working_directory_context = from_union([SessionContext.from_dict, from_none], obj.get("workingDirectoryContext")) - return SessionOpenOptions(additional_content_exclusion_policies, additional_directories, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_mcp_servers, disabled_skills, enable_citations, enable_file_change_tracking, enable_managed_settings, enable_on_demand_instruction_discovery, enable_script_safety, enable_skills, enable_streaming, env_value_mode, events_log_directory, events_log_includes_subagents, excluded_builtin_agents, excluded_tools, exp_assignments, feature_flags, has_skill_provider, included_builtin_agents, included_builtin_skills, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, managed_settings, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, sandbox_config_source, session_capabilities, session_id, session_limits, shell, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, verbosity, working_directory, working_directory_context) + return SessionOpenOptions(additional_content_exclusion_policies, additional_directories, agent_context, allow_all_mcp_server_instructions, ask_user_disabled, auth_client_id_metadata_url, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_mcp_servers, disabled_skills, enable_citations, enable_file_change_tracking, enable_managed_settings, enable_on_demand_instruction_discovery, enable_script_safety, enable_skills, enable_streaming, env_value_mode, events_log_directory, events_log_includes_subagents, excluded_builtin_agents, excluded_tools, exp_assignments, feature_flags, has_skill_provider, included_builtin_agents, included_builtin_skills, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, managed_settings, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, sandbox_config_source, session_capabilities, session_id, session_limits, shell, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, verbosity, working_directory, working_directory_context) def to_dict(self) -> dict: result: dict = {} @@ -31561,6 +32391,8 @@ def to_dict(self) -> dict: result["allowAllMcpServerInstructions"] = from_union([from_bool, from_none], self.allow_all_mcp_server_instructions) if self.ask_user_disabled is not None: result["askUserDisabled"] = from_union([from_bool, from_none], self.ask_user_disabled) + if self.auth_client_id_metadata_url is not None: + result["authClientIdMetadataUrl"] = from_union([from_str, from_none], self.auth_client_id_metadata_url) if self.auth_info is not None: result["authInfo"] = from_union([lambda x: (x).to_dict(), from_none], self.auth_info) if self.available_tools is not None: @@ -34294,6 +35126,11 @@ class Model: a recommended alternative. Present only when the service published at least one notice. Hosts should surface these without implying anything is wrong with the model. """ + metadata: dict[str, Any] | None = None + """Provider-supplied model metadata. Keys and JSON-compatible values are preserved + unchanged. This is factual metadata published by the model provider; it carries no picker + or UX semantics. + """ model_picker_category: ModelPickerCategory | None = None """Model capability category for grouping in the model picker""" @@ -34331,6 +35168,7 @@ def from_dict(obj: Any) -> 'Model': billing = from_union([ModelBilling.from_dict, from_none], obj.get("billing")) default_reasoning_effort = from_union([from_str, from_none], obj.get("defaultReasoningEffort")) info_messages = from_union([lambda x: from_list(ModelMessage.from_dict, x), from_none], obj.get("infoMessages")) + metadata = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("metadata")) model_picker_category = from_union([ModelPickerCategory, from_none], obj.get("modelPickerCategory")) model_picker_price_category = from_union([ModelPickerPriceCategory, from_none], obj.get("modelPickerPriceCategory")) policy = from_union([ModelPolicy.from_dict, from_none], obj.get("policy")) @@ -34338,7 +35176,7 @@ def from_dict(obj: Any) -> 'Model': supported_reasoning_efforts = from_union([lambda x: from_list(from_str, x), from_none], obj.get("supportedReasoningEfforts")) warning_messages = from_union([lambda x: from_list(ModelMessage.from_dict, x), from_none], obj.get("warningMessages")) warning_text = from_union([ModelWarningText.from_dict, from_none], obj.get("warningText")) - return Model(capabilities, id, name, billing, default_reasoning_effort, info_messages, model_picker_category, model_picker_price_category, policy, supported_context_tiers, supported_reasoning_efforts, warning_messages, warning_text) + return Model(capabilities, id, name, billing, default_reasoning_effort, info_messages, metadata, model_picker_category, model_picker_price_category, policy, supported_context_tiers, supported_reasoning_efforts, warning_messages, warning_text) def to_dict(self) -> dict: result: dict = {} @@ -34351,6 +35189,8 @@ def to_dict(self) -> dict: result["defaultReasoningEffort"] = from_union([from_str, from_none], self.default_reasoning_effort) if self.info_messages is not None: result["infoMessages"] = from_union([lambda x: from_list(lambda x: to_class(ModelMessage, x), x), from_none], self.info_messages) + if self.metadata is not None: + result["metadata"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.metadata) if self.model_picker_category is not None: result["modelPickerCategory"] = from_union([lambda x: to_enum(ModelPickerCategory, x), from_none], self.model_picker_category) if self.model_picker_price_category is not None: @@ -34462,6 +35302,11 @@ class ModelSwitchToRequest: `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. """ + auto_tier: AutoTier | None = None + """Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to + return to provider-default Auto routing. This field is rejected when `modelId` is not + `auto`. + """ compaction_decision: str | None = None """Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary. @@ -34514,6 +35359,7 @@ class ModelSwitchToRequest: def from_dict(obj: Any) -> 'ModelSwitchToRequest': assert isinstance(obj, dict) model_id = from_str(obj.get("modelId")) + auto_tier = from_union([AutoTier, from_none], obj.get("autoTier")) compaction_decision = from_union([from_str, from_none], obj.get("compactionDecision")) context_tier = from_union([ContextTier, from_none], obj.get("contextTier")) defer_if_model_change_queued = from_union([from_bool, from_none], obj.get("deferIfModelChangeQueued")) @@ -34527,11 +35373,13 @@ def from_dict(obj: Any) -> 'ModelSwitchToRequest': run_compaction_preflight = from_union([from_bool, from_none], obj.get("runCompactionPreflight")) source = from_union([ModelChangeSource, from_none], obj.get("source")) verbosity = from_union([Verbosity, from_none], obj.get("verbosity")) - return ModelSwitchToRequest(model_id, compaction_decision, context_tier, defer_if_model_change_queued, model_capabilities, model_change_scope, picker_persistence, reasoning_effort, reasoning_summary, repo_scope, require_available, run_compaction_preflight, source, verbosity) + return ModelSwitchToRequest(model_id, auto_tier, compaction_decision, context_tier, defer_if_model_change_queued, model_capabilities, model_change_scope, picker_persistence, reasoning_effort, reasoning_summary, repo_scope, require_available, run_compaction_preflight, source, verbosity) def to_dict(self) -> dict: result: dict = {} result["modelId"] = from_str(self.model_id) + if self.auto_tier is not None: + result["autoTier"] = from_union([lambda x: to_enum(AutoTier, x), from_none], self.auto_tier) if self.compaction_decision is not None: result["compactionDecision"] = from_union([from_str, from_none], self.compaction_decision) if self.context_tier is not None: @@ -35613,6 +36461,9 @@ class RPC: catalog_unsafe_retrieval_error: CatalogUnsafeRetrievalError catalog_unsafe_retrieval_reason: CatalogUnsafeRetrievalReason catalog_unsupported_kind_error: CatalogUnsupportedKindError + client_task_cancel_reason: ClientTaskCancelReason + client_task_cancel_request: ClientTaskCancelRequest + client_task_cancel_result: ClientTaskCancelResult command_list: CommandList commands_finalize_invocation_effect_request: CommandsFinalizeInvocationEffectRequest commands_finalize_invocation_effect_result: CommandsFinalizeInvocationEffectResult @@ -36032,6 +36883,9 @@ class RPC: model_set_reasoning_effort_request: ModelSetReasoningEffortRequest model_set_reasoning_effort_result: ModelSetReasoningEffortResult models_list_request: ModelsListRequest + model_switch_auto_tier_request: ModelSwitchAutoTierRequest + model_switch_auto_tier_result: ModelSwitchAutoTierResult + model_switch_auto_tier_status: ModelSwitchAutoTierStatus model_switch_confirmation: ModelSwitchConfirmation model_switch_to_request: ModelSwitchToRequest model_switch_to_result: ModelSwitchToResult @@ -36542,10 +37396,21 @@ class RPC: subagent_settings_entry_context_tier: SubagentSettingsEntryContextTier task_agent_info: TaskAgentInfo task_agent_progress: TaskAgentProgress + task_client_active_status: TaskClientActiveStatus + task_client_execution_mode: TaskClientExecutionMode + task_client_info: TaskClientInfo + task_client_owner: TaskClientOwner + task_client_owner_kind: TaskClientOwnerKind + task_client_owner_presence: TaskClientOwnerPresence + task_client_progress: TaskClientProgress + task_client_status: TaskClientStatus + task_client_type: TaskClientType + task_client_update: TaskClientUpdate task_complete_data: TaskCompleteData task_completion_decision: TaskCompletionDecision task_execution_mode: TaskExecutionMode task_info: TaskInfo + task_kind: TaskKind task_list: TaskList task_progress_line: TaskProgressLine tasks_cancel_request: TasksCancelRequest @@ -36560,6 +37425,8 @@ class RPC: tasks_promote_to_background_request: TasksPromoteToBackgroundRequest tasks_promote_to_background_result: TasksPromoteToBackgroundResult tasks_refresh_result: TasksRefreshResult + tasks_register_request: TasksRegisterRequest + tasks_register_result: TasksRegisterResult tasks_remove_request: TasksRemoveRequest tasks_remove_result: TasksRemoveResult tasks_send_message_request: TasksSendMessageRequest @@ -36567,6 +37434,8 @@ class RPC: tasks_start_agent_request: TasksStartAgentRequest tasks_start_agent_result: TasksStartAgentResult task_status: TaskStatus + tasks_update_request: TasksUpdateRequest + tasks_update_result: TasksUpdateResult tasks_wait_for_pending_result: TasksWaitForPendingResult telemetry_set_feature_overrides_request: TelemetrySetFeatureOverridesRequest token_auth_info: TokenAuthInfo @@ -36807,6 +37676,9 @@ def from_dict(obj: Any) -> 'RPC': catalog_unsafe_retrieval_error = CatalogUnsafeRetrievalError.from_dict(obj.get("CatalogUnsafeRetrievalError")) catalog_unsafe_retrieval_reason = CatalogUnsafeRetrievalReason(obj.get("CatalogUnsafeRetrievalReason")) catalog_unsupported_kind_error = CatalogUnsupportedKindError.from_dict(obj.get("CatalogUnsupportedKindError")) + client_task_cancel_reason = ClientTaskCancelReason(obj.get("ClientTaskCancelReason")) + client_task_cancel_request = ClientTaskCancelRequest.from_dict(obj.get("ClientTaskCancelRequest")) + client_task_cancel_result = ClientTaskCancelResult.from_dict(obj.get("ClientTaskCancelResult")) command_list = CommandList.from_dict(obj.get("CommandList")) commands_finalize_invocation_effect_request = CommandsFinalizeInvocationEffectRequest.from_dict(obj.get("CommandsFinalizeInvocationEffectRequest")) commands_finalize_invocation_effect_result = CommandsFinalizeInvocationEffectResult.from_dict(obj.get("CommandsFinalizeInvocationEffectResult")) @@ -37226,6 +38098,9 @@ def from_dict(obj: Any) -> 'RPC': model_set_reasoning_effort_request = ModelSetReasoningEffortRequest.from_dict(obj.get("ModelSetReasoningEffortRequest")) model_set_reasoning_effort_result = ModelSetReasoningEffortResult.from_dict(obj.get("ModelSetReasoningEffortResult")) models_list_request = ModelsListRequest.from_dict(obj.get("ModelsListRequest")) + model_switch_auto_tier_request = ModelSwitchAutoTierRequest.from_dict(obj.get("ModelSwitchAutoTierRequest")) + model_switch_auto_tier_result = ModelSwitchAutoTierResult.from_dict(obj.get("ModelSwitchAutoTierResult")) + model_switch_auto_tier_status = ModelSwitchAutoTierStatus(obj.get("ModelSwitchAutoTierStatus")) model_switch_confirmation = ModelSwitchConfirmation.from_dict(obj.get("ModelSwitchConfirmation")) model_switch_to_request = ModelSwitchToRequest.from_dict(obj.get("ModelSwitchToRequest")) model_switch_to_result = ModelSwitchToResult.from_dict(obj.get("ModelSwitchToResult")) @@ -37736,10 +38611,21 @@ def from_dict(obj: Any) -> 'RPC': subagent_settings_entry_context_tier = SubagentSettingsEntryContextTier(obj.get("SubagentSettingsEntryContextTier")) task_agent_info = TaskAgentInfo.from_dict(obj.get("TaskAgentInfo")) task_agent_progress = TaskAgentProgress.from_dict(obj.get("TaskAgentProgress")) + task_client_active_status = TaskClientActiveStatus(obj.get("TaskClientActiveStatus")) + task_client_execution_mode = TaskClientExecutionMode(obj.get("TaskClientExecutionMode")) + task_client_info = TaskClientInfo.from_dict(obj.get("TaskClientInfo")) + task_client_owner = TaskClientOwner.from_dict(obj.get("TaskClientOwner")) + task_client_owner_kind = TaskClientOwnerKind(obj.get("TaskClientOwnerKind")) + task_client_owner_presence = TaskClientOwnerPresence(obj.get("TaskClientOwnerPresence")) + task_client_progress = TaskClientProgress.from_dict(obj.get("TaskClientProgress")) + task_client_status = TaskClientStatus(obj.get("TaskClientStatus")) + task_client_type = TaskClientType(obj.get("TaskClientType")) + task_client_update = TaskClientUpdate.from_dict(obj.get("TaskClientUpdate")) task_complete_data = TaskCompleteData.from_dict(obj.get("TaskCompleteData")) task_completion_decision = TaskCompletionDecision.from_dict(obj.get("TaskCompletionDecision")) task_execution_mode = TaskExecutionMode(obj.get("TaskExecutionMode")) task_info = _load_TaskInfo(obj.get("TaskInfo")) + task_kind = TaskKind(obj.get("TaskKind")) task_list = TaskList.from_dict(obj.get("TaskList")) task_progress_line = TaskProgressLine.from_dict(obj.get("TaskProgressLine")) tasks_cancel_request = TasksCancelRequest.from_dict(obj.get("TasksCancelRequest")) @@ -37754,6 +38640,8 @@ def from_dict(obj: Any) -> 'RPC': tasks_promote_to_background_request = TasksPromoteToBackgroundRequest.from_dict(obj.get("TasksPromoteToBackgroundRequest")) tasks_promote_to_background_result = TasksPromoteToBackgroundResult.from_dict(obj.get("TasksPromoteToBackgroundResult")) tasks_refresh_result = TasksRefreshResult.from_dict(obj.get("TasksRefreshResult")) + tasks_register_request = TasksRegisterRequest.from_dict(obj.get("TasksRegisterRequest")) + tasks_register_result = TasksRegisterResult.from_dict(obj.get("TasksRegisterResult")) tasks_remove_request = TasksRemoveRequest.from_dict(obj.get("TasksRemoveRequest")) tasks_remove_result = TasksRemoveResult.from_dict(obj.get("TasksRemoveResult")) tasks_send_message_request = TasksSendMessageRequest.from_dict(obj.get("TasksSendMessageRequest")) @@ -37761,6 +38649,8 @@ def from_dict(obj: Any) -> 'RPC': tasks_start_agent_request = TasksStartAgentRequest.from_dict(obj.get("TasksStartAgentRequest")) tasks_start_agent_result = TasksStartAgentResult.from_dict(obj.get("TasksStartAgentResult")) task_status = TaskStatus(obj.get("TaskStatus")) + tasks_update_request = TasksUpdateRequest.from_dict(obj.get("TasksUpdateRequest")) + tasks_update_result = TasksUpdateResult.from_dict(obj.get("TasksUpdateResult")) tasks_wait_for_pending_result = TasksWaitForPendingResult.from_dict(obj.get("TasksWaitForPendingResult")) telemetry_set_feature_overrides_request = TelemetrySetFeatureOverridesRequest.from_dict(obj.get("TelemetrySetFeatureOverridesRequest")) token_auth_info = TokenAuthInfo.from_dict(obj.get("TokenAuthInfo")) @@ -37874,7 +38764,7 @@ def from_dict(obj: Any) -> 'RPC': subagent_settings = from_union([SubagentSettings.from_dict, from_none], obj.get("SubagentSettings")) task_progress = from_union([TaskProgress.from_dict, from_none], obj.get("TaskProgress")) workspace_summary = from_union([WorkspaceSummary.from_dict, from_none], obj.get("WorkspaceSummary")) - return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_list_request, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agent_set_prompt_request, agents_get_discovery_paths_request, api_key_auth_info, auth_identity, auth_info, auth_info_type, auth_validation_error, auth_validation_errors, built_in_model_catalog, built_in_model_catalog_entry, builtin_tool_descriptor, builtin_tool_format, builtin_tool_format_type, builtin_tool_input_schema, builtin_tool_input_schema_type, builtin_tool_safe_for_telemetry, builtin_tool_safe_telemetry_fields, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_provider_register_request, canvas_provider_unregister_request, canvas_session_context, capi_session_options, card_digest, card_digest_algorithm, card_digest_value, catalog_ai_skill_candidate, catalog_ai_skill_candidate_provenance, catalog_authentication_required_error, catalog_authentication_required_reason, catalog_candidate, catalog_candidate_kind, catalog_candidate_source, catalog_candidate_source_embedded, catalog_candidate_source_url, catalog_capability, catalog_capability_id, catalog_client_contract, catalog_contract_violation_error, catalog_contract_violation_reason, catalog_handle_rejected_error, catalog_handle_rejection_reason, catalog_handle_type, catalog_invalid_request_error, catalog_invalid_request_field, catalog_malformed_card_error, catalog_malformed_card_reason, catalog_mcp_server_candidate, catalog_mcp_server_candidate_provenance, catalog_mcp_server_installability, catalog_media_type, catalog_negotiated_contract, catalog_negotiation_refused_error, catalog_negotiation_refused_reason, catalog_network_failure_error, catalog_network_failure_reason, catalog_not_installable_error, catalog_not_installable_reason, catalog_policy_rejected_error, catalog_search_request, catalog_search_result, catalog_search_succeeded, catalog_unavailable_error, catalog_unavailable_reason, catalog_unavailable_transport_error, catalog_unavailable_transport_reason, catalog_unsafe_retrieval_error, catalog_unsafe_retrieval_reason, catalog_unsupported_kind_error, command_list, commands_finalize_invocation_effect_request, commands_finalize_invocation_effect_result, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invocation_effect_outcome, commands_invocation_origin, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connect_client_info, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, discovered_canvas, discovered_extension, discovered_extension_mode, discovered_extension_plugin, discovered_extensions, discovered_extensions_disable_request, discovered_extensions_enable_request, discovered_extension_source, discovered_hook, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_direction, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_launch_profile, extension_launch_provider_resolve_request, extension_launch_provider_resolve_result, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, factory_abort_request, factory_ack_result, factory_agent_options, factory_agent_request, factory_agent_result, factory_agent_summary, factory_cancel_request, factory_current_phase, factory_declared_limits, factory_durable_operation, factory_execute_request, factory_execute_result, factory_get_run_progress_request, factory_get_run_request, factory_journal_get_request, factory_journal_get_result, factory_journal_put_request, factory_list_runs_request, factory_list_runs_result, factory_log_line, factory_log_line_kind, factory_log_request, factory_phase_observation, factory_phase_status, factory_progress_line, factory_progress_page, factory_resume_request, factory_resume_result, factory_run_consumed, factory_run_detail, factory_run_failure, factory_run_failure_kind, factory_run_limits, factory_run_request, factory_run_result, factory_run_status, factory_run_summary, factory_run_terminal, factory_tool_resume_request, factory_tool_run_options, factory_tool_run_request, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, git_hub_token_acquire_reason, git_hub_token_acquire_request, git_hub_token_acquire_result, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_clear_context_request, history_clear_context_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_origin, hooks_discover_request, hooks_discover_result, hook_type, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, interrupt_main_turn_request, interrupt_main_turn_result, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, managed_settings_read_result, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_elicitation_form_mode, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_failed_server, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_install_plan, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_authentication_state_changed_request, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_probe_needs_auth_reason, mcp_oauth_probe_request, mcp_oauth_probe_result, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_plan_configuration_change, mcp_plan_configuration_operation, mcp_plan_enum_value_type, mcp_plan_install_planned, mcp_plan_install_request, mcp_plan_install_result, mcp_plan_install_source, mcp_plan_install_source_candidate, mcp_plan_install_source_candidate_kind, mcp_plan_install_source_card, mcp_plan_install_source_card_kind, mcp_plan_package_install_method, mcp_plan_package_transport, mcp_plan_policy_decision, mcp_plan_policy_result, mcp_plan_policy_source, mcp_plan_provenance, mcp_plan_remote_install_method, mcp_plan_remote_transport, mcp_plan_required_value, mcp_plan_required_value_enum, mcp_plan_required_value_enum_kind, mcp_plan_required_value_scalar, mcp_plan_required_value_scalar_kind, mcp_plan_resource_identity, mcp_plan_scalar_value_type, mcp_plan_scope, mcp_plan_secret_placeholder, mcp_plan_secret_reference, mcp_plan_target, mcp_plan_transport_choice, mcp_plan_transport_choice_package, mcp_plan_transport_choice_remote, mcp_plan_value_category, mcp_register_external_client_request, mcp_reload_config, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_safe_for_telemetry, mcp_safe_for_telemetry_fields, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_serializable_server_config, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_card_embedded, mcp_server_card_embedded_kind, mcp_server_card_media_type, mcp_server_card_reference, mcp_server_card_url, mcp_server_card_url_kind, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_memory, mcp_server_config_memory_type, mcp_server_config_stdio, mcp_server_config_stdio_type, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_task_metadata, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_apply_startup_overlay_request, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_message, model_picker_category, model_picker_persistence_request, model_picker_price_category, model_picker_settings_context, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_confirmation, model_switch_to_request, model_switch_to_result, model_warning_text, mode_set_request, mode_set_result, move_mcp_loading_to_background_result, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_env_access, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_factory, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_env_access, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_factory, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_context, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_outcome, permission_decision_reject, permission_decision_request, permission_decision_source, permission_decision_surface, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_mode_source, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_response_capability, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_mode_request, permissions_get_mode_result, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_env_access, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_factory, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_mode_request, permissions_set_mode_result, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_builtin_set_request, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, protocol_external_tool_defer, protocol_external_tool_definition, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_duplicate_at_request, queue_duplicate_at_result, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_insert_at_request, queue_insert_at_result, queue_insert_message, queue_move_item_request, queue_move_item_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_at_request, queue_remove_at_result, queue_remove_most_recent_result, queue_send_now_request, queue_send_now_result, queue_set_drain_paused_request, queue_snapshot_result, queue_update_text_request, queue_update_text_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_host_status, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, run_options, sandbox_config, sandbox_config_auth, sandbox_config_source, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_network_proxy, sandbox_config_user_policy_seatbelt, sandbox_enforcement_status, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_agent_list_request, session_auth_login_request, session_auth_logout_user_request, session_auth_status, session_auth_switch_request, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_commands_list_request, session_completion_item, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_git_hub_auth_get_all_auth_available_result, session_git_hub_auth_logout_result, session_git_hub_auth_logout_user_result, session_history_compact_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_limit_prediction_baseline_data, session_limit_prediction_client_type, session_limit_prediction_details, session_limit_prediction_predict_request, session_limit_prediction_request, session_limit_prediction_result, session_limit_prediction_source, session_limit_prediction_tier, session_limit_prediction_tier_option, session_limit_prediction_unavailable_reason, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_managed_permissions, session_managed_settings, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_model_list_request, session_model_price_category, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_plugins_reload_request, session_provider_get_endpoint_request, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_read_persisted_events_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, settable_auth_info, settable_token_auth_info, shell_cancel_user_requested_request, shell_credentials, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, skills_config_set_disabled_skills_request, skills_config_set_skill_disabled_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_add_timeline_entry_result, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_model_picker_dialog, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_set_model_result, slash_command_set_plan_model_result, slash_command_show_dialog_result, slash_command_text_result, slash_command_timeline_entry, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, token_provider_auth_info, tool, tool_list, tool_result, tool_result_expanded, tool_result_new_message, tool_result_type, tools_execute_request, tools_get_builtin_descriptors_request, tools_get_builtin_descriptors_result, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_set_request, tools_set_result, tools_shell_descriptor_config, tools_task_complete_event_data_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_agent_metric, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, session_auth_info_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) + return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_list_request, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agent_set_prompt_request, agents_get_discovery_paths_request, api_key_auth_info, auth_identity, auth_info, auth_info_type, auth_validation_error, auth_validation_errors, built_in_model_catalog, built_in_model_catalog_entry, builtin_tool_descriptor, builtin_tool_format, builtin_tool_format_type, builtin_tool_input_schema, builtin_tool_input_schema_type, builtin_tool_safe_for_telemetry, builtin_tool_safe_telemetry_fields, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_provider_register_request, canvas_provider_unregister_request, canvas_session_context, capi_session_options, card_digest, card_digest_algorithm, card_digest_value, catalog_ai_skill_candidate, catalog_ai_skill_candidate_provenance, catalog_authentication_required_error, catalog_authentication_required_reason, catalog_candidate, catalog_candidate_kind, catalog_candidate_source, catalog_candidate_source_embedded, catalog_candidate_source_url, catalog_capability, catalog_capability_id, catalog_client_contract, catalog_contract_violation_error, catalog_contract_violation_reason, catalog_handle_rejected_error, catalog_handle_rejection_reason, catalog_handle_type, catalog_invalid_request_error, catalog_invalid_request_field, catalog_malformed_card_error, catalog_malformed_card_reason, catalog_mcp_server_candidate, catalog_mcp_server_candidate_provenance, catalog_mcp_server_installability, catalog_media_type, catalog_negotiated_contract, catalog_negotiation_refused_error, catalog_negotiation_refused_reason, catalog_network_failure_error, catalog_network_failure_reason, catalog_not_installable_error, catalog_not_installable_reason, catalog_policy_rejected_error, catalog_search_request, catalog_search_result, catalog_search_succeeded, catalog_unavailable_error, catalog_unavailable_reason, catalog_unavailable_transport_error, catalog_unavailable_transport_reason, catalog_unsafe_retrieval_error, catalog_unsafe_retrieval_reason, catalog_unsupported_kind_error, client_task_cancel_reason, client_task_cancel_request, client_task_cancel_result, command_list, commands_finalize_invocation_effect_request, commands_finalize_invocation_effect_result, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invocation_effect_outcome, commands_invocation_origin, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connect_client_info, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_exclusion_check_paths_request, content_exclusion_check_paths_result, content_exclusion_path_check, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, discovered_canvas, discovered_extension, discovered_extension_mode, discovered_extension_plugin, discovered_extensions, discovered_extensions_disable_request, discovered_extensions_enable_request, discovered_extension_source, discovered_hook, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_direction, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_launch_profile, extension_launch_provider_resolve_request, extension_launch_provider_resolve_result, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, factory_abort_request, factory_ack_result, factory_agent_options, factory_agent_request, factory_agent_result, factory_agent_summary, factory_cancel_request, factory_current_phase, factory_declared_limits, factory_durable_operation, factory_execute_request, factory_execute_result, factory_get_run_progress_request, factory_get_run_request, factory_journal_get_request, factory_journal_get_result, factory_journal_put_request, factory_list_runs_request, factory_list_runs_result, factory_log_line, factory_log_line_kind, factory_log_request, factory_phase_observation, factory_phase_status, factory_progress_line, factory_progress_page, factory_resume_request, factory_resume_result, factory_run_consumed, factory_run_detail, factory_run_failure, factory_run_failure_kind, factory_run_limits, factory_run_request, factory_run_result, factory_run_status, factory_run_summary, factory_run_terminal, factory_tool_resume_request, factory_tool_run_options, factory_tool_run_request, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, git_hub_token_acquire_reason, git_hub_token_acquire_request, git_hub_token_acquire_result, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_clear_context_request, history_clear_context_result, history_compact_context_window, history_compact_request, history_compact_result, history_file_restore_skip_reason, history_list_rewind_points_result, history_preview_rewind_request, history_preview_rewind_result, history_rewind_change_type, history_rewind_file_preview, history_rewind_mode, history_rewind_outcome, history_rewind_point, history_rewind_request, history_rewind_result, history_rewind_unavailable_reason, history_skipped_file_restore, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, hook_invoke_request, hook_invoke_response, hook_origin, hooks_discover_request, hooks_discover_result, hook_type, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, interrupt_main_turn_request, interrupt_main_turn_result, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, managed_settings_read_result, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_elicitation_form_mode, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_failed_server, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_install_plan, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_authentication_state_changed_request, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_probe_needs_auth_reason, mcp_oauth_probe_request, mcp_oauth_probe_result, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_plan_configuration_change, mcp_plan_configuration_operation, mcp_plan_enum_value_type, mcp_plan_install_planned, mcp_plan_install_request, mcp_plan_install_result, mcp_plan_install_source, mcp_plan_install_source_candidate, mcp_plan_install_source_candidate_kind, mcp_plan_install_source_card, mcp_plan_install_source_card_kind, mcp_plan_package_install_method, mcp_plan_package_transport, mcp_plan_policy_decision, mcp_plan_policy_result, mcp_plan_policy_source, mcp_plan_provenance, mcp_plan_remote_install_method, mcp_plan_remote_transport, mcp_plan_required_value, mcp_plan_required_value_enum, mcp_plan_required_value_enum_kind, mcp_plan_required_value_scalar, mcp_plan_required_value_scalar_kind, mcp_plan_resource_identity, mcp_plan_scalar_value_type, mcp_plan_scope, mcp_plan_secret_placeholder, mcp_plan_secret_reference, mcp_plan_target, mcp_plan_transport_choice, mcp_plan_transport_choice_package, mcp_plan_transport_choice_remote, mcp_plan_value_category, mcp_register_external_client_request, mcp_reload_config, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_safe_for_telemetry, mcp_safe_for_telemetry_fields, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_serializable_server_config, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_card_embedded, mcp_server_card_embedded_kind, mcp_server_card_media_type, mcp_server_card_reference, mcp_server_card_url, mcp_server_card_url_kind, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_memory, mcp_server_config_memory_type, mcp_server_config_stdio, mcp_server_config_stdio_type, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_task_metadata, mcp_tools, mcp_tool_ui, mcp_tool_ui_visibility, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_apply_startup_overlay_request, model_billing, model_billing_promo, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_message, model_picker_category, model_picker_persistence_request, model_picker_price_category, model_picker_settings_context, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_auto_tier_request, model_switch_auto_tier_result, model_switch_auto_tier_status, model_switch_confirmation, model_switch_to_request, model_switch_to_result, model_warning_text, mode_set_request, mode_set_result, move_mcp_loading_to_background_result, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_env_access, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_factory, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_env_access, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_factory, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_context, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_outcome, permission_decision_reject, permission_decision_request, permission_decision_source, permission_decision_surface, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_mode_source, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_response_capability, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_mode_request, permissions_get_mode_result, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_env_access, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_factory, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_mode_request, permissions_set_mode_result, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_builtin_set_request, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, protocol_external_tool_defer, protocol_external_tool_definition, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queue_begin_deferred_idle_drain_request, queue_begin_deferred_idle_drain_result, queue_consume_system_notifications_request, queued_command_handled, queued_command_not_handled, queued_command_result, queue_defer_session_idle_request, queue_duplicate_at_request, queue_duplicate_at_result, queue_enqueue_resume_pending_result, queue_finish_deferred_idle_drain_request, queue_finish_deferred_idle_drain_result, queue_has_pending_result, queue_insert_at_request, queue_insert_at_result, queue_insert_message, queue_move_item_request, queue_move_item_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_at_request, queue_remove_at_result, queue_remove_most_recent_result, queue_send_now_request, queue_send_now_result, queue_set_drain_paused_request, queue_snapshot_result, queue_update_text_request, queue_update_text_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_host_status, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, run_options, sandbox_config, sandbox_config_auth, sandbox_config_source, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_network_proxy, sandbox_config_user_policy_seatbelt, sandbox_enforcement_status, schedule_add_at_request, schedule_add_cron_request, schedule_add_request, schedule_add_result, schedule_add_self_paced_request, schedule_entry, schedule_has_self_paced_result, schedule_list, schedule_rearm_self_paced_request, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, send_system_notification_request, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_agent_list_request, session_auth_login_request, session_auth_logout_user_request, session_auth_status, session_auth_switch_request, session_bulk_delete_result, session_cancel_all_background_agents_result, session_capability, session_commands_list_request, session_completion_item, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_sqlite_transaction_error, session_fs_sqlite_transaction_error_class, session_fs_sqlite_transaction_request, session_fs_sqlite_transaction_result, session_fs_sqlite_transaction_statement, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_git_hub_auth_get_all_auth_available_result, session_git_hub_auth_logout_result, session_git_hub_auth_logout_user_result, session_history_compact_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_limit_prediction_baseline_data, session_limit_prediction_client_type, session_limit_prediction_details, session_limit_prediction_predict_request, session_limit_prediction_request, session_limit_prediction_result, session_limit_prediction_source, session_limit_prediction_tier, session_limit_prediction_tier_option, session_limit_prediction_unavailable_reason, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_managed_permissions, session_managed_settings, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_model_list_request, session_model_price_category, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_plugins_reload_request, session_provider_get_endpoint_request, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_delete_request, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_metadata_request, sessions_get_metadata_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_non_empty_session_ids_request, sessions_list_non_empty_session_ids_result, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_read_persisted_events_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, settable_auth_info, settable_token_auth_info, shell_cancel_user_requested_request, shell_credentials, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_init_profile, shell_init_script, shell_init_script_shell, shell_kill_request, shell_kill_result, shell_kill_signal, shell_options, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skill_provider_descriptor, skill_provider_list_request, skill_provider_list_result, skill_provider_read_request, skill_provider_read_result, skills_config_set_disabled_skills_request, skills_config_set_skill_disabled_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_add_timeline_entry_result, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_model_picker_dialog, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_set_model_result, slash_command_set_plan_model_result, slash_command_show_dialog_result, slash_command_text_result, slash_command_timeline_entry, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_client_active_status, task_client_execution_mode, task_client_info, task_client_owner, task_client_owner_kind, task_client_owner_presence, task_client_progress, task_client_status, task_client_type, task_client_update, task_complete_data, task_completion_decision, task_execution_mode, task_info, task_kind, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_register_request, tasks_register_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_update_request, tasks_update_result, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, token_provider_auth_info, tool, tool_list, tool_result, tool_result_expanded, tool_result_new_message, tool_result_type, tools_execute_request, tools_get_builtin_descriptors_request, tools_get_builtin_descriptors_result, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_set_request, tools_set_result, tools_shell_descriptor_config, tools_task_complete_event_data_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_agent_metric, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_add_summary_request, workspaces_add_summary_result, workspaces_autopilot_objective_exists_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_delete_autopilot_objective_result, workspaces_diff_request, workspaces_ensure_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_autopilot_objective_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspaces_truncate_summaries_request, workspace_summary_host_type, workspaces_update_metadata_request, workspaces_workspace_details_host_type, workspaces_write_autopilot_objective_request, workspaces_write_autopilot_objective_result, session_auth_info_result, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -38001,6 +38891,9 @@ def to_dict(self) -> dict: result["CatalogUnsafeRetrievalError"] = to_class(CatalogUnsafeRetrievalError, self.catalog_unsafe_retrieval_error) result["CatalogUnsafeRetrievalReason"] = to_enum(CatalogUnsafeRetrievalReason, self.catalog_unsafe_retrieval_reason) result["CatalogUnsupportedKindError"] = to_class(CatalogUnsupportedKindError, self.catalog_unsupported_kind_error) + result["ClientTaskCancelReason"] = to_enum(ClientTaskCancelReason, self.client_task_cancel_reason) + result["ClientTaskCancelRequest"] = to_class(ClientTaskCancelRequest, self.client_task_cancel_request) + result["ClientTaskCancelResult"] = to_class(ClientTaskCancelResult, self.client_task_cancel_result) result["CommandList"] = to_class(CommandList, self.command_list) result["CommandsFinalizeInvocationEffectRequest"] = to_class(CommandsFinalizeInvocationEffectRequest, self.commands_finalize_invocation_effect_request) result["CommandsFinalizeInvocationEffectResult"] = to_class(CommandsFinalizeInvocationEffectResult, self.commands_finalize_invocation_effect_result) @@ -38420,6 +39313,9 @@ def to_dict(self) -> dict: result["ModelSetReasoningEffortRequest"] = to_class(ModelSetReasoningEffortRequest, self.model_set_reasoning_effort_request) result["ModelSetReasoningEffortResult"] = to_class(ModelSetReasoningEffortResult, self.model_set_reasoning_effort_result) result["ModelsListRequest"] = to_class(ModelsListRequest, self.models_list_request) + result["ModelSwitchAutoTierRequest"] = to_class(ModelSwitchAutoTierRequest, self.model_switch_auto_tier_request) + result["ModelSwitchAutoTierResult"] = to_class(ModelSwitchAutoTierResult, self.model_switch_auto_tier_result) + result["ModelSwitchAutoTierStatus"] = to_enum(ModelSwitchAutoTierStatus, self.model_switch_auto_tier_status) result["ModelSwitchConfirmation"] = to_class(ModelSwitchConfirmation, self.model_switch_confirmation) result["ModelSwitchToRequest"] = to_class(ModelSwitchToRequest, self.model_switch_to_request) result["ModelSwitchToResult"] = to_class(ModelSwitchToResult, self.model_switch_to_result) @@ -38930,10 +39826,21 @@ def to_dict(self) -> dict: result["SubagentSettingsEntryContextTier"] = to_enum(SubagentSettingsEntryContextTier, self.subagent_settings_entry_context_tier) result["TaskAgentInfo"] = to_class(TaskAgentInfo, self.task_agent_info) result["TaskAgentProgress"] = to_class(TaskAgentProgress, self.task_agent_progress) + result["TaskClientActiveStatus"] = to_enum(TaskClientActiveStatus, self.task_client_active_status) + result["TaskClientExecutionMode"] = to_enum(TaskClientExecutionMode, self.task_client_execution_mode) + result["TaskClientInfo"] = to_class(TaskClientInfo, self.task_client_info) + result["TaskClientOwner"] = to_class(TaskClientOwner, self.task_client_owner) + result["TaskClientOwnerKind"] = to_enum(TaskClientOwnerKind, self.task_client_owner_kind) + result["TaskClientOwnerPresence"] = to_enum(TaskClientOwnerPresence, self.task_client_owner_presence) + result["TaskClientProgress"] = to_class(TaskClientProgress, self.task_client_progress) + result["TaskClientStatus"] = to_enum(TaskClientStatus, self.task_client_status) + result["TaskClientType"] = to_enum(TaskClientType, self.task_client_type) + result["TaskClientUpdate"] = to_class(TaskClientUpdate, self.task_client_update) result["TaskCompleteData"] = to_class(TaskCompleteData, self.task_complete_data) result["TaskCompletionDecision"] = to_class(TaskCompletionDecision, self.task_completion_decision) result["TaskExecutionMode"] = to_enum(TaskExecutionMode, self.task_execution_mode) result["TaskInfo"] = (self.task_info).to_dict() + result["TaskKind"] = to_enum(TaskKind, self.task_kind) result["TaskList"] = to_class(TaskList, self.task_list) result["TaskProgressLine"] = to_class(TaskProgressLine, self.task_progress_line) result["TasksCancelRequest"] = to_class(TasksCancelRequest, self.tasks_cancel_request) @@ -38948,6 +39855,8 @@ def to_dict(self) -> dict: result["TasksPromoteToBackgroundRequest"] = to_class(TasksPromoteToBackgroundRequest, self.tasks_promote_to_background_request) result["TasksPromoteToBackgroundResult"] = to_class(TasksPromoteToBackgroundResult, self.tasks_promote_to_background_result) result["TasksRefreshResult"] = to_class(TasksRefreshResult, self.tasks_refresh_result) + result["TasksRegisterRequest"] = to_class(TasksRegisterRequest, self.tasks_register_request) + result["TasksRegisterResult"] = to_class(TasksRegisterResult, self.tasks_register_result) result["TasksRemoveRequest"] = to_class(TasksRemoveRequest, self.tasks_remove_request) result["TasksRemoveResult"] = to_class(TasksRemoveResult, self.tasks_remove_result) result["TasksSendMessageRequest"] = to_class(TasksSendMessageRequest, self.tasks_send_message_request) @@ -38955,6 +39864,8 @@ def to_dict(self) -> dict: result["TasksStartAgentRequest"] = to_class(TasksStartAgentRequest, self.tasks_start_agent_request) result["TasksStartAgentResult"] = to_class(TasksStartAgentResult, self.tasks_start_agent_result) result["TaskStatus"] = to_enum(TaskStatus, self.task_status) + result["TasksUpdateRequest"] = to_class(TasksUpdateRequest, self.tasks_update_request) + result["TasksUpdateResult"] = to_class(TasksUpdateResult, self.tasks_update_result) result["TasksWaitForPendingResult"] = to_class(TasksWaitForPendingResult, self.tasks_wait_for_pending_result) result["TelemetrySetFeatureOverridesRequest"] = to_class(TelemetrySetFeatureOverridesRequest, self.telemetry_set_feature_overrides_request) result["TokenAuthInfo"] = to_class(TokenAuthInfo, self.token_auth_info) @@ -39411,14 +40322,15 @@ def _load_SlashCommandInvocationResult(obj: Any) -> "SlashCommandInvocationResul case "set-plan-model": return SlashCommandSetPlanModelResult.from_dict(obj) case _: raise ValueError(f"Unknown SlashCommandInvocationResult kind: {kind!r}") -# Tracked task union returned by task APIs, containing either an agent task or a shell task. -TaskInfo = TaskAgentInfo | TaskShellInfo +# Tracked task union returned by task APIs, containing an agent, client, or shell task. +TaskInfo = TaskAgentInfo | TaskClientInfo | TaskShellInfo def _load_TaskInfo(obj: Any) -> "TaskInfo": assert isinstance(obj, dict) kind = obj.get("type") match kind: case "agent": return TaskAgentInfo.from_dict(obj) + case "client": return TaskClientInfo.from_dict(obj) case "shell": return TaskShellInfo.from_dict(obj) case _: raise ValueError(f"Unknown TaskInfo type: {kind!r}") @@ -40329,7 +41241,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self._session_id = session_id async def get_current(self, *, timeout: float | None = None) -> CurrentModel: - "Gets the currently selected model for the session.\n\nReturns:\n The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume." + "Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn.\n\nReturns:\n The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume." return CurrentModel.from_dict(await self._client.request("session.model.getCurrent", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def switch_to(self, params: ModelSwitchToRequest, *, timeout: float | None = None) -> ModelSwitchToResult: @@ -40338,6 +41250,12 @@ async def switch_to(self, params: ModelSwitchToRequest, *, timeout: float | None params_dict["sessionId"] = self._session_id return ModelSwitchToResult.from_dict(await self._client.request("session.model.switchTo", params_dict, **_timeout_kwargs(timeout))) + async def switch_auto_tier(self, params: ModelSwitchAutoTierRequest, *, timeout: float | None = None) -> ModelSwitchAutoTierResult: + "Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`.\n\nArgs:\n params: An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`.\n\nReturns:\n Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return ModelSwitchAutoTierResult.from_dict(await self._client.request("session.model.switchAutoTier", params_dict, **_timeout_kwargs(timeout))) + async def set_reasoning_effort(self, params: ModelSetReasoningEffortRequest, *, timeout: float | None = None) -> ModelSetReasoningEffortResult: "Updates the session's reasoning effort without changing the selected model.\n\nArgs:\n params: Reasoning effort level to apply to the currently selected model.\n\nReturns:\n Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} @@ -40605,6 +41523,18 @@ async def list(self, *, timeout: float | None = None) -> TaskList: "Lists background tasks tracked by the session.\n\nReturns:\n Background tasks currently tracked by the session." return TaskList.from_dict(await self._client.request("session.tasks.list", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + async def register(self, params: TasksRegisterRequest, *, timeout: float | None = None) -> TasksRegisterResult: + "Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal.\n\nArgs:\n params: Registers or reclaims a client-owned task.\n\nReturns:\n Result of registering or reclaiming a client-owned task." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return TasksRegisterResult.from_dict(await self._client.request("session.tasks.register", params_dict, **_timeout_kwargs(timeout))) + + async def update(self, params: TasksUpdateRequest, *, timeout: float | None = None) -> TasksUpdateResult: + "Publishes generic progress or a terminal outcome for a client-owned task.\n\nArgs:\n params: Updates a client-owned task.\n\nReturns:\n Result of publishing a client-owned task update." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} + params_dict["sessionId"] = self._session_id + return TasksUpdateResult.from_dict(await self._client.request("session.tasks.update", params_dict, **_timeout_kwargs(timeout))) + async def refresh(self, *, timeout: float | None = None) -> TasksRefreshResult: "Refreshes metadata for any detached background shells the runtime knows about.\n\nReturns:\n Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop." return TasksRefreshResult.from_dict(await self._client.request("session.tasks.refresh", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) @@ -42026,6 +42956,12 @@ async def abort(self, params: FactoryAbortRequest) -> FactoryACKResult: "Asks the owning extension connection to abort a running factory cooperatively.\n\nArgs:\n params: Parameters for cooperatively aborting a factory body.\n\nReturns:\n Acknowledgement that a factory request was accepted." pass +# Experimental: this API group is experimental and may change or be removed. +class TasksHandler(Protocol): + async def cancel(self, params: ClientTaskCancelRequest) -> ClientTaskCancelResult: + "Asks the client currently bound to a client-owned session task to confirm that its external work stopped.\n\nArgs:\n params: Runtime-to-owner cancellation request for a client-owned task.\n\nReturns:\n Whether the client authoritatively confirmed its external work stopped." + pass + # Experimental: this API group is experimental and may change or be removed. class SessionFsHandler(Protocol): async def read_file(self, params: SessionFSReadFileRequest) -> SessionFSReadFileResult: @@ -42084,6 +43020,7 @@ async def invoke(self, params: CanvasProviderInvokeActionRequest) -> Any: class ClientSessionApiHandlers: provider_token: ProviderTokenHandler | None = None factory: FactoryHandler | None = None + tasks: TasksHandler | None = None session_fs: SessionFsHandler | None = None canvas: CanvasHandler | None = None @@ -42113,6 +43050,13 @@ async def handle_factory_abort(params: dict) -> dict | None: result = await handler.abort(request) return result.to_dict() client.set_request_handler("factory.abort", handle_factory_abort) + async def handle_tasks_cancel(params: dict) -> dict | None: + request = ClientTaskCancelRequest.from_dict(params) + handler = get_handlers(request.session_id).tasks + if handler is None: raise RuntimeError(f"No tasks handler registered for session: {request.session_id}") + result = await handler.cancel(request) + return result.to_dict() + client.set_request_handler("tasks.cancel", handle_tasks_cancel) async def handle_session_fs_read_file(params: dict) -> dict | None: request = SessionFSReadFileRequest.from_dict(params) handler = get_handlers(request.session_id).session_fs @@ -42481,6 +43425,9 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "Categories", "ClientGlobalApiHandlers", "ClientSessionApiHandlers", + "ClientTaskCancelReason", + "ClientTaskCancelRequest", + "ClientTaskCancelResult", "CommandList", "CommandsApi", "CommandsFinalizeInvocationEffectRequest", @@ -42964,6 +43911,9 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "ModelPolicyState", "ModelSetReasoningEffortRequest", "ModelSetReasoningEffortResult", + "ModelSwitchAutoTierRequest", + "ModelSwitchAutoTierResult", + "ModelSwitchAutoTierStatus", "ModelSwitchConfirmation", "ModelSwitchToRequest", "ModelSwitchToResult", @@ -43588,13 +44538,24 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "TaskAgentInfo", "TaskAgentInfoType", "TaskAgentProgress", + "TaskClientActiveStatus", + "TaskClientExecutionMode", + "TaskClientInfo", + "TaskClientOwner", + "TaskClientOwnerKind", + "TaskClientOwnerPresence", + "TaskClientProgress", + "TaskClientStatus", + "TaskClientType", + "TaskClientUpdate", + "TaskClientUpdateKind", "TaskCompleteData", "TaskCompletionDecision", "TaskExecutionMode", "TaskInfo", "TaskInfoExecutionMode", "TaskInfoStatus", - "TaskInfoType", + "TaskKind", "TaskList", "TaskProgress", "TaskProgressLine", @@ -43610,16 +44571,21 @@ async def handle_git_hub_token_get_token(params: dict) -> dict | None: "TasksGetCurrentPromotableResult", "TasksGetProgressRequest", "TasksGetProgressResult", + "TasksHandler", "TasksPromoteCurrentToBackgroundResult", "TasksPromoteToBackgroundRequest", "TasksPromoteToBackgroundResult", "TasksRefreshResult", + "TasksRegisterRequest", + "TasksRegisterResult", "TasksRemoveRequest", "TasksRemoveResult", "TasksSendMessageRequest", "TasksSendMessageResult", "TasksStartAgentRequest", "TasksStartAgentResult", + "TasksUpdateRequest", + "TasksUpdateResult", "TasksWaitForPendingResult", "TelemetryApi", "TelemetrySetFeatureOverridesRequest", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index 51e719bcf9..636f63bcda 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -136,6 +136,7 @@ class SessionEventType(Enum): SESSION_INFO = "session.info" SESSION_WARNING = "session.warning" SESSION_MODEL_CHANGE = "session.model_change" + SESSION_AUTO_TIER_SWITCH_FAILED = "session.auto_tier_switch_failed" SESSION_MODE_CHANGED = "session.mode_changed" SESSION_MODE_NOTICE_DELIVERED = "session.mode_notice_delivered" SESSION_SESSION_LIMITS_CHANGED = "session.session_limits_changed" @@ -262,6 +263,8 @@ class SessionEventType(Enum): SESSION_CUSTOM_AGENTS_UPDATED = "session.custom_agents_updated" SESSION_MCP_SERVERS_LOADED = "session.mcp_servers_loaded" SESSION_MCP_SERVER_STATUS_CHANGED = "session.mcp_server_status_changed" + SESSION_MCP_SERVER_REMOVED = "session.mcp_server_removed" + SESSION_MCP_SERVER_NEEDS_RECONNECT = "session.mcp_server_needs_reconnect" MCP_TOOLS_LIST_CHANGED = "mcp.tools.list_changed" MCP_RESOURCES_LIST_CHANGED = "mcp.resources.list_changed" MCP_PROMPTS_LIST_CHANGED = "mcp.prompts.list_changed" @@ -7586,6 +7589,34 @@ def to_dict(self) -> dict: return {} +@dataclass +class SessionAutoTierSwitchFailedData: + "A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume." + reason: AutoTierSwitchFailureReason + requested_auto_tier: AutoTier | None + effective_auto_tier: AutoTier | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionAutoTierSwitchFailedData": + assert isinstance(obj, dict) + reason = parse_enum(AutoTierSwitchFailureReason, obj.get("reason")) + requested_auto_tier = from_union([from_none, lambda x: parse_enum(AutoTier, x)], obj.get("requestedAutoTier")) + effective_auto_tier = from_union([from_none, lambda x: parse_enum(AutoTier, x)], obj.get("effectiveAutoTier")) + return SessionAutoTierSwitchFailedData( + reason=reason, + requested_auto_tier=requested_auto_tier, + effective_auto_tier=effective_auto_tier, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["reason"] = to_enum(AutoTierSwitchFailureReason, self.reason) + result["requestedAutoTier"] = from_union([from_none, lambda x: to_enum(AutoTier, x)], self.requested_auto_tier) + if self.effective_auto_tier is not None: + result["effectiveAutoTier"] = from_union([from_none, lambda x: to_enum(AutoTier, x)], self.effective_auto_tier) + return result + + @dataclass class SessionAutopilotObjectiveChangedData: "Autopilot objective state file operation details indicating what changed" @@ -8289,6 +8320,44 @@ def to_dict(self) -> dict: return result +@dataclass +class SessionMcpServerNeedsReconnectData: + "Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established." + server_name: str + + @staticmethod + def from_dict(obj: Any) -> "SessionMcpServerNeedsReconnectData": + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + return SessionMcpServerNeedsReconnectData( + server_name=server_name, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + return result + + +@dataclass +class SessionMcpServerRemovedData: + "Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs." + server_name: str + + @staticmethod + def from_dict(obj: Any) -> "SessionMcpServerRemovedData": + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + return SessionMcpServerRemovedData( + server_name=server_name, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + return result + + @dataclass class SessionMcpServerStatusChangedData: "Payload of `session.mcp_server_status_changed` for one MCP server's status and optional failure error." @@ -8387,8 +8456,10 @@ def to_dict(self) -> dict: class SessionModelChangeData: "Model change details including previous and new model identifiers" new_model: str + auto_tier: AutoTier | None = None cause: str | None = None context_tier: ContextTier | None = None + previous_auto_tier: AutoTier | None = None previous_model: str | None = None previous_reasoning_effort: str | None = None previous_reasoning_summary: ReasoningSummary | None = None @@ -8402,8 +8473,10 @@ class SessionModelChangeData: def from_dict(obj: Any) -> "SessionModelChangeData": assert isinstance(obj, dict) new_model = from_str(obj.get("newModel")) + auto_tier = from_union([from_none, lambda x: parse_enum(AutoTier, x)], obj.get("autoTier")) cause = from_union([from_none, from_str], obj.get("cause")) context_tier = from_union([from_none, lambda x: parse_enum(ContextTier, x)], obj.get("contextTier")) + previous_auto_tier = from_union([from_none, lambda x: parse_enum(AutoTier, x)], obj.get("previousAutoTier")) previous_model = from_union([from_none, from_str], obj.get("previousModel")) previous_reasoning_effort = from_union([from_none, from_str], obj.get("previousReasoningEffort")) previous_reasoning_summary = from_union([from_none, lambda x: parse_enum(ReasoningSummary, x)], obj.get("previousReasoningSummary")) @@ -8414,8 +8487,10 @@ def from_dict(obj: Any) -> "SessionModelChangeData": verbosity = from_union([from_none, lambda x: parse_enum(Verbosity, x)], obj.get("verbosity")) return SessionModelChangeData( new_model=new_model, + auto_tier=auto_tier, cause=cause, context_tier=context_tier, + previous_auto_tier=previous_auto_tier, previous_model=previous_model, previous_reasoning_effort=previous_reasoning_effort, previous_reasoning_summary=previous_reasoning_summary, @@ -8429,10 +8504,14 @@ def from_dict(obj: Any) -> "SessionModelChangeData": def to_dict(self) -> dict: result: dict = {} result["newModel"] = from_str(self.new_model) + if self.auto_tier is not None: + result["autoTier"] = from_union([from_none, lambda x: to_enum(AutoTier, x)], self.auto_tier) if self.cause is not None: result["cause"] = from_union([from_none, from_str], self.cause) if self.context_tier is not None: result["contextTier"] = from_union([from_none, lambda x: to_enum(ContextTier, x)], self.context_tier) + if self.previous_auto_tier is not None: + result["previousAutoTier"] = from_union([from_none, lambda x: to_enum(AutoTier, x)], self.previous_auto_tier) if self.previous_model is not None: result["previousModel"] = from_union([from_none, from_str], self.previous_model) if self.previous_reasoning_effort is not None: @@ -12033,6 +12112,18 @@ class AutoTier(Enum): INTELLIGENCE = "intelligence" +class AutoTierSwitchFailureReason(Enum): + "Terminal reason an Auto preference activation failed." + # The candidate model was rejected by model policy. + POLICY_REJECTED = "policy_rejected" + # The Auto routing request failed or returned an unusable response. + REQUEST_FAILED = "request_failed" + # The runtime could not prepare the Auto routing request. + SETUP_FAILED = "setup_failed" + # The provider does not support Auto routing. + UNSUPPORTED = "unsupported" + + class AutopilotObjectiveChangedOperation(Enum): "The type of operation performed on the autopilot objective state file" # Autopilot objective state file was created for a new objective. @@ -12647,7 +12738,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionModeNoticeDeliveredData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionContextClearedData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | SessionCompletionReceiptData | SessionFusionRouteStartedData | SessionFusionRouteFailedData | SessionFusionResolvedData | SessionFusionCompletedData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantTurnRetryData | AgentInterruptedData | AssistantIntentData | AssistantFusionPhaseStartedData | AssistantFusionPhaseActivityData | AssistantFusionPhaseCompletedData | AssistantFusionPhaseFailedData | AssistantServerToolProgressData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | PromptCacheBreakData | ModelCallFailureData | ModelCallFinishedData | ModelCallStartData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | ToolSearchActivatedData | SkillInvokedData | SandboxDecisionData | SubagentStartedData | SubagentConfiguredData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | UiEphemeralQueryData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | SessionManagedSettingsResolvedData | SessionManagedSettingsEnforcedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | FactoryRunUpdatedData | FactoryRunStartedData | FactoryRunSettledData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data +SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionAutoTierSwitchFailedData | SessionModeChangedData | SessionModeNoticeDeliveredData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionContextClearedData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | SessionCompletionReceiptData | SessionFusionRouteStartedData | SessionFusionRouteFailedData | SessionFusionResolvedData | SessionFusionCompletedData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantTurnRetryData | AgentInterruptedData | AssistantIntentData | AssistantFusionPhaseStartedData | AssistantFusionPhaseActivityData | AssistantFusionPhaseCompletedData | AssistantFusionPhaseFailedData | AssistantServerToolProgressData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | PromptCacheBreakData | ModelCallFailureData | ModelCallFinishedData | ModelCallStartData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | ToolSearchActivatedData | SkillInvokedData | SandboxDecisionData | SubagentStartedData | SubagentConfiguredData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | UiEphemeralQueryData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | SessionManagedSettingsResolvedData | SessionManagedSettingsEnforcedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | FactoryRunUpdatedData | FactoryRunStartedData | FactoryRunSettledData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | SessionMcpServerRemovedData | SessionMcpServerNeedsReconnectData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -12686,6 +12777,7 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_INFO: data = SessionInfoData.from_dict(data_obj) case SessionEventType.SESSION_WARNING: data = SessionWarningData.from_dict(data_obj) case SessionEventType.SESSION_MODEL_CHANGE: data = SessionModelChangeData.from_dict(data_obj) + case SessionEventType.SESSION_AUTO_TIER_SWITCH_FAILED: data = SessionAutoTierSwitchFailedData.from_dict(data_obj) case SessionEventType.SESSION_MODE_CHANGED: data = SessionModeChangedData.from_dict(data_obj) case SessionEventType.SESSION_MODE_NOTICE_DELIVERED: data = SessionModeNoticeDeliveredData.from_dict(data_obj) case SessionEventType.SESSION_SESSION_LIMITS_CHANGED: data = SessionSessionLimitsChangedData.from_dict(data_obj) @@ -12794,6 +12886,8 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_CUSTOM_AGENTS_UPDATED: data = SessionCustomAgentsUpdatedData.from_dict(data_obj) case SessionEventType.SESSION_MCP_SERVERS_LOADED: data = SessionMcpServersLoadedData.from_dict(data_obj) case SessionEventType.SESSION_MCP_SERVER_STATUS_CHANGED: data = SessionMcpServerStatusChangedData.from_dict(data_obj) + case SessionEventType.SESSION_MCP_SERVER_REMOVED: data = SessionMcpServerRemovedData.from_dict(data_obj) + case SessionEventType.SESSION_MCP_SERVER_NEEDS_RECONNECT: data = SessionMcpServerNeedsReconnectData.from_dict(data_obj) case SessionEventType.MCP_TOOLS_LIST_CHANGED: data = McpToolsListChangedData.from_dict(data_obj) case SessionEventType.MCP_RESOURCES_LIST_CHANGED: data = McpResourcesListChangedData.from_dict(data_obj) case SessionEventType.MCP_PROMPTS_LIST_CHANGED: data = McpPromptsListChangedData.from_dict(data_obj) @@ -12904,6 +12998,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "AutoModeSwitchRequestedData", "AutoModeSwitchResponse", "AutoTier", + "AutoTierSwitchFailureReason", "AutopilotObjectiveChangedOperation", "AutopilotObjectiveChangedStatus", "BinaryAssetReference", @@ -13081,6 +13176,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SandboxDecisionData", "ScheduleOrigin", "SessionAutoModeResolvedData", + "SessionAutoTierSwitchFailedData", "SessionAutopilotObjectiveChangedData", "SessionBackgroundTasksChangedData", "SessionBinaryAssetData", @@ -13117,6 +13213,8 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SessionLimitsExhaustedResponseAction", "SessionManagedSettingsEnforcedData", "SessionManagedSettingsResolvedData", + "SessionMcpServerNeedsReconnectData", + "SessionMcpServerRemovedData", "SessionMcpServerStatusChangedData", "SessionMcpServersLoadedData", "SessionMode", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 96e18b0685..f1568a8232 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -288,6 +288,8 @@ pub mod rpc_methods { pub const SESSION_MODEL_GETCURRENT: &str = "session.model.getCurrent"; /// `session.model.switchTo` pub const SESSION_MODEL_SWITCHTO: &str = "session.model.switchTo"; + /// `session.model.switchAutoTier` + pub const SESSION_MODEL_SWITCHAUTOTIER: &str = "session.model.switchAutoTier"; /// `session.model.applyStartupOverlay` pub const SESSION_MODEL_APPLYSTARTUPOVERLAY: &str = "session.model.applyStartupOverlay"; /// `session.model.setReasoningEffort` @@ -376,6 +378,10 @@ pub mod rpc_methods { pub const SESSION_TASKS_STARTAGENT: &str = "session.tasks.startAgent"; /// `session.tasks.list` pub const SESSION_TASKS_LIST: &str = "session.tasks.list"; + /// `session.tasks.register` + pub const SESSION_TASKS_REGISTER: &str = "session.tasks.register"; + /// `session.tasks.update` + pub const SESSION_TASKS_UPDATE: &str = "session.tasks.update"; /// `session.tasks.refresh` pub const SESSION_TASKS_REFRESH: &str = "session.tasks.refresh"; /// `session.tasks.waitForPending` @@ -753,6 +759,8 @@ pub mod rpc_methods { pub const FACTORY_EXECUTE: &str = "factory.execute"; /// `factory.abort` pub const FACTORY_ABORT: &str = "factory.abort"; + /// `tasks.cancel` + pub const TASKS_CANCEL: &str = "tasks.cancel"; /// `sessionFs.readFile` pub const SESSIONFS_READFILE: &str = "sessionFs.readFile"; /// `sessionFs.writeFile` @@ -3038,7 +3046,7 @@ pub struct CanvasProviderUnregisterRequest { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CapiSessionOptions { - /// Routing preference used when the session model is `auto`. The runtime persists the preference across cold resume. When omitted, the default routing behavior is used. Resuming an already-resident session cannot change its preference. + /// Routing preference for sessions whose model is `auto`. On create or cold resume, this establishes the preference sent as `tier` on CAPI `/auto` requests; when omitted on cold resume, the runtime restores the last committed preference. On resident resume, a different value requests a safe switch after resume succeeds and cannot change an in-flight turn. Successful switches are persisted for later cold resume. When no preference is supplied or restored, CAPI default routing is used. #[serde(skip_serializing_if = "Option::is_none")] pub auto_tier: Option, /// 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. @@ -3551,6 +3559,44 @@ pub struct CatalogUnavailableTransportError { pub reason: CatalogUnavailableTransportReason, } +/// Runtime-to-owner cancellation request for a client-owned task. +/// +///

+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ClientTaskCancelRequest { + /// Opaque identifier shared by coalesced cancellation callers + pub cancellation_id: String, + /// Owner-scoped task key included for correlation + pub client_task_id: String, + /// Canonical runtime-generated task identifier + pub id: String, + /// Reason the runtime requests cancellation + pub reason: ClientTaskCancelReason, + /// Session that owns the client task + pub session_id: SessionId, +} + +/// Whether the client authoritatively confirmed its external work stopped. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ClientTaskCancelResult { + /// True only when the owner confirms that external work stopped before responding + pub cancelled: bool, +} + /// A literal choice the command input accepts, with a human-facing description /// ///
@@ -3997,6 +4043,9 @@ pub(crate) struct ConnectRequest { /// Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events. #[serde(skip_serializing_if = "Option::is_none")] pub enable_git_hub_telemetry_forwarding: Option, + /// Task kinds this connection can decode when observing session tasks. Omit to retain agent and shell compatibility. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_task_kinds: Option>, /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN #[serde(skip_serializing_if = "Option::is_none")] pub token: Option, @@ -4017,6 +4066,9 @@ pub(crate) struct ConnectResult { pub ok: bool, /// Server protocol version number pub protocol_version: i64, + /// Task kinds the server may return to this connection. + #[serde(skip_serializing_if = "Option::is_none")] + pub task_kinds: Option>, /// Server package version pub version: String, } @@ -4091,7 +4143,7 @@ pub struct ContextHeaviestMessage { pub tokens: i64, } -/// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. +/// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. /// ///
/// @@ -4102,12 +4154,21 @@ pub struct ContextHeaviestMessage { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CurrentModel { + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub activating_auto_tier: Option, + /// Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_tier: Option, /// Context tier for models that support multiple context-window sizes. #[serde(skip_serializing_if = "Option::is_none")] pub context_tier: Option, /// Currently active model identifier #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_auto_tier: Option, /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_effort: Option, @@ -7720,6 +7781,9 @@ pub struct McpConfigList { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct McpConfigRemoveRequest { + /// OAuth Client ID Metadata Document URL whose persisted credentials should also be removed. + #[serde(skip_serializing_if = "Option::is_none")] + pub auth_client_id_metadata_url: Option, /// Name of the MCP server to remove pub name: String, } @@ -10259,6 +10323,9 @@ pub struct Model { /// Informational notices the service published for this model, such as an upcoming change or a recommended alternative. Present only when the service published at least one notice. Hosts should surface these without implying anything is wrong with the model. #[serde(skip_serializing_if = "Option::is_none")] pub info_messages: Option>, + /// Provider-supplied model metadata. Keys and JSON-compatible values are preserved unchanged. This is factual metadata published by the model provider; it carries no picker or UX semantics. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, /// Model capability category for grouping in the model picker #[serde(skip_serializing_if = "Option::is_none")] pub model_picker_category: Option, @@ -10538,6 +10605,51 @@ pub struct ModelsListRequest { pub selection_id: Option, } +/// An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ModelSwitchAutoTierRequest { + /// Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. + pub auto_tier: Option, + /// Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, +} + +/// Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ModelSwitchAutoTierResult { + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub activating_auto_tier: Option, + /// Auto preference currently committed for the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_auto_tier: Option, + /// Latest unclaimed Auto preference waiting for a future user turn. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_auto_tier: Option, + /// Immediate request status. `pending` means accepted but not committed. + pub status: ModelSwitchAutoTierStatus, + /// Earlier unclaimed preference replaced by this request. This can be present with either status, including when selecting the effective preference cancels pending work. + #[serde(skip_serializing_if = "Option::is_none")] + pub superseded_auto_tier: Option, +} + /// ///
/// @@ -10567,6 +10679,9 @@ pub struct ModelSwitchConfirmation { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ModelSwitchToRequest { + /// Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_tier: Option, /// Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary. #[serde(skip_serializing_if = "Option::is_none")] pub compaction_decision: Option, @@ -10636,6 +10751,9 @@ pub struct ModelSwitchToResult { /// Currently active model identifier after the switch #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_state: Option, /// Persistence failure encountered after applying the model switch. #[serde(skip_serializing_if = "Option::is_none")] pub persistence_error: Option, @@ -14850,6 +14968,9 @@ pub struct SandboxConfig { /// Whether to auto-add the current working directory to readwritePaths. Default: true. #[serde(skip_serializing_if = "Option::is_none")] pub add_current_working_directory: Option, + /// Whether the agent may request that an individual command run outside the sandbox, which the host then approves or denies through the usual permission flow. A host capability flag rather than part of the policy: it is stripped from the effective spawn policy and only has an effect while `enabled` is true. Fail-closed, unlike the opt-out flags on this object: omitting it offers no bypass. Default: false (opt-in). + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_bypass: Option, /// Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out). #[serde(skip_serializing_if = "Option::is_none")] pub allow_dev_tool_access: Option, @@ -14858,6 +14979,20 @@ pub struct SandboxConfig { pub auth: Option, /// Whether sandboxing is enabled for the session. pub enabled: bool, + /// The `sandboxLspServers` counterpart of `managedMcpRoutingLocked`. + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) managed_lsp_routing_locked: Option, + /// Set by the runtime when a managed policy forced `sandboxMcpServers` on and took the local opt-out away. Provenance rather than policy: it lets a sandbox startup failure point at the administrator instead of a setting the next managed merge would override, and it is ignored when comparing two configs for change. Only the managed merge may set it; a caller-supplied value is stripped. + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) managed_mcp_routing_locked: Option, + /// Whether language servers the session launches are confined by the sandbox. Only an explicit `false` opts out. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + #[serde(skip_serializing_if = "Option::is_none")] + pub sandbox_lsp_servers: Option, + /// Whether MCP servers the session launches are confined by the sandbox. Only an explicit `false` opts out; doing so also lets remote-MCP egress leave the sandbox, so the flag and `enabled` are always read together. Ignored while `enabled` is false. Default: true (enabled by default; set to false to opt out). + #[serde(skip_serializing_if = "Option::is_none")] + pub sandbox_mcp_servers: Option, /// User-managed sandbox policy fragment merged into the auto-discovered base policy. #[serde(skip_serializing_if = "Option::is_none")] pub user_policy: Option, @@ -16817,6 +16952,9 @@ pub struct SessionOpenOptions { /// Whether ask_user is explicitly disabled. #[serde(skip_serializing_if = "Option::is_none")] pub ask_user_disabled: Option, + /// OAuth Client ID Metadata Document URL used by this host for MCP authorization. + #[serde(skip_serializing_if = "Option::is_none")] + pub auth_client_id_metadata_url: Option, /// Initial authentication info for the session. #[serde(skip_serializing_if = "Option::is_none")] pub auth_info: Option, @@ -19363,6 +19501,199 @@ pub struct TaskAgentProgress { pub r#type: TaskAgentProgressType, } +/// Public owner attribution for a client-owned task. Identifiers are opaque and never authorize requests. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientOwner { + /// ISO 8601 timestamp when the bound join disconnected + #[serde(skip_serializing_if = "Option::is_none")] + pub disconnected_at: Option, + /// Display-only owner name + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option, + /// Opaque identity of the currently or most recently bound session join + pub join_id: String, + /// Class of the task owner + pub kind: TaskClientOwnerKind, + /// Opaque session-scoped participant identity + pub participant_id: String, + /// Whether this task's bound join is currently connected + pub presence: TaskClientOwnerPresence, + /// Display-only owner source + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, +} + +/// Tracked client-owned task metadata. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientInfo { + /// ISO 8601 timestamp when the current active segment started + #[serde(skip_serializing_if = "Option::is_none")] + pub active_started_at: Option, + /// Accumulated active execution time in milliseconds + pub active_time_ms: i64, + /// Whether the currently bound owner can receive a cancellation request + pub can_cancel: bool, + /// Human-readable reason for terminal cancellation + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option, + /// Owner-scoped registration and reclaim key + pub client_task_id: String, + /// ISO 8601 timestamp when the task reached a terminal status + #[serde(skip_serializing_if = "Option::is_none")] + pub completed_at: Option, + /// Task description + pub description: String, + /// Optional task display name + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option, + /// Human-readable terminal failure message + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Optional owner-supplied terminal failure code + #[serde(skip_serializing_if = "Option::is_none")] + pub error_code: Option, + /// Execution mode, which is always background for client-owned tasks + pub execution_mode: TaskClientExecutionMode, + /// Canonical runtime-generated task identifier + pub id: String, + /// ISO 8601 timestamp when the connected owner entered idle status + #[serde(skip_serializing_if = "Option::is_none")] + pub idle_since: Option, + /// ISO 8601 timestamp of the most recent orphan transition + #[serde(skip_serializing_if = "Option::is_none")] + pub orphaned_at: Option, + /// Public attribution and presence for the task owner + pub owner: TaskClientOwner, + /// ISO 8601 timestamp of the most recent successful reclaim + #[serde(skip_serializing_if = "Option::is_none")] + pub reclaimed_at: Option, + /// Opaque successful terminal result supplied by the task owner + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option, + /// Sequence number of the latest accepted owner update + pub sequence: i64, + /// ISO 8601 timestamp when the task started + pub started_at: String, + /// Client task lifecycle status + pub status: TaskClientStatus, + /// Task kind + pub r#type: TaskClientType, + /// ISO 8601 timestamp of the latest accepted lifecycle change + pub updated_at: String, +} + +/// Generic progress for a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientProgress { + /// Most recent nonempty progress message + #[serde(skip_serializing_if = "Option::is_none")] + pub last_message: Option, + /// Current completion percentage from zero through one hundred + #[serde(skip_serializing_if = "Option::is_none")] + pub percentage: Option, + /// Current owner-defined progress phase + #[serde(skip_serializing_if = "Option::is_none")] + pub phase: Option, + /// Recent server-timestamped progress messages + pub recent_activity: Vec, + /// Sequence number of the latest accepted owner update + pub sequence: i64, + /// Current client task lifecycle status + pub status: TaskClientStatus, + /// Progress kind + pub r#type: TaskClientType, + /// ISO 8601 timestamp of the latest accepted lifecycle change + pub updated_at: String, +} + +/// Publishes nonterminal progress for a running or idle client task. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientUpdateProgress { + /// Client task update variant discriminator. + pub kind: TaskClientUpdateProgressKind, + /// Optional progress message appended to recent activity when nonempty + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + /// Optional completion percentage; null clears the current percentage + #[serde(skip_serializing_if = "Option::is_none")] + pub percentage: Option, + /// Optional progress phase; null clears the current phase + #[serde(skip_serializing_if = "Option::is_none")] + pub phase: Option, + /// Optional active status transition + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +/// Reports successful terminal completion. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientUpdateCompleted { + /// Client task update variant discriminator. + pub kind: TaskClientUpdateCompletedKind, + /// Optional final progress message + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + /// Optional opaque successful terminal result + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option, +} + +/// Reports terminal failure. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientUpdateFailed { + /// Optional owner-supplied terminal failure code + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, + /// Human-readable terminal failure message + pub error: String, + /// Client task update variant discriminator. + pub kind: TaskClientUpdateFailedKind, + /// Optional final progress message + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, +} + +/// Reports terminal cancellation after external work stopped. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TaskClientUpdateCancelled { + /// Client task update variant discriminator. + pub kind: TaskClientUpdateCancelledKind, + /// Optional final progress message + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + /// Optional human-readable cancellation reason + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, +} + /// Task completion notification with summary from the agent /// ///
@@ -19511,7 +19842,7 @@ pub struct TasksGetProgressRequest { #[serde(rename_all = "camelCase")] pub struct TasksGetProgressResult { /// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. - pub progress: Option, + pub progress: serde_json::Value, } /// Tracked shell task metadata, including ID, command, status, timing, attachment/execution mode, log path, and PID. @@ -19634,6 +19965,52 @@ pub struct TasksPromoteToBackgroundResult { #[serde(rename_all = "camelCase")] pub struct TasksRefreshResult {} +/// Registers or reclaims a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TasksRegisterRequest { + /// Whether the owner supports runtime cancellation requests + pub cancellable: bool, + /// Owner-scoped idempotency key used for registration and reclaim + pub client_task_id: String, + /// Human-readable description of the external work + pub description: String, + /// Optional short display name for the external work + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option, + /// Expected current sequence for idempotent registration or orphan reclaim + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_sequence: Option, + /// Task kind + pub r#type: TaskClientType, +} + +/// Result of registering or reclaiming a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TasksRegisterResult { + /// True only when this invocation created a new task + pub created: bool, + /// True only when this invocation reclaimed an orphaned task + pub reclaimed: bool, + /// Authoritative registered or reclaimed task + pub task: TaskClientInfo, +} + /// Identifier of the completed or cancelled task to remove from tracking. /// ///
@@ -19742,6 +20119,44 @@ pub struct TasksStartAgentResult { pub agent_id: String, } +/// Updates a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TasksUpdateRequest { + /// Canonical runtime-generated task identifier + pub id: String, + /// Owner update sequence to apply + pub sequence: i64, + /// Progress or terminal update payload + pub update: TaskClientUpdate, +} + +/// Result of publishing a client-owned task update. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TasksUpdateResult { + /// Whether this invocation changed task state + pub applied: bool, + /// Whether this invocation repeated the latest accepted update + pub duplicate: bool, + /// Authoritative task after processing the update + pub task: TaskClientInfo, +} + /// Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS). /// ///
@@ -22972,7 +23387,7 @@ pub struct SessionModelGetCurrentParams { pub session_id: SessionId, } -/// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. +/// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. /// ///
/// @@ -22983,12 +23398,21 @@ pub struct SessionModelGetCurrentParams { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionModelGetCurrentResult { + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub activating_auto_tier: Option, + /// Auto preference currently committed for the session. This can remain available while another model is selected so a later switch to `auto` can reuse it. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_tier: Option, /// Context tier for models that support multiple context-window sizes. #[serde(skip_serializing_if = "Option::is_none")] pub context_tier: Option, /// Currently active model identifier #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Latest unclaimed Auto preference waiting for a future user turn. Null means the pending request is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_auto_tier: Option, /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_effort: Option, @@ -23020,6 +23444,9 @@ pub struct SessionModelSwitchToResult { /// Currently active model identifier after the switch #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_state: Option, /// Persistence failure encountered after applying the model switch. #[serde(skip_serializing_if = "Option::is_none")] pub persistence_error: Option, @@ -23031,6 +23458,33 @@ pub struct SessionModelSwitchToResult { pub warning: Option, } +/// Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionModelSwitchAutoTierResult { + /// Auto preference currently claimed by an in-progress activation. Null means the activation is returning to provider-default routing. + #[serde(skip_serializing_if = "Option::is_none")] + pub activating_auto_tier: Option, + /// Auto preference currently committed for the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_auto_tier: Option, + /// Latest unclaimed Auto preference waiting for a future user turn. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_auto_tier: Option, + /// Immediate request status. `pending` means accepted but not committed. + pub status: ModelSwitchAutoTierStatus, + /// Earlier unclaimed preference replaced by this request. This can be present with either status, including when selecting the effective preference cancels pending work. + #[serde(skip_serializing_if = "Option::is_none")] + pub superseded_auto_tier: Option, +} + /// The model identifier active on the session after the switch. /// ///
@@ -23057,6 +23511,9 @@ pub struct SessionModelApplyStartupOverlayResult { /// Currently active model identifier after the switch #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Authoritative model and Auto preference state after an immediate switch. For deferred switches this remains the current state until the queued change drains. + #[serde(skip_serializing_if = "Option::is_none")] + pub model_state: Option, /// Persistence failure encountered after applying the model switch. #[serde(skip_serializing_if = "Option::is_none")] pub persistence_error: Option, @@ -24136,6 +24593,44 @@ pub struct SessionTasksListResult { pub tasks: Vec, } +/// Result of registering or reclaiming a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionTasksRegisterResult { + /// True only when this invocation created a new task + pub created: bool, + /// True only when this invocation reclaimed an orphaned task + pub reclaimed: bool, + /// Authoritative registered or reclaimed task + pub task: TaskClientInfo, +} + +/// Result of publishing a client-owned task update. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionTasksUpdateResult { + /// Whether this invocation changed task state + pub applied: bool, + /// Whether this invocation repeated the latest accepted update + pub duplicate: bool, + /// Authoritative task after processing the update + pub task: TaskClientInfo, +} + /// Identifies the target session. /// ///
@@ -24202,7 +24697,7 @@ pub struct SessionTasksWaitForPendingResult {} #[serde(rename_all = "camelCase")] pub struct SessionTasksGetProgressResult { /// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. - pub progress: Option, + pub progress: serde_json::Value, } /// Identifies the target session. @@ -28888,6 +29383,28 @@ pub enum CatalogUnavailableTransportReason { Unknown, } +/// Why the runtime requests client-task cancellation. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ClientTaskCancelReason { + /// A caller requested task cancellation. + #[serde(rename = "cancel_requested")] + CancelRequested, + /// The session is shutting down. + #[serde(rename = "session_shutdown")] + SessionShutdown, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Optional completion hint for the input (e.g. 'directory' for filesystem path completion) /// ///
@@ -28993,6 +29510,31 @@ pub enum ConnectedRemoteSessionMetadataKind { Unknown, } +/// Closed set of public task kinds a connection can negotiate. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskKind { + /// Runtime-owned background agent task. + #[serde(rename = "agent")] + Agent, + /// Runtime-owned shell task. + #[serde(rename = "shell")] + Shell, + /// Client-owned externally executed task. + #[serde(rename = "client")] + Client, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Controls how MCP tool result content is filtered: none leaves content unchanged, markdown sanitizes HTML while preserving Markdown-friendly output, and hidden_characters removes characters that can hide directives. /// ///
@@ -31211,6 +31753,28 @@ pub enum ModelPolicyState { Unknown, } +/// Whether the requested preference was already effective or was accepted for later transactional activation. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ModelSwitchAutoTierStatus { + /// The requested preference is already effective. No activation is pending for it, although this request may have cancelled an earlier unclaimed preference reported in `supersededAutoTier`. + #[serde(rename = "unchanged")] + Unchanged, + /// The request was accepted but has not committed. A later user turn using the `auto` model must mint and validate the replacement before it becomes effective. + #[serde(rename = "pending")] + Pending, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Provider transport. Defaults to "http". /// ///
@@ -33574,6 +34138,191 @@ pub enum TaskAgentProgressType { Agent, } +/// Active status a client owner may publish with a progress update. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientActiveStatus { + /// The external owner is actively working. + #[serde(rename = "running")] + Running, + /// The external owner is connected but waiting. + #[serde(rename = "idle")] + Idle, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Client-owned tasks always execute outside the runtime in background mode. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientExecutionMode { + #[serde(rename = "background")] + Background, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Connection class owning a client task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientOwnerKind { + /// A discovered extension connection owns the task. + #[serde(rename = "extension")] + Extension, + /// A generic SDK connection owns the task. + #[serde(rename = "sdk")] + Sdk, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Presence of the task's bound join. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientOwnerPresence { + /// The bound session join is connected. + #[serde(rename = "connected")] + Connected, + /// The bound session join is disconnected. + #[serde(rename = "disconnected")] + Disconnected, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Lifecycle status of a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientStatus { + /// The external owner is actively working. + #[serde(rename = "running")] + Running, + /// The external owner is connected but waiting. + #[serde(rename = "idle")] + Idle, + /// The owner reported successful completion. + #[serde(rename = "completed")] + Completed, + /// The owner reported failure. + #[serde(rename = "failed")] + Failed, + /// The owner reported or confirmed cancellation. + #[serde(rename = "cancelled")] + Cancelled, + /// The bound owner join disappeared; external executor state is unknown. + #[serde(rename = "orphaned")] + Orphaned, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Discriminator for a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientType { + #[serde(rename = "client")] + Client, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Client task update variant discriminator. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientUpdateProgressKind { + #[serde(rename = "progress")] + #[default] + Progress, +} + +/// Client task update variant discriminator. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientUpdateCompletedKind { + #[serde(rename = "completed")] + #[default] + Completed, +} + +/// Client task update variant discriminator. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientUpdateFailedKind { + #[serde(rename = "failed")] + #[default] + Failed, +} + +/// Client task update variant discriminator. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum TaskClientUpdateCancelledKind { + #[serde(rename = "cancelled")] + #[default] + Cancelled, +} + +/// Progress or terminal update for a client-owned task. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TaskClientUpdate { + Progress(TaskClientUpdateProgress), + Completed(TaskClientUpdateCompleted), + Failed(TaskClientUpdateFailed), + Cancelled(TaskClientUpdateCancelled), +} + /// Whether the shell runs inside a managed PTY session or as an independent background process /// ///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 14b77f6254..9dd8f9e58b 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -7454,13 +7454,13 @@ pub struct SessionRpcModel<'a> { } impl<'a> SessionRpcModel<'a> { - /// Gets the currently selected model for the session. + /// Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn. /// /// Wire method: `session.model.getCurrent`. /// /// # Returns /// - /// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. + /// The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. /// ///
/// @@ -7512,6 +7512,39 @@ impl<'a> SessionRpcModel<'a> { Ok(serde_json::from_value(_value)?) } + /// Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`. + /// + /// Wire method: `session.model.switchAutoTier`. + /// + /// # Parameters + /// + /// * `params` - An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`. + /// + /// # Returns + /// + /// Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn switch_auto_tier( + &self, + params: ModelSwitchAutoTierRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_MODEL_SWITCHAUTOTIER, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Resolves and applies organization-managed and repository model overlays. /// /// Wire method: `session.model.applyStartupOverlay`. @@ -10263,6 +10296,69 @@ impl<'a> SessionRpcTasks<'a> { Ok(serde_json::from_value(_value)?) } + /// Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal. + /// + /// Wire method: `session.tasks.register`. + /// + /// # Parameters + /// + /// * `params` - Registers or reclaims a client-owned task. + /// + /// # Returns + /// + /// Result of registering or reclaiming a client-owned task. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn register( + &self, + params: TasksRegisterRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_TASKS_REGISTER, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Publishes generic progress or a terminal outcome for a client-owned task. + /// + /// Wire method: `session.tasks.update`. + /// + /// # Parameters + /// + /// * `params` - Updates a client-owned task. + /// + /// # Returns + /// + /// Result of publishing a client-owned task update. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn update(&self, params: TasksUpdateRequest) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_TASKS_UPDATE, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Refreshes metadata for any detached background shells the runtime knows about. /// /// Wire method: `session.tasks.refresh`. diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index eb63f11438..fff10bd697 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -37,6 +37,8 @@ pub enum SessionEventType { SessionWarning, #[serde(rename = "session.model_change")] SessionModelChange, + #[serde(rename = "session.auto_tier_switch_failed")] + SessionAutoTierSwitchFailed, #[serde(rename = "session.mode_changed")] SessionModeChanged, #[serde(rename = "session.mode_notice_delivered")] @@ -379,6 +381,10 @@ pub enum SessionEventType { SessionMcpServersLoaded, #[serde(rename = "session.mcp_server_status_changed")] SessionMcpServerStatusChanged, + #[serde(rename = "session.mcp_server_removed")] + SessionMcpServerRemoved, + #[serde(rename = "session.mcp_server_needs_reconnect")] + SessionMcpServerNeedsReconnect, #[serde(rename = "mcp.tools.list_changed")] McpToolsListChanged, #[serde(rename = "mcp.resources.list_changed")] @@ -483,6 +489,8 @@ pub enum SessionEventData { SessionWarning(SessionWarningData), #[serde(rename = "session.model_change")] SessionModelChange(SessionModelChangeData), + #[serde(rename = "session.auto_tier_switch_failed")] + SessionAutoTierSwitchFailed(SessionAutoTierSwitchFailedData), #[serde(rename = "session.mode_changed")] SessionModeChanged(SessionModeChangedData), #[serde(rename = "session.mode_notice_delivered")] @@ -818,6 +826,10 @@ pub enum SessionEventData { SessionMcpServersLoaded(SessionMcpServersLoadedData), #[serde(rename = "session.mcp_server_status_changed")] SessionMcpServerStatusChanged(SessionMcpServerStatusChangedData), + #[serde(rename = "session.mcp_server_removed")] + SessionMcpServerRemoved(SessionMcpServerRemovedData), + #[serde(rename = "session.mcp_server_needs_reconnect")] + SessionMcpServerNeedsReconnect(SessionMcpServerNeedsReconnectData), #[serde(rename = "mcp.tools.list_changed")] McpToolsListChanged(McpToolsListChangedData), #[serde(rename = "mcp.resources.list_changed")] @@ -1231,6 +1243,9 @@ pub struct SessionWarningData { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionModelChangeData { + /// Committed Auto preference after the model configuration change, when applicable. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_tier: Option, /// Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy. #[serde(skip_serializing_if = "Option::is_none")] pub cause: Option, @@ -1239,6 +1254,9 @@ pub struct SessionModelChangeData { pub context_tier: Option, /// Newly selected model identifier pub new_model: String, + /// Previously committed Auto preference, when one was explicitly selected. + #[serde(skip_serializing_if = "Option::is_none")] + pub previous_auto_tier: Option, /// Model that was previously selected, if any #[serde(skip_serializing_if = "Option::is_none")] pub previous_model: Option, @@ -1265,6 +1283,19 @@ pub struct SessionModelChangeData { pub verbosity: Option, } +/// Session event "session.auto_tier_switch_failed". A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionAutoTierSwitchFailedData { + /// Auto preference that remains effective after the failed request. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_auto_tier: Option, + /// Low-cardinality failure outcome reported by Auto resolution. + pub reason: AutoTierSwitchFailureReason, + /// Auto preference that failed to activate, or null when returning to provider-default routing failed. + pub requested_auto_tier: Option, +} + /// Session event "session.mode_changed". Agent mode change details including previous and new modes #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -6238,6 +6269,22 @@ pub struct SessionMcpServerStatusChangedData { pub status: McpServerStatus, } +/// Session event "session.mcp_server_removed". Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionMcpServerRemovedData { + /// Name of the MCP server that was removed from the graph + pub server_name: String, +} + +/// Session event "session.mcp_server_needs_reconnect". Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionMcpServerNeedsReconnectData { + /// Name of the MCP server that needs to reconnect + pub server_name: String, +} + /// Session event "mcp.tools.list_changed". Payload identifying the MCP server associated with a list change. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -6733,6 +6780,27 @@ pub enum ModelChangeSource { Unknown, } +/// Terminal reason an Auto preference activation failed. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum AutoTierSwitchFailureReason { + /// The candidate model was rejected by model policy. + #[serde(rename = "policy_rejected")] + PolicyRejected, + /// The Auto routing request failed or returned an unusable response. + #[serde(rename = "request_failed")] + RequestFailed, + /// The runtime could not prepare the Auto routing request. + #[serde(rename = "setup_failed")] + SetupFailed, + /// The provider does not support Auto routing. + #[serde(rename = "unsupported")] + Unsupported, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Permission mode for the session. /// ///
From 60da1d8e967e91069a28c9bdeefe2a7fb10df319 Mon Sep 17 00:00:00 2001 From: Josh Spicer <23246594+joshspicer@users.noreply.github.com> Date: Thu, 3 Sep 2026 11:18:22 -0700 Subject: [PATCH 11/14] Add managed settings clear-cache E2E coverage Exercise the released managedSettings.clearCache RPC in all six SDKs and adapt handwritten callers to the regenerated 1.0.83-4 types. Preserve explicit nulls for required nullable Java and .NET RPC fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/src/Generated/Rpc.cs | 34 ++++++++++++++++++ dotnet/test/E2E/RpcServerE2ETests.cs | 8 +++++ dotnet/test/Unit/SerializationTests.cs | 29 +++++++++++++++ go/internal/e2e/rpc_server_e2e_test.go | 15 ++++++++ java/scripts/codegen/java.ts | 24 ++++++++++++- java/scripts/codegen/package-lock.json | 35 +++++++++++++++++++ .../generated/CustomAgentsUpdatedAgent.java | 1 + .../generated/rpc/BuiltinToolDescriptor.java | 5 +++ .../generated/rpc/FactoryAgentSummary.java | 1 + .../generated/rpc/FactoryCurrentPhase.java | 1 + .../rpc/FactoryPhaseObservation.java | 1 + .../generated/rpc/FactoryProgressLine.java | 1 + .../generated/rpc/FactoryProgressPage.java | 2 ++ .../generated/rpc/FactoryRunSummary.java | 6 ++++ .../copilot/generated/rpc/PermissionRule.java | 1 + .../rpc/SessionFactoryGetRunDetailResult.java | 6 ++++ .../SessionFactoryGetRunProgressResult.java | 2 ++ .../rpc/SessionMetadataSnapshotResult.java | 2 ++ .../rpc/SessionModelSwitchAutoTierParams.java | 1 + .../generated/rpc/SessionNameGetResult.java | 1 + .../generated/rpc/SessionPlanReadResult.java | 2 ++ .../SessionToolsGetCurrentMetadataResult.java | 1 + .../rpc/SessionWorkspacesEnsureResult.java | 1 + .../SessionWorkspacesGetWorkspaceResult.java | 1 + ...orkspacesReadAutopilotObjectiveResult.java | 1 + ...SessionWorkspacesReadCheckpointResult.java | 1 + ...SessionWorkspacesSaveLargePasteResult.java | 1 + ...sionWorkspacesTruncateSummariesResult.java | 1 + ...SessionWorkspacesUpdateMetadataResult.java | 1 + .../com/github/copilot/CopilotSession.java | 10 +++--- .../com/github/copilot/RpcServerE2ETest.java | 11 ++++++ .../copilot/RpcSessionStateExtrasE2ETest.java | 2 +- .../com/github/copilot/RpcWrappersTest.java | 2 +- .../rpc/GeneratedRpcApiCoverageTest.java | 2 +- .../rpc/GeneratedRpcRecordsCoverageTest.java | 32 ++++++++++++----- nodejs/test/e2e/rpc_server.e2e.test.ts | 5 +++ python/e2e/test_rpc_server_e2e.py | 4 +++ rust/src/lib.rs | 1 + rust/src/session.rs | 1 + rust/tests/e2e/rpc_mcp_config.rs | 4 +++ rust/tests/e2e/rpc_server.rs | 26 +++++++++++++- rust/tests/e2e/rpc_tasks_and_handlers.rs | 2 +- scripts/codegen/csharp.ts | 3 ++ ...ould_clear_the_managed_settings_cache.yaml | 3 ++ 44 files changed, 274 insertions(+), 20 deletions(-) create mode 100644 test/snapshots/rpc_server/should_clear_the_managed_settings_cache.yaml diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index d65aa4f1b8..16de07a5fc 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -6745,6 +6745,7 @@ public sealed class FactoryCurrentPhase /// Zero-based declared phase ordinal, or null for an undeclared phase. [JsonPropertyName("ordinal")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public long? Ordinal { get; set; } } @@ -6775,14 +6776,17 @@ public sealed class FactoryRunSummary { /// Epoch milliseconds when the current active segment started, or null while inactive. [JsonPropertyName("activeSegmentStartedAt")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public long? ActiveSegmentStartedAt { get; set; } /// Approved effective resource ceilings, or null until approved. [JsonPropertyName("approved")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public FactoryDeclaredLimits? Approved { get; set; } /// Epoch milliseconds when the run completed, or null while nonterminal. [JsonPropertyName("completedAt")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public long? CompletedAt { get; set; } /// Durable resource consumption. @@ -6795,6 +6799,7 @@ public sealed class FactoryRunSummary /// Current phase identity, or null before any phase is entered. [JsonPropertyName("currentPhase")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public FactoryCurrentPhase? CurrentPhase { get; set; } /// Resource ceilings declared by the factory. @@ -6831,6 +6836,7 @@ public sealed class FactoryRunSummary /// Epoch milliseconds when execution first started, or null before start. [JsonPropertyName("startedAt")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public long? StartedAt { get; set; } /// Current factory run status. @@ -6839,6 +6845,7 @@ public sealed class FactoryRunSummary /// Terminal run outcome, or null while nonterminal. [JsonPropertyName("terminal")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public FactoryRunTerminal? Terminal { get; set; } /// Total direct factory agents spawned across all attempts. @@ -6930,6 +6937,7 @@ public sealed class FactoryAgentSummary /// Phase identifier active when the agent was launched, or null. [JsonPropertyName("phaseId")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? PhaseId { get; set; } /// Model requested when the agent was launched. @@ -6995,6 +7003,7 @@ public sealed class FactoryPhaseObservation /// Zero-based declared phase ordinal, or null for an undeclared phase. [JsonPropertyName("ordinal")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public long? Ordinal { get; set; } /// Epoch milliseconds when this phase first started; for a skipped phase, the synthetic skip timestamp (equal to `completedAt`). @@ -7028,6 +7037,7 @@ public sealed class FactoryProgressLine /// Phase active when the record was emitted, or null before any phase. [JsonPropertyName("phaseId")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? PhaseId { get; set; } /// Epoch milliseconds when the record was persisted. @@ -7057,10 +7067,12 @@ public sealed class FactoryProgressPage /// Newest sequence number in this page, or null when empty. [JsonPropertyName("newestSeq")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public long? NewestSeq { get; set; } /// Oldest sequence number in this page, or null when empty. [JsonPropertyName("oldestSeq")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public long? OldestSeq { get; set; } /// Progress records in sequence order. @@ -7078,6 +7090,7 @@ public sealed class FactoryRunDetail { /// Epoch milliseconds when the current active segment started, or null while inactive. [JsonPropertyName("activeSegmentStartedAt")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public long? ActiveSegmentStartedAt { get; set; } /// Durable identities and live statuses for direct factory agents. @@ -7086,10 +7099,12 @@ public sealed class FactoryRunDetail /// Approved effective resource ceilings, or null until approved. [JsonPropertyName("approved")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public FactoryDeclaredLimits? Approved { get; set; } /// Epoch milliseconds when the run completed, or null while nonterminal. [JsonPropertyName("completedAt")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public long? CompletedAt { get; set; } /// Durable resource consumption. @@ -7102,6 +7117,7 @@ public sealed class FactoryRunDetail /// Current phase identity, or null before any phase is entered. [JsonPropertyName("currentPhase")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public FactoryCurrentPhase? CurrentPhase { get; set; } /// Resource ceilings declared by the factory. @@ -7146,6 +7162,7 @@ public sealed class FactoryRunDetail /// Epoch milliseconds when execution first started, or null before start. [JsonPropertyName("startedAt")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public long? StartedAt { get; set; } /// Current factory run status. @@ -7154,6 +7171,7 @@ public sealed class FactoryRunDetail /// Terminal run outcome, or null while nonterminal. [JsonPropertyName("terminal")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public FactoryRunTerminal? Terminal { get; set; } /// Total direct factory agents spawned across all attempts. @@ -7676,6 +7694,7 @@ internal sealed class ModelSwitchAutoTierRequest { /// Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. [JsonPropertyName("autoTier")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public AutoTier? AutoTier { get; set; } /// Target session identifier. @@ -7907,6 +7926,7 @@ public sealed class NameGetResult { /// The session name (user-set or auto-generated), or null if not yet set. [JsonPropertyName("name")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? Name { get; set; } } @@ -7963,6 +7983,7 @@ public sealed class PlanReadResult { /// The content of the plan file, or null if it does not exist. [JsonPropertyName("content")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? Content { get; set; } /// Whether the plan file exists in the workspace. @@ -7971,6 +7992,7 @@ public sealed class PlanReadResult /// Absolute file path of the plan file, or null if workspace is not enabled. [JsonPropertyName("path")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? Path { get; set; } } @@ -8167,6 +8189,7 @@ public sealed class WorkspacesGetWorkspaceResult /// Current workspace metadata, or null if not available. [JsonPropertyName("workspace")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public WorkspacesGetWorkspaceResultWorkspace? Workspace { get; set; } } @@ -8307,6 +8330,7 @@ public sealed class WorkspacesReadCheckpointResult { /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. [JsonPropertyName("content")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? Content { get; set; } } @@ -8382,6 +8406,7 @@ public sealed class WorkspacesReadAutopilotObjectiveResult { /// Autopilot objective file content, or null when missing. [JsonPropertyName("content")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? Content { get; set; } } @@ -8474,6 +8499,7 @@ public sealed class WorkspacesSaveLargePasteResult { /// Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime, non-infinite sessions, remote sessions). [JsonPropertyName("saved")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public WorkspacesSaveLargePasteResultSaved? Saved { get; set; } } @@ -12969,6 +12995,7 @@ public sealed class BuiltinToolDescriptor /// Optional custom input format used instead of a JSON Schema. [JsonPropertyName("format")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public BuiltinToolFormat? Format { get; set; } /// Whether the tool provides a specialized intention summary. @@ -12977,10 +13004,12 @@ public sealed class BuiltinToolDescriptor /// JSON Schema for the tool input, or null when the tool uses a custom format. [JsonPropertyName("inputSchema")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public BuiltinToolInputSchema? InputSchema { get; set; } /// Optional supplemental usage instructions for the tool. [JsonPropertyName("instructions")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? Instructions { get; set; } /// Whether the tool executes commands in a terminal. @@ -12997,10 +13026,12 @@ public sealed class BuiltinToolDescriptor /// Optional human-readable title for the tool. [JsonPropertyName("title")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? Title { get; set; } /// Optional tool category discriminator. [JsonPropertyName("type")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? Type { get; set; } } @@ -13567,6 +13598,7 @@ public sealed class ToolsGetCurrentMetadataResult { /// Current tool metadata, or null when tools have not been initialized yet. [JsonPropertyName("tools")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public IList? Tools { get; set; } } @@ -16158,6 +16190,7 @@ public sealed class SessionMetadataSnapshot /// Current session limits, or null when no limits are active. [JsonPropertyName("sessionLimits")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public SessionLimitsConfig? SessionLimits { get; set; } /// ISO 8601 timestamp of when the session started. @@ -16178,6 +16211,7 @@ public sealed class SessionMetadataSnapshot /// Absolute path to the session's workspace directory on disk, or null if the session has no associated workspace. [JsonPropertyName("workspacePath")] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string? WorkspacePath { get; set; } } diff --git a/dotnet/test/E2E/RpcServerE2ETests.cs b/dotnet/test/E2E/RpcServerE2ETests.cs index 5e39c5ca5a..7822bf5352 100644 --- a/dotnet/test/E2E/RpcServerE2ETests.cs +++ b/dotnet/test/E2E/RpcServerE2ETests.cs @@ -125,6 +125,14 @@ public async Task Should_Call_Rpc_Ping_With_Typed_Params_And_Result() Assert.NotEqual(default, result.Timestamp); } + [Fact] + public async Task Should_Clear_The_Managed_Settings_Cache() + { + await Client.StartAsync(); + + await Client.Rpc.ManagedSettings.ClearCacheAsync(); + } + [Fact] public async Task Should_Reject_Llm_Inference_Response_Frames_For_Missing_Request() { diff --git a/dotnet/test/Unit/SerializationTests.cs b/dotnet/test/Unit/SerializationTests.cs index 2414093797..444fc5488e 100644 --- a/dotnet/test/Unit/SerializationTests.cs +++ b/dotnet/test/Unit/SerializationTests.cs @@ -1122,6 +1122,35 @@ public void ToolResultObject_OmitsToolReferences_WhenNull_WithSdkOptions() Assert.False(document.RootElement.TryGetProperty("toolReferences", out _)); } + [Fact] + public void ModelSwitchRequests_DistinguishRequiredNullFromOmittedOptionalValue() + { + var options = GetSerializerOptions(); + var assembly = typeof(CopilotClient).Assembly; + + var switchAutoTierType = assembly.GetType("GitHub.Copilot.Rpc.ModelSwitchAutoTierRequest"); + Assert.NotNull(switchAutoTierType); + var switchAutoTierRequest = CreateInternalRequest( + switchAutoTierType!, + ("SessionId", "session-id"), + ("AutoTier", null)); + using var switchAutoTierDocument = JsonDocument.Parse( + JsonSerializer.Serialize(switchAutoTierRequest, switchAutoTierType!, options)); + Assert.True(switchAutoTierDocument.RootElement.TryGetProperty("autoTier", out var requiredAutoTier)); + Assert.Equal(JsonValueKind.Null, requiredAutoTier.ValueKind); + + var switchToType = assembly.GetType("GitHub.Copilot.Rpc.ModelSwitchToRequest"); + Assert.NotNull(switchToType); + var switchToRequest = CreateInternalRequest( + switchToType!, + ("SessionId", "session-id"), + ("ModelId", "auto"), + ("AutoTier", null)); + using var switchToDocument = JsonDocument.Parse( + JsonSerializer.Serialize(switchToRequest, switchToType!, options)); + Assert.False(switchToDocument.RootElement.TryGetProperty("autoTier", out _)); + } + private static JsonSerializerOptions GetSerializerOptions() { var prop = typeof(CopilotClient) diff --git a/go/internal/e2e/rpc_server_e2e_test.go b/go/internal/e2e/rpc_server_e2e_test.go index f1aa5a19c7..fb24309c1d 100644 --- a/go/internal/e2e/rpc_server_e2e_test.go +++ b/go/internal/e2e/rpc_server_e2e_test.go @@ -17,6 +17,21 @@ import ( // Mirrors dotnet/test/RpcServerTests.cs (snapshot category "rpc_server"). // Tests server-scoped (non-session) RPCs. func TestRPCServerE2E(t *testing.T) { + t.Run("should clear the managed settings cache", func(t *testing.T) { + ctx := testharness.NewTestContext(t) + ctx.ConfigureForTest(t) + client := ctx.NewClient() + t.Cleanup(func() { client.ForceStop() }) + + if err := client.Start(t.Context()); err != nil { + t.Fatalf("Start failed: %v", err) + } + + if _, err := client.RPC.ManagedSettings.ClearCache(t.Context()); err != nil { + t.Fatalf("ManagedSettings.ClearCache failed: %v", err) + } + }) + t.Run("should call rpc ping with typed params and result", func(t *testing.T) { ctx := testharness.NewTestContext(t) ctx.ConfigureForTest(t) diff --git a/java/scripts/codegen/java.ts b/java/scripts/codegen/java.ts index 785049afa1..9bd9ed8cfc 100644 --- a/java/scripts/codegen/java.ts +++ b/java/scripts/codegen/java.ts @@ -1326,6 +1326,18 @@ function rpcMethodToClassName(rpcMethod: string): string { return rpcMethod.split(/[._-]/).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(""); } +function schemaAllowsNull(schema: JSONSchema7): boolean { + if (schema.type === "null" || (Array.isArray(schema.type) && schema.type.includes("null"))) { + return true; + } + if (schema.const === null || schema.enum?.includes(null)) { + return true; + } + return [...(schema.anyOf || []), ...(schema.oneOf || [])].some( + (variant) => typeof variant === "object" && schemaAllowsNull(variant) + ); +} + /** Generate a Java record for a JSON Schema object type. Returns the class content. */ function generateRpcClass( className: string, @@ -1340,13 +1352,20 @@ function generateRpcClass( const visModifier = visibility === "public" ? "public " : ""; const properties = Object.entries(schema.properties || {}); + const required = new Set(schema.required || []); const fields = properties.flatMap(([propName, propSchema]) => { if (typeof propSchema !== "object") return []; const prop = propSchema as JSONSchema7; // Record components are always boxed (nullable by design). const result = schemaTypeToJava(prop, false, className, propName, localNestedTypes); for (const imp of result.imports) imports.add(imp); - return [{ propName, javaName: toCamelCase(propName), javaType: result.javaType, description: prop.description }]; + return [{ + propName, + javaName: toCamelCase(propName), + javaType: result.javaType, + description: prop.description, + includeNull: required.has(propName) && schemaAllowsNull(prop), + }]; }); lines.push(`@JsonInclude(JsonInclude.Include.NON_NULL)`); @@ -1361,6 +1380,9 @@ function generateRpcClass( if (f.description) { lines.push(` /** ${f.description} */`); } + if (f.includeNull) { + lines.push(` @JsonInclude(JsonInclude.Include.ALWAYS)`); + } lines.push(` @JsonProperty("${f.propName}") ${f.javaType} ${f.javaName}${comma}`); } lines.push(`) {`); diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index a394c2717f..b3656d002a 100644 --- a/java/scripts/codegen/package-lock.json +++ b/java/scripts/codegen/package-lock.json @@ -513,6 +513,25 @@ "copilot-linux-x64": "copilot" } }, + "node_modules/@github/copilot-linuxmusl-arm64": { + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.83-4.tgz", + "integrity": "sha512-Y4AjA9FCMzlfYcS9GYffXiJLEe0yXwFWB/lGT8em0P0Pvi/U2cOxuZu/4CzFrSE8zDhBLwI8/JAZWCE0pPeV7g==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "SEE LICENSE IN LICENSE.md", + "optional": true, + "os": [ + "linux" + ], + "bin": { + "copilot-linuxmusl-arm64": "copilot" + } + }, "node_modules/@github/copilot-linuxmusl-x64": { "version": "1.0.83-4", "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.83-4.tgz", @@ -545,6 +564,22 @@ "copilot-win32-arm64": "copilot.exe" } }, + "node_modules/@github/copilot-win32-x64": { + "version": "1.0.83-4", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.83-4.tgz", + "integrity": "sha512-BZB6DkRaj2n0UXXgG5IqVz7FN3gMBpEh6tdv1DGfIsfMVlCwQWGR5gb5fzOfxVlJWAlxxBk7nmJYFsYgZtC7yQ==", + "cpu": [ + "x64" + ], + "license": "SEE LICENSE IN LICENSE.md", + "optional": true, + "os": [ + "win32" + ], + "bin": { + "copilot-win32-x64": "copilot.exe" + } + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/CustomAgentsUpdatedAgent.java b/java/sdk/src/generated/java/com/github/copilot/generated/CustomAgentsUpdatedAgent.java index 762f0b1ac8..4bea6b921b 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/CustomAgentsUpdatedAgent.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/CustomAgentsUpdatedAgent.java @@ -33,6 +33,7 @@ public record CustomAgentsUpdatedAgent( /** Source location: user, project, inherited, remote, or plugin */ @JsonProperty("source") String source, /** List of tool names available to this agent, or null when all tools are available */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("tools") List tools, /** Whether the agent can be selected by the user */ @JsonProperty("userInvocable") Boolean userInvocable, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/BuiltinToolDescriptor.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/BuiltinToolDescriptor.java index 057498fb98..1d901ad496 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/BuiltinToolDescriptor.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/BuiltinToolDescriptor.java @@ -24,16 +24,21 @@ public record BuiltinToolDescriptor( /** Stable name used to invoke the built-in tool. */ @JsonProperty("name") String name, /** Optional human-readable title for the tool. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("title") String title, /** Model-facing description of the tool's behavior. */ @JsonProperty("description") String description, /** JSON Schema for the tool input, or null when the tool uses a custom format. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("inputSchema") BuiltinToolInputSchema inputSchema, /** Optional supplemental usage instructions for the tool. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("instructions") String instructions, /** Optional tool category discriminator. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("type") String type, /** Optional custom input format used instead of a JSON Schema. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("format") BuiltinToolFormat format, /** Policy describing which tool metadata may be recorded without obfuscation. */ @JsonProperty("safeForTelemetry") Object safeForTelemetry, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentSummary.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentSummary.java index d1bd2329b2..1a912c7e02 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentSummary.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryAgentSummary.java @@ -28,6 +28,7 @@ public record FactoryAgentSummary( /** Owning factory run identifier. */ @JsonProperty("runId") String runId, /** Phase identifier active when the agent was launched, or null. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("phaseId") String phaseId, /** Friendly, non-unique name intended for display */ @JsonProperty("label") String label, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryCurrentPhase.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryCurrentPhase.java index e0a30f51a6..fc6902d83c 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryCurrentPhase.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryCurrentPhase.java @@ -24,6 +24,7 @@ public record FactoryCurrentPhase( /** Current phase identifier. */ @JsonProperty("id") String id, /** Zero-based declared phase ordinal, or null for an undeclared phase. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("ordinal") Long ordinal ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseObservation.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseObservation.java index aa96e0cb90..833ceab067 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseObservation.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryPhaseObservation.java @@ -24,6 +24,7 @@ public record FactoryPhaseObservation( /** Phase identifier. */ @JsonProperty("id") String id, /** Zero-based declared phase ordinal, or null for an undeclared phase. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("ordinal") Long ordinal, /** Human-readable phase title. */ @JsonProperty("title") String title, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressLine.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressLine.java index 3a26b67d79..65ffc36521 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressLine.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressLine.java @@ -26,6 +26,7 @@ public record FactoryProgressLine( /** Resume attempt that emitted this record. */ @JsonProperty("attempt") Long attempt, /** Phase active when the record was emitted, or null before any phase. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("phaseId") String phaseId, /** Epoch milliseconds when the record was persisted. */ @JsonProperty("recordedAt") Long recordedAt, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressPage.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressPage.java index 76278a1585..f0b1930686 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressPage.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryProgressPage.java @@ -25,8 +25,10 @@ public record FactoryProgressPage( /** Progress records in sequence order. */ @JsonProperty("records") List records, /** Oldest sequence number in this page, or null when empty. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("oldestSeq") Long oldestSeq, /** Newest sequence number in this page, or null when empty. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("newestSeq") Long newestSeq, /** Whether progress records older than this page exist. */ @JsonProperty("hasMoreOlder") Boolean hasMoreOlder, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java index f482acfa16..f73aa9c2a0 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/FactoryRunSummary.java @@ -34,12 +34,15 @@ public record FactoryRunSummary( /** Epoch milliseconds when the run was created. */ @JsonProperty("createdAt") Long createdAt, /** Epoch milliseconds when execution first started, or null before start. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("startedAt") Long startedAt, /** Epoch milliseconds when the durable run was last updated. */ @JsonProperty("updatedAt") Long updatedAt, /** Epoch milliseconds when the run completed, or null while nonterminal. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("completedAt") Long completedAt, /** Current phase identity, or null before any phase is entered. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("currentPhase") FactoryCurrentPhase currentPhase, /** Number of phases declared by the factory. */ @JsonProperty("declaredPhaseCount") Long declaredPhaseCount, @@ -52,12 +55,15 @@ public record FactoryRunSummary( /** Resource ceilings declared by the factory. */ @JsonProperty("declaredLimits") FactoryDeclaredLimits declaredLimits, /** Approved effective resource ceilings, or null until approved. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("approved") FactoryDeclaredLimits approved, /** Epoch milliseconds when this live-overlay snapshot was observed. */ @JsonProperty("observedAt") Long observedAt, /** Epoch milliseconds when the current active segment started, or null while inactive. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("activeSegmentStartedAt") Long activeSegmentStartedAt, /** Terminal run outcome, or null while nonterminal. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("terminal") FactoryRunTerminal terminal ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PermissionRule.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PermissionRule.java index 8e7a6c769e..e37d9dbb33 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PermissionRule.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/PermissionRule.java @@ -24,6 +24,7 @@ public record PermissionRule( /** The rule kind, such as Shell or GitHubMCP */ @JsonProperty("kind") String kind, /** Argument value matched against the request, or null when the rule kind has no argument (e.g. 'read', 'write', 'memory'). */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("argument") String argument ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java index 01204cb832..a72ad0bc8e 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunDetailResult.java @@ -38,12 +38,15 @@ public record SessionFactoryGetRunDetailResult( /** Epoch milliseconds when the run was created. */ @JsonProperty("createdAt") Long createdAt, /** Epoch milliseconds when execution first started, or null before start. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("startedAt") Long startedAt, /** Epoch milliseconds when the durable run was last updated. */ @JsonProperty("updatedAt") Long updatedAt, /** Epoch milliseconds when the run completed, or null while nonterminal. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("completedAt") Long completedAt, /** Current phase identity, or null before any phase is entered. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("currentPhase") FactoryCurrentPhase currentPhase, /** Number of phases declared by the factory. */ @JsonProperty("declaredPhaseCount") Long declaredPhaseCount, @@ -56,12 +59,15 @@ public record SessionFactoryGetRunDetailResult( /** Resource ceilings declared by the factory. */ @JsonProperty("declaredLimits") FactoryDeclaredLimits declaredLimits, /** Approved effective resource ceilings, or null until approved. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("approved") FactoryDeclaredLimits approved, /** Epoch milliseconds when this live-overlay snapshot was observed. */ @JsonProperty("observedAt") Long observedAt, /** Epoch milliseconds when the current active segment started, or null while inactive. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("activeSegmentStartedAt") Long activeSegmentStartedAt, /** Terminal run outcome, or null while nonterminal. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("terminal") FactoryRunTerminal terminal, /** Lifecycle and timing observations for each factory phase. */ @JsonProperty("phases") List phases, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressResult.java index 2a4cb78cb2..ec6ac51496 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionFactoryGetRunProgressResult.java @@ -28,8 +28,10 @@ public record SessionFactoryGetRunProgressResult( /** Progress records in sequence order. */ @JsonProperty("records") List records, /** Oldest sequence number in this page, or null when empty. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("oldestSeq") Long oldestSeq, /** Newest sequence number in this page, or null when empty. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("newestSeq") Long newestSeq, /** Whether progress records older than this page exist. */ @JsonProperty("hasMoreOlder") Boolean hasMoreOlder, diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java index 6c29e07b6e..33bf5891d9 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionMetadataSnapshotResult.java @@ -36,6 +36,7 @@ public record SessionMetadataSnapshotResult( /** True when the session was detected to be in use by another process at construction time. Local consumers may surface a confirmation prompt before fully attaching. Always false for new sessions. */ @JsonProperty("alreadyInUse") Boolean alreadyInUse, /** Absolute path to the session's workspace directory on disk, or null if the session has no associated workspace */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("workspacePath") String workspacePath, /** User-provided name supplied at session construction (via `--name`), if any. Immutable after construction. */ @JsonProperty("initialName") String initialName, @@ -52,6 +53,7 @@ public record SessionMetadataSnapshotResult( /** Currently selected model identifier, if any */ @JsonProperty("selectedModel") String selectedModel, /** Current session limits, or null when no limits are active */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("sessionLimits") SessionLimitsConfig sessionLimits, /** Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags). */ @JsonProperty("workspace") SessionMetadataSnapshotResultWorkspace workspace diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java index 576df55aa1..dfa020c034 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java @@ -27,6 +27,7 @@ public record SessionModelSwitchAutoTierParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, /** Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("autoTier") AutoTier autoTier, /** Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. */ @JsonProperty("source") ModelChangeSource source diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionNameGetResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionNameGetResult.java index 4743adaed2..de3ae5a494 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionNameGetResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionNameGetResult.java @@ -25,6 +25,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionNameGetResult( /** The session name (user-set or auto-generated), or null if not yet set */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("name") String name ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionPlanReadResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionPlanReadResult.java index 5fd82d3e14..97db4cfcf6 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionPlanReadResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionPlanReadResult.java @@ -27,8 +27,10 @@ public record SessionPlanReadResult( /** Whether the plan file exists in the workspace */ @JsonProperty("exists") Boolean exists, /** The content of the plan file, or null if it does not exist */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("content") String content, /** Absolute file path of the plan file, or null if workspace is not enabled */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("path") String path ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataResult.java index 8f3bf99125..e6cb29f310 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionToolsGetCurrentMetadataResult.java @@ -26,6 +26,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionToolsGetCurrentMetadataResult( /** Current tool metadata, or null when tools have not been initialized yet */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("tools") List tools ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureResult.java index c2d7e9ce37..77362d450a 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesEnsureResult.java @@ -26,6 +26,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionWorkspacesEnsureResult( /** Current workspace metadata, or null if not available */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("workspace") SessionWorkspacesEnsureResultWorkspace workspace, /** Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). */ @JsonProperty("path") String path diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesGetWorkspaceResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesGetWorkspaceResult.java index 6f4714a594..8d8ff53c98 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesGetWorkspaceResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesGetWorkspaceResult.java @@ -26,6 +26,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionWorkspacesGetWorkspaceResult( /** Current workspace metadata, or null if not available */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("workspace") SessionWorkspacesGetWorkspaceResultWorkspace workspace, /** Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). */ @JsonProperty("path") String path diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveResult.java index 7b2e157b56..6928c1c88d 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadAutopilotObjectiveResult.java @@ -25,6 +25,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionWorkspacesReadAutopilotObjectiveResult( /** Autopilot objective file content, or null when missing. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("content") String content ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadCheckpointResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadCheckpointResult.java index 21aa5009fe..02a413a4ab 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadCheckpointResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesReadCheckpointResult.java @@ -25,6 +25,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionWorkspacesReadCheckpointResult( /** Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("content") String content ) { } diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesSaveLargePasteResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesSaveLargePasteResult.java index 08df378c90..5604588123 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesSaveLargePasteResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesSaveLargePasteResult.java @@ -25,6 +25,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionWorkspacesSaveLargePasteResult( /** Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime, non-infinite sessions, remote sessions) */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("saved") SessionWorkspacesSaveLargePasteResultSaved saved ) { diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesResult.java index 1dc348e67e..6d957fe52b 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesTruncateSummariesResult.java @@ -26,6 +26,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionWorkspacesTruncateSummariesResult( /** Current workspace metadata, or null if not available */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("workspace") SessionWorkspacesTruncateSummariesResultWorkspace workspace, /** Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). */ @JsonProperty("path") String path diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataResult.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataResult.java index 03731650a8..06a2dea59c 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataResult.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionWorkspacesUpdateMetadataResult.java @@ -26,6 +26,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public record SessionWorkspacesUpdateMetadataResult( /** Current workspace metadata, or null if not available */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("workspace") SessionWorkspacesUpdateMetadataResultWorkspace workspace, /** Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). */ @JsonProperty("path") String path diff --git a/java/sdk/src/main/java/com/github/copilot/CopilotSession.java b/java/sdk/src/main/java/com/github/copilot/CopilotSession.java index f3a35967d3..c53fea3f4b 100644 --- a/java/sdk/src/main/java/com/github/copilot/CopilotSession.java +++ b/java/sdk/src/main/java/com/github/copilot/CopilotSession.java @@ -2010,8 +2010,8 @@ public CompletableFuture abort() { */ public CompletableFuture setModel(String model, String reasoningEffort) { ensureNotTerminated(); - return getRpc().model.switchTo(new SessionModelSwitchToParams(sessionId, model, reasoningEffort, null, null, - null, null, null, null, null, null, null, null, null, null)).thenApply(r -> null); + return getRpc().model.switchTo(new SessionModelSwitchToParams(sessionId, model, null, reasoningEffort, null, + null, null, null, null, null, null, null, null, null, null, null)).thenApply(r -> null); } /** @@ -2091,9 +2091,9 @@ public CompletableFuture setModel(String model, String reasoningEffort, St var generatedReasoningSummary = reasoningSummary == null ? null : com.github.copilot.generated.rpc.ReasoningSummary.fromValue(reasoningSummary); - return getRpc().model - .switchTo(new SessionModelSwitchToParams(sessionId, model, reasoningEffort, generatedReasoningSummary, - null, generatedCapabilities, null, null, null, null, null, null, null, null, null)) + return getRpc().model.switchTo( + new SessionModelSwitchToParams(sessionId, model, null, reasoningEffort, generatedReasoningSummary, null, + generatedCapabilities, null, null, null, null, null, null, null, null, null)) .thenApply(r -> null); } diff --git a/java/sdk/src/test/java/com/github/copilot/RpcServerE2ETest.java b/java/sdk/src/test/java/com/github/copilot/RpcServerE2ETest.java index 6c9753025a..1da37ad1d9 100644 --- a/java/sdk/src/test/java/com/github/copilot/RpcServerE2ETest.java +++ b/java/sdk/src/test/java/com/github/copilot/RpcServerE2ETest.java @@ -95,6 +95,17 @@ void testShouldCallRpcPingWithTypedParamsAndResult() throws Exception { } } + @Test + void testShouldClearTheManagedSettingsCache() throws Exception { + ctx.configureForTest("rpc_server", "should_clear_the_managed_settings_cache"); + + try (var client = ctx.createClient()) { + client.start().get(TIMEOUT_SECONDS, TimeUnit.SECONDS); + + client.getRpc().managedSettings.clearCache().get(TIMEOUT_SECONDS, TimeUnit.SECONDS); + } + } + @Test void testShouldRejectLlmInferenceResponseFramesForMissingRequest() throws Exception { ctx.initializeProxy(); diff --git a/java/sdk/src/test/java/com/github/copilot/RpcSessionStateExtrasE2ETest.java b/java/sdk/src/test/java/com/github/copilot/RpcSessionStateExtrasE2ETest.java index f7fc58d429..235b1d5720 100644 --- a/java/sdk/src/test/java/com/github/copilot/RpcSessionStateExtrasE2ETest.java +++ b/java/sdk/src/test/java/com/github/copilot/RpcSessionStateExtrasE2ETest.java @@ -65,7 +65,7 @@ void testShouldAddByokProviderAndModelAtRuntime() throws Exception { var selectionId = "java-e2e-provider/small"; session.getRpc().model.switchTo(new SessionModelSwitchToParams(null, selectionId, null, null, null, - null, null, null, null, null, null, null, null, null, null)).get(30, TimeUnit.SECONDS); + null, null, null, null, null, null, null, null, null, null, null)).get(30, TimeUnit.SECONDS); var current = session.getRpc().model.getCurrent().get(30, TimeUnit.SECONDS); assertEquals(selectionId, current.modelId()); } diff --git a/java/sdk/src/test/java/com/github/copilot/RpcWrappersTest.java b/java/sdk/src/test/java/com/github/copilot/RpcWrappersTest.java index 3bb9001f35..7b55748bb8 100644 --- a/java/sdk/src/test/java/com/github/copilot/RpcWrappersTest.java +++ b/java/sdk/src/test/java/com/github/copilot/RpcWrappersTest.java @@ -206,7 +206,7 @@ void sessionRpc_model_switchTo_merges_sessionId_with_extra_params() { // switchTo takes extra params beyond sessionId var switchParams = new SessionModelSwitchToParams(null, "gpt-5", null, null, null, null, null, null, null, null, - null, null, null, null, null); + null, null, null, null, null, null); session.model.switchTo(switchParams); assertEquals(1, stub.calls.size()); diff --git a/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcApiCoverageTest.java b/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcApiCoverageTest.java index fd0fdaaea1..191c290026 100644 --- a/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcApiCoverageTest.java +++ b/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcApiCoverageTest.java @@ -97,7 +97,7 @@ void serverRpc_mcp_config_remove_invokes_correct_method() { var stub = new StubCaller(); var server = new ServerRpc(stub); - var params = new McpConfigRemoveParams("myServer"); + var params = new McpConfigRemoveParams("myServer", null); server.mcp.config.remove(params); assertEquals(1, stub.calls.size()); diff --git a/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java b/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java index f86b3dfbcb..7310e087e9 100644 --- a/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java +++ b/java/sdk/src/test/java/com/github/copilot/generated/rpc/GeneratedRpcRecordsCoverageTest.java @@ -13,6 +13,7 @@ import org.junit.jupiter.api.Test; +import com.fasterxml.jackson.databind.ObjectMapper; import com.github.copilot.TestUtil; /** @@ -48,7 +49,7 @@ void mcpDiscoverParams_record() { @Test void mcpConfigRemoveParams_record() { - var params = new McpConfigRemoveParams("old-server"); + var params = new McpConfigRemoveParams("old-server", null); assertEquals("old-server", params.name()); } @@ -326,10 +327,11 @@ void sessionModelGetCurrentParams_record() { @Test void sessionModelSwitchToParams_record() { - var params = new SessionModelSwitchToParams("sess-32", "claude-sonnet-5", "high", null, null, null, null, null, - null, null, null, null, null, null, null); + var params = new SessionModelSwitchToParams("sess-32", "claude-sonnet-5", null, "high", null, null, null, null, + null, null, null, null, null, null, null, null); assertEquals("sess-32", params.sessionId()); assertEquals("claude-sonnet-5", params.modelId()); + assertNull(params.autoTier()); assertEquals("high", params.reasoningEffort()); assertNull(params.reasoningSummary()); assertNull(params.verbosity()); @@ -337,6 +339,18 @@ void sessionModelSwitchToParams_record() { assertNull(params.deferIfModelChangeQueued()); } + @Test + void sessionModelSwitchParams_distinguishRequiredNullFromOmittedOptionalValue() { + var mapper = new ObjectMapper(); + var switchAutoTier = mapper.valueToTree(new SessionModelSwitchAutoTierParams("sess-32", null, null)); + assertTrue(switchAutoTier.has("autoTier")); + assertTrue(switchAutoTier.get("autoTier").isNull()); + + var switchTo = mapper.valueToTree(new SessionModelSwitchToParams("sess-32", "auto", null, null, null, null, + null, null, null, null, null, null, null, null, null, null)); + assertFalse(switchTo.has("autoTier")); + } + @Test void sessionPermissionsHandlePendingPermissionRequestParams_record() { var params = new SessionPermissionsHandlePendingPermissionRequestParams("sess-33", "req-1", "allow", null); @@ -657,13 +671,13 @@ void sessionMcpListResult_status_enum_all_values() { @Test void sessionModelGetCurrentResult_record() { - var result = new SessionModelGetCurrentResult("claude-sonnet-5", null, null); + var result = new SessionModelGetCurrentResult("claude-sonnet-5", null, null, null, null, null); assertEquals("claude-sonnet-5", result.modelId()); } @Test void sessionModelSwitchToResult_record() { - var result = new SessionModelSwitchToResult("gpt-5", true, null, null, null, null, null, null); + var result = new SessionModelSwitchToResult("gpt-5", true, null, null, null, null, null, null, null); assertEquals("gpt-5", result.modelId()); assertEquals(true, result.deferred()); } @@ -819,8 +833,8 @@ void modelsListResult_nested() { var policy = new ModelPolicy(ModelPolicyState.ENABLED, null); var promo = new ModelBillingPromo("summer-2026", 25.0, "2026-08-01T00:00:00Z", "Summer discount", true); var billing = new ModelBilling(1.0, null, null, promo); - var modelItem = new Model("gpt-5", "GPT-5", capabilities, policy, billing, null, null, null, null, null, null, - null, null); + var modelItem = new Model("gpt-5", "GPT-5", capabilities, null, policy, billing, null, null, null, null, null, + null, null, null); var result = new ModelsListResult(List.of(modelItem)); assertEquals(1, result.models().size()); @@ -857,8 +871,8 @@ void sessionModelSwitchToParams_nested_records() { var limits = new ModelCapabilitiesOverrideLimits(100000L, 8192L, 128000L, limitsVision); var supports = new ModelCapabilitiesOverrideSupports(true, true, null); var capabilities = new ModelCapabilitiesOverride(supports, limits); - var params = new SessionModelSwitchToParams("sess-m", "gpt-5", null, null, null, capabilities, null, null, null, - null, null, null, null, null, null); + var params = new SessionModelSwitchToParams("sess-m", "gpt-5", null, null, null, null, capabilities, null, null, + null, null, null, null, null, null, null); assertEquals("gpt-5", params.modelId()); assertNotNull(params.modelCapabilities()); diff --git a/nodejs/test/e2e/rpc_server.e2e.test.ts b/nodejs/test/e2e/rpc_server.e2e.test.ts index 13a63875e9..cbcdbbd686 100644 --- a/nodejs/test/e2e/rpc_server.e2e.test.ts +++ b/nodejs/test/e2e/rpc_server.e2e.test.ts @@ -103,6 +103,11 @@ describe("Server-scoped RPC", async () => { expect(Date.parse(result.timestamp)).not.toBeNaN(); }); + it("should clear the managed settings cache", async () => { + await client.start(); + await expect(client.rpc.managedSettings.clearCache()).resolves.toBeNull(); + }); + it("should reject llm inference response frames for missing request", async () => { await client.start(); diff --git a/python/e2e/test_rpc_server_e2e.py b/python/e2e/test_rpc_server_e2e.py index fdff3b8004..2c1d2581fe 100644 --- a/python/e2e/test_rpc_server_e2e.py +++ b/python/e2e/test_rpc_server_e2e.py @@ -137,6 +137,10 @@ async def test_should_call_rpc_ping_with_typed_params_and_result(self, ctx: E2ET assert result.message == "pong: typed rpc test" assert result.timestamp is not None + async def test_should_clear_the_managed_settings_cache(self, ctx: E2ETestContext): + await ctx.client.start() + assert await ctx.client.rpc.managed_settings.clear_cache() is None + async def test_should_reject_llm_inference_response_frames_for_missing_request( self, ctx: E2ETestContext ): diff --git a/rust/src/lib.rs b/rust/src/lib.rs index fd7f12cf14..5a8eb60d4d 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -2486,6 +2486,7 @@ impl Client { .client_info .as_ref() .and_then(ClientInfo::to_wire), + supported_task_kinds: None, }; let value = self .call( diff --git a/rust/src/session.rs b/rust/src/session.rs index 509485e39e..029e640948 100644 --- a/rust/src/session.rs +++ b/rust/src/session.rs @@ -549,6 +549,7 @@ impl Session { pub async fn set_model(&self, model: &str, opts: Option) -> Result<(), Error> { let opts = opts.unwrap_or_default(); let request = ModelSwitchToRequest { + auto_tier: None, compaction_decision: None, context_tier: opts.context_tier, defer_if_model_change_queued: None, diff --git a/rust/tests/e2e/rpc_mcp_config.rs b/rust/tests/e2e/rpc_mcp_config.rs index 591d7d247c..b3c91fc180 100644 --- a/rust/tests/e2e/rpc_mcp_config.rs +++ b/rust/tests/e2e/rpc_mcp_config.rs @@ -17,6 +17,7 @@ async fn should_call_server_mcp_config_rpcs() { let config = client.rpc().mcp().config(); let _ = config .remove(McpConfigRemoveRequest { + auth_client_id_metadata_url: None, name: server_name.to_string(), }) .await; @@ -73,6 +74,7 @@ async fn should_call_server_mcp_config_rpcs() { .expect("enable"); config .remove(McpConfigRemoveRequest { + auth_client_id_metadata_url: None, name: server_name.to_string(), }) .await @@ -101,6 +103,7 @@ async fn should_round_trip_http_mcp_oauth_config_rpc() { let config = client.rpc().mcp().config(); let _ = config .remove(McpConfigRemoveRequest { + auth_client_id_metadata_url: None, name: server_name.to_string(), }) .await; @@ -196,6 +199,7 @@ async fn should_round_trip_http_mcp_oauth_config_rpc() { config .remove(McpConfigRemoveRequest { + auth_client_id_metadata_url: None, name: server_name.to_string(), }) .await diff --git a/rust/tests/e2e/rpc_server.rs b/rust/tests/e2e/rpc_server.rs index 2e80ae1d70..a3bb58e286 100644 --- a/rust/tests/e2e/rpc_server.rs +++ b/rust/tests/e2e/rpc_server.rs @@ -46,6 +46,30 @@ async fn should_call_rpc_ping_with_typed_params_and_result() { .await; } +#[tokio::test] +async fn should_clear_the_managed_settings_cache() { + super::support::with_shared_e2e_context( + &E2E, + "rpc_server", + "should_clear_the_managed_settings_cache", + |ctx| { + Box::pin(async move { + let client = ctx.start_client().await; + + client + .rpc() + .managed_settings() + .clear_cache() + .await + .expect("clear managed settings cache"); + + client.stop().await.expect("stop client"); + }) + }, + ) + .await; +} + #[tokio::test] async fn should_call_rpc_models_list_with_typed_result() { // TODO(cli-1.0.81-2): CLI 1.0.81-2 stopped honoring client-level GitHub tokens over the @@ -891,4 +915,4 @@ fn paths_equal(left: &str, right: &str) -> bool { normalize(left) == normalize(right) } static E2E: super::support::SharedE2eGroup = - super::support::SharedE2eGroup::standard("rpc_server", 11); + super::support::SharedE2eGroup::standard("rpc_server", 12); diff --git a/rust/tests/e2e/rpc_tasks_and_handlers.rs b/rust/tests/e2e/rpc_tasks_and_handlers.rs index 540238ddd0..0b8e7d0642 100644 --- a/rust/tests/e2e/rpc_tasks_and_handlers.rs +++ b/rust/tests/e2e/rpc_tasks_and_handlers.rs @@ -66,7 +66,7 @@ async fn should_list_task_state_and_return_false_for_missing_task_operations() { .await .expect("progress missing") .progress - .is_none() + .is_null() ); assert!( session diff --git a/scripts/codegen/csharp.ts b/scripts/codegen/csharp.ts index 00afec6000..e170727528 100644 --- a/scripts/codegen/csharp.ts +++ b/scripts/codegen/csharp.ts @@ -1828,6 +1828,9 @@ function emitRpcClass( if (isMillisecondsDurationProperty(propName, prop)) lines.push(` [JsonConverter(typeof(MillisecondsTimeSpanConverter))]`); const propVisibility = pushCSharpInternalAttribute(lines, prop); lines.push(` [JsonPropertyName("${propName}")]`); + if (isReq && csharpType.endsWith("?")) { + lines.push(` [JsonIgnore(Condition = JsonIgnoreCondition.Never)]`); + } let defaultVal = ""; let propAccessors = "{ get; set; }"; diff --git a/test/snapshots/rpc_server/should_clear_the_managed_settings_cache.yaml b/test/snapshots/rpc_server/should_clear_the_managed_settings_cache.yaml new file mode 100644 index 0000000000..0c6b353c19 --- /dev/null +++ b/test/snapshots/rpc_server/should_clear_the_managed_settings_cache.yaml @@ -0,0 +1,3 @@ +models: + - claude-sonnet-5 +conversations: [] From 527379617fc5d7cd609bafde708d66e8e8b84fa2 Mon Sep 17 00:00:00 2001 From: Josh Spicer <23246594+joshspicer@users.noreply.github.com> Date: Thu, 3 Sep 2026 11:41:52 -0700 Subject: [PATCH 12/14] Keep clear-cache E2E on default transport The in-process host does not expose managedSettings.clearCache, and invoking this process-global invalidation inside shared in-process suites can disturb unrelated tests. Keep the replay-backed coverage on the default transport for each SDK. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/test/E2E/RpcServerE2ETests.cs | 1 + nodejs/test/e2e/rpc_server.e2e.test.ts | 4 ++-- python/e2e/test_rpc_server_e2e.py | 6 +++++- rust/tests/e2e/rpc_server.rs | 8 +++++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dotnet/test/E2E/RpcServerE2ETests.cs b/dotnet/test/E2E/RpcServerE2ETests.cs index 7822bf5352..b13151db60 100644 --- a/dotnet/test/E2E/RpcServerE2ETests.cs +++ b/dotnet/test/E2E/RpcServerE2ETests.cs @@ -126,6 +126,7 @@ public async Task Should_Call_Rpc_Ping_With_Typed_Params_And_Result() } [Fact] + [Trait(E2ETestTraits.Backend, E2ETestTraits.CapiOnly)] public async Task Should_Clear_The_Managed_Settings_Cache() { await Client.StartAsync(); diff --git a/nodejs/test/e2e/rpc_server.e2e.test.ts b/nodejs/test/e2e/rpc_server.e2e.test.ts index cbcdbbd686..cf08f916a2 100644 --- a/nodejs/test/e2e/rpc_server.e2e.test.ts +++ b/nodejs/test/e2e/rpc_server.e2e.test.ts @@ -7,7 +7,7 @@ import * as path from "path"; import { randomUUID } from "node:crypto"; import { describe, expect, it, onTestFinished } from "vitest"; import { CopilotClient, RuntimeConnection } from "../../src/index.js"; -import { createSdkTestContext } from "./harness/sdkTestContext.js"; +import { createSdkTestContext, isInProcessTransport } from "./harness/sdkTestContext.js"; import { waitForCondition } from "./harness/sdkTestHelper.js"; describe("Server-scoped RPC", async () => { @@ -103,7 +103,7 @@ describe("Server-scoped RPC", async () => { expect(Date.parse(result.timestamp)).not.toBeNaN(); }); - it("should clear the managed settings cache", async () => { + it.skipIf(isInProcessTransport)("should clear the managed settings cache", async () => { await client.start(); await expect(client.rpc.managedSettings.clearCache()).resolves.toBeNull(); }); diff --git a/python/e2e/test_rpc_server_e2e.py b/python/e2e/test_rpc_server_e2e.py index 2c1d2581fe..83dc4a01e2 100644 --- a/python/e2e/test_rpc_server_e2e.py +++ b/python/e2e/test_rpc_server_e2e.py @@ -55,7 +55,7 @@ ) from copilot.session import PermissionHandler -from .testharness import E2ETestContext, wait_for_condition +from .testharness import E2ETestContext, is_inprocess_transport, wait_for_condition pytestmark = pytest.mark.asyncio(loop_scope="module") @@ -137,6 +137,10 @@ async def test_should_call_rpc_ping_with_typed_params_and_result(self, ctx: E2ET assert result.message == "pong: typed rpc test" assert result.timestamp is not None + @pytest.mark.skipif( + is_inprocess_transport(), + reason="managedSettings.clearCache is unavailable in the in-process host", + ) async def test_should_clear_the_managed_settings_cache(self, ctx: E2ETestContext): await ctx.client.start() assert await ctx.client.rpc.managed_settings.clear_cache() is None diff --git a/rust/tests/e2e/rpc_server.rs b/rust/tests/e2e/rpc_server.rs index a3bb58e286..628d5597c5 100644 --- a/rust/tests/e2e/rpc_server.rs +++ b/rust/tests/e2e/rpc_server.rs @@ -48,8 +48,10 @@ async fn should_call_rpc_ping_with_typed_params_and_result() { #[tokio::test] async fn should_clear_the_managed_settings_cache() { - super::support::with_shared_e2e_context( - &E2E, + if super::support::skip_inprocess("managedSettings.clearCache is unavailable in-process") { + return; + } + with_e2e_context( "rpc_server", "should_clear_the_managed_settings_cache", |ctx| { @@ -915,4 +917,4 @@ fn paths_equal(left: &str, right: &str) -> bool { normalize(left) == normalize(right) } static E2E: super::support::SharedE2eGroup = - super::support::SharedE2eGroup::standard("rpc_server", 12); + super::support::SharedE2eGroup::standard("rpc_server", 11); From 7e3ed43fb8de860d5ba199bb6b478467d78cfad7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Sep 2026 17:42:54 +0000 Subject: [PATCH 13/14] Regenerate Java codegen output Auto-committed by java-codegen-check workflow. --- .../copilot/generated/rpc/SessionModelSwitchAutoTierParams.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java index 576df55aa1..dfa020c034 100644 --- a/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java +++ b/java/sdk/src/generated/java/com/github/copilot/generated/rpc/SessionModelSwitchAutoTierParams.java @@ -27,6 +27,7 @@ public record SessionModelSwitchAutoTierParams( /** Target session identifier */ @JsonProperty("sessionId") String sessionId, /** Auto preference to activate when a future user turn using the `auto` model safely mints a replacement model and token pair. Pass null to return to provider-default Auto routing. */ + @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("autoTier") AutoTier autoTier, /** Origin to record on the effective `session.model_change` event. Defaults to `sdk` when omitted. */ @JsonProperty("source") ModelChangeSource source From 0d85463593233a35218035d862d15521db3706e0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Sep 2026 18:15:13 +0000 Subject: [PATCH 14/14] Fix duplicate Rust MCP config field Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com> --- rust/tests/e2e/rpc_mcp_config.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rust/tests/e2e/rpc_mcp_config.rs b/rust/tests/e2e/rpc_mcp_config.rs index 0175d0baab..b3c91fc180 100644 --- a/rust/tests/e2e/rpc_mcp_config.rs +++ b/rust/tests/e2e/rpc_mcp_config.rs @@ -19,7 +19,6 @@ async fn should_call_server_mcp_config_rpcs() { .remove(McpConfigRemoveRequest { auth_client_id_metadata_url: None, name: server_name.to_string(), - auth_client_id_metadata_url: None, }) .await; @@ -77,7 +76,6 @@ async fn should_call_server_mcp_config_rpcs() { .remove(McpConfigRemoveRequest { auth_client_id_metadata_url: None, name: server_name.to_string(), - auth_client_id_metadata_url: None, }) .await .expect("remove"); @@ -107,7 +105,6 @@ async fn should_round_trip_http_mcp_oauth_config_rpc() { .remove(McpConfigRemoveRequest { auth_client_id_metadata_url: None, name: server_name.to_string(), - auth_client_id_metadata_url: None, }) .await; @@ -204,7 +201,6 @@ async fn should_round_trip_http_mcp_oauth_config_rpc() { .remove(McpConfigRemoveRequest { auth_client_id_metadata_url: None, name: server_name.to_string(), - auth_client_id_metadata_url: None, }) .await .expect("remove");