@drisp/protocol 0.6.0 → 0.6.2

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.
package/package.json CHANGED
@@ -1,53 +1,58 @@
1
1
  {
2
- "name": "@drisp/protocol",
3
- "version": "0.6.0",
4
- "description": "Wire contract between a drisp runner and the hub: zod schemas, inferred types, and JSON Schema for the instance-socket frames, Run, Turn, Interruption, and the event stream",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/drisplabs/cli.git",
8
- "directory": "packages/protocol"
9
- },
10
- "homepage": "https://github.com/drisplabs/cli/tree/main/packages/protocol#readme",
11
- "bugs": {
12
- "url": "https://github.com/drisplabs/cli/issues"
13
- },
14
- "keywords": [
15
- "drisp",
16
- "protocol",
17
- "zod",
18
- "json-schema"
19
- ],
20
- "license": "MIT",
21
- "type": "module",
22
- "engines": {
23
- "node": ">=20"
24
- },
25
- "publishConfig": {
26
- "access": "public"
27
- },
28
- "exports": {
29
- ".": {
30
- "source": "./src/index.ts",
31
- "types": "./dist/index.d.ts",
32
- "import": "./dist/index.js"
33
- },
34
- "./schema/*.json": "./schema/*.json",
35
- "./package.json": "./package.json"
36
- },
37
- "main": "./dist/index.js",
38
- "types": "./dist/index.d.ts",
39
- "files": [
40
- "dist",
41
- "!dist/**/*.js.map",
42
- "schema"
43
- ],
44
- "scripts": {
45
- "build": "tsup",
46
- "typecheck": "tsc --noEmit",
47
- "schema:generate": "vite-node scripts/generate-schema.ts",
48
- "prepublishOnly": "npm run build"
49
- },
50
- "dependencies": {
51
- "zod": "^4.3.6"
52
- }
2
+ "name": "@drisp/protocol",
3
+ "version": "0.6.2",
4
+ "description": "Wire contract between a drisp runner and the hub: zod schemas, inferred types, and JSON Schema for the instance-socket frames, Run, Turn, Interruption, and the event stream",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/drisplabs/cli.git",
8
+ "directory": "packages/protocol"
9
+ },
10
+ "homepage": "https://github.com/drisplabs/cli/tree/main/packages/protocol#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/drisplabs/cli/issues"
13
+ },
14
+ "keywords": [
15
+ "drisp",
16
+ "protocol",
17
+ "zod",
18
+ "json-schema"
19
+ ],
20
+ "license": "MIT",
21
+ "type": "module",
22
+ "engines": {
23
+ "node": ">=22"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "exports": {
29
+ ".": {
30
+ "source": "./src/index.ts",
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ },
34
+ "./schema/*.json": "./schema/*.json",
35
+ "./package.json": "./package.json",
36
+ "./v2": {
37
+ "source": "./src/v2.ts",
38
+ "types": "./dist/v2.d.ts",
39
+ "import": "./dist/v2.js"
40
+ }
41
+ },
42
+ "main": "./dist/index.js",
43
+ "types": "./dist/index.d.ts",
44
+ "files": [
45
+ "dist",
46
+ "!dist/**/*.js.map",
47
+ "schema"
48
+ ],
49
+ "scripts": {
50
+ "build": "tsup",
51
+ "typecheck": "tsc --noEmit",
52
+ "schema:generate": "vite-node scripts/generate-schema.ts",
53
+ "prepublishOnly": "npm run build"
54
+ },
55
+ "dependencies": {
56
+ "zod": "^4.3.6"
57
+ }
53
58
  }
@@ -0,0 +1,566 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "version": {
6
+ "type": "number",
7
+ "const": 1
8
+ },
9
+ "checkpointId": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "orgId": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "phase": {
18
+ "type": "string",
19
+ "enum": [
20
+ "parked",
21
+ "terminal"
22
+ ]
23
+ },
24
+ "runId": {
25
+ "type": "string",
26
+ "minLength": 1
27
+ },
28
+ "sessionId": {
29
+ "type": "string",
30
+ "minLength": 1
31
+ },
32
+ "sourceAttemptId": {
33
+ "type": "string",
34
+ "minLength": 1
35
+ },
36
+ "executionRevision": {
37
+ "type": "integer",
38
+ "exclusiveMinimum": 0,
39
+ "maximum": 9007199254740991
40
+ },
41
+ "historyProduced": {
42
+ "type": "integer",
43
+ "minimum": 0,
44
+ "maximum": 9007199254740991
45
+ },
46
+ "historyAck": {
47
+ "type": "integer",
48
+ "minimum": 0,
49
+ "maximum": 9007199254740991
50
+ },
51
+ "grant": {
52
+ "type": "object",
53
+ "properties": {
54
+ "commandId": {
55
+ "type": "string",
56
+ "minLength": 1,
57
+ "maxLength": 160
58
+ },
59
+ "hubEpoch": {
60
+ "type": "string",
61
+ "minLength": 1,
62
+ "maxLength": 160
63
+ },
64
+ "runId": {
65
+ "type": "string",
66
+ "minLength": 1,
67
+ "maxLength": 160
68
+ },
69
+ "sessionId": {
70
+ "type": "string",
71
+ "minLength": 1,
72
+ "maxLength": 160
73
+ },
74
+ "runnerId": {
75
+ "type": "string",
76
+ "minLength": 1,
77
+ "maxLength": 160
78
+ },
79
+ "installationId": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "maxLength": 160
83
+ },
84
+ "attemptId": {
85
+ "type": "string",
86
+ "minLength": 1,
87
+ "maxLength": 160
88
+ },
89
+ "generation": {
90
+ "type": "integer",
91
+ "minimum": 0,
92
+ "maximum": 9007199254740991
93
+ },
94
+ "baseExecutionRevision": {
95
+ "type": "integer",
96
+ "minimum": 0,
97
+ "maximum": 9007199254740991
98
+ },
99
+ "baseHistorySeq": {
100
+ "type": "integer",
101
+ "minimum": 0,
102
+ "maximum": 9007199254740991
103
+ },
104
+ "cloudHistoryThrough": {
105
+ "type": "integer",
106
+ "minimum": 0,
107
+ "maximum": 9007199254740991
108
+ },
109
+ "purpose": {
110
+ "type": "string",
111
+ "enum": [
112
+ "start",
113
+ "resume"
114
+ ]
115
+ },
116
+ "spec": {
117
+ "type": "object",
118
+ "properties": {
119
+ "prompt": {
120
+ "type": "string",
121
+ "minLength": 1,
122
+ "maxLength": 131072
123
+ },
124
+ "projectDir": {
125
+ "type": "string",
126
+ "minLength": 1,
127
+ "maxLength": 4096
128
+ },
129
+ "harness": {
130
+ "type": "string",
131
+ "enum": [
132
+ "claude-code",
133
+ "codex"
134
+ ]
135
+ },
136
+ "workflow": {
137
+ "anyOf": [
138
+ {
139
+ "type": "string",
140
+ "maxLength": 512
141
+ },
142
+ {
143
+ "type": "object",
144
+ "properties": {
145
+ "name": {
146
+ "type": "string",
147
+ "minLength": 1,
148
+ "maxLength": 128,
149
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*$"
150
+ },
151
+ "source": {
152
+ "type": "string",
153
+ "maxLength": 201,
154
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]*\\/[A-Za-z0-9][A-Za-z0-9_.-]*$"
155
+ },
156
+ "ref": {
157
+ "type": "string",
158
+ "minLength": 1,
159
+ "maxLength": 512
160
+ },
161
+ "version": {
162
+ "type": "string",
163
+ "minLength": 1,
164
+ "maxLength": 128,
165
+ "pattern": "^\\d[A-Za-z0-9_.+-]*$"
166
+ }
167
+ },
168
+ "required": [
169
+ "name"
170
+ ],
171
+ "additionalProperties": false
172
+ }
173
+ ]
174
+ },
175
+ "repository": {
176
+ "type": "object",
177
+ "properties": {
178
+ "bindingId": {
179
+ "type": "string",
180
+ "minLength": 1,
181
+ "maxLength": 160
182
+ },
183
+ "repositoryId": {
184
+ "type": "integer",
185
+ "exclusiveMinimum": 0,
186
+ "maximum": 9007199254740991
187
+ },
188
+ "installationId": {
189
+ "type": "integer",
190
+ "exclusiveMinimum": 0,
191
+ "maximum": 9007199254740991
192
+ },
193
+ "owner": {
194
+ "type": "string",
195
+ "minLength": 1,
196
+ "maxLength": 100,
197
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]*$"
198
+ },
199
+ "name": {
200
+ "type": "string",
201
+ "minLength": 1,
202
+ "maxLength": 100,
203
+ "pattern": "^(?!\\.{1,2}$)[a-zA-Z0-9_.-]+$"
204
+ },
205
+ "ref": {
206
+ "type": "string",
207
+ "minLength": 1,
208
+ "maxLength": 512,
209
+ "pattern": "^(?![-/])(?!.*\\.\\.)(?!.*@\\{)(?!.*(?:^|\\/)\\.)(?!.*\\.lock(?:\\/|$))(?!.*\\/\\/)[^\\x00-\\x20\\x7f~^:?*\\[\\\\]+(?<![/.])$"
210
+ },
211
+ "commitSha": {
212
+ "type": "string",
213
+ "pattern": "^[0-9a-f]{40}$"
214
+ },
215
+ "branch": {
216
+ "type": "string",
217
+ "minLength": 1,
218
+ "maxLength": 512,
219
+ "pattern": "^(?![-/])(?!.*\\.\\.)(?!.*@\\{)(?!.*(?:^|\\/)\\.)(?!.*\\.lock(?:\\/|$))(?!.*\\/\\/)[^\\x00-\\x20\\x7f~^:?*\\[\\\\]+(?<![/.])$"
220
+ },
221
+ "workingDirectory": {
222
+ "type": "string",
223
+ "minLength": 1,
224
+ "maxLength": 1024,
225
+ "pattern": "^(?:\\.|(?!\\/)(?!.*(?:^|\\/)\\.\\.?(?:\\/|$))(?!.*(?:^|\\/)\\.git(?:\\/|$))[^\\x00-\\x1f\\x7f\\\\:]+(?<!\\/))$"
226
+ },
227
+ "setupCommands": {
228
+ "maxItems": 16,
229
+ "type": "array",
230
+ "items": {
231
+ "type": "string",
232
+ "minLength": 1,
233
+ "maxLength": 8192
234
+ }
235
+ },
236
+ "configRevision": {
237
+ "type": "integer",
238
+ "minimum": 0,
239
+ "maximum": 9007199254740991
240
+ }
241
+ },
242
+ "required": [
243
+ "bindingId",
244
+ "repositoryId",
245
+ "installationId",
246
+ "owner",
247
+ "name",
248
+ "ref",
249
+ "commitSha",
250
+ "branch",
251
+ "workingDirectory",
252
+ "setupCommands",
253
+ "configRevision"
254
+ ],
255
+ "additionalProperties": false
256
+ }
257
+ },
258
+ "required": [
259
+ "prompt",
260
+ "projectDir",
261
+ "harness"
262
+ ],
263
+ "additionalProperties": false
264
+ },
265
+ "continuation": {
266
+ "$ref": "#/$defs/__schema0"
267
+ },
268
+ "previousRun": {
269
+ "type": "object",
270
+ "properties": {
271
+ "runId": {
272
+ "type": "string",
273
+ "minLength": 1,
274
+ "maxLength": 160
275
+ },
276
+ "executionRevision": {
277
+ "type": "integer",
278
+ "minimum": 0,
279
+ "maximum": 9007199254740991
280
+ },
281
+ "historyProduced": {
282
+ "type": "integer",
283
+ "minimum": 0,
284
+ "maximum": 9007199254740991
285
+ },
286
+ "closeReason": {
287
+ "type": "string",
288
+ "const": "abandoned"
289
+ },
290
+ "checkpoint": {
291
+ "type": "object",
292
+ "properties": {
293
+ "checkpointId": {
294
+ "type": "string",
295
+ "minLength": 1,
296
+ "maxLength": 160
297
+ },
298
+ "checksum": {
299
+ "type": "string",
300
+ "pattern": "^[a-f0-9]{64}$"
301
+ }
302
+ },
303
+ "required": [
304
+ "checkpointId",
305
+ "checksum"
306
+ ],
307
+ "additionalProperties": false
308
+ }
309
+ },
310
+ "required": [
311
+ "runId",
312
+ "executionRevision",
313
+ "historyProduced"
314
+ ],
315
+ "additionalProperties": false
316
+ },
317
+ "checkpoint": {
318
+ "type": "object",
319
+ "properties": {
320
+ "checkpointId": {
321
+ "type": "string",
322
+ "minLength": 1,
323
+ "maxLength": 160
324
+ },
325
+ "checksum": {
326
+ "type": "string",
327
+ "pattern": "^[a-f0-9]{64}$"
328
+ }
329
+ },
330
+ "required": [
331
+ "checkpointId",
332
+ "checksum"
333
+ ],
334
+ "additionalProperties": false
335
+ }
336
+ },
337
+ "required": [
338
+ "commandId",
339
+ "hubEpoch",
340
+ "runId",
341
+ "sessionId",
342
+ "runnerId",
343
+ "installationId",
344
+ "attemptId",
345
+ "generation",
346
+ "baseExecutionRevision",
347
+ "baseHistorySeq",
348
+ "cloudHistoryThrough",
349
+ "purpose",
350
+ "spec"
351
+ ],
352
+ "additionalProperties": false
353
+ },
354
+ "gitHead": {
355
+ "type": "string",
356
+ "pattern": "^[0-9a-f]{40,64}$"
357
+ },
358
+ "gitBase": {
359
+ "type": "string",
360
+ "pattern": "^[0-9a-f]{40,64}$"
361
+ },
362
+ "gitBundle": {
363
+ "type": "string"
364
+ },
365
+ "indexPatch": {
366
+ "type": "string"
367
+ },
368
+ "files": {
369
+ "maxItems": 100000,
370
+ "type": "array",
371
+ "items": {
372
+ "type": "object",
373
+ "properties": {
374
+ "path": {
375
+ "type": "string",
376
+ "minLength": 1,
377
+ "maxLength": 4096
378
+ },
379
+ "content": {
380
+ "type": "string"
381
+ },
382
+ "executable": {
383
+ "type": "boolean"
384
+ }
385
+ },
386
+ "required": [
387
+ "path",
388
+ "content",
389
+ "executable"
390
+ ],
391
+ "additionalProperties": false
392
+ }
393
+ },
394
+ "deleted": {
395
+ "maxItems": 100000,
396
+ "type": "array",
397
+ "items": {
398
+ "type": "string",
399
+ "minLength": 1,
400
+ "maxLength": 4096
401
+ }
402
+ },
403
+ "sessionRows": {
404
+ "type": "array",
405
+ "items": {
406
+ "type": "object",
407
+ "properties": {
408
+ "kind": {
409
+ "type": "string"
410
+ },
411
+ "id": {
412
+ "type": "string"
413
+ },
414
+ "payload": {
415
+ "type": "string"
416
+ }
417
+ },
418
+ "required": [
419
+ "kind",
420
+ "id",
421
+ "payload"
422
+ ],
423
+ "additionalProperties": false
424
+ }
425
+ },
426
+ "history": {
427
+ "type": "array",
428
+ "items": {
429
+ "type": "object",
430
+ "properties": {
431
+ "seq": {
432
+ "type": "integer",
433
+ "exclusiveMinimum": 0,
434
+ "maximum": 9007199254740991
435
+ },
436
+ "record": {
437
+ "type": "object",
438
+ "properties": {
439
+ "eventId": {
440
+ "type": "string",
441
+ "minLength": 1,
442
+ "maxLength": 160
443
+ },
444
+ "attemptId": {
445
+ "type": "string",
446
+ "minLength": 1,
447
+ "maxLength": 160
448
+ },
449
+ "emittedAt": {
450
+ "type": "string",
451
+ "format": "date-time",
452
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
453
+ },
454
+ "kind": {
455
+ "type": "string",
456
+ "minLength": 1,
457
+ "maxLength": 128
458
+ },
459
+ "data": {
460
+ "$ref": "#/$defs/__schema1"
461
+ }
462
+ },
463
+ "required": [
464
+ "eventId",
465
+ "attemptId",
466
+ "emittedAt",
467
+ "kind",
468
+ "data"
469
+ ],
470
+ "additionalProperties": false
471
+ }
472
+ },
473
+ "required": [
474
+ "seq",
475
+ "record"
476
+ ],
477
+ "additionalProperties": false
478
+ }
479
+ }
480
+ },
481
+ "required": [
482
+ "version",
483
+ "checkpointId",
484
+ "orgId",
485
+ "phase",
486
+ "runId",
487
+ "sessionId",
488
+ "sourceAttemptId",
489
+ "executionRevision",
490
+ "historyProduced",
491
+ "historyAck",
492
+ "grant",
493
+ "gitHead",
494
+ "gitBundle",
495
+ "indexPatch",
496
+ "files",
497
+ "deleted",
498
+ "sessionRows",
499
+ "history"
500
+ ],
501
+ "additionalProperties": false,
502
+ "$defs": {
503
+ "__schema0": {
504
+ "anyOf": [
505
+ {
506
+ "type": "string"
507
+ },
508
+ {
509
+ "type": "number"
510
+ },
511
+ {
512
+ "type": "boolean"
513
+ },
514
+ {
515
+ "type": "null"
516
+ },
517
+ {
518
+ "type": "array",
519
+ "items": {
520
+ "$ref": "#/$defs/__schema0"
521
+ }
522
+ },
523
+ {
524
+ "type": "object",
525
+ "propertyNames": {
526
+ "type": "string"
527
+ },
528
+ "additionalProperties": {
529
+ "$ref": "#/$defs/__schema0"
530
+ }
531
+ }
532
+ ]
533
+ },
534
+ "__schema1": {
535
+ "anyOf": [
536
+ {
537
+ "type": "string"
538
+ },
539
+ {
540
+ "type": "number"
541
+ },
542
+ {
543
+ "type": "boolean"
544
+ },
545
+ {
546
+ "type": "null"
547
+ },
548
+ {
549
+ "type": "array",
550
+ "items": {
551
+ "$ref": "#/$defs/__schema1"
552
+ }
553
+ },
554
+ {
555
+ "type": "object",
556
+ "propertyNames": {
557
+ "type": "string"
558
+ },
559
+ "additionalProperties": {
560
+ "$ref": "#/$defs/__schema1"
561
+ }
562
+ }
563
+ ]
564
+ }
565
+ }
566
+ }