@ilbie/capybara-code-darwin-arm64 0.1.0-alpha.3

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,711 @@
1
+ {
2
+ "x-dialect": "json-schema-draft-2020-12",
3
+ "$id": "cbc:protocol/rpc",
4
+ "title": "Capybara Code runtime RPC",
5
+ "description": "PRD 20.1-20.5. Source of truth for the framed JSON-RPC boundary between the TypeScript control plane and the Rust runtime. packages/protocol-ts/src/rpc.ts and crates/cbc-protocol/src/{methods,limits,jsonrpc}.rs must agree with this file; scripts/check-protocol-drift.ts enforces that. Every reference is local, because 19.9 forbids the build from depending on a network fetch.",
6
+ "type": "object",
7
+ "$defs": {
8
+ "protocolVersion": {
9
+ "description": "19.12: independent of the product version. A differing major refuses to run.",
10
+ "type": "string",
11
+ "pattern": "^\\d+(\\.\\d+)?$",
12
+ "const": "1.0"
13
+ },
14
+ "limits": {
15
+ "description": "20.4 message and rate limits. Enforced by the runtime independently of anything the client claims (19.7).",
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": [
19
+ "maxFrameBytes",
20
+ "maxJsonDepth",
21
+ "maxStringBytes",
22
+ "maxEventPayloadBytes",
23
+ "maxOutstandingRequests",
24
+ "lengthPrefixBytes"
25
+ ],
26
+ "properties": {
27
+ "maxFrameBytes": {
28
+ "type": "integer",
29
+ "const": 8388608
30
+ },
31
+ "maxJsonDepth": {
32
+ "type": "integer",
33
+ "const": 64
34
+ },
35
+ "maxStringBytes": {
36
+ "type": "integer",
37
+ "const": 4194304
38
+ },
39
+ "maxEventPayloadBytes": {
40
+ "type": "integer",
41
+ "const": 1048576
42
+ },
43
+ "maxOutstandingRequests": {
44
+ "type": "integer",
45
+ "const": 128
46
+ },
47
+ "lengthPrefixBytes": {
48
+ "type": "integer",
49
+ "const": 4
50
+ }
51
+ }
52
+ },
53
+ "heartbeat": {
54
+ "description": "20.5 liveness thresholds, in milliseconds.",
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": [
58
+ "intervalMs",
59
+ "degradedMs",
60
+ "fatalMs"
61
+ ],
62
+ "properties": {
63
+ "intervalMs": {
64
+ "type": "integer",
65
+ "const": 5000
66
+ },
67
+ "degradedMs": {
68
+ "type": "integer",
69
+ "const": 15000
70
+ },
71
+ "fatalMs": {
72
+ "type": "integer",
73
+ "const": 30000
74
+ }
75
+ }
76
+ },
77
+ "readMaxLines": {
78
+ "description": "Default maximum line count for fs.read and legacy fs.read_many requests.",
79
+ "type": "integer",
80
+ "const": 400,
81
+ "default": 400
82
+ },
83
+ "readMode": {
84
+ "type": "string",
85
+ "enum": [
86
+ "preview",
87
+ "exact"
88
+ ]
89
+ },
90
+ "interactionMode": {
91
+ "description": "Live runtime interaction ceiling. Plan is read-only and must be entered only after quiescence.",
92
+ "type": "string",
93
+ "enum": [
94
+ "build",
95
+ "plan"
96
+ ]
97
+ },
98
+ "readRequest": {
99
+ "type": "object",
100
+ "additionalProperties": true,
101
+ "required": [
102
+ "path"
103
+ ],
104
+ "properties": {
105
+ "path": {
106
+ "type": "string"
107
+ },
108
+ "startLine": {
109
+ "type": "integer",
110
+ "minimum": 1
111
+ },
112
+ "maxLines": {
113
+ "type": "integer",
114
+ "minimum": 1,
115
+ "maximum": 5000,
116
+ "default": 400
117
+ },
118
+ "mode": {
119
+ "$ref": "#/$defs/readMode",
120
+ "default": "exact"
121
+ },
122
+ "maxBytes": {
123
+ "type": "integer",
124
+ "minimum": 1
125
+ }
126
+ }
127
+ },
128
+ "readExcerpt": {
129
+ "type": "object",
130
+ "additionalProperties": true,
131
+ "required": [
132
+ "startLine",
133
+ "endLine",
134
+ "endOfFile",
135
+ "text",
136
+ "truncatedByBytes"
137
+ ],
138
+ "properties": {
139
+ "path": {
140
+ "type": "string"
141
+ },
142
+ "checksum": {
143
+ "type": "string"
144
+ },
145
+ "startLine": {
146
+ "type": "integer",
147
+ "minimum": 1
148
+ },
149
+ "endLine": {
150
+ "type": "integer",
151
+ "minimum": 1
152
+ },
153
+ "totalLines": {
154
+ "type": "integer",
155
+ "minimum": 0
156
+ },
157
+ "endOfFile": {
158
+ "type": "boolean"
159
+ },
160
+ "text": {
161
+ "type": "string"
162
+ },
163
+ "partial": {
164
+ "type": "boolean"
165
+ },
166
+ "omittedBefore": {
167
+ "type": "integer",
168
+ "minimum": 0
169
+ },
170
+ "omittedAfter": {
171
+ "type": "integer",
172
+ "minimum": 0
173
+ },
174
+ "truncatedByBytes": {
175
+ "type": "boolean"
176
+ }
177
+ }
178
+ },
179
+ "readResponse": {
180
+ "type": "object",
181
+ "additionalProperties": true,
182
+ "required": [
183
+ "path",
184
+ "mode",
185
+ "revisionToken",
186
+ "authoritativeForWrite",
187
+ "excerpt"
188
+ ],
189
+ "properties": {
190
+ "path": {
191
+ "type": "string"
192
+ },
193
+ "mode": {
194
+ "$ref": "#/$defs/readMode"
195
+ },
196
+ "revisionToken": {
197
+ "type": "string",
198
+ "minLength": 1
199
+ },
200
+ "checksum": {
201
+ "type": "string"
202
+ },
203
+ "authoritativeForWrite": {
204
+ "type": "boolean"
205
+ },
206
+ "excerpt": {
207
+ "$ref": "#/$defs/readExcerpt"
208
+ },
209
+ "truncatedByBytes": {
210
+ "type": "boolean"
211
+ }
212
+ }
213
+ },
214
+ "readManyRequest": {
215
+ "type": "object",
216
+ "additionalProperties": true,
217
+ "anyOf": [
218
+ {
219
+ "required": [
220
+ "items"
221
+ ]
222
+ },
223
+ {
224
+ "required": [
225
+ "paths"
226
+ ]
227
+ }
228
+ ],
229
+ "properties": {
230
+ "items": {
231
+ "type": "array",
232
+ "minItems": 1,
233
+ "items": {
234
+ "$ref": "#/$defs/readRequest"
235
+ }
236
+ },
237
+ "paths": {
238
+ "type": "array",
239
+ "minItems": 1,
240
+ "items": {
241
+ "type": "string"
242
+ }
243
+ },
244
+ "maxLines": {
245
+ "type": "integer",
246
+ "minimum": 1,
247
+ "maximum": 5000,
248
+ "default": 400
249
+ },
250
+ "maxTotalLines": {
251
+ "type": "integer",
252
+ "minimum": 1
253
+ },
254
+ "maxTotalBytes": {
255
+ "type": "integer",
256
+ "minimum": 1
257
+ },
258
+ "concurrency": {
259
+ "type": "integer",
260
+ "minimum": 1,
261
+ "maximum": 8,
262
+ "default": 4
263
+ },
264
+ "limit": {
265
+ "type": "integer",
266
+ "minimum": 1,
267
+ "maximum": 50,
268
+ "default": 20
269
+ }
270
+ }
271
+ },
272
+ "fingerprintRequest": {
273
+ "type": "object",
274
+ "additionalProperties": true,
275
+ "required": [
276
+ "path"
277
+ ],
278
+ "properties": {
279
+ "path": {
280
+ "type": "string"
281
+ },
282
+ "includeChecksum": {
283
+ "type": "boolean",
284
+ "default": false
285
+ }
286
+ }
287
+ },
288
+ "fingerprintResponse": {
289
+ "type": "object",
290
+ "additionalProperties": true,
291
+ "required": [
292
+ "path",
293
+ "revisionToken",
294
+ "fingerprint",
295
+ "bytes"
296
+ ],
297
+ "properties": {
298
+ "path": {
299
+ "type": "string"
300
+ },
301
+ "revisionToken": {
302
+ "type": "string",
303
+ "minLength": 1
304
+ },
305
+ "fingerprint": {
306
+ "type": "string",
307
+ "minLength": 1
308
+ },
309
+ "bytes": {
310
+ "type": "integer",
311
+ "minimum": 0
312
+ },
313
+ "checksum": {
314
+ "type": "string"
315
+ }
316
+ }
317
+ },
318
+ "requestMethod": {
319
+ "description": "20.3 TypeScript to Rust requests, in PRD declaration order.",
320
+ "type": "string",
321
+ "enum": [
322
+ "runtime.initialize",
323
+ "runtime.capabilities",
324
+ "runtime.shutdown",
325
+ "runtime.cancel",
326
+ "runtime.capability.issue",
327
+ "workspace.inspect",
328
+ "workspace.mode.write",
329
+ "workspace.trust.read",
330
+ "workspace.trust.write",
331
+ "workspace.trust.list",
332
+ "workspace.trust.set",
333
+ "workspace.trust.remove",
334
+ "fs.list",
335
+ "fs.glob",
336
+ "fs.search",
337
+ "fs.read",
338
+ "fs.read_many",
339
+ "fs.fingerprint",
340
+ "fs.transaction.begin",
341
+ "fs.patch",
342
+ "fs.write",
343
+ "fs.move",
344
+ "fs.delete",
345
+ "fs.transaction.commit",
346
+ "fs.transaction.rollback",
347
+ "fs.transaction.rollback_to_checkpoint",
348
+ "process.run",
349
+ "process.start",
350
+ "process.input",
351
+ "process.stop",
352
+ "process.status",
353
+ "git.status",
354
+ "git.diff",
355
+ "git.log",
356
+ "git.show",
357
+ "git.checkpoint",
358
+ "credential.store",
359
+ "credential.lease",
360
+ "credential.delete",
361
+ "session.open",
362
+ "session.append",
363
+ "session.snapshot",
364
+ "session.load",
365
+ "session.list",
366
+ "session.resolve",
367
+ "session.set_status",
368
+ "session.export",
369
+ "session.fork",
370
+ "session.delete",
371
+ "artifact.create",
372
+ "artifact.read",
373
+ "artifact.delete",
374
+ "update.verify"
375
+ ]
376
+ },
377
+ "notificationMethod": {
378
+ "description": "20.3 Rust to TypeScript notifications, in PRD declaration order. 20.4 requires consumers to tolerate an unknown method for forward compatibility, so this enum constrains what the runtime may emit rather than what a client must accept.",
379
+ "type": "string",
380
+ "enum": [
381
+ "runtime.heartbeat",
382
+ "process.output",
383
+ "process.exited",
384
+ "process.limit_warning",
385
+ "workspace.changed",
386
+ "transaction.conflict",
387
+ "journal.committed",
388
+ "artifact.spilled",
389
+ "sandbox.degraded",
390
+ "runtime.warning",
391
+ "runtime.fatal"
392
+ ]
393
+ },
394
+ "preInitializeMethod": {
395
+ "description": "Methods callable before runtime.initialize succeeds.",
396
+ "type": "string",
397
+ "enum": [
398
+ "runtime.initialize",
399
+ "runtime.shutdown"
400
+ ]
401
+ },
402
+ "mutatingMethod": {
403
+ "description": "Methods that mutate the workspace. The runtime revalidates the write lease and the path guard for each of these regardless of any client-side approval (19.7).",
404
+ "type": "string",
405
+ "enum": [
406
+ "fs.patch",
407
+ "fs.write",
408
+ "fs.move",
409
+ "fs.delete",
410
+ "fs.transaction.rollback_to_checkpoint",
411
+ "git.checkpoint"
412
+ ]
413
+ },
414
+ "toolErrorCode": {
415
+ "description": "12.10 tool error taxonomy. Every failure the model observes maps to exactly one of these.",
416
+ "type": "string",
417
+ "enum": [
418
+ "INVALID_ARGUMENT",
419
+ "PATH_OUTSIDE_WORKSPACE",
420
+ "PATH_CHANGED",
421
+ "HASH_MISMATCH",
422
+ "PERMISSION_DENIED",
423
+ "APPROVAL_DENIED",
424
+ "NOT_FOUND",
425
+ "ALREADY_EXISTS",
426
+ "UNSUPPORTED_ENCODING",
427
+ "OUTPUT_LIMIT",
428
+ "TIMEOUT",
429
+ "CANCELLED",
430
+ "PROCESS_EXIT_NONZERO",
431
+ "SANDBOX_UNAVAILABLE",
432
+ "NETWORK_DENIED",
433
+ "MCP_UNAVAILABLE",
434
+ "TRANSACTION_CONFLICT",
435
+ "PROTOCOL_INCOMPATIBLE",
436
+ "LEASE_VIOLATION",
437
+ "RESOURCE_LIMIT",
438
+ "NOT_INITIALIZED",
439
+ "TOO_MANY_REQUESTS",
440
+ "INTERNAL"
441
+ ]
442
+ },
443
+ "errorCodes": {
444
+ "description": "JSON-RPC error codes. -32700 to -32603 are the standard set; -32000 and below are Capybara-specific and each maps to a taxonomy entry via codeToTaxonomy.",
445
+ "type": "object",
446
+ "additionalProperties": false,
447
+ "required": [
448
+ "parseError",
449
+ "invalidRequest",
450
+ "methodNotFound",
451
+ "invalidParams",
452
+ "internalError",
453
+ "pathOutsideWorkspace",
454
+ "hashMismatch",
455
+ "pathChanged",
456
+ "notFound",
457
+ "alreadyExists",
458
+ "unsupportedEncoding",
459
+ "outputLimit",
460
+ "timeout",
461
+ "cancelled",
462
+ "processExitNonzero",
463
+ "sandboxUnavailable",
464
+ "networkDenied",
465
+ "transactionConflict",
466
+ "protocolIncompatible",
467
+ "leaseViolation",
468
+ "resourceLimit",
469
+ "notInitialized",
470
+ "tooManyRequests",
471
+ "invalidArgument",
472
+ "permissionDenied"
473
+ ],
474
+ "properties": {
475
+ "parseError": {
476
+ "type": "integer",
477
+ "const": -32700
478
+ },
479
+ "invalidRequest": {
480
+ "type": "integer",
481
+ "const": -32600
482
+ },
483
+ "methodNotFound": {
484
+ "type": "integer",
485
+ "const": -32601
486
+ },
487
+ "invalidParams": {
488
+ "type": "integer",
489
+ "const": -32602
490
+ },
491
+ "internalError": {
492
+ "type": "integer",
493
+ "const": -32603
494
+ },
495
+ "pathOutsideWorkspace": {
496
+ "type": "integer",
497
+ "const": -32000
498
+ },
499
+ "hashMismatch": {
500
+ "type": "integer",
501
+ "const": -32001
502
+ },
503
+ "pathChanged": {
504
+ "type": "integer",
505
+ "const": -32002
506
+ },
507
+ "notFound": {
508
+ "type": "integer",
509
+ "const": -32003
510
+ },
511
+ "alreadyExists": {
512
+ "type": "integer",
513
+ "const": -32004
514
+ },
515
+ "unsupportedEncoding": {
516
+ "type": "integer",
517
+ "const": -32005
518
+ },
519
+ "outputLimit": {
520
+ "type": "integer",
521
+ "const": -32006
522
+ },
523
+ "timeout": {
524
+ "type": "integer",
525
+ "const": -32007
526
+ },
527
+ "cancelled": {
528
+ "type": "integer",
529
+ "const": -32008
530
+ },
531
+ "processExitNonzero": {
532
+ "type": "integer",
533
+ "const": -32009
534
+ },
535
+ "sandboxUnavailable": {
536
+ "type": "integer",
537
+ "const": -32010
538
+ },
539
+ "networkDenied": {
540
+ "type": "integer",
541
+ "const": -32011
542
+ },
543
+ "transactionConflict": {
544
+ "type": "integer",
545
+ "const": -32012
546
+ },
547
+ "protocolIncompatible": {
548
+ "type": "integer",
549
+ "const": -32013
550
+ },
551
+ "leaseViolation": {
552
+ "type": "integer",
553
+ "const": -32014
554
+ },
555
+ "resourceLimit": {
556
+ "type": "integer",
557
+ "const": -32015
558
+ },
559
+ "notInitialized": {
560
+ "type": "integer",
561
+ "const": -32016
562
+ },
563
+ "tooManyRequests": {
564
+ "type": "integer",
565
+ "const": -32017
566
+ },
567
+ "invalidArgument": {
568
+ "type": "integer",
569
+ "const": -32018
570
+ },
571
+ "permissionDenied": {
572
+ "type": "integer",
573
+ "const": -32019
574
+ }
575
+ }
576
+ },
577
+ "request": {
578
+ "type": "object",
579
+ "additionalProperties": false,
580
+ "required": [
581
+ "jsonrpc",
582
+ "id",
583
+ "method"
584
+ ],
585
+ "properties": {
586
+ "jsonrpc": {
587
+ "const": "2.0"
588
+ },
589
+ "id": {
590
+ "type": [
591
+ "integer",
592
+ "string"
593
+ ]
594
+ },
595
+ "method": {
596
+ "$ref": "#/$defs/requestMethod"
597
+ },
598
+ "params": true
599
+ }
600
+ },
601
+ "errorBody": {
602
+ "type": "object",
603
+ "additionalProperties": false,
604
+ "required": [
605
+ "code",
606
+ "message"
607
+ ],
608
+ "properties": {
609
+ "code": {
610
+ "type": "integer"
611
+ },
612
+ "message": {
613
+ "type": "string"
614
+ },
615
+ "data": {
616
+ "type": "object",
617
+ "properties": {
618
+ "taxonomy": {
619
+ "$ref": "#/$defs/toolErrorCode"
620
+ }
621
+ }
622
+ }
623
+ }
624
+ },
625
+ "response": {
626
+ "type": "object",
627
+ "additionalProperties": false,
628
+ "required": [
629
+ "jsonrpc",
630
+ "id"
631
+ ],
632
+ "properties": {
633
+ "jsonrpc": {
634
+ "const": "2.0"
635
+ },
636
+ "id": {
637
+ "type": [
638
+ "integer",
639
+ "string"
640
+ ]
641
+ },
642
+ "result": true,
643
+ "error": {
644
+ "$ref": "#/$defs/errorBody"
645
+ }
646
+ }
647
+ },
648
+ "notification": {
649
+ "type": "object",
650
+ "additionalProperties": false,
651
+ "required": [
652
+ "jsonrpc",
653
+ "method"
654
+ ],
655
+ "properties": {
656
+ "jsonrpc": {
657
+ "const": "2.0"
658
+ },
659
+ "method": {
660
+ "type": "string"
661
+ },
662
+ "params": true
663
+ }
664
+ },
665
+ "workspaceModeWriteRequest": {
666
+ "type": "object",
667
+ "additionalProperties": false,
668
+ "required": [
669
+ "mode"
670
+ ],
671
+ "properties": {
672
+ "mode": {
673
+ "$ref": "#/$defs/interactionMode"
674
+ }
675
+ }
676
+ },
677
+ "workspaceModeWriteResult": {
678
+ "type": "object",
679
+ "additionalProperties": false,
680
+ "required": [
681
+ "mode",
682
+ "changed"
683
+ ],
684
+ "properties": {
685
+ "mode": {
686
+ "$ref": "#/$defs/interactionMode"
687
+ },
688
+ "previousMode": {
689
+ "$ref": "#/$defs/interactionMode"
690
+ },
691
+ "changed": {
692
+ "type": "boolean"
693
+ },
694
+ "quiescent": {
695
+ "type": "boolean"
696
+ }
697
+ }
698
+ }
699
+ },
700
+ "oneOf": [
701
+ {
702
+ "$ref": "#/$defs/request"
703
+ },
704
+ {
705
+ "$ref": "#/$defs/response"
706
+ },
707
+ {
708
+ "$ref": "#/$defs/notification"
709
+ }
710
+ ]
711
+ }