-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathgenerated_rpc.go
More file actions
1636 lines (1430 loc) · 49 KB
/
generated_rpc.go
File metadata and controls
1636 lines (1430 loc) · 49 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
package rpc
import (
"context"
"encoding/json"
"github.com/github/copilot-sdk/go/internal/jsonrpc2"
)
type PingResult struct {
// Echoed message (or default greeting)
Message string `json:"message"`
// Server protocol version number
ProtocolVersion float64 `json:"protocolVersion"`
// Server timestamp in milliseconds
Timestamp float64 `json:"timestamp"`
}
type PingParams struct {
// Optional message to echo back
Message *string `json:"message,omitempty"`
}
type ModelsListResult struct {
// List of available models with full metadata
Models []Model `json:"models"`
}
type Model struct {
// Billing information
Billing *Billing `json:"billing,omitempty"`
// Model capabilities and limits
Capabilities Capabilities `json:"capabilities"`
// Default reasoning effort level (only present if model supports reasoning effort)
DefaultReasoningEffort *string `json:"defaultReasoningEffort,omitempty"`
// Model identifier (e.g., "claude-sonnet-4.5")
ID string `json:"id"`
// Display name
Name string `json:"name"`
// Policy state (if applicable)
Policy *Policy `json:"policy,omitempty"`
// Supported reasoning effort levels (only present if model supports reasoning effort)
SupportedReasoningEfforts []string `json:"supportedReasoningEfforts,omitempty"`
}
// Billing information
type Billing struct {
// Billing cost multiplier relative to the base rate
Multiplier float64 `json:"multiplier"`
}
// Model capabilities and limits
type Capabilities struct {
// Token limits for prompts, outputs, and context window
Limits Limits `json:"limits"`
// Feature flags indicating what the model supports
Supports Supports `json:"supports"`
}
// Token limits for prompts, outputs, and context window
type Limits struct {
// Maximum total context window size in tokens
MaxContextWindowTokens float64 `json:"max_context_window_tokens"`
// Maximum number of output/completion tokens
MaxOutputTokens *float64 `json:"max_output_tokens,omitempty"`
// Maximum number of prompt/input tokens
MaxPromptTokens *float64 `json:"max_prompt_tokens,omitempty"`
}
// Feature flags indicating what the model supports
type Supports struct {
// Whether this model supports reasoning effort configuration
ReasoningEffort *bool `json:"reasoningEffort,omitempty"`
// Whether this model supports vision/image input
Vision *bool `json:"vision,omitempty"`
}
// Policy state (if applicable)
type Policy struct {
// Current policy state for this model
State string `json:"state"`
// Usage terms or conditions for this model
Terms string `json:"terms"`
}
type ToolsListResult struct {
// List of available built-in tools with metadata
Tools []Tool `json:"tools"`
}
type Tool struct {
// Description of what the tool does
Description string `json:"description"`
// Optional instructions for how to use this tool effectively
Instructions *string `json:"instructions,omitempty"`
// Tool identifier (e.g., "bash", "grep", "str_replace_editor")
Name string `json:"name"`
// Optional namespaced name for declarative filtering (e.g., "playwright/navigate" for MCP
// tools)
NamespacedName *string `json:"namespacedName,omitempty"`
// JSON Schema for the tool's input parameters
Parameters map[string]any `json:"parameters,omitempty"`
}
type ToolsListParams struct {
// Optional model ID — when provided, the returned tool list reflects model-specific
// overrides
Model *string `json:"model,omitempty"`
}
type AccountGetQuotaResult struct {
// Quota snapshots keyed by type (e.g., chat, completions, premium_interactions)
QuotaSnapshots map[string]QuotaSnapshot `json:"quotaSnapshots"`
}
type QuotaSnapshot struct {
// Number of requests included in the entitlement
EntitlementRequests float64 `json:"entitlementRequests"`
// Number of overage requests made this period
Overage float64 `json:"overage"`
// Whether pay-per-request usage is allowed when quota is exhausted
OverageAllowedWithExhaustedQuota bool `json:"overageAllowedWithExhaustedQuota"`
// Percentage of entitlement remaining
RemainingPercentage float64 `json:"remainingPercentage"`
// Date when the quota resets (ISO 8601)
ResetDate *string `json:"resetDate,omitempty"`
// Number of requests used so far this period
UsedRequests float64 `json:"usedRequests"`
}
type MCPConfigListResult struct {
// All MCP servers from user config, keyed by name
Servers map[string]ServerValue `json:"servers"`
}
// MCP server configuration (local/stdio or remote/http)
type ServerValue struct {
Args []string `json:"args,omitempty"`
Command *string `json:"command,omitempty"`
Cwd *string `json:"cwd,omitempty"`
Env map[string]string `json:"env,omitempty"`
FilterMapping *FilterMappingUnion `json:"filterMapping"`
IsDefaultServer *bool `json:"isDefaultServer,omitempty"`
Timeout *float64 `json:"timeout,omitempty"`
// Tools to include. Defaults to all tools if not specified.
Tools []string `json:"tools,omitempty"`
Type *ServerType `json:"type,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
OauthClientID *string `json:"oauthClientId,omitempty"`
OauthPublicClient *bool `json:"oauthPublicClient,omitempty"`
URL *string `json:"url,omitempty"`
}
type MCPConfigAddParams struct {
// MCP server configuration (local/stdio or remote/http)
Config MCPConfigAddParamsConfig `json:"config"`
// Unique name for the MCP server
Name string `json:"name"`
}
// MCP server configuration (local/stdio or remote/http)
type MCPConfigAddParamsConfig struct {
Args []string `json:"args,omitempty"`
Command *string `json:"command,omitempty"`
Cwd *string `json:"cwd,omitempty"`
Env map[string]string `json:"env,omitempty"`
FilterMapping *FilterMappingUnion `json:"filterMapping"`
IsDefaultServer *bool `json:"isDefaultServer,omitempty"`
Timeout *float64 `json:"timeout,omitempty"`
// Tools to include. Defaults to all tools if not specified.
Tools []string `json:"tools,omitempty"`
Type *ServerType `json:"type,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
OauthClientID *string `json:"oauthClientId,omitempty"`
OauthPublicClient *bool `json:"oauthPublicClient,omitempty"`
URL *string `json:"url,omitempty"`
}
type MCPConfigUpdateParams struct {
// MCP server configuration (local/stdio or remote/http)
Config MCPConfigUpdateParamsConfig `json:"config"`
// Name of the MCP server to update
Name string `json:"name"`
}
// MCP server configuration (local/stdio or remote/http)
type MCPConfigUpdateParamsConfig struct {
Args []string `json:"args,omitempty"`
Command *string `json:"command,omitempty"`
Cwd *string `json:"cwd,omitempty"`
Env map[string]string `json:"env,omitempty"`
FilterMapping *FilterMappingUnion `json:"filterMapping"`
IsDefaultServer *bool `json:"isDefaultServer,omitempty"`
Timeout *float64 `json:"timeout,omitempty"`
// Tools to include. Defaults to all tools if not specified.
Tools []string `json:"tools,omitempty"`
Type *ServerType `json:"type,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
OauthClientID *string `json:"oauthClientId,omitempty"`
OauthPublicClient *bool `json:"oauthPublicClient,omitempty"`
URL *string `json:"url,omitempty"`
}
type MCPConfigRemoveParams struct {
// Name of the MCP server to remove
Name string `json:"name"`
}
type SessionFSSetProviderResult struct {
// Whether the provider was set successfully
Success bool `json:"success"`
}
type SessionFSSetProviderParams struct {
// Path conventions used by this filesystem
Conventions Conventions `json:"conventions"`
// Initial working directory for sessions
InitialCwd string `json:"initialCwd"`
// Path within each session's SessionFs where the runtime stores files for that session
SessionStatePath string `json:"sessionStatePath"`
}
type SessionModelGetCurrentResult struct {
// Currently active model identifier
ModelID *string `json:"modelId,omitempty"`
}
type SessionModelSwitchToResult struct {
// Currently active model identifier after the switch
ModelID *string `json:"modelId,omitempty"`
}
type SessionModelSwitchToParams struct {
// Model identifier to switch to
ModelID string `json:"modelId"`
// Reasoning effort level to use for the model
ReasoningEffort *string `json:"reasoningEffort,omitempty"`
}
type SessionModeGetResult struct {
// The current agent mode.
Mode Mode `json:"mode"`
}
type SessionModeSetResult struct {
// The agent mode after switching.
Mode Mode `json:"mode"`
}
type SessionModeSetParams struct {
// The mode to switch to. Valid values: "interactive", "plan", "autopilot".
Mode Mode `json:"mode"`
}
type SessionPlanReadResult struct {
// The content of the plan file, or null if it does not exist
Content *string `json:"content"`
// Whether the plan file exists in the workspace
Exists bool `json:"exists"`
// Absolute file path of the plan file, or null if workspace is not enabled
Path *string `json:"path"`
}
type SessionPlanUpdateResult struct {
}
type SessionPlanUpdateParams struct {
// The new content for the plan file
Content string `json:"content"`
}
type SessionPlanDeleteResult struct {
}
type SessionWorkspaceListFilesResult struct {
// Relative file paths in the workspace files directory
Files []string `json:"files"`
}
type SessionWorkspaceReadFileResult struct {
// File content as a UTF-8 string
Content string `json:"content"`
}
type SessionWorkspaceReadFileParams struct {
// Relative path within the workspace files directory
Path string `json:"path"`
}
type SessionWorkspaceCreateFileResult struct {
}
type SessionWorkspaceCreateFileParams struct {
// File content to write as a UTF-8 string
Content string `json:"content"`
// Relative path within the workspace files directory
Path string `json:"path"`
}
// Experimental: SessionFleetStartResult is part of an experimental API and may change or be removed.
type SessionFleetStartResult struct {
// Whether fleet mode was successfully activated
Started bool `json:"started"`
}
// Experimental: SessionFleetStartParams is part of an experimental API and may change or be removed.
type SessionFleetStartParams struct {
// Optional user prompt to combine with fleet instructions
Prompt *string `json:"prompt,omitempty"`
}
// Experimental: SessionAgentListResult is part of an experimental API and may change or be removed.
type SessionAgentListResult struct {
// Available custom agents
Agents []SessionAgentListResultAgent `json:"agents"`
}
type SessionAgentListResultAgent struct {
// Description of the agent's purpose
Description string `json:"description"`
// Human-readable display name
DisplayName string `json:"displayName"`
// Unique identifier of the custom agent
Name string `json:"name"`
}
// Experimental: SessionAgentGetCurrentResult is part of an experimental API and may change or be removed.
type SessionAgentGetCurrentResult struct {
// Currently selected custom agent, or null if using the default agent
Agent *SessionAgentGetCurrentResultAgent `json:"agent"`
}
type SessionAgentGetCurrentResultAgent struct {
// Description of the agent's purpose
Description string `json:"description"`
// Human-readable display name
DisplayName string `json:"displayName"`
// Unique identifier of the custom agent
Name string `json:"name"`
}
// Experimental: SessionAgentSelectResult is part of an experimental API and may change or be removed.
type SessionAgentSelectResult struct {
// The newly selected custom agent
Agent SessionAgentSelectResultAgent `json:"agent"`
}
// The newly selected custom agent
type SessionAgentSelectResultAgent struct {
// Description of the agent's purpose
Description string `json:"description"`
// Human-readable display name
DisplayName string `json:"displayName"`
// Unique identifier of the custom agent
Name string `json:"name"`
}
// Experimental: SessionAgentSelectParams is part of an experimental API and may change or be removed.
type SessionAgentSelectParams struct {
// Name of the custom agent to select
Name string `json:"name"`
}
// Experimental: SessionAgentDeselectResult is part of an experimental API and may change or be removed.
type SessionAgentDeselectResult struct {
}
// Experimental: SessionAgentReloadResult is part of an experimental API and may change or be removed.
type SessionAgentReloadResult struct {
// Reloaded custom agents
Agents []SessionAgentReloadResultAgent `json:"agents"`
}
type SessionAgentReloadResultAgent struct {
// Description of the agent's purpose
Description string `json:"description"`
// Human-readable display name
DisplayName string `json:"displayName"`
// Unique identifier of the custom agent
Name string `json:"name"`
}
// Experimental: SessionSkillsListResult is part of an experimental API and may change or be removed.
type SessionSkillsListResult struct {
// Available skills
Skills []Skill `json:"skills"`
}
type Skill struct {
// Description of what the skill does
Description string `json:"description"`
// Whether the skill is currently enabled
Enabled bool `json:"enabled"`
// Unique identifier for the skill
Name string `json:"name"`
// Absolute path to the skill file
Path *string `json:"path,omitempty"`
// Source location type (e.g., project, personal, plugin)
Source string `json:"source"`
// Whether the skill can be invoked by the user as a slash command
UserInvocable bool `json:"userInvocable"`
}
// Experimental: SessionSkillsEnableResult is part of an experimental API and may change or be removed.
type SessionSkillsEnableResult struct {
}
// Experimental: SessionSkillsEnableParams is part of an experimental API and may change or be removed.
type SessionSkillsEnableParams struct {
// Name of the skill to enable
Name string `json:"name"`
}
// Experimental: SessionSkillsDisableResult is part of an experimental API and may change or be removed.
type SessionSkillsDisableResult struct {
}
// Experimental: SessionSkillsDisableParams is part of an experimental API and may change or be removed.
type SessionSkillsDisableParams struct {
// Name of the skill to disable
Name string `json:"name"`
}
// Experimental: SessionSkillsReloadResult is part of an experimental API and may change or be removed.
type SessionSkillsReloadResult struct {
}
type SessionMCPListResult struct {
// Configured MCP servers
Servers []ServerElement `json:"servers"`
}
type ServerElement struct {
// Error message if the server failed to connect
Error *string `json:"error,omitempty"`
// Server name (config key)
Name string `json:"name"`
// Configuration source: user, workspace, plugin, or builtin
Source *string `json:"source,omitempty"`
// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
Status ServerStatus `json:"status"`
}
type SessionMCPEnableResult struct {
}
type SessionMCPEnableParams struct {
// Name of the MCP server to enable
ServerName string `json:"serverName"`
}
type SessionMCPDisableResult struct {
}
type SessionMCPDisableParams struct {
// Name of the MCP server to disable
ServerName string `json:"serverName"`
}
type SessionMCPReloadResult struct {
}
// Experimental: SessionPluginsListResult is part of an experimental API and may change or be removed.
type SessionPluginsListResult struct {
// Installed plugins
Plugins []Plugin `json:"plugins"`
}
type Plugin struct {
// Whether the plugin is currently enabled
Enabled bool `json:"enabled"`
// Marketplace the plugin came from
Marketplace string `json:"marketplace"`
// Plugin name
Name string `json:"name"`
// Installed version
Version *string `json:"version,omitempty"`
}
// Experimental: SessionExtensionsListResult is part of an experimental API and may change or be removed.
type SessionExtensionsListResult struct {
// Discovered extensions and their current status
Extensions []Extension `json:"extensions"`
}
type Extension struct {
// Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper')
ID string `json:"id"`
// Extension name (directory name)
Name string `json:"name"`
// Process ID if the extension is running
PID *int64 `json:"pid,omitempty"`
// Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/)
Source Source `json:"source"`
// Current status: running, disabled, failed, or starting
Status ExtensionStatus `json:"status"`
}
// Experimental: SessionExtensionsEnableResult is part of an experimental API and may change or be removed.
type SessionExtensionsEnableResult struct {
}
// Experimental: SessionExtensionsEnableParams is part of an experimental API and may change or be removed.
type SessionExtensionsEnableParams struct {
// Source-qualified extension ID to enable
ID string `json:"id"`
}
// Experimental: SessionExtensionsDisableResult is part of an experimental API and may change or be removed.
type SessionExtensionsDisableResult struct {
}
// Experimental: SessionExtensionsDisableParams is part of an experimental API and may change or be removed.
type SessionExtensionsDisableParams struct {
// Source-qualified extension ID to disable
ID string `json:"id"`
}
// Experimental: SessionExtensionsReloadResult is part of an experimental API and may change or be removed.
type SessionExtensionsReloadResult struct {
}
// Experimental: SessionCompactionCompactResult is part of an experimental API and may change or be removed.
type SessionCompactionCompactResult struct {
// Number of messages removed during compaction
MessagesRemoved float64 `json:"messagesRemoved"`
// Whether compaction completed successfully
Success bool `json:"success"`
// Number of tokens freed by compaction
TokensRemoved float64 `json:"tokensRemoved"`
}
type SessionToolsHandlePendingToolCallResult struct {
// Whether the tool call result was handled successfully
Success bool `json:"success"`
}
type SessionToolsHandlePendingToolCallParams struct {
Error *string `json:"error,omitempty"`
RequestID string `json:"requestId"`
Result *ResultUnion `json:"result"`
}
type ResultResult struct {
Error *string `json:"error,omitempty"`
ResultType *string `json:"resultType,omitempty"`
TextResultForLlm string `json:"textResultForLlm"`
ToolTelemetry map[string]any `json:"toolTelemetry,omitempty"`
}
type SessionCommandsHandlePendingCommandResult struct {
Success bool `json:"success"`
}
type SessionCommandsHandlePendingCommandParams struct {
// Error message if the command handler failed
Error *string `json:"error,omitempty"`
// Request ID from the command invocation event
RequestID string `json:"requestId"`
}
type SessionUIElicitationResult struct {
// The user's response: accept (submitted), decline (rejected), or cancel (dismissed)
Action Action `json:"action"`
// The form values submitted by the user (present when action is 'accept')
Content map[string]*Content `json:"content,omitempty"`
}
type SessionUIElicitationParams struct {
// Message describing what information is needed from the user
Message string `json:"message"`
// JSON Schema describing the form fields to present to the user
RequestedSchema RequestedSchema `json:"requestedSchema"`
}
// JSON Schema describing the form fields to present to the user
type RequestedSchema struct {
// Form field definitions, keyed by field name
Properties map[string]Property `json:"properties"`
// List of required field names
Required []string `json:"required,omitempty"`
// Schema type indicator (always 'object')
Type RequestedSchemaType `json:"type"`
}
type Property struct {
Default *Content `json:"default"`
Description *string `json:"description,omitempty"`
Enum []string `json:"enum,omitempty"`
EnumNames []string `json:"enumNames,omitempty"`
Title *string `json:"title,omitempty"`
Type PropertyType `json:"type"`
OneOf []OneOf `json:"oneOf,omitempty"`
Items *Items `json:"items,omitempty"`
MaxItems *float64 `json:"maxItems,omitempty"`
MinItems *float64 `json:"minItems,omitempty"`
Format *Format `json:"format,omitempty"`
MaxLength *float64 `json:"maxLength,omitempty"`
MinLength *float64 `json:"minLength,omitempty"`
Maximum *float64 `json:"maximum,omitempty"`
Minimum *float64 `json:"minimum,omitempty"`
}
type Items struct {
Enum []string `json:"enum,omitempty"`
Type *ItemsType `json:"type,omitempty"`
AnyOf []AnyOf `json:"anyOf,omitempty"`
}
type AnyOf struct {
Const string `json:"const"`
Title string `json:"title"`
}
type OneOf struct {
Const string `json:"const"`
Title string `json:"title"`
}
type SessionUIHandlePendingElicitationResult struct {
// Whether the response was accepted. False if the request was already resolved by another
// client.
Success bool `json:"success"`
}
type SessionUIHandlePendingElicitationParams struct {
// The unique request ID from the elicitation.requested event
RequestID string `json:"requestId"`
// The elicitation response (accept with form values, decline, or cancel)
Result SessionUIHandlePendingElicitationParamsResult `json:"result"`
}
// The elicitation response (accept with form values, decline, or cancel)
type SessionUIHandlePendingElicitationParamsResult struct {
// The user's response: accept (submitted), decline (rejected), or cancel (dismissed)
Action Action `json:"action"`
// The form values submitted by the user (present when action is 'accept')
Content map[string]*Content `json:"content,omitempty"`
}
type SessionPermissionsHandlePendingPermissionRequestResult struct {
// Whether the permission request was handled successfully
Success bool `json:"success"`
}
type SessionPermissionsHandlePendingPermissionRequestParams struct {
RequestID string `json:"requestId"`
Result SessionPermissionsHandlePendingPermissionRequestParamsResult `json:"result"`
}
type SessionPermissionsHandlePendingPermissionRequestParamsResult struct {
Kind Kind `json:"kind"`
Rules []any `json:"rules,omitempty"`
Feedback *string `json:"feedback,omitempty"`
Message *string `json:"message,omitempty"`
Path *string `json:"path,omitempty"`
Interrupt *bool `json:"interrupt,omitempty"`
}
type SessionLogResult struct {
// The unique identifier of the emitted session event
EventID string `json:"eventId"`
}
type SessionLogParams struct {
// When true, the message is transient and not persisted to the session event log on disk
Ephemeral *bool `json:"ephemeral,omitempty"`
// Log severity level. Determines how the message is displayed in the timeline. Defaults to
// "info".
Level *Level `json:"level,omitempty"`
// Human-readable message
Message string `json:"message"`
// Optional URL the user can open in their browser for more details
URL *string `json:"url,omitempty"`
}
type SessionShellExecResult struct {
// Unique identifier for tracking streamed output
ProcessID string `json:"processId"`
}
type SessionShellExecParams struct {
// Shell command to execute
Command string `json:"command"`
// Working directory (defaults to session working directory)
Cwd *string `json:"cwd,omitempty"`
// Timeout in milliseconds (default: 30000)
Timeout *float64 `json:"timeout,omitempty"`
}
type SessionShellKillResult struct {
// Whether the signal was sent successfully
Killed bool `json:"killed"`
}
type SessionShellKillParams struct {
// Process identifier returned by shell.exec
ProcessID string `json:"processId"`
// Signal to send (default: SIGTERM)
Signal *Signal `json:"signal,omitempty"`
}
type FilterMappingEnum string
const (
FilterMappingEnumHiddenCharacters FilterMappingEnum = "hidden_characters"
FilterMappingEnumMarkdown FilterMappingEnum = "markdown"
FilterMappingEnumNone FilterMappingEnum = "none"
)
type ServerType string
const (
ServerTypeHTTP ServerType = "http"
ServerTypeLocal ServerType = "local"
ServerTypeSse ServerType = "sse"
ServerTypeStdio ServerType = "stdio"
)
// Path conventions used by this filesystem
type Conventions string
const (
ConventionsPosix Conventions = "posix"
ConventionsWindows Conventions = "windows"
)
// The current agent mode.
//
// The agent mode after switching.
//
// The mode to switch to. Valid values: "interactive", "plan", "autopilot".
type Mode string
const (
ModeAutopilot Mode = "autopilot"
ModeInteractive Mode = "interactive"
ModePlan Mode = "plan"
)
// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
type ServerStatus string
const (
ServerStatusConnected ServerStatus = "connected"
ServerStatusNeedsAuth ServerStatus = "needs-auth"
ServerStatusNotConfigured ServerStatus = "not_configured"
ServerStatusPending ServerStatus = "pending"
ServerStatusDisabled ServerStatus = "disabled"
ServerStatusFailed ServerStatus = "failed"
)
// Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/)
type Source string
const (
SourceProject Source = "project"
SourceUser Source = "user"
)
// Current status: running, disabled, failed, or starting
type ExtensionStatus string
const (
ExtensionStatusDisabled ExtensionStatus = "disabled"
ExtensionStatusFailed ExtensionStatus = "failed"
ExtensionStatusRunning ExtensionStatus = "running"
ExtensionStatusStarting ExtensionStatus = "starting"
)
// The user's response: accept (submitted), decline (rejected), or cancel (dismissed)
type Action string
const (
ActionAccept Action = "accept"
ActionCancel Action = "cancel"
ActionDecline Action = "decline"
)
type Format string
const (
FormatDate Format = "date"
FormatDateTime Format = "date-time"
FormatEmail Format = "email"
FormatUri Format = "uri"
)
type ItemsType string
const (
ItemsTypeString ItemsType = "string"
)
type PropertyType string
const (
PropertyTypeArray PropertyType = "array"
PropertyTypeBoolean PropertyType = "boolean"
PropertyTypeString PropertyType = "string"
PropertyTypeInteger PropertyType = "integer"
PropertyTypeNumber PropertyType = "number"
)
type RequestedSchemaType string
const (
RequestedSchemaTypeObject RequestedSchemaType = "object"
)
type Kind string
const (
KindApproved Kind = "approved"
KindDeniedByContentExclusionPolicy Kind = "denied-by-content-exclusion-policy"
KindDeniedByPermissionRequestHook Kind = "denied-by-permission-request-hook"
KindDeniedByRules Kind = "denied-by-rules"
KindDeniedInteractivelyByUser Kind = "denied-interactively-by-user"
KindDeniedNoApprovalRuleAndCouldNotRequestFromUser Kind = "denied-no-approval-rule-and-could-not-request-from-user"
)
// Log severity level. Determines how the message is displayed in the timeline. Defaults to
// "info".
type Level string
const (
LevelError Level = "error"
LevelInfo Level = "info"
LevelWarning Level = "warning"
)
// Signal to send (default: SIGTERM)
type Signal string
const (
SignalSIGINT Signal = "SIGINT"
SignalSIGKILL Signal = "SIGKILL"
SignalSIGTERM Signal = "SIGTERM"
)
type FilterMappingUnion struct {
Enum *FilterMappingEnum
EnumMap map[string]FilterMappingEnum
}
type ResultUnion struct {
ResultResult *ResultResult
String *string
}
type Content struct {
Bool *bool
Double *float64
String *string
StringArray []string
}
type serverApi struct {
client *jsonrpc2.Client
}
type ServerModelsApi serverApi
func (a *ServerModelsApi) List(ctx context.Context) (*ModelsListResult, error) {
raw, err := a.client.Request("models.list", nil)
if err != nil {
return nil, err
}
var result ModelsListResult
if err := json.Unmarshal(raw, &result); err != nil {
return nil, err
}
return &result, nil
}
type ServerToolsApi serverApi
func (a *ServerToolsApi) List(ctx context.Context, params *ToolsListParams) (*ToolsListResult, error) {
raw, err := a.client.Request("tools.list", params)
if err != nil {
return nil, err
}
var result ToolsListResult
if err := json.Unmarshal(raw, &result); err != nil {
return nil, err
}
return &result, nil
}
type ServerAccountApi serverApi
func (a *ServerAccountApi) GetQuota(ctx context.Context) (*AccountGetQuotaResult, error) {
raw, err := a.client.Request("account.getQuota", nil)
if err != nil {
return nil, err
}
var result AccountGetQuotaResult
if err := json.Unmarshal(raw, &result); err != nil {
return nil, err
}
return &result, nil
}
type ServerMcpApi serverApi
type ServerSessionFsApi serverApi
func (a *ServerSessionFsApi) SetProvider(ctx context.Context, params *SessionFSSetProviderParams) (*SessionFSSetProviderResult, error) {
raw, err := a.client.Request("sessionFs.setProvider", params)
if err != nil {
return nil, err
}
var result SessionFSSetProviderResult
if err := json.Unmarshal(raw, &result); err != nil {
return nil, err
}
return &result, nil
}
// ServerRpc provides typed server-scoped RPC methods.
type ServerRpc struct {
common serverApi // Reuse a single struct instead of allocating one for each service on the heap.
Models *ServerModelsApi
Tools *ServerToolsApi
Account *ServerAccountApi
Mcp *ServerMcpApi
SessionFs *ServerSessionFsApi
}
func (a *ServerRpc) Ping(ctx context.Context, params *PingParams) (*PingResult, error) {
raw, err := a.common.client.Request("ping", params)
if err != nil {
return nil, err
}
var result PingResult
if err := json.Unmarshal(raw, &result); err != nil {
return nil, err
}
return &result, nil
}
func NewServerRpc(client *jsonrpc2.Client) *ServerRpc {
r := &ServerRpc{}
r.common = serverApi{client: client}
r.Models = (*ServerModelsApi)(&r.common)
r.Tools = (*ServerToolsApi)(&r.common)
r.Account = (*ServerAccountApi)(&r.common)
r.Mcp = (*ServerMcpApi)(&r.common)
r.SessionFs = (*ServerSessionFsApi)(&r.common)
return r
}
type sessionApi struct {
client *jsonrpc2.Client
sessionID string
}
type ModelApi sessionApi
func (a *ModelApi) GetCurrent(ctx context.Context) (*SessionModelGetCurrentResult, error) {
req := map[string]any{"sessionId": a.sessionID}
raw, err := a.client.Request("session.model.getCurrent", req)
if err != nil {
return nil, err
}
var result SessionModelGetCurrentResult
if err := json.Unmarshal(raw, &result); err != nil {
return nil, err
}
return &result, nil
}
func (a *ModelApi) SwitchTo(ctx context.Context, params *SessionModelSwitchToParams) (*SessionModelSwitchToResult, error) {
req := map[string]any{"sessionId": a.sessionID}
if params != nil {
req["modelId"] = params.ModelID
if params.ReasoningEffort != nil {
req["reasoningEffort"] = *params.ReasoningEffort
}
}
raw, err := a.client.Request("session.model.switchTo", req)
if err != nil {
return nil, err
}
var result SessionModelSwitchToResult
if err := json.Unmarshal(raw, &result); err != nil {
return nil, err
}
return &result, nil
}
type ModeApi sessionApi
func (a *ModeApi) Get(ctx context.Context) (*SessionModeGetResult, error) {
req := map[string]any{"sessionId": a.sessionID}
raw, err := a.client.Request("session.mode.get", req)