@github/copilot-sdk 1.0.3 → 1.0.5-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,14 @@
3
3
  * Generated from: api.schema.json
4
4
  */
5
5
  import type { MessageConnection } from "vscode-jsonrpc/node.js";
6
- import type { AbortReason, Attachment, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpServerSource, McpServerStatus, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionMode, ShutdownType, SkillSource, UserToolSessionApproval } from "./session-events.js";
6
+ import type { AbortReason, Attachment, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpServerSource, McpServerStatus, PermissionPromptRequest, PermissionRule, ReasoningSummary, ResponseBudgetConfig, SessionEvent, SessionMode, ShutdownType, SkillSource, UserToolSessionApproval } from "./session-events.js";
7
+ /**
8
+ * Initial authentication info for the session.
9
+ *
10
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
11
+ * via the `definition` "AuthInfo".
12
+ */
13
+ export type AuthInfo = HMACAuthInfo | EnvAuthInfo | TokenAuthInfo | CopilotApiTokenAuthInfo | UserAuthInfo | GhCliAuthInfo | ApiKeyAuthInfo;
7
14
  /**
8
15
  * Which tier this directory belongs to
9
16
  *
@@ -166,14 +173,6 @@ export type AgentRegistrySpawnValidationErrorField =
166
173
  | "model"
167
174
  /** The permissionMode parameter */
168
175
  | "permissionMode";
169
- /**
170
- * Initial authentication info for the session.
171
- *
172
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
173
- * via the `definition` "AuthInfo".
174
- */
175
- /** @experimental */
176
- export type AuthInfo = HMACAuthInfo | EnvAuthInfo | TokenAuthInfo | CopilotApiTokenAuthInfo | UserAuthInfo | GhCliAuthInfo | ApiKeyAuthInfo;
177
176
  /**
178
177
  * Authentication type
179
178
  *
@@ -196,18 +195,6 @@ export type AuthInfoType =
196
195
  | "token"
197
196
  /** Authentication from a Copilot API token. */
198
197
  | "copilot-api-token";
199
- /**
200
- * Runtime-controlled routing state for an open canvas instance.
201
- *
202
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
203
- * via the `definition` "CanvasInstanceAvailability".
204
- */
205
- /** @experimental */
206
- export type CanvasInstanceAvailability =
207
- /** The owning provider is currently connected and routing calls will be dispatched normally. */
208
- "ready"
209
- /** The owning provider is not currently connected. Routing calls fail with canvas_provider_unavailable until the agent re-issues open_canvas (which rehydrates via a fresh canvas.open) or the provider reconnects. */
210
- | "stale";
211
198
  /**
212
199
  * Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command
213
200
  *
@@ -479,6 +466,7 @@ export type InstructionSourceLocation =
479
466
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
480
467
  * via the `definition` "LlmInferenceHttpRequestStartTransport".
481
468
  */
469
+ /** @experimental */
482
470
  export type LlmInferenceHttpRequestStartTransport =
483
471
  /** 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. */
484
472
  "http"
@@ -665,6 +653,24 @@ export type McpServerConfigHttpOauthGrantType =
665
653
  "authorization_code"
666
654
  /** Headless client credentials flow using the configured OAuth client. */
667
655
  | "client_credentials";
656
+ /**
657
+ * Host response: supply dynamic headers or decline this refresh.
658
+ *
659
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
660
+ * via the `definition` "McpHeadersHandlePendingHeadersRefreshRequest".
661
+ */
662
+ /** @experimental */
663
+ export type McpHeadersHandlePendingHeadersRefreshRequest = {
664
+ /**
665
+ * Headers to overlay onto the MCP request. Dynamic headers override static config headers but do not replace SDK-managed request headers.
666
+ */
667
+ headers: {
668
+ [k: string]: string | undefined;
669
+ };
670
+ kind: "headers";
671
+ } | {
672
+ kind: "none";
673
+ };
668
674
  /**
669
675
  * Host response to the pending OAuth request.
670
676
  *
@@ -681,10 +687,6 @@ export type McpOauthPendingRequestResponse = {
681
687
  * OAuth token type. Defaults to Bearer when omitted.
682
688
  */
683
689
  tokenType?: string;
684
- /**
685
- * Refresh token supplied by the host, if available.
686
- */
687
- refreshToken?: string;
688
690
  /**
689
691
  * Token lifetime in seconds, if known.
690
692
  */
@@ -693,6 +695,18 @@ export type McpOauthPendingRequestResponse = {
693
695
  } | {
694
696
  kind: "cancelled";
695
697
  };
698
+ /**
699
+ * OAuth grant type override for this login.
700
+ *
701
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
702
+ * via the `definition` "McpOauthLoginGrantType".
703
+ */
704
+ /** @experimental */
705
+ export type McpOauthLoginGrantType =
706
+ /** Interactive browser-based OAuth flow using an authorization code, typically with PKCE. */
707
+ "authorization_code"
708
+ /** Headless OAuth flow where a confidential client authenticates directly with a client secret. */
709
+ | "client_credentials";
696
710
  /**
697
711
  * Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution.
698
712
  *
@@ -873,6 +887,18 @@ export type ProviderConfigWireApi =
873
887
  "completions"
874
888
  /** OpenAI Responses API wire format. */
875
889
  | "responses";
890
+ /**
891
+ * Provider transport. Defaults to "http".
892
+ *
893
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
894
+ * via the `definition` "ProviderConfigTransport".
895
+ */
896
+ /** @experimental */
897
+ export type ProviderConfigTransport =
898
+ /** HTTP request/streaming transport. */
899
+ "http"
900
+ /** WebSocket transport. */
901
+ | "websockets";
876
902
  /**
877
903
  * Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration.
878
904
  *
@@ -1061,6 +1087,18 @@ export type ProviderEndpointWireApi =
1061
1087
  "completions"
1062
1088
  /** Newer responses request shape. */
1063
1089
  | "responses";
1090
+ /**
1091
+ * Transport to be used for provider requests.
1092
+ *
1093
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1094
+ * via the `definition` "ProviderEndpointTransport".
1095
+ */
1096
+ /** @experimental */
1097
+ export type ProviderEndpointTransport =
1098
+ /** HTTP request/streaming transport. */
1099
+ "http"
1100
+ /** WebSocket transport. */
1101
+ | "websockets";
1064
1102
  /**
1065
1103
  * Schema for the `PushAttachment` type.
1066
1104
  *
@@ -1068,7 +1106,7 @@ export type ProviderEndpointWireApi =
1068
1106
  * via the `definition` "PushAttachment".
1069
1107
  */
1070
1108
  /** @experimental */
1071
- export type PushAttachment = PushAttachmentFile | PushAttachmentDirectory | PushAttachmentSelection | PushAttachmentGitHubReference | PushAttachmentBlob | ExtensionContextPushInput;
1109
+ export type PushAttachment = PushAttachmentFile | PushAttachmentDirectory | PushAttachmentSelection | PushAttachmentGitHubReference | PushAttachmentGitHubCommit | PushAttachmentGitHubRelease | PushAttachmentGitHubActionsJob | PushAttachmentGitHubRepository | PushAttachmentGitHubFileDiff | PushAttachmentGitHubTreeComparison | PushAttachmentGitHubUrl | PushAttachmentGitHubFile | PushAttachmentGitHubSnippet | PushAttachmentBlob | ExtensionContextPushInput;
1072
1110
  /**
1073
1111
  * Type of GitHub reference
1074
1112
  *
@@ -1463,7 +1501,7 @@ export type SkillDiscoveryScope =
1463
1501
  /** A configured custom skill directory. */
1464
1502
  | "custom";
1465
1503
  /**
1466
- * Result of invoking the slash command (text output, prompt to send to the agent, or completion).
1504
+ * Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection).
1467
1505
  *
1468
1506
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1469
1507
  * via the `definition` "SlashCommandInvocationResult".
@@ -1488,6 +1526,14 @@ export type SubagentSettings = {
1488
1526
  * Names of subagents the user has turned off; they cannot be dispatched
1489
1527
  */
1490
1528
  disabledSubagents?: string[];
1529
+ /**
1530
+ * Maximum number of subagents that can run concurrently; applies to usage-based billing users only
1531
+ */
1532
+ maxConcurrency?: number;
1533
+ /**
1534
+ * Maximum subagent nesting depth; applies to usage-based billing users only
1535
+ */
1536
+ maxDepth?: number;
1491
1537
  } | null;
1492
1538
  /**
1493
1539
  * Context tier override for matching subagents
@@ -1676,7 +1722,9 @@ export type WorkspaceDiffMode =
1676
1722
  /** Return staged, unstaged, and untracked working tree changes. */
1677
1723
  "unstaged"
1678
1724
  /** Return changes compared with the default branch. */
1679
- | "branch";
1725
+ | "branch"
1726
+ /** Return the cumulative diff of files Copilot changed this session (used in non-git workspaces). */
1727
+ | "session";
1680
1728
  /**
1681
1729
  * Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration.
1682
1730
  *
@@ -1689,6 +1737,13 @@ export type WorkspacesWorkspaceDetailsHostType =
1689
1737
  "github"
1690
1738
  /** Workspace repository is hosted on Azure DevOps. */
1691
1739
  | "ado";
1740
+ /**
1741
+ * List of all authenticated users
1742
+ *
1743
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1744
+ * via the `definition` "AccountGetAllUsersResult".
1745
+ */
1746
+ export type AccountGetAllUsersResult = AccountAllUsers[];
1692
1747
  /**
1693
1748
  * Parameters for aborting the current turn
1694
1749
  *
@@ -1716,793 +1771,859 @@ export interface AbortResult {
1716
1771
  */
1717
1772
  error?: string;
1718
1773
  }
1719
- export interface AccountGetQuotaRequest {
1720
- /**
1721
- * GitHub token for per-user quota lookup. When provided, resolves this token to determine the user's quota instead of using the global auth.
1722
- */
1723
- gitHubToken?: string;
1724
- }
1725
1774
  /**
1726
- * Quota usage snapshots for the resolved user, keyed by quota type.
1775
+ * Schema for the `AccountAllUsers` type.
1727
1776
  *
1728
1777
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1729
- * via the `definition` "AccountGetQuotaResult".
1778
+ * via the `definition` "AccountAllUsers".
1730
1779
  */
1731
- export interface AccountGetQuotaResult {
1780
+ export interface AccountAllUsers {
1781
+ authInfo: AuthInfo;
1732
1782
  /**
1733
- * Quota snapshots keyed by type (e.g., chat, completions, premium_interactions)
1783
+ * Associated token, if available
1734
1784
  */
1735
- quotaSnapshots: {
1736
- [k: string]: AccountQuotaSnapshot | undefined;
1737
- };
1785
+ token?: string;
1738
1786
  }
1739
1787
  /**
1740
- * Schema for the `AccountQuotaSnapshot` type.
1788
+ * Schema for the `HMACAuthInfo` type.
1741
1789
  *
1742
1790
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1743
- * via the `definition` "AccountQuotaSnapshot".
1791
+ * via the `definition` "HMACAuthInfo".
1744
1792
  */
1745
- export interface AccountQuotaSnapshot {
1746
- /**
1747
- * Whether the user has an unlimited usage entitlement
1748
- */
1749
- isUnlimitedEntitlement: boolean;
1750
- /**
1751
- * Number of requests included in the entitlement, or -1 for unlimited entitlements
1752
- */
1753
- entitlementRequests: number;
1754
- /**
1755
- * Number of requests used so far this period
1756
- */
1757
- usedRequests: number;
1758
- /**
1759
- * Whether usage is still permitted after quota exhaustion
1760
- */
1761
- usageAllowedWithExhaustedQuota: boolean;
1762
- /**
1763
- * Percentage of entitlement remaining
1764
- */
1765
- remainingPercentage: number;
1793
+ export interface HMACAuthInfo {
1766
1794
  /**
1767
- * Number of additional usage requests made this period
1795
+ * HMAC-based authentication used by GitHub-internal services.
1768
1796
  */
1769
- overage: number;
1797
+ type: "hmac";
1770
1798
  /**
1771
- * Whether additional usage is allowed when quota is exhausted
1799
+ * Authentication host. HMAC auth always targets the public GitHub host.
1772
1800
  */
1773
- overageAllowedWithExhaustedQuota: boolean;
1801
+ host: "https://github.com";
1774
1802
  /**
1775
- * Date when the quota resets (ISO 8601 string)
1803
+ * HMAC secret used to sign requests.
1776
1804
  */
1777
- resetDate?: string;
1805
+ hmac: string;
1806
+ copilotUser?: CopilotUserResponse;
1778
1807
  }
1779
1808
  /**
1780
- * Schema for the `AgentDiscoveryPath` type.
1809
+ * 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.
1781
1810
  *
1782
1811
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1783
- * via the `definition` "AgentDiscoveryPath".
1812
+ * via the `definition` "CopilotUserResponse".
1784
1813
  */
1785
- /** @experimental */
1786
- export interface AgentDiscoveryPath {
1787
- /**
1788
- * Absolute path of the search/create directory (may not exist on disk yet)
1789
- */
1790
- path: string;
1791
- scope: AgentDiscoveryPathScope;
1792
- /**
1793
- * Whether this is the canonical directory to create a new agent in its tier. At most one entry per tier is preferred.
1794
- */
1795
- preferredForCreation: boolean;
1796
- /**
1797
- * The input project path this directory was derived from (only for project scope)
1798
- */
1799
- projectPath?: string;
1814
+ export interface CopilotUserResponse {
1815
+ login?: string;
1816
+ access_type_sku?: string;
1817
+ analytics_tracking_id?: string;
1818
+ assigned_date?: ({
1819
+ [k: string]: unknown | undefined;
1820
+ } | string) | null;
1821
+ can_signup_for_limited?: boolean;
1822
+ chat_enabled?: boolean;
1823
+ copilot_plan?: string;
1824
+ copilotignore_enabled?: boolean;
1825
+ endpoints?: CopilotUserResponseEndpoints;
1826
+ organization_login_list?: string[];
1827
+ organization_list?: ({
1828
+ [k: string]: unknown | undefined;
1829
+ } | ({
1830
+ login?: ({
1831
+ [k: string]: unknown | undefined;
1832
+ } | string) | null;
1833
+ name?: ({
1834
+ [k: string]: unknown | undefined;
1835
+ } | string) | null;
1836
+ } | null)[]) | null;
1837
+ codex_agent_enabled?: boolean;
1838
+ is_mcp_enabled?: ({
1839
+ [k: string]: unknown | undefined;
1840
+ } | boolean) | null;
1841
+ quota_reset_date?: string;
1842
+ quota_snapshots?: CopilotUserResponseQuotaSnapshots;
1843
+ restricted_telemetry?: boolean;
1844
+ is_staff?: boolean;
1845
+ token_based_billing?: boolean;
1846
+ can_upgrade_plan?: boolean;
1847
+ quota_reset_date_utc?: string;
1848
+ limited_user_quotas?: {
1849
+ [k: string]: number | undefined;
1850
+ };
1851
+ limited_user_reset_date?: string;
1852
+ monthly_quotas?: {
1853
+ [k: string]: number | undefined;
1854
+ };
1855
+ cloud_session_storage_enabled?: boolean;
1856
+ cli_remote_control_enabled?: boolean;
1800
1857
  }
1801
1858
  /**
1802
- * Canonical locations where custom agents can be created so the runtime will recognize them.
1859
+ * Schema for the `CopilotUserResponseEndpoints` type.
1803
1860
  *
1804
1861
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1805
- * via the `definition` "AgentDiscoveryPathList".
1862
+ * via the `definition` "CopilotUserResponseEndpoints".
1806
1863
  */
1807
- /** @experimental */
1808
- export interface AgentDiscoveryPathList {
1809
- /**
1810
- * Canonical agent create/discovery directories, in priority order
1811
- */
1812
- paths: AgentDiscoveryPath[];
1864
+ export interface CopilotUserResponseEndpoints {
1865
+ api?: string;
1866
+ "origin-tracker"?: string;
1867
+ proxy?: string;
1868
+ telemetry?: string;
1813
1869
  }
1814
1870
  /**
1815
- * The currently selected custom agent, or null when using the default agent.
1871
+ * Schema for the `CopilotUserResponseQuotaSnapshots` type.
1816
1872
  *
1817
1873
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1818
- * via the `definition` "AgentGetCurrentResult".
1874
+ * via the `definition` "CopilotUserResponseQuotaSnapshots".
1819
1875
  */
1820
- /** @experimental */
1821
- export interface AgentGetCurrentResult {
1822
- /**
1823
- * Currently selected custom agent, or null if using the default agent
1824
- */
1825
- agent?: AgentInfo | null;
1876
+ export interface CopilotUserResponseQuotaSnapshots {
1877
+ chat?: CopilotUserResponseQuotaSnapshotsChat;
1878
+ completions?: CopilotUserResponseQuotaSnapshotsCompletions;
1879
+ premium_interactions?: CopilotUserResponseQuotaSnapshotsPremiumInteractions;
1880
+ [k: string]: ({
1881
+ entitlement?: number;
1882
+ overage_count?: number;
1883
+ overage_permitted?: boolean;
1884
+ percent_remaining?: number;
1885
+ quota_id?: string;
1886
+ quota_remaining?: number;
1887
+ remaining?: number;
1888
+ unlimited?: boolean;
1889
+ timestamp_utc?: string;
1890
+ has_quota?: boolean;
1891
+ quota_reset_at?: number;
1892
+ token_based_billing?: boolean;
1893
+ } | null) | undefined;
1826
1894
  }
1827
1895
  /**
1828
- * Schema for the `AgentInfo` type.
1896
+ * Schema for the `CopilotUserResponseQuotaSnapshotsChat` type.
1829
1897
  *
1830
1898
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1831
- * via the `definition` "AgentInfo".
1899
+ * via the `definition` "CopilotUserResponseQuotaSnapshotsChat".
1832
1900
  */
1833
- /** @experimental */
1834
- export interface AgentInfo {
1835
- /**
1836
- * Unique identifier of the custom agent
1837
- */
1838
- name: string;
1839
- /**
1840
- * Human-readable display name
1841
- */
1842
- displayName: string;
1843
- /**
1844
- * Description of the agent's purpose
1845
- */
1846
- description: string;
1847
- /**
1848
- * Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path.
1849
- */
1850
- path?: string;
1851
- /**
1852
- * 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.
1853
- */
1854
- id: string;
1855
- source?: AgentInfoSource;
1856
- /**
1857
- * Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only.
1858
- */
1859
- userInvocable?: boolean;
1860
- /**
1861
- * Allowed tool names for this agent. Empty array means none; omitted means inherit defaults.
1862
- */
1863
- tools?: string[];
1864
- /**
1865
- * Preferred model id for this agent. When omitted, inherits the outer agent's model.
1866
- */
1867
- model?: string;
1868
- /**
1869
- * MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema.
1870
- *
1871
- * @experimental
1872
- */
1873
- mcpServers?: {
1874
- [k: string]: unknown | undefined;
1875
- };
1876
- /**
1877
- * Skill names preloaded into this agent's context. Omitted means none.
1878
- */
1879
- skills?: string[];
1901
+ export interface CopilotUserResponseQuotaSnapshotsChat {
1902
+ entitlement?: number;
1903
+ overage_count?: number;
1904
+ overage_permitted?: boolean;
1905
+ percent_remaining?: number;
1906
+ quota_id?: string;
1907
+ quota_remaining?: number;
1908
+ remaining?: number;
1909
+ unlimited?: boolean;
1910
+ timestamp_utc?: string;
1911
+ has_quota?: boolean;
1912
+ quota_reset_at?: number;
1913
+ token_based_billing?: boolean;
1880
1914
  }
1881
1915
  /**
1882
- * Custom agents available to the session.
1916
+ * Schema for the `CopilotUserResponseQuotaSnapshotsCompletions` type.
1883
1917
  *
1884
1918
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1885
- * via the `definition` "AgentList".
1919
+ * via the `definition` "CopilotUserResponseQuotaSnapshotsCompletions".
1886
1920
  */
1887
- /** @experimental */
1888
- export interface AgentList {
1889
- /**
1890
- * Available custom agents
1891
- */
1892
- agents: AgentInfo[];
1921
+ export interface CopilotUserResponseQuotaSnapshotsCompletions {
1922
+ entitlement?: number;
1923
+ overage_count?: number;
1924
+ overage_permitted?: boolean;
1925
+ percent_remaining?: number;
1926
+ quota_id?: string;
1927
+ quota_remaining?: number;
1928
+ remaining?: number;
1929
+ unlimited?: boolean;
1930
+ timestamp_utc?: string;
1931
+ has_quota?: boolean;
1932
+ quota_reset_at?: number;
1933
+ token_based_billing?: boolean;
1893
1934
  }
1894
1935
  /**
1895
- * Full registry entry for the spawned child. Lets the controller call `handleLiveTargetSelected(entry)` directly without re-reading the registry (avoids a TOCTOU window).
1936
+ * Schema for the `CopilotUserResponseQuotaSnapshotsPremiumInteractions` type.
1896
1937
  *
1897
1938
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1898
- * via the `definition` "AgentRegistryLiveTargetEntry".
1939
+ * via the `definition` "CopilotUserResponseQuotaSnapshotsPremiumInteractions".
1899
1940
  */
1900
- /** @experimental */
1901
- export interface AgentRegistryLiveTargetEntry {
1902
- /**
1903
- * Registry entry schema version (1 = ui-server, 2 = managed-server)
1904
- */
1905
- schemaVersion: number;
1906
- kind: AgentRegistryLiveTargetEntryKind;
1941
+ export interface CopilotUserResponseQuotaSnapshotsPremiumInteractions {
1942
+ entitlement?: number;
1943
+ overage_count?: number;
1944
+ overage_permitted?: boolean;
1945
+ percent_remaining?: number;
1946
+ quota_id?: string;
1947
+ quota_remaining?: number;
1948
+ remaining?: number;
1949
+ unlimited?: boolean;
1950
+ timestamp_utc?: string;
1951
+ has_quota?: boolean;
1952
+ quota_reset_at?: number;
1953
+ token_based_billing?: boolean;
1954
+ }
1955
+ /**
1956
+ * Schema for the `EnvAuthInfo` type.
1957
+ *
1958
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1959
+ * via the `definition` "EnvAuthInfo".
1960
+ */
1961
+ export interface EnvAuthInfo {
1907
1962
  /**
1908
- * Operating-system pid of the process owning this entry
1963
+ * Personal access token (PAT) or server-to-server token sourced from an environment variable.
1909
1964
  */
1910
- pid: number;
1965
+ type: "env";
1911
1966
  /**
1912
- * Bind host for the entry's JSON-RPC server
1967
+ * Authentication host (e.g. https://github.com or a GHES host).
1913
1968
  */
1914
1969
  host: string;
1915
1970
  /**
1916
- * TCP port the entry's JSON-RPC server is listening on
1917
- */
1918
- port: number;
1919
- /**
1920
- * Session ID of the foreground session for this entry
1921
- */
1922
- sessionId?: string;
1923
- /**
1924
- * Friendly session name (when set)
1925
- */
1926
- sessionName?: string;
1927
- /**
1928
- * Working directory of the session (when known)
1929
- */
1930
- cwd?: string;
1931
- /**
1932
- * Git branch of the session (when known)
1933
- */
1934
- branch?: string;
1935
- /**
1936
- * Model identifier currently selected for the session
1937
- */
1938
- model?: string;
1939
- status?: AgentRegistryLiveTargetEntryStatus;
1940
- attentionKind?: AgentRegistryLiveTargetEntryAttentionKind;
1941
- /**
1942
- * Monotonic per-publisher revision counter incremented on every status update. Lets watchers detect transient flips.
1943
- */
1944
- statusRevision?: number;
1945
- lastTerminalEvent?: AgentRegistryLiveTargetEntryLastTerminalEvent;
1946
- /**
1947
- * ISO 8601 timestamp captured at registration
1971
+ * User login associated with the token. Undefined for server-to-server tokens (those starting with `ghs_`).
1948
1972
  */
1949
- startedAt: string;
1973
+ login?: string;
1950
1974
  /**
1951
- * Copilot CLI version that wrote the entry
1975
+ * The token value itself. Treat as a secret.
1952
1976
  */
1953
- copilotVersion: string;
1977
+ token: string;
1954
1978
  /**
1955
- * Wall-clock milliseconds since the watcher last observed this entry (heartbeat freshness)
1979
+ * Name of the environment variable the token was sourced from.
1956
1980
  */
1957
- lastSeenMs: number;
1981
+ envVar: string;
1982
+ copilotUser?: CopilotUserResponse;
1958
1983
  }
1959
1984
  /**
1960
- * Per-spawn log-capture outcome; populated from spawnLiveTarget.
1985
+ * Schema for the `TokenAuthInfo` type.
1961
1986
  *
1962
1987
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1963
- * via the `definition` "AgentRegistryLogCapture".
1988
+ * via the `definition` "TokenAuthInfo".
1964
1989
  */
1965
- /** @experimental */
1966
- export interface AgentRegistryLogCapture {
1990
+ export interface TokenAuthInfo {
1967
1991
  /**
1968
- * Whether per-spawn log capture is on (false when env-disabled or open failed)
1992
+ * SDK-side token authentication; the host configured the token directly via the SDK.
1969
1993
  */
1970
- enabled: boolean;
1994
+ type: "token";
1971
1995
  /**
1972
- * Absolute path to the per-spawn log file (only set when enabled)
1996
+ * Authentication host.
1973
1997
  */
1974
- path?: string;
1998
+ host: string;
1975
1999
  /**
1976
- * Human-readable open failure message (only set when enabled === false AND the env-disable opt-out was NOT used)
2000
+ * The token value itself. Treat as a secret.
1977
2001
  */
1978
- openError?: string;
1979
- openErrorReason?: AgentRegistryLogCaptureOpenErrorReason;
2002
+ token: string;
2003
+ copilotUser?: CopilotUserResponse;
1980
2004
  }
1981
2005
  /**
1982
- * `child_process.spawn` itself failed before the child entered the registry.
2006
+ * Schema for the `CopilotApiTokenAuthInfo` type.
1983
2007
  *
1984
2008
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
1985
- * via the `definition` "AgentRegistrySpawnError".
2009
+ * via the `definition` "CopilotApiTokenAuthInfo".
1986
2010
  */
1987
- /** @experimental */
1988
- export interface AgentRegistrySpawnError {
1989
- /**
1990
- * Discriminator: child_process.spawn itself failed
1991
- */
1992
- kind: "spawn-error";
2011
+ export interface CopilotApiTokenAuthInfo {
1993
2012
  /**
1994
- * Human-readable error message
2013
+ * 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.
1995
2014
  */
1996
- message: string;
2015
+ type: "copilot-api-token";
1997
2016
  /**
1998
- * Underlying errno code (e.g. ENOENT, EACCES) when available
2017
+ * Authentication host (always the public GitHub host).
1999
2018
  */
2000
- code?: string;
2019
+ host: "https://github.com";
2020
+ copilotUser?: CopilotUserResponse;
2001
2021
  }
2002
2022
  /**
2003
- * Spawn succeeded but the child did not publish a matching managed-server entry within the timeout.
2023
+ * Schema for the `UserAuthInfo` type.
2004
2024
  *
2005
2025
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2006
- * via the `definition` "AgentRegistrySpawnRegistryTimeout".
2026
+ * via the `definition` "UserAuthInfo".
2007
2027
  */
2008
- /** @experimental */
2009
- export interface AgentRegistrySpawnRegistryTimeout {
2028
+ export interface UserAuthInfo {
2010
2029
  /**
2011
- * Discriminator: spawn succeeded but child never registered
2030
+ * 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.
2012
2031
  */
2013
- kind: "registry-timeout";
2032
+ type: "user";
2014
2033
  /**
2015
- * Process ID of the orphaned child (so the caller can offer 'kill the pid' guidance)
2034
+ * Authentication host.
2016
2035
  */
2017
- childPid: number;
2018
- logCapture?: AgentRegistryLogCapture;
2036
+ host: string;
2037
+ /**
2038
+ * OAuth user login.
2039
+ */
2040
+ login: string;
2041
+ copilotUser?: CopilotUserResponse;
2019
2042
  }
2020
2043
  /**
2021
- * Inputs to spawn a managed-server child via the controller's spawn delegate.
2044
+ * Schema for the `GhCliAuthInfo` type.
2022
2045
  *
2023
2046
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2024
- * via the `definition` "AgentRegistrySpawnRequest".
2047
+ * via the `definition` "GhCliAuthInfo".
2025
2048
  */
2026
- /** @experimental */
2027
- export interface AgentRegistrySpawnRequest {
2028
- /**
2029
- * Working directory for the spawned child (must be an existing directory)
2030
- */
2031
- cwd: string;
2049
+ export interface GhCliAuthInfo {
2032
2050
  /**
2033
- * Custom or built-in agent name (e.g. 'explore'). When omitted, the child uses its own default.
2051
+ * Authentication via the `gh` CLI's saved credentials.
2034
2052
  */
2035
- agentName?: string;
2053
+ type: "gh-cli";
2036
2054
  /**
2037
- * Model identifier to apply to the new session
2055
+ * Authentication host.
2038
2056
  */
2039
- model?: string;
2057
+ host: string;
2040
2058
  /**
2041
- * Friendly session name. Must satisfy validateSessionName: non-empty, no leading/trailing whitespace, <=100 chars, no control chars, no double quotes.
2059
+ * User login as reported by `gh auth status`.
2042
2060
  */
2043
- name?: string;
2044
- permissionMode?: AgentRegistrySpawnPermissionMode;
2061
+ login: string;
2045
2062
  /**
2046
- * Optional first user message. Forwarded to the caller (the CLI's spawn wrapper sends it post-attach via the standard LocalRpcSession.send path).
2063
+ * The token returned by `gh auth token`. Treat as a secret.
2047
2064
  */
2048
- initialPrompt?: string;
2065
+ token: string;
2066
+ copilotUser?: CopilotUserResponse;
2049
2067
  }
2050
2068
  /**
2051
- * Managed-server child was spawned and registered successfully.
2069
+ * Schema for the `ApiKeyAuthInfo` type.
2052
2070
  *
2053
2071
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2054
- * via the `definition` "AgentRegistrySpawnSpawned".
2072
+ * via the `definition` "ApiKeyAuthInfo".
2055
2073
  */
2056
- /** @experimental */
2057
- export interface AgentRegistrySpawnSpawned {
2074
+ export interface ApiKeyAuthInfo {
2058
2075
  /**
2059
- * Discriminator: managed-server child spawned successfully
2076
+ * API-key authentication for non-GitHub LLM providers (e.g. when running BYOM-style).
2060
2077
  */
2061
- kind: "spawned";
2062
- entry: AgentRegistryLiveTargetEntry;
2078
+ type: "api-key";
2063
2079
  /**
2064
- * 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.
2080
+ * The API key. Treat as a secret.
2065
2081
  */
2066
- initialPromptSent?: boolean;
2082
+ apiKey: string;
2067
2083
  /**
2068
- * If the delegate attempted to send the initial prompt and failed, the categorized error message.
2084
+ * Authentication host.
2069
2085
  */
2070
- initialPromptError?: string;
2071
- logCapture?: AgentRegistryLogCapture;
2086
+ host: string;
2087
+ copilotUser?: CopilotUserResponse;
2072
2088
  }
2073
2089
  /**
2074
- * Synchronous pre-validation rejected the spawn request.
2090
+ * Current authentication state
2075
2091
  *
2076
2092
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2077
- * via the `definition` "AgentRegistrySpawnValidationError".
2093
+ * via the `definition` "AccountGetCurrentAuthResult".
2078
2094
  */
2079
- /** @experimental */
2080
- export interface AgentRegistrySpawnValidationError {
2095
+ export interface AccountGetCurrentAuthResult {
2096
+ authInfo?: AuthInfo;
2081
2097
  /**
2082
- * Discriminator: synchronous pre-validation rejected the request
2098
+ * Authentication errors from the last auth attempt, if any
2083
2099
  */
2084
- kind: "validation-error";
2085
- reason: AgentRegistrySpawnValidationErrorReason;
2086
- field?: AgentRegistrySpawnValidationErrorField;
2087
- /**
2088
- * Human-readable explanation; safe to surface in the UI banner. Never logged to unrestricted telemetry.
2100
+ authErrors?: string[];
2101
+ }
2102
+ export interface AccountGetQuotaRequest {
2103
+ /**
2104
+ * GitHub token for per-user quota lookup. When provided, resolves this token to determine the user's quota instead of using the global auth.
2089
2105
  */
2090
- message: string;
2106
+ gitHubToken?: string;
2091
2107
  }
2092
2108
  /**
2093
- * Custom agents available to the session after reloading definitions from disk.
2109
+ * Quota usage snapshots for the resolved user, keyed by quota type.
2094
2110
  *
2095
2111
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2096
- * via the `definition` "AgentReloadResult".
2112
+ * via the `definition` "AccountGetQuotaResult".
2097
2113
  */
2098
- /** @experimental */
2099
- export interface AgentReloadResult {
2114
+ export interface AccountGetQuotaResult {
2100
2115
  /**
2101
- * Reloaded custom agents
2116
+ * Quota snapshots keyed by type (e.g., chat, completions, premium_interactions)
2102
2117
  */
2103
- agents: AgentInfo[];
2118
+ quotaSnapshots: {
2119
+ [k: string]: AccountQuotaSnapshot | undefined;
2120
+ };
2104
2121
  }
2105
2122
  /**
2106
- * Optional project paths to include in agent discovery.
2123
+ * Schema for the `AccountQuotaSnapshot` type.
2107
2124
  *
2108
2125
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2109
- * via the `definition` "AgentsDiscoverRequest".
2126
+ * via the `definition` "AccountQuotaSnapshot".
2110
2127
  */
2111
- /** @experimental */
2112
- export interface AgentsDiscoverRequest {
2128
+ export interface AccountQuotaSnapshot {
2113
2129
  /**
2114
- * 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).
2130
+ * Whether the user has an unlimited usage entitlement
2115
2131
  */
2116
- projectPaths?: string[];
2132
+ isUnlimitedEntitlement: boolean;
2117
2133
  /**
2118
- * 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.
2134
+ * Number of requests included in the entitlement, or -1 for unlimited entitlements
2119
2135
  */
2120
- excludeHostAgents?: boolean;
2136
+ entitlementRequests: number;
2137
+ /**
2138
+ * Number of requests used so far this period
2139
+ */
2140
+ usedRequests: number;
2141
+ /**
2142
+ * Whether usage is still permitted after quota exhaustion
2143
+ */
2144
+ usageAllowedWithExhaustedQuota: boolean;
2145
+ /**
2146
+ * Percentage of entitlement remaining
2147
+ */
2148
+ remainingPercentage: number;
2149
+ /**
2150
+ * Number of additional usage requests made this period
2151
+ */
2152
+ overage: number;
2153
+ /**
2154
+ * Whether additional usage is allowed when quota is exhausted
2155
+ */
2156
+ overageAllowedWithExhaustedQuota: boolean;
2157
+ /**
2158
+ * Date when the quota resets (ISO 8601 string)
2159
+ */
2160
+ resetDate?: string;
2121
2161
  }
2122
2162
  /**
2123
- * Name of the custom agent to select for subsequent turns.
2163
+ * Credentials to store after successful authentication
2124
2164
  *
2125
2165
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2126
- * via the `definition` "AgentSelectRequest".
2166
+ * via the `definition` "AccountLoginRequest".
2127
2167
  */
2128
- /** @experimental */
2129
- export interface AgentSelectRequest {
2168
+ export interface AccountLoginRequest {
2130
2169
  /**
2131
- * Name of the custom agent to select
2170
+ * GitHub host URL
2132
2171
  */
2133
- name: string;
2172
+ host: string;
2173
+ /**
2174
+ * User login/username
2175
+ */
2176
+ login: string;
2177
+ /**
2178
+ * GitHub authentication token
2179
+ */
2180
+ token: string;
2134
2181
  }
2135
2182
  /**
2136
- * The newly selected custom agent.
2183
+ * Result of a successful login; throws on failure
2137
2184
  *
2138
2185
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2139
- * via the `definition` "AgentSelectResult".
2186
+ * via the `definition` "AccountLoginResult".
2140
2187
  */
2141
- /** @experimental */
2142
- export interface AgentSelectResult {
2143
- agent: AgentInfo;
2188
+ export interface AccountLoginResult {
2189
+ /**
2190
+ * 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.
2191
+ */
2192
+ storedInVault: boolean;
2144
2193
  }
2145
2194
  /**
2146
- * Optional project paths to include when enumerating agent discovery directories.
2195
+ * User to log out
2147
2196
  *
2148
2197
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2149
- * via the `definition` "AgentsGetDiscoveryPathsRequest".
2198
+ * via the `definition` "AccountLogoutRequest".
2150
2199
  */
2151
- /** @experimental */
2152
- export interface AgentsGetDiscoveryPathsRequest {
2153
- /**
2154
- * Optional list of project directory paths. When omitted or empty, only the user-level directory is returned.
2155
- */
2156
- projectPaths?: string[];
2200
+ export interface AccountLogoutRequest {
2201
+ authInfo: AuthInfo;
2202
+ }
2203
+ /**
2204
+ * Logout result indicating if more users remain
2205
+ *
2206
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2207
+ * via the `definition` "AccountLogoutResult".
2208
+ */
2209
+ export interface AccountLogoutResult {
2157
2210
  /**
2158
- * When true, omit the host's user-level agent directory, leaving only project directories. For multitenant deployments (mirrors `discover`'s `excludeHostAgents`).
2211
+ * Whether other authenticated users remain after logout
2159
2212
  */
2160
- excludeHostAgents?: boolean;
2213
+ hasMoreUsers: boolean;
2161
2214
  }
2162
2215
  /**
2163
- * Indicates whether the operation succeeded and reports the post-mutation state.
2216
+ * Schema for the `AgentDiscoveryPath` type.
2164
2217
  *
2165
2218
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2166
- * via the `definition` "AllowAllPermissionSetResult".
2219
+ * via the `definition` "AgentDiscoveryPath".
2167
2220
  */
2168
2221
  /** @experimental */
2169
- export interface AllowAllPermissionSetResult {
2222
+ export interface AgentDiscoveryPath {
2170
2223
  /**
2171
- * Whether the operation succeeded
2224
+ * Absolute path of the search/create directory (may not exist on disk yet)
2172
2225
  */
2173
- success: boolean;
2226
+ path: string;
2227
+ scope: AgentDiscoveryPathScope;
2174
2228
  /**
2175
- * Authoritative allow-all state after the mutation
2229
+ * Whether this is the canonical directory to create a new agent in its tier. At most one entry per tier is preferred.
2176
2230
  */
2177
- enabled: boolean;
2231
+ preferredForCreation: boolean;
2232
+ /**
2233
+ * The input project path this directory was derived from (only for project scope)
2234
+ */
2235
+ projectPath?: string;
2178
2236
  }
2179
2237
  /**
2180
- * Current full allow-all permission state.
2238
+ * Canonical locations where custom agents can be created so the runtime will recognize them.
2181
2239
  *
2182
2240
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2183
- * via the `definition` "AllowAllPermissionState".
2241
+ * via the `definition` "AgentDiscoveryPathList".
2184
2242
  */
2185
2243
  /** @experimental */
2186
- export interface AllowAllPermissionState {
2244
+ export interface AgentDiscoveryPathList {
2187
2245
  /**
2188
- * Whether full allow-all permissions are currently active
2246
+ * Canonical agent create/discovery directories, in priority order
2189
2247
  */
2190
- enabled: boolean;
2248
+ paths: AgentDiscoveryPath[];
2191
2249
  }
2192
2250
  /**
2193
- * Schema for the `ApiKeyAuthInfo` type.
2251
+ * The currently selected custom agent, or null when using the default agent.
2194
2252
  *
2195
2253
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2196
- * via the `definition` "ApiKeyAuthInfo".
2254
+ * via the `definition` "AgentGetCurrentResult".
2197
2255
  */
2198
2256
  /** @experimental */
2199
- export interface ApiKeyAuthInfo {
2200
- /**
2201
- * API-key authentication for non-GitHub LLM providers (e.g. when running BYOM-style).
2202
- */
2203
- type: "api-key";
2204
- /**
2205
- * The API key. Treat as a secret.
2206
- */
2207
- apiKey: string;
2257
+ export interface AgentGetCurrentResult {
2208
2258
  /**
2209
- * Authentication host.
2259
+ * Currently selected custom agent, or null if using the default agent
2210
2260
  */
2211
- host: string;
2212
- copilotUser?: CopilotUserResponse;
2261
+ agent?: AgentInfo | null;
2213
2262
  }
2214
2263
  /**
2215
- * 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.
2264
+ * Schema for the `AgentInfo` type.
2216
2265
  *
2217
2266
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2218
- * via the `definition` "CopilotUserResponse".
2267
+ * via the `definition` "AgentInfo".
2219
2268
  */
2220
2269
  /** @experimental */
2221
- export interface CopilotUserResponse {
2222
- login?: string;
2223
- access_type_sku?: string;
2224
- analytics_tracking_id?: string;
2225
- assigned_date?: ({
2226
- [k: string]: unknown | undefined;
2227
- } | string) | null;
2228
- can_signup_for_limited?: boolean;
2229
- chat_enabled?: boolean;
2230
- copilot_plan?: string;
2231
- copilotignore_enabled?: boolean;
2232
- endpoints?: CopilotUserResponseEndpoints;
2233
- organization_login_list?: string[];
2234
- organization_list?: ({
2235
- [k: string]: unknown | undefined;
2236
- } | ({
2237
- login?: ({
2238
- [k: string]: unknown | undefined;
2239
- } | string) | null;
2240
- name?: ({
2241
- [k: string]: unknown | undefined;
2242
- } | string) | null;
2243
- } | null)[]) | null;
2244
- codex_agent_enabled?: boolean;
2245
- is_mcp_enabled?: ({
2270
+ export interface AgentInfo {
2271
+ /**
2272
+ * Unique identifier of the custom agent
2273
+ */
2274
+ name: string;
2275
+ /**
2276
+ * Human-readable display name
2277
+ */
2278
+ displayName: string;
2279
+ /**
2280
+ * Description of the agent's purpose
2281
+ */
2282
+ description: string;
2283
+ /**
2284
+ * Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path.
2285
+ */
2286
+ path?: string;
2287
+ /**
2288
+ * 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.
2289
+ */
2290
+ id: string;
2291
+ source?: AgentInfoSource;
2292
+ /**
2293
+ * Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only.
2294
+ */
2295
+ userInvocable?: boolean;
2296
+ /**
2297
+ * Allowed tool names for this agent. Empty array means none; omitted means inherit defaults.
2298
+ */
2299
+ tools?: string[];
2300
+ /**
2301
+ * Preferred model id for this agent. When omitted, inherits the outer agent's model.
2302
+ */
2303
+ model?: string;
2304
+ /**
2305
+ * MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema.
2306
+ *
2307
+ * @experimental
2308
+ */
2309
+ mcpServers?: {
2246
2310
  [k: string]: unknown | undefined;
2247
- } | boolean) | null;
2248
- quota_reset_date?: string;
2249
- quota_snapshots?: CopilotUserResponseQuotaSnapshots;
2250
- restricted_telemetry?: boolean;
2251
- is_staff?: boolean;
2252
- token_based_billing?: boolean;
2253
- can_upgrade_plan?: boolean;
2254
- quota_reset_date_utc?: string;
2255
- limited_user_quotas?: {
2256
- [k: string]: number | undefined;
2257
2311
  };
2258
- limited_user_reset_date?: string;
2259
- monthly_quotas?: {
2260
- [k: string]: number | undefined;
2261
- };
2262
- cloud_session_storage_enabled?: boolean;
2263
- cli_remote_control_enabled?: boolean;
2312
+ /**
2313
+ * Skill names preloaded into this agent's context. Omitted means none.
2314
+ */
2315
+ skills?: string[];
2264
2316
  }
2265
2317
  /**
2266
- * Schema for the `CopilotUserResponseEndpoints` type.
2318
+ * Custom agents available to the session.
2267
2319
  *
2268
2320
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2269
- * via the `definition` "CopilotUserResponseEndpoints".
2321
+ * via the `definition` "AgentList".
2270
2322
  */
2271
2323
  /** @experimental */
2272
- export interface CopilotUserResponseEndpoints {
2273
- api?: string;
2274
- "origin-tracker"?: string;
2275
- proxy?: string;
2276
- telemetry?: string;
2324
+ export interface AgentList {
2325
+ /**
2326
+ * Available custom agents
2327
+ */
2328
+ agents: AgentInfo[];
2277
2329
  }
2278
2330
  /**
2279
- * Schema for the `CopilotUserResponseQuotaSnapshots` type.
2331
+ * Full registry entry for the spawned child. Lets the controller call `handleLiveTargetSelected(entry)` directly without re-reading the registry (avoids a TOCTOU window).
2280
2332
  *
2281
2333
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2282
- * via the `definition` "CopilotUserResponseQuotaSnapshots".
2334
+ * via the `definition` "AgentRegistryLiveTargetEntry".
2283
2335
  */
2284
2336
  /** @experimental */
2285
- export interface CopilotUserResponseQuotaSnapshots {
2286
- chat?: CopilotUserResponseQuotaSnapshotsChat;
2287
- completions?: CopilotUserResponseQuotaSnapshotsCompletions;
2288
- premium_interactions?: CopilotUserResponseQuotaSnapshotsPremiumInteractions;
2289
- [k: string]: ({
2290
- entitlement?: number;
2291
- overage_count?: number;
2292
- overage_permitted?: boolean;
2293
- percent_remaining?: number;
2294
- quota_id?: string;
2295
- quota_remaining?: number;
2296
- remaining?: number;
2297
- unlimited?: boolean;
2298
- timestamp_utc?: string;
2299
- has_quota?: boolean;
2300
- quota_reset_at?: number;
2301
- token_based_billing?: boolean;
2302
- } | null) | undefined;
2337
+ export interface AgentRegistryLiveTargetEntry {
2338
+ /**
2339
+ * Registry entry schema version (1 = ui-server, 2 = managed-server)
2340
+ */
2341
+ schemaVersion: number;
2342
+ kind: AgentRegistryLiveTargetEntryKind;
2343
+ /**
2344
+ * Operating-system pid of the process owning this entry
2345
+ */
2346
+ pid: number;
2347
+ /**
2348
+ * Bind host for the entry's JSON-RPC server
2349
+ */
2350
+ host: string;
2351
+ /**
2352
+ * TCP port the entry's JSON-RPC server is listening on
2353
+ */
2354
+ port: number;
2355
+ /**
2356
+ * Session ID of the foreground session for this entry
2357
+ */
2358
+ sessionId?: string;
2359
+ /**
2360
+ * Friendly session name (when set)
2361
+ */
2362
+ sessionName?: string;
2363
+ /**
2364
+ * Working directory of the session (when known)
2365
+ */
2366
+ cwd?: string;
2367
+ /**
2368
+ * Git branch of the session (when known)
2369
+ */
2370
+ branch?: string;
2371
+ /**
2372
+ * Model identifier currently selected for the session
2373
+ */
2374
+ model?: string;
2375
+ status?: AgentRegistryLiveTargetEntryStatus;
2376
+ attentionKind?: AgentRegistryLiveTargetEntryAttentionKind;
2377
+ /**
2378
+ * Monotonic per-publisher revision counter incremented on every status update. Lets watchers detect transient flips.
2379
+ */
2380
+ statusRevision?: number;
2381
+ lastTerminalEvent?: AgentRegistryLiveTargetEntryLastTerminalEvent;
2382
+ /**
2383
+ * ISO 8601 timestamp captured at registration
2384
+ */
2385
+ startedAt: string;
2386
+ /**
2387
+ * Copilot CLI version that wrote the entry
2388
+ */
2389
+ copilotVersion: string;
2390
+ /**
2391
+ * Wall-clock milliseconds since the watcher last observed this entry (heartbeat freshness)
2392
+ */
2393
+ lastSeenMs: number;
2303
2394
  }
2304
2395
  /**
2305
- * Schema for the `CopilotUserResponseQuotaSnapshotsChat` type.
2396
+ * Per-spawn log-capture outcome; populated from spawnLiveTarget.
2306
2397
  *
2307
2398
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2308
- * via the `definition` "CopilotUserResponseQuotaSnapshotsChat".
2399
+ * via the `definition` "AgentRegistryLogCapture".
2309
2400
  */
2310
2401
  /** @experimental */
2311
- export interface CopilotUserResponseQuotaSnapshotsChat {
2312
- entitlement?: number;
2313
- overage_count?: number;
2314
- overage_permitted?: boolean;
2315
- percent_remaining?: number;
2316
- quota_id?: string;
2317
- quota_remaining?: number;
2318
- remaining?: number;
2319
- unlimited?: boolean;
2320
- timestamp_utc?: string;
2321
- has_quota?: boolean;
2322
- quota_reset_at?: number;
2323
- token_based_billing?: boolean;
2402
+ export interface AgentRegistryLogCapture {
2403
+ /**
2404
+ * Whether per-spawn log capture is on (false when env-disabled or open failed)
2405
+ */
2406
+ enabled: boolean;
2407
+ /**
2408
+ * Absolute path to the per-spawn log file (only set when enabled)
2409
+ */
2410
+ path?: string;
2411
+ /**
2412
+ * Human-readable open failure message (only set when enabled === false AND the env-disable opt-out was NOT used)
2413
+ */
2414
+ openError?: string;
2415
+ openErrorReason?: AgentRegistryLogCaptureOpenErrorReason;
2324
2416
  }
2325
2417
  /**
2326
- * Schema for the `CopilotUserResponseQuotaSnapshotsCompletions` type.
2418
+ * `child_process.spawn` itself failed before the child entered the registry.
2327
2419
  *
2328
2420
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2329
- * via the `definition` "CopilotUserResponseQuotaSnapshotsCompletions".
2421
+ * via the `definition` "AgentRegistrySpawnError".
2330
2422
  */
2331
2423
  /** @experimental */
2332
- export interface CopilotUserResponseQuotaSnapshotsCompletions {
2333
- entitlement?: number;
2334
- overage_count?: number;
2335
- overage_permitted?: boolean;
2336
- percent_remaining?: number;
2337
- quota_id?: string;
2338
- quota_remaining?: number;
2339
- remaining?: number;
2340
- unlimited?: boolean;
2341
- timestamp_utc?: string;
2342
- has_quota?: boolean;
2343
- quota_reset_at?: number;
2344
- token_based_billing?: boolean;
2424
+ export interface AgentRegistrySpawnError {
2425
+ /**
2426
+ * Discriminator: child_process.spawn itself failed
2427
+ */
2428
+ kind: "spawn-error";
2429
+ /**
2430
+ * Human-readable error message
2431
+ */
2432
+ message: string;
2433
+ /**
2434
+ * Underlying errno code (e.g. ENOENT, EACCES) when available
2435
+ */
2436
+ code?: string;
2345
2437
  }
2346
2438
  /**
2347
- * Schema for the `CopilotUserResponseQuotaSnapshotsPremiumInteractions` type.
2439
+ * Spawn succeeded but the child did not publish a matching managed-server entry within the timeout.
2348
2440
  *
2349
2441
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2350
- * via the `definition` "CopilotUserResponseQuotaSnapshotsPremiumInteractions".
2442
+ * via the `definition` "AgentRegistrySpawnRegistryTimeout".
2351
2443
  */
2352
2444
  /** @experimental */
2353
- export interface CopilotUserResponseQuotaSnapshotsPremiumInteractions {
2354
- entitlement?: number;
2355
- overage_count?: number;
2356
- overage_permitted?: boolean;
2357
- percent_remaining?: number;
2358
- quota_id?: string;
2359
- quota_remaining?: number;
2360
- remaining?: number;
2361
- unlimited?: boolean;
2362
- timestamp_utc?: string;
2363
- has_quota?: boolean;
2364
- quota_reset_at?: number;
2365
- token_based_billing?: boolean;
2445
+ export interface AgentRegistrySpawnRegistryTimeout {
2446
+ /**
2447
+ * Discriminator: spawn succeeded but child never registered
2448
+ */
2449
+ kind: "registry-timeout";
2450
+ /**
2451
+ * Process ID of the orphaned child (so the caller can offer 'kill the pid' guidance)
2452
+ */
2453
+ childPid: number;
2454
+ logCapture?: AgentRegistryLogCapture;
2366
2455
  }
2367
2456
  /**
2368
- * Schema for the `HMACAuthInfo` type.
2457
+ * Inputs to spawn a managed-server child via the controller's spawn delegate.
2369
2458
  *
2370
2459
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2371
- * via the `definition` "HMACAuthInfo".
2460
+ * via the `definition` "AgentRegistrySpawnRequest".
2372
2461
  */
2373
2462
  /** @experimental */
2374
- export interface HMACAuthInfo {
2463
+ export interface AgentRegistrySpawnRequest {
2375
2464
  /**
2376
- * HMAC-based authentication used by GitHub-internal services.
2465
+ * Working directory for the spawned child (must be an existing directory)
2377
2466
  */
2378
- type: "hmac";
2467
+ cwd: string;
2379
2468
  /**
2380
- * Authentication host. HMAC auth always targets the public GitHub host.
2469
+ * Custom or built-in agent name (e.g. 'explore'). When omitted, the child uses its own default.
2381
2470
  */
2382
- host: "https://github.com";
2471
+ agentName?: string;
2383
2472
  /**
2384
- * HMAC secret used to sign requests.
2473
+ * Model identifier to apply to the new session
2385
2474
  */
2386
- hmac: string;
2387
- copilotUser?: CopilotUserResponse;
2475
+ model?: string;
2476
+ /**
2477
+ * Friendly session name. Must satisfy validateSessionName: non-empty, no leading/trailing whitespace, <=100 chars, no control chars, no double quotes.
2478
+ */
2479
+ name?: string;
2480
+ permissionMode?: AgentRegistrySpawnPermissionMode;
2481
+ /**
2482
+ * Optional first user message. Forwarded to the caller (the CLI's spawn wrapper sends it post-attach via the standard LocalRpcSession.send path).
2483
+ */
2484
+ initialPrompt?: string;
2388
2485
  }
2389
2486
  /**
2390
- * Schema for the `EnvAuthInfo` type.
2487
+ * Managed-server child was spawned and registered successfully.
2391
2488
  *
2392
2489
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2393
- * via the `definition` "EnvAuthInfo".
2490
+ * via the `definition` "AgentRegistrySpawnSpawned".
2394
2491
  */
2395
2492
  /** @experimental */
2396
- export interface EnvAuthInfo {
2397
- /**
2398
- * Personal access token (PAT) or server-to-server token sourced from an environment variable.
2399
- */
2400
- type: "env";
2401
- /**
2402
- * Authentication host (e.g. https://github.com or a GHES host).
2403
- */
2404
- host: string;
2493
+ export interface AgentRegistrySpawnSpawned {
2405
2494
  /**
2406
- * User login associated with the token. Undefined for server-to-server tokens (those starting with `ghs_`).
2495
+ * Discriminator: managed-server child spawned successfully
2407
2496
  */
2408
- login?: string;
2497
+ kind: "spawned";
2498
+ entry: AgentRegistryLiveTargetEntry;
2409
2499
  /**
2410
- * The token value itself. Treat as a secret.
2500
+ * 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.
2411
2501
  */
2412
- token: string;
2502
+ initialPromptSent?: boolean;
2413
2503
  /**
2414
- * Name of the environment variable the token was sourced from.
2504
+ * If the delegate attempted to send the initial prompt and failed, the categorized error message.
2415
2505
  */
2416
- envVar: string;
2417
- copilotUser?: CopilotUserResponse;
2506
+ initialPromptError?: string;
2507
+ logCapture?: AgentRegistryLogCapture;
2418
2508
  }
2419
2509
  /**
2420
- * Schema for the `TokenAuthInfo` type.
2510
+ * Synchronous pre-validation rejected the spawn request.
2421
2511
  *
2422
2512
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2423
- * via the `definition` "TokenAuthInfo".
2513
+ * via the `definition` "AgentRegistrySpawnValidationError".
2424
2514
  */
2425
2515
  /** @experimental */
2426
- export interface TokenAuthInfo {
2516
+ export interface AgentRegistrySpawnValidationError {
2427
2517
  /**
2428
- * SDK-side token authentication; the host configured the token directly via the SDK.
2518
+ * Discriminator: synchronous pre-validation rejected the request
2429
2519
  */
2430
- type: "token";
2520
+ kind: "validation-error";
2521
+ reason: AgentRegistrySpawnValidationErrorReason;
2522
+ field?: AgentRegistrySpawnValidationErrorField;
2431
2523
  /**
2432
- * Authentication host.
2524
+ * Human-readable explanation; safe to surface in the UI banner. Never logged to unrestricted telemetry.
2433
2525
  */
2434
- host: string;
2526
+ message: string;
2527
+ }
2528
+ /**
2529
+ * Custom agents available to the session after reloading definitions from disk.
2530
+ *
2531
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2532
+ * via the `definition` "AgentReloadResult".
2533
+ */
2534
+ /** @experimental */
2535
+ export interface AgentReloadResult {
2435
2536
  /**
2436
- * The token value itself. Treat as a secret.
2537
+ * Reloaded custom agents
2437
2538
  */
2438
- token: string;
2439
- copilotUser?: CopilotUserResponse;
2539
+ agents: AgentInfo[];
2440
2540
  }
2441
2541
  /**
2442
- * Schema for the `CopilotApiTokenAuthInfo` type.
2542
+ * Optional project paths to include in agent discovery.
2443
2543
  *
2444
2544
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2445
- * via the `definition` "CopilotApiTokenAuthInfo".
2545
+ * via the `definition` "AgentsDiscoverRequest".
2446
2546
  */
2447
2547
  /** @experimental */
2448
- export interface CopilotApiTokenAuthInfo {
2548
+ export interface AgentsDiscoverRequest {
2449
2549
  /**
2450
- * 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.
2550
+ * 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).
2451
2551
  */
2452
- type: "copilot-api-token";
2552
+ projectPaths?: string[];
2453
2553
  /**
2454
- * Authentication host (always the public GitHub host).
2554
+ * 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.
2455
2555
  */
2456
- host: "https://github.com";
2457
- copilotUser?: CopilotUserResponse;
2556
+ excludeHostAgents?: boolean;
2458
2557
  }
2459
2558
  /**
2460
- * Schema for the `UserAuthInfo` type.
2559
+ * Name of the custom agent to select for subsequent turns.
2461
2560
  *
2462
2561
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2463
- * via the `definition` "UserAuthInfo".
2562
+ * via the `definition` "AgentSelectRequest".
2464
2563
  */
2465
2564
  /** @experimental */
2466
- export interface UserAuthInfo {
2565
+ export interface AgentSelectRequest {
2467
2566
  /**
2468
- * 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.
2567
+ * Name of the custom agent to select
2469
2568
  */
2470
- type: "user";
2569
+ name: string;
2570
+ }
2571
+ /**
2572
+ * The newly selected custom agent.
2573
+ *
2574
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2575
+ * via the `definition` "AgentSelectResult".
2576
+ */
2577
+ /** @experimental */
2578
+ export interface AgentSelectResult {
2579
+ agent: AgentInfo;
2580
+ }
2581
+ /**
2582
+ * Optional project paths to include when enumerating agent discovery directories.
2583
+ *
2584
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2585
+ * via the `definition` "AgentsGetDiscoveryPathsRequest".
2586
+ */
2587
+ /** @experimental */
2588
+ export interface AgentsGetDiscoveryPathsRequest {
2471
2589
  /**
2472
- * Authentication host.
2590
+ * Optional list of project directory paths. When omitted or empty, only the user-level directory is returned.
2473
2591
  */
2474
- host: string;
2592
+ projectPaths?: string[];
2475
2593
  /**
2476
- * OAuth user login.
2594
+ * When true, omit the host's user-level agent directory, leaving only project directories. For multitenant deployments (mirrors `discover`'s `excludeHostAgents`).
2477
2595
  */
2478
- login: string;
2479
- copilotUser?: CopilotUserResponse;
2596
+ excludeHostAgents?: boolean;
2480
2597
  }
2481
2598
  /**
2482
- * Schema for the `GhCliAuthInfo` type.
2599
+ * Indicates whether the operation succeeded and reports the post-mutation state.
2483
2600
  *
2484
2601
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2485
- * via the `definition` "GhCliAuthInfo".
2602
+ * via the `definition` "AllowAllPermissionSetResult".
2486
2603
  */
2487
2604
  /** @experimental */
2488
- export interface GhCliAuthInfo {
2489
- /**
2490
- * Authentication via the `gh` CLI's saved credentials.
2491
- */
2492
- type: "gh-cli";
2605
+ export interface AllowAllPermissionSetResult {
2493
2606
  /**
2494
- * Authentication host.
2607
+ * Whether the operation succeeded
2495
2608
  */
2496
- host: string;
2609
+ success: boolean;
2497
2610
  /**
2498
- * User login as reported by `gh auth status`.
2611
+ * Authoritative allow-all state after the mutation
2499
2612
  */
2500
- login: string;
2613
+ enabled: boolean;
2614
+ }
2615
+ /**
2616
+ * Current full allow-all permission state.
2617
+ *
2618
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
2619
+ * via the `definition` "AllowAllPermissionState".
2620
+ */
2621
+ /** @experimental */
2622
+ export interface AllowAllPermissionState {
2501
2623
  /**
2502
- * The token returned by `gh auth token`. Treat as a secret.
2624
+ * Whether full allow-all permissions are currently active
2503
2625
  */
2504
- token: string;
2505
- copilotUser?: CopilotUserResponse;
2626
+ enabled: boolean;
2506
2627
  }
2507
2628
  /**
2508
2629
  * Cancellation result for a user-requested shell command.
@@ -2716,11 +2837,6 @@ export interface OpenCanvasInstance {
2716
2837
  input?: {
2717
2838
  [k: string]: unknown | undefined;
2718
2839
  };
2719
- /**
2720
- * Whether this snapshot came from an idempotent reopen
2721
- */
2722
- reopen: boolean;
2723
- availability: CanvasInstanceAvailability;
2724
2840
  }
2725
2841
  /**
2726
2842
  * Canvas open parameters.
@@ -2880,6 +2996,19 @@ export interface CanvasProviderOpenResult {
2880
2996
  */
2881
2997
  status?: string;
2882
2998
  }
2999
+ /**
3000
+ * Options scoped to the built-in CAPI (Copilot API) provider.
3001
+ *
3002
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
3003
+ * via the `definition` "CapiSessionOptions".
3004
+ */
3005
+ /** @experimental */
3006
+ export interface CapiSessionOptions {
3007
+ /**
3008
+ * 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.
3009
+ */
3010
+ enableWebSocketResponses?: boolean;
3011
+ }
2883
3012
  /**
2884
3013
  * Slash commands available in the session, after applying any include/exclude filters.
2885
3014
  *
@@ -4008,6 +4137,10 @@ export interface InstalledPluginInfo {
4008
4137
  * Marketplace the plugin came from. Empty string ("") for direct repo / URL / local installs.
4009
4138
  */
4010
4139
  marketplace: string;
4140
+ /**
4141
+ * 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.
4142
+ */
4143
+ directSourceId?: string;
4011
4144
  /**
4012
4145
  * Installed version (when reported by the plugin manifest)
4013
4146
  */
@@ -4159,6 +4292,7 @@ export interface LlmInferenceHeaders {
4159
4292
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
4160
4293
  * via the `definition` "LlmInferenceHttpRequestChunkRequest".
4161
4294
  */
4295
+ /** @experimental */
4162
4296
  export interface LlmInferenceHttpRequestChunkRequest {
4163
4297
  /**
4164
4298
  * Matches the requestId from the originating httpRequestStart frame.
@@ -4191,6 +4325,7 @@ export interface LlmInferenceHttpRequestChunkRequest {
4191
4325
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
4192
4326
  * via the `definition` "LlmInferenceHttpRequestChunkResult".
4193
4327
  */
4328
+ /** @experimental */
4194
4329
  export interface LlmInferenceHttpRequestChunkResult {
4195
4330
  }
4196
4331
  /**
@@ -4199,6 +4334,7 @@ export interface LlmInferenceHttpRequestChunkResult {
4199
4334
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
4200
4335
  * via the `definition` "LlmInferenceHttpRequestStartRequest".
4201
4336
  */
4337
+ /** @experimental */
4202
4338
  export interface LlmInferenceHttpRequestStartRequest {
4203
4339
  /**
4204
4340
  * 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.
@@ -4225,6 +4361,7 @@ export interface LlmInferenceHttpRequestStartRequest {
4225
4361
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
4226
4362
  * via the `definition` "LlmInferenceHttpRequestStartResult".
4227
4363
  */
4364
+ /** @experimental */
4228
4365
  export interface LlmInferenceHttpRequestStartResult {
4229
4366
  }
4230
4367
  /**
@@ -5212,6 +5349,33 @@ export interface McpFilteredServer {
5212
5349
  */
5213
5350
  enterpriseName?: string;
5214
5351
  }
5352
+ /**
5353
+ * MCP headers refresh request id and the host response.
5354
+ *
5355
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
5356
+ * via the `definition` "McpHeadersHandlePendingHeadersRefreshRequestRequest".
5357
+ */
5358
+ /** @experimental */
5359
+ export interface McpHeadersHandlePendingHeadersRefreshRequestRequest {
5360
+ /**
5361
+ * Headers refresh request identifier from mcp.headers_refresh_required
5362
+ */
5363
+ requestId: string;
5364
+ result: McpHeadersHandlePendingHeadersRefreshRequest;
5365
+ }
5366
+ /**
5367
+ * Indicates whether the pending MCP headers refresh response was accepted.
5368
+ *
5369
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
5370
+ * via the `definition` "McpHeadersHandlePendingHeadersRefreshRequestResult".
5371
+ */
5372
+ /** @experimental */
5373
+ export interface McpHeadersHandlePendingHeadersRefreshRequestResult {
5374
+ /**
5375
+ * Whether the response was accepted. False if the request was unknown, timed out, or already resolved.
5376
+ */
5377
+ success: boolean;
5378
+ }
5215
5379
  /**
5216
5380
  * Host-level state, omitted when no MCP host is initialized.
5217
5381
  *
@@ -5380,7 +5544,7 @@ export interface McpOauthHandlePendingResult {
5380
5544
  success: boolean;
5381
5545
  }
5382
5546
  /**
5383
- * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy.
5547
+ * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.
5384
5548
  *
5385
5549
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
5386
5550
  * via the `definition` "McpOauthLoginRequest".
@@ -5403,6 +5567,19 @@ export interface McpOauthLoginRequest {
5403
5567
  * 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.
5404
5568
  */
5405
5569
  callbackSuccessMessage?: string;
5570
+ /**
5571
+ * Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration.
5572
+ */
5573
+ clientId?: string;
5574
+ /**
5575
+ * 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.
5576
+ */
5577
+ clientSecret?: string;
5578
+ /**
5579
+ * 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.
5580
+ */
5581
+ publicClient?: boolean;
5582
+ grantType?: McpOauthLoginGrantType;
5406
5583
  }
5407
5584
  /**
5408
5585
  * OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
@@ -5883,6 +6060,10 @@ export interface ModelBilling {
5883
6060
  */
5884
6061
  multiplier?: number;
5885
6062
  tokenPrices?: ModelBillingTokenPrices;
6063
+ /**
6064
+ * 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.
6065
+ */
6066
+ discountPercent?: number;
5886
6067
  }
5887
6068
  /**
5888
6069
  * Token-level pricing information for this model
@@ -5900,7 +6081,8 @@ export interface ModelBillingTokenPrices {
5900
6081
  */
5901
6082
  outputPrice?: number;
5902
6083
  /**
5903
- * Deprecated: use cacheReadPrice. AI Credits cost per billing batch of cached tokens
6084
+ * @deprecated
6085
+ * Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens
5904
6086
  */
5905
6087
  cachePrice?: number;
5906
6088
  /**
@@ -5916,7 +6098,8 @@ export interface ModelBillingTokenPrices {
5916
6098
  */
5917
6099
  batchSize?: number;
5918
6100
  /**
5919
- * Deprecated: use maxPromptTokens. Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens.
6101
+ * @deprecated
6102
+ * Use maxPromptTokens instead. Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens.
5920
6103
  */
5921
6104
  contextMax?: number;
5922
6105
  /**
@@ -5941,7 +6124,8 @@ export interface ModelBillingTokenPricesLongContext {
5941
6124
  */
5942
6125
  outputPrice?: number;
5943
6126
  /**
5944
- * Deprecated: use cacheReadPrice. AI Credits cost per billing batch of cached tokens
6127
+ * @deprecated
6128
+ * Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens
5945
6129
  */
5946
6130
  cachePrice?: number;
5947
6131
  /**
@@ -5953,7 +6137,8 @@ export interface ModelBillingTokenPricesLongContext {
5953
6137
  */
5954
6138
  cacheWritePrice?: number;
5955
6139
  /**
5956
- * Deprecated: use maxPromptTokens. Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens.
6140
+ * @deprecated
6141
+ * 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.
5957
6142
  */
5958
6143
  contextMax?: number;
5959
6144
  /**
@@ -6146,6 +6331,7 @@ export interface NamedProviderConfig {
6146
6331
  name: string;
6147
6332
  type?: ProviderConfigType;
6148
6333
  wireApi?: ProviderConfigWireApi;
6334
+ transport?: ProviderConfigTransport;
6149
6335
  /**
6150
6336
  * API endpoint URL.
6151
6337
  */
@@ -6165,6 +6351,10 @@ export interface NamedProviderConfig {
6165
6351
  headers?: {
6166
6352
  [k: string]: string | undefined;
6167
6353
  };
6354
+ /**
6355
+ * 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 <token>` 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.
6356
+ */
6357
+ hasBearerTokenProvider?: boolean;
6168
6358
  }
6169
6359
  /**
6170
6360
  * Azure-specific provider options.
@@ -7910,6 +8100,10 @@ export interface PluginsUninstallRequest {
7910
8100
  * Plugin name or "plugin@marketplace" spec to uninstall. When ambiguous, prefer the fully-qualified spec.
7911
8101
  */
7912
8102
  name: string;
8103
+ /**
8104
+ * Stable source identity for a direct (non-marketplace) install. Disambiguates uninstall when multiple installed plugins share the same name.
8105
+ */
8106
+ directSourceId?: string | null;
7913
8107
  }
7914
8108
  /**
7915
8109
  * Name (or spec) of the plugin to update.
@@ -8025,6 +8219,78 @@ export interface SessionsPollSpawnedSessionsEvent {
8025
8219
  */
8026
8220
  sessionId: string;
8027
8221
  }
8222
+ /**
8223
+ * BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both.
8224
+ *
8225
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8226
+ * via the `definition` "ProviderAddRequest".
8227
+ */
8228
+ /** @experimental */
8229
+ export interface ProviderAddRequest {
8230
+ /**
8231
+ * 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 '/'.
8232
+ */
8233
+ providers?: NamedProviderConfig[];
8234
+ /**
8235
+ * 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.
8236
+ */
8237
+ models?: ProviderModelConfig[];
8238
+ }
8239
+ /**
8240
+ * A BYOK model definition referencing a named provider.
8241
+ *
8242
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8243
+ * via the `definition` "ProviderModelConfig".
8244
+ */
8245
+ /** @experimental */
8246
+ export interface ProviderModelConfig {
8247
+ /**
8248
+ * 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`.
8249
+ */
8250
+ id: string;
8251
+ /**
8252
+ * Name of the NamedProviderConfig that serves this model.
8253
+ */
8254
+ provider: string;
8255
+ /**
8256
+ * The model name sent to the provider API for inference. Defaults to `id`.
8257
+ */
8258
+ wireModel?: string;
8259
+ /**
8260
+ * Well-known base model id used for behavior/capability/config lookup. Defaults to `id`.
8261
+ */
8262
+ modelId?: string;
8263
+ /**
8264
+ * Display name for model pickers. Defaults to the provider-qualified selection id (`provider/id`).
8265
+ */
8266
+ name?: string;
8267
+ /**
8268
+ * Maximum prompt/input tokens for the model.
8269
+ */
8270
+ maxPromptTokens?: number;
8271
+ /**
8272
+ * Maximum context window tokens for the model.
8273
+ */
8274
+ maxContextWindowTokens?: number;
8275
+ /**
8276
+ * Maximum output tokens for the model.
8277
+ */
8278
+ maxOutputTokens?: number;
8279
+ capabilities?: ModelCapabilitiesOverride;
8280
+ }
8281
+ /**
8282
+ * The selectable model entries synthesized for the models added by this call.
8283
+ *
8284
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8285
+ * via the `definition` "ProviderAddResult".
8286
+ */
8287
+ /** @experimental */
8288
+ export interface ProviderAddResult {
8289
+ /**
8290
+ * 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.
8291
+ */
8292
+ models: unknown[];
8293
+ }
8028
8294
  /**
8029
8295
  * Custom model-provider configuration (BYOK).
8030
8296
  *
@@ -8035,6 +8301,7 @@ export interface SessionsPollSpawnedSessionsEvent {
8035
8301
  export interface ProviderConfig {
8036
8302
  type?: ProviderConfigType;
8037
8303
  wireApi?: ProviderConfigWireApi;
8304
+ transport?: ProviderConfigTransport;
8038
8305
  /**
8039
8306
  * API endpoint URL.
8040
8307
  */
@@ -8074,6 +8341,10 @@ export interface ProviderConfig {
8074
8341
  headers?: {
8075
8342
  [k: string]: string | undefined;
8076
8343
  };
8344
+ /**
8345
+ * 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 <token>` 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.
8346
+ */
8347
+ hasBearerTokenProvider?: boolean;
8077
8348
  }
8078
8349
  /**
8079
8350
  * A snapshot of the provider endpoint the session is currently configured to talk to.
@@ -8085,6 +8356,7 @@ export interface ProviderConfig {
8085
8356
  export interface ProviderEndpoint {
8086
8357
  type: ProviderEndpointType;
8087
8358
  wireApi?: ProviderEndpointWireApi;
8359
+ transport?: ProviderEndpointTransport;
8088
8360
  /**
8089
8361
  * Base URL to pass to the LLM client library.
8090
8362
  */
@@ -8140,46 +8412,34 @@ export interface ProviderGetEndpointRequest {
8140
8412
  modelId?: string;
8141
8413
  }
8142
8414
  /**
8143
- * A BYOK model definition referencing a named provider.
8415
+ * 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.
8144
8416
  *
8145
8417
  * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8146
- * via the `definition` "ProviderModelConfig".
8418
+ * via the `definition` "ProviderTokenAcquireRequest".
8147
8419
  */
8148
8420
  /** @experimental */
8149
- export interface ProviderModelConfig {
8150
- /**
8151
- * 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`.
8152
- */
8153
- id: string;
8154
- /**
8155
- * Name of the NamedProviderConfig that serves this model.
8156
- */
8157
- provider: string;
8158
- /**
8159
- * The model name sent to the provider API for inference. Defaults to `id`.
8160
- */
8161
- wireModel?: string;
8162
- /**
8163
- * Well-known base model id used for behavior/capability/config lookup. Defaults to `id`.
8164
- */
8165
- modelId?: string;
8166
- /**
8167
- * Display name for model pickers. Defaults to the provider-qualified selection id (`provider/id`).
8168
- */
8169
- name?: string;
8421
+ export interface ProviderTokenAcquireRequest {
8170
8422
  /**
8171
- * Maximum prompt/input tokens for the model.
8423
+ * Target session identifier
8172
8424
  */
8173
- maxPromptTokens?: number;
8425
+ sessionId: string;
8174
8426
  /**
8175
- * Maximum context window tokens for the model.
8427
+ * Name of the BYOK provider needing a token. For the legacy whole-session `provider` this is the implicit provider name; for named providers it is `NamedProviderConfig.name`.
8176
8428
  */
8177
- maxContextWindowTokens?: number;
8429
+ providerName: string;
8430
+ }
8431
+ /**
8432
+ * A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer <token>` on the outbound request and does no caching; the SDK consumer owns token caching and refresh.
8433
+ *
8434
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8435
+ * via the `definition` "ProviderTokenAcquireResult".
8436
+ */
8437
+ /** @experimental */
8438
+ export interface ProviderTokenAcquireResult {
8178
8439
  /**
8179
- * Maximum output tokens for the model.
8440
+ * The bearer token value (without the `Bearer ` prefix).
8180
8441
  */
8181
- maxOutputTokens?: number;
8182
- capabilities?: ModelCapabilitiesOverride;
8442
+ token: string;
8183
8443
  }
8184
8444
  /**
8185
8445
  * File attachment
@@ -8342,6 +8602,279 @@ export interface PushAttachmentGitHubReference {
8342
8602
  */
8343
8603
  url: string;
8344
8604
  }
8605
+ /**
8606
+ * Pointer to a GitHub commit.
8607
+ *
8608
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8609
+ * via the `definition` "PushAttachmentGitHubCommit".
8610
+ */
8611
+ /** @experimental */
8612
+ export interface PushAttachmentGitHubCommit {
8613
+ /**
8614
+ * Attachment type discriminator
8615
+ */
8616
+ type: "github_commit";
8617
+ repo: PushGitHubRepoRef;
8618
+ /**
8619
+ * Full commit SHA
8620
+ */
8621
+ oid: string;
8622
+ /**
8623
+ * First line of the commit message
8624
+ */
8625
+ message: string;
8626
+ /**
8627
+ * URL to the commit on GitHub
8628
+ */
8629
+ url: string;
8630
+ }
8631
+ /**
8632
+ * Pointer to a GitHub repository.
8633
+ *
8634
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8635
+ * via the `definition` "PushGitHubRepoRef".
8636
+ */
8637
+ /** @experimental */
8638
+ export interface PushGitHubRepoRef {
8639
+ /**
8640
+ * Numeric GitHub repository id
8641
+ */
8642
+ id?: number;
8643
+ /**
8644
+ * Repository name (without owner)
8645
+ */
8646
+ name: string;
8647
+ /**
8648
+ * Repository owner login (user or organization)
8649
+ */
8650
+ owner: string;
8651
+ }
8652
+ /**
8653
+ * Pointer to a GitHub release.
8654
+ *
8655
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8656
+ * via the `definition` "PushAttachmentGitHubRelease".
8657
+ */
8658
+ /** @experimental */
8659
+ export interface PushAttachmentGitHubRelease {
8660
+ /**
8661
+ * Attachment type discriminator
8662
+ */
8663
+ type: "github_release";
8664
+ repo: PushGitHubRepoRef;
8665
+ /**
8666
+ * Git tag the release is anchored to
8667
+ */
8668
+ tagName: string;
8669
+ /**
8670
+ * Human-readable release name
8671
+ */
8672
+ name: string;
8673
+ /**
8674
+ * URL to the release on GitHub
8675
+ */
8676
+ url: string;
8677
+ }
8678
+ /**
8679
+ * Pointer to a GitHub Actions job.
8680
+ *
8681
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8682
+ * via the `definition` "PushAttachmentGitHubActionsJob".
8683
+ */
8684
+ /** @experimental */
8685
+ export interface PushAttachmentGitHubActionsJob {
8686
+ /**
8687
+ * Attachment type discriminator
8688
+ */
8689
+ type: "github_actions_job";
8690
+ repo: PushGitHubRepoRef;
8691
+ /**
8692
+ * Job id within the workflow run
8693
+ */
8694
+ jobId: number;
8695
+ /**
8696
+ * Display name of the job
8697
+ */
8698
+ jobName: string;
8699
+ /**
8700
+ * Display name of the workflow the job ran in
8701
+ */
8702
+ workflowName: string;
8703
+ /**
8704
+ * URL to the job on GitHub
8705
+ */
8706
+ url: string;
8707
+ /**
8708
+ * Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs.
8709
+ */
8710
+ conclusion?: string;
8711
+ }
8712
+ /**
8713
+ * Pointer to a GitHub repository.
8714
+ *
8715
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8716
+ * via the `definition` "PushAttachmentGitHubRepository".
8717
+ */
8718
+ /** @experimental */
8719
+ export interface PushAttachmentGitHubRepository {
8720
+ /**
8721
+ * Attachment type discriminator
8722
+ */
8723
+ type: "github_repository";
8724
+ repo: PushGitHubRepoRef;
8725
+ /**
8726
+ * URL to the repository on GitHub
8727
+ */
8728
+ url: string;
8729
+ /**
8730
+ * Short description of the repository
8731
+ */
8732
+ description?: string;
8733
+ /**
8734
+ * Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied.
8735
+ */
8736
+ ref?: string;
8737
+ }
8738
+ /**
8739
+ * Pointer to a single-file diff. At least one of `head` and `base` must be present.
8740
+ *
8741
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8742
+ * via the `definition` "PushAttachmentGitHubFileDiff".
8743
+ */
8744
+ /** @experimental */
8745
+ export interface PushAttachmentGitHubFileDiff {
8746
+ /**
8747
+ * Attachment type discriminator
8748
+ */
8749
+ type: "github_file_diff";
8750
+ /**
8751
+ * URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL)
8752
+ */
8753
+ url: string;
8754
+ head?: PushAttachmentGitHubFileDiffSide;
8755
+ base?: PushAttachmentGitHubFileDiffSide;
8756
+ }
8757
+ /**
8758
+ * One side of a file diff (head or base)
8759
+ *
8760
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8761
+ * via the `definition` "PushAttachmentGitHubFileDiffSide".
8762
+ */
8763
+ /** @experimental */
8764
+ export interface PushAttachmentGitHubFileDiffSide {
8765
+ repo: PushGitHubRepoRef;
8766
+ /**
8767
+ * Git ref (branch, tag, or commit SHA) the file is read at
8768
+ */
8769
+ ref: string;
8770
+ /**
8771
+ * Repository-relative path to the file
8772
+ */
8773
+ path: string;
8774
+ }
8775
+ /**
8776
+ * Pointer to a comparison between two git revisions.
8777
+ *
8778
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8779
+ * via the `definition` "PushAttachmentGitHubTreeComparison".
8780
+ */
8781
+ /** @experimental */
8782
+ export interface PushAttachmentGitHubTreeComparison {
8783
+ /**
8784
+ * Attachment type discriminator
8785
+ */
8786
+ type: "github_tree_comparison";
8787
+ /**
8788
+ * URL to the comparison on GitHub
8789
+ */
8790
+ url: string;
8791
+ base: PushAttachmentGitHubTreeComparisonSide;
8792
+ head: PushAttachmentGitHubTreeComparisonSide;
8793
+ }
8794
+ /**
8795
+ * One side of a tree comparison (head or base)
8796
+ *
8797
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8798
+ * via the `definition` "PushAttachmentGitHubTreeComparisonSide".
8799
+ */
8800
+ /** @experimental */
8801
+ export interface PushAttachmentGitHubTreeComparisonSide {
8802
+ repo: PushGitHubRepoRef;
8803
+ /**
8804
+ * Git revision (branch, tag, or commit SHA)
8805
+ */
8806
+ revision: string;
8807
+ }
8808
+ /**
8809
+ * Generic GitHub URL reference.
8810
+ *
8811
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8812
+ * via the `definition` "PushAttachmentGitHubUrl".
8813
+ */
8814
+ /** @experimental */
8815
+ export interface PushAttachmentGitHubUrl {
8816
+ /**
8817
+ * Attachment type discriminator
8818
+ */
8819
+ type: "github_url";
8820
+ /**
8821
+ * URL to the GitHub resource
8822
+ */
8823
+ url: string;
8824
+ }
8825
+ /**
8826
+ * Pointer to a file in a GitHub repository at a specific ref.
8827
+ *
8828
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8829
+ * via the `definition` "PushAttachmentGitHubFile".
8830
+ */
8831
+ /** @experimental */
8832
+ export interface PushAttachmentGitHubFile {
8833
+ /**
8834
+ * Attachment type discriminator
8835
+ */
8836
+ type: "github_file";
8837
+ repo: PushGitHubRepoRef;
8838
+ /**
8839
+ * Git ref the file is read at (branch, tag, or commit SHA)
8840
+ */
8841
+ ref: string;
8842
+ /**
8843
+ * Repository-relative path to the file
8844
+ */
8845
+ path: string;
8846
+ /**
8847
+ * URL to the file on GitHub
8848
+ */
8849
+ url: string;
8850
+ }
8851
+ /**
8852
+ * Pointer to a line range inside a file in a GitHub repository.
8853
+ *
8854
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
8855
+ * via the `definition` "PushAttachmentGitHubSnippet".
8856
+ */
8857
+ /** @experimental */
8858
+ export interface PushAttachmentGitHubSnippet {
8859
+ /**
8860
+ * Attachment type discriminator
8861
+ */
8862
+ type: "github_snippet";
8863
+ repo: PushGitHubRepoRef;
8864
+ /**
8865
+ * Git ref the file is read at (branch, tag, or commit SHA)
8866
+ */
8867
+ ref: string;
8868
+ /**
8869
+ * Repository-relative path to the file
8870
+ */
8871
+ path: string;
8872
+ /**
8873
+ * URL to the snippet on GitHub (with line anchor)
8874
+ */
8875
+ url: string;
8876
+ lineRange: PushAttachmentFileLineRange;
8877
+ }
8345
8878
  /**
8346
8879
  * Blob attachment with inline base64-encoded data
8347
8880
  *
@@ -8794,12 +9327,6 @@ export interface SandboxConfig {
8794
9327
  */
8795
9328
  enabled: boolean;
8796
9329
  userPolicy?: SandboxConfigUserPolicy;
8797
- /**
8798
- * Raw `ContainerConfig` (per `@microsoft/mxc-sdk`) passed directly to `spawnSandboxFromConfig`, bypassing policy merging.
8799
- */
8800
- config?: {
8801
- [k: string]: unknown | undefined;
8802
- };
8803
9330
  /**
8804
9331
  * Whether to auto-add the current working directory to readwritePaths. Default: true.
8805
9332
  */
@@ -8815,6 +9342,7 @@ export interface SandboxConfig {
8815
9342
  export interface SandboxConfigUserPolicy {
8816
9343
  filesystem?: SandboxConfigUserPolicyFilesystem;
8817
9344
  network?: SandboxConfigUserPolicyNetwork;
9345
+ seatbelt?: SandboxConfigUserPolicySeatbelt;
8818
9346
  experimental?: SandboxConfigUserPolicyExperimental;
8819
9347
  }
8820
9348
  /**
@@ -8867,6 +9395,19 @@ export interface SandboxConfigUserPolicyNetwork {
8867
9395
  */
8868
9396
  blockedHosts?: string[];
8869
9397
  }
9398
+ /**
9399
+ * macOS seatbelt-specific options.
9400
+ *
9401
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
9402
+ * via the `definition` "SandboxConfigUserPolicySeatbelt".
9403
+ */
9404
+ /** @experimental */
9405
+ export interface SandboxConfigUserPolicySeatbelt {
9406
+ /**
9407
+ * Whether the macOS seatbelt profile may access the keychain.
9408
+ */
9409
+ keychainAccess?: boolean;
9410
+ }
8870
9411
  /**
8871
9412
  * Platform-specific experimental policy fields.
8872
9413
  *
@@ -8926,6 +9467,10 @@ export interface ScheduleEntry {
8926
9467
  * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`).
8927
9468
  */
8928
9469
  recurring: boolean;
9470
+ /**
9471
+ * 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.
9472
+ */
9473
+ selfPaced?: boolean;
8929
9474
  /**
8930
9475
  * 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`.
8931
9476
  */
@@ -9136,6 +9681,10 @@ export interface ServerSkill {
9136
9681
  * The project path this skill belongs to (only for project/inherited skills)
9137
9682
  */
9138
9683
  projectPath?: string;
9684
+ /**
9685
+ * Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field
9686
+ */
9687
+ argumentHint?: string;
9139
9688
  }
9140
9689
  /**
9141
9690
  * Skills discovered across global and project sources.
@@ -9916,6 +10465,7 @@ export interface SessionOpenOptions {
9916
10465
  isExperimentalMode?: boolean;
9917
10466
  authInfo?: AuthInfo;
9918
10467
  provider?: ProviderConfig;
10468
+ capi?: CapiSessionOptions;
9919
10469
  /**
9920
10470
  * Named BYOK provider connections, additive to CAPI auth. Combining with `provider` is rejected.
9921
10471
  *
@@ -9979,6 +10529,10 @@ export interface SessionOpenOptions {
9979
10529
  */
9980
10530
  logInteractiveShells?: boolean;
9981
10531
  envValueMode?: SessionOpenOptionsEnvValueMode;
10532
+ /**
10533
+ * Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers.
10534
+ */
10535
+ allowAllMcpServerInstructions?: boolean;
9982
10536
  /**
9983
10537
  * Additional directories to search for skills.
9984
10538
  */
@@ -10046,6 +10600,7 @@ export interface SessionOpenOptions {
10046
10600
  */
10047
10601
  maxInlineBinaryBytes?: number;
10048
10602
  modelCapabilitiesOverrides?: ModelCapabilitiesOverride;
10603
+ responseBudget?: ResponseBudgetConfig;
10049
10604
  /**
10050
10605
  * Runtime context discriminator for agent filtering.
10051
10606
  */
@@ -10407,6 +10962,10 @@ export interface SessionSetCredentialsResult {
10407
10962
  * Whether the operation succeeded
10408
10963
  */
10409
10964
  success: boolean;
10965
+ /**
10966
+ * 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).
10967
+ */
10968
+ copilotUserResolved?: boolean;
10410
10969
  }
10411
10970
  /**
10412
10971
  * UUID prefix to resolve to a unique session ID.
@@ -10887,6 +11446,7 @@ export interface SessionUpdateOptionsParams {
10887
11446
  */
10888
11447
  isExperimentalMode?: boolean;
10889
11448
  provider?: ProviderConfig;
11449
+ capi?: CapiSessionOptions;
10890
11450
  /**
10891
11451
  * Absolute working-directory path for shell tools.
10892
11452
  */
@@ -10918,6 +11478,10 @@ export interface SessionUpdateOptionsParams {
10918
11478
  */
10919
11479
  logInteractiveShells?: boolean;
10920
11480
  envValueMode?: OptionsUpdateEnvValueMode;
11481
+ /**
11482
+ * Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers.
11483
+ */
11484
+ allowAllMcpServerInstructions?: boolean;
10921
11485
  /**
10922
11486
  * Additional directories to search for skills.
10923
11487
  */
@@ -11033,6 +11597,10 @@ export interface SessionUpdateOptionsParams {
11033
11597
  */
11034
11598
  enableSkills?: boolean;
11035
11599
  contextTier?: OptionsUpdateContextTier;
11600
+ /**
11601
+ * Optional response budget limits. Pass null to clear the response budget.
11602
+ */
11603
+ responseBudget?: ResponseBudgetConfig | null;
11036
11604
  }
11037
11605
  /**
11038
11606
  * Indicates whether the session options patch was applied successfully.
@@ -11185,6 +11753,10 @@ export interface Skill {
11185
11753
  * Name of the plugin that provides the skill, when source is 'plugin'
11186
11754
  */
11187
11755
  pluginName?: string;
11756
+ /**
11757
+ * Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field
11758
+ */
11759
+ argumentHint?: string;
11188
11760
  }
11189
11761
  /**
11190
11762
  * Schema for the `SkillDiscoveryPath` type.
@@ -13113,6 +13685,34 @@ export declare function createServerRpc(connection: MessageConnection): {
13113
13685
  * @returns Quota usage snapshots for the resolved user, keyed by quota type.
13114
13686
  */
13115
13687
  getQuota: (params: AccountGetQuotaRequest) => Promise<AccountGetQuotaResult>;
13688
+ /**
13689
+ * Gets the currently active authentication credentials from the global auth manager.
13690
+ *
13691
+ * @returns Current authentication state
13692
+ */
13693
+ getCurrentAuth: () => Promise<AccountGetCurrentAuthResult>;
13694
+ /**
13695
+ * Gets all authenticated users available for account switching.
13696
+ *
13697
+ * @returns List of all authenticated users
13698
+ */
13699
+ getAllUsers: () => Promise<AccountGetAllUsersResult>;
13700
+ /**
13701
+ * Stores authentication credentials after successful login (e.g., device code flow).
13702
+ *
13703
+ * @param params Credentials to store after successful authentication
13704
+ *
13705
+ * @returns Result of a successful login; throws on failure
13706
+ */
13707
+ login: (params: AccountLoginRequest) => Promise<AccountLoginResult>;
13708
+ /**
13709
+ * Removes user authentication from keychain and persisted state.
13710
+ *
13711
+ * @param params User to log out
13712
+ *
13713
+ * @returns Logout result indicating if more users remain
13714
+ */
13715
+ logout: (params: AccountLogoutRequest) => Promise<AccountLogoutResult>;
13116
13716
  };
13117
13717
  secrets: {
13118
13718
  /**
@@ -13613,7 +14213,7 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
13613
14213
  */
13614
14214
  shutdown: (params: ShutdownRequest) => Promise<void>;
13615
14215
  /** @experimental */
13616
- auth: {
14216
+ gitHubAuth: {
13617
14217
  /**
13618
14218
  * Gets authentication status and account metadata for the session.
13619
14219
  *
@@ -14090,13 +14690,24 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
14090
14690
  /**
14091
14691
  * Starts OAuth authentication for a remote MCP server.
14092
14692
  *
14093
- * @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy.
14693
+ * @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.
14094
14694
  *
14095
14695
  * @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
14096
14696
  */
14097
14697
  login: (params: McpOauthLoginRequest) => Promise<McpOauthLoginResult>;
14098
14698
  };
14099
14699
  /** @experimental */
14700
+ headers: {
14701
+ /**
14702
+ * Responds to a pending MCP dynamic headers refresh request. Hosts that subscribe to `mcp.headers_refresh_required` use this to provide short-lived per-server headers or to indicate that no dynamic headers are available for this refresh.
14703
+ *
14704
+ * @param params MCP headers refresh request id and the host response.
14705
+ *
14706
+ * @returns Indicates whether the pending MCP headers refresh response was accepted.
14707
+ */
14708
+ handlePendingHeadersRefreshRequest: (params: McpHeadersHandlePendingHeadersRefreshRequestRequest) => Promise<McpHeadersHandlePendingHeadersRefreshRequestResult>;
14709
+ };
14710
+ /** @experimental */
14100
14711
  apps: {
14101
14712
  /**
14102
14713
  * Fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) from a connected server. Requires the `mcp-apps` session capability.
@@ -14169,6 +14780,14 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
14169
14780
  * @returns A snapshot of the provider endpoint the session is currently configured to talk to.
14170
14781
  */
14171
14782
  getEndpoint: (params?: ProviderGetEndpointRequest) => Promise<ProviderEndpoint>;
14783
+ /**
14784
+ * 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.
14785
+ *
14786
+ * @param params BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both.
14787
+ *
14788
+ * @returns The selectable model entries synthesized for the models added by this call.
14789
+ */
14790
+ add: (params: ProviderAddRequest) => Promise<ProviderAddResult>;
14172
14791
  };
14173
14792
  /** @experimental */
14174
14793
  options: {
@@ -14267,7 +14886,7 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
14267
14886
  *
14268
14887
  * @param params Slash command name and optional raw input string to invoke.
14269
14888
  *
14270
- * @returns Result of invoking the slash command (text output, prompt to send to the agent, or completion).
14889
+ * @returns Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection).
14271
14890
  */
14272
14891
  invoke: (params: CommandsInvokeRequest) => Promise<SlashCommandInvocationResult>;
14273
14892
  /**
@@ -14803,6 +15422,18 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
14803
15422
  stop: (params: ScheduleStopRequest) => Promise<ScheduleStopResult>;
14804
15423
  };
14805
15424
  };
15425
+ /** Handler for `providerToken` client session API methods. */
15426
+ /** @experimental */
15427
+ export interface ProviderTokenHandler {
15428
+ /**
15429
+ * Asks the SDK client to get a bearer token for a BYOK provider whose config set `hasBearerTokenProvider: true`. Session-scoped: the runtime calls it back on the connection that most recently supplied that provider's config for the session (the creating connection, or a resuming connection if the session was resumed — distinct providers may be owned by different connections), passing the provider name, and uses the returned token as the Authorization header for the outbound model request. The runtime does no caching — it calls this once per outbound request; the SDK consumer owns token acquisition, caching, and refresh.
15430
+ *
15431
+ * @param params 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.
15432
+ *
15433
+ * @returns A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer <token>` on the outbound request and does no caching; the SDK consumer owns token caching and refresh.
15434
+ */
15435
+ getToken(params: ProviderTokenAcquireRequest): Promise<ProviderTokenAcquireResult>;
15436
+ }
14806
15437
  /** Handler for `sessionFs` client session API methods. */
14807
15438
  /** @experimental */
14808
15439
  export interface SessionFsHandler {
@@ -14931,6 +15562,7 @@ export interface CanvasHandler {
14931
15562
  }
14932
15563
  /** All client session API handler groups. */
14933
15564
  export interface ClientSessionApiHandlers {
15565
+ providerToken?: ProviderTokenHandler;
14934
15566
  sessionFs?: SessionFsHandler;
14935
15567
  canvas?: CanvasHandler;
14936
15568
  }
@@ -14941,3 +15573,35 @@ export interface ClientSessionApiHandlers {
14941
15573
  * function uses `getHandlers` to resolve the session's handlers.
14942
15574
  */
14943
15575
  export declare function registerClientSessionApiHandlers(connection: MessageConnection, getHandlers: (sessionId: string) => ClientSessionApiHandlers): void;
15576
+ /** Handler for `llmInference` client global API methods. */
15577
+ /** @experimental */
15578
+ export interface LlmInferenceHandler {
15579
+ /**
15580
+ * Announces an outbound model-layer HTTP request the runtime wants the SDK client to service. Carries the request head only; the body always follows as one or more httpRequestChunk frames keyed by the same requestId, even when the body is empty (a single chunk with end=true).
15581
+ *
15582
+ * @param params The head of an outbound model-layer HTTP request.
15583
+ *
15584
+ * @returns Acknowledgement. Returning successfully simply means the SDK accepted the start frame; it does not imply the request will succeed.
15585
+ */
15586
+ httpRequestStart(params: LlmInferenceHttpRequestStartRequest): Promise<LlmInferenceHttpRequestStartResult>;
15587
+ /**
15588
+ * 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.
15589
+ *
15590
+ * @param params A request body chunk or cancellation signal.
15591
+ *
15592
+ * @returns Acknowledgement. The SDK is free to ignore the ack and treat chunk delivery as fire-and-forget.
15593
+ */
15594
+ httpRequestChunk(params: LlmInferenceHttpRequestChunkRequest): Promise<LlmInferenceHttpRequestChunkResult>;
15595
+ }
15596
+ /** All client global API handler groups. */
15597
+ export interface ClientGlobalApiHandlers {
15598
+ llmInference?: LlmInferenceHandler;
15599
+ }
15600
+ /**
15601
+ * Register client global API handlers on a JSON-RPC connection.
15602
+ * The server calls these methods to delegate work to the client.
15603
+ * Unlike session-scoped client APIs, these methods carry no implicit
15604
+ * `sessionId` dispatch key — a single set of handlers serves the entire
15605
+ * connection.
15606
+ */
15607
+ export declare function registerClientGlobalApiHandlers(connection: MessageConnection, handlers: ClientGlobalApiHandlers): void;