@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.
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Union of all session event variants emitted by the Copilot CLI runtime.
7
7
  */
8
- export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | ContextChangedEvent | UsageInfoEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantUsageEvent | ModelCallFailureEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | BinaryAssetEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
8
+ export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | ScheduleRearmedEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | ContextChangedEvent | UsageInfoEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantIdleEvent | AssistantUsageEvent | ModelCallFailureEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | BinaryAssetEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | McpHeadersRefreshRequiredEvent | McpHeadersRefreshCompletedEvent | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | CanvasUnavailableEvent | CanvasRecordedEvent | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
9
9
  /**
10
10
  * Hosting platform type of the repository (github or ado)
11
11
  */
@@ -111,9 +111,9 @@ export type UserMessageAgentMode =
111
111
  /** The agent is in shell-focused UI mode. */
112
112
  | "shell";
113
113
  /**
114
- * A user message attachment — a file, directory, code selection, blob, GitHub reference, or extension-supplied context payload
114
+ * A user message attachment — a file, directory, code selection, blob, GitHub reference, GitHub-anchored pointer, or extension-supplied context payload
115
115
  */
116
- export type Attachment = AttachmentFile | AttachmentDirectory | AttachmentSelection | AttachmentGitHubReference | AttachmentBlob | AttachmentExtensionContext;
116
+ export type Attachment = AttachmentFile | AttachmentDirectory | AttachmentSelection | AttachmentGitHubReference | AttachmentGitHubCommit | AttachmentGitHubRelease | AttachmentGitHubActionsJob | AttachmentGitHubRepository | AttachmentGitHubFileDiff | AttachmentGitHubTreeComparison | AttachmentGitHubUrl | AttachmentGitHubFile | AttachmentGitHubSnippet | AttachmentBlob | AttachmentExtensionContext;
117
117
  /**
118
118
  * Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable
119
119
  */
@@ -132,6 +132,16 @@ export type AttachmentGitHubReferenceType =
132
132
  | "pr"
133
133
  /** GitHub discussion reference. */
134
134
  | "discussion";
135
+ /**
136
+ * How this user message was delivered to the agentic loop, relative to whether the loop was already running. This is the timing axis only; the message's origin (human vs. system/command/schedule/skill/etc.) is carried separately by `source`. A system-injected message has a delivery too — e.g. a background-task notification waking an idle agent is `idle`, the same mechanism as a human starting a fresh turn.
137
+ */
138
+ export type UserMessageDelivery =
139
+ /** Delivered while the loop was idle; starts its own run immediately (a human's fresh turn, or a system notification waking an idle agent). */
140
+ "idle"
141
+ /** Injected into the current in-flight run while the agent was busy (immediate mode). */
142
+ | "steering"
143
+ /** Enqueued while the agent was busy; processed as its own run afterward. */
144
+ | "queued";
135
145
  /**
136
146
  * The system that produced a citation.
137
147
  */
@@ -355,6 +365,18 @@ export type ElicitationCompletedAction =
355
365
  | "decline"
356
366
  /** The user dismissed the request. */
357
367
  | "cancel";
368
+ /**
369
+ * Reason the runtime is requesting host-provided MCP OAuth credentials
370
+ */
371
+ export type McpOauthRequestReason =
372
+ /** Initial credentials are required before connecting to the MCP server. */
373
+ "initial"
374
+ /** The current host-provided credential was rejected and a replacement is requested. */
375
+ | "refresh"
376
+ /** The server requires a new host authorization flow before continuing. */
377
+ | "reauth"
378
+ /** The server requires a credential with additional scope or audience. */
379
+ | "upscope";
358
380
  /**
359
381
  * How the pending MCP OAuth request was completed
360
382
  */
@@ -363,6 +385,26 @@ export type McpOauthCompletionOutcome =
363
385
  "token"
364
386
  /** The request completed without an OAuth provider. */
365
387
  | "cancelled";
388
+ /**
389
+ * Why dynamic headers are being requested.
390
+ */
391
+ export type McpHeadersRefreshRequiredReason =
392
+ /** The transport is making its first dynamic header request for this server. */
393
+ "startup"
394
+ /** The previously cached dynamic headers expired. */
395
+ | "ttl-expired"
396
+ /** The server returned 401 and stale dynamic headers were invalidated. */
397
+ | "auth-failed";
398
+ /**
399
+ * How the pending MCP headers refresh request resolved.
400
+ */
401
+ export type McpHeadersRefreshCompletedOutcome =
402
+ /** The host supplied dynamic headers. */
403
+ "headers"
404
+ /** The host responded with no dynamic headers. */
405
+ | "none"
406
+ /** No response arrived within the bounded window. */
407
+ | "timeout";
366
408
  /**
367
409
  * The user's auto-mode-switch choice
368
410
  */
@@ -467,14 +509,6 @@ export type ExtensionsLoadedExtensionStatus =
467
509
  | "failed"
468
510
  /** The extension process is starting. */
469
511
  | "starting";
470
- /**
471
- * Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding.
472
- */
473
- export type CanvasOpenedAvailability =
474
- /** Provider connection is live; actions can be invoked. */
475
- "ready"
476
- /** Provider has gone away; the instance is awaiting rebinding. */
477
- | "stale";
478
512
  /**
479
513
  * Session event "session.start". Session initialization metadata including context and configuration
480
514
  */
@@ -539,6 +573,7 @@ export interface StartData {
539
573
  * Whether this session supports remote steering via GitHub
540
574
  */
541
575
  remoteSteerable?: boolean;
576
+ responseBudget?: ResponseBudgetConfig;
542
577
  /**
543
578
  * Model selected at session creation time, if any
544
579
  */
@@ -590,6 +625,19 @@ export interface WorkingDirectoryContext {
590
625
  */
591
626
  repositoryHost?: string;
592
627
  }
628
+ /**
629
+ * Optional response budget limits.
630
+ */
631
+ export interface ResponseBudgetConfig {
632
+ /**
633
+ * Maximum AI Credits allowed while responding to one top-level user message.
634
+ */
635
+ maxAiCredits?: number;
636
+ /**
637
+ * Maximum model-call iterations allowed while responding to one top-level user message.
638
+ */
639
+ maxModelIterations?: number;
640
+ }
593
641
  /**
594
642
  * Session event "session.resume". Session resume metadata including current context and event count
595
643
  */
@@ -654,6 +702,10 @@ export interface ResumeData {
654
702
  * Whether this session supports remote steering via GitHub
655
703
  */
656
704
  remoteSteerable?: boolean;
705
+ /**
706
+ * Response budget limits currently configured at resume time; null when no budget is active
707
+ */
708
+ responseBudget?: ResponseBudgetConfig | null;
657
709
  /**
658
710
  * ISO 8601 timestamp when the session was resumed
659
711
  */
@@ -917,6 +969,10 @@ export interface ScheduleCreatedData {
917
969
  * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`)
918
970
  */
919
971
  recurring?: boolean;
972
+ /**
973
+ * True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled rather than auto-computed.
974
+ */
975
+ selfPaced?: boolean;
920
976
  /**
921
977
  * IANA timezone the `cron` expression is evaluated in
922
978
  */
@@ -961,6 +1017,49 @@ export interface ScheduleCancelledData {
961
1017
  */
962
1018
  id: number;
963
1019
  }
1020
+ /**
1021
+ * Session event "session.schedule_rearmed". Self-paced schedule re-armed for its next run
1022
+ */
1023
+ export interface ScheduleRearmedEvent {
1024
+ /**
1025
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1026
+ */
1027
+ agentId?: string;
1028
+ data: ScheduleRearmedData;
1029
+ /**
1030
+ * When true, the event is transient and not persisted to the session event log on disk
1031
+ */
1032
+ ephemeral?: boolean;
1033
+ /**
1034
+ * Unique event identifier (UUID v4), generated when the event is emitted
1035
+ */
1036
+ id: string;
1037
+ /**
1038
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
1039
+ */
1040
+ parentId: string | null;
1041
+ /**
1042
+ * ISO 8601 timestamp when the event was created
1043
+ */
1044
+ timestamp: string;
1045
+ /**
1046
+ * Type discriminator. Always "session.schedule_rearmed".
1047
+ */
1048
+ type: "session.schedule_rearmed";
1049
+ }
1050
+ /**
1051
+ * Self-paced schedule re-armed for its next run
1052
+ */
1053
+ export interface ScheduleRearmedData {
1054
+ /**
1055
+ * Id of the self-paced schedule that was re-armed
1056
+ */
1057
+ id: number;
1058
+ /**
1059
+ * Absolute time (epoch milliseconds) the model armed the next run to fire
1060
+ */
1061
+ nextRunAt: number;
1062
+ }
964
1063
  /**
965
1064
  * Session event "session.autopilot_objective_changed". Autopilot objective state file operation details indicating what changed
966
1065
  */
@@ -1942,6 +2041,10 @@ export interface CompactionCompleteData {
1942
2041
  * Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call
1943
2042
  */
1944
2043
  serviceRequestId?: string;
2044
+ /**
2045
+ * For failed compaction only: the HTTP status code of the compaction LLM call failure, when it carried one. Absent for successful compaction and for failures without an HTTP status (e.g. an empty model response or a transport error).
2046
+ */
2047
+ statusCode?: number;
1945
2048
  /**
1946
2049
  * Whether compaction completed successfully
1947
2050
  */
@@ -2099,6 +2202,7 @@ export interface UserMessageData {
2099
2202
  * The user's message text as displayed in the timeline
2100
2203
  */
2101
2204
  content: string;
2205
+ delivery?: UserMessageDelivery;
2102
2206
  /**
2103
2207
  * CAPI interaction ID for correlating this user message with its turn
2104
2208
  */
@@ -2154,6 +2258,10 @@ export interface AttachmentFile {
2154
2258
  * Absolute file path
2155
2259
  */
2156
2260
  path: string;
2261
+ /**
2262
+ * Frozen rendered line this attachment contributed to the <tagged_files> prompt block (e.g. "* /path (123 lines)"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. Present only for attachments routed to <tagged_files> (mutually exclusive with assetId, which marks bytes sent natively).
2263
+ */
2264
+ taggedFilesEntry?: string;
2157
2265
  /**
2158
2266
  * Attachment type discriminator
2159
2267
  */
@@ -2184,6 +2292,10 @@ export interface AttachmentDirectory {
2184
2292
  * Absolute directory path
2185
2293
  */
2186
2294
  path: string;
2295
+ /**
2296
+ * Frozen rendered line this attachment contributed to the <tagged_files> prompt block (e.g. "* /path (12 items)"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes.
2297
+ */
2298
+ taggedFilesEntry?: string;
2187
2299
  /**
2188
2300
  * Attachment type discriminator
2189
2301
  */
@@ -2270,6 +2382,231 @@ export interface AttachmentGitHubReference {
2270
2382
  */
2271
2383
  url: string;
2272
2384
  }
2385
+ /**
2386
+ * Pointer to a GitHub commit.
2387
+ */
2388
+ export interface AttachmentGitHubCommit {
2389
+ /**
2390
+ * First line of the commit message
2391
+ */
2392
+ message: string;
2393
+ /**
2394
+ * Full commit SHA
2395
+ */
2396
+ oid: string;
2397
+ repo: GitHubRepoRef;
2398
+ /**
2399
+ * Attachment type discriminator
2400
+ */
2401
+ type: "github_commit";
2402
+ /**
2403
+ * URL to the commit on GitHub
2404
+ */
2405
+ url: string;
2406
+ }
2407
+ /**
2408
+ * Pointer to a GitHub repository.
2409
+ */
2410
+ export interface GitHubRepoRef {
2411
+ /**
2412
+ * Numeric GitHub repository id
2413
+ */
2414
+ id?: number;
2415
+ /**
2416
+ * Repository name (without owner)
2417
+ */
2418
+ name: string;
2419
+ /**
2420
+ * Repository owner login (user or organization)
2421
+ */
2422
+ owner: string;
2423
+ }
2424
+ /**
2425
+ * Pointer to a GitHub release.
2426
+ */
2427
+ export interface AttachmentGitHubRelease {
2428
+ /**
2429
+ * Human-readable release name
2430
+ */
2431
+ name: string;
2432
+ repo: GitHubRepoRef;
2433
+ /**
2434
+ * Git tag the release is anchored to
2435
+ */
2436
+ tagName: string;
2437
+ /**
2438
+ * Attachment type discriminator
2439
+ */
2440
+ type: "github_release";
2441
+ /**
2442
+ * URL to the release on GitHub
2443
+ */
2444
+ url: string;
2445
+ }
2446
+ /**
2447
+ * Pointer to a GitHub Actions job.
2448
+ */
2449
+ export interface AttachmentGitHubActionsJob {
2450
+ /**
2451
+ * Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs.
2452
+ */
2453
+ conclusion?: string;
2454
+ /**
2455
+ * Job id within the workflow run
2456
+ */
2457
+ jobId: number;
2458
+ /**
2459
+ * Display name of the job
2460
+ */
2461
+ jobName: string;
2462
+ repo: GitHubRepoRef;
2463
+ /**
2464
+ * Attachment type discriminator
2465
+ */
2466
+ type: "github_actions_job";
2467
+ /**
2468
+ * URL to the job on GitHub
2469
+ */
2470
+ url: string;
2471
+ /**
2472
+ * Display name of the workflow the job ran in
2473
+ */
2474
+ workflowName: string;
2475
+ }
2476
+ /**
2477
+ * Pointer to a GitHub repository.
2478
+ */
2479
+ export interface AttachmentGitHubRepository {
2480
+ /**
2481
+ * Short description of the repository
2482
+ */
2483
+ description?: string;
2484
+ /**
2485
+ * Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied.
2486
+ */
2487
+ ref?: string;
2488
+ repo: GitHubRepoRef;
2489
+ /**
2490
+ * Attachment type discriminator
2491
+ */
2492
+ type: "github_repository";
2493
+ /**
2494
+ * URL to the repository on GitHub
2495
+ */
2496
+ url: string;
2497
+ }
2498
+ /**
2499
+ * Pointer to a single-file diff. At least one of `head` and `base` must be present.
2500
+ */
2501
+ export interface AttachmentGitHubFileDiff {
2502
+ base?: AttachmentGitHubFileDiffSide;
2503
+ head?: AttachmentGitHubFileDiffSide;
2504
+ /**
2505
+ * Attachment type discriminator
2506
+ */
2507
+ type: "github_file_diff";
2508
+ /**
2509
+ * URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL)
2510
+ */
2511
+ url: string;
2512
+ }
2513
+ /**
2514
+ * One side of a file diff (head or base)
2515
+ */
2516
+ export interface AttachmentGitHubFileDiffSide {
2517
+ /**
2518
+ * Repository-relative path to the file
2519
+ */
2520
+ path: string;
2521
+ /**
2522
+ * Git ref (branch, tag, or commit SHA) the file is read at
2523
+ */
2524
+ ref: string;
2525
+ repo: GitHubRepoRef;
2526
+ }
2527
+ /**
2528
+ * Pointer to a comparison between two git revisions.
2529
+ */
2530
+ export interface AttachmentGitHubTreeComparison {
2531
+ base: AttachmentGitHubTreeComparisonSide;
2532
+ head: AttachmentGitHubTreeComparisonSide;
2533
+ /**
2534
+ * Attachment type discriminator
2535
+ */
2536
+ type: "github_tree_comparison";
2537
+ /**
2538
+ * URL to the comparison on GitHub
2539
+ */
2540
+ url: string;
2541
+ }
2542
+ /**
2543
+ * One side of a tree comparison (head or base)
2544
+ */
2545
+ export interface AttachmentGitHubTreeComparisonSide {
2546
+ repo: GitHubRepoRef;
2547
+ /**
2548
+ * Git revision (branch, tag, or commit SHA)
2549
+ */
2550
+ revision: string;
2551
+ }
2552
+ /**
2553
+ * Generic GitHub URL reference.
2554
+ */
2555
+ export interface AttachmentGitHubUrl {
2556
+ /**
2557
+ * Attachment type discriminator
2558
+ */
2559
+ type: "github_url";
2560
+ /**
2561
+ * URL to the GitHub resource
2562
+ */
2563
+ url: string;
2564
+ }
2565
+ /**
2566
+ * Pointer to a file in a GitHub repository at a specific ref.
2567
+ */
2568
+ export interface AttachmentGitHubFile {
2569
+ /**
2570
+ * Repository-relative path to the file
2571
+ */
2572
+ path: string;
2573
+ /**
2574
+ * Git ref the file is read at (branch, tag, or commit SHA)
2575
+ */
2576
+ ref: string;
2577
+ repo: GitHubRepoRef;
2578
+ /**
2579
+ * Attachment type discriminator
2580
+ */
2581
+ type: "github_file";
2582
+ /**
2583
+ * URL to the file on GitHub
2584
+ */
2585
+ url: string;
2586
+ }
2587
+ /**
2588
+ * Pointer to a line range inside a file in a GitHub repository.
2589
+ */
2590
+ export interface AttachmentGitHubSnippet {
2591
+ lineRange: AttachmentFileLineRange;
2592
+ /**
2593
+ * Repository-relative path to the file
2594
+ */
2595
+ path: string;
2596
+ /**
2597
+ * Git ref the file is read at (branch, tag, or commit SHA)
2598
+ */
2599
+ ref: string;
2600
+ repo: GitHubRepoRef;
2601
+ /**
2602
+ * Attachment type discriminator
2603
+ */
2604
+ type: "github_snippet";
2605
+ /**
2606
+ * URL to the snippet on GitHub (with line anchor)
2607
+ */
2608
+ url: string;
2609
+ }
2273
2610
  /**
2274
2611
  * Blob attachment with inline base64-encoded data
2275
2612
  */
@@ -2989,6 +3326,45 @@ export interface AssistantTurnEndData {
2989
3326
  */
2990
3327
  turnId: string;
2991
3328
  }
3329
+ /**
3330
+ * Session event "assistant.idle". Payload emitted whenever the main agent's processing loop goes idle, including while related background work (running agents or in-flight attached shell commands) is still pending and the session-level idle event is therefore deferred
3331
+ */
3332
+ export interface AssistantIdleEvent {
3333
+ /**
3334
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
3335
+ */
3336
+ agentId?: string;
3337
+ data: AssistantIdleData;
3338
+ /**
3339
+ * Always true for events that are transient and not persisted to the session event log on disk.
3340
+ */
3341
+ ephemeral: true;
3342
+ /**
3343
+ * Unique event identifier (UUID v4), generated when the event is emitted
3344
+ */
3345
+ id: string;
3346
+ /**
3347
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3348
+ */
3349
+ parentId: string | null;
3350
+ /**
3351
+ * ISO 8601 timestamp when the event was created
3352
+ */
3353
+ timestamp: string;
3354
+ /**
3355
+ * Type discriminator. Always "assistant.idle".
3356
+ */
3357
+ type: "assistant.idle";
3358
+ }
3359
+ /**
3360
+ * Payload emitted whenever the main agent's processing loop goes idle, including while related background work (running agents or in-flight attached shell commands) is still pending and the session-level idle event is therefore deferred
3361
+ */
3362
+ export interface AssistantIdleData {
3363
+ /**
3364
+ * True when the preceding agentic loop was cancelled via abort signal
3365
+ */
3366
+ aborted?: boolean;
3367
+ }
2992
3368
  /**
2993
3369
  * Session event "assistant.usage". LLM API call usage metrics including tokens, costs, quotas, and billing information
2994
3370
  */
@@ -3198,6 +3574,7 @@ export interface ModelCallFailureData {
3198
3574
  * GitHub request tracing ID (x-github-request-id header) for server-side log correlation
3199
3575
  */
3200
3576
  providerCallId?: string;
3577
+ requestFingerprint?: ModelCallFailureRequestFingerprint;
3201
3578
  /**
3202
3579
  * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
3203
3580
  */
@@ -3208,6 +3585,39 @@ export interface ModelCallFailureData {
3208
3585
  */
3209
3586
  statusCode?: number;
3210
3587
  }
3588
+ /**
3589
+ * Content-free structural summary of the failing request for diagnosing malformed 4xx calls
3590
+ */
3591
+ export interface ModelCallFailureRequestFingerprint {
3592
+ /**
3593
+ * Total number of image content parts
3594
+ */
3595
+ imagePartCount: number;
3596
+ /**
3597
+ * Image parts whose media type cannot be determined (rejected by strict providers)
3598
+ */
3599
+ imagePartsMissingMediaType: number;
3600
+ /**
3601
+ * Role of the final message in the request
3602
+ */
3603
+ lastMessageRole?: string;
3604
+ /**
3605
+ * Total number of messages in the request
3606
+ */
3607
+ messageCount: number;
3608
+ /**
3609
+ * Tool calls whose name is missing or empty (rejected by strict providers)
3610
+ */
3611
+ namelessToolCallCount: number;
3612
+ /**
3613
+ * Total number of tool calls across assistant messages
3614
+ */
3615
+ toolCallCount: number;
3616
+ /**
3617
+ * Number of "tool" result messages in the request
3618
+ */
3619
+ toolResultMessageCount: number;
3620
+ }
3211
3621
  /**
3212
3622
  * Session event "abort". Turn abort information including the reason for termination
3213
3623
  */
@@ -3354,6 +3764,7 @@ export interface ToolExecutionStartData {
3354
3764
  * Tool call ID of the parent tool invocation when this event originates from a sub-agent
3355
3765
  */
3356
3766
  parentToolCallId?: string;
3767
+ shellToolInfo?: ToolExecutionStartShellToolInfo;
3357
3768
  /**
3358
3769
  * Unique identifier for this tool call
3359
3770
  */
@@ -3368,6 +3779,19 @@ export interface ToolExecutionStartData {
3368
3779
  */
3369
3780
  turnId?: string;
3370
3781
  }
3782
+ /**
3783
+ * Shell-aware path hints for a shell tool's command, captured at start time so consumers can snapshot a file's pre-image before the tool runs.
3784
+ */
3785
+ export interface ToolExecutionStartShellToolInfo {
3786
+ /**
3787
+ * Whether the command includes a file write redirection (e.g., > or >>).
3788
+ */
3789
+ hasWriteFileRedirection: boolean;
3790
+ /**
3791
+ * File paths the command may read or write, derived from the command at start time. Produced by the same shell-aware extractor as PermissionRequestShell.possiblePaths, so it is present even when the command is auto-approved and no permission request fires.
3792
+ */
3793
+ possiblePaths: string[];
3794
+ }
3371
3795
  /**
3372
3796
  * Tool definition metadata, present for MCP tools with MCP Apps support
3373
3797
  */
@@ -4870,6 +5294,14 @@ export interface PermissionRequestShell {
4870
5294
  * URLs that may be accessed by the command
4871
5295
  */
4872
5296
  possibleUrls: PermissionRequestShellPossibleUrl[];
5297
+ /**
5298
+ * True when the model has requested to run this command outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the command runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
5299
+ */
5300
+ requestSandboxBypass?: boolean;
5301
+ /**
5302
+ * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true.
5303
+ */
5304
+ requestSandboxBypassReason?: string;
4873
5305
  /**
4874
5306
  * Tool call ID that triggered this permission request
4875
5307
  */
@@ -6046,6 +6478,7 @@ export interface McpOauthRequiredEvent {
6046
6478
  * OAuth authentication request for an MCP server
6047
6479
  */
6048
6480
  export interface McpOauthRequiredData {
6481
+ reason: McpOauthRequestReason;
6049
6482
  /**
6050
6483
  * Unique identifier for this OAuth request; used to respond via session.mcp.oauth.handlePendingRequest
6051
6484
  */
@@ -6073,6 +6506,10 @@ export interface McpOauthRequiredStaticClientConfig {
6073
6506
  * OAuth client ID for the server
6074
6507
  */
6075
6508
  clientId: string;
6509
+ /**
6510
+ * Optional OAuth client secret for confidential static clients, when the runtime can resolve one
6511
+ */
6512
+ clientSecret?: string;
6076
6513
  /**
6077
6514
  * Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server).
6078
6515
  */
@@ -6091,9 +6528,9 @@ export interface McpOauthWWWAuthenticateParams {
6091
6528
  */
6092
6529
  error?: string;
6093
6530
  /**
6094
- * Protected resource metadata URL from the WWW-Authenticate resource_metadata parameter
6531
+ * Protected resource metadata URL from the WWW-Authenticate resource_metadata parameter, if present
6095
6532
  */
6096
- resourceMetadataUrl: string;
6533
+ resourceMetadataUrl?: string;
6097
6534
  /**
6098
6535
  * Requested OAuth scopes from the WWW-Authenticate scope parameter, if present
6099
6536
  */
@@ -6139,6 +6576,94 @@ export interface McpOauthCompletedData {
6139
6576
  */
6140
6577
  requestId: string;
6141
6578
  }
6579
+ /**
6580
+ * Session event "mcp.headers_refresh_required". Dynamic headers refresh request for a remote MCP server
6581
+ */
6582
+ export interface McpHeadersRefreshRequiredEvent {
6583
+ /**
6584
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
6585
+ */
6586
+ agentId?: string;
6587
+ data: McpHeadersRefreshRequiredData;
6588
+ /**
6589
+ * Always true for events that are transient and not persisted to the session event log on disk.
6590
+ */
6591
+ ephemeral: true;
6592
+ /**
6593
+ * Unique event identifier (UUID v4), generated when the event is emitted
6594
+ */
6595
+ id: string;
6596
+ /**
6597
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
6598
+ */
6599
+ parentId: string | null;
6600
+ /**
6601
+ * ISO 8601 timestamp when the event was created
6602
+ */
6603
+ timestamp: string;
6604
+ /**
6605
+ * Type discriminator. Always "mcp.headers_refresh_required".
6606
+ */
6607
+ type: "mcp.headers_refresh_required";
6608
+ }
6609
+ /**
6610
+ * Dynamic headers refresh request for a remote MCP server
6611
+ */
6612
+ export interface McpHeadersRefreshRequiredData {
6613
+ reason: McpHeadersRefreshRequiredReason;
6614
+ /**
6615
+ * Unique identifier for this headers refresh request; used to respond via session.mcp.headers.handlePendingHeadersRefreshRequest()
6616
+ */
6617
+ requestId: string;
6618
+ /**
6619
+ * Display name of the remote MCP server requesting headers
6620
+ */
6621
+ serverName: string;
6622
+ /**
6623
+ * URL of the remote MCP server requesting headers
6624
+ */
6625
+ serverUrl: string;
6626
+ }
6627
+ /**
6628
+ * Session event "mcp.headers_refresh_completed". MCP headers refresh request completion notification
6629
+ */
6630
+ export interface McpHeadersRefreshCompletedEvent {
6631
+ /**
6632
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
6633
+ */
6634
+ agentId?: string;
6635
+ data: McpHeadersRefreshCompletedData;
6636
+ /**
6637
+ * Always true for events that are transient and not persisted to the session event log on disk.
6638
+ */
6639
+ ephemeral: true;
6640
+ /**
6641
+ * Unique event identifier (UUID v4), generated when the event is emitted
6642
+ */
6643
+ id: string;
6644
+ /**
6645
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
6646
+ */
6647
+ parentId: string | null;
6648
+ /**
6649
+ * ISO 8601 timestamp when the event was created
6650
+ */
6651
+ timestamp: string;
6652
+ /**
6653
+ * Type discriminator. Always "mcp.headers_refresh_completed".
6654
+ */
6655
+ type: "mcp.headers_refresh_completed";
6656
+ }
6657
+ /**
6658
+ * MCP headers refresh request completion notification
6659
+ */
6660
+ export interface McpHeadersRefreshCompletedData {
6661
+ outcome: McpHeadersRefreshCompletedOutcome;
6662
+ /**
6663
+ * Request ID of the resolved headers refresh request
6664
+ */
6665
+ requestId: string;
6666
+ }
6142
6667
  /**
6143
6668
  * Session event "session.custom_notification". Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.
6144
6669
  */
@@ -6854,6 +7379,10 @@ export interface SkillsLoadedData {
6854
7379
  * Schema for the `SkillsLoadedSkill` type.
6855
7380
  */
6856
7381
  export interface SkillsLoadedSkill {
7382
+ /**
7383
+ * Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field
7384
+ */
7385
+ argumentHint?: string;
6857
7386
  /**
6858
7387
  * Description of what the skill does
6859
7388
  */
@@ -7124,6 +7653,7 @@ export interface ExtensionsLoadedExtension {
7124
7653
  /**
7125
7654
  * Session event "session.canvas.opened".
7126
7655
  */
7656
+ /** @experimental */
7127
7657
  export interface CanvasOpenedEvent {
7128
7658
  /**
7129
7659
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -7154,8 +7684,8 @@ export interface CanvasOpenedEvent {
7154
7684
  /**
7155
7685
  * Schema for the `CanvasOpenedData` type.
7156
7686
  */
7687
+ /** @experimental */
7157
7688
  export interface CanvasOpenedData {
7158
- availability: CanvasOpenedAvailability;
7159
7689
  /**
7160
7690
  * Provider-local canvas identifier
7161
7691
  */
@@ -7178,10 +7708,6 @@ export interface CanvasOpenedData {
7178
7708
  * Stable caller-supplied canvas instance identifier
7179
7709
  */
7180
7710
  instanceId: string;
7181
- /**
7182
- * Whether this notification represents an idempotent reopen
7183
- */
7184
- reopen: boolean;
7185
7711
  /**
7186
7712
  * Provider-supplied status text
7187
7713
  */
@@ -7198,6 +7724,7 @@ export interface CanvasOpenedData {
7198
7724
  /**
7199
7725
  * Session event "session.canvas.registry_changed".
7200
7726
  */
7727
+ /** @experimental */
7201
7728
  export interface CanvasRegistryChangedEvent {
7202
7729
  /**
7203
7730
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -7228,6 +7755,7 @@ export interface CanvasRegistryChangedEvent {
7228
7755
  /**
7229
7756
  * Schema for the `CanvasRegistryChangedData` type.
7230
7757
  */
7758
+ /** @experimental */
7231
7759
  export interface CanvasRegistryChangedData {
7232
7760
  /**
7233
7761
  * Canvas declarations currently available
@@ -7237,6 +7765,7 @@ export interface CanvasRegistryChangedData {
7237
7765
  /**
7238
7766
  * Schema for the `CanvasRegistryChangedCanvas` type.
7239
7767
  */
7768
+ /** @experimental */
7240
7769
  export interface CanvasRegistryChangedCanvas {
7241
7770
  /**
7242
7771
  * Actions the agent or host may invoke
@@ -7272,6 +7801,7 @@ export interface CanvasRegistryChangedCanvas {
7272
7801
  /**
7273
7802
  * Schema for the `CanvasRegistryChangedCanvasAction` type.
7274
7803
  */
7804
+ /** @experimental */
7275
7805
  export interface CanvasRegistryChangedCanvasAction {
7276
7806
  /**
7277
7807
  * Action description
@@ -7291,6 +7821,7 @@ export interface CanvasRegistryChangedCanvasAction {
7291
7821
  /**
7292
7822
  * Session event "session.canvas.closed".
7293
7823
  */
7824
+ /** @experimental */
7294
7825
  export interface CanvasClosedEvent {
7295
7826
  /**
7296
7827
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -7321,6 +7852,7 @@ export interface CanvasClosedEvent {
7321
7852
  /**
7322
7853
  * Schema for the `CanvasClosedData` type.
7323
7854
  */
7855
+ /** @experimental */
7324
7856
  export interface CanvasClosedData {
7325
7857
  /**
7326
7858
  * Provider-local canvas identifier
@@ -7335,6 +7867,163 @@ export interface CanvasClosedData {
7335
7867
  */
7336
7868
  instanceId: string;
7337
7869
  }
7870
+ /**
7871
+ * Session event "session.canvas.unavailable". Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume.
7872
+ */
7873
+ /** @experimental */
7874
+ export interface CanvasUnavailableEvent {
7875
+ /**
7876
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
7877
+ */
7878
+ agentId?: string;
7879
+ data: CanvasUnavailableData;
7880
+ /**
7881
+ * Always true for events that are transient and not persisted to the session event log on disk.
7882
+ */
7883
+ ephemeral: true;
7884
+ /**
7885
+ * Unique event identifier (UUID v4), generated when the event is emitted
7886
+ */
7887
+ id: string;
7888
+ /**
7889
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
7890
+ */
7891
+ parentId: string | null;
7892
+ /**
7893
+ * ISO 8601 timestamp when the event was created
7894
+ */
7895
+ timestamp: string;
7896
+ /**
7897
+ * Type discriminator. Always "session.canvas.unavailable".
7898
+ */
7899
+ type: "session.canvas.unavailable";
7900
+ }
7901
+ /**
7902
+ * Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume.
7903
+ */
7904
+ /** @experimental */
7905
+ export interface CanvasUnavailableData {
7906
+ /**
7907
+ * Provider-local canvas identifier
7908
+ */
7909
+ canvasId: string;
7910
+ /**
7911
+ * Owning provider identifier
7912
+ */
7913
+ extensionId: string;
7914
+ /**
7915
+ * Stable caller-supplied identifier of the canvas instance whose provider became unavailable
7916
+ */
7917
+ instanceId: string;
7918
+ }
7919
+ /**
7920
+ * Session event "session.canvas.recorded". Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability.
7921
+ */
7922
+ /** @experimental */
7923
+ export interface CanvasRecordedEvent {
7924
+ /**
7925
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
7926
+ */
7927
+ agentId?: string;
7928
+ data: CanvasRecordedData;
7929
+ /**
7930
+ * When true, the event is transient and not persisted to the session event log on disk
7931
+ */
7932
+ ephemeral?: boolean;
7933
+ /**
7934
+ * Unique event identifier (UUID v4), generated when the event is emitted
7935
+ */
7936
+ id: string;
7937
+ /**
7938
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
7939
+ */
7940
+ parentId: string | null;
7941
+ /**
7942
+ * ISO 8601 timestamp when the event was created
7943
+ */
7944
+ timestamp: string;
7945
+ /**
7946
+ * Type discriminator. Always "session.canvas.recorded".
7947
+ */
7948
+ type: "session.canvas.recorded";
7949
+ }
7950
+ /**
7951
+ * Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability.
7952
+ */
7953
+ /** @experimental */
7954
+ export interface CanvasRecordedData {
7955
+ /**
7956
+ * Provider-local canvas identifier
7957
+ */
7958
+ canvasId: string;
7959
+ /**
7960
+ * Owning provider identifier
7961
+ */
7962
+ extensionId: string;
7963
+ /**
7964
+ * Input supplied when the instance was opened
7965
+ */
7966
+ input?: {
7967
+ [k: string]: unknown | undefined;
7968
+ };
7969
+ /**
7970
+ * Stable caller-supplied canvas instance identifier
7971
+ */
7972
+ instanceId: string;
7973
+ /**
7974
+ * Rendered title
7975
+ */
7976
+ title?: string;
7977
+ }
7978
+ /**
7979
+ * Session event "session.canvas.removed". Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay.
7980
+ */
7981
+ /** @experimental */
7982
+ export interface CanvasRemovedEvent {
7983
+ /**
7984
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
7985
+ */
7986
+ agentId?: string;
7987
+ data: CanvasRemovedData;
7988
+ /**
7989
+ * When true, the event is transient and not persisted to the session event log on disk
7990
+ */
7991
+ ephemeral?: boolean;
7992
+ /**
7993
+ * Unique event identifier (UUID v4), generated when the event is emitted
7994
+ */
7995
+ id: string;
7996
+ /**
7997
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
7998
+ */
7999
+ parentId: string | null;
8000
+ /**
8001
+ * ISO 8601 timestamp when the event was created
8002
+ */
8003
+ timestamp: string;
8004
+ /**
8005
+ * Type discriminator. Always "session.canvas.removed".
8006
+ */
8007
+ type: "session.canvas.removed";
8008
+ }
8009
+ /**
8010
+ * Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay.
8011
+ */
8012
+ /** @experimental */
8013
+ export interface CanvasRemovedData {
8014
+ /**
8015
+ * Provider-local canvas identifier
8016
+ */
8017
+ canvasId: string;
8018
+ /**
8019
+ * Owning provider identifier
8020
+ */
8021
+ extensionId: string;
8022
+ /**
8023
+ * Stable caller-supplied identifier of the canvas instance that was closed
8024
+ */
8025
+ instanceId: string;
8026
+ }
7338
8027
  /**
7339
8028
  * Session event "session.extensions.attachments_pushed".
7340
8029
  */