forked from github/copilot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrpc.ts
More file actions
9349 lines (9337 loc) · 311 KB
/
Copy pathrpc.ts
File metadata and controls
9349 lines (9337 loc) · 311 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 = "user" | "project" | "inherited" | "remote" | "plugin" | "builtin";
/**
* 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".
*/
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".
*/
export type AuthInfoType = "hmac" | "env" | "user" | "gh-cli" | "api-key" | "token" | "copilot-api-token";
/**
* 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".
*/
export type SlashCommandKind = "builtin" | "skill" | "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".
*/
export type SlashCommandInputCompletion = "directory";
/**
* Result of the queued command execution.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "QueuedCommandResult".
*/
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-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 = "none" | "markdown" | "hidden_characters";
/**
* Server transport type: stdio, http, sse, or memory
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "DiscoveredMcpServerType".
*/
export type DiscoveredMcpServerType = "stdio" | "http" | "sse" | "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 = "primary" | "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 = "ok" | "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 = "project" | "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 = "running" | "disabled" | "failed" | "starting";
/**
* Tool call result (string or expanded result object)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ExternalToolResult".
*/
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".
*/
export type ExternalToolTextResultForLlmBinaryResultsForLlmType = "image" | "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".
*/
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".
*/
export type ExternalToolTextResultForLlmContentResourceLinkIconTheme = "light" | "dark";
/**
* The embedded resource contents, either text or base64-encoded binary
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ExternalToolTextResultForLlmContentResourceDetails".
*/
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".
*/
export type InstructionsSourcesType =
| "home"
| "repo"
| "model"
| "vscode"
| "nested-agents"
| "child-instructions"
| "plugin";
/**
* Where this source lives — used for UI grouping
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "InstructionsSourcesLocation".
*/
export type InstructionsSourcesLocation = "user" | "repository" | "working-directory" | "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".
*/
export type SessionLogLevel = "info" | "warning" | "error";
/**
* 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;
/**
* Remote transport type. Defaults to "http" when omitted.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "McpServerConfigHttpType".
*/
export type McpServerConfigHttpType = "http" | "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 = "authorization_code" | "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 = "success" | "failure" | "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 = "direct" | "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;
/**
* 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 = "github" | "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 = "interactive" | "plan" | "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 = "cca" | "cli";
/**
* Current policy state for this model
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ModelPolicyState".
*/
export type ModelPolicyState = "enabled" | "disabled" | "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" | "versatile" | "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 = "low" | "medium" | "high" | "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 = "direct" | "indirect";
/**
* The client's response to the pending permission prompt
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "PermissionDecision".
*/
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".
*/
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".
*/
export type PermissionDecisionApproveForLocationApproval =
| PermissionDecisionApproveForLocationApprovalCommands
| PermissionDecisionApproveForLocationApprovalRead
| PermissionDecisionApproveForLocationApprovalWrite
| PermissionDecisionApproveForLocationApprovalMcp
| PermissionDecisionApproveForLocationApprovalMcpSampling
| PermissionDecisionApproveForLocationApprovalMemory
| PermissionDecisionApproveForLocationApprovalCustomTool
| PermissionDecisionApproveForLocationApprovalExtensionManagement
| PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess;
/**
* Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "PermissionsConfigureAdditionalContentExclusionPolicyScope".
*/
export type PermissionsConfigureAdditionalContentExclusionPolicyScope = "repo" | "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".
*/
export type PermissionsModifyRulesScope = "session" | "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".
*/
export type PermissionsSetApproveAllSource = "cli_flag" | "slash_command" | "autopilot_confirmation" | "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 = "message" | "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 = "off" | "export" | "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".
*/
export type SendAgentMode = "interactive" | "plan" | "autopilot" | "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".
*/
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".
*/
export type SendAttachmentGithubReferenceType = "issue" | "pr" | "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".
*/
export type SendMode = "enqueue" | "immediate";
/**
* Repository host type
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionContextHostType".
*/
/** @experimental */
export type SessionContextHostType = "github" | "ado";
/**
* Error classification
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionFsErrorCode".
*/
export type SessionFsErrorCode = "ENOENT" | "UNKNOWN";
/**
* Entry type
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionFsReaddirWithTypesEntryType".
*/
export type SessionFsReaddirWithTypesEntryType = "file" | "directory";
/**
* Path conventions used by this filesystem
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionFsSetProviderConventions".
*/
export type SessionFsSetProviderConventions = "windows" | "posix";
/**
* How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionFsSqliteQueryType".
*/
export type SessionFsSqliteQueryType = "exec" | "query" | "run";
/**
* Source descriptor for direct repo installs (when marketplace is empty)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SessionInstalledPluginSource".
*/
/** @experimental */
export type SessionInstalledPluginSource =
| string
| SessionInstalledPluginSourceGithub
| SessionInstalledPluginSourceUrl
| SessionInstalledPluginSourceLocal;
/**
* Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags).
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "WorkspaceSummary".
*/
/** @experimental */
export type WorkspaceSummary = {
/**
* Workspace identifier (1:1 with sessionId)
*/
id: string;
/**
* Current working directory at session start
*/
cwd?: string;
/**
* Resolved git root for cwd, if any
*/
git_root?: string;
/**
* Repository identifier in 'owner/repo' or 'org/project/repo' format, if any
*/
repository?: string;
/**
* Repository host type, if known
*/
host_type?: "github" | "ado";
/**
* Branch checked out at session start, if any
*/
branch?: string;
/**
* Display name for the session, if set
*/
name?: string;
/**
* ISO 8601 timestamp when the workspace was created
*/
created_at?: string;
/**
* ISO 8601 timestamp when the workspace was last updated
*/
updated_at?: string;
} | null;
/**
* Signal to send (default: SIGTERM)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ShellKillSignal".
*/
export type ShellKillSignal = "SIGTERM" | "SIGKILL" | "SIGINT";
/**
* Result of invoking the slash command (text output, prompt to send to the agent, or completion).
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "SlashCommandInvocationResult".
*/
export type SlashCommandInvocationResult =
| SlashCommandTextResult
| SlashCommandAgentPromptResult
| SlashCommandCompletedResult;
/**
* Current lifecycle status of the task
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "TaskStatus".
*/
/** @experimental */
export type TaskStatus = "running" | "idle" | "completed" | "failed" | "cancelled";
/**
* Whether task execution is synchronously awaited or managed in the background
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "TaskExecutionMode".
*/
/** @experimental */
export type TaskExecutionMode = "sync" | "background";
/**
* Schema for the `TaskAgentProgress` type.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "TaskAgentProgress".
*/
/** @experimental */
export type TaskAgentProgress =
| {
/**
* Progress kind
*/
type: "agent";
/**
* Recent tool execution events converted to display lines
*/
recentActivity: {
/**
* Display message, e.g., "▸ bash", "✓ edit src/foo.ts"
*/
message: string;
/**
* ISO 8601 timestamp when this event occurred
*/
timestamp: string;
}[];
/**
* The most recent intent reported by the agent
*/
latestIntent?: string;
}
| {
/**
* Progress kind
*/
type: "shell";
/**
* Recent stdout/stderr lines from the running shell command
*/
recentOutput: string;
/**
* Process ID when available
*/
pid?: number;
};
/**
* Schema for the `TaskInfo` type.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "TaskInfo".
*/
/** @experimental */
export type TaskInfo = TaskAgentInfo | TaskShellInfo;
/**
* Whether the shell runs inside a managed PTY session or as an independent background process
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "TaskShellInfoAttachmentMode".
*/
/** @experimental */
export type TaskShellInfoAttachmentMode = "attached" | "detached";
/**
* Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "TaskProgress".
*/
/** @experimental */
export type TaskProgress = TaskAgentProgress | TaskShellProgress;
/**
* Schema for the `TaskShellProgress` type.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "TaskShellProgress".
*/
/** @experimental */
export type TaskShellProgress = null;
/**
* User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline).
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "UIAutoModeSwitchResponse".
*/
export type UIAutoModeSwitchResponse = "yes" | "yes_always" | "no";
/**
* Schema for the `UIElicitationFieldValue` type.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "UIElicitationFieldValue".
*/
export type UIElicitationFieldValue = string | number | boolean | string[];
/**
* Definition for a single elicitation form field.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "UIElicitationSchemaProperty".
*/
export type UIElicitationSchemaProperty =
| (
| UIElicitationStringEnumField
| UIElicitationStringOneOfField
| UIElicitationArrayEnumField
| UIElicitationArrayAnyOfField
| UIElicitationSchemaPropertyBoolean
| UIElicitationSchemaPropertyString
| UIElicitationSchemaPropertyNumber
)
| undefined;
/**
* Optional format hint that constrains the accepted input.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "UIElicitationSchemaPropertyStringFormat".
*/
export type UIElicitationSchemaPropertyStringFormat = "email" | "uri" | "date" | "date-time";
/**
* Numeric type accepted by the field.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "UIElicitationSchemaPropertyNumberType".
*/
export type UIElicitationSchemaPropertyNumberType = "number" | "integer";
/**
* The user's response: accept (submitted), decline (rejected), or cancel (dismissed)
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "UIElicitationResponseAction".
*/
export type UIElicitationResponseAction = "accept" | "decline" | "cancel";
/**
* The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "UIExitPlanModeAction".
*/
export type UIExitPlanModeAction = "exit_only" | "interactive" | "autopilot" | "autopilot_fleet";
/**
* Parameters for aborting the current turn
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AbortRequest".
*/
export interface AbortRequest {
reason?: AbortReason;
}
/**
* Result of aborting the current turn
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AbortResult".
*/
export interface AbortResult {
/**
* Whether the abort completed successfully
*/
success: boolean;
/**
* Error message if the abort failed
*/
error?: string;
}
export interface AccountGetQuotaRequest {
/**
* GitHub token for per-user quota lookup. When provided, resolves this token to determine the user's quota instead of using the global auth.
*/
gitHubToken?: string;
}
/**
* Quota usage snapshots for the resolved user, keyed by quota type.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AccountGetQuotaResult".
*/
export interface AccountGetQuotaResult {
/**
* Quota snapshots keyed by type (e.g., chat, completions, premium_interactions)
*/
quotaSnapshots: {
[k: string]: AccountQuotaSnapshot | undefined;
};
}
/**
* Schema for the `AccountQuotaSnapshot` type.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AccountQuotaSnapshot".
*/
export interface AccountQuotaSnapshot {
/**
* Whether the user has an unlimited usage entitlement
*/
isUnlimitedEntitlement: boolean;
/**
* Number of requests included in the entitlement, or -1 for unlimited entitlements
*/
entitlementRequests: number;
/**
* Number of requests used so far this period
*/
usedRequests: number;
/**
* Whether usage is still permitted after quota exhaustion
*/
usageAllowedWithExhaustedQuota: boolean;
/**
* Percentage of entitlement remaining
*/
remainingPercentage: number;
/**
* Number of overage requests made this period
*/
overage: number;
/**
* Whether overage is allowed when quota is exhausted
*/
overageAllowedWithExhaustedQuota: boolean;
/**
* Date when the quota resets (ISO 8601 string)
*/
resetDate?: string;
}
/**
* The currently selected custom agent, or null when using the default agent.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentGetCurrentResult".
*/
/** @experimental */
export interface AgentGetCurrentResult {
/**
* Currently selected custom agent, or null if using the default agent
*/
agent?: AgentInfo | null;
}
/**
* Schema for the `AgentInfo` type.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentInfo".
*/
/** @experimental */
export interface AgentInfo {
/**
* Unique identifier of the custom agent
*/
name: string;
/**
* Human-readable display name
*/
displayName: string;
/**
* Description of the agent's purpose
*/
description: string;
/**
* Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path.
*/
path?: string;
/**
* Stable identifier for selection. For most agents this is the same as `name`; for plugin/builtin agents it may differ. Always populated; defaults to `name` when no distinct id was assigned.
*/
id: string;
source?: AgentInfoSource;
/**
* Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only.
*/
userInvocable?: boolean;
/**
* Allowed tool names for this agent. Empty array means none; omitted means inherit defaults.
*/
tools?: string[];
/**
* Preferred model id for this agent. When omitted, inherits the outer agent's model.
*/
model?: string;
/**
* MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema.
*/
mcpServers?: {
[k: string]: unknown | undefined;
};
/**
* Skill names preloaded into this agent's context. Omitted means none.
*/
skills?: string[];
}
/**
* Custom agents available to the session.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentList".
*/
/** @experimental */
export interface AgentList {
/**
* Available custom agents
*/
agents: AgentInfo[];
}
/**
* Custom agents available to the session after reloading definitions from disk.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentReloadResult".
*/
/** @experimental */
export interface AgentReloadResult {
/**
* Reloaded custom agents
*/
agents: AgentInfo[];
}
/**
* Name of the custom agent to select for subsequent turns.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentSelectRequest".
*/
/** @experimental */
export interface AgentSelectRequest {
/**
* Name of the custom agent to select
*/
name: string;
}
/**
* The newly selected custom agent.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "AgentSelectResult".
*/
/** @experimental */
export interface AgentSelectResult {
agent: AgentInfo;
}
/**
* Schema for the `ApiKeyAuthInfo` type.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "ApiKeyAuthInfo".
*/
export interface ApiKeyAuthInfo {
/**
* API-key authentication for non-GitHub LLM providers (e.g. when running BYOM-style).
*/
type: "api-key";
/**
* The API key. Treat as a secret.
*/
apiKey: string;
/**
* Authentication host.
*/
host: string;
copilotUser?: CopilotUserResponse;
}
/**
* Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.
*
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
* via the `definition` "CopilotUserResponse".
*/
export interface CopilotUserResponse {
login?: string;
access_type_sku?: string;
analytics_tracking_id?: string;
assigned_date?:
| (
| {
[k: string]: unknown | undefined;
}
| string
)
| null;
can_signup_for_limited?: boolean;
chat_enabled?: boolean;
copilot_plan?: string;
copilotignore_enabled?: boolean;
endpoints?: CopilotUserResponseEndpoints;
organization_login_list?: string[];
organization_list?:
| (
| {
[k: string]: unknown | undefined;
}
| ({
login?:
| (
| {
[k: string]: unknown | undefined;
}
| string
)
| null;
name?:
| (
| {
[k: string]: unknown | undefined;