@github/copilot-sdk 1.0.18-preview.3 → 1.0.18-preview.5

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,7 @@
3
3
  * Generated from: api.schema.json
4
4
  */
5
5
  import type { MessageConnection } from "vscode-jsonrpc/node.js";
6
- import type { AbortReason, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, IndexedSearchState, ManagedSettingsResolvedData, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerMetadata, McpServerSource, McpServerStatus, ModelChangeSource, PermissionDecisionSource, PermissionMode, PermissionPromptRequest, PermissionRule, ReasoningSummary, RemediationAction, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompleteData, TaskCompletionOutcome, UserToolSessionApproval, Verbosity } from "./session-events.js";
6
+ import type { AbortReason, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, IndexedSearchState, ManagedSettingsResolvedData, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerMetadata, McpServerSource, McpServerStatus, ModelChangeSource, ModelProviderKind, ModelProviderRef, PermissionDecisionSource, PermissionMode, PermissionPromptRequest, PermissionRule, ProviderQuotaState, ReasoningSummary, RemediationAction, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompleteData, TaskCompletionOutcome, UsageGetMetricsResult, UserToolSessionApproval, Verbosity } from "./session-events.js";
7
7
  /** A value that can be represented losslessly on the SDK JSON wire. */
8
8
  export type JsonValue = null | boolean | number | string | JsonValue[] | {
9
9
  [key: string]: JsonValue;
@@ -3502,6 +3502,11 @@ export type SessionContextInfo = {
3502
3502
  * The model used for token counting
3503
3503
  */
3504
3504
  modelName: string;
3505
+ provider?: ModelProviderRef;
3506
+ /**
3507
+ * Provider-owned model display label, or the Auto routing label. Presentation only; modelName remains the tokenization identity.
3508
+ */
3509
+ displayModelName?: string;
3505
3510
  /**
3506
3511
  * Tokens consumed by the system prompt
3507
3512
  */
@@ -3621,18 +3626,6 @@ export type ModelPickerPriceCategory =
3621
3626
  | "high"
3622
3627
  /** Highest relative token cost tier. */
3623
3628
  | "very_high";
3624
- /**
3625
- * The neutral kind of a model provider — the model analog of `AccountKind`. A model provider is the live, entitled source a model came from; central code never branches on this beyond a single dispatch.
3626
- *
3627
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
3628
- * via the `definition` "ModelProviderKind".
3629
- */
3630
- /** @experimental */
3631
- export type ModelProviderKind =
3632
- /** GitHub Copilot / CAPI models, spawned by a github-resolving account that holds a Copilot seat. */
3633
- "copilot"
3634
- /** Microsoft 365 Copilot (Loki) inference models, spawned by a resolvable Entra-derived Loki account. */
3635
- | "loki";
3636
3629
  /**
3637
3630
  * Optional listing options.
3638
3631
  *
@@ -4180,6 +4173,14 @@ export type QueuePendingItemsKind =
4180
4173
  "message"
4181
4174
  /** A queued slash command or model-change command. */
4182
4175
  | "command";
4176
+ /**
4177
+ * Pending warnings returned and cleared by session.quota.takeWarnings.
4178
+ *
4179
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
4180
+ * via the `definition` "QuotaTakeWarningsResult".
4181
+ */
4182
+ /** @experimental */
4183
+ export type QuotaTakeWarningsResult = QuotaWarningProjection[];
4183
4184
  /**
4184
4185
  * State of the runtime-managed remote-control singleton.
4185
4186
  *
@@ -4700,6 +4701,30 @@ export type SessionsOpenProgressStatus =
4700
4701
  "in-progress"
4701
4702
  /** The step has completed successfully. */
4702
4703
  | "complete";
4704
+ /**
4705
+ * Copilot plan tier used by the session quota projection.
4706
+ *
4707
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
4708
+ * via the `definition` "SessionQuotaPlanTier".
4709
+ */
4710
+ /** @experimental */
4711
+ export type SessionQuotaPlanTier =
4712
+ /** Copilot Free. */
4713
+ "free"
4714
+ /** Copilot education entitlement. */
4715
+ | "edu"
4716
+ /** Copilot Pro. */
4717
+ | "pro"
4718
+ /** Copilot Pro+. */
4719
+ | "pro_plus"
4720
+ /** Copilot Business. */
4721
+ | "business"
4722
+ /** Copilot Enterprise. */
4723
+ | "enterprise"
4724
+ /** Copilot Max. */
4725
+ | "max"
4726
+ /** The account's plan tier is not known. */
4727
+ | "unknown";
4703
4728
  /**
4704
4729
  * Client metadata outcome for one requested local session.
4705
4730
  *
@@ -5859,6 +5884,14 @@ export type SessionGitHubAuthLogoutResult = boolean;
5859
5884
  */
5860
5885
  /** @experimental */
5861
5886
  export type SessionGitHubAuthLogoutUserResult = boolean;
5887
+ /**
5888
+ * Pending warnings returned and cleared by session.quota.takeWarnings.
5889
+ *
5890
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
5891
+ * via the `definition` "SessionQuotaTakeWarningsResult".
5892
+ */
5893
+ /** @experimental */
5894
+ export type SessionQuotaTakeWarningsResult = QuotaWarningProjection[];
5862
5895
  /**
5863
5896
  * Parameters for aborting the current turn
5864
5897
  *
@@ -9814,10 +9847,18 @@ export interface CurrentModel {
9814
9847
  * Currently active model identifier
9815
9848
  */
9816
9849
  modelId?: string;
9850
+ /**
9851
+ * Provider selected for this model. Together with modelId, identifies a catalog entry even when providers serve the same model. Omitted for unattributed legacy selections.
9852
+ */
9853
+ providerId?: string;
9817
9854
  /**
9818
9855
  * Captured base model to restore when leaving plan mode. Omitted outside plan mode or when no plan override has captured a base model. Persistent agent model requirements apply to this model rather than the temporary plan model.
9819
9856
  */
9820
9857
  planBaseModelId?: string;
9858
+ /**
9859
+ * Provider of planBaseModelId, when that saved selection is provider-qualified.
9860
+ */
9861
+ planBaseProviderId?: string;
9821
9862
  /**
9822
9863
  * Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot.
9823
9864
  */
@@ -12092,6 +12133,10 @@ export interface HostGitHubEnvironmentOptions {
12092
12133
  * Stable application installation identity, reused across host restarts.
12093
12134
  */
12094
12135
  computeId: string;
12136
+ /**
12137
+ * Require sealed, connection-bound authentication (default true), independent of listener address. False permits unsealed direct credentials and unbound sealed relay credentials; use only when the caller fully controls and trusts the direct transport. Relay token encryption remains mandatory.
12138
+ */
12139
+ requireConnectionBinding?: boolean;
12095
12140
  }
12096
12141
  /**
12097
12142
  * Stops a connection-owned listener and joins its teardown.
@@ -12162,6 +12207,66 @@ export interface HostExitedNotification {
12162
12207
  */
12163
12208
  error?: string | null;
12164
12209
  }
12210
+ /**
12211
+ * Reads a running host's catalog or the runtime's saved default catalog.
12212
+ *
12213
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
12214
+ * via the `definition` "HostListSessionsRequest".
12215
+ */
12216
+ /** @experimental */
12217
+ export interface HostListSessionsRequest {
12218
+ /**
12219
+ * Listener UUID returned by host.start; the caller must own it. Omit to read
12220
+ * the saved default compute-identity catalog without starting a listener.
12221
+ */
12222
+ hostId?: string;
12223
+ }
12224
+ /**
12225
+ * The complete live and dormant advertised catalog, without subscribing to sessions.
12226
+ *
12227
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
12228
+ * via the `definition` "HostListSessionsResult".
12229
+ */
12230
+ /** @experimental */
12231
+ export interface HostListSessionsResult {
12232
+ /**
12233
+ * Complete advertised session summaries, in the host's catalog order.
12234
+ */
12235
+ sessions: HostSessionSummary[];
12236
+ }
12237
+ /**
12238
+ * Metadata advertised by the AHP host, not a guarantee that history can be resumed.
12239
+ *
12240
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
12241
+ * via the `definition` "HostSessionSummary".
12242
+ */
12243
+ /** @experimental */
12244
+ export interface HostSessionSummary {
12245
+ /**
12246
+ * Stable AHP resource URI identifying the session on this host.
12247
+ */
12248
+ resource: string;
12249
+ /**
12250
+ * Authoritative title advertised by the host.
12251
+ */
12252
+ title: string;
12253
+ /**
12254
+ * Session creation time as an ISO 8601 timestamp.
12255
+ */
12256
+ createdAt: string;
12257
+ /**
12258
+ * Last modification time as an ISO 8601 timestamp.
12259
+ */
12260
+ modifiedAt: string;
12261
+ /**
12262
+ * Unsigned 32-bit AHP session status bitset (0..=4294967295); unknown bits must be preserved.
12263
+ */
12264
+ status: number;
12265
+ /**
12266
+ * Optional activity description advertised by the host.
12267
+ */
12268
+ activity?: string;
12269
+ }
12165
12270
  /**
12166
12271
  * Local WebSocket transport options.
12167
12272
  *
@@ -12318,6 +12423,11 @@ export interface HostSessionCreateRequest {
12318
12423
  * Resume an app-owned durable session instead of creating a new session.
12319
12424
  */
12320
12425
  resume?: boolean;
12426
+ /**
12427
+ * For an explicit publication, borrow an existing owning-connection resident
12428
+ * instead of invoking the resume factory. Cold sessions still use the factory.
12429
+ */
12430
+ preferResident?: boolean;
12321
12431
  /**
12322
12432
  * Host-selected SDK creation or resume settings, without executable callbacks or tools.
12323
12433
  */
@@ -12380,6 +12490,10 @@ export interface HostStartRequest {
12380
12490
  * Caller-generated UUID identifying this connection-owned listener.
12381
12491
  */
12382
12492
  hostId: string;
12493
+ /**
12494
+ * Stable application identity selecting its durable host catalog. Defaults to the persisted runtime compute GUID; must agree with githubEnvironment.computeId when both are supplied.
12495
+ */
12496
+ computeId?: string;
12383
12497
  localServer?: HostLocalServerOptions;
12384
12498
  githubEnvironment?: HostGitHubEnvironmentOptions;
12385
12499
  /**
@@ -14607,7 +14721,7 @@ export interface McpConfiguredServer {
14607
14721
  * Human-readable display name supplied by configuration.
14608
14722
  */
14609
14723
  displayName?: string;
14610
- live?: McpConfiguredServerState;
14724
+ live: McpConfiguredServerState;
14611
14725
  }
14612
14726
  /**
14613
14727
  * Observational state for a matching already materialized MCP server.
@@ -16330,6 +16444,10 @@ export interface MetadataContextInfoRequest {
16330
16444
  * Model identifier used for tokenization. Omit to use the session default. Used both for token counting and to compute display values.
16331
16445
  */
16332
16446
  selectedModel?: string;
16447
+ /**
16448
+ * Provider owning selectedModel. Omit to use the current provider for the current model, or deterministic legacy lookup for a different model.
16449
+ */
16450
+ providerId?: string;
16333
16451
  }
16334
16452
  /**
16335
16453
  * Token breakdown for the session's current context window, or null if uninitialized.
@@ -16776,24 +16894,6 @@ export interface ModelMessage {
16776
16894
  */
16777
16895
  message: string;
16778
16896
  }
16779
- /**
16780
- * A neutral reference to the model provider that produced a model: an opaque id, a human-readable label, and the provider kind. Carried on each enumerated Model so consumers can group by provider without reaching into a provider-shaped internal type.
16781
- *
16782
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
16783
- * via the `definition` "ModelProviderRef".
16784
- */
16785
- /** @experimental */
16786
- export interface ModelProviderRef {
16787
- /**
16788
- * Opaque, stable id of the provider that produced this model. Matches the enumerated `ModelProviderDescriptor.id`.
16789
- */
16790
- id: string;
16791
- /**
16792
- * Human-readable provider label, owned by the runtime so every consumer renders identical text.
16793
- */
16794
- label: string;
16795
- kind: ModelProviderKind;
16796
- }
16797
16897
  /**
16798
16898
  * Managed, repository, and CLI model overrides to overlay onto the session at startup.
16799
16899
  *
@@ -16819,6 +16919,10 @@ export interface ModelApplyStartupOverlayRequest {
16819
16919
  * Model selected by repository settings, when configured.
16820
16920
  */
16821
16921
  repoModel?: string;
16922
+ /**
16923
+ * Provider owning the repository-selected model. Omitted repository provider identity retains legacy bare-model behavior.
16924
+ */
16925
+ repoModelProviderId?: string;
16822
16926
  /**
16823
16927
  * Reasoning effort selected by repository settings, when configured.
16824
16928
  */
@@ -17530,9 +17634,13 @@ export interface ModelSwitchConfirmation {
17530
17634
  /** @experimental */
17531
17635
  export interface ModelSwitchToRequest {
17532
17636
  /**
17533
- * Model selection id to switch to, as returned by `list`. A bare id (e.g. `claude-sonnet-4.6`) names a Copilot (CAPI) model; a provider-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a registry BYOK model.
17637
+ * Model id to switch to, as returned by `list`. Include providerId to select an exact catalog entry when providers share the id. Without providerId, a bare id retains incumbent selection behavior; a registry-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a BYOK model.
17534
17638
  */
17535
17639
  modelId: string;
17640
+ /**
17641
+ * Provider id from the selected list entry's provider reference. Selects this exact provider/model pair; an unavailable pair fails rather than using another provider. Omit for deterministic legacy bare-model selection.
17642
+ */
17643
+ providerId?: string;
17536
17644
  /**
17537
17645
  * Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`.
17538
17646
  */
@@ -17637,6 +17745,10 @@ export interface ModeSetRequest {
17637
17745
  * Dedicated model to use in plan mode, when configured.
17638
17746
  */
17639
17747
  planModel?: string;
17748
+ /**
17749
+ * Provider owning planModel. Omit for legacy bare-model selection.
17750
+ */
17751
+ planModelProviderId?: string;
17640
17752
  /**
17641
17753
  * Reasoning effort to use with the dedicated plan model.
17642
17754
  */
@@ -17827,6 +17939,52 @@ export interface OptionsUpdateAdditionalContentExclusionPolicyRuleSource {
17827
17939
  */
17828
17940
  type: string;
17829
17941
  }
17942
+ /**
17943
+ * External tool call of the session or one of its sub-agents that is still waiting for session.tools.handlePendingToolCall.
17944
+ *
17945
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
17946
+ * via the `definition` "PendingExternalToolRequest".
17947
+ */
17948
+ /** @experimental */
17949
+ export interface PendingExternalToolRequest {
17950
+ /**
17951
+ * Request ID to pass to session.tools.handlePendingToolCall
17952
+ */
17953
+ requestId: string;
17954
+ /**
17955
+ * Tool call ID assigned to this external tool invocation
17956
+ */
17957
+ toolCallId: string;
17958
+ /**
17959
+ * Name of the external tool to invoke
17960
+ */
17961
+ toolName: string;
17962
+ /**
17963
+ * Arguments to pass to the external tool
17964
+ */
17965
+ arguments?: JsonValue;
17966
+ /**
17967
+ * Stable identity of the provider that offered the tool, for hosts that route extension-owned tools by provider
17968
+ */
17969
+ providerId?: string;
17970
+ /**
17971
+ * Sub-agent instance identifier (the envelope agentId of its events) of the agent that issued the call; absent for calls issued by the root agent
17972
+ */
17973
+ agentId?: string;
17974
+ }
17975
+ /**
17976
+ * External tool calls still waiting for a result.
17977
+ *
17978
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
17979
+ * via the `definition` "PendingExternalToolRequestList".
17980
+ */
17981
+ /** @experimental */
17982
+ export interface PendingExternalToolRequestList {
17983
+ /**
17984
+ * External tool calls of the session and its sub-agents that session.tools.handlePendingToolCall would still accept, in the order they were requested. Includes calls that were pending when the session was last suspended and resumed with pending work continued, so a host that did not observe the original external_tool.requested event can answer them.
17985
+ */
17986
+ items: PendingExternalToolRequest[];
17987
+ }
17830
17988
  /**
17831
17989
  * Pending permission prompt reconstructed from event history, with request ID and user-facing prompt details.
17832
17990
  *
@@ -21066,6 +21224,27 @@ export interface QueueWithdrawMessageResult {
21066
21224
  */
21067
21225
  interrupted: boolean;
21068
21226
  }
21227
+ /**
21228
+ * A pending session quota warning, consumed once by takeWarnings.
21229
+ *
21230
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
21231
+ * via the `definition` "QuotaWarningProjection".
21232
+ */
21233
+ /** @experimental */
21234
+ export interface QuotaWarningProjection {
21235
+ /**
21236
+ * Existing warning category.
21237
+ */
21238
+ warningType: string;
21239
+ /**
21240
+ * User-facing warning text.
21241
+ */
21242
+ message: string;
21243
+ /**
21244
+ * Related account or upgrade link.
21245
+ */
21246
+ url?: string;
21247
+ }
21069
21248
  /**
21070
21249
  * Event type to register consumer interest for, used by runtime gating logic.
21071
21250
  *
@@ -24079,6 +24258,137 @@ export interface SessionPruneResult {
24079
24258
  */
24080
24259
  dryRun: boolean;
24081
24260
  }
24261
+ /**
24262
+ * Existing delegation guidance for an account without delegation access.
24263
+ *
24264
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
24265
+ * via the `definition` "SessionQuotaDelegateWarning".
24266
+ */
24267
+ /** @experimental */
24268
+ export interface SessionQuotaDelegateWarning {
24269
+ /**
24270
+ * User-facing guidance.
24271
+ */
24272
+ text: string;
24273
+ /**
24274
+ * Link to upgrade the account.
24275
+ */
24276
+ url: string;
24277
+ }
24278
+ /**
24279
+ * The incumbent session-owned quota and account projection.
24280
+ *
24281
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
24282
+ * via the `definition` "SessionQuotaProjection".
24283
+ */
24284
+ /** @experimental */
24285
+ export interface SessionQuotaProjection {
24286
+ /**
24287
+ * Known quota snapshots, keyed by the provider's quota type.
24288
+ */
24289
+ snapshots: {
24290
+ [k: string]: SessionQuotaSnapshot | undefined;
24291
+ };
24292
+ /**
24293
+ * Provider-owned account quota state, including snapshots without numeric balances.
24294
+ */
24295
+ providerQuotas?: ProviderQuotaState[];
24296
+ /**
24297
+ * Whether the account uses the free limited Copilot plan.
24298
+ */
24299
+ isFreeUser: boolean;
24300
+ /**
24301
+ * Whether the account uses token-based billing.
24302
+ */
24303
+ isTbbUser: boolean;
24304
+ planTier: SessionQuotaPlanTier;
24305
+ /**
24306
+ * Whether premium-request costs are billable.
24307
+ */
24308
+ premiumRequestsBillable: boolean;
24309
+ /**
24310
+ * Whether model cost columns should be shown.
24311
+ */
24312
+ modelCostColumnVisible: boolean;
24313
+ /**
24314
+ * Whether the account can delegate tasks to GitHub.
24315
+ */
24316
+ delegateAvailable: boolean;
24317
+ /**
24318
+ * Whether the account can sign up for Copilot Free.
24319
+ */
24320
+ canSignupForCopilotFree: boolean;
24321
+ /**
24322
+ * Whether dynamic workflows are enabled for the active account.
24323
+ */
24324
+ dynamicWorkflowsEnabled: boolean;
24325
+ /**
24326
+ * Whether dynamic workflows are visible under the session's feature flags.
24327
+ */
24328
+ dynamicWorkflowsUiVisible: boolean;
24329
+ /**
24330
+ * Upgrade link for a free account.
24331
+ */
24332
+ upgradeUrl?: string;
24333
+ delegateWarning?: SessionQuotaDelegateWarning;
24334
+ }
24335
+ /**
24336
+ * Session quota snapshot, preserving the incumbent numeric units and reset metadata.
24337
+ *
24338
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
24339
+ * via the `definition` "SessionQuotaSnapshot".
24340
+ */
24341
+ /** @experimental */
24342
+ export interface SessionQuotaSnapshot {
24343
+ /**
24344
+ * Whether the entitlement is unlimited.
24345
+ */
24346
+ isUnlimitedEntitlement: boolean;
24347
+ /**
24348
+ * Entitled quantity in this quota's units.
24349
+ */
24350
+ entitlementRequests: number;
24351
+ /**
24352
+ * Consumed quantity in this quota's units.
24353
+ */
24354
+ usedRequests: number;
24355
+ /**
24356
+ * Whether usage is allowed after quota exhaustion.
24357
+ */
24358
+ usageAllowedWithExhaustedQuota: boolean;
24359
+ /**
24360
+ * Additional usage in this quota's units.
24361
+ */
24362
+ overage: number;
24363
+ /**
24364
+ * Whether additional usage is allowed after quota exhaustion.
24365
+ */
24366
+ overageAllowedWithExhaustedQuota: boolean;
24367
+ /**
24368
+ * Percentage of the entitlement remaining.
24369
+ */
24370
+ remainingPercentage: number;
24371
+ /**
24372
+ * Quota reset time in milliseconds since the Unix epoch, when known.
24373
+ */
24374
+ resetDateEpochMs?: number;
24375
+ /**
24376
+ * Whether the reset time is estimated.
24377
+ */
24378
+ resetDateEstimated?: boolean;
24379
+ /**
24380
+ * Whether the provider reports available quota.
24381
+ */
24382
+ hasQuota?: boolean;
24383
+ /**
24384
+ * Whether this quota uses token-based billing.
24385
+ */
24386
+ tokenBasedBilling?: boolean;
24387
+ /**
24388
+ * Additional-usage budget cap, when provided.
24389
+ */
24390
+ overageEntitlement?: number;
24391
+ }
24082
24392
  /**
24083
24393
  * Session IDs to close, deactivate, and delete from disk.
24084
24394
  *
@@ -27164,6 +27474,15 @@ export interface ToolsGetCurrentMetadataResult {
27164
27474
  /** @experimental */
27165
27475
  export interface ToolsInitializeAndValidateResult {
27166
27476
  }
27477
+ /**
27478
+ * No parameters; returns the external tool calls of the session and its sub-agents that are still waiting for a result.
27479
+ *
27480
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
27481
+ * via the `definition` "ToolsListPendingRequestsRequest".
27482
+ */
27483
+ /** @experimental */
27484
+ export interface ToolsListPendingRequestsRequest {
27485
+ }
27167
27486
  /**
27168
27487
  * Optional model identifier whose tool overrides should be applied to the listing.
27169
27488
  *
@@ -27838,219 +28157,6 @@ export interface UpdateSubagentSettingsRequest {
27838
28157
  */
27839
28158
  subagents?: SubagentSettings | null;
27840
28159
  }
27841
- /**
27842
- * Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals.
27843
- *
27844
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
27845
- * via the `definition` "UsageGetMetricsResult".
27846
- */
27847
- /** @experimental */
27848
- export interface UsageGetMetricsResult {
27849
- /**
27850
- * Total user-initiated premium request cost across all models (may be fractional due to multipliers)
27851
- */
27852
- totalPremiumRequestCost: number;
27853
- /**
27854
- * Raw count of user-initiated API requests
27855
- */
27856
- totalUserRequests: number;
27857
- /**
27858
- * Session-wide accumulated nano-AI units cost
27859
- */
27860
- totalNanoAiu?: number;
27861
- /**
27862
- * Session-wide per-token-type accumulated token counts
27863
- */
27864
- tokenDetails?: {
27865
- [k: string]: UsageMetricsTokenDetail | undefined;
27866
- };
27867
- /**
27868
- * Total time spent in model API calls (milliseconds)
27869
- */
27870
- totalApiDurationMs: number;
27871
- /**
27872
- * ISO 8601 timestamp when the session started
27873
- */
27874
- sessionStartTime: string;
27875
- codeChanges: UsageMetricsCodeChanges;
27876
- /**
27877
- * Per-model token and request metrics, keyed by model identifier
27878
- */
27879
- modelMetrics: {
27880
- [k: string]: UsageMetricsModelMetric | undefined;
27881
- };
27882
- /**
27883
- * Per-agent usage metrics, keyed by agent instance identifier. The main conversation uses the stable key `main`.
27884
- */
27885
- agentMetrics?: {
27886
- [k: string]: UsageMetricsAgentMetric | undefined;
27887
- };
27888
- /**
27889
- * Currently active model identifier
27890
- */
27891
- currentModel?: string;
27892
- /**
27893
- * Input tokens from the most recent main-agent API call
27894
- */
27895
- lastCallInputTokens: number;
27896
- /**
27897
- * Output tokens from the most recent main-agent API call
27898
- */
27899
- lastCallOutputTokens: number;
27900
- }
27901
- /**
27902
- * Session-wide token-detail entry containing the accumulated token count for one token type.
27903
- *
27904
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
27905
- * via the `definition` "UsageMetricsTokenDetail".
27906
- */
27907
- /** @experimental */
27908
- export interface UsageMetricsTokenDetail {
27909
- /**
27910
- * Accumulated token count for this token type
27911
- */
27912
- tokenCount: number;
27913
- }
27914
- /**
27915
- * Aggregated code change metrics
27916
- *
27917
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
27918
- * via the `definition` "UsageMetricsCodeChanges".
27919
- */
27920
- /** @experimental */
27921
- export interface UsageMetricsCodeChanges {
27922
- /**
27923
- * Total lines of code added
27924
- */
27925
- linesAdded: number;
27926
- /**
27927
- * Total lines of code removed
27928
- */
27929
- linesRemoved: number;
27930
- /**
27931
- * Number of distinct files modified
27932
- */
27933
- filesModifiedCount: number;
27934
- /**
27935
- * Distinct file paths modified during the session
27936
- */
27937
- filesModified: string[];
27938
- }
27939
- /**
27940
- * Per-model usage metrics, including request counts/costs, token usage, nano-AI units, and per-token-type details.
27941
- *
27942
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
27943
- * via the `definition` "UsageMetricsModelMetric".
27944
- */
27945
- /** @experimental */
27946
- export interface UsageMetricsModelMetric {
27947
- requests: UsageMetricsModelMetricRequests;
27948
- usage: UsageMetricsModelMetricUsage;
27949
- /**
27950
- * Latest known prompt-cache expiration for this model. A timestamp in the past indicates that the observed cache has expired.
27951
- */
27952
- cacheExpiresAt?: string;
27953
- /**
27954
- * Accumulated nano-AI units cost for this model
27955
- */
27956
- totalNanoAiu?: number;
27957
- /**
27958
- * Token count details per type
27959
- */
27960
- tokenDetails?: {
27961
- [k: string]: UsageMetricsModelMetricTokenDetail | undefined;
27962
- };
27963
- }
27964
- /**
27965
- * Request count and cost metrics for this model
27966
- *
27967
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
27968
- * via the `definition` "UsageMetricsModelMetricRequests".
27969
- */
27970
- /** @experimental */
27971
- export interface UsageMetricsModelMetricRequests {
27972
- /**
27973
- * Number of API requests made with this model
27974
- */
27975
- count: number;
27976
- /**
27977
- * User-initiated premium request cost (with multiplier applied)
27978
- */
27979
- cost: number;
27980
- }
27981
- /**
27982
- * Token usage metrics for this model
27983
- *
27984
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
27985
- * via the `definition` "UsageMetricsModelMetricUsage".
27986
- */
27987
- /** @experimental */
27988
- export interface UsageMetricsModelMetricUsage {
27989
- /**
27990
- * Total input tokens consumed
27991
- */
27992
- inputTokens: number;
27993
- /**
27994
- * Total output tokens produced
27995
- */
27996
- outputTokens: number;
27997
- /**
27998
- * Total tokens read from prompt cache
27999
- */
28000
- cacheReadTokens: number;
28001
- /**
28002
- * Total tokens written to prompt cache
28003
- */
28004
- cacheWriteTokens: number;
28005
- /**
28006
- * Total output tokens used for reasoning
28007
- */
28008
- reasoningTokens?: number;
28009
- }
28010
- /**
28011
- * Per-model token-detail entry containing the accumulated token count for one token type.
28012
- *
28013
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
28014
- * via the `definition` "UsageMetricsModelMetricTokenDetail".
28015
- */
28016
- /** @experimental */
28017
- export interface UsageMetricsModelMetricTokenDetail {
28018
- /**
28019
- * Accumulated token count for this token type
28020
- */
28021
- tokenCount: number;
28022
- }
28023
- /**
28024
- * Usage attributed to one agent instance, including its identity, API duration, AI units, and per-model breakdown.
28025
- *
28026
- * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
28027
- * via the `definition` "UsageMetricsAgentMetric".
28028
- */
28029
- /** @experimental */
28030
- export interface UsageMetricsAgentMetric {
28031
- /**
28032
- * Configured agent name, when this is a subagent
28033
- */
28034
- agentName?: string;
28035
- /**
28036
- * Human-readable label for this subagent invocation, copied from the originating `subagent.started` event. For task-tool subagents this is the invocation's task description rather than the agent's configured display name, so group by `agentName` for stable per-agent labels.
28037
- */
28038
- agentDisplayName?: string;
28039
- /**
28040
- * Time spent in model API calls by this agent, in milliseconds
28041
- */
28042
- totalApiDurationMs: number;
28043
- /**
28044
- * Accumulated nano-AI units cost for this agent
28045
- */
28046
- totalNanoAiu: number;
28047
- /**
28048
- * Per-model usage for this agent, keyed by model identifier
28049
- */
28050
- modelMetrics: {
28051
- [k: string]: UsageMetricsModelMetric | undefined;
28052
- };
28053
- }
28054
28160
  /**
28055
28161
  * Result of a user-requested shell command.
28056
28162
  *
@@ -29731,6 +29837,11 @@ export interface HostCreateSessionRequest {
29731
29837
  * Resume an app-owned durable session instead of creating a new session.
29732
29838
  */
29733
29839
  resume?: boolean;
29840
+ /**
29841
+ * For an explicit publication, borrow an existing owning-connection resident
29842
+ * instead of invoking the resume factory. Cold sessions still use the factory.
29843
+ */
29844
+ preferResident?: boolean;
29734
29845
  /**
29735
29846
  * Host-selected SDK creation or resume settings, without executable callbacks or tools.
29736
29847
  */
@@ -29827,6 +29938,18 @@ export interface SessionWorkflowPauseAtCheckpointResult {
29827
29938
  action: WorkflowPauseCheckpointAction;
29828
29939
  }
29829
29940
  /** @experimental */
29941
+ export interface SessionModelClearStartupSeedResult {
29942
+ cleared: boolean;
29943
+ }
29944
+ /** @experimental */
29945
+ export interface SessionModelClearStartupSeedRequest {
29946
+ expectedModel: string;
29947
+ /**
29948
+ * Provider captured with the startup seed; omission matches only an unqualified seed.
29949
+ */
29950
+ expectedProviderId?: string;
29951
+ }
29952
+ /** @experimental */
29830
29953
  export interface SessionModelListRequest {
29831
29954
  /**
29832
29955
  * If true, bypasses the per-session model list cache and re-fetches from CAPI.
@@ -29999,6 +30122,141 @@ export interface SessionHistoryCompactRequest {
29999
30122
  */
30000
30123
  tokenLimit?: number;
30001
30124
  }
30125
+ /**
30126
+ * Internal absolute code-change totals reported by the owning host.
30127
+ *
30128
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
30129
+ * via the `definition` "SessionUsageSetCodeChangesRequest".
30130
+ */
30131
+ /** @experimental */
30132
+ export interface SessionUsageSetCodeChangesRequest {
30133
+ /**
30134
+ * Absolute added-line total, replacing the previous reading.
30135
+ */
30136
+ linesAdded: number;
30137
+ /**
30138
+ * Absolute removed-line total, replacing the previous reading.
30139
+ */
30140
+ linesRemoved: number;
30141
+ /**
30142
+ * Absolute changed-file count; omission preserves the previous count.
30143
+ */
30144
+ filesCount?: number;
30145
+ }
30146
+ /**
30147
+ * The incumbent session-owned quota and account projection.
30148
+ *
30149
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
30150
+ * via the `definition` "SessionQuotaGetResult".
30151
+ */
30152
+ /** @experimental */
30153
+ export interface SessionQuotaGetResult {
30154
+ /**
30155
+ * Known quota snapshots, keyed by the provider's quota type.
30156
+ */
30157
+ snapshots: {
30158
+ [k: string]: SessionQuotaSnapshot | undefined;
30159
+ };
30160
+ /**
30161
+ * Provider-owned account quota state, including snapshots without numeric balances.
30162
+ */
30163
+ providerQuotas?: ProviderQuotaState[];
30164
+ /**
30165
+ * Whether the account uses the free limited Copilot plan.
30166
+ */
30167
+ isFreeUser: boolean;
30168
+ /**
30169
+ * Whether the account uses token-based billing.
30170
+ */
30171
+ isTbbUser: boolean;
30172
+ planTier: SessionQuotaPlanTier;
30173
+ /**
30174
+ * Whether premium-request costs are billable.
30175
+ */
30176
+ premiumRequestsBillable: boolean;
30177
+ /**
30178
+ * Whether model cost columns should be shown.
30179
+ */
30180
+ modelCostColumnVisible: boolean;
30181
+ /**
30182
+ * Whether the account can delegate tasks to GitHub.
30183
+ */
30184
+ delegateAvailable: boolean;
30185
+ /**
30186
+ * Whether the account can sign up for Copilot Free.
30187
+ */
30188
+ canSignupForCopilotFree: boolean;
30189
+ /**
30190
+ * Whether dynamic workflows are enabled for the active account.
30191
+ */
30192
+ dynamicWorkflowsEnabled: boolean;
30193
+ /**
30194
+ * Whether dynamic workflows are visible under the session's feature flags.
30195
+ */
30196
+ dynamicWorkflowsUiVisible: boolean;
30197
+ /**
30198
+ * Upgrade link for a free account.
30199
+ */
30200
+ upgradeUrl?: string;
30201
+ delegateWarning?: SessionQuotaDelegateWarning;
30202
+ }
30203
+ /**
30204
+ * The incumbent session-owned quota and account projection.
30205
+ *
30206
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
30207
+ * via the `definition` "SessionQuotaRefreshResult".
30208
+ */
30209
+ /** @experimental */
30210
+ export interface SessionQuotaRefreshResult {
30211
+ /**
30212
+ * Known quota snapshots, keyed by the provider's quota type.
30213
+ */
30214
+ snapshots: {
30215
+ [k: string]: SessionQuotaSnapshot | undefined;
30216
+ };
30217
+ /**
30218
+ * Provider-owned account quota state, including snapshots without numeric balances.
30219
+ */
30220
+ providerQuotas?: ProviderQuotaState[];
30221
+ /**
30222
+ * Whether the account uses the free limited Copilot plan.
30223
+ */
30224
+ isFreeUser: boolean;
30225
+ /**
30226
+ * Whether the account uses token-based billing.
30227
+ */
30228
+ isTbbUser: boolean;
30229
+ planTier: SessionQuotaPlanTier;
30230
+ /**
30231
+ * Whether premium-request costs are billable.
30232
+ */
30233
+ premiumRequestsBillable: boolean;
30234
+ /**
30235
+ * Whether model cost columns should be shown.
30236
+ */
30237
+ modelCostColumnVisible: boolean;
30238
+ /**
30239
+ * Whether the account can delegate tasks to GitHub.
30240
+ */
30241
+ delegateAvailable: boolean;
30242
+ /**
30243
+ * Whether the account can sign up for Copilot Free.
30244
+ */
30245
+ canSignupForCopilotFree: boolean;
30246
+ /**
30247
+ * Whether dynamic workflows are enabled for the active account.
30248
+ */
30249
+ dynamicWorkflowsEnabled: boolean;
30250
+ /**
30251
+ * Whether dynamic workflows are visible under the session's feature flags.
30252
+ */
30253
+ dynamicWorkflowsUiVisible: boolean;
30254
+ /**
30255
+ * Upgrade link for a free account.
30256
+ */
30257
+ upgradeUrl?: string;
30258
+ delegateWarning?: SessionQuotaDelegateWarning;
30259
+ }
30002
30260
  /** @experimental */
30003
30261
  export interface SessionLimitPredictionPredictRequest {
30004
30262
  /**
@@ -30226,6 +30484,14 @@ export declare function createServerRpc(connection: MessageConnection): {
30226
30484
  * @returns The existing runtime identity and its resource on the listener.
30227
30485
  */
30228
30486
  publishSession: (params: HostPublishSessionRequest) => Promise<HostPublishSessionResult>;
30487
+ /**
30488
+ * Reads the complete advertised live and dormant session catalog of an existing host owned by this connection. Does not start hosting, subscribe to sessions, or guarantee resumability.
30489
+ *
30490
+ * @param params Reads a running host's catalog or the runtime's saved default catalog.
30491
+ *
30492
+ * @returns The complete live and dormant advertised catalog, without subscribing to sessions.
30493
+ */
30494
+ listSessions: (params: HostListSessionsRequest) => Promise<HostListSessionsResult>;
30229
30495
  /**
30230
30496
  * Starts a connection-owned AHP host with explicit localServer and/or githubEnvironment transports as a supervised SDK participant.
30231
30497
  *
@@ -32611,6 +32877,12 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
32611
32877
  * @returns Indicates whether the external tool call result was handled successfully.
32612
32878
  */
32613
32879
  handlePendingToolCall: (params: HandlePendingToolCallRequest) => Promise<HandlePendingToolCallResult>;
32880
+ /**
32881
+ * Lists the external tool calls of the session and its sub-agents that are still waiting for session.tools.handlePendingToolCall.
32882
+ *
32883
+ * @returns External tool calls still waiting for a result.
32884
+ */
32885
+ listPendingRequests: () => Promise<PendingExternalToolRequestList>;
32614
32886
  /**
32615
32887
  * Resolves, builds, and validates the runtime tool list for the session.
32616
32888
  *
@@ -33300,6 +33572,27 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
33300
33572
  getMetrics: () => Promise<UsageGetMetricsResult>;
33301
33573
  };
33302
33574
  /** @experimental */
33575
+ quota: {
33576
+ /**
33577
+ * Gets the session's current quota and account projection without making a network request.
33578
+ *
33579
+ * @returns The incumbent session-owned quota and account projection.
33580
+ */
33581
+ get: () => Promise<SessionQuotaGetResult>;
33582
+ /**
33583
+ * Refreshes the session's provider model catalog bypassing its cache, folds quota snapshots into session state, and returns the updated projection. Failures leave the last known quota intact.
33584
+ *
33585
+ * @returns The incumbent session-owned quota and account projection.
33586
+ */
33587
+ refresh: () => Promise<SessionQuotaRefreshResult>;
33588
+ /**
33589
+ * Returns and clears the session's pending quota warnings. Reading or refreshing quota does not drain warnings.
33590
+ *
33591
+ * @returns Pending warnings returned and cleared by session.quota.takeWarnings.
33592
+ */
33593
+ takeWarnings: () => Promise<SessionQuotaTakeWarningsResult>;
33594
+ };
33595
+ /** @experimental */
33303
33596
  limitPrediction: {
33304
33597
  /**
33305
33598
  * Predicts an AI-credit session limit for the session's resolved model. Returns an unavailable result instead of falling back when the current model is unresolved auto.