@github/copilot-sdk 1.0.18-preview.2 → 1.0.18-preview.4

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
  */
@@ -16330,6 +16371,10 @@ export interface MetadataContextInfoRequest {
16330
16371
  * Model identifier used for tokenization. Omit to use the session default. Used both for token counting and to compute display values.
16331
16372
  */
16332
16373
  selectedModel?: string;
16374
+ /**
16375
+ * Provider owning selectedModel. Omit to use the current provider for the current model, or deterministic legacy lookup for a different model.
16376
+ */
16377
+ providerId?: string;
16333
16378
  }
16334
16379
  /**
16335
16380
  * Token breakdown for the session's current context window, or null if uninitialized.
@@ -16776,24 +16821,6 @@ export interface ModelMessage {
16776
16821
  */
16777
16822
  message: string;
16778
16823
  }
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
16824
  /**
16798
16825
  * Managed, repository, and CLI model overrides to overlay onto the session at startup.
16799
16826
  *
@@ -16819,6 +16846,10 @@ export interface ModelApplyStartupOverlayRequest {
16819
16846
  * Model selected by repository settings, when configured.
16820
16847
  */
16821
16848
  repoModel?: string;
16849
+ /**
16850
+ * Provider owning the repository-selected model. Omitted repository provider identity retains legacy bare-model behavior.
16851
+ */
16852
+ repoModelProviderId?: string;
16822
16853
  /**
16823
16854
  * Reasoning effort selected by repository settings, when configured.
16824
16855
  */
@@ -17530,9 +17561,13 @@ export interface ModelSwitchConfirmation {
17530
17561
  /** @experimental */
17531
17562
  export interface ModelSwitchToRequest {
17532
17563
  /**
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.
17564
+ * 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
17565
  */
17535
17566
  modelId: string;
17567
+ /**
17568
+ * 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.
17569
+ */
17570
+ providerId?: string;
17536
17571
  /**
17537
17572
  * 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
17573
  */
@@ -17637,6 +17672,10 @@ export interface ModeSetRequest {
17637
17672
  * Dedicated model to use in plan mode, when configured.
17638
17673
  */
17639
17674
  planModel?: string;
17675
+ /**
17676
+ * Provider owning planModel. Omit for legacy bare-model selection.
17677
+ */
17678
+ planModelProviderId?: string;
17640
17679
  /**
17641
17680
  * Reasoning effort to use with the dedicated plan model.
17642
17681
  */
@@ -17827,6 +17866,52 @@ export interface OptionsUpdateAdditionalContentExclusionPolicyRuleSource {
17827
17866
  */
17828
17867
  type: string;
17829
17868
  }
17869
+ /**
17870
+ * External tool call of the session or one of its sub-agents that is still waiting for session.tools.handlePendingToolCall.
17871
+ *
17872
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
17873
+ * via the `definition` "PendingExternalToolRequest".
17874
+ */
17875
+ /** @experimental */
17876
+ export interface PendingExternalToolRequest {
17877
+ /**
17878
+ * Request ID to pass to session.tools.handlePendingToolCall
17879
+ */
17880
+ requestId: string;
17881
+ /**
17882
+ * Tool call ID assigned to this external tool invocation
17883
+ */
17884
+ toolCallId: string;
17885
+ /**
17886
+ * Name of the external tool to invoke
17887
+ */
17888
+ toolName: string;
17889
+ /**
17890
+ * Arguments to pass to the external tool
17891
+ */
17892
+ arguments?: JsonValue;
17893
+ /**
17894
+ * Stable identity of the provider that offered the tool, for hosts that route extension-owned tools by provider
17895
+ */
17896
+ providerId?: string;
17897
+ /**
17898
+ * 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
17899
+ */
17900
+ agentId?: string;
17901
+ }
17902
+ /**
17903
+ * External tool calls still waiting for a result.
17904
+ *
17905
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
17906
+ * via the `definition` "PendingExternalToolRequestList".
17907
+ */
17908
+ /** @experimental */
17909
+ export interface PendingExternalToolRequestList {
17910
+ /**
17911
+ * 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.
17912
+ */
17913
+ items: PendingExternalToolRequest[];
17914
+ }
17830
17915
  /**
17831
17916
  * Pending permission prompt reconstructed from event history, with request ID and user-facing prompt details.
17832
17917
  *
@@ -21066,6 +21151,27 @@ export interface QueueWithdrawMessageResult {
21066
21151
  */
21067
21152
  interrupted: boolean;
21068
21153
  }
21154
+ /**
21155
+ * A pending session quota warning, consumed once by takeWarnings.
21156
+ *
21157
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
21158
+ * via the `definition` "QuotaWarningProjection".
21159
+ */
21160
+ /** @experimental */
21161
+ export interface QuotaWarningProjection {
21162
+ /**
21163
+ * Existing warning category.
21164
+ */
21165
+ warningType: string;
21166
+ /**
21167
+ * User-facing warning text.
21168
+ */
21169
+ message: string;
21170
+ /**
21171
+ * Related account or upgrade link.
21172
+ */
21173
+ url?: string;
21174
+ }
21069
21175
  /**
21070
21176
  * Event type to register consumer interest for, used by runtime gating logic.
21071
21177
  *
@@ -24079,6 +24185,137 @@ export interface SessionPruneResult {
24079
24185
  */
24080
24186
  dryRun: boolean;
24081
24187
  }
24188
+ /**
24189
+ * Existing delegation guidance for an account without delegation access.
24190
+ *
24191
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
24192
+ * via the `definition` "SessionQuotaDelegateWarning".
24193
+ */
24194
+ /** @experimental */
24195
+ export interface SessionQuotaDelegateWarning {
24196
+ /**
24197
+ * User-facing guidance.
24198
+ */
24199
+ text: string;
24200
+ /**
24201
+ * Link to upgrade the account.
24202
+ */
24203
+ url: string;
24204
+ }
24205
+ /**
24206
+ * The incumbent session-owned quota and account projection.
24207
+ *
24208
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
24209
+ * via the `definition` "SessionQuotaProjection".
24210
+ */
24211
+ /** @experimental */
24212
+ export interface SessionQuotaProjection {
24213
+ /**
24214
+ * Known quota snapshots, keyed by the provider's quota type.
24215
+ */
24216
+ snapshots: {
24217
+ [k: string]: SessionQuotaSnapshot | undefined;
24218
+ };
24219
+ /**
24220
+ * Provider-owned account quota state, including snapshots without numeric balances.
24221
+ */
24222
+ providerQuotas?: ProviderQuotaState[];
24223
+ /**
24224
+ * Whether the account uses the free limited Copilot plan.
24225
+ */
24226
+ isFreeUser: boolean;
24227
+ /**
24228
+ * Whether the account uses token-based billing.
24229
+ */
24230
+ isTbbUser: boolean;
24231
+ planTier: SessionQuotaPlanTier;
24232
+ /**
24233
+ * Whether premium-request costs are billable.
24234
+ */
24235
+ premiumRequestsBillable: boolean;
24236
+ /**
24237
+ * Whether model cost columns should be shown.
24238
+ */
24239
+ modelCostColumnVisible: boolean;
24240
+ /**
24241
+ * Whether the account can delegate tasks to GitHub.
24242
+ */
24243
+ delegateAvailable: boolean;
24244
+ /**
24245
+ * Whether the account can sign up for Copilot Free.
24246
+ */
24247
+ canSignupForCopilotFree: boolean;
24248
+ /**
24249
+ * Whether dynamic workflows are enabled for the active account.
24250
+ */
24251
+ dynamicWorkflowsEnabled: boolean;
24252
+ /**
24253
+ * Whether dynamic workflows are visible under the session's feature flags.
24254
+ */
24255
+ dynamicWorkflowsUiVisible: boolean;
24256
+ /**
24257
+ * Upgrade link for a free account.
24258
+ */
24259
+ upgradeUrl?: string;
24260
+ delegateWarning?: SessionQuotaDelegateWarning;
24261
+ }
24262
+ /**
24263
+ * Session quota snapshot, preserving the incumbent numeric units and reset metadata.
24264
+ *
24265
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
24266
+ * via the `definition` "SessionQuotaSnapshot".
24267
+ */
24268
+ /** @experimental */
24269
+ export interface SessionQuotaSnapshot {
24270
+ /**
24271
+ * Whether the entitlement is unlimited.
24272
+ */
24273
+ isUnlimitedEntitlement: boolean;
24274
+ /**
24275
+ * Entitled quantity in this quota's units.
24276
+ */
24277
+ entitlementRequests: number;
24278
+ /**
24279
+ * Consumed quantity in this quota's units.
24280
+ */
24281
+ usedRequests: number;
24282
+ /**
24283
+ * Whether usage is allowed after quota exhaustion.
24284
+ */
24285
+ usageAllowedWithExhaustedQuota: boolean;
24286
+ /**
24287
+ * Additional usage in this quota's units.
24288
+ */
24289
+ overage: number;
24290
+ /**
24291
+ * Whether additional usage is allowed after quota exhaustion.
24292
+ */
24293
+ overageAllowedWithExhaustedQuota: boolean;
24294
+ /**
24295
+ * Percentage of the entitlement remaining.
24296
+ */
24297
+ remainingPercentage: number;
24298
+ /**
24299
+ * Quota reset time in milliseconds since the Unix epoch, when known.
24300
+ */
24301
+ resetDateEpochMs?: number;
24302
+ /**
24303
+ * Whether the reset time is estimated.
24304
+ */
24305
+ resetDateEstimated?: boolean;
24306
+ /**
24307
+ * Whether the provider reports available quota.
24308
+ */
24309
+ hasQuota?: boolean;
24310
+ /**
24311
+ * Whether this quota uses token-based billing.
24312
+ */
24313
+ tokenBasedBilling?: boolean;
24314
+ /**
24315
+ * Additional-usage budget cap, when provided.
24316
+ */
24317
+ overageEntitlement?: number;
24318
+ }
24082
24319
  /**
24083
24320
  * Session IDs to close, deactivate, and delete from disk.
24084
24321
  *
@@ -27164,6 +27401,15 @@ export interface ToolsGetCurrentMetadataResult {
27164
27401
  /** @experimental */
27165
27402
  export interface ToolsInitializeAndValidateResult {
27166
27403
  }
27404
+ /**
27405
+ * No parameters; returns the external tool calls of the session and its sub-agents that are still waiting for a result.
27406
+ *
27407
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
27408
+ * via the `definition` "ToolsListPendingRequestsRequest".
27409
+ */
27410
+ /** @experimental */
27411
+ export interface ToolsListPendingRequestsRequest {
27412
+ }
27167
27413
  /**
27168
27414
  * Optional model identifier whose tool overrides should be applied to the listing.
27169
27415
  *
@@ -27838,219 +28084,6 @@ export interface UpdateSubagentSettingsRequest {
27838
28084
  */
27839
28085
  subagents?: SubagentSettings | null;
27840
28086
  }
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
28087
  /**
28055
28088
  * Result of a user-requested shell command.
28056
28089
  *
@@ -29138,6 +29171,23 @@ export interface WorkflowRunRequest {
29138
29171
  args: JsonValue;
29139
29172
  options?: WorkflowRunOptions;
29140
29173
  }
29174
+ /**
29175
+ * Complete text used to generate one session diff. These are display contents, with the same text decoding as the patch, not a file-restore contract.
29176
+ *
29177
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29178
+ * via the `definition` "WorkspaceDiffContents".
29179
+ */
29180
+ /** @experimental */
29181
+ export interface WorkspaceDiffContents {
29182
+ /**
29183
+ * Complete text before the session first changed the file. Omitted when the file did not exist; an empty string represents an existing empty file.
29184
+ */
29185
+ before?: string;
29186
+ /**
29187
+ * Complete current text read when computing the diff. Omitted for a deleted file; an empty string represents an existing empty file.
29188
+ */
29189
+ after?: string;
29190
+ }
29141
29191
  /**
29142
29192
  * A single changed file and its unified diff.
29143
29193
  *
@@ -29163,6 +29213,7 @@ export interface WorkspaceDiffFileChange {
29163
29213
  * Whether the diff content was omitted because it exceeded the per-file size limit.
29164
29214
  */
29165
29215
  isTruncated?: boolean;
29216
+ contents?: WorkspaceDiffContents;
29166
29217
  }
29167
29218
  /**
29168
29219
  * Workspace diff result for the requested mode.
@@ -29317,6 +29368,10 @@ export interface WorkspacesDiffRequest {
29317
29368
  * When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false.
29318
29369
  */
29319
29370
  ignoreWhitespace?: boolean;
29371
+ /**
29372
+ * Include the full before/after text used to compute each session diff. Defaults to false; true is accepted only for session mode. Existing capture/read limits still apply, and binary or unavailable contents are not returned. This can substantially increase response size.
29373
+ */
29374
+ includeContents?: boolean;
29320
29375
  }
29321
29376
  /**
29322
29377
  * Optional session context used when creating a local workspace.
@@ -29805,6 +29860,18 @@ export interface SessionWorkflowPauseAtCheckpointResult {
29805
29860
  action: WorkflowPauseCheckpointAction;
29806
29861
  }
29807
29862
  /** @experimental */
29863
+ export interface SessionModelClearStartupSeedResult {
29864
+ cleared: boolean;
29865
+ }
29866
+ /** @experimental */
29867
+ export interface SessionModelClearStartupSeedRequest {
29868
+ expectedModel: string;
29869
+ /**
29870
+ * Provider captured with the startup seed; omission matches only an unqualified seed.
29871
+ */
29872
+ expectedProviderId?: string;
29873
+ }
29874
+ /** @experimental */
29808
29875
  export interface SessionModelListRequest {
29809
29876
  /**
29810
29877
  * If true, bypasses the per-session model list cache and re-fetches from CAPI.
@@ -29977,6 +30044,141 @@ export interface SessionHistoryCompactRequest {
29977
30044
  */
29978
30045
  tokenLimit?: number;
29979
30046
  }
30047
+ /**
30048
+ * Internal absolute code-change totals reported by the owning host.
30049
+ *
30050
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
30051
+ * via the `definition` "SessionUsageSetCodeChangesRequest".
30052
+ */
30053
+ /** @experimental */
30054
+ export interface SessionUsageSetCodeChangesRequest {
30055
+ /**
30056
+ * Absolute added-line total, replacing the previous reading.
30057
+ */
30058
+ linesAdded: number;
30059
+ /**
30060
+ * Absolute removed-line total, replacing the previous reading.
30061
+ */
30062
+ linesRemoved: number;
30063
+ /**
30064
+ * Absolute changed-file count; omission preserves the previous count.
30065
+ */
30066
+ filesCount?: number;
30067
+ }
30068
+ /**
30069
+ * The incumbent session-owned quota and account projection.
30070
+ *
30071
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
30072
+ * via the `definition` "SessionQuotaGetResult".
30073
+ */
30074
+ /** @experimental */
30075
+ export interface SessionQuotaGetResult {
30076
+ /**
30077
+ * Known quota snapshots, keyed by the provider's quota type.
30078
+ */
30079
+ snapshots: {
30080
+ [k: string]: SessionQuotaSnapshot | undefined;
30081
+ };
30082
+ /**
30083
+ * Provider-owned account quota state, including snapshots without numeric balances.
30084
+ */
30085
+ providerQuotas?: ProviderQuotaState[];
30086
+ /**
30087
+ * Whether the account uses the free limited Copilot plan.
30088
+ */
30089
+ isFreeUser: boolean;
30090
+ /**
30091
+ * Whether the account uses token-based billing.
30092
+ */
30093
+ isTbbUser: boolean;
30094
+ planTier: SessionQuotaPlanTier;
30095
+ /**
30096
+ * Whether premium-request costs are billable.
30097
+ */
30098
+ premiumRequestsBillable: boolean;
30099
+ /**
30100
+ * Whether model cost columns should be shown.
30101
+ */
30102
+ modelCostColumnVisible: boolean;
30103
+ /**
30104
+ * Whether the account can delegate tasks to GitHub.
30105
+ */
30106
+ delegateAvailable: boolean;
30107
+ /**
30108
+ * Whether the account can sign up for Copilot Free.
30109
+ */
30110
+ canSignupForCopilotFree: boolean;
30111
+ /**
30112
+ * Whether dynamic workflows are enabled for the active account.
30113
+ */
30114
+ dynamicWorkflowsEnabled: boolean;
30115
+ /**
30116
+ * Whether dynamic workflows are visible under the session's feature flags.
30117
+ */
30118
+ dynamicWorkflowsUiVisible: boolean;
30119
+ /**
30120
+ * Upgrade link for a free account.
30121
+ */
30122
+ upgradeUrl?: string;
30123
+ delegateWarning?: SessionQuotaDelegateWarning;
30124
+ }
30125
+ /**
30126
+ * The incumbent session-owned quota and account projection.
30127
+ *
30128
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
30129
+ * via the `definition` "SessionQuotaRefreshResult".
30130
+ */
30131
+ /** @experimental */
30132
+ export interface SessionQuotaRefreshResult {
30133
+ /**
30134
+ * Known quota snapshots, keyed by the provider's quota type.
30135
+ */
30136
+ snapshots: {
30137
+ [k: string]: SessionQuotaSnapshot | undefined;
30138
+ };
30139
+ /**
30140
+ * Provider-owned account quota state, including snapshots without numeric balances.
30141
+ */
30142
+ providerQuotas?: ProviderQuotaState[];
30143
+ /**
30144
+ * Whether the account uses the free limited Copilot plan.
30145
+ */
30146
+ isFreeUser: boolean;
30147
+ /**
30148
+ * Whether the account uses token-based billing.
30149
+ */
30150
+ isTbbUser: boolean;
30151
+ planTier: SessionQuotaPlanTier;
30152
+ /**
30153
+ * Whether premium-request costs are billable.
30154
+ */
30155
+ premiumRequestsBillable: boolean;
30156
+ /**
30157
+ * Whether model cost columns should be shown.
30158
+ */
30159
+ modelCostColumnVisible: boolean;
30160
+ /**
30161
+ * Whether the account can delegate tasks to GitHub.
30162
+ */
30163
+ delegateAvailable: boolean;
30164
+ /**
30165
+ * Whether the account can sign up for Copilot Free.
30166
+ */
30167
+ canSignupForCopilotFree: boolean;
30168
+ /**
30169
+ * Whether dynamic workflows are enabled for the active account.
30170
+ */
30171
+ dynamicWorkflowsEnabled: boolean;
30172
+ /**
30173
+ * Whether dynamic workflows are visible under the session's feature flags.
30174
+ */
30175
+ dynamicWorkflowsUiVisible: boolean;
30176
+ /**
30177
+ * Upgrade link for a free account.
30178
+ */
30179
+ upgradeUrl?: string;
30180
+ delegateWarning?: SessionQuotaDelegateWarning;
30181
+ }
29980
30182
  /** @experimental */
29981
30183
  export interface SessionLimitPredictionPredictRequest {
29982
30184
  /**
@@ -32589,6 +32791,12 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
32589
32791
  * @returns Indicates whether the external tool call result was handled successfully.
32590
32792
  */
32591
32793
  handlePendingToolCall: (params: HandlePendingToolCallRequest) => Promise<HandlePendingToolCallResult>;
32794
+ /**
32795
+ * Lists the external tool calls of the session and its sub-agents that are still waiting for session.tools.handlePendingToolCall.
32796
+ *
32797
+ * @returns External tool calls still waiting for a result.
32798
+ */
32799
+ listPendingRequests: () => Promise<PendingExternalToolRequestList>;
32592
32800
  /**
32593
32801
  * Resolves, builds, and validates the runtime tool list for the session.
32594
32802
  *
@@ -33278,6 +33486,27 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
33278
33486
  getMetrics: () => Promise<UsageGetMetricsResult>;
33279
33487
  };
33280
33488
  /** @experimental */
33489
+ quota: {
33490
+ /**
33491
+ * Gets the session's current quota and account projection without making a network request.
33492
+ *
33493
+ * @returns The incumbent session-owned quota and account projection.
33494
+ */
33495
+ get: () => Promise<SessionQuotaGetResult>;
33496
+ /**
33497
+ * 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.
33498
+ *
33499
+ * @returns The incumbent session-owned quota and account projection.
33500
+ */
33501
+ refresh: () => Promise<SessionQuotaRefreshResult>;
33502
+ /**
33503
+ * Returns and clears the session's pending quota warnings. Reading or refreshing quota does not drain warnings.
33504
+ *
33505
+ * @returns Pending warnings returned and cleared by session.quota.takeWarnings.
33506
+ */
33507
+ takeWarnings: () => Promise<SessionQuotaTakeWarningsResult>;
33508
+ };
33509
+ /** @experimental */
33281
33510
  limitPrediction: {
33282
33511
  /**
33283
33512
  * 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.