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2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
syntax = "proto3";

package warp.multi_agent.v1;

import "google/protobuf/empty.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/struct.proto";
import "citations.proto";
import "input_context.proto";
import "attachment.proto";
import "file_content.proto";
import "options.proto";
import "todo.proto";

option go_package = "github.com/warp/warp-proto-apis/multi_agent/v1";

message Task {
    string id = 1;
    string description = 2;
    
    Dependencies dependencies = 3;
    message Dependencies {
        string parent_task_id = 1;
        repeated string sibling_dependencies = 2;
    }
    
    TaskStatus status = 4;
    repeated Message messages = 5;
    string summary = 6;
}

message TaskStatus {
    oneof status {
        Pending pending = 1;
        InProgress in_progress = 2;
        Blocked blocked = 3;
        Succeeded succeeded = 4;
        Failed failed = 5;
        Aborted aborted = 6;
    }
    
    message Pending {
        
    }
    
    message InProgress {
        
    }
    
    message Blocked {
        
    }
    
    message Succeeded {
        
    }
    
    message Failed {
        
    }
    
    message Aborted {
        
    }
}

message Message {
    string id = 1;
    string task_id = 11;
    string server_message_data = 7;
    repeated Citation citations = 8;
    
    oneof message {
        UserQuery user_query = 2;
        AgentOutput agent_output = 3;
        ToolCall tool_call = 4;
        ToolCallResult tool_call_result = 5;
        ServerEvent server_event = 6;
        SystemQuery system_query = 9;
        UpdateTodos update_todos = 10;
    }
    
    message UserQuery {
        string query = 1;
        InputContext context = 2;
        map<string, Attachment> referenced_attachments = 3;
    }
    
    message SystemQuery {
        InputContext context = 2;
        
        oneof type {
            AutoCodeDiff auto_code_diff = 1;
            ResumeConversation resume_conversation = 3;
        }
    }
    
    message AutoCodeDiff {
        string query = 1;
    }
    
    message ResumeConversation {
        
    }
    
    message AgentOutput {
        string text = 1;
        string reasoning = 2;
    }
    
    message ToolCall {
        string tool_call_id = 1;
        
        oneof tool {
            RunShellCommand run_shell_command = 2;
            SearchCodebase search_codebase = 3;
            Server server = 4;
            ReadFiles read_files = 5;
            ApplyFileDiffs apply_file_diffs = 6;
            SuggestPlan suggest_plan = 7;
            SuggestCreatePlan suggest_create_plan = 8;
            Grep grep = 9;
            FileGlob file_glob = 10 [deprecated = true];
            ReadMCPResource read_mcp_resource = 11;
            CallMCPTool call_mcp_tool = 12;
            WriteToLongRunningShellCommand write_to_long_running_shell_command = 13;
            SuggestNewConversation suggest_new_conversation = 14;
            FileGlobV2 file_glob_v2 = 15;
        }
        
        message Server {
            string payload = 1;
        }
        
        message RunShellCommand {
            string command = 1;
            bool is_read_only = 2;
            bool uses_pager = 3;
            repeated Citation citations = 4;
            bool is_risky = 5;
        }
        
        message WriteToLongRunningShellCommand {
            bytes input = 1;
        }
        
        message SuggestNewConversation {
            string message_id = 1;
        }
        
        message ReadFiles {
            repeated File files = 1;
            message File {
                string name = 1;
                repeated FileContentLineRange line_ranges = 2;
            }
        }
        
        message SearchCodebase {
            string query = 1;
            repeated string path_filters = 2;
            string codebase_path = 3;
        }
        
        message ApplyFileDiffs {
            string summary = 1;
            
            repeated FileDiff diffs = 2;
            message FileDiff {
                string file_path = 1;
                string search = 2;
                string replace = 3;
            }
            
            repeated NewFile new_files = 3;
            message NewFile {
                string file_path = 1;
                string content = 2;
            }
        }
        
        message SuggestPlan {
            string summary = 1;
            repeated Task proposed_tasks = 2;
        }
        
        message SuggestCreatePlan {
            
        }
        
        message Grep {
            repeated string queries = 1;
            string path = 2;
        }
        
        message FileGlob {
            repeated string patterns = 1;
            string path = 2;
        }
        
        message FileGlobV2 {
            repeated string patterns = 1;
            string search_dir = 2;
            int32 max_matches = 3;
            int32 max_depth = 4;
            int32 min_depth = 5;
        }
        
        message ReadMCPResource {
            string uri = 1;
        }
        
        message CallMCPTool {
            string name = 1;
            google.protobuf.Struct args = 2;
        }
    }
    
    message ToolCallResult {
        string tool_call_id = 1;
        InputContext context = 11;
        
        oneof result {
            RunShellCommandResult run_shell_command = 2;
            SearchCodebaseResult search_codebase = 3;
            ServerResult server = 4;
            ReadFilesResult read_files = 5;
            ApplyFileDiffsResult apply_file_diffs = 6;
            SuggestPlanResult suggest_plan = 7;
            SuggestCreatePlanResult suggest_create_plan = 8;
            GrepResult grep = 9;
            FileGlobResult file_glob = 10 [deprecated = true];
            RefineResult refine = 13;
            google.protobuf.Empty cancel = 14;
            ReadMCPResourceResult read_mcp_resource = 15;
            CallMCPToolResult call_mcp_tool = 16;
            WriteToLongRunningShellCommandResult write_to_long_running_shell_command = 17;
            SuggestNewConversationResult suggest_new_conversation = 18;
            FileGlobV2Result file_glob_v2 = 19;
        }
        
        message ServerResult {
            string serialized_result = 1;
        }
        
        message RefineResult {
            UserQuery user_query = 1;
        }
    }
    
    message ServerEvent {
        string payload = 1;
    }
    
    message UpdateTodos {
        oneof operation {
            CreateTodoList create_todo_list = 1;
            UpdatePendingTodos update_pending_todos = 2;
            MarkTodosCompleted mark_todos_completed = 3;
        }
    }
}

message RunShellCommandResult {
    string command = 3;
    string output = 1 [deprecated = true];
    int32 exit_code = 2 [deprecated = true];
    
    oneof result {
        LongRunningShellCommandSnapshot long_running_command_snapshot = 4;
        ShellCommandFinished command_finished = 5;
    }
}

message ReadFilesResult {
    oneof result {
        Success success = 1;
        Error error = 2;
    }
    
    message Success {
        repeated FileContent files = 1;
    }
    
    message Error {
        string message = 1;
    }
}

message SearchCodebaseResult {
    oneof result {
        Success success = 1;
        Error error = 2;
    }
    
    message Success {
        repeated FileContent files = 1;
    }
    
    message Error {
        string message = 1;
    }
}

message ApplyFileDiffsResult {
    oneof result {
        Success success = 1;
        Error error = 2;
    }
    
    message Success {
        repeated FileContent updated_files = 1 [deprecated = true];
        
        repeated UpdatedFileContent updated_files_v2 = 2;
        message UpdatedFileContent {
            FileContent file = 1;
            bool was_edited_by_user = 2;
        }
    }
    
    message Error {
        string message = 1;
    }
}

message SuggestCreatePlanResult {
    bool accepted = 1;
}

message SuggestPlanResult {
    oneof result {
        google.protobuf.Empty accepted = 1;
        UserEditedPlan user_edited_plan = 2;
    }
    
    message UserEditedPlan {
        string plan_text = 1;
    }
}

message GrepResult {
    oneof result {
        Success success = 1;
        Error error = 2;
    }
    
    message Success {
        repeated GrepFileMatch matched_files = 1;
        message GrepFileMatch {
            string file_path = 1;
            
            repeated GrepLineMatch matched_lines = 2;
            message GrepLineMatch {
                uint32 line_number = 1;
            }
        }
    }
    
    message Error {
        string message = 1;
    }
}

message FileGlobResult {
    oneof result {
        Success success = 1;
        Error error = 2;
    }
    
    message Success {
        string matched_files = 1;
    }
    
    message Error {
        string message = 1;
    }
}

message FileGlobV2Result {
    oneof result {
        Success success = 1;
        Error error = 2;
    }
    
    message Success {
        repeated FileGlobMatch matched_files = 1;
        message FileGlobMatch {
            string file_path = 1;
        }
    }
    
    message Error {
        string message = 1;
    }
}

message MCPResourceContent {
    string uri = 1;
    
    oneof content_type {
        Text text = 2;
        Binary binary = 3;
    }
    
    message Text {
        string content = 1;
        string mime_type = 2;
    }
    
    message Binary {
        bytes data = 1;
        string mime_type = 2;
    }
}

message ReadMCPResourceResult {
    oneof result {
        Success success = 1;
        Error error = 2;
    }
    
    message Success {
        repeated MCPResourceContent contents = 1;
    }
    
    message Error {
        string message = 1;
    }
}

message WriteToLongRunningShellCommandResult {
    oneof result {
        LongRunningShellCommandSnapshot long_running_command_snapshot = 1;
        ShellCommandFinished command_finished = 2;
    }
}

message SuggestNewConversationResult {
    oneof result {
        Accepted accepted = 1;
        Rejected rejected = 2;
    }
    
    message Accepted {
        string message_id = 1;
    }
    
    message Rejected {
        
    }
}

message ShellCommandFinished {
    string output = 1;
    int32 exit_code = 2;
}

message CallMCPToolResult {
    oneof result {
        Success success = 1;
        Error error = 2;
    }
    
    message Success {
        repeated Result results = 1;
        message Result {
            oneof result {
                Text text = 1;
                Image image = 2;
                MCPResourceContent resource = 3;
            }
            
            message Text {
                string text = 1;
            }
            
            message Image {
                bytes data = 1;
                string mime_type = 2;
            }
        }
    }
    
    message Error {
        string message = 1;
    }
}

enum ToolType {
    RUN_SHELL_COMMAND = 0;
    SEARCH_CODEBASE = 1;
    READ_FILES = 2;
    APPLY_FILE_DIFFS = 3;
    SUGGEST_PLAN = 4;
    SUGGEST_CREATE_PLAN = 5;
    GREP = 6;
    FILE_GLOB = 7;
    READ_MCP_RESOURCE = 8;
    CALL_MCP_TOOL = 9;
    WRITE_TO_LONG_RUNNING_SHELL_COMMAND = 10;
    SUGGEST_NEW_CONVERSATION = 11;
    FILE_GLOB_V2 = 12;
}