@kurvball/rehearse 1.8.0 → 1.10.0

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.
Files changed (74) hide show
  1. package/README.md +3 -2
  2. package/dist/commands/init.js +52 -7
  3. package/dist/commands/stage.js +19 -3
  4. package/dist/detect/detect.d.ts +6 -0
  5. package/dist/detect/detect.js +48 -0
  6. package/dist/detect/finding.d.ts +18 -0
  7. package/dist/detect/finding.js +4 -0
  8. package/dist/detect/globs.d.ts +10 -0
  9. package/dist/detect/globs.js +43 -0
  10. package/dist/detect/index.d.ts +2 -0
  11. package/dist/detect/index.js +2 -0
  12. package/dist/detect/lockfiles.d.ts +15 -0
  13. package/dist/detect/lockfiles.js +64 -0
  14. package/dist/detect/paths.d.ts +5 -0
  15. package/dist/detect/paths.js +39 -0
  16. package/dist/detect/pieces.d.ts +14 -0
  17. package/dist/detect/pieces.js +119 -0
  18. package/dist/detect/prepare.d.ts +14 -0
  19. package/dist/detect/prepare.js +78 -0
  20. package/dist/detect/repository.d.ts +33 -0
  21. package/dist/detect/repository.js +166 -0
  22. package/dist/detect/scenarios.d.ts +26 -0
  23. package/dist/detect/scenarios.js +170 -0
  24. package/dist/detect/scripts.d.ts +46 -0
  25. package/dist/detect/scripts.js +233 -0
  26. package/dist/detect/services.d.ts +16 -0
  27. package/dist/detect/services.js +171 -0
  28. package/dist/detect/write.d.ts +18 -0
  29. package/dist/detect/write.js +115 -0
  30. package/dist/manifest/index.d.ts +1 -1
  31. package/dist/manifest/index.js +1 -1
  32. package/dist/manifest/init.d.ts +47 -1
  33. package/dist/manifest/init.js +19 -16
  34. package/dist/scenarios/glob.d.ts +1 -0
  35. package/dist/scenarios/glob.js +10 -3
  36. package/dist/scenarios/index.d.ts +1 -1
  37. package/dist/scenarios/index.js +1 -1
  38. package/dist/schema.d.ts +1 -1
  39. package/dist/schema.js +1 -0
  40. package/dist/stage/client/client/api.js +4 -1
  41. package/dist/stage/client/client/index.js +1 -0
  42. package/dist/stage/client/client/static.js +28 -0
  43. package/dist/stage/client/features/canvas/call.js +12 -3
  44. package/dist/stage/client/features/canvas/file.js +4 -2
  45. package/dist/stage/client/features/canvas/piece.js +12 -2
  46. package/dist/stage/client/features/list/list.js +6 -1
  47. package/dist/stage/client/features/scenario/heading.js +3 -2
  48. package/dist/stage/client/features/scenario/scenario.js +8 -4
  49. package/dist/stage/client/main.js +7 -3
  50. package/dist/stage/client/stage.css +11 -0
  51. package/dist/stage/compared.d.ts +7 -1
  52. package/dist/stage/compared.js +16 -4
  53. package/dist/stage/files.d.ts +1 -0
  54. package/dist/stage/files.js +6 -4
  55. package/dist/stage/index.d.ts +1 -0
  56. package/dist/stage/index.js +1 -0
  57. package/dist/stage/public.d.ts +9 -0
  58. package/dist/stage/public.js +107 -0
  59. package/dist/stage/server.js +2 -2
  60. package/dist/stage/static.d.ts +22 -0
  61. package/dist/stage/static.js +241 -0
  62. package/llms.txt +3 -2
  63. package/package.json +1 -1
  64. package/schema/v1/init.schema.json +69 -1
  65. package/schema/v1/samples/init.json +46 -1
  66. package/schema/v1/samples/static.json +21 -0
  67. package/schema/v1/static.schema.json +34 -0
  68. package/schema/vendor/acta/LICENSE +21 -0
  69. package/schema/vendor/acta/README.md +12 -0
  70. package/schema/vendor/acta/v1/canonical.schema.json +818 -0
  71. package/schema/vendor/acta/v1/check.schema.json +35 -0
  72. package/schema/vendor/acta/v1/record.schema.json +1443 -0
  73. package/schema/vendor/acta/v1/run-model.schema.json +1074 -0
  74. package/skill/rehearse/SKILL.md +6 -0
@@ -0,0 +1,1443 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://acta.kurvball.ca/schema/v1/record.schema.json",
4
+ "title": "Acta record",
5
+ "description": "What an agent did, as events in time order. Folding them gives the run model at any moment. Readers ignore fields and event types they do not know.",
6
+ "type": "object",
7
+ "properties": {
8
+ "version": {
9
+ "const": 1
10
+ },
11
+ "source": {
12
+ "$ref": "#/$defs/Source"
13
+ },
14
+ "title": {
15
+ "type": "string"
16
+ },
17
+ "events": {
18
+ "type": "array",
19
+ "items": {
20
+ "$ref": "#/$defs/RunEvent"
21
+ }
22
+ }
23
+ },
24
+ "required": [
25
+ "version",
26
+ "source",
27
+ "events"
28
+ ],
29
+ "$defs": {
30
+ "RunState": {
31
+ "type": "string",
32
+ "enum": [
33
+ "working",
34
+ "waiting",
35
+ "done",
36
+ "failed",
37
+ "stopped"
38
+ ]
39
+ },
40
+ "Todo": {
41
+ "type": "object",
42
+ "properties": {
43
+ "text": {
44
+ "type": "string"
45
+ },
46
+ "state": {
47
+ "type": "string",
48
+ "enum": [
49
+ "pending",
50
+ "working",
51
+ "done"
52
+ ]
53
+ },
54
+ "doing": {
55
+ "type": "string"
56
+ }
57
+ },
58
+ "required": [
59
+ "text",
60
+ "state"
61
+ ]
62
+ },
63
+ "Speaker": {
64
+ "type": "object",
65
+ "properties": {
66
+ "kind": {
67
+ "type": "string",
68
+ "enum": [
69
+ "person",
70
+ "agent",
71
+ "teammate",
72
+ "system"
73
+ ]
74
+ },
75
+ "name": {
76
+ "type": "string"
77
+ }
78
+ },
79
+ "required": [
80
+ "kind",
81
+ "name"
82
+ ]
83
+ },
84
+ "Attachment": {
85
+ "type": "object",
86
+ "properties": {
87
+ "id": {
88
+ "type": "string",
89
+ "minLength": 1
90
+ },
91
+ "name": {
92
+ "type": "string"
93
+ },
94
+ "kind": {
95
+ "type": "string",
96
+ "enum": [
97
+ "file",
98
+ "image",
99
+ "text"
100
+ ]
101
+ },
102
+ "size": {
103
+ "type": "number",
104
+ "minimum": 0
105
+ }
106
+ },
107
+ "required": [
108
+ "id",
109
+ "name",
110
+ "kind"
111
+ ]
112
+ },
113
+ "Tool": {
114
+ "type": "object",
115
+ "properties": {
116
+ "name": {
117
+ "type": "string"
118
+ },
119
+ "call": {
120
+ "type": "string"
121
+ },
122
+ "input": {}
123
+ },
124
+ "required": [
125
+ "name"
126
+ ]
127
+ },
128
+ "Slot": {
129
+ "type": "object",
130
+ "properties": {
131
+ "response": {
132
+ "type": "integer",
133
+ "minimum": 1
134
+ },
135
+ "call": {
136
+ "type": "integer",
137
+ "minimum": 1
138
+ }
139
+ },
140
+ "required": [
141
+ "response",
142
+ "call"
143
+ ]
144
+ },
145
+ "Usage": {
146
+ "type": "object",
147
+ "properties": {
148
+ "input": {
149
+ "type": "integer",
150
+ "minimum": 0
151
+ },
152
+ "output": {
153
+ "type": "integer",
154
+ "minimum": 0
155
+ },
156
+ "cacheRead": {
157
+ "type": "integer",
158
+ "minimum": 0
159
+ },
160
+ "cacheWrite": {
161
+ "type": "integer",
162
+ "minimum": 0
163
+ },
164
+ "reasoning": {
165
+ "type": "integer",
166
+ "minimum": 0
167
+ }
168
+ },
169
+ "required": []
170
+ },
171
+ "StepFile": {
172
+ "type": "object",
173
+ "properties": {
174
+ "path": {
175
+ "type": "string"
176
+ },
177
+ "change": {
178
+ "type": "string",
179
+ "enum": [
180
+ "added",
181
+ "changed",
182
+ "removed",
183
+ "read"
184
+ ]
185
+ },
186
+ "added": {
187
+ "type": "integer",
188
+ "minimum": 0
189
+ },
190
+ "removed": {
191
+ "type": "integer",
192
+ "minimum": 0
193
+ }
194
+ },
195
+ "required": [
196
+ "path",
197
+ "change"
198
+ ]
199
+ },
200
+ "Choice": {
201
+ "type": "object",
202
+ "properties": {
203
+ "id": {
204
+ "type": "string",
205
+ "minLength": 1
206
+ },
207
+ "label": {
208
+ "type": "string"
209
+ },
210
+ "intent": {
211
+ "type": "string",
212
+ "enum": [
213
+ "approve",
214
+ "decline"
215
+ ]
216
+ }
217
+ },
218
+ "required": [
219
+ "id",
220
+ "label"
221
+ ]
222
+ },
223
+ "FileEntry": {
224
+ "type": "object",
225
+ "properties": {
226
+ "path": {
227
+ "type": "string"
228
+ },
229
+ "change": {
230
+ "type": "string",
231
+ "enum": [
232
+ "added",
233
+ "changed",
234
+ "removed",
235
+ "read"
236
+ ]
237
+ }
238
+ },
239
+ "required": [
240
+ "path",
241
+ "change"
242
+ ]
243
+ },
244
+ "Block": {
245
+ "type": "object",
246
+ "properties": {
247
+ "kind": {
248
+ "type": "string",
249
+ "minLength": 1
250
+ }
251
+ },
252
+ "required": [
253
+ "kind"
254
+ ],
255
+ "allOf": [
256
+ {
257
+ "if": {
258
+ "properties": {
259
+ "kind": {
260
+ "const": "text"
261
+ }
262
+ },
263
+ "required": [
264
+ "kind"
265
+ ]
266
+ },
267
+ "then": {
268
+ "type": "object",
269
+ "properties": {
270
+ "text": {
271
+ "type": "string"
272
+ }
273
+ },
274
+ "required": [
275
+ "text"
276
+ ]
277
+ }
278
+ },
279
+ {
280
+ "if": {
281
+ "properties": {
282
+ "kind": {
283
+ "const": "callout"
284
+ }
285
+ },
286
+ "required": [
287
+ "kind"
288
+ ]
289
+ },
290
+ "then": {
291
+ "type": "object",
292
+ "properties": {
293
+ "tone": {
294
+ "type": "string",
295
+ "enum": [
296
+ "note",
297
+ "tip",
298
+ "important",
299
+ "warning",
300
+ "caution"
301
+ ]
302
+ },
303
+ "text": {
304
+ "type": "string"
305
+ },
306
+ "title": {
307
+ "type": "string"
308
+ }
309
+ },
310
+ "required": [
311
+ "tone",
312
+ "text"
313
+ ]
314
+ }
315
+ },
316
+ {
317
+ "if": {
318
+ "properties": {
319
+ "kind": {
320
+ "const": "quote"
321
+ }
322
+ },
323
+ "required": [
324
+ "kind"
325
+ ]
326
+ },
327
+ "then": {
328
+ "type": "object",
329
+ "properties": {
330
+ "text": {
331
+ "type": "string"
332
+ },
333
+ "source": {
334
+ "type": "string"
335
+ },
336
+ "run": {
337
+ "type": "string",
338
+ "minLength": 1
339
+ }
340
+ },
341
+ "required": [
342
+ "text"
343
+ ]
344
+ }
345
+ },
346
+ {
347
+ "if": {
348
+ "properties": {
349
+ "kind": {
350
+ "const": "figure"
351
+ }
352
+ },
353
+ "required": [
354
+ "kind"
355
+ ]
356
+ },
357
+ "then": {
358
+ "type": "object",
359
+ "properties": {
360
+ "alt": {
361
+ "type": "string"
362
+ },
363
+ "src": {
364
+ "type": "string"
365
+ },
366
+ "caption": {
367
+ "type": "string"
368
+ }
369
+ },
370
+ "required": [
371
+ "alt"
372
+ ]
373
+ }
374
+ },
375
+ {
376
+ "if": {
377
+ "properties": {
378
+ "kind": {
379
+ "const": "files"
380
+ }
381
+ },
382
+ "required": [
383
+ "kind"
384
+ ]
385
+ },
386
+ "then": {
387
+ "type": "object",
388
+ "properties": {
389
+ "files": {
390
+ "type": "array",
391
+ "items": {
392
+ "$ref": "#/$defs/FileEntry"
393
+ }
394
+ }
395
+ },
396
+ "required": [
397
+ "files"
398
+ ]
399
+ }
400
+ },
401
+ {
402
+ "if": {
403
+ "properties": {
404
+ "kind": {
405
+ "const": "code"
406
+ }
407
+ },
408
+ "required": [
409
+ "kind"
410
+ ]
411
+ },
412
+ "then": {
413
+ "type": "object",
414
+ "properties": {
415
+ "code": {
416
+ "type": "string"
417
+ },
418
+ "language": {
419
+ "type": "string"
420
+ }
421
+ },
422
+ "required": [
423
+ "code"
424
+ ]
425
+ }
426
+ }
427
+ ]
428
+ },
429
+ "Section": {
430
+ "type": "object",
431
+ "properties": {
432
+ "id": {
433
+ "type": "string",
434
+ "minLength": 1
435
+ },
436
+ "heading": {
437
+ "type": "string"
438
+ },
439
+ "state": {
440
+ "type": "string",
441
+ "enum": [
442
+ "writing",
443
+ "ready",
444
+ "changed"
445
+ ]
446
+ },
447
+ "blocks": {
448
+ "type": "array",
449
+ "items": {
450
+ "$ref": "#/$defs/Block"
451
+ }
452
+ },
453
+ "before": {
454
+ "type": "string"
455
+ }
456
+ },
457
+ "required": [
458
+ "id",
459
+ "heading",
460
+ "blocks"
461
+ ]
462
+ },
463
+ "Doc": {
464
+ "type": "object",
465
+ "properties": {
466
+ "id": {
467
+ "type": "string",
468
+ "minLength": 1
469
+ },
470
+ "run": {
471
+ "type": "string",
472
+ "minLength": 1
473
+ },
474
+ "title": {
475
+ "type": "string"
476
+ },
477
+ "kind": {
478
+ "type": "string"
479
+ },
480
+ "state": {
481
+ "type": "string",
482
+ "enum": [
483
+ "draft",
484
+ "writing",
485
+ "ready"
486
+ ]
487
+ },
488
+ "sections": {
489
+ "type": "array",
490
+ "items": {
491
+ "$ref": "#/$defs/Section"
492
+ }
493
+ }
494
+ },
495
+ "required": [
496
+ "id",
497
+ "title",
498
+ "sections"
499
+ ]
500
+ },
501
+ "Source": {
502
+ "type": "object",
503
+ "properties": {
504
+ "kind": {
505
+ "type": "string",
506
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
507
+ },
508
+ "version": {
509
+ "type": "string"
510
+ },
511
+ "session": {
512
+ "type": "string"
513
+ }
514
+ },
515
+ "required": [
516
+ "kind"
517
+ ]
518
+ },
519
+ "RunEvent": {
520
+ "type": "object",
521
+ "properties": {
522
+ "type": {
523
+ "type": "string",
524
+ "minLength": 1
525
+ },
526
+ "at": {
527
+ "type": "string",
528
+ "format": "date-time"
529
+ }
530
+ },
531
+ "required": [
532
+ "type",
533
+ "at"
534
+ ],
535
+ "allOf": [
536
+ {
537
+ "if": {
538
+ "properties": {
539
+ "type": {
540
+ "const": "run.started"
541
+ }
542
+ },
543
+ "required": [
544
+ "type"
545
+ ]
546
+ },
547
+ "then": {
548
+ "type": "object",
549
+ "properties": {
550
+ "at": {
551
+ "type": "string",
552
+ "format": "date-time"
553
+ },
554
+ "run": {
555
+ "type": "object",
556
+ "properties": {
557
+ "id": {
558
+ "type": "string",
559
+ "minLength": 1
560
+ },
561
+ "title": {
562
+ "type": "string"
563
+ },
564
+ "parent": {
565
+ "type": "string",
566
+ "minLength": 1
567
+ },
568
+ "activity": {
569
+ "type": "string"
570
+ },
571
+ "fork": {
572
+ "type": "object",
573
+ "properties": {
574
+ "reason": {
575
+ "type": "string"
576
+ },
577
+ "step": {
578
+ "type": "string",
579
+ "minLength": 1
580
+ },
581
+ "group": {
582
+ "type": "string",
583
+ "minLength": 1
584
+ }
585
+ },
586
+ "required": [
587
+ "reason"
588
+ ]
589
+ },
590
+ "join": {
591
+ "type": "object",
592
+ "properties": {
593
+ "into": {
594
+ "type": "string",
595
+ "minLength": 1
596
+ },
597
+ "quorum": {
598
+ "type": "string",
599
+ "enum": [
600
+ "all",
601
+ "each",
602
+ "none"
603
+ ]
604
+ }
605
+ },
606
+ "required": [
607
+ "into",
608
+ "quorum"
609
+ ]
610
+ },
611
+ "model": {
612
+ "type": "string"
613
+ },
614
+ "told": {
615
+ "type": "object",
616
+ "properties": {
617
+ "role": {
618
+ "type": "object",
619
+ "properties": {
620
+ "id": {
621
+ "type": "string",
622
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
623
+ },
624
+ "version": {
625
+ "type": "integer",
626
+ "minimum": 1
627
+ },
628
+ "hash": {
629
+ "type": "string",
630
+ "pattern": "^[0-9a-f]{64}$"
631
+ }
632
+ },
633
+ "required": [
634
+ "id",
635
+ "version",
636
+ "hash"
637
+ ]
638
+ },
639
+ "rendering": {
640
+ "type": "string",
641
+ "pattern": "^[0-9a-f]{64}$"
642
+ },
643
+ "target": {
644
+ "type": "string",
645
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
646
+ }
647
+ },
648
+ "required": [
649
+ "role",
650
+ "rendering",
651
+ "target"
652
+ ]
653
+ },
654
+ "cwd": {
655
+ "type": "string"
656
+ },
657
+ "state": {
658
+ "$ref": "#/$defs/RunState"
659
+ }
660
+ },
661
+ "required": [
662
+ "id",
663
+ "title"
664
+ ]
665
+ }
666
+ },
667
+ "required": [
668
+ "run"
669
+ ]
670
+ }
671
+ },
672
+ {
673
+ "if": {
674
+ "properties": {
675
+ "type": {
676
+ "const": "run.state"
677
+ }
678
+ },
679
+ "required": [
680
+ "type"
681
+ ]
682
+ },
683
+ "then": {
684
+ "type": "object",
685
+ "properties": {
686
+ "at": {
687
+ "type": "string",
688
+ "format": "date-time"
689
+ },
690
+ "run": {
691
+ "type": "string",
692
+ "minLength": 1
693
+ },
694
+ "state": {
695
+ "$ref": "#/$defs/RunState"
696
+ },
697
+ "reason": {
698
+ "type": "string",
699
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
700
+ }
701
+ },
702
+ "required": [
703
+ "run",
704
+ "state"
705
+ ]
706
+ }
707
+ },
708
+ {
709
+ "if": {
710
+ "properties": {
711
+ "type": {
712
+ "const": "run.activity"
713
+ }
714
+ },
715
+ "required": [
716
+ "type"
717
+ ]
718
+ },
719
+ "then": {
720
+ "type": "object",
721
+ "properties": {
722
+ "at": {
723
+ "type": "string",
724
+ "format": "date-time"
725
+ },
726
+ "run": {
727
+ "type": "string",
728
+ "minLength": 1
729
+ },
730
+ "activity": {
731
+ "type": [
732
+ "string",
733
+ "null"
734
+ ]
735
+ }
736
+ },
737
+ "required": [
738
+ "run",
739
+ "activity"
740
+ ]
741
+ }
742
+ },
743
+ {
744
+ "if": {
745
+ "properties": {
746
+ "type": {
747
+ "const": "turn.started"
748
+ }
749
+ },
750
+ "required": [
751
+ "type"
752
+ ]
753
+ },
754
+ "then": {
755
+ "type": "object",
756
+ "properties": {
757
+ "at": {
758
+ "type": "string",
759
+ "format": "date-time"
760
+ },
761
+ "turn": {
762
+ "type": "object",
763
+ "properties": {
764
+ "id": {
765
+ "type": "string",
766
+ "minLength": 1
767
+ },
768
+ "run": {
769
+ "type": "string",
770
+ "minLength": 1
771
+ },
772
+ "speaker": {
773
+ "$ref": "#/$defs/Speaker"
774
+ },
775
+ "attachments": {
776
+ "type": "array",
777
+ "items": {
778
+ "$ref": "#/$defs/Attachment"
779
+ }
780
+ }
781
+ },
782
+ "required": [
783
+ "id",
784
+ "run",
785
+ "speaker"
786
+ ]
787
+ }
788
+ },
789
+ "required": [
790
+ "turn"
791
+ ]
792
+ }
793
+ },
794
+ {
795
+ "if": {
796
+ "properties": {
797
+ "type": {
798
+ "const": "turn.text"
799
+ }
800
+ },
801
+ "required": [
802
+ "type"
803
+ ]
804
+ },
805
+ "then": {
806
+ "type": "object",
807
+ "properties": {
808
+ "at": {
809
+ "type": "string",
810
+ "format": "date-time"
811
+ },
812
+ "turn": {
813
+ "type": "string",
814
+ "minLength": 1
815
+ },
816
+ "text": {
817
+ "type": "string"
818
+ },
819
+ "mode": {
820
+ "type": "string",
821
+ "enum": [
822
+ "append",
823
+ "replace"
824
+ ]
825
+ },
826
+ "response": {
827
+ "type": "integer",
828
+ "minimum": 1
829
+ },
830
+ "partial": {
831
+ "type": "boolean"
832
+ }
833
+ },
834
+ "required": [
835
+ "turn",
836
+ "text",
837
+ "mode"
838
+ ]
839
+ }
840
+ },
841
+ {
842
+ "if": {
843
+ "properties": {
844
+ "type": {
845
+ "const": "turn.activity"
846
+ }
847
+ },
848
+ "required": [
849
+ "type"
850
+ ]
851
+ },
852
+ "then": {
853
+ "type": "object",
854
+ "properties": {
855
+ "at": {
856
+ "type": "string",
857
+ "format": "date-time"
858
+ },
859
+ "turn": {
860
+ "type": "string",
861
+ "minLength": 1
862
+ },
863
+ "activity": {
864
+ "type": [
865
+ "string",
866
+ "null"
867
+ ]
868
+ }
869
+ },
870
+ "required": [
871
+ "turn",
872
+ "activity"
873
+ ]
874
+ }
875
+ },
876
+ {
877
+ "if": {
878
+ "properties": {
879
+ "type": {
880
+ "const": "turn.usage"
881
+ }
882
+ },
883
+ "required": [
884
+ "type"
885
+ ]
886
+ },
887
+ "then": {
888
+ "type": "object",
889
+ "properties": {
890
+ "at": {
891
+ "type": "string",
892
+ "format": "date-time"
893
+ },
894
+ "turn": {
895
+ "type": "string",
896
+ "minLength": 1
897
+ },
898
+ "response": {
899
+ "type": "integer",
900
+ "minimum": 1
901
+ },
902
+ "id": {
903
+ "type": "string"
904
+ },
905
+ "model": {
906
+ "type": "string"
907
+ },
908
+ "provider": {
909
+ "type": "string",
910
+ "pattern": "^[a-z][a-z0-9_.-]*$"
911
+ },
912
+ "finish": {
913
+ "type": "string",
914
+ "pattern": "^[a-z][a-z0-9_.-]*$"
915
+ },
916
+ "usage": {
917
+ "$ref": "#/$defs/Usage"
918
+ }
919
+ },
920
+ "required": [
921
+ "turn",
922
+ "usage"
923
+ ]
924
+ }
925
+ },
926
+ {
927
+ "if": {
928
+ "properties": {
929
+ "type": {
930
+ "const": "turn.ended"
931
+ }
932
+ },
933
+ "required": [
934
+ "type"
935
+ ]
936
+ },
937
+ "then": {
938
+ "type": "object",
939
+ "properties": {
940
+ "at": {
941
+ "type": "string",
942
+ "format": "date-time"
943
+ },
944
+ "turn": {
945
+ "type": "string",
946
+ "minLength": 1
947
+ },
948
+ "state": {
949
+ "type": "string",
950
+ "enum": [
951
+ "done",
952
+ "stopped",
953
+ "failed"
954
+ ]
955
+ },
956
+ "reason": {
957
+ "type": "string",
958
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
959
+ },
960
+ "output": {}
961
+ },
962
+ "required": [
963
+ "turn",
964
+ "state"
965
+ ]
966
+ }
967
+ },
968
+ {
969
+ "if": {
970
+ "properties": {
971
+ "type": {
972
+ "const": "step.started"
973
+ }
974
+ },
975
+ "required": [
976
+ "type"
977
+ ]
978
+ },
979
+ "then": {
980
+ "type": "object",
981
+ "properties": {
982
+ "at": {
983
+ "type": "string",
984
+ "format": "date-time"
985
+ },
986
+ "turn": {
987
+ "type": "string",
988
+ "minLength": 1
989
+ },
990
+ "step": {
991
+ "type": "object",
992
+ "properties": {
993
+ "id": {
994
+ "type": "string",
995
+ "minLength": 1
996
+ },
997
+ "kind": {
998
+ "type": "string",
999
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
1000
+ },
1001
+ "label": {
1002
+ "type": "string"
1003
+ },
1004
+ "run": {
1005
+ "type": "string",
1006
+ "minLength": 1
1007
+ },
1008
+ "tool": {
1009
+ "$ref": "#/$defs/Tool"
1010
+ },
1011
+ "slot": {
1012
+ "$ref": "#/$defs/Slot"
1013
+ }
1014
+ },
1015
+ "required": [
1016
+ "id",
1017
+ "kind",
1018
+ "label"
1019
+ ]
1020
+ }
1021
+ },
1022
+ "required": [
1023
+ "turn",
1024
+ "step"
1025
+ ]
1026
+ }
1027
+ },
1028
+ {
1029
+ "if": {
1030
+ "properties": {
1031
+ "type": {
1032
+ "const": "step.ended"
1033
+ }
1034
+ },
1035
+ "required": [
1036
+ "type"
1037
+ ]
1038
+ },
1039
+ "then": {
1040
+ "type": "object",
1041
+ "properties": {
1042
+ "at": {
1043
+ "type": "string",
1044
+ "format": "date-time"
1045
+ },
1046
+ "step": {
1047
+ "type": "string",
1048
+ "minLength": 1
1049
+ },
1050
+ "state": {
1051
+ "type": "string",
1052
+ "enum": [
1053
+ "ok",
1054
+ "failed",
1055
+ "refused"
1056
+ ]
1057
+ },
1058
+ "detail": {
1059
+ "type": "string"
1060
+ },
1061
+ "reason": {
1062
+ "type": "string",
1063
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
1064
+ },
1065
+ "exit": {
1066
+ "type": "integer"
1067
+ },
1068
+ "files": {
1069
+ "type": "array",
1070
+ "items": {
1071
+ "$ref": "#/$defs/StepFile"
1072
+ }
1073
+ }
1074
+ },
1075
+ "required": [
1076
+ "step",
1077
+ "state"
1078
+ ]
1079
+ }
1080
+ },
1081
+ {
1082
+ "if": {
1083
+ "properties": {
1084
+ "type": {
1085
+ "const": "ask.opened"
1086
+ }
1087
+ },
1088
+ "required": [
1089
+ "type"
1090
+ ]
1091
+ },
1092
+ "then": {
1093
+ "type": "object",
1094
+ "properties": {
1095
+ "at": {
1096
+ "type": "string",
1097
+ "format": "date-time"
1098
+ },
1099
+ "ask": {
1100
+ "type": "object",
1101
+ "properties": {
1102
+ "id": {
1103
+ "type": "string",
1104
+ "minLength": 1
1105
+ },
1106
+ "run": {
1107
+ "type": "string",
1108
+ "minLength": 1
1109
+ },
1110
+ "step": {
1111
+ "type": "string",
1112
+ "minLength": 1
1113
+ },
1114
+ "from": {
1115
+ "type": "string"
1116
+ },
1117
+ "says": {
1118
+ "type": "string"
1119
+ },
1120
+ "choices": {
1121
+ "type": "array",
1122
+ "items": {
1123
+ "$ref": "#/$defs/Choice"
1124
+ }
1125
+ },
1126
+ "other": {
1127
+ "type": "boolean"
1128
+ },
1129
+ "risk": {
1130
+ "type": "string"
1131
+ },
1132
+ "command": {
1133
+ "type": "string"
1134
+ },
1135
+ "waiting": {
1136
+ "type": "string",
1137
+ "enum": [
1138
+ "blocked",
1139
+ "going-ahead",
1140
+ "your-call"
1141
+ ]
1142
+ },
1143
+ "kind": {
1144
+ "type": "string",
1145
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
1146
+ },
1147
+ "multiple": {
1148
+ "type": "boolean"
1149
+ },
1150
+ "tool": {
1151
+ "type": "string"
1152
+ },
1153
+ "title": {
1154
+ "type": "string"
1155
+ },
1156
+ "why": {
1157
+ "type": "string"
1158
+ },
1159
+ "path": {
1160
+ "type": "string"
1161
+ },
1162
+ "suggestions": {
1163
+ "type": "array",
1164
+ "items": {}
1165
+ },
1166
+ "confirm": {
1167
+ "type": "string",
1168
+ "enum": [
1169
+ "explicit"
1170
+ ]
1171
+ },
1172
+ "remember": {
1173
+ "type": "boolean"
1174
+ },
1175
+ "input": {}
1176
+ },
1177
+ "required": [
1178
+ "id",
1179
+ "run",
1180
+ "from",
1181
+ "says",
1182
+ "choices",
1183
+ "waiting"
1184
+ ]
1185
+ }
1186
+ },
1187
+ "required": [
1188
+ "ask"
1189
+ ]
1190
+ }
1191
+ },
1192
+ {
1193
+ "if": {
1194
+ "properties": {
1195
+ "type": {
1196
+ "const": "ask.closed"
1197
+ }
1198
+ },
1199
+ "required": [
1200
+ "type"
1201
+ ]
1202
+ },
1203
+ "then": {
1204
+ "type": "object",
1205
+ "properties": {
1206
+ "at": {
1207
+ "type": "string",
1208
+ "format": "date-time"
1209
+ },
1210
+ "ask": {
1211
+ "type": "string",
1212
+ "minLength": 1
1213
+ },
1214
+ "state": {
1215
+ "type": "string",
1216
+ "enum": [
1217
+ "answered",
1218
+ "withdrawn"
1219
+ ]
1220
+ },
1221
+ "answer": {
1222
+ "type": "object",
1223
+ "properties": {
1224
+ "choice": {
1225
+ "type": "string",
1226
+ "minLength": 1
1227
+ },
1228
+ "choices": {
1229
+ "type": "array",
1230
+ "items": {
1231
+ "type": "string",
1232
+ "minLength": 1
1233
+ }
1234
+ },
1235
+ "text": {
1236
+ "type": "string"
1237
+ },
1238
+ "by": {
1239
+ "type": "string"
1240
+ },
1241
+ "input": {},
1242
+ "interrupt": {
1243
+ "type": "boolean"
1244
+ }
1245
+ },
1246
+ "required": [
1247
+ "by"
1248
+ ]
1249
+ }
1250
+ },
1251
+ "required": [
1252
+ "ask",
1253
+ "state"
1254
+ ]
1255
+ }
1256
+ },
1257
+ {
1258
+ "if": {
1259
+ "properties": {
1260
+ "type": {
1261
+ "const": "doc.set"
1262
+ }
1263
+ },
1264
+ "required": [
1265
+ "type"
1266
+ ]
1267
+ },
1268
+ "then": {
1269
+ "type": "object",
1270
+ "properties": {
1271
+ "at": {
1272
+ "type": "string",
1273
+ "format": "date-time"
1274
+ },
1275
+ "doc": {
1276
+ "$ref": "#/$defs/Doc"
1277
+ }
1278
+ },
1279
+ "required": [
1280
+ "doc"
1281
+ ]
1282
+ }
1283
+ },
1284
+ {
1285
+ "if": {
1286
+ "properties": {
1287
+ "type": {
1288
+ "const": "todo.set"
1289
+ }
1290
+ },
1291
+ "required": [
1292
+ "type"
1293
+ ]
1294
+ },
1295
+ "then": {
1296
+ "type": "object",
1297
+ "properties": {
1298
+ "at": {
1299
+ "type": "string",
1300
+ "format": "date-time"
1301
+ },
1302
+ "run": {
1303
+ "type": "string",
1304
+ "minLength": 1
1305
+ },
1306
+ "turn": {
1307
+ "type": "string",
1308
+ "minLength": 1
1309
+ },
1310
+ "items": {
1311
+ "type": "array",
1312
+ "items": {
1313
+ "$ref": "#/$defs/Todo"
1314
+ }
1315
+ }
1316
+ },
1317
+ "required": [
1318
+ "run",
1319
+ "items"
1320
+ ]
1321
+ }
1322
+ },
1323
+ {
1324
+ "if": {
1325
+ "properties": {
1326
+ "type": {
1327
+ "const": "checkpoint"
1328
+ }
1329
+ },
1330
+ "required": [
1331
+ "type"
1332
+ ]
1333
+ },
1334
+ "then": {
1335
+ "type": "object",
1336
+ "properties": {
1337
+ "at": {
1338
+ "type": "string",
1339
+ "format": "date-time"
1340
+ },
1341
+ "run": {
1342
+ "type": "string",
1343
+ "minLength": 1
1344
+ },
1345
+ "turn": {
1346
+ "type": "string",
1347
+ "minLength": 1
1348
+ },
1349
+ "id": {
1350
+ "type": "string",
1351
+ "minLength": 1
1352
+ },
1353
+ "files": {
1354
+ "type": "array",
1355
+ "items": {
1356
+ "type": "string"
1357
+ }
1358
+ }
1359
+ },
1360
+ "required": [
1361
+ "run",
1362
+ "id"
1363
+ ]
1364
+ }
1365
+ },
1366
+ {
1367
+ "if": {
1368
+ "properties": {
1369
+ "type": {
1370
+ "const": "checkpoint.restored"
1371
+ }
1372
+ },
1373
+ "required": [
1374
+ "type"
1375
+ ]
1376
+ },
1377
+ "then": {
1378
+ "type": "object",
1379
+ "properties": {
1380
+ "at": {
1381
+ "type": "string",
1382
+ "format": "date-time"
1383
+ },
1384
+ "run": {
1385
+ "type": "string",
1386
+ "minLength": 1
1387
+ },
1388
+ "checkpoint": {
1389
+ "type": "string",
1390
+ "minLength": 1
1391
+ }
1392
+ },
1393
+ "required": [
1394
+ "run",
1395
+ "checkpoint"
1396
+ ]
1397
+ }
1398
+ },
1399
+ {
1400
+ "if": {
1401
+ "properties": {
1402
+ "type": {
1403
+ "const": "context.compacted"
1404
+ }
1405
+ },
1406
+ "required": [
1407
+ "type"
1408
+ ]
1409
+ },
1410
+ "then": {
1411
+ "type": "object",
1412
+ "properties": {
1413
+ "at": {
1414
+ "type": "string",
1415
+ "format": "date-time"
1416
+ },
1417
+ "run": {
1418
+ "type": "string",
1419
+ "minLength": 1
1420
+ },
1421
+ "trigger": {
1422
+ "type": "string",
1423
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
1424
+ },
1425
+ "before": {
1426
+ "type": "integer",
1427
+ "minimum": 0
1428
+ },
1429
+ "after": {
1430
+ "type": "integer",
1431
+ "minimum": 0
1432
+ }
1433
+ },
1434
+ "required": [
1435
+ "run",
1436
+ "trigger"
1437
+ ]
1438
+ }
1439
+ }
1440
+ ]
1441
+ }
1442
+ }
1443
+ }