@oh-my-pi/pi-ai 4.2.3 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3526 @@
1
+ syntax = "proto3";
2
+
3
+ package agent.v1;
4
+
5
+ enum AppliedAgentChange_ChangeType {
6
+ CHANGE_TYPE_UNSPECIFIED = 0;
7
+ CHANGE_TYPE_CREATED = 1;
8
+ CHANGE_TYPE_MODIFIED = 2;
9
+ CHANGE_TYPE_DELETED = 3;
10
+ }
11
+
12
+ enum MouseButton {
13
+ MOUSE_BUTTON_UNSPECIFIED = 0;
14
+ MOUSE_BUTTON_LEFT = 1;
15
+ MOUSE_BUTTON_RIGHT = 2;
16
+ MOUSE_BUTTON_MIDDLE = 3;
17
+ MOUSE_BUTTON_BACK = 4;
18
+ MOUSE_BUTTON_FORWARD = 5;
19
+ }
20
+
21
+ enum ScrollDirection {
22
+ SCROLL_DIRECTION_UNSPECIFIED = 0;
23
+ SCROLL_DIRECTION_UP = 1;
24
+ SCROLL_DIRECTION_DOWN = 2;
25
+ SCROLL_DIRECTION_LEFT = 3;
26
+ SCROLL_DIRECTION_RIGHT = 4;
27
+ }
28
+
29
+ enum CursorRuleSource {
30
+ CURSOR_RULE_SOURCE_UNSPECIFIED = 0;
31
+ CURSOR_RULE_SOURCE_TEAM = 1;
32
+ CURSOR_RULE_SOURCE_USER = 2;
33
+ }
34
+
35
+ enum DiagnosticSeverity {
36
+ DIAGNOSTIC_SEVERITY_UNSPECIFIED = 0;
37
+ DIAGNOSTIC_SEVERITY_ERROR = 1;
38
+ DIAGNOSTIC_SEVERITY_WARNING = 2;
39
+ DIAGNOSTIC_SEVERITY_INFORMATION = 3;
40
+ DIAGNOSTIC_SEVERITY_HINT = 4;
41
+ }
42
+
43
+ enum RecordingMode {
44
+ RECORDING_MODE_UNSPECIFIED = 0;
45
+ RECORDING_MODE_START_RECORDING = 1;
46
+ RECORDING_MODE_SAVE_RECORDING = 2;
47
+ RECORDING_MODE_DISCARD_RECORDING = 3;
48
+ }
49
+
50
+ enum RequestedFilePathRejectedReason {
51
+ REQUESTED_FILE_PATH_REJECTED_REASON_UNSPECIFIED = 0;
52
+ REQUESTED_FILE_PATH_REJECTED_REASON_SLASHES_NOT_ALLOWED = 1;
53
+ }
54
+
55
+ enum PackageType {
56
+ PACKAGE_TYPE_UNSPECIFIED = 0;
57
+ PACKAGE_TYPE_CURSOR_PROJECT = 1;
58
+ PACKAGE_TYPE_CURSOR_PERSONAL = 2;
59
+ PACKAGE_TYPE_CLAUDE_SKILL = 3;
60
+ PACKAGE_TYPE_CLAUDE_PLUGIN = 4;
61
+ }
62
+
63
+ enum SandboxPolicy_Type {
64
+ TYPE_UNSPECIFIED = 0;
65
+ TYPE_INSECURE_NONE = 1;
66
+ TYPE_WORKSPACE_READWRITE = 2;
67
+ TYPE_WORKSPACE_READONLY = 3;
68
+ }
69
+
70
+ enum TimeoutBehavior {
71
+ TIMEOUT_BEHAVIOR_UNSPECIFIED = 0;
72
+ TIMEOUT_BEHAVIOR_CANCEL = 1;
73
+ TIMEOUT_BEHAVIOR_BACKGROUND = 2;
74
+ }
75
+
76
+ enum ShellAbortReason {
77
+ SHELL_ABORT_REASON_UNSPECIFIED = 0;
78
+ SHELL_ABORT_REASON_USER_ABORT = 1;
79
+ SHELL_ABORT_REASON_TIMEOUT = 2;
80
+ }
81
+
82
+ enum CustomSubagentPermissionMode {
83
+ CUSTOM_SUBAGENT_PERMISSION_MODE_UNSPECIFIED = 0;
84
+ CUSTOM_SUBAGENT_PERMISSION_MODE_DEFAULT = 1;
85
+ CUSTOM_SUBAGENT_PERMISSION_MODE_READONLY = 2;
86
+ }
87
+
88
+ enum TodoStatus {
89
+ TODO_STATUS_UNSPECIFIED = 0;
90
+ TODO_STATUS_PENDING = 1;
91
+ TODO_STATUS_IN_PROGRESS = 2;
92
+ TODO_STATUS_COMPLETED = 3;
93
+ TODO_STATUS_CANCELLED = 4;
94
+ }
95
+
96
+ enum ClientOS {
97
+ CLIENT_OS_UNSPECIFIED = 0;
98
+ CLIENT_OS_WINDOWS = 1;
99
+ CLIENT_OS_MACOS = 2;
100
+ CLIENT_OS_LINUX = 3;
101
+ }
102
+
103
+ enum ArtifactUploadDispatchStatus {
104
+ ARTIFACT_UPLOAD_DISPATCH_STATUS_UNSPECIFIED = 0;
105
+ ARTIFACT_UPLOAD_DISPATCH_STATUS_ACCEPTED = 1;
106
+ ARTIFACT_UPLOAD_DISPATCH_STATUS_REJECTED = 2;
107
+ ARTIFACT_UPLOAD_DISPATCH_STATUS_SKIPPED_ALREADY_IN_PROGRESS = 3;
108
+ }
109
+
110
+ enum Frame_Kind {
111
+ KIND_UNSPECIFIED = 0;
112
+ KIND_REQUEST = 1;
113
+ KIND_RESPONSE = 2;
114
+ KIND_ERROR = 3;
115
+ }
116
+
117
+ enum BugbotDeeplinkEventKind {
118
+ BUGBOT_DEEPLINK_EVENT_KIND_UNSPECIFIED = 0;
119
+ BUGBOT_DEEPLINK_EVENT_KIND_CLICKED = 1;
120
+ BUGBOT_DEEPLINK_EVENT_KIND_HANDLED_DIALOG_SHOWN = 2;
121
+ BUGBOT_DEEPLINK_EVENT_KIND_HANDLED_CHAT_CREATED = 3;
122
+ BUGBOT_DEEPLINK_EVENT_KIND_ERROR = 4;
123
+ BUGBOT_DEEPLINK_EVENT_KIND_HANDLED_FIX_IN_WEB = 5;
124
+ }
125
+
126
+ message GlobToolResult {
127
+ oneof result {
128
+ GlobToolSuccess success = 1;
129
+ GlobToolError error = 2;
130
+ }
131
+ }
132
+
133
+ message GlobToolError {
134
+ string error = 1;
135
+ }
136
+
137
+ // Only file results are needed for this tool
138
+ message GlobToolSuccess {
139
+ string pattern = 1;
140
+ string path = 2;
141
+ repeated string files = 3;
142
+ int32 total_files = 4;
143
+ bool client_truncated = 5;
144
+ bool ripgrep_truncated = 6;
145
+ }
146
+
147
+ message GlobToolCall {
148
+ bytes args = 1;
149
+ GlobToolResult result = 2;
150
+ }
151
+
152
+ message ReadLintsToolCall {
153
+ ReadLintsToolArgs args = 1;
154
+ ReadLintsToolResult result = 2;
155
+ }
156
+
157
+ message ReadLintsToolArgs {
158
+ repeated string paths = 1;
159
+ }
160
+
161
+ message ReadLintsToolResult {
162
+ oneof result {
163
+ ReadLintsToolSuccess success = 1;
164
+ ReadLintsToolError error = 2;
165
+ }
166
+ }
167
+
168
+ message ReadLintsToolSuccess {
169
+ repeated FileDiagnostics file_diagnostics = 1;
170
+ int32 total_files = 2;
171
+ int32 total_diagnostics = 3;
172
+ }
173
+
174
+ message FileDiagnostics {
175
+ string path = 1;
176
+ repeated DiagnosticItem diagnostics = 2;
177
+ int32 diagnostics_count = 3;
178
+ }
179
+
180
+ message DiagnosticItem {
181
+ DiagnosticSeverity severity = 1;
182
+ DiagnosticRange range = 2;
183
+ string message = 3;
184
+ string source = 4;
185
+ string code = 5;
186
+ bool is_stale = 6;
187
+ }
188
+
189
+ message DiagnosticRange {
190
+ Position start = 1;
191
+ Position end = 2;
192
+ }
193
+
194
+ message ReadLintsToolError {
195
+ string error_message = 1;
196
+ }
197
+
198
+ message McpToolError {
199
+ string error = 1;
200
+ }
201
+
202
+ // Result for MCP tool calls (separate from exec results)
203
+ message McpToolResult {
204
+ oneof result {
205
+ McpSuccess success = 1;
206
+ McpToolError error = 2;
207
+ McpRejected rejected = 3;
208
+ McpPermissionDenied permission_denied = 4;
209
+ }
210
+ }
211
+
212
+ message McpToolCall {
213
+ McpArgs args = 1;
214
+ McpToolResult result = 2;
215
+ }
216
+
217
+ message SemSearchToolCall {
218
+ SemSearchToolArgs args = 1;
219
+ SemSearchToolResult result = 2;
220
+ }
221
+
222
+ message SemSearchToolArgs {
223
+ string query = 1;
224
+ repeated string target_directories = 2;
225
+ string explanation = 3;
226
+ }
227
+
228
+ message SemSearchToolResult {
229
+ oneof result {
230
+ SemSearchToolSuccess success = 1;
231
+ SemSearchToolError error = 2;
232
+ }
233
+ }
234
+
235
+ message SemSearchToolSuccess {
236
+ string results = 1;
237
+ repeated bytes code_results = 2;
238
+ }
239
+
240
+ message SemSearchToolError {
241
+ string error_message = 1;
242
+ }
243
+
244
+ message ListMcpResourcesToolCall {
245
+ ListMcpResourcesExecArgs args = 1;
246
+ ListMcpResourcesExecResult result = 2;
247
+ }
248
+
249
+ message ReadMcpResourceToolCall {
250
+ ReadMcpResourceExecArgs args = 1;
251
+ ReadMcpResourceExecResult result = 2;
252
+ }
253
+
254
+ message FetchToolCall {
255
+ FetchArgs args = 1;
256
+ FetchResult result = 2;
257
+ }
258
+
259
+ message RecordScreenToolCall {
260
+ RecordScreenArgs args = 1;
261
+ RecordScreenResult result = 2;
262
+ }
263
+
264
+ message WriteShellStdinToolCall {
265
+ WriteShellStdinArgs args = 1;
266
+ WriteShellStdinResult result = 2;
267
+ }
268
+
269
+ message ReflectArgs {
270
+ string unexpected_action_outcomes = 1;
271
+ string relevant_instructions = 2;
272
+ string scenario_analysis = 3;
273
+ string critical_synthesis = 4;
274
+ string next_steps = 5;
275
+ string tool_call_id = 6;
276
+ }
277
+
278
+ message ReflectResult {
279
+ oneof result {
280
+ ReflectSuccess success = 1;
281
+ ReflectError error = 2;
282
+ }
283
+ }
284
+
285
+ message ReflectSuccess {
286
+ }
287
+
288
+ message ReflectError {
289
+ string error = 1;
290
+ }
291
+
292
+ message ReflectToolCall {
293
+ ReflectArgs args = 1;
294
+ ReflectResult result = 2;
295
+ }
296
+
297
+ message StartGrindExecutionArgs {
298
+ // Optional explanation for why the agent is requesting to begin executing.
299
+ optional string explanation = 1;
300
+ string tool_call_id = 2;
301
+ }
302
+
303
+ message StartGrindExecutionResult {
304
+ oneof result {
305
+ StartGrindExecutionSuccess success = 1;
306
+ StartGrindExecutionError error = 2;
307
+ }
308
+ }
309
+
310
+ message StartGrindExecutionSuccess {
311
+ }
312
+
313
+ message StartGrindExecutionError {
314
+ string error = 1;
315
+ }
316
+
317
+ message StartGrindExecutionToolCall {
318
+ StartGrindExecutionArgs args = 1;
319
+ StartGrindExecutionResult result = 2;
320
+ }
321
+
322
+ message StartGrindPlanningArgs {
323
+ // Optional explanation for why the agent is requesting to return to planning.
324
+ optional string explanation = 1;
325
+ string tool_call_id = 2;
326
+ }
327
+
328
+ message StartGrindPlanningResult {
329
+ oneof result {
330
+ StartGrindPlanningSuccess success = 1;
331
+ StartGrindPlanningError error = 2;
332
+ }
333
+ }
334
+
335
+ message StartGrindPlanningSuccess {
336
+ }
337
+
338
+ message StartGrindPlanningError {
339
+ string error = 1;
340
+ }
341
+
342
+ message StartGrindPlanningToolCall {
343
+ StartGrindPlanningArgs args = 1;
344
+ StartGrindPlanningResult result = 2;
345
+ }
346
+
347
+ // var AgentMode; (function (AgentMode) { AgentMode[AgentMode["UNSPECIFIED"] = 0] = "UNSPECIFIED"; AgentMode[AgentMode["AGENT"] = 1] = "AGENT"; AgentMode[AgentMode["ASK"] = 2] = "ASK"; AgentMode[AgentMode["PLAN"] = 3] = "PLAN"; AgentMode[AgentMode["DEBUG"] = 4] = "DEBUG"; AgentMode[AgentMode["TRIAGE"] = 5] = "TRIAGE"; AgentMode[AgentMode["PROJECT"] = 6] = "PROJECT"; })(AgentMode || (AgentMode = {})); // Retrieve enum metadata with: proto3.getEnumType(AgentMode) proto3/* int32 */.C.util.setEnumType(AgentMode, "agent.v1.AgentMode", [ { no: 0, name: "AGENT_MODE_UNSPECIFIED" }, { no: 1, name: "AGENT_MODE_AGENT" }, { no: 2, name: "AGENT_MODE_ASK" }, { no: 3, name: "AGENT_MODE_PLAN" }, { no: 4, name: "AGENT_MODE_DEBUG" }, { no: 5, name: "AGENT_MODE_TRIAGE" }, { no: 6, name: "AGENT_MODE_PROJECT" }, ]);
348
+ message TaskArgs {
349
+ string description = 1;
350
+ string prompt = 2;
351
+ SubagentType subagent_type = 3;
352
+ optional string model = 4;
353
+ optional string resume = 5;
354
+ }
355
+
356
+ message TaskSuccess {
357
+ repeated ConversationStep conversation_steps = 1;
358
+ optional string agent_id = 2;
359
+ bool is_background = 3;
360
+ optional uint64 duration_ms = 4;
361
+ }
362
+
363
+ message TaskError {
364
+ string error = 1;
365
+ }
366
+
367
+ message TaskResult {
368
+ oneof result {
369
+ TaskSuccess success = 1;
370
+ TaskError error = 2;
371
+ }
372
+ }
373
+
374
+ message TaskToolCall {
375
+ TaskArgs args = 1;
376
+ TaskResult result = 2;
377
+ }
378
+
379
+ message TaskToolCallDelta {
380
+ InteractionUpdate interaction_update = 1;
381
+ }
382
+
383
+ // Tool messages (from tool.proto)
384
+ message ToolCall {
385
+ oneof tool {
386
+ ShellToolCall shell_tool_call = 1;
387
+ DeleteToolCall delete_tool_call = 3;
388
+ GlobToolCall glob_tool_call = 4;
389
+ GrepToolCall grep_tool_call = 5;
390
+ ReadToolCall read_tool_call = 8;
391
+ UpdateTodosToolCall update_todos_tool_call = 9;
392
+ ReadTodosToolCall read_todos_tool_call = 10;
393
+ EditToolCall edit_tool_call = 12;
394
+ LsToolCall ls_tool_call = 13;
395
+ ReadLintsToolCall read_lints_tool_call = 14;
396
+ McpToolCall mcp_tool_call = 15;
397
+ SemSearchToolCall sem_search_tool_call = 16;
398
+ CreatePlanToolCall create_plan_tool_call = 17;
399
+ WebSearchToolCall web_search_tool_call = 18;
400
+ TaskToolCall task_tool_call = 19;
401
+ ListMcpResourcesToolCall list_mcp_resources_tool_call = 20;
402
+ ReadMcpResourceToolCall read_mcp_resource_tool_call = 21;
403
+ ApplyAgentDiffToolCall apply_agent_diff_tool_call = 22;
404
+ AskQuestionToolCall ask_question_tool_call = 23;
405
+ FetchToolCall fetch_tool_call = 24;
406
+ SwitchModeToolCall switch_mode_tool_call = 25;
407
+ ExaSearchToolCall exa_search_tool_call = 26;
408
+ ExaFetchToolCall exa_fetch_tool_call = 27;
409
+ GenerateImageToolCall generate_image_tool_call = 28;
410
+ RecordScreenToolCall record_screen_tool_call = 29;
411
+ ComputerUseToolCall computer_use_tool_call = 30;
412
+ WriteShellStdinToolCall write_shell_stdin_tool_call = 31;
413
+ ReflectToolCall reflect_tool_call = 32;
414
+ SetupVmEnvironmentToolCall setup_vm_environment_tool_call = 33;
415
+ TruncatedToolCall truncated_tool_call = 34;
416
+ StartGrindExecutionToolCall start_grind_execution_tool_call = 35;
417
+ StartGrindPlanningToolCall start_grind_planning_tool_call = 36;
418
+ }
419
+ }
420
+
421
+ message TruncatedToolCallArgs {
422
+ }
423
+
424
+ message TruncatedToolCallSuccess {
425
+ }
426
+
427
+ message TruncatedToolCallError {
428
+ string error = 1;
429
+ }
430
+
431
+ message TruncatedToolCallResult {
432
+ oneof result {
433
+ TruncatedToolCallSuccess success = 1;
434
+ TruncatedToolCallError error = 2;
435
+ }
436
+ }
437
+
438
+ // Placeholder for tool calls that were truncated due to size limits.
439
+ message TruncatedToolCall {
440
+ bytes original_step_blob_id = 1;
441
+ // unused, just matches the discriminated union for other tool calls
442
+ TruncatedToolCallArgs args = 2;
443
+ TruncatedToolCallResult result = 3;
444
+ }
445
+
446
+ message ToolCallDelta {
447
+ oneof delta {
448
+ ShellToolCallDelta shell_tool_call_delta = 1;
449
+ TaskToolCallDelta task_tool_call_delta = 2;
450
+ EditToolCallDelta edit_tool_call_delta = 3;
451
+ }
452
+ }
453
+
454
+ message ConversationStep {
455
+ oneof message {
456
+ AssistantMessage assistant_message = 1;
457
+ ToolCall tool_call = 2;
458
+ ThinkingMessage thinking_message = 3;
459
+ }
460
+ }
461
+
462
+ message ConversationAction {
463
+ oneof action {
464
+ UserMessageAction user_message_action = 1;
465
+ ResumeAction resume_action = 2;
466
+ CancelAction cancel_action = 3;
467
+ SummarizeAction summarize_action = 4;
468
+ ShellCommandAction shell_command_action = 5;
469
+ StartPlanAction start_plan_action = 6;
470
+ ExecutePlanAction execute_plan_action = 7;
471
+ AsyncAskQuestionCompletionAction async_ask_question_completion_action = 8;
472
+ }
473
+ }
474
+
475
+ message UserMessageAction {
476
+ UserMessage user_message = 1;
477
+ RequestContext request_context = 2;
478
+ optional bool send_to_interaction_listener = 3;
479
+ }
480
+
481
+ message CancelAction {
482
+ }
483
+
484
+ message ResumeAction {
485
+ RequestContext request_context = 2;
486
+ }
487
+
488
+ message AsyncAskQuestionCompletionAction {
489
+ // Contains the original tool call ID and the result from the user
490
+ string original_tool_call_id = 1;
491
+ AskQuestionArgs original_args = 2;
492
+ AskQuestionResult result = 3;
493
+ }
494
+
495
+ message SummarizeAction {
496
+ }
497
+
498
+ message ShellCommandAction {
499
+ ShellCommand shell_command = 1;
500
+ // unique identifier for preemptive exec attachment
501
+ string exec_id = 2;
502
+ }
503
+
504
+ message StartPlanAction {
505
+ UserMessage user_message = 1;
506
+ RequestContext request_context = 2;
507
+ bool is_spec = 3;
508
+ }
509
+
510
+ message ExecutePlanAction {
511
+ RequestContext request_context = 1;
512
+ optional ConversationPlan plan = 2;
513
+ // e.g., "cursor-plan://composerId/plan.md"
514
+ optional string plan_file_uri = 3;
515
+ // The actual plan content from the file
516
+ optional string plan_file_content = 4;
517
+ }
518
+
519
+ message UserMessage {
520
+ string text = 1;
521
+ string message_id = 2;
522
+ optional SelectedContext selected_context = 3;
523
+ int32 mode = 4;
524
+ optional bool is_simulated_msg = 5;
525
+ optional string best_of_n_group_id = 6;
526
+ optional bool try_use_best_of_n_promotion = 7;
527
+ optional string rich_text = 8;
528
+ }
529
+
530
+ message AssistantMessage {
531
+ string text = 1;
532
+ }
533
+
534
+ message ThinkingMessage {
535
+ string text = 1;
536
+ uint32 duration_ms = 2;
537
+ }
538
+
539
+ message ShellCommand {
540
+ string command = 1;
541
+ }
542
+
543
+ message ShellOutput {
544
+ string stdout = 1;
545
+ string stderr = 2;
546
+ int32 exit_code = 3;
547
+ }
548
+
549
+ message ConversationTurn {
550
+ oneof turn {
551
+ AgentConversationTurn agent_conversation_turn = 1;
552
+ ShellConversationTurn shell_conversation_turn = 2;
553
+ }
554
+ }
555
+
556
+ message ConversationPlan {
557
+ string plan = 1;
558
+ }
559
+
560
+ message ConversationTurnStructure {
561
+ oneof turn {
562
+ AgentConversationTurnStructure agent_conversation_turn = 1;
563
+ ShellConversationTurnStructure shell_conversation_turn = 2;
564
+ }
565
+ }
566
+
567
+ message AgentConversationTurn {
568
+ UserMessage user_message = 1;
569
+ repeated ConversationStep steps = 2;
570
+ // The request ID associated with this turn, used for analytics tracking
571
+ optional string request_id = 3;
572
+ }
573
+
574
+ message AgentConversationTurnStructure {
575
+ bytes user_message = 1;
576
+ repeated bytes steps = 2;
577
+ // The request ID associated with this turn, used for analytics tracking
578
+ optional string request_id = 3;
579
+ }
580
+
581
+ message ShellConversationTurn {
582
+ ShellCommand shell_command = 1;
583
+ ShellOutput shell_output = 2;
584
+ }
585
+
586
+ message ShellConversationTurnStructure {
587
+ bytes shell_command = 1;
588
+ bytes shell_output = 2;
589
+ }
590
+
591
+ message ConversationSummary {
592
+ string summary = 1;
593
+ }
594
+
595
+ message ConversationSummaryArchive {
596
+ repeated bytes summarized_messages = 1;
597
+ string summary = 2;
598
+ uint32 window_tail = 3;
599
+ bytes summary_message = 4;
600
+ }
601
+
602
+ message ConversationTokenDetails {
603
+ uint32 used_tokens = 1;
604
+ uint32 max_tokens = 2;
605
+ }
606
+
607
+ message FileState {
608
+ // Optional content. If not set or undefined, the file is considered deleted.
609
+ optional string content = 1;
610
+ // Optional initial content captured when the file was first tracked. If not set or undefined, the file did not exist when tracking began.
611
+ optional string initial_content = 2;
612
+ }
613
+
614
+ message FileStateStructure {
615
+ // Optional content. If not set or undefined, the file is considered deleted.
616
+ optional bytes content = 1;
617
+ // Optional initial content captured when the file was first tracked. If not set or undefined, the file did not exist when tracking began.
618
+ optional bytes initial_content = 2;
619
+ }
620
+
621
+ message StepTiming {
622
+ uint64 duration_ms = 1;
623
+ uint64 timestamp_ms = 2;
624
+ }
625
+
626
+ message ConversationState {
627
+ repeated string root_prompt_messages_json = 1;
628
+ repeated ConversationTurn turns = 8;
629
+ repeated TodoItem todos = 3;
630
+ // Raw JSON stringified tool-call content parts awaiting execution
631
+ repeated string pending_tool_calls = 4;
632
+ ConversationTokenDetails token_details = 5;
633
+ // only for when the user explicitly asks for a summary through the summary action
634
+ optional ConversationSummary summary = 6;
635
+ optional ConversationPlan plan = 7;
636
+ optional ConversationSummaryArchive summary_archive = 9;
637
+ // Deprecated, use summary_archives instead @deprecated summaryArchive;
638
+ map<string, FileState> file_states = 10;
639
+ repeated ConversationSummaryArchive summary_archives = 11;
640
+ }
641
+
642
+ message SubagentPersistedState {
643
+ // The subagent's conversation state structure
644
+ ConversationStateStructure conversation_state = 1;
645
+ // Timestamp when this subagent was first created
646
+ uint64 created_timestamp_ms = 2;
647
+ // Timestamp when this subagent was last used (by task tool call)
648
+ uint64 last_used_timestamp_ms = 3;
649
+ // The subagent type (e.g., computerUse, custom with name)
650
+ SubagentType subagent_type = 4;
651
+ }
652
+
653
+ message ConversationStateStructure {
654
+ repeated bytes turns_old = 2;
655
+ // @deprecated turnsOld = [];
656
+ repeated bytes root_prompt_messages_json = 1;
657
+ repeated bytes turns = 8;
658
+ repeated bytes todos = 3;
659
+ // Raw JSON stringified tool-call content parts awaiting execution
660
+ repeated string pending_tool_calls = 4;
661
+ ConversationTokenDetails token_details = 5;
662
+ // only for when the user explicitly asks for a summary through the summary action
663
+ optional bytes summary = 6;
664
+ optional bytes plan = 7;
665
+ repeated string previous_workspace_uris = 9;
666
+ // Current mode of the conversation
667
+ optional int32 mode = 10;
668
+ optional bytes summary_archive = 11;
669
+ map<string, bytes> file_states = 12;
670
+ // Deprecated, use summary_archives instead @deprecated summaryArchive; Map of file paths to their latest content (stored as blob IDs in the KV store) Each blob contains a serialized FileState message @deprecated fileStates = {}; Map of file paths to their latest content (stored as FileStateStructure)
671
+ map<string, FileStateStructure> file_states_v2 = 15;
672
+ repeated bytes summary_archives = 13;
673
+ repeated StepTiming turn_timings = 14;
674
+ // Subagent resume tracking Map of subagent ID to the persisted subagent state (stored inline)
675
+ map<string, SubagentPersistedState> subagent_states = 16;
676
+ // Count of self-summaries generated for this conversation
677
+ uint32 self_summary_count = 17;
678
+ // Set of file paths that have been read during this conversation
679
+ repeated string read_paths = 18;
680
+ }
681
+
682
+ message ThinkingDetails {
683
+ }
684
+
685
+ message ApiKeyCredentials {
686
+ string api_key = 1;
687
+ // For OpenAI-compatible endpoints
688
+ optional string base_url = 2;
689
+ }
690
+
691
+ message AzureCredentials {
692
+ string api_key = 1;
693
+ string base_url = 2;
694
+ string deployment = 3;
695
+ }
696
+
697
+ message BedrockCredentials {
698
+ string access_key = 1;
699
+ string secret_key = 2;
700
+ string region = 3;
701
+ optional string session_token = 4;
702
+ }
703
+
704
+ message ModelDetails {
705
+ string model_id = 1;
706
+ string display_model_id = 3;
707
+ string display_name = 4;
708
+ string display_name_short = 5;
709
+ repeated string aliases = 6;
710
+ optional ThinkingDetails thinking_details = 2;
711
+ optional bool max_mode = 7;
712
+ oneof credentials {
713
+ ApiKeyCredentials api_key_credentials = 8;
714
+ AzureCredentials azure_credentials = 9;
715
+ BedrockCredentials bedrock_credentials = 10;
716
+ }
717
+ }
718
+
719
+ message RequestedModel {
720
+ string model_id = 1;
721
+ bool max_mode = 2;
722
+ repeated RequestedModel_ModelParameterbytes parameters = 3;
723
+ oneof credentials {
724
+ ApiKeyCredentials api_key_credentials = 4;
725
+ AzureCredentials azure_credentials = 5;
726
+ BedrockCredentials bedrock_credentials = 6;
727
+ }
728
+ }
729
+
730
+ message RequestedModel_ModelParameterbytes {
731
+ string id = 1;
732
+ // All paramters are encoded as strings. For boolean parameters, the value is either "true" or "false". For enum parameters, the value is one of the values in the enum.
733
+ string value = 2;
734
+ }
735
+
736
+ message AgentRunRequest {
737
+ ConversationStateStructure conversation_state = 1;
738
+ ConversationAction action = 2;
739
+ // TODO: Today we use model_details, but we are getting ready to deprecate that and use requested_model instead.
740
+ ModelDetails model_details = 3;
741
+ optional RequestedModel requested_model = 9;
742
+ McpTools mcp_tools = 4;
743
+ optional string conversation_id = 5;
744
+ optional McpFileSystemOptions mcp_file_system_options = 6;
745
+ // Deprecated, use the one in RequestContext message in request_context_exec.proto instead
746
+ optional SkillOptions skill_options = 7;
747
+ // Custom system prompt override. Allowlisted for specific teams only.
748
+ optional string custom_system_prompt = 8;
749
+ }
750
+
751
+ message TextDeltaUpdate {
752
+ string text = 1;
753
+ }
754
+
755
+ message ToolCallStartedUpdate {
756
+ string call_id = 1;
757
+ ToolCall tool_call = 2;
758
+ // groups tool calls that originate from the same model provider call
759
+ string model_call_id = 3;
760
+ }
761
+
762
+ message ToolCallCompletedUpdate {
763
+ string call_id = 1;
764
+ ToolCall tool_call = 2;
765
+ // groups tool calls that originate from the same model provider call
766
+ string model_call_id = 3;
767
+ }
768
+
769
+ message ToolCallDeltaUpdate {
770
+ string call_id = 1;
771
+ ToolCallDelta tool_call_delta = 2;
772
+ // groups tool calls that originate from the same model provider call
773
+ string model_call_id = 3;
774
+ }
775
+
776
+ // Streaming update for partial tool call arguments
777
+ message PartialToolCallUpdate {
778
+ string call_id = 1;
779
+ ToolCall tool_call = 2;
780
+ // Aggregated args text so far (as JSON text). May be incomplete until final tool call.
781
+ string args_text_delta = 3;
782
+ // groups tool calls that originate from the same model provider call
783
+ string model_call_id = 4;
784
+ }
785
+
786
+ message ThinkingDeltaUpdate {
787
+ string text = 1;
788
+ }
789
+
790
+ message ThinkingCompletedUpdate {
791
+ int32 thinking_duration_ms = 1;
792
+ }
793
+
794
+ message TokenDeltaUpdate {
795
+ int32 tokens = 1;
796
+ }
797
+
798
+ message SummaryUpdate {
799
+ string summary = 1;
800
+ }
801
+
802
+ message SummaryStartedUpdate {
803
+ }
804
+
805
+ message HeartbeatUpdate {
806
+ }
807
+
808
+ message SummaryCompletedUpdate {
809
+ }
810
+
811
+ message ShellOutputDeltaUpdate {
812
+ oneof event {
813
+ ShellStreamStdout stdout = 1;
814
+ ShellStreamStderr stderr = 2;
815
+ ShellStreamExit exit = 3;
816
+ ShellStreamStart start = 4;
817
+ }
818
+ }
819
+
820
+ message TurnEndedUpdate {
821
+ }
822
+
823
+ // Only: user message appended update
824
+ message UserMessageAppendedUpdate {
825
+ UserMessage user_message = 1;
826
+ }
827
+
828
+ message StepStartedUpdate {
829
+ uint64 step_id = 1;
830
+ }
831
+
832
+ message StepCompletedUpdate {
833
+ uint64 step_id = 1;
834
+ int64 step_duration_ms = 2;
835
+ }
836
+
837
+ message InteractionUpdate {
838
+ oneof message {
839
+ TextDeltaUpdate text_delta = 1;
840
+ PartialToolCallUpdate partial_tool_call = 7;
841
+ ToolCallDeltaUpdate tool_call_delta = 15;
842
+ ToolCallStartedUpdate tool_call_started = 2;
843
+ ToolCallCompletedUpdate tool_call_completed = 3;
844
+ ThinkingDeltaUpdate thinking_delta = 4;
845
+ ThinkingCompletedUpdate thinking_completed = 5;
846
+ UserMessageAppendedUpdate user_message_appended = 6;
847
+ TokenDeltaUpdate token_delta = 8;
848
+ SummaryUpdate summary = 9;
849
+ SummaryStartedUpdate summary_started = 10;
850
+ SummaryCompletedUpdate summary_completed = 11;
851
+ ShellOutputDeltaUpdate shell_output_delta = 12;
852
+ HeartbeatUpdate heartbeat = 13;
853
+ TurnEndedUpdate turn_ended = 14;
854
+ StepStartedUpdate step_started = 16;
855
+ StepCompletedUpdate step_completed = 17;
856
+ }
857
+ }
858
+
859
+ // Interaction query messages for bidirectional communication
860
+ message InteractionQuery {
861
+ uint32 id = 1;
862
+ oneof query {
863
+ WebSearchRequestQuery web_search_request_query = 2;
864
+ AskQuestionInteractionQuery ask_question_interaction_query = 3;
865
+ SwitchModeRequestQuery switch_mode_request_query = 4;
866
+ ExaSearchRequestQuery exa_search_request_query = 5;
867
+ ExaFetchRequestQuery exa_fetch_request_query = 6;
868
+ CreatePlanRequestQuery create_plan_request_query = 7;
869
+ SetupVmEnvironmentArgs setup_vm_environment_args = 8;
870
+ }
871
+ }
872
+
873
+ message InteractionResponse {
874
+ uint32 id = 1;
875
+ oneof result {
876
+ WebSearchRequestResponse web_search_request_response = 2;
877
+ AskQuestionInteractionResponse ask_question_interaction_response = 3;
878
+ SwitchModeRequestResponse switch_mode_request_response = 4;
879
+ ExaSearchRequestResponse exa_search_request_response = 5;
880
+ ExaFetchRequestResponse exa_fetch_request_response = 6;
881
+ CreatePlanRequestResponse create_plan_request_response = 7;
882
+ SetupVmEnvironmentResult setup_vm_environment_result = 8;
883
+ }
884
+ }
885
+
886
+ message AskQuestionInteractionQuery {
887
+ AskQuestionArgs args = 1;
888
+ string tool_call_id = 2;
889
+ }
890
+
891
+ message AskQuestionInteractionResponse {
892
+ AskQuestionResult result = 1;
893
+ }
894
+
895
+ message ClientHeartbeat {
896
+ }
897
+
898
+ // Prewarm request - sent before the actual action to prepare the backend Contains all config needed for auth, model routing, and session building The actual ConversationAction is sent separately after prewarming completes
899
+ message PrewarmRequest {
900
+ ModelDetails model_details = 1;
901
+ optional RequestedModel requested_model = 9;
902
+ optional string conversation_id = 2;
903
+ ConversationStateStructure conversation_state = 3;
904
+ McpTools mcp_tools = 4;
905
+ optional McpFileSystemOptions mcp_file_system_options = 5;
906
+ // Best-of-N context for usage billing (same fields as UserMessage)
907
+ optional string best_of_n_group_id = 6;
908
+ optional bool try_use_best_of_n_promotion = 7;
909
+ // Custom system prompt override. Allowlisted for specific teams only.
910
+ optional string custom_system_prompt = 8;
911
+ }
912
+
913
+ message ExecServerAbort {
914
+ uint32 id = 1;
915
+ }
916
+
917
+ message ExecServerControlMessage {
918
+ oneof message {
919
+ ExecServerAbort abort = 1;
920
+ }
921
+ }
922
+
923
+ message AgentClientMessage {
924
+ oneof message {
925
+ AgentRunRequest run_request = 1;
926
+ ExecClientMessage exec_client_message = 2;
927
+ ExecClientControlMessage exec_client_control_message = 5;
928
+ KvClientMessage kv_client_message = 3;
929
+ ConversationAction conversation_action = 4;
930
+ InteractionResponse interaction_response = 6;
931
+ ClientHeartbeat client_heartbeat = 7;
932
+ PrewarmRequest prewarm_request = 8;
933
+ }
934
+ }
935
+
936
+ message AgentServerMessage {
937
+ oneof message {
938
+ InteractionUpdate interaction_update = 1;
939
+ ExecServerMessage exec_server_message = 2;
940
+ ExecServerControlMessage exec_server_control_message = 5;
941
+ ConversationStateStructure conversation_checkpoint_update = 3;
942
+ KvServerMessage kv_server_message = 4;
943
+ InteractionQuery interaction_query = 7;
944
+ }
945
+ }
946
+
947
+ // New unary API for naming an agent from a user message
948
+ message NameAgentRequest {
949
+ string user_message = 1;
950
+ }
951
+
952
+ message NameAgentResponse {
953
+ string name = 1;
954
+ }
955
+
956
+ message GetUsableModelsRequest {
957
+ // Not used right now, but can use to populate info about custom models the user passes in that we don't send down by default
958
+ repeated string custom_model_ids = 1;
959
+ }
960
+
961
+ message GetUsableModelsResponse {
962
+ repeated ModelDetails models = 1;
963
+ }
964
+
965
+ message GetDefaultModelForCliRequest {
966
+ }
967
+
968
+ message GetDefaultModelForCliResponse {
969
+ ModelDetails model = 1;
970
+ }
971
+
972
+ // Internal endpoint: returns all allowed model intents for devs
973
+ message GetAllowedModelIntentsRequest {
974
+ }
975
+
976
+ message GetAllowedModelIntentsResponse {
977
+ repeated string model_intents = 1;
978
+ }
979
+
980
+ // IDE state persistence for clients (CLI / VSCode integration) Mirrors a subset of aiserver.v1.ConversationMessage.IdeEditorsState, but only contains the recently viewed files and avoids any deprecated fields.
981
+ message IdeEditorsStateFile {
982
+ string relative_path = 1;
983
+ string absolute_path = 2;
984
+ optional bool is_currently_focused = 3;
985
+ optional int32 current_line_number = 4;
986
+ optional string current_line_text = 5;
987
+ optional int32 line_count = 6;
988
+ }
989
+
990
+ message IdeEditorsStateLite {
991
+ repeated IdeEditorsStateFile recently_viewed_files = 1;
992
+ }
993
+
994
+ message ApplyAgentDiffToolCall {
995
+ ApplyAgentDiffArgs args = 1;
996
+ ApplyAgentDiffResult result = 2;
997
+ }
998
+
999
+ message ApplyAgentDiffArgs {
1000
+ string agent_id = 1;
1001
+ }
1002
+
1003
+ message ApplyAgentDiffResult {
1004
+ oneof result {
1005
+ ApplyAgentDiffSuccess success = 1;
1006
+ ApplyAgentDiffError error = 2;
1007
+ }
1008
+ }
1009
+
1010
+ message ApplyAgentDiffSuccess {
1011
+ repeated AppliedAgentChange applied_changes = 1;
1012
+ }
1013
+
1014
+ message AppliedAgentChange {
1015
+ string path = 1;
1016
+ int32 change_type = 2;
1017
+ optional string before_content = 3;
1018
+ optional string after_content = 4;
1019
+ optional string error = 5;
1020
+ // Detailed result message from the execution (e.g., "Successfully deleted file: path (123 bytes)")
1021
+ optional string message_for_model = 6;
1022
+ }
1023
+
1024
+ message ApplyAgentDiffError {
1025
+ string error = 1;
1026
+ repeated AppliedAgentChange applied_changes = 2;
1027
+ }
1028
+
1029
+ message AskQuestionToolCall {
1030
+ AskQuestionArgs args = 1;
1031
+ AskQuestionResult result = 2;
1032
+ }
1033
+
1034
+ message AskQuestionArgs {
1035
+ // optional form title
1036
+ string title = 1;
1037
+ // 1+ questions
1038
+ repeated AskQuestionArgs_Question questions = 2;
1039
+ // if true, return immediately with async marker instead of blocking
1040
+ bool run_async = 5;
1041
+ // if set, indicates this is a synthetic completion for the original async tool call with this ID
1042
+ string async_original_tool_call_id = 6;
1043
+ }
1044
+
1045
+ message AskQuestionArgs_Question {
1046
+ // unique, model-provided
1047
+ string id = 1;
1048
+ // the question text
1049
+ string prompt = 2;
1050
+ // choices
1051
+ repeated AskQuestionArgs_Option options = 3;
1052
+ // multi-select vs single-select
1053
+ bool allow_multiple = 4;
1054
+ }
1055
+
1056
+ message AskQuestionArgs_Option {
1057
+ // stable option id
1058
+ string id = 1;
1059
+ // display text
1060
+ string label = 2;
1061
+ }
1062
+
1063
+ // Marker indicating that questions have been sent asynchronously Answers will arrive later as a separate ask_question tool call
1064
+ message AskQuestionAsync {
1065
+ }
1066
+
1067
+ message AskQuestionResult {
1068
+ oneof result {
1069
+ AskQuestionSuccess success = 1;
1070
+ AskQuestionError error = 2;
1071
+ AskQuestionRejected rejected = 3;
1072
+ AskQuestionAsync async = 4;
1073
+ }
1074
+ }
1075
+
1076
+ message AskQuestionSuccess {
1077
+ repeated AskQuestionSuccess_Answer answers = 1;
1078
+ }
1079
+
1080
+ message AskQuestionSuccess_Answer {
1081
+ string question_id = 1;
1082
+ // empty if unanswered
1083
+ repeated string selected_option_ids = 2;
1084
+ }
1085
+
1086
+ message AskQuestionError {
1087
+ string error_message = 1;
1088
+ }
1089
+
1090
+ message AskQuestionRejected {
1091
+ string reason = 1;
1092
+ }
1093
+
1094
+ message BackgroundShellSpawnArgs {
1095
+ string command = 1;
1096
+ string working_directory = 2;
1097
+ string tool_call_id = 3;
1098
+ ShellCommandParsingResult parsing_result = 4;
1099
+ optional SandboxPolicy sandbox_policy = 5;
1100
+ bool enable_write_shell_stdin_tool = 6;
1101
+ }
1102
+
1103
+ // Result of spawning a background shell
1104
+ message BackgroundShellSpawnResult {
1105
+ oneof result {
1106
+ BackgroundShellSpawnSuccess success = 1;
1107
+ BackgroundShellSpawnError error = 2;
1108
+ ShellRejected rejected = 3;
1109
+ ShellPermissionDenied permission_denied = 4;
1110
+ }
1111
+ }
1112
+
1113
+ message BackgroundShellSpawnSuccess {
1114
+ uint32 shell_id = 1;
1115
+ string command = 2;
1116
+ string working_directory = 3;
1117
+ // Process ID of the spawned shell
1118
+ optional uint32 pid = 4;
1119
+ }
1120
+
1121
+ message BackgroundShellSpawnError {
1122
+ string command = 1;
1123
+ string working_directory = 2;
1124
+ string error = 3;
1125
+ }
1126
+
1127
+ message WriteShellStdinArgs {
1128
+ uint32 shell_id = 1;
1129
+ string chars = 2;
1130
+ }
1131
+
1132
+ message WriteShellStdinResult {
1133
+ oneof result {
1134
+ WriteShellStdinSuccess success = 1;
1135
+ WriteShellStdinError error = 2;
1136
+ }
1137
+ }
1138
+
1139
+ message WriteShellStdinSuccess {
1140
+ uint32 shell_id = 1;
1141
+ uint32 terminal_file_length_before_input_written = 2;
1142
+ }
1143
+
1144
+ message WriteShellStdinError {
1145
+ string error = 1;
1146
+ }
1147
+
1148
+ message Coordinate {
1149
+ int32 x = 1;
1150
+ int32 y = 2;
1151
+ }
1152
+
1153
+ // Arguments for the computer-use tool
1154
+ message ComputerUseArgs {
1155
+ string tool_call_id = 1;
1156
+ repeated ComputerUseAction actions = 2;
1157
+ }
1158
+
1159
+ // A single computer-use action. This is our internal canonical representation. Provider-specific formats are converted to this by adapters.
1160
+ message ComputerUseAction {
1161
+ oneof action {
1162
+ MouseMoveAction mouse_move = 1;
1163
+ ClickAction click = 2;
1164
+ MouseDownAction mouse_down = 3;
1165
+ MouseUpAction mouse_up = 4;
1166
+ DragAction drag = 5;
1167
+ ScrollAction scroll = 6;
1168
+ TypeAction type = 7;
1169
+ KeyAction key = 8;
1170
+ WaitAction wait = 9;
1171
+ ScreenshotAction screenshot = 10;
1172
+ CursorPositionAction cursor_position = 11;
1173
+ }
1174
+ }
1175
+
1176
+ // Move mouse to coordinate (required)
1177
+ message MouseMoveAction {
1178
+ Coordinate coordinate = 1;
1179
+ }
1180
+
1181
+ // Unified click action - coordinate: optional, clicks at current cursor if omitted - button: which mouse button (default: LEFT) - count: click count (1=single, 2=double, 3=triple, default: 1) - modifier_keys: optional, held during click (e.g., "ctrl", "shift", "ctrl+shift")
1182
+ message ClickAction {
1183
+ optional Coordinate coordinate = 1;
1184
+ int32 button = 2;
1185
+ int32 count = 3;
1186
+ optional string modifier_keys = 4;
1187
+ }
1188
+
1189
+ // Press mouse button down (for fine-grained drag control)
1190
+ message MouseDownAction {
1191
+ int32 button = 1;
1192
+ }
1193
+
1194
+ // Release mouse button (for fine-grained drag control)
1195
+ message MouseUpAction {
1196
+ int32 button = 1;
1197
+ }
1198
+
1199
+ // Drag action - path of coordinates (at least 2 points: [start, ..., end])
1200
+ message DragAction {
1201
+ repeated Coordinate path = 1;
1202
+ int32 button = 2;
1203
+ }
1204
+
1205
+ // Scroll action - coordinate: optional, scrolls at current cursor if omitted - direction: scroll direction (required) - amount: number of scroll "clicks" (default: 3) - modifier_keys: optional, held during scroll (e.g., "ctrl" for zoom)
1206
+ message ScrollAction {
1207
+ optional Coordinate coordinate = 1;
1208
+ int32 direction = 2;
1209
+ int32 amount = 3;
1210
+ optional string modifier_keys = 4;
1211
+ }
1212
+
1213
+ // Type text
1214
+ message TypeAction {
1215
+ string text = 1;
1216
+ }
1217
+
1218
+ // Press key or key combination (xdotool-style: "ctrl+a", "Return", "Alt+Left") If hold_duration_ms is set, holds the key for that duration
1219
+ message KeyAction {
1220
+ string key = 1;
1221
+ optional int32 hold_duration_ms = 2;
1222
+ }
1223
+
1224
+ // Wait for a duration
1225
+ message WaitAction {
1226
+ int32 duration_ms = 1;
1227
+ }
1228
+
1229
+ // Take a screenshot
1230
+ message ScreenshotAction {
1231
+ }
1232
+
1233
+ // Get current cursor position
1234
+ message CursorPositionAction {
1235
+ }
1236
+
1237
+ // Result of computer-use execution
1238
+ message ComputerUseResult {
1239
+ oneof result {
1240
+ ComputerUseSuccess success = 1;
1241
+ ComputerUseError error = 2;
1242
+ }
1243
+ }
1244
+
1245
+ message ComputerUseSuccess {
1246
+ int32 action_count = 1;
1247
+ int32 duration_ms = 2;
1248
+ // Base64 WebP at API resolution
1249
+ optional string screenshot = 3;
1250
+ optional string log = 4;
1251
+ optional string screenshot_path = 5;
1252
+ // In API resolution
1253
+ optional Coordinate cursor_position = 6;
1254
+ }
1255
+
1256
+ message ComputerUseError {
1257
+ string error = 1;
1258
+ int32 action_count = 2;
1259
+ int32 duration_ms = 3;
1260
+ optional string log = 4;
1261
+ // Base64 WebP of screen state at error time
1262
+ optional string screenshot = 5;
1263
+ // Path where screenshot was saved
1264
+ optional string screenshot_path = 6;
1265
+ }
1266
+
1267
+ message ComputerUseToolCall {
1268
+ ComputerUseArgs args = 1;
1269
+ ComputerUseResult result = 2;
1270
+ }
1271
+
1272
+ message CreatePlanToolCall {
1273
+ CreatePlanArgs args = 1;
1274
+ CreatePlanResult result = 2;
1275
+ }
1276
+
1277
+ // A phase groups related todos together for project-mode plans
1278
+ message Phase {
1279
+ string name = 1;
1280
+ repeated TodoItem todos = 2;
1281
+ }
1282
+
1283
+ message CreatePlanArgs {
1284
+ string plan = 1;
1285
+ repeated TodoItem todos = 2;
1286
+ string overview = 3;
1287
+ string name = 4;
1288
+ // When true, uses phases instead of flat todos (mutually exclusive)
1289
+ bool is_project = 5;
1290
+ // Implementation phases (only valid when is_project=true)
1291
+ repeated Phase phases = 6;
1292
+ }
1293
+
1294
+ message CreatePlanResult {
1295
+ // URI of the plan file (returned when file_based_plan_edits is enabled)
1296
+ string plan_uri = 3;
1297
+ oneof result {
1298
+ CreatePlanSuccess success = 1;
1299
+ CreatePlanError error = 2;
1300
+ }
1301
+ }
1302
+
1303
+ message CreatePlanSuccess {
1304
+ }
1305
+
1306
+ message CreatePlanError {
1307
+ string error = 1;
1308
+ }
1309
+
1310
+ // Query sent from server to client to create a plan file
1311
+ message CreatePlanRequestQuery {
1312
+ CreatePlanArgs args = 1;
1313
+ string tool_call_id = 2;
1314
+ }
1315
+
1316
+ // Response from client with the created plan URI
1317
+ message CreatePlanRequestResponse {
1318
+ CreatePlanResult result = 1;
1319
+ }
1320
+
1321
+ message CursorRuleTypeGlobal {
1322
+ }
1323
+
1324
+ message CursorRuleTypeFileGlobs {
1325
+ repeated string globs = 1;
1326
+ }
1327
+
1328
+ message CursorRuleTypeAgentFetched {
1329
+ string description = 1;
1330
+ }
1331
+
1332
+ message CursorRuleTypeManuallyAttached {
1333
+ }
1334
+
1335
+ message CursorRuleType {
1336
+ oneof type {
1337
+ CursorRuleTypeGlobal global = 1;
1338
+ CursorRuleTypeFileGlobs file_globbed = 2;
1339
+ CursorRuleTypeAgentFetched agent_fetched = 3;
1340
+ CursorRuleTypeManuallyAttached manually_attached = 4;
1341
+ }
1342
+ }
1343
+
1344
+ message CursorRule {
1345
+ // absolute path to the .mdc file
1346
+ string full_path = 1;
1347
+ // rule body, trimmed to reasonable size if needed by client
1348
+ string content = 2;
1349
+ // classification of rule
1350
+ CursorRuleType type = 3;
1351
+ // source of the rule
1352
+ int32 source = 4;
1353
+ // Git remote origin URL for the repository containing this rule, if available. Normalized to host/path format (e.g., "github.com/owner/repo").
1354
+ optional string git_remote_origin = 5;
1355
+ optional string parse_error = 6;
1356
+ }
1357
+
1358
+ message DeleteArgs {
1359
+ string path = 1;
1360
+ string tool_call_id = 2;
1361
+ }
1362
+
1363
+ message DeleteResult {
1364
+ oneof result {
1365
+ DeleteSuccess success = 1;
1366
+ DeleteFileNotFound file_not_found = 2;
1367
+ DeleteNotFile not_file = 3;
1368
+ DeletePermissionDenied permission_denied = 4;
1369
+ DeleteFileBusy file_busy = 5;
1370
+ DeleteRejected rejected = 6;
1371
+ DeleteError error = 7;
1372
+ }
1373
+ }
1374
+
1375
+ message DeleteSuccess {
1376
+ string path = 1;
1377
+ string deleted_file = 2;
1378
+ int64 file_size = 3;
1379
+ string prev_content = 4;
1380
+ }
1381
+
1382
+ message DeleteFileNotFound {
1383
+ string path = 1;
1384
+ }
1385
+
1386
+ message DeleteNotFile {
1387
+ string path = 1;
1388
+ // "directory" or "other"
1389
+ string actual_type = 2;
1390
+ }
1391
+
1392
+ message DeletePermissionDenied {
1393
+ string path = 1;
1394
+ string client_visible_error = 2;
1395
+ bool is_readonly = 3;
1396
+ }
1397
+
1398
+ message DeleteFileBusy {
1399
+ string path = 1;
1400
+ }
1401
+
1402
+ message DeleteRejected {
1403
+ string path = 1;
1404
+ string reason = 2;
1405
+ }
1406
+
1407
+ message DeleteError {
1408
+ string path = 1;
1409
+ string error = 2;
1410
+ }
1411
+
1412
+ message DeleteToolCall {
1413
+ DeleteArgs args = 1;
1414
+ DeleteResult result = 2;
1415
+ }
1416
+
1417
+ message DiagnosticsArgs {
1418
+ string path = 1;
1419
+ string tool_call_id = 2;
1420
+ }
1421
+
1422
+ message DiagnosticsResult {
1423
+ oneof result {
1424
+ DiagnosticsSuccess success = 1;
1425
+ DiagnosticsError error = 2;
1426
+ DiagnosticsRejected rejected = 3;
1427
+ DiagnosticsFileNotFound file_not_found = 4;
1428
+ DiagnosticsPermissionDenied permission_denied = 5;
1429
+ }
1430
+ }
1431
+
1432
+ message DiagnosticsSuccess {
1433
+ string path = 1;
1434
+ repeated Diagnostic diagnostics = 2;
1435
+ int32 total_diagnostics = 3;
1436
+ }
1437
+
1438
+ message Diagnostic {
1439
+ int32 severity = 1;
1440
+ Range range = 2;
1441
+ string message = 3;
1442
+ string source = 4;
1443
+ string code = 5;
1444
+ bool is_stale = 6;
1445
+ }
1446
+
1447
+ message DiagnosticsError {
1448
+ string path = 1;
1449
+ string error = 2;
1450
+ }
1451
+
1452
+ message DiagnosticsRejected {
1453
+ string path = 1;
1454
+ string reason = 2;
1455
+ }
1456
+
1457
+ message DiagnosticsFileNotFound {
1458
+ string path = 1;
1459
+ }
1460
+
1461
+ message DiagnosticsPermissionDenied {
1462
+ string path = 1;
1463
+ }
1464
+
1465
+ message EditArgs {
1466
+ string path = 1;
1467
+ optional string stream_content = 6;
1468
+ }
1469
+
1470
+ message EditResult {
1471
+ oneof result {
1472
+ EditSuccess success = 1;
1473
+ EditFileNotFound file_not_found = 2;
1474
+ EditReadPermissionDenied read_permission_denied = 3;
1475
+ EditWritePermissionDenied write_permission_denied = 4;
1476
+ EditRejected rejected = 6;
1477
+ EditError error = 7;
1478
+ }
1479
+ }
1480
+
1481
+ message EditSuccess {
1482
+ string path = 1;
1483
+ optional int32 lines_added = 3;
1484
+ optional int32 lines_removed = 4;
1485
+ // Concatenated chunk diff strings separated by "\n...\n"
1486
+ optional string diff_string = 5;
1487
+ // undefined if file didn't exist before the edit
1488
+ optional string before_full_file_content = 6;
1489
+ string after_full_file_content = 7;
1490
+ // Formatted message for display to model (resultForModel from EditTransformResult)
1491
+ optional string message = 8;
1492
+ }
1493
+
1494
+ message EditFileNotFound {
1495
+ string path = 1;
1496
+ }
1497
+
1498
+ message EditReadPermissionDenied {
1499
+ string path = 1;
1500
+ }
1501
+
1502
+ message EditWritePermissionDenied {
1503
+ string path = 1;
1504
+ string error = 2;
1505
+ bool is_readonly = 3;
1506
+ }
1507
+
1508
+ message EditRejected {
1509
+ string path = 1;
1510
+ string reason = 2;
1511
+ }
1512
+
1513
+ message EditError {
1514
+ string path = 1;
1515
+ string error = 2;
1516
+ optional string model_visible_error = 5;
1517
+ }
1518
+
1519
+ message EditToolCall {
1520
+ EditArgs args = 1;
1521
+ EditResult result = 2;
1522
+ }
1523
+
1524
+ message EditToolCallDelta {
1525
+ string stream_content_delta = 1;
1526
+ }
1527
+
1528
+ message ExaFetchArgs {
1529
+ repeated string ids = 1;
1530
+ string tool_call_id = 2;
1531
+ }
1532
+
1533
+ message ExaFetchResult {
1534
+ oneof result {
1535
+ ExaFetchSuccess success = 1;
1536
+ ExaFetchError error = 2;
1537
+ ExaFetchRejected rejected = 3;
1538
+ }
1539
+ }
1540
+
1541
+ message ExaFetchSuccess {
1542
+ repeated ExaFetchContent contents = 1;
1543
+ }
1544
+
1545
+ message ExaFetchError {
1546
+ string error = 1;
1547
+ }
1548
+
1549
+ message ExaFetchRejected {
1550
+ string reason = 1;
1551
+ }
1552
+
1553
+ message ExaFetchContent {
1554
+ string title = 1;
1555
+ string url = 2;
1556
+ string text = 3;
1557
+ string published_date = 4;
1558
+ }
1559
+
1560
+ message ExaFetchToolCall {
1561
+ ExaFetchArgs args = 1;
1562
+ ExaFetchResult result = 2;
1563
+ }
1564
+
1565
+ message ExaFetchRequestQuery {
1566
+ ExaFetchArgs args = 1;
1567
+ }
1568
+
1569
+ message ExaFetchRequestResponse {
1570
+ oneof result {
1571
+ ExaFetchRequestResponse_Approved approved = 1;
1572
+ ExaFetchRequestResponse_Rejected rejected = 2;
1573
+ }
1574
+ }
1575
+
1576
+ message ExaFetchRequestResponse_Approved {
1577
+ }
1578
+
1579
+ message ExaFetchRequestResponse_Rejected {
1580
+ string reason = 1;
1581
+ }
1582
+
1583
+ message ExaSearchArgs {
1584
+ string query = 1;
1585
+ // "auto", "neural", or "keyword"
1586
+ string type = 2;
1587
+ int32 num_results = 3;
1588
+ string tool_call_id = 4;
1589
+ }
1590
+
1591
+ message ExaSearchResult {
1592
+ oneof result {
1593
+ ExaSearchSuccess success = 1;
1594
+ ExaSearchError error = 2;
1595
+ ExaSearchRejected rejected = 3;
1596
+ }
1597
+ }
1598
+
1599
+ message ExaSearchSuccess {
1600
+ repeated ExaSearchReference references = 1;
1601
+ }
1602
+
1603
+ message ExaSearchError {
1604
+ string error = 1;
1605
+ }
1606
+
1607
+ message ExaSearchRejected {
1608
+ string reason = 1;
1609
+ }
1610
+
1611
+ message ExaSearchReference {
1612
+ string title = 1;
1613
+ string url = 2;
1614
+ string text = 3;
1615
+ string published_date = 4;
1616
+ }
1617
+
1618
+ message ExaSearchToolCall {
1619
+ ExaSearchArgs args = 1;
1620
+ ExaSearchResult result = 2;
1621
+ }
1622
+
1623
+ message ExaSearchRequestQuery {
1624
+ ExaSearchArgs args = 1;
1625
+ }
1626
+
1627
+ message ExaSearchRequestResponse {
1628
+ oneof result {
1629
+ ExaSearchRequestResponse_Approved approved = 1;
1630
+ ExaSearchRequestResponse_Rejected rejected = 2;
1631
+ }
1632
+ }
1633
+
1634
+ message ExaSearchRequestResponse_Approved {
1635
+ }
1636
+
1637
+ message ExaSearchRequestResponse_Rejected {
1638
+ string reason = 1;
1639
+ }
1640
+
1641
+ message ExecClientStreamClose {
1642
+ uint32 id = 1;
1643
+ }
1644
+
1645
+ message ExecClientThrow {
1646
+ uint32 id = 1;
1647
+ string error = 2;
1648
+ optional string stack_trace = 3;
1649
+ }
1650
+
1651
+ message ExecClientHeartbeat {
1652
+ uint32 id = 1;
1653
+ }
1654
+
1655
+ message ExecClientControlMessage {
1656
+ oneof message {
1657
+ ExecClientStreamClose stream_close = 1;
1658
+ ExecClientThrow throw = 2;
1659
+ ExecClientHeartbeat heartbeat = 3;
1660
+ }
1661
+ }
1662
+
1663
+ // Simplified span context for tracing exec calls
1664
+ message SpanContext {
1665
+ // Trace identifier (128-bit as hex string, same for all spans in a trace)
1666
+ string trace_id = 1;
1667
+ // Unique span identifier (64-bit as hex string)
1668
+ string span_id = 2;
1669
+ // Trace flags bit field following OTEL SPAN_FLAGS_* semantics
1670
+ optional uint32 trace_flags = 3;
1671
+ // W3C trace-state header string (optional)
1672
+ optional string trace_state = 4;
1673
+ }
1674
+
1675
+ // Empty abort message for aborting running execs
1676
+ message AbortArgs {
1677
+ }
1678
+
1679
+ message AbortResult {
1680
+ }
1681
+
1682
+ message ExecServerMessage {
1683
+ uint32 id = 1;
1684
+ // Optional exec ID for attachable executions
1685
+ string exec_id = 15;
1686
+ // Optional parent span context for tracing
1687
+ optional SpanContext span_context = 19;
1688
+ oneof message {
1689
+ ShellArgs shell_args = 2;
1690
+ WriteArgs write_args = 3;
1691
+ DeleteArgs delete_args = 4;
1692
+ GrepArgs grep_args = 5;
1693
+ ReadArgs read_args = 7;
1694
+ LsArgs ls_args = 8;
1695
+ DiagnosticsArgs diagnostics_args = 9;
1696
+ RequestContextArgs request_context_args = 10;
1697
+ McpArgs mcp_args = 11;
1698
+ ShellArgs shell_stream_args = 14;
1699
+ BackgroundShellSpawnArgs background_shell_spawn_args = 16;
1700
+ ListMcpResourcesExecArgs list_mcp_resources_exec_args = 17;
1701
+ ReadMcpResourceExecArgs read_mcp_resource_exec_args = 18;
1702
+ FetchArgs fetch_args = 20;
1703
+ RecordScreenArgs record_screen_args = 21;
1704
+ ComputerUseArgs computer_use_args = 22;
1705
+ WriteShellStdinArgs write_shell_stdin_args = 23;
1706
+ }
1707
+ }
1708
+
1709
+ message ExecClientMessage {
1710
+ uint32 id = 1;
1711
+ // Optional exec ID for attachable executions
1712
+ string exec_id = 15;
1713
+ oneof message {
1714
+ ShellResult shell_result = 2;
1715
+ WriteResult write_result = 3;
1716
+ DeleteResult delete_result = 4;
1717
+ GrepResult grep_result = 5;
1718
+ ReadResult read_result = 7;
1719
+ LsResult ls_result = 8;
1720
+ DiagnosticsResult diagnostics_result = 9;
1721
+ RequestContextResult request_context_result = 10;
1722
+ McpResult mcp_result = 11;
1723
+ ShellStream shell_stream = 14;
1724
+ BackgroundShellSpawnResult background_shell_spawn_result = 16;
1725
+ ListMcpResourcesExecResult list_mcp_resources_exec_result = 17;
1726
+ ReadMcpResourceExecResult read_mcp_resource_exec_result = 18;
1727
+ FetchResult fetch_result = 20;
1728
+ RecordScreenResult record_screen_result = 21;
1729
+ ComputerUseResult computer_use_result = 22;
1730
+ WriteShellStdinResult write_shell_stdin_result = 23;
1731
+ }
1732
+ }
1733
+
1734
+ message FetchArgs {
1735
+ string url = 1;
1736
+ string tool_call_id = 2;
1737
+ }
1738
+
1739
+ message FetchResult {
1740
+ oneof result {
1741
+ FetchSuccess success = 1;
1742
+ FetchError error = 2;
1743
+ }
1744
+ }
1745
+
1746
+ message FetchSuccess {
1747
+ string url = 1;
1748
+ string content = 2;
1749
+ int32 status_code = 3;
1750
+ string content_type = 4;
1751
+ }
1752
+
1753
+ message FetchError {
1754
+ string url = 1;
1755
+ string error = 2;
1756
+ }
1757
+
1758
+ message GenerateImageArgs {
1759
+ string description = 1;
1760
+ optional string file_path = 2;
1761
+ // Optional paths to reference images to use as input for image-to-image generation
1762
+ repeated string reference_image_paths = 5;
1763
+ }
1764
+
1765
+ message GenerateImageResult {
1766
+ oneof result {
1767
+ GenerateImageSuccess success = 1;
1768
+ GenerateImageError error = 2;
1769
+ }
1770
+ }
1771
+
1772
+ message GenerateImageSuccess {
1773
+ // Actual file path where the image was saved (e.g., /path/to/project/assets/image.png)
1774
+ string file_path = 1;
1775
+ // Base64-encoded image data
1776
+ string image_data = 2;
1777
+ }
1778
+
1779
+ message GenerateImageError {
1780
+ string error = 1;
1781
+ }
1782
+
1783
+ message GenerateImageToolCall {
1784
+ GenerateImageArgs args = 1;
1785
+ GenerateImageResult result = 2;
1786
+ }
1787
+
1788
+ message GrepArgs {
1789
+ string pattern = 1;
1790
+ optional string path = 2;
1791
+ optional string glob = 3;
1792
+ // "content", "files_with_matches", "count"
1793
+ optional string output_mode = 4;
1794
+ optional int32 context_before = 5;
1795
+ optional int32 context_after = 6;
1796
+ optional int32 context = 7;
1797
+ optional bool case_insensitive = 8;
1798
+ // --type
1799
+ optional string type = 9;
1800
+ // | head -N
1801
+ optional int32 head_limit = 10;
1802
+ // -U --multiline-dotall
1803
+ optional bool multiline = 11;
1804
+ // --sort: "none", "path", "modified", "accessed", "created"
1805
+ optional string sort = 12;
1806
+ // if false, use --sortr for reverse sort
1807
+ optional bool sort_ascending = 13;
1808
+ string tool_call_id = 14;
1809
+ optional SandboxPolicy sandbox_policy = 15;
1810
+ }
1811
+
1812
+ message GrepResult {
1813
+ oneof result {
1814
+ GrepSuccess success = 1;
1815
+ GrepError error = 2;
1816
+ }
1817
+ }
1818
+
1819
+ message GrepError {
1820
+ string error = 1;
1821
+ }
1822
+
1823
+ message GrepSuccess {
1824
+ string pattern = 1;
1825
+ string path = 2;
1826
+ // "content", "files_with_matches", or "count"
1827
+ string output_mode = 3;
1828
+ map<string, GrepUnionResult> workspace_results = 4;
1829
+ optional GrepUnionResult active_editor_result = 5;
1830
+ }
1831
+
1832
+ message GrepUnionResult {
1833
+ oneof result {
1834
+ GrepCountResult count = 1;
1835
+ GrepFilesResult files = 2;
1836
+ GrepContentResult content = 3;
1837
+ }
1838
+ }
1839
+
1840
+ message GrepCountResult {
1841
+ // ordered by relevance
1842
+ repeated GrepFileCount counts = 1;
1843
+ // The total count of files that the client found from the ripgrep call This is a lower bound if we truncated the output from the ripgrep call itself, but is accurate if client_truncated is true (but may be more than the number of files returned to the server)
1844
+ int32 total_files = 2;
1845
+ // The total count of matches that the client found from the ripgrep call This is a lower bound if we truncated the output from the ripgrep call itself, but is accurate if client_truncated is true (but may be more than the number of matches returned to the server)
1846
+ int32 total_matches = 3;
1847
+ // true if the client truncated the output sent to the server
1848
+ bool client_truncated = 4;
1849
+ // true if we truncated the output from the ripgrep call itself
1850
+ bool ripgrep_truncated = 5;
1851
+ }
1852
+
1853
+ message GrepFileCount {
1854
+ string file = 1;
1855
+ int32 count = 2;
1856
+ }
1857
+
1858
+ message GrepFilesResult {
1859
+ // ordered by relevance
1860
+ repeated string files = 1;
1861
+ // The total count of files that the client found from the ripgrep call This is a lower bound if we truncated the output from the ripgrep call itself, but is accurate if client_truncated is true (but may be more than the number of files returned to the server)
1862
+ int32 total_files = 2;
1863
+ // true if the client truncated the output sent to the server
1864
+ bool client_truncated = 3;
1865
+ // true if we truncated the output from the ripgrep call itself
1866
+ bool ripgrep_truncated = 4;
1867
+ }
1868
+
1869
+ message GrepContentResult {
1870
+ // ordered by relevance
1871
+ repeated GrepFileMatch matches = 1;
1872
+ // The total count of lines that the client found from the ripgrep call This is a lower bound if we truncated the output from the ripgrep call itself, but is accurate if client_truncated is true (but may be more than the number of lines returned to the server)
1873
+ int32 total_lines = 2;
1874
+ // The total count of matches that the client found from the ripgrep call This is a lower bound if we truncated the output from the ripgrep call itself, but is accurate if client_truncated is true (but may be more than the number of matches returned to the server)
1875
+ int32 total_matched_lines = 3;
1876
+ // true if the client truncated the output sent to the server
1877
+ bool client_truncated = 4;
1878
+ // true if we truncated the output from the ripgrep call itself
1879
+ bool ripgrep_truncated = 5;
1880
+ }
1881
+
1882
+ message GrepFileMatch {
1883
+ string file = 1;
1884
+ repeated GrepContentMatch matches = 2;
1885
+ }
1886
+
1887
+ message GrepContentMatch {
1888
+ int32 line_number = 1;
1889
+ string content = 2;
1890
+ bool content_truncated = 3;
1891
+ // true for context lines (-A/B/C)
1892
+ bool is_context_line = 4;
1893
+ }
1894
+
1895
+ message GrepStream {
1896
+ string pattern = 1;
1897
+ }
1898
+
1899
+ message GrepToolCall {
1900
+ GrepArgs args = 1;
1901
+ GrepResult result = 2;
1902
+ }
1903
+
1904
+ message GetBlobArgs {
1905
+ bytes blob_id = 1;
1906
+ }
1907
+
1908
+ message GetBlobResult {
1909
+ optional bytes blob_data = 1;
1910
+ }
1911
+
1912
+ message SetBlobArgs {
1913
+ bytes blob_id = 1;
1914
+ bytes blob_data = 2;
1915
+ }
1916
+
1917
+ message SetBlobResult {
1918
+ optional Error error = 1;
1919
+ }
1920
+
1921
+ message KvServerMessage {
1922
+ uint32 id = 1;
1923
+ // Span context for distributed tracing
1924
+ optional SpanContext span_context = 4;
1925
+ oneof message {
1926
+ GetBlobArgs get_blob_args = 2;
1927
+ SetBlobArgs set_blob_args = 3;
1928
+ }
1929
+ }
1930
+
1931
+ message KvClientMessage {
1932
+ uint32 id = 1;
1933
+ oneof message {
1934
+ GetBlobResult get_blob_result = 2;
1935
+ SetBlobResult set_blob_result = 3;
1936
+ }
1937
+ }
1938
+
1939
+ message LsArgs {
1940
+ string path = 1;
1941
+ repeated string ignore = 2;
1942
+ string tool_call_id = 3;
1943
+ optional SandboxPolicy sandbox_policy = 4;
1944
+ // defaults to 5000ms
1945
+ optional uint32 timeout_ms = 5;
1946
+ }
1947
+
1948
+ message LsResult {
1949
+ oneof result {
1950
+ LsSuccess success = 1;
1951
+ LsError error = 2;
1952
+ LsRejected rejected = 3;
1953
+ LsTimeout timeout = 4;
1954
+ }
1955
+ }
1956
+
1957
+ message LsSuccess {
1958
+ LsDirectoryTreeNode directory_tree_root = 1;
1959
+ }
1960
+
1961
+ message LsDirectoryTreeNode {
1962
+ string abs_path = 1;
1963
+ repeated LsDirectoryTreeNode children_dirs = 2;
1964
+ repeated LsDirectoryTreeNode_File children_files = 3;
1965
+ // Proto doesn't allow repeated fields to be optional, so in case of empty children arrays, this fields indicates if it happens: `true` - because directory really doesn't have any children `false` - because we stopped traversal before getting to its children
1966
+ bool children_were_processed = 4;
1967
+ // Count of extensions in the full sub-tree
1968
+ map<string, int32> full_subtree_extension_counts = 5;
1969
+ int32 num_files = 6;
1970
+ }
1971
+
1972
+ message LsDirectoryTreeNode_File {
1973
+ string name = 1;
1974
+ optional TerminalMetadata terminal_metadata = 2;
1975
+ }
1976
+
1977
+ message LsError {
1978
+ string path = 1;
1979
+ string error = 2;
1980
+ }
1981
+
1982
+ message LsRejected {
1983
+ string path = 1;
1984
+ string reason = 2;
1985
+ }
1986
+
1987
+ // Returned when ls operation timed out. Contains partial results gathered before timeout.
1988
+ message LsTimeout {
1989
+ LsDirectoryTreeNode directory_tree_root = 1;
1990
+ }
1991
+
1992
+ message TerminalMetadata {
1993
+ optional string cwd = 1;
1994
+ repeated TerminalMetadata_Command last_commands = 2;
1995
+ optional int64 last_modified_ms = 3;
1996
+ optional TerminalMetadata_Command current_command = 4;
1997
+ }
1998
+
1999
+ message TerminalMetadata_Command {
2000
+ string command = 1;
2001
+ optional int32 exit_code = 2;
2002
+ optional int64 timestamp_ms = 3;
2003
+ optional int64 duration_ms = 4;
2004
+ }
2005
+
2006
+ message LsToolCall {
2007
+ LsArgs args = 1;
2008
+ LsResult result = 2;
2009
+ }
2010
+
2011
+ message McpArgs {
2012
+ string name = 1;
2013
+ map<string, bytes> args = 2;
2014
+ string tool_call_id = 3;
2015
+ string provider_identifier = 4;
2016
+ string tool_name = 5;
2017
+ }
2018
+
2019
+ message McpResult {
2020
+ oneof result {
2021
+ McpSuccess success = 1;
2022
+ McpError error = 2;
2023
+ McpRejected rejected = 3;
2024
+ McpPermissionDenied permission_denied = 4;
2025
+ McpToolNotFound tool_not_found = 5;
2026
+ }
2027
+ }
2028
+
2029
+ message McpToolNotFound {
2030
+ string name = 1;
2031
+ repeated string available_tools = 2;
2032
+ }
2033
+
2034
+ // Text content item
2035
+ message McpTextContent {
2036
+ string text = 1;
2037
+ // Optional file location for large outputs
2038
+ optional OutputLocation output_location = 2;
2039
+ }
2040
+
2041
+ // Image content item
2042
+ message McpImageContent {
2043
+ // Raw bytes of the image. In JSON, this will be base64-encoded.
2044
+ bytes data = 1;
2045
+ // Optional MIME type, e.g. "image/png"
2046
+ string mime_type = 2;
2047
+ }
2048
+
2049
+ // A single tool result content item: either text or image
2050
+ message McpToolResultContentItem {
2051
+ oneof content {
2052
+ McpTextContent text = 1;
2053
+ McpImageContent image = 2;
2054
+ }
2055
+ }
2056
+
2057
+ // Equivalent to the requested McpToolResult TypeScript type
2058
+ message McpSuccess {
2059
+ repeated McpToolResultContentItem content = 1;
2060
+ bool is_error = 2;
2061
+ }
2062
+
2063
+ message McpError {
2064
+ string error = 1;
2065
+ }
2066
+
2067
+ message McpRejected {
2068
+ string reason = 1;
2069
+ bool is_readonly = 2;
2070
+ }
2071
+
2072
+ message McpPermissionDenied {
2073
+ string error = 1;
2074
+ bool is_readonly = 2;
2075
+ }
2076
+
2077
+ // List MCP resources exec args
2078
+ message ListMcpResourcesExecArgs {
2079
+ // Optional server name to filter resources by
2080
+ optional string server = 1;
2081
+ }
2082
+
2083
+ // List MCP resources exec result
2084
+ message ListMcpResourcesExecResult {
2085
+ oneof result {
2086
+ ListMcpResourcesSuccess success = 1;
2087
+ ListMcpResourcesError error = 2;
2088
+ ListMcpResourcesRejected rejected = 3;
2089
+ }
2090
+ }
2091
+
2092
+ message ListMcpResourcesExecResult_McpResource {
2093
+ string uri = 1;
2094
+ optional string name = 2;
2095
+ optional string description = 3;
2096
+ optional string mime_type = 4;
2097
+ // Server name that provides this resource
2098
+ string server = 5;
2099
+ // Additional metadata
2100
+ map<string, string> annotations = 6;
2101
+ }
2102
+
2103
+ message ListMcpResourcesSuccess {
2104
+ repeated ListMcpResourcesExecResult_McpResource resources = 1;
2105
+ }
2106
+
2107
+ message ListMcpResourcesError {
2108
+ string error = 1;
2109
+ }
2110
+
2111
+ message ListMcpResourcesRejected {
2112
+ string reason = 1;
2113
+ }
2114
+
2115
+ // Read MCP resource exec args
2116
+ message ReadMcpResourceExecArgs {
2117
+ // Required server name
2118
+ string server = 1;
2119
+ // Required resource URI
2120
+ string uri = 2;
2121
+ // Optional: when set, the resource will be downloaded to this path relative to the workspace, and the content will not be returned to the model.
2122
+ optional string download_path = 3;
2123
+ }
2124
+
2125
+ // Read MCP resource exec result
2126
+ message ReadMcpResourceExecResult {
2127
+ oneof result {
2128
+ ReadMcpResourceSuccess success = 1;
2129
+ ReadMcpResourceError error = 2;
2130
+ ReadMcpResourceRejected rejected = 3;
2131
+ ReadMcpResourceNotFound not_found = 4;
2132
+ }
2133
+ }
2134
+
2135
+ message ReadMcpResourceSuccess {
2136
+ string uri = 1;
2137
+ optional string name = 2;
2138
+ optional string description = 3;
2139
+ optional string mime_type = 4;
2140
+ // Additional metadata
2141
+ map<string, string> annotations = 7;
2142
+ // If set, resource was downloaded to this path
2143
+ optional string download_path = 8;
2144
+ oneof content {
2145
+ string text = 5;
2146
+ bytes blob = 6;
2147
+ }
2148
+ }
2149
+
2150
+ message ReadMcpResourceError {
2151
+ string uri = 1;
2152
+ string error = 2;
2153
+ }
2154
+
2155
+ message ReadMcpResourceRejected {
2156
+ string uri = 1;
2157
+ string reason = 2;
2158
+ }
2159
+
2160
+ message ReadMcpResourceNotFound {
2161
+ string uri = 1;
2162
+ }
2163
+
2164
+ message McpToolDefinition {
2165
+ string name = 1;
2166
+ string provider_identifier = 4;
2167
+ string tool_name = 5;
2168
+ string description = 2;
2169
+ bytes input_schema = 3;
2170
+ }
2171
+
2172
+ message McpTools {
2173
+ repeated McpToolDefinition mcp_tools = 1;
2174
+ }
2175
+
2176
+ // Represents MCP-provided instructions from a specific server
2177
+ message McpInstructions {
2178
+ string server_name = 1;
2179
+ string instructions = 2;
2180
+ }
2181
+
2182
+ message McpDescriptor {
2183
+ // Display name of the MCP server associated with this folder.
2184
+ string server_name = 1;
2185
+ string server_identifier = 2;
2186
+ // Absolute folder path where MCP tool descriptor JSON files are stored.
2187
+ optional string folder_path = 3;
2188
+ optional string server_use_instructions = 4;
2189
+ repeated McpToolDescriptor tools = 5;
2190
+ }
2191
+
2192
+ message McpToolDescriptor {
2193
+ string tool_name = 1;
2194
+ optional string definition_path = 2;
2195
+ }
2196
+
2197
+ message McpFileSystemOptions {
2198
+ bool enabled = 1;
2199
+ string workspace_project_dir = 2;
2200
+ repeated McpDescriptor mcp_descriptors = 3;
2201
+ }
2202
+
2203
+ message ReadArgs {
2204
+ string path = 1;
2205
+ string tool_call_id = 2;
2206
+ }
2207
+
2208
+ message ReadResult {
2209
+ oneof result {
2210
+ ReadSuccess success = 1;
2211
+ ReadError error = 2;
2212
+ ReadRejected rejected = 3;
2213
+ ReadFileNotFound file_not_found = 4;
2214
+ ReadPermissionDenied permission_denied = 5;
2215
+ ReadInvalidFile invalid_file = 6;
2216
+ }
2217
+ }
2218
+
2219
+ message ReadSuccess {
2220
+ string path = 1;
2221
+ int32 total_lines = 3;
2222
+ int64 file_size = 4;
2223
+ // true if the content was truncated due to size limits
2224
+ bool truncated = 6;
2225
+ // Returns blob ID if the output was stored in the blob store. If provided, the output is stored separately from the rest of the tool result, and since it's already in the blob store, it need not be sent back to the client -- reducing bandwidth.
2226
+ optional bytes output_blob_id = 7;
2227
+ oneof output {
2228
+ string content = 2;
2229
+ bytes data = 5;
2230
+ }
2231
+ }
2232
+
2233
+ message ReadError {
2234
+ string path = 1;
2235
+ string error = 2;
2236
+ }
2237
+
2238
+ message ReadRejected {
2239
+ string path = 1;
2240
+ string reason = 2;
2241
+ }
2242
+
2243
+ message ReadFileNotFound {
2244
+ string path = 1;
2245
+ }
2246
+
2247
+ message ReadPermissionDenied {
2248
+ string path = 1;
2249
+ }
2250
+
2251
+ message ReadInvalidFile {
2252
+ string path = 1;
2253
+ // e.g., "Path is a directory, not a file"
2254
+ string reason = 2;
2255
+ }
2256
+
2257
+ message ReadToolCall {
2258
+ ReadToolArgs args = 1;
2259
+ ReadToolResult result = 2;
2260
+ }
2261
+
2262
+ message ReadToolArgs {
2263
+ string path = 1;
2264
+ optional int32 offset = 2;
2265
+ optional int32 limit = 3;
2266
+ }
2267
+
2268
+ message ReadToolResult {
2269
+ oneof result {
2270
+ ReadToolSuccess success = 1;
2271
+ ReadToolError error = 2;
2272
+ }
2273
+ }
2274
+
2275
+ message ReadRange {
2276
+ uint32 start_line = 1;
2277
+ uint32 end_line = 2;
2278
+ }
2279
+
2280
+ message ReadToolSuccess {
2281
+ bool is_empty = 2;
2282
+ bool exceeded_limit = 3;
2283
+ uint32 total_lines = 4;
2284
+ uint32 file_size = 5;
2285
+ string path = 7;
2286
+ optional ReadRange read_range = 8;
2287
+ oneof output {
2288
+ string content = 1;
2289
+ bytes data = 6;
2290
+ bytes data_blob_id = 9;
2291
+ bytes content_blob_id = 10;
2292
+ }
2293
+ }
2294
+
2295
+ message ReadToolError {
2296
+ string error_message = 1;
2297
+ }
2298
+
2299
+ message RecordScreenArgs {
2300
+ int32 mode = 1;
2301
+ string tool_call_id = 2;
2302
+ // Custom filename for SAVE_RECORDING mode
2303
+ optional string save_as_filename = 3;
2304
+ }
2305
+
2306
+ message RecordScreenResult {
2307
+ oneof result {
2308
+ RecordScreenStartSuccess start_success = 1;
2309
+ RecordScreenSaveSuccess save_success = 2;
2310
+ RecordScreenDiscardSuccess discard_success = 3;
2311
+ RecordScreenFailure failure = 4;
2312
+ }
2313
+ }
2314
+
2315
+ message RecordScreenStartSuccess {
2316
+ // True if a prior recording was cancelled, false otherwise
2317
+ bool was_prior_recording_cancelled = 1;
2318
+ // True if save_as_filename arg was passed to start tool and ignored
2319
+ bool was_save_as_filename_ignored = 2;
2320
+ }
2321
+
2322
+ message RecordScreenSaveSuccess {
2323
+ // Path to the saved recording file
2324
+ string path = 1;
2325
+ // Duration of the recording in milliseconds
2326
+ int64 recording_duration_ms = 2;
2327
+ // Set if save_as_filename was invalid and default path was used instead
2328
+ optional int32 requested_file_path_rejected_reason = 3;
2329
+ }
2330
+
2331
+ // Empty message - recording discarded successfully
2332
+ message RecordScreenDiscardSuccess {
2333
+ }
2334
+
2335
+ message RecordScreenFailure {
2336
+ // Error message
2337
+ string error = 1;
2338
+ }
2339
+
2340
+ message CursorPackagePrompt {
2341
+ string name = 1;
2342
+ string file_path = 2;
2343
+ }
2344
+
2345
+ message CursorPackage {
2346
+ string name = 1;
2347
+ string description = 2;
2348
+ string folder_path = 3;
2349
+ bool enabled = 4;
2350
+ optional string parse_error = 5;
2351
+ repeated CursorPackagePrompt prompts = 6;
2352
+ string readme_file_path = 7;
2353
+ int32 package_type = 8;
2354
+ }
2355
+
2356
+ // TODO: you should be able to override / configure this list in your .vscode settings not exactly sure what that should look like... but i guess you should be able to specify an override URL because we use URLs for identifying repos and maybe you should be able to specify additional buckets too... like in the jane street case: i guess jane street should have some default buckets
2357
+ message RepositoryIndexingInfo {
2358
+ // the relative path in the current workspace this is useful for locating the repo and identifying what repo a given file is in this should be unique for different repositories (I think)
2359
+ string relative_workspace_path = 1;
2360
+ // a git repo may have multiple remotes at the server we choose the remote (either origin, or the one we have embedded, or something else) invariant: len(remote_urls) == len(remote_names)
2361
+ repeated string remote_urls = 2;
2362
+ repeated string remote_names = 3;
2363
+ string repo_name = 4;
2364
+ string repo_owner = 5;
2365
+ bool is_tracked = 6;
2366
+ // If this is local
2367
+ bool is_local = 7;
2368
+ // the orthogonal transform seed if sent from the client! if the client sends up the transform seed then we use that for the orthogonal transform instead of the value stored in the database
2369
+ optional double orthogonal_transform_seed = 8;
2370
+ // The encrypted workspace uri for the repository.
2371
+ string workspace_uri = 9;
2372
+ // The encryption key for partial paths
2373
+ string path_encryption_key = 10;
2374
+ }
2375
+
2376
+ message RequestContextArgs {
2377
+ optional string notes_session_id = 2;
2378
+ optional string workspace_id = 3;
2379
+ }
2380
+
2381
+ message RequestContextResult {
2382
+ oneof result {
2383
+ RequestContextSuccess success = 1;
2384
+ RequestContextError error = 2;
2385
+ RequestContextRejected rejected = 3;
2386
+ }
2387
+ }
2388
+
2389
+ message RequestContextSuccess {
2390
+ RequestContext request_context = 1;
2391
+ }
2392
+
2393
+ message RequestContextError {
2394
+ string error = 1;
2395
+ }
2396
+
2397
+ message RequestContextRejected {
2398
+ string reason = 1;
2399
+ }
2400
+
2401
+ // same as SelectedImage, but with the data field is the full image data
2402
+ message ImageProto {
2403
+ bytes data = 1;
2404
+ string uuid = 2;
2405
+ string path = 3;
2406
+ ImageProto_Dimension dimension = 4;
2407
+ optional string task_specific_description = 6;
2408
+ string mime_type = 7;
2409
+ }
2410
+
2411
+ message ImageProto_Dimension {
2412
+ int32 width = 1;
2413
+ int32 height = 2;
2414
+ }
2415
+
2416
+ // Git repository information for a workspace
2417
+ message GitRepoInfo {
2418
+ string path = 1;
2419
+ string status = 2;
2420
+ string branch_name = 3;
2421
+ optional string remote_url = 4;
2422
+ }
2423
+
2424
+ // Environment details for system prompt/context
2425
+ message RequestContextEnv {
2426
+ string os_version = 1;
2427
+ repeated string workspace_paths = 2;
2428
+ string shell = 3;
2429
+ bool sandbox_enabled = 5;
2430
+ string terminals_folder = 7;
2431
+ string agent_shared_notes_folder = 8;
2432
+ string agent_conversation_notes_folder = 9;
2433
+ string time_zone = 10;
2434
+ // Project-specific folder for storing artifacts, computed client-side as ~/.cursor/projects/{slug}/
2435
+ string project_folder = 11;
2436
+ // Folder where agent conversation transcripts are stored
2437
+ string agent_transcripts_folder = 12;
2438
+ }
2439
+
2440
+ message DebugModeConfig {
2441
+ string log_path = 1;
2442
+ string server_endpoint = 2;
2443
+ }
2444
+
2445
+ message SkillDescriptor {
2446
+ string name = 1;
2447
+ string description = 2;
2448
+ string folder_path = 3;
2449
+ bool enabled = 4;
2450
+ optional string parse_error = 5;
2451
+ string readme_file_path = 6;
2452
+ int32 package_type = 7;
2453
+ }
2454
+
2455
+ message SkillOptions {
2456
+ repeated SkillDescriptor skill_descriptors = 1;
2457
+ }
2458
+
2459
+ message RequestContext {
2460
+ // All rules, categorized by the embedded type
2461
+ repeated CursorRule rules = 2;
2462
+ RequestContextEnv env = 4;
2463
+ repeated RepositoryIndexingInfo repository_info = 6;
2464
+ repeated McpToolDefinition tools = 7;
2465
+ optional string conversation_notes_listing = 8;
2466
+ optional string shared_notes_listing = 9;
2467
+ repeated GitRepoInfo git_repos = 11;
2468
+ repeated LsDirectoryTreeNode project_layouts = 13;
2469
+ repeated McpInstructions mcp_instructions = 14;
2470
+ optional DebugModeConfig debug_mode_config = 15;
2471
+ optional string cloud_rule = 16;
2472
+ optional bool web_search_enabled = 17;
2473
+ optional SkillOptions skill_options = 18;
2474
+ optional bool repository_info_should_query_prod = 19;
2475
+ map<string, string> file_contents = 20;
2476
+ // Content of the user-intent/index.md file summarizing past conversations
2477
+ optional string user_intent_summary = 21;
2478
+ // Local custom subagent definitions loaded from workspace configuration
2479
+ repeated CustomSubagent custom_subagents = 22;
2480
+ // MCP file system options for agent MCP tool descriptor access
2481
+ optional McpFileSystemOptions mcp_file_system_options = 23;
2482
+ }
2483
+
2484
+ message SandboxPolicy {
2485
+ int32 type = 1;
2486
+ optional bool network_access = 2;
2487
+ repeated string additional_readwrite_paths = 3;
2488
+ repeated string additional_readonly_paths = 4;
2489
+ optional string debug_output_dir = 5;
2490
+ optional bool block_git_writes = 6;
2491
+ // If true, excludes default tmp paths (/tmp/, /private/tmp/, /var/folders/) from the sandbox writable paths. Useful for testing readonly behavior.
2492
+ optional bool disable_tmp_write = 7;
2493
+ }
2494
+
2495
+ message SelectedImage {
2496
+ string uuid = 2;
2497
+ string path = 3;
2498
+ SelectedImage_Dimension dimension = 4;
2499
+ string mime_type = 7;
2500
+ oneof data_or_blob_id {
2501
+ bytes blob_id = 1;
2502
+ bytes data = 8;
2503
+ SelectedImage_BlobIdWithData blob_id_with_data = 9;
2504
+ }
2505
+ }
2506
+
2507
+ // Contains both blob_id and data together, for when the client has both and wants to populate the server-side cache without re-uploading
2508
+ message SelectedImage_BlobIdWithData {
2509
+ bytes blob_id = 1;
2510
+ bytes data = 2;
2511
+ }
2512
+
2513
+ message SelectedImage_Dimension {
2514
+ int32 width = 1;
2515
+ int32 height = 2;
2516
+ }
2517
+
2518
+ // Extra context entry that can be stored inline or as a blob reference
2519
+ message ExtraContextEntry {
2520
+ oneof data_or_blob_id {
2521
+ string data = 1;
2522
+ bytes blob_id = 2;
2523
+ }
2524
+ }
2525
+
2526
+ // A selected file from the UI
2527
+ message SelectedFile {
2528
+ string content = 1;
2529
+ // This is the full path
2530
+ string path = 2;
2531
+ optional string relative_path = 3;
2532
+ }
2533
+
2534
+ // A selected code selection from the UI
2535
+ message SelectedCodeSelection {
2536
+ string content = 1;
2537
+ // This is the full path
2538
+ string path = 2;
2539
+ optional string relative_path = 3;
2540
+ Range range = 4;
2541
+ }
2542
+
2543
+ // A selected terminal from the UI
2544
+ message SelectedTerminal {
2545
+ string content = 1;
2546
+ optional string title = 2;
2547
+ optional string path = 3;
2548
+ }
2549
+
2550
+ // A selected terminal selection from the UI
2551
+ message SelectedTerminalSelection {
2552
+ string content = 1;
2553
+ optional string title = 2;
2554
+ optional string path = 3;
2555
+ Range range = 4;
2556
+ }
2557
+
2558
+ // A selected folder from the UI
2559
+ message SelectedFolder {
2560
+ // This is the full path
2561
+ string path = 1;
2562
+ optional string relative_path = 2;
2563
+ LsDirectoryTreeNode directory_tree = 3;
2564
+ }
2565
+
2566
+ // An external link manually attached by the user
2567
+ message SelectedExternalLink {
2568
+ string url = 1;
2569
+ string uuid = 2;
2570
+ // For local PDF files Base64-encoded PDF content
2571
+ optional string pdf_content = 3;
2572
+ optional bool is_pdf = 4;
2573
+ optional string filename = 5;
2574
+ }
2575
+
2576
+ // A cursor rule manually attached by the user
2577
+ message SelectedCursorRule {
2578
+ CursorRule rule = 1;
2579
+ }
2580
+
2581
+ // Git diff (uncommitted changes in working tree)
2582
+ message SelectedGitDiff {
2583
+ // Raw git diff output
2584
+ string content = 1;
2585
+ }
2586
+
2587
+ // Git diff from branch to main
2588
+ message SelectedGitDiffFromBranchToMain {
2589
+ // Raw git diff output
2590
+ string content = 1;
2591
+ }
2592
+
2593
+ // A git commit manually attached by the user
2594
+ message SelectedGitCommit {
2595
+ string sha = 1;
2596
+ string message = 2;
2597
+ optional string description = 3;
2598
+ // Raw git diff output for this commit
2599
+ string diff = 4;
2600
+ }
2601
+
2602
+ // A pull request manually attached by the user via @mention Uses the same folder structure as ViewedPullRequest for consistency
2603
+ message SelectedPullRequest {
2604
+ int32 number = 1;
2605
+ string url = 2;
2606
+ optional string title = 3;
2607
+ // Path to the folder containing PR details (diffs, metadata, etc.)
2608
+ string folder_path = 4;
2609
+ // Summary JSON containing file list and diff sizes (contents of summary.json)
2610
+ optional string summary_json = 5;
2611
+ // PR description/body
2612
+ optional string description = 6;
2613
+ // If set, other fields are empty and data should be fetched from the blob
2614
+ optional bytes blob_id = 7;
2615
+ }
2616
+
2617
+ // A selection from a pull request diff (for files that may not exist on disk)
2618
+ message SelectedGitPRDiffSelection {
2619
+ // Full URL to the pull request
2620
+ string pr_url = 1;
2621
+ // Path to the file within the PR
2622
+ string file_path = 2;
2623
+ // Start line in the diff
2624
+ int32 start_line = 3;
2625
+ // End line in the diff
2626
+ int32 end_line = 4;
2627
+ // The diff content for this file (or selection)
2628
+ optional string diff_content = 5;
2629
+ // If set, other fields are empty and data should be fetched from the blob
2630
+ optional bytes blob_id = 6;
2631
+ }
2632
+
2633
+ // A cursor command manually attached by the user
2634
+ message SelectedCursorCommand {
2635
+ string name = 1;
2636
+ string content = 2;
2637
+ }
2638
+
2639
+ // A documentation manually attached by the user
2640
+ message SelectedDocumentation {
2641
+ string doc_id = 1;
2642
+ string name = 2;
2643
+ }
2644
+
2645
+ // A past chat manually attached by the user (transcript file)
2646
+ message SelectedPastChat {
2647
+ string agent_id = 1;
2648
+ string name = 2;
2649
+ }
2650
+
2651
+ // A call frame from a stack trace
2652
+ message CallFrame {
2653
+ optional string function_name = 1;
2654
+ optional string url = 2;
2655
+ optional int32 line_number = 3;
2656
+ optional int32 column_number = 4;
2657
+ }
2658
+
2659
+ // A stack trace
2660
+ message StackTrace {
2661
+ repeated CallFrame call_frames = 1;
2662
+ optional string raw_stack_trace = 2;
2663
+ }
2664
+
2665
+ // A console log entry from the runtime
2666
+ message SelectedConsoleLog {
2667
+ string message = 1;
2668
+ // * Unix timestamp in milliseconds when this log entry was created
2669
+ double timestamp = 2;
2670
+ string level = 3;
2671
+ string client_name = 4;
2672
+ string session_id = 5;
2673
+ optional StackTrace stack_trace = 6;
2674
+ optional string object_data_json = 7;
2675
+ }
2676
+
2677
+ // A UI element picked by the user from the runtime
2678
+ message SelectedUIElement {
2679
+ string element = 1;
2680
+ string xpath = 2;
2681
+ string text_content = 3;
2682
+ string extra = 4;
2683
+ optional string component = 5;
2684
+ optional string component_props_json = 6;
2685
+ }
2686
+
2687
+ // A subagent selected by the user from the slash menu
2688
+ message SelectedSubagent {
2689
+ string name = 1;
2690
+ }
2691
+
2692
+ // Container for selected context from the UI
2693
+ message SelectedContext {
2694
+ repeated SelectedImage selected_images = 1;
2695
+ optional InvocationContext invocation_context = 2;
2696
+ // Temporary hack for IDE-based context (@filename, @Diff, etc.) in background agents only. TODO: remove once proper IDE context format is implemented.
2697
+ repeated string extra_context = 3;
2698
+ repeated ExtraContextEntry extra_context_entries = 16;
2699
+ // New context types
2700
+ repeated SelectedFile files = 4;
2701
+ repeated SelectedCodeSelection code_selections = 5;
2702
+ repeated SelectedTerminal terminals = 6;
2703
+ repeated SelectedTerminalSelection terminal_selections = 7;
2704
+ repeated SelectedFolder folders = 8;
2705
+ repeated SelectedExternalLink external_links = 9;
2706
+ repeated SelectedCursorRule cursor_rules = 10;
2707
+ optional SelectedGitDiff git_diff = 18;
2708
+ optional SelectedGitDiffFromBranchToMain git_diff_from_branch_to_main = 11;
2709
+ repeated SelectedCursorCommand cursor_commands = 12;
2710
+ repeated SelectedDocumentation documentations = 13;
2711
+ repeated SelectedUIElement ui_elements = 14;
2712
+ repeated SelectedConsoleLog console_logs = 15;
2713
+ repeated SelectedGitCommit git_commits = 17;
2714
+ repeated SelectedPastChat past_chats = 19;
2715
+ repeated SelectedGitPRDiffSelection git_pr_diff_selections = 20;
2716
+ repeated SelectedPullRequest selected_pull_requests = 21;
2717
+ repeated SelectedSubagent selected_subagents = 22;
2718
+ }
2719
+
2720
+ // InvocationContext represents the context from the external app/integration that triggered this agent request.
2721
+ message InvocationContext {
2722
+ oneof data {
2723
+ InvocationContext_SlackThread slack_thread = 1;
2724
+ InvocationContext_GithubPR github_pr = 2;
2725
+ InvocationContext_IdeState ide_state = 3;
2726
+ bytes blob_id = 10;
2727
+ }
2728
+ }
2729
+
2730
+ message InvocationContext_SlackThread {
2731
+ string thread = 1;
2732
+ optional string channel_name = 2;
2733
+ optional string channel_purpose = 3;
2734
+ optional string channel_topic = 4;
2735
+ }
2736
+
2737
+ message InvocationContext_GithubPR {
2738
+ string title = 1;
2739
+ string description = 2;
2740
+ string comments = 3;
2741
+ optional string ci_failures = 4;
2742
+ }
2743
+
2744
+ message InvocationContext_IdeState {
2745
+ repeated InvocationContext_IdeState_File visible_files = 1;
2746
+ repeated InvocationContext_IdeState_File recently_viewed_files = 2;
2747
+ // PRs currently being viewed in the review editor (if any)
2748
+ repeated InvocationContext_IdeState_ViewedPullRequest currently_viewed_prs = 3;
2749
+ }
2750
+
2751
+ message InvocationContext_IdeState_File {
2752
+ // This is the full path
2753
+ string path = 1;
2754
+ optional string relative_path = 2;
2755
+ // Present if file is currently focused
2756
+ optional InvocationContext_IdeState_File_CursorPosition cursor_position = 3;
2757
+ int32 total_lines = 4;
2758
+ // Present for terminal files
2759
+ optional string active_command = 5;
2760
+ }
2761
+
2762
+ message InvocationContext_IdeState_File_CursorPosition {
2763
+ int32 line = 1;
2764
+ string text = 2;
2765
+ }
2766
+
2767
+ // Information about a PR currently being viewed in a review editor
2768
+ message InvocationContext_IdeState_ViewedPullRequest {
2769
+ int32 number = 1;
2770
+ string url = 2;
2771
+ optional string title = 3;
2772
+ // Path to the folder containing PR details (diffs, metadata, etc.)
2773
+ optional string folder_path = 4;
2774
+ // Summary JSON containing file list and diff sizes (contents of summary.json)
2775
+ optional string summary_json = 5;
2776
+ // PR description/body
2777
+ optional string description = 6;
2778
+ }
2779
+
2780
+ message SetupVmEnvironmentArgs {
2781
+ // Command to install runtime dependencies (e.g., "npm install")
2782
+ string install_command = 2;
2783
+ string start_command = 3;
2784
+ }
2785
+
2786
+ // Result of VM environment setup operations
2787
+ message SetupVmEnvironmentResult {
2788
+ oneof result {
2789
+ SetupVmEnvironmentSuccess success = 1;
2790
+ }
2791
+ }
2792
+
2793
+ // Successful VM environment setup result
2794
+ message SetupVmEnvironmentSuccess {
2795
+ }
2796
+
2797
+ // Tool call structure for SetupVmEnvironment
2798
+ message SetupVmEnvironmentToolCall {
2799
+ // Arguments for the tool call
2800
+ SetupVmEnvironmentArgs args = 1;
2801
+ // Result of the tool call (populated after execution)
2802
+ SetupVmEnvironmentResult result = 2;
2803
+ }
2804
+
2805
+ message ShellCommandParsingResult {
2806
+ bool parsing_failed = 1;
2807
+ repeated ShellCommandParsingResult_ExecutableCommand executable_commands = 2;
2808
+ bool has_redirects = 3;
2809
+ bool has_command_substitution = 4;
2810
+ }
2811
+
2812
+ message ShellCommandParsingResult_ExecutableCommandArg {
2813
+ string type = 1;
2814
+ string value = 2;
2815
+ }
2816
+
2817
+ message ShellCommandParsingResult_ExecutableCommand {
2818
+ string name = 1;
2819
+ repeated ShellCommandParsingResult_ExecutableCommandArg args = 2;
2820
+ string full_text = 3;
2821
+ }
2822
+
2823
+ message ShellArgs {
2824
+ string command = 1;
2825
+ string working_directory = 2;
2826
+ int32 timeout = 3;
2827
+ string tool_call_id = 4;
2828
+ repeated string simple_commands = 5;
2829
+ bool has_input_redirect = 6;
2830
+ bool has_output_redirect = 7;
2831
+ // Deprecated: use parsing_result instead @deprecated simpleCommands = []; Deprecated: use parsing_result instead @deprecated hasInputRedirect = false; Deprecated: use parsing_result instead @deprecated hasOutputRedirect = false;
2832
+ ShellCommandParsingResult parsing_result = 8;
2833
+ optional SandboxPolicy requested_sandbox_policy = 9;
2834
+ // If output size exceeds this threshold (in bytes), write to file instead of inline. If unset or 0, always use inline output.
2835
+ optional uint64 file_output_threshold_bytes = 10;
2836
+ bool is_background = 11;
2837
+ bool skip_approval = 12;
2838
+ int32 timeout_behavior = 13;
2839
+ // Hard timeout: kill the command after this many ms, even if running in background
2840
+ optional int32 hard_timeout = 14;
2841
+ }
2842
+
2843
+ message ShellResult {
2844
+ optional SandboxPolicy sandbox_policy = 101;
2845
+ // Rendering is affected by this flag, pass forward from args.
2846
+ optional bool is_background = 102;
2847
+ // Rendering is affected by this flag, pass forward from args.
2848
+ optional string terminals_folder = 103;
2849
+ // Process ID, used for backgrounded shells.
2850
+ optional uint32 pid = 104;
2851
+ oneof result {
2852
+ ShellSuccess success = 1;
2853
+ ShellFailure failure = 2;
2854
+ ShellTimeout timeout = 3;
2855
+ ShellRejected rejected = 4;
2856
+ ShellSpawnError spawn_error = 5;
2857
+ ShellPermissionDenied permission_denied = 7;
2858
+ }
2859
+ }
2860
+
2861
+ message ShellStreamStdout {
2862
+ string data = 1;
2863
+ }
2864
+
2865
+ message ShellStreamStderr {
2866
+ string data = 1;
2867
+ }
2868
+
2869
+ message ShellStreamExit {
2870
+ uint32 code = 1;
2871
+ string cwd = 2;
2872
+ optional OutputLocation output_location = 3;
2873
+ bool aborted = 4;
2874
+ // If aborted is true, this field indicates the reason for the abort
2875
+ optional int32 abort_reason = 5;
2876
+ }
2877
+
2878
+ message ShellStreamStart {
2879
+ optional SandboxPolicy sandbox_policy = 1;
2880
+ }
2881
+
2882
+ message ShellStreamBackgrounded {
2883
+ uint32 shell_id = 1;
2884
+ string command = 2;
2885
+ string working_directory = 3;
2886
+ optional uint32 pid = 4;
2887
+ // The ms_to_wait value that was used for backgrounding, for display purposes
2888
+ optional int32 ms_to_wait = 5;
2889
+ }
2890
+
2891
+ message ShellStream {
2892
+ oneof event {
2893
+ ShellStreamStdout stdout = 1;
2894
+ ShellStreamStderr stderr = 2;
2895
+ ShellStreamExit exit = 3;
2896
+ ShellStreamStart start = 4;
2897
+ ShellRejected rejected = 5;
2898
+ ShellPermissionDenied permission_denied = 6;
2899
+ ShellStreamBackgrounded backgrounded = 7;
2900
+ }
2901
+ }
2902
+
2903
+ message OutputLocation {
2904
+ // Absolute path to the output file
2905
+ string file_path = 1;
2906
+ // Size of the output in bytes
2907
+ int64 size_bytes = 2;
2908
+ // Number of lines in the output
2909
+ int64 line_count = 3;
2910
+ }
2911
+
2912
+ message ShellSuccess {
2913
+ string command = 1;
2914
+ string working_directory = 2;
2915
+ int32 exit_code = 3;
2916
+ string signal = 4;
2917
+ // Inline stdout - populated when write_output_to_file is false, empty when true
2918
+ string stdout = 5;
2919
+ // Inline stderr - populated when write_output_to_file is false, empty when true
2920
+ string stderr = 6;
2921
+ int32 execution_time = 7;
2922
+ // File-based output - populated when write_output_to_file is true (chronologically merged stdout+stderr)
2923
+ optional OutputLocation output_location = 8;
2924
+ // Used by background shell executor
2925
+ optional uint32 shell_id = 9;
2926
+ optional string interleaved_output = 10;
2927
+ // Process ID, used for backgrounded shells
2928
+ optional uint32 pid = 11;
2929
+ // The ms_to_wait value used for backgrounding (for display in result)
2930
+ optional int32 ms_to_wait = 12;
2931
+ }
2932
+
2933
+ message ShellFailure {
2934
+ string command = 1;
2935
+ string working_directory = 2;
2936
+ int32 exit_code = 3;
2937
+ string signal = 4;
2938
+ // Inline stdout - populated when write_output_to_file is false, empty when true
2939
+ string stdout = 5;
2940
+ // Inline stderr - populated when write_output_to_file is false, empty when true
2941
+ string stderr = 6;
2942
+ int32 execution_time = 7;
2943
+ // File-based output - populated when write_output_to_file is true (chronologically merged stdout+stderr)
2944
+ optional OutputLocation output_location = 8;
2945
+ optional string interleaved_output = 9;
2946
+ // If the command was aborted, this indicates the reason
2947
+ optional int32 abort_reason = 10;
2948
+ // Whether the command was aborted (by user or timeout)
2949
+ bool aborted = 11;
2950
+ }
2951
+
2952
+ message ShellTimeout {
2953
+ string command = 1;
2954
+ string working_directory = 2;
2955
+ int32 timeout_ms = 3;
2956
+ }
2957
+
2958
+ message ShellRejected {
2959
+ string command = 1;
2960
+ string working_directory = 2;
2961
+ string reason = 3;
2962
+ bool is_readonly = 4;
2963
+ }
2964
+
2965
+ message ShellPermissionDenied {
2966
+ string command = 1;
2967
+ string working_directory = 2;
2968
+ string error = 3;
2969
+ bool is_readonly = 4;
2970
+ }
2971
+
2972
+ message ShellSpawnError {
2973
+ string command = 1;
2974
+ string working_directory = 2;
2975
+ string error = 3;
2976
+ }
2977
+
2978
+ message ShellPartialResult {
2979
+ string stdout_delta = 1;
2980
+ string stderr_delta = 2;
2981
+ }
2982
+
2983
+ message ShellToolCall {
2984
+ ShellArgs args = 1;
2985
+ ShellResult result = 2;
2986
+ }
2987
+
2988
+ message ShellToolCallStdoutDelta {
2989
+ string content = 1;
2990
+ }
2991
+
2992
+ message ShellToolCallStderrDelta {
2993
+ string content = 1;
2994
+ }
2995
+
2996
+ message ShellToolCallDelta {
2997
+ oneof delta {
2998
+ ShellToolCallStdoutDelta stdout = 1;
2999
+ ShellToolCallStderrDelta stderr = 2;
3000
+ }
3001
+ }
3002
+
3003
+ message SubagentType {
3004
+ oneof type {
3005
+ SubagentTypeUnspecified unspecified = 1;
3006
+ SubagentTypeComputerUse computer_use = 2;
3007
+ SubagentTypeCustom custom = 3;
3008
+ SubagentTypeExplore explore = 4;
3009
+ }
3010
+ }
3011
+
3012
+ // Empty message for unspecified subagent type
3013
+ message SubagentTypeUnspecified {
3014
+ }
3015
+
3016
+ // Empty message for computer use subagent type
3017
+ message SubagentTypeComputerUse {
3018
+ }
3019
+
3020
+ // Empty message for explore subagent type (read-only codebase exploration)
3021
+ message SubagentTypeExplore {
3022
+ }
3023
+
3024
+ // Custom subagent type with a name field
3025
+ message SubagentTypeCustom {
3026
+ // unique identifier of the custom subagent
3027
+ string name = 1;
3028
+ }
3029
+
3030
+ // Custom subagent definition loaded from local workspace configuration.
3031
+ message CustomSubagent {
3032
+ // absolute path to the markdown definition file
3033
+ string full_path = 1;
3034
+ // unique identifier of the subagent
3035
+ string name = 2;
3036
+ // short summary of the agent's specialization
3037
+ string description = 3;
3038
+ // list of tool names the subagent can access
3039
+ repeated string tools = 4;
3040
+ // preferred model (or "inherit" to use parent's model)
3041
+ string model = 5;
3042
+ // full prompt contents from the markdown file
3043
+ string prompt = 6;
3044
+ // default permission mode for subagent execution
3045
+ int32 permission_mode = 7;
3046
+ }
3047
+
3048
+ message SwitchModeArgs {
3049
+ // The unified mode id to switch to (agent/chat/plan/spec/debug/triage)
3050
+ string target_mode_id = 1;
3051
+ // Optional explanation for why the mode switch is requested
3052
+ optional string explanation = 2;
3053
+ string tool_call_id = 3;
3054
+ }
3055
+
3056
+ message SwitchModeResult {
3057
+ oneof result {
3058
+ SwitchModeSuccess success = 1;
3059
+ SwitchModeError error = 2;
3060
+ SwitchModeRejected rejected = 3;
3061
+ }
3062
+ }
3063
+
3064
+ message SwitchModeSuccess {
3065
+ // The mode we switched from
3066
+ string from_mode_id = 1;
3067
+ // The mode we switched to
3068
+ string to_mode_id = 2;
3069
+ }
3070
+
3071
+ message SwitchModeError {
3072
+ string error = 1;
3073
+ }
3074
+
3075
+ message SwitchModeRejected {
3076
+ string reason = 1;
3077
+ }
3078
+
3079
+ message SwitchModeToolCall {
3080
+ SwitchModeArgs args = 1;
3081
+ SwitchModeResult result = 2;
3082
+ }
3083
+
3084
+ message SwitchModeRequestQuery {
3085
+ SwitchModeArgs args = 1;
3086
+ }
3087
+
3088
+ message SwitchModeRequestResponse {
3089
+ oneof result {
3090
+ SwitchModeRequestResponse_Approved approved = 1;
3091
+ SwitchModeRequestResponse_Rejected rejected = 2;
3092
+ }
3093
+ }
3094
+
3095
+ message SwitchModeRequestResponse_Approved {
3096
+ }
3097
+
3098
+ message SwitchModeRequestResponse_Rejected {
3099
+ string reason = 1;
3100
+ }
3101
+
3102
+ message TodoItem {
3103
+ string id = 1;
3104
+ string content = 2;
3105
+ int32 status = 3;
3106
+ int64 created_at = 4;
3107
+ int64 updated_at = 5;
3108
+ // IDs of other TODOs this depends on
3109
+ repeated string dependencies = 6;
3110
+ }
3111
+
3112
+ // UpdateTodos tool call
3113
+ message UpdateTodosToolCall {
3114
+ UpdateTodosArgs args = 1;
3115
+ UpdateTodosResult result = 2;
3116
+ }
3117
+
3118
+ message UpdateTodosArgs {
3119
+ repeated TodoItem todos = 1;
3120
+ bool merge = 2;
3121
+ }
3122
+
3123
+ message UpdateTodosResult {
3124
+ oneof result {
3125
+ UpdateTodosSuccess success = 1;
3126
+ UpdateTodosError error = 2;
3127
+ }
3128
+ }
3129
+
3130
+ message UpdateTodosSuccess {
3131
+ repeated TodoItem todos = 1;
3132
+ int32 total_count = 2;
3133
+ // Whether this was a merge operation (needed for conditional rendering)
3134
+ bool was_merge = 3;
3135
+ }
3136
+
3137
+ message UpdateTodosError {
3138
+ string error = 1;
3139
+ }
3140
+
3141
+ // ReadTodos tool call
3142
+ message ReadTodosToolCall {
3143
+ ReadTodosArgs args = 1;
3144
+ ReadTodosResult result = 2;
3145
+ }
3146
+
3147
+ message ReadTodosArgs {
3148
+ // Optional: filter by status
3149
+ repeated int32 status_filter = 1;
3150
+ // Optional: filter by IDs
3151
+ repeated string id_filter = 2;
3152
+ }
3153
+
3154
+ message ReadTodosResult {
3155
+ oneof result {
3156
+ ReadTodosSuccess success = 1;
3157
+ ReadTodosError error = 2;
3158
+ }
3159
+ }
3160
+
3161
+ message ReadTodosSuccess {
3162
+ repeated TodoItem todos = 1;
3163
+ int32 total_count = 2;
3164
+ }
3165
+
3166
+ message ReadTodosError {
3167
+ string error = 1;
3168
+ }
3169
+
3170
+ message Range {
3171
+ Position start = 1;
3172
+ Position end = 2;
3173
+ }
3174
+
3175
+ message Position {
3176
+ uint32 line = 1;
3177
+ uint32 column = 2;
3178
+ }
3179
+
3180
+ message Error {
3181
+ string message = 1;
3182
+ }
3183
+
3184
+ message WebSearchArgs {
3185
+ string search_term = 1;
3186
+ string tool_call_id = 2;
3187
+ }
3188
+
3189
+ message WebSearchResult {
3190
+ oneof result {
3191
+ WebSearchSuccess success = 1;
3192
+ WebSearchError error = 2;
3193
+ WebSearchRejected rejected = 3;
3194
+ }
3195
+ }
3196
+
3197
+ message WebSearchSuccess {
3198
+ repeated WebSearchReference references = 1;
3199
+ }
3200
+
3201
+ message WebSearchError {
3202
+ string error = 1;
3203
+ }
3204
+
3205
+ message WebSearchRejected {
3206
+ string reason = 1;
3207
+ }
3208
+
3209
+ message WebSearchReference {
3210
+ string title = 1;
3211
+ string url = 2;
3212
+ string chunk = 3;
3213
+ }
3214
+
3215
+ message WebSearchToolCall {
3216
+ WebSearchArgs args = 1;
3217
+ WebSearchResult result = 2;
3218
+ }
3219
+
3220
+ message WebSearchRequestQuery {
3221
+ WebSearchArgs args = 1;
3222
+ }
3223
+
3224
+ message WebSearchRequestResponse {
3225
+ oneof result {
3226
+ WebSearchRequestResponse_Approved approved = 1;
3227
+ WebSearchRequestResponse_Rejected rejected = 2;
3228
+ }
3229
+ }
3230
+
3231
+ message WebSearchRequestResponse_Approved {
3232
+ }
3233
+
3234
+ message WebSearchRequestResponse_Rejected {
3235
+ string reason = 1;
3236
+ }
3237
+
3238
+ message WriteArgs {
3239
+ string path = 1;
3240
+ string file_text = 2;
3241
+ string tool_call_id = 3;
3242
+ bool return_file_content_after_write = 4;
3243
+ // Raw binary data to write. When set, file_text is ignored and the bytes are written directly without any text processing (e.g., line ending normalization).
3244
+ bytes file_bytes = 5;
3245
+ }
3246
+
3247
+ message WriteResult {
3248
+ oneof result {
3249
+ WriteSuccess success = 1;
3250
+ WritePermissionDenied permission_denied = 3;
3251
+ WriteNoSpace no_space = 4;
3252
+ WriteError error = 5;
3253
+ WriteRejected rejected = 6;
3254
+ }
3255
+ }
3256
+
3257
+ message WriteSuccess {
3258
+ string path = 1;
3259
+ int32 lines_created = 2;
3260
+ int32 file_size = 3;
3261
+ optional string file_content_after_write = 4;
3262
+ }
3263
+
3264
+ message WritePermissionDenied {
3265
+ string path = 1;
3266
+ string directory = 2;
3267
+ // "create_directory" or "create_file"
3268
+ string operation = 3;
3269
+ string error = 4;
3270
+ bool is_readonly = 5;
3271
+ }
3272
+
3273
+ message WriteNoSpace {
3274
+ string path = 1;
3275
+ }
3276
+
3277
+ message WriteError {
3278
+ string path = 1;
3279
+ string error = 2;
3280
+ }
3281
+
3282
+ message WriteRejected {
3283
+ string path = 1;
3284
+ string reason = 2;
3285
+ }
3286
+
3287
+ message BootstrapStatsigRequest {
3288
+ // When true, the server should evaluate gates as if dev/internal status is ignored. This is used by clients to simulate a prod user experience.
3289
+ optional bool ignore_dev_status = 1;
3290
+ optional int32 operating_system = 2;
3291
+ }
3292
+
3293
+ message PingResponse {
3294
+ }
3295
+
3296
+ message ExecRequest {
3297
+ string command = 1;
3298
+ optional string cwd = 2;
3299
+ repeated string args = 3;
3300
+ map<string, string> environment = 4;
3301
+ }
3302
+
3303
+ message ExecResponse {
3304
+ oneof event {
3305
+ StdoutEvent stdout_event = 1;
3306
+ StderrEvent stderr_event = 2;
3307
+ ExitEvent exit_event = 3;
3308
+ }
3309
+ }
3310
+
3311
+ message StdoutEvent {
3312
+ string data = 1;
3313
+ }
3314
+
3315
+ message StderrEvent {
3316
+ string data = 1;
3317
+ }
3318
+
3319
+ message ExitEvent {
3320
+ int32 exit_code = 1;
3321
+ }
3322
+
3323
+ message ReadTextFileRequest {
3324
+ string path = 1;
3325
+ }
3326
+
3327
+ message ReadTextFileResponse {
3328
+ string content = 1;
3329
+ }
3330
+
3331
+ message WriteTextFileRequest {
3332
+ string path = 1;
3333
+ string content = 2;
3334
+ }
3335
+
3336
+ // Empty response - success is implied by RPC completion
3337
+ message WriteTextFileResponse {
3338
+ }
3339
+
3340
+ message ReadBinaryFileRequest {
3341
+ string path = 1;
3342
+ }
3343
+
3344
+ message ReadBinaryFileResponse {
3345
+ bytes content = 1;
3346
+ }
3347
+
3348
+ message WriteBinaryFileRequest {
3349
+ string path = 1;
3350
+ bytes content = 2;
3351
+ }
3352
+
3353
+ // Empty response - success is implied by RPC completion
3354
+ message WriteBinaryFileResponse {
3355
+ }
3356
+
3357
+ message GetWorkspaceChangesHashRequest {
3358
+ string root_path = 1;
3359
+ string base_ref = 2;
3360
+ }
3361
+
3362
+ message GetWorkspaceChangesHashResponse {
3363
+ string hash = 1;
3364
+ }
3365
+
3366
+ message RefreshGithubAccessTokenRequest {
3367
+ string github_access_token = 1;
3368
+ // e.g., "github.com", "gitlab.com", "gitlab.example.com"
3369
+ string hostname = 2;
3370
+ }
3371
+
3372
+ // Empty response - success is implied by RPC completion
3373
+ message RefreshGithubAccessTokenResponse {
3374
+ }
3375
+
3376
+ message WarmRemoteAccessServerRequest {
3377
+ string commit = 1;
3378
+ int32 port = 2;
3379
+ string connection_token = 3;
3380
+ }
3381
+
3382
+ // Empty response - success is implied by RPC completion
3383
+ message WarmRemoteAccessServerResponse {
3384
+ }
3385
+
3386
+ message ListArtifactsRequest {
3387
+ }
3388
+
3389
+ message ArtifactUploadMetadata {
3390
+ string absolute_path = 1;
3391
+ uint64 size_bytes = 2;
3392
+ int64 updated_at_unix_ms = 3;
3393
+ int32 status = 4;
3394
+ uint64 bytes_uploaded = 5;
3395
+ string last_error = 6;
3396
+ uint32 upload_attempts = 7;
3397
+ int64 last_started_at_unix_ms = 8;
3398
+ int64 last_finished_at_unix_ms = 9;
3399
+ string upload_id = 10;
3400
+ }
3401
+
3402
+ message ListArtifactsResponse {
3403
+ repeated ArtifactUploadMetadata artifacts = 1;
3404
+ }
3405
+
3406
+ message UploadArtifactsRequest {
3407
+ repeated ArtifactUploadInstruction uploads = 1;
3408
+ }
3409
+
3410
+ message ArtifactUploadInstruction {
3411
+ string absolute_path = 1;
3412
+ string upload_url = 2;
3413
+ string method = 3;
3414
+ map<string, string> headers = 4;
3415
+ optional string content_type = 5;
3416
+ optional string slack_upload_url = 6;
3417
+ optional string slack_file_id = 7;
3418
+ }
3419
+
3420
+ message ArtifactUploadDispatchResult {
3421
+ string absolute_path = 1;
3422
+ int32 status = 2;
3423
+ string message = 3;
3424
+ optional string slack_file_id = 4;
3425
+ }
3426
+
3427
+ message UploadArtifactsResponse {
3428
+ repeated ArtifactUploadDispatchResult results = 1;
3429
+ }
3430
+
3431
+ message GetMcpRefreshTokensRequest {
3432
+ }
3433
+
3434
+ message GetMcpRefreshTokensResponse {
3435
+ // Map from server URL to refresh token
3436
+ map<string, string> refresh_tokens = 1;
3437
+ }
3438
+
3439
+ message UpdateEnvironmentVariablesRequest {
3440
+ // Environment variables to manage (plaintext values).
3441
+ map<string, string> env = 1;
3442
+ // If true, unset previously-managed keys that are not present in `env`.
3443
+ bool replace = 2;
3444
+ }
3445
+
3446
+ message UpdateEnvironmentVariablesResponse {
3447
+ uint32 applied = 1;
3448
+ uint32 removed = 2;
3449
+ }
3450
+
3451
+ // Check if an error is caused by the client disconnecting (e.g., due to timeout or abort). This includes errors like ERR_STREAM_DESTROYED which occur when the HTTP response stream is closed by the client while the server is still writing to it. function isClientDisconnectError(error) { if (!(error instanceof Error)) { return false; const code = error.code; return (code === "ERR_STREAM_DESTROYED" || code === "ERR_STREAM_PREMATURE_CLOSE" || code === "ECONNRESET" || code === "EPIPE"); ;// ../proto/dist/generated/aiserver/v1/mcp_pb.js // @ts-nocheck
3452
+ message McpOAuthStoredData {
3453
+ string refresh_token = 1;
3454
+ string client_id = 2;
3455
+ optional string client_secret = 3;
3456
+ repeated string redirect_uris = 4;
3457
+ }
3458
+
3459
+ message Frame {
3460
+ // Correlation ID
3461
+ string id = 1;
3462
+ // RPC method (e.g., "/agent.v1.ControlService/Ping")
3463
+ string method = 2;
3464
+ // Serialized payload
3465
+ bytes data = 3;
3466
+ int32 kind = 4;
3467
+ // Error message (kind == ERROR)
3468
+ string error = 5;
3469
+ }
3470
+
3471
+ // var Frame_Kind; (function (Frame_Kind) { Frame_Kind[Frame_Kind["UNSPECIFIED"] = 0] = "UNSPECIFIED"; Frame_Kind[Frame_Kind["REQUEST"] = 1] = "REQUEST"; Frame_Kind[Frame_Kind["RESPONSE"] = 2] = "RESPONSE"; Frame_Kind[Frame_Kind["ERROR"] = 3] = "ERROR"; })(Frame_Kind || (Frame_Kind = {})); // Retrieve enum metadata with: proto3.getEnumType(Frame_Kind) proto3/* int32 */.C.util.setEnumType(Frame_Kind, "agent.v1.Frame.Kind", [ { no: 0, name: "KIND_UNSPECIFIED" }, { no: 1, name: "KIND_REQUEST" }, { no: 2, name: "KIND_RESPONSE" }, { no: 3, name: "KIND_ERROR" }, ]);
3472
+ message Empty {
3473
+ }
3474
+
3475
+ message BidiRequestId {
3476
+ string request_id = 1;
3477
+ }
3478
+
3479
+ // Agent Service with bidirectional streaming
3480
+ service AgentService {
3481
+ rpc Run(AgentClientMessage) returns (AgentServerMessage);
3482
+ rpc RunSSE(BidiRequestId) returns (AgentServerMessage);
3483
+ // Generate a very short, succinct agent name from the provided user message.
3484
+ rpc NameAgent(NameAgentRequest) returns (NameAgentResponse);
3485
+ rpc GetUsableModels(GetUsableModelsRequest) returns (GetUsableModelsResponse);
3486
+ rpc GetDefaultModelForCli(GetDefaultModelForCliRequest) returns (GetDefaultModelForCliResponse);
3487
+ // Internal endpoint: returns all allowed model intents for devs
3488
+ rpc GetAllowedModelIntents(GetAllowedModelIntentsRequest) returns (GetAllowedModelIntentsResponse);
3489
+ }
3490
+
3491
+ service ControlService {
3492
+ // Spawn
3493
+ // File read / write
3494
+ rpc ReadTextFile(ReadTextFileRequest) returns (ReadTextFileResponse);
3495
+ rpc WriteTextFile(WriteTextFileRequest) returns (WriteTextFileResponse);
3496
+ // Binary file read / write
3497
+ rpc ReadBinaryFile(ReadBinaryFileRequest) returns (ReadBinaryFileResponse);
3498
+ rpc WriteBinaryFile(WriteBinaryFileRequest) returns (WriteBinaryFileResponse);
3499
+ // Git
3500
+ rpc GetWorkspaceChangesHash(GetWorkspaceChangesHashRequest) returns (GetWorkspaceChangesHashResponse);
3501
+ rpc RefreshGithubAccessToken(RefreshGithubAccessTokenRequest) returns (RefreshGithubAccessTokenResponse);
3502
+ // Remote access
3503
+ rpc WarmRemoteAccessServer(WarmRemoteAccessServerRequest) returns (WarmRemoteAccessServerResponse);
3504
+ // Artifact uploads
3505
+ rpc ListArtifacts(ListArtifactsRequest) returns (ListArtifactsResponse);
3506
+ rpc UploadArtifacts(UploadArtifactsRequest) returns (UploadArtifactsResponse);
3507
+ rpc GetMcpRefreshTokens(GetMcpRefreshTokensRequest) returns (GetMcpRefreshTokensResponse);
3508
+ // Update the exec-daemon's environment variables for subsequent process spawns. This does NOT affect already-running processes.
3509
+ rpc UpdateEnvironmentVariables(UpdateEnvironmentVariablesRequest) returns (UpdateEnvironmentVariablesResponse);
3510
+ }
3511
+
3512
+ // Agent Service with unary RPC
3513
+ service ExecService {
3514
+ }
3515
+
3516
+ service PrivateWorkerBridgeExternalService {
3517
+ rpc Connect(Frame) returns (Frame);
3518
+ }
3519
+
3520
+ // LifecycleService is exposed by the bridge *client*, in addition to ExecService (tool calls) and ControlService (control operations "within the daemon"). It operates at a similar abstraction level as AnyrunService: it represents operations similar to creating a VM, checking out a repository, etc.
3521
+ service LifecycleService {
3522
+ // Resets a long-lived worker
3523
+ rpc ResetInstance(Empty) returns (Empty);
3524
+ // Asks worker to exit(0) so that a new worker can take his place
3525
+ rpc RenewInstance(Empty) returns (Empty);
3526
+ }