-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathRpc.cs
More file actions
3486 lines (2965 loc) · 133 KB
/
Rpc.cs
File metadata and controls
3486 lines (2965 loc) · 133 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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
// AUTO-GENERATED FILE - DO NOT EDIT
// Generated from: api.schema.json
#pragma warning disable CS0612 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete (with message)
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;
using StreamJsonRpc;
namespace GitHub.Copilot.SDK.Rpc;
/// <summary>Diagnostic IDs for the Copilot SDK.</summary>
internal static class Diagnostics
{
/// <summary>Indicates an experimental API that may change or be removed.</summary>
internal const string Experimental = "GHCP001";
}
/// <summary>RPC data type for Ping operations.</summary>
public sealed class PingResult
{
/// <summary>Echoed message (or default greeting).</summary>
[JsonPropertyName("message")]
public string Message { get; set; } = string.Empty;
/// <summary>Server timestamp in milliseconds.</summary>
[JsonPropertyName("timestamp")]
public long Timestamp { get; set; }
/// <summary>Server protocol version number.</summary>
[JsonPropertyName("protocolVersion")]
public long ProtocolVersion { get; set; }
}
/// <summary>RPC data type for Ping operations.</summary>
internal sealed class PingRequest
{
/// <summary>Optional message to echo back.</summary>
[JsonPropertyName("message")]
public string? Message { get; set; }
}
/// <summary>Feature flags indicating what the model supports.</summary>
public sealed class ModelCapabilitiesSupports
{
/// <summary>Whether this model supports vision/image input.</summary>
[JsonPropertyName("vision")]
public bool? Vision { get; set; }
/// <summary>Whether this model supports reasoning effort configuration.</summary>
[JsonPropertyName("reasoningEffort")]
public bool? ReasoningEffort { get; set; }
}
/// <summary>Vision-specific limits.</summary>
public sealed class ModelCapabilitiesLimitsVision
{
/// <summary>MIME types the model accepts.</summary>
[JsonPropertyName("supported_media_types")]
public IList<string> SupportedMediaTypes { get => field ??= []; set; }
/// <summary>Maximum number of images per prompt.</summary>
[Range((double)1, (double)long.MaxValue)]
[JsonPropertyName("max_prompt_images")]
public long MaxPromptImages { get; set; }
/// <summary>Maximum image size in bytes.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("max_prompt_image_size")]
public long MaxPromptImageSize { get; set; }
}
/// <summary>Token limits for prompts, outputs, and context window.</summary>
public sealed class ModelCapabilitiesLimits
{
/// <summary>Maximum number of prompt/input tokens.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("max_prompt_tokens")]
public long? MaxPromptTokens { get; set; }
/// <summary>Maximum number of output/completion tokens.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("max_output_tokens")]
public long? MaxOutputTokens { get; set; }
/// <summary>Maximum total context window size in tokens.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("max_context_window_tokens")]
public long? MaxContextWindowTokens { get; set; }
/// <summary>Vision-specific limits.</summary>
[JsonPropertyName("vision")]
public ModelCapabilitiesLimitsVision? Vision { get; set; }
}
/// <summary>Model capabilities and limits.</summary>
public sealed class ModelCapabilities
{
/// <summary>Feature flags indicating what the model supports.</summary>
[JsonPropertyName("supports")]
public ModelCapabilitiesSupports? Supports { get; set; }
/// <summary>Token limits for prompts, outputs, and context window.</summary>
[JsonPropertyName("limits")]
public ModelCapabilitiesLimits? Limits { get; set; }
}
/// <summary>Policy state (if applicable).</summary>
public sealed class ModelPolicy
{
/// <summary>Current policy state for this model.</summary>
[JsonPropertyName("state")]
public string State { get; set; } = string.Empty;
/// <summary>Usage terms or conditions for this model.</summary>
[JsonPropertyName("terms")]
public string Terms { get; set; } = string.Empty;
}
/// <summary>Billing information.</summary>
public sealed class ModelBilling
{
/// <summary>Billing cost multiplier relative to the base rate.</summary>
[JsonPropertyName("multiplier")]
public double Multiplier { get; set; }
}
/// <summary>RPC data type for Model operations.</summary>
public sealed class Model
{
/// <summary>Model identifier (e.g., "claude-sonnet-4.5").</summary>
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
/// <summary>Display name.</summary>
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>Model capabilities and limits.</summary>
[JsonPropertyName("capabilities")]
public ModelCapabilities Capabilities { get => field ??= new(); set; }
/// <summary>Policy state (if applicable).</summary>
[JsonPropertyName("policy")]
public ModelPolicy? Policy { get; set; }
/// <summary>Billing information.</summary>
[JsonPropertyName("billing")]
public ModelBilling? Billing { get; set; }
/// <summary>Supported reasoning effort levels (only present if model supports reasoning effort).</summary>
[JsonPropertyName("supportedReasoningEfforts")]
public IList<string>? SupportedReasoningEfforts { get; set; }
/// <summary>Default reasoning effort level (only present if model supports reasoning effort).</summary>
[JsonPropertyName("defaultReasoningEffort")]
public string? DefaultReasoningEffort { get; set; }
}
/// <summary>RPC data type for ModelList operations.</summary>
public sealed class ModelList
{
/// <summary>List of available models with full metadata.</summary>
[JsonPropertyName("models")]
public IList<Model> Models { get => field ??= []; set; }
}
/// <summary>RPC data type for Tool operations.</summary>
public sealed class Tool
{
/// <summary>Tool identifier (e.g., "bash", "grep", "str_replace_editor").</summary>
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>Optional namespaced name for declarative filtering (e.g., "playwright/navigate" for MCP tools).</summary>
[JsonPropertyName("namespacedName")]
public string? NamespacedName { get; set; }
/// <summary>Description of what the tool does.</summary>
[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;
/// <summary>JSON Schema for the tool's input parameters.</summary>
[JsonPropertyName("parameters")]
public IDictionary<string, object>? Parameters { get; set; }
/// <summary>Optional instructions for how to use this tool effectively.</summary>
[JsonPropertyName("instructions")]
public string? Instructions { get; set; }
}
/// <summary>RPC data type for ToolList operations.</summary>
public sealed class ToolList
{
/// <summary>List of available built-in tools with metadata.</summary>
[JsonPropertyName("tools")]
public IList<Tool> Tools { get => field ??= []; set; }
}
/// <summary>RPC data type for ToolsList operations.</summary>
internal sealed class ToolsListRequest
{
/// <summary>Optional model ID — when provided, the returned tool list reflects model-specific overrides.</summary>
[JsonPropertyName("model")]
public string? Model { get; set; }
}
/// <summary>RPC data type for AccountQuotaSnapshot operations.</summary>
public sealed class AccountQuotaSnapshot
{
/// <summary>Number of requests included in the entitlement.</summary>
[JsonPropertyName("entitlementRequests")]
public long EntitlementRequests { get; set; }
/// <summary>Number of requests used so far this period.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("usedRequests")]
public long UsedRequests { get; set; }
/// <summary>Percentage of entitlement remaining.</summary>
[JsonPropertyName("remainingPercentage")]
public double RemainingPercentage { get; set; }
/// <summary>Number of overage requests made this period.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("overage")]
public long Overage { get; set; }
/// <summary>Whether pay-per-request usage is allowed when quota is exhausted.</summary>
[JsonPropertyName("overageAllowedWithExhaustedQuota")]
public bool OverageAllowedWithExhaustedQuota { get; set; }
/// <summary>Date when the quota resets (ISO 8601).</summary>
[JsonPropertyName("resetDate")]
public DateTimeOffset? ResetDate { get; set; }
}
/// <summary>RPC data type for AccountGetQuota operations.</summary>
public sealed class AccountGetQuotaResult
{
/// <summary>Quota snapshots keyed by type (e.g., chat, completions, premium_interactions).</summary>
[JsonPropertyName("quotaSnapshots")]
public IDictionary<string, AccountQuotaSnapshot> QuotaSnapshots { get => field ??= new Dictionary<string, AccountQuotaSnapshot>(); set; }
}
/// <summary>RPC data type for DiscoveredMcpServer operations.</summary>
public sealed class DiscoveredMcpServer
{
/// <summary>Server name (config key).</summary>
[RegularExpression("^[0-9a-zA-Z_.@-]+(\\/[0-9a-zA-Z_.@-]+)*$")]
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>Server transport type: stdio, http, sse, or memory (local configs are normalized to stdio).</summary>
[JsonPropertyName("type")]
public DiscoveredMcpServerType? Type { get; set; }
/// <summary>Configuration source.</summary>
[JsonPropertyName("source")]
public DiscoveredMcpServerSource Source { get; set; }
/// <summary>Whether the server is enabled (not in the disabled list).</summary>
[JsonPropertyName("enabled")]
public bool Enabled { get; set; }
}
/// <summary>RPC data type for McpDiscover operations.</summary>
public sealed class McpDiscoverResult
{
/// <summary>MCP servers discovered from all sources.</summary>
[JsonPropertyName("servers")]
public IList<DiscoveredMcpServer> Servers { get => field ??= []; set; }
}
/// <summary>RPC data type for McpDiscover operations.</summary>
internal sealed class McpDiscoverRequest
{
/// <summary>Working directory used as context for discovery (e.g., plugin resolution).</summary>
[JsonPropertyName("workingDirectory")]
public string? WorkingDirectory { get; set; }
}
/// <summary>RPC data type for McpConfigList operations.</summary>
public sealed class McpConfigList
{
/// <summary>All MCP servers from user config, keyed by name.</summary>
[JsonPropertyName("servers")]
public IDictionary<string, object> Servers { get => field ??= new Dictionary<string, object>(); set; }
}
/// <summary>RPC data type for McpConfigAdd operations.</summary>
internal sealed class McpConfigAddRequest
{
/// <summary>Unique name for the MCP server.</summary>
[RegularExpression("^[0-9a-zA-Z_.@-]+(\\/[0-9a-zA-Z_.@-]+)*$")]
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>MCP server configuration (local/stdio or remote/http).</summary>
[JsonPropertyName("config")]
public object Config { get; set; } = null!;
}
/// <summary>RPC data type for McpConfigUpdate operations.</summary>
internal sealed class McpConfigUpdateRequest
{
/// <summary>Name of the MCP server to update.</summary>
[RegularExpression("^[0-9a-zA-Z_.@-]+(\\/[0-9a-zA-Z_.@-]+)*$")]
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>MCP server configuration (local/stdio or remote/http).</summary>
[JsonPropertyName("config")]
public object Config { get; set; } = null!;
}
/// <summary>RPC data type for McpConfigRemove operations.</summary>
internal sealed class McpConfigRemoveRequest
{
/// <summary>Name of the MCP server to remove.</summary>
[RegularExpression("^[0-9a-zA-Z_.@-]+(\\/[0-9a-zA-Z_.@-]+)*$")]
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
}
/// <summary>RPC data type for ServerSkill operations.</summary>
public sealed class ServerSkill
{
/// <summary>Unique identifier for the skill.</summary>
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>Description of what the skill does.</summary>
[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;
/// <summary>Source location type (e.g., project, personal-copilot, plugin, builtin).</summary>
[JsonPropertyName("source")]
public string Source { get; set; } = string.Empty;
/// <summary>Whether the skill can be invoked by the user as a slash command.</summary>
[JsonPropertyName("userInvocable")]
public bool UserInvocable { get; set; }
/// <summary>Whether the skill is currently enabled (based on global config).</summary>
[JsonPropertyName("enabled")]
public bool Enabled { get; set; }
/// <summary>Absolute path to the skill file.</summary>
[JsonPropertyName("path")]
public string? Path { get; set; }
/// <summary>The project path this skill belongs to (only for project/inherited skills).</summary>
[JsonPropertyName("projectPath")]
public string? ProjectPath { get; set; }
}
/// <summary>RPC data type for ServerSkillList operations.</summary>
public sealed class ServerSkillList
{
/// <summary>All discovered skills across all sources.</summary>
[JsonPropertyName("skills")]
public IList<ServerSkill> Skills { get => field ??= []; set; }
}
/// <summary>RPC data type for SkillsDiscover operations.</summary>
internal sealed class SkillsDiscoverRequest
{
/// <summary>Optional list of project directory paths to scan for project-scoped skills.</summary>
[JsonPropertyName("projectPaths")]
public IList<string>? ProjectPaths { get; set; }
/// <summary>Optional list of additional skill directory paths to include.</summary>
[JsonPropertyName("skillDirectories")]
public IList<string>? SkillDirectories { get; set; }
}
/// <summary>RPC data type for SkillsConfigSetDisabledSkills operations.</summary>
internal sealed class SkillsConfigSetDisabledSkillsRequest
{
/// <summary>List of skill names to disable.</summary>
[JsonPropertyName("disabledSkills")]
public IList<string> DisabledSkills { get => field ??= []; set; }
}
/// <summary>RPC data type for SessionFsSetProvider operations.</summary>
public sealed class SessionFsSetProviderResult
{
/// <summary>Whether the provider was set successfully.</summary>
[JsonPropertyName("success")]
public bool Success { get; set; }
}
/// <summary>RPC data type for SessionFsSetProvider operations.</summary>
internal sealed class SessionFsSetProviderRequest
{
/// <summary>Initial working directory for sessions.</summary>
[JsonPropertyName("initialCwd")]
public string InitialCwd { get; set; } = string.Empty;
/// <summary>Path within each session's SessionFs where the runtime stores files for that session.</summary>
[JsonPropertyName("sessionStatePath")]
public string SessionStatePath { get; set; } = string.Empty;
/// <summary>Path conventions used by this filesystem.</summary>
[JsonPropertyName("conventions")]
public SessionFsSetProviderConventions Conventions { get; set; }
}
/// <summary>RPC data type for SessionsFork operations.</summary>
[Experimental(Diagnostics.Experimental)]
public sealed class SessionsForkResult
{
/// <summary>The new forked session's ID.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for SessionsFork operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal sealed class SessionsForkRequest
{
/// <summary>Source session ID to fork from.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
/// <summary>Optional event ID boundary. When provided, the fork includes only events before this ID (exclusive). When omitted, all events are included.</summary>
[JsonPropertyName("toEventId")]
public string? ToEventId { get; set; }
}
/// <summary>RPC data type for Log operations.</summary>
public sealed class LogResult
{
/// <summary>The unique identifier of the emitted session event.</summary>
[JsonPropertyName("eventId")]
public Guid EventId { get; set; }
}
/// <summary>RPC data type for Log operations.</summary>
internal sealed class LogRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
/// <summary>Human-readable message.</summary>
[JsonPropertyName("message")]
public string Message { get; set; } = string.Empty;
/// <summary>Log severity level. Determines how the message is displayed in the timeline. Defaults to "info".</summary>
[JsonPropertyName("level")]
public SessionLogLevel? Level { get; set; }
/// <summary>When true, the message is transient and not persisted to the session event log on disk.</summary>
[JsonPropertyName("ephemeral")]
public bool? Ephemeral { get; set; }
/// <summary>Optional URL the user can open in their browser for more details.</summary>
[Url]
[StringSyntax(StringSyntaxAttribute.Uri)]
[JsonPropertyName("url")]
public string? Url { get; set; }
}
/// <summary>RPC data type for CurrentModel operations.</summary>
public sealed class CurrentModel
{
/// <summary>Currently active model identifier.</summary>
[JsonPropertyName("modelId")]
public string? ModelId { get; set; }
}
/// <summary>RPC data type for SessionModelGetCurrent operations.</summary>
internal sealed class SessionModelGetCurrentRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for ModelSwitchTo operations.</summary>
public sealed class ModelSwitchToResult
{
/// <summary>Currently active model identifier after the switch.</summary>
[JsonPropertyName("modelId")]
public string? ModelId { get; set; }
}
/// <summary>Feature flags indicating what the model supports.</summary>
public sealed class ModelCapabilitiesOverrideSupports
{
/// <summary>Gets or sets the <c>vision</c> value.</summary>
[JsonPropertyName("vision")]
public bool? Vision { get; set; }
/// <summary>Gets or sets the <c>reasoningEffort</c> value.</summary>
[JsonPropertyName("reasoningEffort")]
public bool? ReasoningEffort { get; set; }
}
/// <summary>RPC data type for ModelCapabilitiesOverrideLimitsVision operations.</summary>
public sealed class ModelCapabilitiesOverrideLimitsVision
{
/// <summary>MIME types the model accepts.</summary>
[JsonPropertyName("supported_media_types")]
public IList<string>? SupportedMediaTypes { get; set; }
/// <summary>Maximum number of images per prompt.</summary>
[Range((double)1, (double)long.MaxValue)]
[JsonPropertyName("max_prompt_images")]
public long? MaxPromptImages { get; set; }
/// <summary>Maximum image size in bytes.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("max_prompt_image_size")]
public long? MaxPromptImageSize { get; set; }
}
/// <summary>Token limits for prompts, outputs, and context window.</summary>
public sealed class ModelCapabilitiesOverrideLimits
{
/// <summary>Gets or sets the <c>max_prompt_tokens</c> value.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("max_prompt_tokens")]
public long? MaxPromptTokens { get; set; }
/// <summary>Gets or sets the <c>max_output_tokens</c> value.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("max_output_tokens")]
public long? MaxOutputTokens { get; set; }
/// <summary>Maximum total context window size in tokens.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("max_context_window_tokens")]
public long? MaxContextWindowTokens { get; set; }
/// <summary>Gets or sets the <c>vision</c> value.</summary>
[JsonPropertyName("vision")]
public ModelCapabilitiesOverrideLimitsVision? Vision { get; set; }
}
/// <summary>Override individual model capabilities resolved by the runtime.</summary>
public sealed class ModelCapabilitiesOverride
{
/// <summary>Feature flags indicating what the model supports.</summary>
[JsonPropertyName("supports")]
public ModelCapabilitiesOverrideSupports? Supports { get; set; }
/// <summary>Token limits for prompts, outputs, and context window.</summary>
[JsonPropertyName("limits")]
public ModelCapabilitiesOverrideLimits? Limits { get; set; }
}
/// <summary>RPC data type for ModelSwitchTo operations.</summary>
internal sealed class ModelSwitchToRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
/// <summary>Model identifier to switch to.</summary>
[JsonPropertyName("modelId")]
public string ModelId { get; set; } = string.Empty;
/// <summary>Reasoning effort level to use for the model.</summary>
[JsonPropertyName("reasoningEffort")]
public string? ReasoningEffort { get; set; }
/// <summary>Override individual model capabilities resolved by the runtime.</summary>
[JsonPropertyName("modelCapabilities")]
public ModelCapabilitiesOverride? ModelCapabilities { get; set; }
}
/// <summary>RPC data type for SessionModeGet operations.</summary>
internal sealed class SessionModeGetRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for ModeSet operations.</summary>
internal sealed class ModeSetRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
/// <summary>The agent mode. Valid values: "interactive", "plan", "autopilot".</summary>
[JsonPropertyName("mode")]
public SessionMode Mode { get; set; }
}
/// <summary>RPC data type for NameGet operations.</summary>
public sealed class NameGetResult
{
/// <summary>The session name, falling back to the auto-generated summary, or null if neither exists.</summary>
[JsonPropertyName("name")]
public string? Name { get; set; }
}
/// <summary>RPC data type for SessionNameGet operations.</summary>
internal sealed class SessionNameGetRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for NameSet operations.</summary>
internal sealed class NameSetRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
/// <summary>New session name (1–100 characters, trimmed of leading/trailing whitespace).</summary>
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
[MinLength(1)]
[MaxLength(100)]
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
}
/// <summary>RPC data type for PlanRead operations.</summary>
public sealed class PlanReadResult
{
/// <summary>Whether the plan file exists in the workspace.</summary>
[JsonPropertyName("exists")]
public bool Exists { get; set; }
/// <summary>The content of the plan file, or null if it does not exist.</summary>
[JsonPropertyName("content")]
public string? Content { get; set; }
/// <summary>Absolute file path of the plan file, or null if workspace is not enabled.</summary>
[JsonPropertyName("path")]
public string? Path { get; set; }
}
/// <summary>RPC data type for SessionPlanRead operations.</summary>
internal sealed class SessionPlanReadRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for PlanUpdate operations.</summary>
internal sealed class PlanUpdateRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
/// <summary>The new content for the plan file.</summary>
[JsonPropertyName("content")]
public string Content { get; set; } = string.Empty;
}
/// <summary>RPC data type for SessionPlanDelete operations.</summary>
internal sealed class SessionPlanDeleteRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for WorkspacesGetWorkspaceResultWorkspace operations.</summary>
public sealed class WorkspacesGetWorkspaceResultWorkspace
{
/// <summary>Gets or sets the <c>id</c> value.</summary>
[JsonPropertyName("id")]
public Guid Id { get; set; }
/// <summary>Gets or sets the <c>cwd</c> value.</summary>
[JsonPropertyName("cwd")]
public string? Cwd { get; set; }
/// <summary>Gets or sets the <c>git_root</c> value.</summary>
[JsonPropertyName("git_root")]
public string? GitRoot { get; set; }
/// <summary>Gets or sets the <c>repository</c> value.</summary>
[JsonPropertyName("repository")]
public string? Repository { get; set; }
/// <summary>Gets or sets the <c>host_type</c> value.</summary>
[JsonPropertyName("host_type")]
public WorkspacesGetWorkspaceResultWorkspaceHostType? HostType { get; set; }
/// <summary>Gets or sets the <c>branch</c> value.</summary>
[JsonPropertyName("branch")]
public string? Branch { get; set; }
/// <summary>Gets or sets the <c>summary</c> value.</summary>
[JsonPropertyName("summary")]
public string? Summary { get; set; }
/// <summary>Gets or sets the <c>name</c> value.</summary>
[JsonPropertyName("name")]
public string? Name { get; set; }
/// <summary>Gets or sets the <c>summary_count</c> value.</summary>
[Range((double)0, (double)long.MaxValue)]
[JsonPropertyName("summary_count")]
public long? SummaryCount { get; set; }
/// <summary>Gets or sets the <c>created_at</c> value.</summary>
[JsonPropertyName("created_at")]
public DateTimeOffset? CreatedAt { get; set; }
/// <summary>Gets or sets the <c>updated_at</c> value.</summary>
[JsonPropertyName("updated_at")]
public DateTimeOffset? UpdatedAt { get; set; }
/// <summary>Gets or sets the <c>remote_steerable</c> value.</summary>
[JsonPropertyName("remote_steerable")]
public bool? RemoteSteerable { get; set; }
/// <summary>Gets or sets the <c>mc_task_id</c> value.</summary>
[JsonPropertyName("mc_task_id")]
public string? McTaskId { get; set; }
/// <summary>Gets or sets the <c>mc_session_id</c> value.</summary>
[JsonPropertyName("mc_session_id")]
public string? McSessionId { get; set; }
/// <summary>Gets or sets the <c>mc_last_event_id</c> value.</summary>
[JsonPropertyName("mc_last_event_id")]
public string? McLastEventId { get; set; }
/// <summary>Gets or sets the <c>session_sync_level</c> value.</summary>
[JsonPropertyName("session_sync_level")]
public WorkspacesGetWorkspaceResultWorkspaceSessionSyncLevel? SessionSyncLevel { get; set; }
/// <summary>Gets or sets the <c>chronicle_sync_dismissed</c> value.</summary>
[JsonPropertyName("chronicle_sync_dismissed")]
public bool? ChronicleSyncDismissed { get; set; }
}
/// <summary>RPC data type for WorkspacesGetWorkspace operations.</summary>
public sealed class WorkspacesGetWorkspaceResult
{
/// <summary>Current workspace metadata, or null if not available.</summary>
[JsonPropertyName("workspace")]
public WorkspacesGetWorkspaceResultWorkspace? Workspace { get; set; }
}
/// <summary>RPC data type for SessionWorkspacesGetWorkspace operations.</summary>
internal sealed class SessionWorkspacesGetWorkspaceRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for WorkspacesListFiles operations.</summary>
public sealed class WorkspacesListFilesResult
{
/// <summary>Relative file paths in the workspace files directory.</summary>
[JsonPropertyName("files")]
public IList<string> Files { get => field ??= []; set; }
}
/// <summary>RPC data type for SessionWorkspacesListFiles operations.</summary>
internal sealed class SessionWorkspacesListFilesRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for WorkspacesReadFile operations.</summary>
public sealed class WorkspacesReadFileResult
{
/// <summary>File content as a UTF-8 string.</summary>
[JsonPropertyName("content")]
public string Content { get; set; } = string.Empty;
}
/// <summary>RPC data type for WorkspacesReadFile operations.</summary>
internal sealed class WorkspacesReadFileRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
/// <summary>Relative path within the workspace files directory.</summary>
[JsonPropertyName("path")]
public string Path { get; set; } = string.Empty;
}
/// <summary>RPC data type for WorkspacesCreateFile operations.</summary>
internal sealed class WorkspacesCreateFileRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
/// <summary>Relative path within the workspace files directory.</summary>
[JsonPropertyName("path")]
public string Path { get; set; } = string.Empty;
/// <summary>File content to write as a UTF-8 string.</summary>
[JsonPropertyName("content")]
public string Content { get; set; } = string.Empty;
}
/// <summary>RPC data type for InstructionsSources operations.</summary>
public sealed class InstructionsSources
{
/// <summary>Unique identifier for this source (used for toggling).</summary>
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
/// <summary>Human-readable label.</summary>
[JsonPropertyName("label")]
public string Label { get; set; } = string.Empty;
/// <summary>File path relative to repo or absolute for home.</summary>
[JsonPropertyName("sourcePath")]
public string SourcePath { get; set; } = string.Empty;
/// <summary>Raw content of the instruction file.</summary>
[JsonPropertyName("content")]
public string Content { get; set; } = string.Empty;
/// <summary>Category of instruction source — used for merge logic.</summary>
[JsonPropertyName("type")]
public InstructionsSourcesType Type { get; set; }
/// <summary>Where this source lives — used for UI grouping.</summary>
[JsonPropertyName("location")]
public InstructionsSourcesLocation Location { get; set; }
/// <summary>Glob pattern from frontmatter — when set, this instruction applies only to matching files.</summary>
[JsonPropertyName("applyTo")]
public string? ApplyTo { get; set; }
/// <summary>Short description (body after frontmatter) for use in instruction tables.</summary>
[JsonPropertyName("description")]
public string? Description { get; set; }
}
/// <summary>RPC data type for InstructionsGetSources operations.</summary>
public sealed class InstructionsGetSourcesResult
{
/// <summary>Instruction sources for the session.</summary>
[JsonPropertyName("sources")]
public IList<InstructionsSources> Sources { get => field ??= []; set; }
}
/// <summary>RPC data type for SessionInstructionsGetSources operations.</summary>
internal sealed class SessionInstructionsGetSourcesRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for FleetStart operations.</summary>
[Experimental(Diagnostics.Experimental)]
public sealed class FleetStartResult
{
/// <summary>Whether fleet mode was successfully activated.</summary>
[JsonPropertyName("started")]
public bool Started { get; set; }
}
/// <summary>RPC data type for FleetStart operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal sealed class FleetStartRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
/// <summary>Optional user prompt to combine with fleet instructions.</summary>
[JsonPropertyName("prompt")]
public string? Prompt { get; set; }
}
/// <summary>RPC data type for AgentInfo operations.</summary>
public sealed class AgentInfo
{
/// <summary>Unique identifier of the custom agent.</summary>
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>Human-readable display name.</summary>
[JsonPropertyName("displayName")]
public string DisplayName { get; set; } = string.Empty;
/// <summary>Description of the agent's purpose.</summary>
[JsonPropertyName("description")]
public string Description { get; set; } = string.Empty;
}
/// <summary>RPC data type for AgentList operations.</summary>
[Experimental(Diagnostics.Experimental)]
public sealed class AgentList
{
/// <summary>Available custom agents.</summary>
[JsonPropertyName("agents")]
public IList<AgentInfo> Agents { get => field ??= []; set; }
}
/// <summary>RPC data type for SessionAgentList operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal sealed class SessionAgentListRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for AgentGetCurrent operations.</summary>
[Experimental(Diagnostics.Experimental)]
public sealed class AgentGetCurrentResult
{
/// <summary>Currently selected custom agent, or null if using the default agent.</summary>
[JsonPropertyName("agent")]
public AgentInfo? Agent { get; set; }
}
/// <summary>RPC data type for SessionAgentGetCurrent operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal sealed class SessionAgentGetCurrentRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for AgentSelect operations.</summary>
[Experimental(Diagnostics.Experimental)]
public sealed class AgentSelectResult
{
/// <summary>The newly selected custom agent.</summary>
[JsonPropertyName("agent")]
public AgentInfo Agent { get => field ??= new(); set; }
}
/// <summary>RPC data type for AgentSelect operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal sealed class AgentSelectRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
/// <summary>Name of the custom agent to select.</summary>
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
}
/// <summary>RPC data type for SessionAgentDeselect operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal sealed class SessionAgentDeselectRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for AgentReload operations.</summary>
[Experimental(Diagnostics.Experimental)]
public sealed class AgentReloadResult
{
/// <summary>Reloaded custom agents.</summary>
[JsonPropertyName("agents")]
public IList<AgentInfo> Agents { get => field ??= []; set; }
}
/// <summary>RPC data type for SessionAgentReload operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal sealed class SessionAgentReloadRequest
{
/// <summary>Target session identifier.</summary>
[JsonPropertyName("sessionId")]
public string SessionId { get; set; } = string.Empty;
}
/// <summary>RPC data type for Skill operations.</summary>
public sealed class Skill
{
/// <summary>Unique identifier for the skill.</summary>
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>Description of what the skill does.</summary>