-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathrpc.ts
More file actions
12052 lines (12039 loc) · 391 KB
/
rpc.ts
File metadata and controls
12052 lines (12039 loc) · 391 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* AUTO-GENERATED FILE - DO NOT EDIT
* Generated from: api.schema.json
*/
import type { MessageConnection } from "vscode-jsonrpc/node.js";
import type { AbortReason, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, McpServerSource, McpServerStatus, PermissionPromptRequest, PermissionRule, ReasoningSummary, SessionEvent, SessionMode, ShutdownType, SkillSource, UserToolSessionApproval } from "./session-events.js";
/**
* Where the agent definition was loaded from
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentInfoSource".
*/
/** @experimental */
export type AgentInfoSource =
/** Agent loaded from the user's personal agent configuration. */
| "user"
/** Agent loaded from the current project's repository configuration. */
| "project"
/** Agent inherited from a parent project or workspace. */
| "inherited"
/** Agent provided by a remote runtime or service. */
| "remote"
/** Agent contributed by an installed plugin. */
| "plugin"
/** Agent built into the Copilot runtime. */
| "builtin";
/**
* Process kind tag for the registry entry
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentRegistryLiveTargetEntryKind".
*/
/** @experimental */
export type AgentRegistryLiveTargetEntryKind =
/** Interactive Copilot CLI exposing a UI server (legacy/normal CLI process) */
| "ui-server"
/** Headless `--server --managed-server` child spawned by a controller */
| "managed-server";
/**
* Coarse lifecycle status of the foreground session
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentRegistryLiveTargetEntryStatus".
*/
/** @experimental */
export type AgentRegistryLiveTargetEntryStatus =
/** Session is actively processing a turn */
| "working"
/** Session is idle, waiting for input */
| "waiting"
/** Last turn completed successfully */
| "done"
/** Session needs user attention (see attentionKind for the specific reason) */
| "attention";
/**
* Kind of attention required when status === "attention". Meaningful only when status === "attention".
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentRegistryLiveTargetEntryAttentionKind".
*/
/** @experimental */
export type AgentRegistryLiveTargetEntryAttentionKind =
/** Session is blocked on an unrecoverable error */
| "error"
/** Session is waiting for a tool-permission decision */
| "permission"
/** Session is waiting for the user to approve or reject a plan */
| "exit_plan"
/** Session is waiting on an elicitation prompt */
| "elicitation"
/** Session is waiting for free-form user input */
| "user_input";
/**
* How the most recent turn ended (clean vs aborted). Lets the renderer distinguish done from done_cancelled.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentRegistryLiveTargetEntryLastTerminalEvent".
*/
/** @experimental */
export type AgentRegistryLiveTargetEntryLastTerminalEvent =
/** Last turn ended cleanly (model returned a final assistant message) */
| "turn_end"
/** Last turn was aborted (e.g. user interrupted) */
| "abort";
/**
* Categorized reason for log-open failure
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentRegistryLogCaptureOpenErrorReason".
*/
/** @experimental */
export type AgentRegistryLogCaptureOpenErrorReason =
/** Filesystem permission denied opening the log file */
| "permission"
/** No space left on device */
| "disk_full"
/** Other / uncategorized open failure */
| "other";
/**
* Permission posture for the new session. 'yolo' requires the controller-local session to currently be in allow-all mode.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentRegistrySpawnPermissionMode".
*/
/** @experimental */
export type AgentRegistrySpawnPermissionMode =
/** Standard permission posture (prompts for each request) */
| "default"
/** Full allow-all (requires the controller-local session to currently be in allow-all mode) */
| "yolo";
/**
* Outcome of an agentRegistry.spawn call.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentRegistrySpawnResult".
*/
/** @experimental */
export type AgentRegistrySpawnResult =
| AgentRegistrySpawnSpawned
| AgentRegistrySpawnError
| AgentRegistrySpawnRegistryTimeout
| AgentRegistrySpawnValidationError;
/**
* Categorized reason for the rejection. Low-cardinality enum so telemetry can aggregate by reason without leaking raw paths or agent/model names.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentRegistrySpawnValidationErrorReason".
*/
/** @experimental */
export type AgentRegistrySpawnValidationErrorReason =
/** Provided cwd does not exist on disk */
| "cwd-not-found"
/** Provided cwd exists but is not a directory */
| "cwd-not-directory"
/** Session name failed validateSessionName */
| "invalid-name"
/** Requested agent name was not found in builtin or custom agents */
| "unknown-agent"
/** Requested model is not available to this session */
| "unknown-model"
/** Caller asked for permissionMode='yolo' but the controller is not currently in allow-all mode */
| "yolo-not-allowed";
/**
* Which parameter field was invalid. Omitted when the rejection is not field-specific.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentRegistrySpawnValidationErrorField".
*/
/** @experimental */
export type AgentRegistrySpawnValidationErrorField =
/** The cwd parameter */
| "cwd"
/** The session name parameter */
| "name"
/** The agentName parameter */
| "agentName"
/** The model parameter */
| "model"
/** The permissionMode parameter */
| "permissionMode";
/**
* The new auth credentials to install on the session. When omitted or `undefined`, the call is a no-op and the session's existing credentials are preserved. The runtime stores the value verbatim and uses it for outbound model/API requests; it does NOT re-validate or re-fetch the associated Copilot user response. Several variants carry secret material; treat this method's params as containing secrets at rest and in transit.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AuthInfo".
*/
/** @experimental */
export type AuthInfo =
| HMACAuthInfo
| EnvAuthInfo
| TokenAuthInfo
| CopilotApiTokenAuthInfo
| UserAuthInfo
| GhCliAuthInfo
| ApiKeyAuthInfo;
/**
* Authentication type
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AuthInfoType".
*/
/** @experimental */
export type AuthInfoType =
/** Authentication provided by a GitHub App HMAC credential. */
| "hmac"
/** Authentication resolved from environment-provided credentials. */
| "env"
/** Authentication from an interactive user sign-in. */
| "user"
/** Authentication delegated to the GitHub CLI. */
| "gh-cli"
/** Authentication from an API key credential. */
| "api-key"
/** Authentication from a GitHub token. */
| "token"
/** Authentication from a Copilot API token. */
| "copilot-api-token";
/**
* Runtime-controlled routing state for an open canvas instance.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "CanvasInstanceAvailability".
*/
/** @experimental */
export type CanvasInstanceAvailability =
/** The owning provider is currently connected and routing calls will be dispatched normally. */
| "ready"
/** The owning provider is not currently connected. Routing calls fail with canvas_provider_unavailable until the agent re-issues open_canvas (which rehydrates via a fresh canvas.open) or the provider reconnects. */
| "stale";
/**
* Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SlashCommandKind".
*/
/** @experimental */
export type SlashCommandKind =
/** Command implemented by the runtime. */
| "builtin"
/** Command backed by a skill. */
| "skill"
/** Command registered by an SDK client or extension. */
| "client";
/**
* Optional completion hint for the input (e.g. 'directory' for filesystem path completion)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SlashCommandInputCompletion".
*/
/** @experimental */
export type SlashCommandInputCompletion = /** Input should complete filesystem directories. */ "directory";
/**
* Result of the queued command execution.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "QueuedCommandResult".
*/
/** @experimental */
export type QueuedCommandResult = QueuedCommandHandled | QueuedCommandNotHandled;
/**
* Neutral SDK discriminator for the connected remote session kind.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ConnectedRemoteSessionMetadataKind".
*/
/** @experimental */
export type ConnectedRemoteSessionMetadataKind =
/** Remote CLI session. */
| "remote-session"
/** GitHub Copilot coding agent session. */
| "coding-agent";
/**
* Controls how MCP tool result content is filtered: none leaves content unchanged, markdown sanitizes HTML while preserving Markdown-friendly output, and hidden_characters removes characters that can hide directives.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ContentFilterMode".
*/
export type ContentFilterMode =
/** Leave MCP tool result content unchanged. */
| "none"
/** Sanitize HTML while preserving Markdown-friendly output. */
| "markdown"
/** Remove characters that can hide directives. */
| "hidden_characters";
/**
* Server transport type: stdio, http, sse (deprecated), or memory
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "DiscoveredMcpServerType".
*/
export type DiscoveredMcpServerType =
/** Server communicates over stdio with a local child process. */
| "stdio"
/** Server communicates over streamable HTTP. */
| "http"
/** Server communicates over Server-Sent Events (deprecated). */
| "sse"
/** Server is backed by an in-memory runtime implementation. */
| "memory";
/**
* Either '*' to receive all event types, or a non-empty list of event types to receive
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "EventLogTypes".
*/
/** @experimental */
export type EventLogTypes = "*" | [string, ...string[]];
/**
* Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "EventsAgentScope".
*/
/** @experimental */
export type EventsAgentScope =
/** Return main-agent events and typed subagent lifecycle events. */
| "primary"
/** Return events from all agents. */
| "all";
/**
* Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "EventsCursorStatus".
*/
/** @experimental */
export type EventsCursorStatus =
/** The cursor was applied successfully. */
| "ok"
/** The cursor referred to history that is no longer available. */
| "expired";
/**
* Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ExtensionSource".
*/
/** @experimental */
export type ExtensionSource =
/** Extension discovered from the current project's .github/extensions directory. */
| "project"
/** Extension discovered from the user's ~/.copilot/extensions directory. */
| "user";
/**
* Current status: running, disabled, failed, or starting
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ExtensionStatus".
*/
/** @experimental */
export type ExtensionStatus =
/** The extension process is running. */
| "running"
/** The extension is installed but disabled. */
| "disabled"
/** The extension failed to start or crashed. */
| "failed"
/** The extension process is starting. */
| "starting";
/**
* Tool call result (string or expanded result object)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ExternalToolResult".
*/
/** @experimental */
export type ExternalToolResult = string | ExternalToolTextResultForLlm;
/**
* Binary result type discriminator. Use "image" for images and "resource" for other binary data.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ExternalToolTextResultForLlmBinaryResultsForLlmType".
*/
/** @experimental */
export type ExternalToolTextResultForLlmBinaryResultsForLlmType =
/** Binary image data. */
| "image"
/** Other binary resource data. */
| "resource";
/**
* A content block within a tool result, which may be text, terminal output, image, audio, or a resource
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ExternalToolTextResultForLlmContent".
*/
/** @experimental */
export type ExternalToolTextResultForLlmContent =
| ExternalToolTextResultForLlmContentText
| ExternalToolTextResultForLlmContentTerminal
| ExternalToolTextResultForLlmContentImage
| ExternalToolTextResultForLlmContentAudio
| ExternalToolTextResultForLlmContentResourceLink
| ExternalToolTextResultForLlmContentResource;
/**
* Theme variant this icon is intended for
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ExternalToolTextResultForLlmContentResourceLinkIconTheme".
*/
/** @experimental */
export type ExternalToolTextResultForLlmContentResourceLinkIconTheme =
/** Icon intended for light themes. */
| "light"
/** Icon intended for dark themes. */
| "dark";
/**
* The embedded resource contents, either text or base64-encoded binary
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ExternalToolTextResultForLlmContentResourceDetails".
*/
/** @experimental */
export type ExternalToolTextResultForLlmContentResourceDetails =
| EmbeddedTextResourceContents
| EmbeddedBlobResourceContents;
/**
* Content filtering mode to apply to all tools, or a map of tool name to content filtering mode.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "FilterMapping".
*/
export type FilterMapping =
| {
[k: string]: ContentFilterMode;
}
| ContentFilterMode;
/**
* Source for direct repo installs (when marketplace is empty)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "InstalledPluginSource".
*/
/** @experimental */
export type InstalledPluginSource =
| string
| InstalledPluginSourceGithub
| InstalledPluginSourceUrl
| InstalledPluginSourceLocal;
/**
* Category of instruction source — used for merge logic
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "InstructionsSourcesType".
*/
/** @experimental */
export type InstructionsSourcesType =
/** Instructions loaded from the user's home configuration. */
| "home"
/** Instructions loaded from repository-scoped files. */
| "repo"
/** Instructions loaded from model-specific files. */
| "model"
/** Instructions loaded from VS Code instruction files. */
| "vscode"
/** Instructions discovered from nested agent files. */
| "nested-agents"
/** Instructions inherited from child instruction files. */
| "child-instructions"
/** Instructions supplied by an installed plugin. */
| "plugin";
/**
* Where this source lives — used for UI grouping
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "InstructionsSourcesLocation".
*/
/** @experimental */
export type InstructionsSourcesLocation =
/** Instructions live in user-level configuration. */
| "user"
/** Instructions live in repository-level configuration. */
| "repository"
/** Instructions live under the current working directory. */
| "working-directory"
/** Instructions live in plugin-provided configuration. */
| "plugin";
/**
* Log severity level. Determines how the message is displayed in the timeline. Defaults to "info".
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionLogLevel".
*/
/** @experimental */
export type SessionLogLevel =
/** Informational message. */
| "info"
/** Warning message that may require attention. */
| "warning"
/** Error message describing a failure. */
| "error";
/**
* UI theme preference per SEP-1865
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpAppsHostContextDetailsTheme".
*/
/** @experimental */
export type McpAppsHostContextDetailsTheme =
/** Light UI theme */
| "light"
/** Dark UI theme */
| "dark";
/**
* Current display mode (SEP-1865)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpAppsHostContextDetailsDisplayMode".
*/
/** @experimental */
export type McpAppsHostContextDetailsDisplayMode =
/** Rendered inline within the host conversation surface */
| "inline"
/** Rendered as a fullscreen overlay */
| "fullscreen"
/** Rendered as a picture-in-picture floating panel */
| "pip";
/**
* Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpAppsHostContextDetailsAvailableDisplayMode".
*/
/** @experimental */
export type McpAppsHostContextDetailsAvailableDisplayMode =
/** Rendered inline within the host conversation surface */
| "inline"
/** Rendered as a fullscreen overlay */
| "fullscreen"
/** Rendered as a picture-in-picture floating panel */
| "pip";
/**
* Platform type for responsive design
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpAppsHostContextDetailsPlatform".
*/
/** @experimental */
export type McpAppsHostContextDetailsPlatform =
/** Host runs in a web browser */
| "web"
/** Host runs as a desktop application */
| "desktop"
/** Host runs on a mobile device */
| "mobile";
/**
* UI theme preference per SEP-1865
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpAppsSetHostContextDetailsTheme".
*/
/** @experimental */
export type McpAppsSetHostContextDetailsTheme =
/** Light UI theme */
| "light"
/** Dark UI theme */
| "dark";
/**
* Current display mode (SEP-1865)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpAppsSetHostContextDetailsDisplayMode".
*/
/** @experimental */
export type McpAppsSetHostContextDetailsDisplayMode =
/** Rendered inline within the host conversation surface */
| "inline"
/** Rendered as a fullscreen overlay */
| "fullscreen"
/** Rendered as a picture-in-picture floating panel */
| "pip";
/**
* Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpAppsSetHostContextDetailsAvailableDisplayMode".
*/
/** @experimental */
export type McpAppsSetHostContextDetailsAvailableDisplayMode =
/** Rendered inline within the host conversation surface */
| "inline"
/** Rendered as a fullscreen overlay */
| "fullscreen"
/** Rendered as a picture-in-picture floating panel */
| "pip";
/**
* Platform type for responsive design
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpAppsSetHostContextDetailsPlatform".
*/
/** @experimental */
export type McpAppsSetHostContextDetailsPlatform =
/** Host runs in a web browser */
| "web"
/** Host runs as a desktop application */
| "desktop"
/** Host runs on a mobile device */
| "mobile";
/**
* MCP server configuration (stdio process or remote HTTP/SSE)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpServerConfig".
*/
export type McpServerConfig = McpServerConfigStdio | McpServerConfigHttp;
/**
* Set to `true` to use defaults, or provide an object with additional auth or OIDC settings.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpServerAuthConfig".
*/
export type McpServerAuthConfig = boolean | McpServerAuthConfigRedirectPort;
/**
* Remote transport type. Defaults to "http" when omitted.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpServerConfigHttpType".
*/
export type McpServerConfigHttpType =
/** Streamable HTTP transport. */
| "http"
/** Server-Sent Events transport. */
| "sse";
/**
* OAuth grant type to use when authenticating to the remote MCP server.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpServerConfigHttpOauthGrantType".
*/
export type McpServerConfigHttpOauthGrantType =
/** Interactive browser-based authorization code flow with PKCE. */
| "authorization_code"
/** Headless client credentials flow using the configured OAuth client. */
| "client_credentials";
/**
* Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpSamplingExecutionAction".
*/
/** @experimental */
export type McpSamplingExecutionAction =
/** The sampling inference completed and produced a result. */
| "success"
/** The sampling inference failed or was rejected. */
| "failure"
/** The sampling inference was cancelled before completion. */
| "cancelled";
/**
* How environment-variable values supplied to MCP servers are resolved. "direct" passes literal string values; "indirect" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to "direct".
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpSetEnvValueModeDetails".
*/
/** @experimental */
export type McpSetEnvValueModeDetails =
/** Treat MCP server environment values as literal strings. */
| "direct"
/** Treat MCP server environment values as host-side references to resolve before launch. */
| "indirect";
/**
* Token breakdown for the current context window, or null if the session has not yet been initialized (no system prompt or tool metadata cached).
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionContextInfo".
*/
/** @experimental */
export type SessionContextInfo = {
/**
* The model used for token counting
*/
modelName: string;
/**
* Tokens consumed by the system prompt
*/
systemTokens: number;
/**
* Tokens consumed by user/assistant/tool messages
*/
conversationTokens: number;
/**
* Tokens consumed by tool definitions sent to the model (excludes deferred tools)
*/
toolDefinitionsTokens: number;
/**
* Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools)
*/
mcpToolsTokens: number;
/**
* Sum of system, conversation and tool-definition tokens
*/
totalTokens: number;
/**
* Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified)
*/
promptTokenLimit: number;
/**
* Token count at which background compaction starts (configurable percentage of promptTokenLimit)
*/
compactionThreshold: number;
/**
* Total context limit for /context display. promptTokenLimit + min(32k or 64k, outputTokenLimit) depending on model.
*/
limit: number;
/**
* Output reserve plus tokens after the buffer-exhaustion blocking threshold (default 95%)
*/
bufferTokens: number;
} | null;
/**
* Hosting platform type of the repository
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionWorkingDirectoryContextHostType".
*/
/** @experimental */
export type SessionWorkingDirectoryContextHostType =
/** The working directory repository is hosted on GitHub. */
| "github"
/** The working directory repository is hosted on Azure DevOps. */
| "ado";
/**
* The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot')
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "MetadataSnapshotCurrentMode".
*/
/** @experimental */
export type MetadataSnapshotCurrentMode =
/** The agent is responding interactively to the user. */
| "interactive"
/** The agent is preparing a plan before making changes. */
| "plan"
/** The agent is working autonomously toward task completion. */
| "autopilot";
/**
* Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote` invocation.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "MetadataSnapshotRemoteMetadataTaskType".
*/
/** @experimental */
export type MetadataSnapshotRemoteMetadataTaskType =
/** Remote task originated from Copilot Coding Agent. */
| "cca"
/** Remote task originated from a CLI remote-session invocation. */
| "cli";
/**
* Current policy state for this model
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ModelPolicyState".
*/
export type ModelPolicyState =
/** The model is enabled by policy. */
| "enabled"
/** The model is disabled by policy. */
| "disabled"
/** No explicit policy is configured for the model. */
| "unconfigured";
/**
* Model capability category for grouping in the model picker
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ModelPickerCategory".
*/
export type ModelPickerCategory =
/** Lightweight model category optimized for faster, lower-cost interactions. */
| "lightweight"
/** Versatile model category suitable for a broad range of tasks. */
| "versatile"
/** Powerful model category optimized for complex tasks. */
| "powerful";
/**
* Relative cost tier for token-based billing users
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ModelPickerPriceCategory".
*/
export type ModelPickerPriceCategory =
/** Lowest relative token cost tier. */
| "low"
/** Medium relative token cost tier. */
| "medium"
/** High relative token cost tier. */
| "high"
/** Highest relative token cost tier. */
| "very_high";
/**
* How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch).
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "OptionsUpdateEnvValueMode".
*/
/** @experimental */
export type OptionsUpdateEnvValueMode =
/** Pass MCP server environment values as literal strings. */
| "direct"
/** Resolve MCP server environment values from host-side references. */
| "indirect";
/**
* Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "OptionsUpdateToolFilterPrecedence".
*/
/** @experimental */
export type OptionsUpdateToolFilterPrecedence =
/** If availableTools is set, it is the only constraint that applies (excludedTools is ignored). Preserves CLI / pre-existing client behavior. Default. */
| "available"
/** A tool is enabled if and only if it matches the allowlist (or the allowlist is unset) AND it does not match the denylist. Makes 'all except X' expressible by combining the two lists. */
| "excluded";
/**
* The client's response to the pending permission prompt
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "PermissionDecision".
*/
/** @experimental */
export type PermissionDecision =
| PermissionDecisionApproveOnce
| PermissionDecisionApproveForSession
| PermissionDecisionApproveForLocation
| PermissionDecisionApprovePermanently
| PermissionDecisionReject
| PermissionDecisionUserNotAvailable
| PermissionDecisionApproved
| PermissionDecisionApprovedForSession
| PermissionDecisionApprovedForLocation
| PermissionDecisionCancelled
| PermissionDecisionDeniedByRules
| PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser
| PermissionDecisionDeniedInteractivelyByUser
| PermissionDecisionDeniedByContentExclusionPolicy
| PermissionDecisionDeniedByPermissionRequestHook;
/**
* Session-scoped approval to remember (tool prompts only; omitted for path/url prompts)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "PermissionDecisionApproveForSessionApproval".
*/
/** @experimental */
export type PermissionDecisionApproveForSessionApproval =
| PermissionDecisionApproveForSessionApprovalCommands
| PermissionDecisionApproveForSessionApprovalRead
| PermissionDecisionApproveForSessionApprovalWrite
| PermissionDecisionApproveForSessionApprovalMcp
| PermissionDecisionApproveForSessionApprovalMcpSampling
| PermissionDecisionApproveForSessionApprovalMemory
| PermissionDecisionApproveForSessionApprovalCustomTool
| PermissionDecisionApproveForSessionApprovalExtensionManagement
| PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess;
/**
* Approval to persist for this location
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "PermissionDecisionApproveForLocationApproval".
*/
/** @experimental */
export type PermissionDecisionApproveForLocationApproval =
| PermissionDecisionApproveForLocationApprovalCommands
| PermissionDecisionApproveForLocationApprovalRead
| PermissionDecisionApproveForLocationApprovalWrite
| PermissionDecisionApproveForLocationApprovalMcp
| PermissionDecisionApproveForLocationApprovalMcpSampling
| PermissionDecisionApproveForLocationApprovalMemory
| PermissionDecisionApproveForLocationApprovalCustomTool
| PermissionDecisionApproveForLocationApprovalExtensionManagement
| PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess;
/**
* Tool approval to persist and apply
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "PermissionsLocationsAddToolApprovalDetails".
*/
/** @experimental */
export type PermissionsLocationsAddToolApprovalDetails =
| PermissionsLocationsAddToolApprovalDetailsCommands
| PermissionsLocationsAddToolApprovalDetailsRead
| PermissionsLocationsAddToolApprovalDetailsWrite
| PermissionsLocationsAddToolApprovalDetailsMcp
| PermissionsLocationsAddToolApprovalDetailsMcpSampling
| PermissionsLocationsAddToolApprovalDetailsMemory
| PermissionsLocationsAddToolApprovalDetailsCustomTool
| PermissionsLocationsAddToolApprovalDetailsExtensionManagement
| PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess;
/**
* Whether the location is a git repo or directory
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "PermissionLocationType".
*/
/** @experimental */
export type PermissionLocationType =
/** The permission location is persisted at the git repository root. */
| "repo"
/** The permission location is persisted at the working directory. */
| "dir";
/**
* Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "PermissionsConfigureAdditionalContentExclusionPolicyScope".
*/
/** @experimental */
export type PermissionsConfigureAdditionalContentExclusionPolicyScope =
/** The content exclusion policy applies to the current repository. */
| "repo"
/** The content exclusion policy applies across all repositories. */
| "all";
/**
* Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "PermissionsModifyRulesScope".
*/
/** @experimental */
export type PermissionsModifyRulesScope =
/** Apply the rule change only to this session. */
| "session"
/** Persist the rule change for this project location. */
| "location";
/**
* Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "PermissionsSetApproveAllSource".
*/
/** @experimental */
export type PermissionsSetApproveAllSource =
/** Allow-all was enabled from a CLI command-line flag. */
| "cli_flag"
/** Allow-all was enabled by a slash command. */
| "slash_command"
/** Allow-all was enabled by confirming autopilot behavior. */
| "autopilot_confirmation"
/** Allow-all was enabled through an RPC caller. */
| "rpc";
/**
* Whether this item is a queued user message or a queued slash command / model change
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "QueuePendingItemsKind".
*/
/** @experimental */
export type QueuePendingItemsKind =
/** A queued user message. */
| "message"
/** A queued slash command or model-change command. */
| "command";
/**
* Per-session remote mode. "off" disables remote, "export" exports session events to GitHub without enabling remote steering, "on" enables both export and remote steering.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "RemoteSessionMode".
*/
/** @experimental */
export type RemoteSessionMode =
/** Disable remote session export and steering. */
| "off"
/** Export session events to GitHub without enabling remote steering. */
| "export"
/** Enable both remote session export and remote steering. */
| "on";
/**
* The UI mode the agent was in when this message was sent. Defaults to the session's current mode.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SendAgentMode".
*/
/** @experimental */
export type SendAgentMode =
/** The agent is responding interactively to the user. */
| "interactive"
/** The agent is preparing a plan before making changes. */
| "plan"
/** The agent is working autonomously toward task completion. */
| "autopilot"
/** The agent is in shell-focused UI mode. */
| "shell";
/**
* A user message attachment — a file, directory, code selection, blob, or GitHub reference
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SendAttachment".
*/
/** @experimental */
export type SendAttachment =
| SendAttachmentFile
| SendAttachmentDirectory
| SendAttachmentSelection
| SendAttachmentGithubReference
| SendAttachmentBlob;
/**
* Type of GitHub reference
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SendAttachmentGithubReferenceType".
*/
/** @experimental */
export type SendAttachmentGithubReferenceType =
/** GitHub issue reference. */
| "issue"
/** GitHub pull request reference. */
| "pr"
/** GitHub discussion reference. */
| "discussion";
/**
* How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SendMode".
*/
/** @experimental */
export type SendMode =
/** Append the message to the normal session queue. */
| "enqueue"