@skill-harness/adapters 0.24.1 → 0.24.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,1343 @@
1
+ // GENERATED by scripts/vendor-pi-daddy-record-v1-contract.mjs; do not hand-edit.
2
+ export const PI_DADDY_RECORD_V1_COMMIT = "38418793efb785bc582c4a233a18c40364ccd1be";
3
+ export const PI_DADDY_RECORD_V1_VERSION = "0.44.3";
4
+ export const PI_DADDY_RECORD_V1_SCHEMA = {
5
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
6
+ "$id": "https://github.com/mojomanyana/pi-daddy/contracts/ledger-record/v1/record.schema.json",
7
+ "title": "pi-daddy ledger record envelope v1",
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": [
11
+ "v",
12
+ "seq",
13
+ "prev",
14
+ "at",
15
+ "kind",
16
+ "id",
17
+ "body",
18
+ "digest"
19
+ ],
20
+ "properties": {
21
+ "v": {
22
+ "const": 1
23
+ },
24
+ "seq": {
25
+ "type": "integer",
26
+ "minimum": 1
27
+ },
28
+ "prev": {
29
+ "anyOf": [
30
+ {
31
+ "type": "null"
32
+ },
33
+ {
34
+ "type": "string",
35
+ "pattern": "^[0-9a-f]{64}$"
36
+ }
37
+ ],
38
+ "description": "SHA-256 of the previous line's bytes; null for the first record"
39
+ },
40
+ "at": {
41
+ "type": "string",
42
+ "format": "date-time",
43
+ "description": "the writer's clock, not the body's timestamp"
44
+ },
45
+ "kind": {
46
+ "type": "string",
47
+ "enum": [
48
+ "binding",
49
+ "capability",
50
+ "lifecycle",
51
+ "approval",
52
+ "lease",
53
+ "check",
54
+ "fact",
55
+ "work",
56
+ "control",
57
+ "experiment",
58
+ "activity",
59
+ "advice"
60
+ ]
61
+ },
62
+ "id": {
63
+ "type": "string",
64
+ "minLength": 1,
65
+ "maxLength": 128
66
+ },
67
+ "body": {
68
+ "description": "the record payload; a governance event validates against governance-event.schema.json"
69
+ },
70
+ "imported": {
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": [
74
+ "path",
75
+ "line"
76
+ ],
77
+ "properties": {
78
+ "path": {
79
+ "type": "string"
80
+ },
81
+ "line": {
82
+ "type": "integer",
83
+ "minimum": 1
84
+ }
85
+ },
86
+ "description": "present on records copied from a pre-format ledger; the source is left untouched"
87
+ },
88
+ "digest": {
89
+ "type": "string",
90
+ "pattern": "^[0-9a-f]{64}$",
91
+ "description": "SHA-256 of the canonical JSON of the record without this field"
92
+ }
93
+ }
94
+ };
95
+ export const PI_DADDY_RECORD_V1_GOVERNANCE_SCHEMA = {
96
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
97
+ "$id": "https://github.com/mojomanyana/pi-daddy/contracts/ledger-record/v1/governance-event.schema.json",
98
+ "title": "pi-daddy ledgerVersion 3 event",
99
+ "description": "One JSON object per JSONL line. Version 3 adds unique execution identity and explicit parent execution identity; legacy and v2 lines are intentionally outside this schema.",
100
+ "oneOf": [
101
+ {
102
+ "$ref": "#/$defs/capabilityDecision"
103
+ },
104
+ {
105
+ "$ref": "#/$defs/workspaceLease"
106
+ },
107
+ {
108
+ "$ref": "#/$defs/childLifecycle"
109
+ },
110
+ {
111
+ "$ref": "#/$defs/costGate"
112
+ },
113
+ {
114
+ "$ref": "#/$defs/sessionConfig"
115
+ },
116
+ {
117
+ "$ref": "#/$defs/episodeOutcome"
118
+ }
119
+ ],
120
+ "$defs": {
121
+ "timestamp": {
122
+ "type": "string",
123
+ "format": "date-time",
124
+ "pattern": ":[0-5][0-9](?:\\.[0-9]+)?(?:[Zz]|[+-][0-9]{2}:[0-9]{2})$"
125
+ },
126
+ "episodeId": {
127
+ "type": "string",
128
+ "pattern": "^episode:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
129
+ },
130
+ "correlation": {
131
+ "type": "object",
132
+ "description": "Non-authoritative controller metadata under the pinned 1.0 contract. String and aggregate byte limits are additionally enforced by the runtime and cannot be represented exactly in JSON Schema.",
133
+ "properties": {
134
+ "schema_version": {
135
+ "const": "1.0"
136
+ },
137
+ "run_id": {
138
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
139
+ },
140
+ "task_id": {
141
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
142
+ },
143
+ "workspace_id": {
144
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
145
+ },
146
+ "context_id": {
147
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
148
+ },
149
+ "phase": {
150
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
151
+ },
152
+ "assurance": {
153
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
154
+ },
155
+ "assurance_effective": {
156
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
157
+ },
158
+ "policy_label": {
159
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
160
+ },
161
+ "assurance_source": {
162
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
163
+ },
164
+ "assurance_scope": {
165
+ "oneOf": [
166
+ {
167
+ "type": "object",
168
+ "properties": {
169
+ "type": {
170
+ "const": "entire-run"
171
+ },
172
+ "selectors": {
173
+ "type": "array",
174
+ "maxItems": 0
175
+ }
176
+ },
177
+ "required": [
178
+ "type",
179
+ "selectors"
180
+ ],
181
+ "additionalProperties": false
182
+ },
183
+ {
184
+ "type": "object",
185
+ "properties": {
186
+ "type": {
187
+ "const": "selectors"
188
+ },
189
+ "selectors": {
190
+ "type": "array",
191
+ "minItems": 1,
192
+ "items": {
193
+ "type": "string",
194
+ "minLength": 1
195
+ }
196
+ }
197
+ },
198
+ "required": [
199
+ "type",
200
+ "selectors"
201
+ ],
202
+ "additionalProperties": false
203
+ }
204
+ ]
205
+ },
206
+ "activated_at": {
207
+ "type": "string",
208
+ "maxLength": 512
209
+ },
210
+ "plan_digest": {
211
+ "type": "string",
212
+ "maxLength": 512
213
+ },
214
+ "definition_digest": {
215
+ "type": "string",
216
+ "maxLength": 512
217
+ },
218
+ "task_digest": {
219
+ "type": "string",
220
+ "maxLength": 512
221
+ },
222
+ "base_sha": {
223
+ "type": "string",
224
+ "maxLength": 512
225
+ },
226
+ "head_sha": {
227
+ "type": "string",
228
+ "maxLength": 512
229
+ },
230
+ "tree_sha": {
231
+ "type": "string",
232
+ "maxLength": 512
233
+ },
234
+ "event_seq": {
235
+ "type": "number"
236
+ },
237
+ "last_change_seq": {
238
+ "type": "number"
239
+ },
240
+ "last_authority_seq": {
241
+ "type": "number"
242
+ },
243
+ "check_receipt_id": {
244
+ "type": "string",
245
+ "maxLength": 512
246
+ }
247
+ },
248
+ "additionalProperties": false
249
+ },
250
+ "ledgerDisplayIdentifier": {
251
+ "type": "string",
252
+ "pattern": "^[A-Za-z0-9@*][A-Za-z0-9@*._:/-]{0,511}$"
253
+ },
254
+ "ledgerCorrelationIdentifier": {
255
+ "type": "string",
256
+ "pattern": "^[A-Za-z0-9@*][A-Za-z0-9@*._:/-]{0,127}$"
257
+ },
258
+ "ledgerCapabilityIdentifier": {
259
+ "type": "string",
260
+ "pattern": "^(?:tool:|ext:|skill:|agent:|workspace:|context:)[A-Za-z0-9@*][A-Za-z0-9@*._/-]{0,255}$"
261
+ },
262
+ "refusalCode": {
263
+ "type": "string",
264
+ "enum": [
265
+ "CAPABILITY_ESCALATION",
266
+ "GRANT_ID_MALFORMED",
267
+ "DEFINITION_NOT_AUTHORIZED",
268
+ "UNDECLARED_TOOLS",
269
+ "UNKNOWN_TOOL",
270
+ "GATED_UNAPPROVED",
271
+ "APPROVAL_EXPIRED",
272
+ "APPROVAL_SCOPE_MISMATCH",
273
+ "APPROVAL_FLOW_FAILED",
274
+ "DEPTH_EXCEEDED",
275
+ "FANOUT_EXCEEDED",
276
+ "EXECUTOR_UNAVAILABLE",
277
+ "MODEL_UNRESOLVED",
278
+ "GRANT_STORE_INVALID",
279
+ "CHILD_TIMED_OUT",
280
+ "CHILD_CANCELLED",
281
+ "CHILD_EXIT_NONZERO",
282
+ "TASK_MISSING",
283
+ "UNKNOWN_DEFINITION",
284
+ "CEILING_PATTERNS_UNRESOLVED",
285
+ "NARROWING_VIOLATED",
286
+ "DEFINITION_UNREADABLE",
287
+ "CORRELATION_TOO_LARGE",
288
+ "CORRELATION_INVALID",
289
+ "LEDGER_WRITE_FAILED",
290
+ "FANOUT_FAILED",
291
+ "WORKSPACE_NOT_REGISTERED",
292
+ "WORKSPACE_NOT_AUTHORIZED",
293
+ "WORKSPACE_WRITE_CONFLICT",
294
+ "WORKSPACE_LEASE_STALE",
295
+ "LEDGER_DAMAGED",
296
+ "CONTEXT_REQUEST_INVALID"
297
+ ]
298
+ },
299
+ "refusal": {
300
+ "type": "object",
301
+ "properties": {
302
+ "code": {
303
+ "$ref": "#/$defs/refusalCode"
304
+ },
305
+ "message": {
306
+ "type": "string"
307
+ },
308
+ "details": {
309
+ "type": "object",
310
+ "additionalProperties": {
311
+ "type": [
312
+ "string",
313
+ "number",
314
+ "boolean",
315
+ "null"
316
+ ]
317
+ }
318
+ }
319
+ },
320
+ "required": [
321
+ "code",
322
+ "message"
323
+ ],
324
+ "additionalProperties": false
325
+ },
326
+ "approvalSource": {
327
+ "type": "string",
328
+ "enum": [
329
+ "prompt",
330
+ "session",
331
+ "persisted",
332
+ "inherited"
333
+ ]
334
+ },
335
+ "approvalScope": {
336
+ "type": "string",
337
+ "enum": [
338
+ "once",
339
+ "session",
340
+ "always"
341
+ ]
342
+ },
343
+ "approvalUse": {
344
+ "type": "object",
345
+ "properties": {
346
+ "max": {
347
+ "type": "integer",
348
+ "minimum": 0
349
+ },
350
+ "remaining": {
351
+ "type": "integer",
352
+ "minimum": 0
353
+ }
354
+ },
355
+ "required": [
356
+ "max",
357
+ "remaining"
358
+ ],
359
+ "additionalProperties": false
360
+ },
361
+ "definitionDigest": {
362
+ "type": "object",
363
+ "properties": {
364
+ "name": {
365
+ "type": "string"
366
+ },
367
+ "source": {
368
+ "type": "string"
369
+ },
370
+ "sha256": {
371
+ "type": "string",
372
+ "pattern": "^[a-fA-F0-9]{64}$"
373
+ }
374
+ },
375
+ "required": [
376
+ "name",
377
+ "source",
378
+ "sha256"
379
+ ],
380
+ "additionalProperties": false
381
+ },
382
+ "capabilityDecision": {
383
+ "type": "object",
384
+ "properties": {
385
+ "ledgerVersion": {
386
+ "const": 3
387
+ },
388
+ "event": {
389
+ "const": "capability_decision"
390
+ },
391
+ "ts": {
392
+ "$ref": "#/$defs/timestamp"
393
+ },
394
+ "episodeId": {
395
+ "$ref": "#/$defs/episodeId"
396
+ },
397
+ "parentId": {
398
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
399
+ },
400
+ "childId": {
401
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
402
+ },
403
+ "depth": {
404
+ "type": "integer",
405
+ "minimum": 0
406
+ },
407
+ "agentType": {
408
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
409
+ },
410
+ "requested": {
411
+ "type": "array",
412
+ "items": {
413
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
414
+ }
415
+ },
416
+ "parentGrant": {
417
+ "type": "array",
418
+ "items": {
419
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
420
+ }
421
+ },
422
+ "effective": {
423
+ "type": "array",
424
+ "items": {
425
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
426
+ }
427
+ },
428
+ "denied": {
429
+ "type": "array",
430
+ "items": {
431
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
432
+ }
433
+ },
434
+ "clipped": {
435
+ "type": "array",
436
+ "items": {
437
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
438
+ }
439
+ },
440
+ "gatedBlocked": {
441
+ "type": "array",
442
+ "items": {
443
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
444
+ }
445
+ },
446
+ "blocked": {
447
+ "type": "boolean"
448
+ },
449
+ "reason": {
450
+ "type": "string"
451
+ },
452
+ "approved": {
453
+ "type": "array",
454
+ "items": {
455
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
456
+ }
457
+ },
458
+ "approvalSource": {
459
+ "$ref": "#/$defs/approvalSource"
460
+ },
461
+ "approvalSources": {
462
+ "type": "object",
463
+ "propertyNames": {
464
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
465
+ },
466
+ "additionalProperties": {
467
+ "$ref": "#/$defs/approvalSource"
468
+ }
469
+ },
470
+ "approvalScopes": {
471
+ "type": "object",
472
+ "propertyNames": {
473
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
474
+ },
475
+ "additionalProperties": {
476
+ "$ref": "#/$defs/approvalScope"
477
+ }
478
+ },
479
+ "approvalExpiresAt": {
480
+ "type": "object",
481
+ "propertyNames": {
482
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
483
+ },
484
+ "additionalProperties": {
485
+ "$ref": "#/$defs/timestamp"
486
+ }
487
+ },
488
+ "approvalUses": {
489
+ "type": "object",
490
+ "propertyNames": {
491
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
492
+ },
493
+ "additionalProperties": {
494
+ "$ref": "#/$defs/approvalUse"
495
+ }
496
+ },
497
+ "approvalScope": {
498
+ "$ref": "#/$defs/approvalScope"
499
+ },
500
+ "humanDenied": {
501
+ "const": true
502
+ },
503
+ "gateOutcome": {
504
+ "type": "string",
505
+ "enum": [
506
+ "declined",
507
+ "dismissed",
508
+ "no-ui",
509
+ "error"
510
+ ]
511
+ },
512
+ "definitionDigest": {
513
+ "$ref": "#/$defs/definitionDigest"
514
+ },
515
+ "definitionHash": {
516
+ "type": "string",
517
+ "pattern": "^[a-f0-9]{64}$"
518
+ },
519
+ "definitionPackageVersion": {
520
+ "type": "string",
521
+ "pattern": "^[0-9A-Za-z][0-9A-Za-z.+_-]{0,127}$"
522
+ },
523
+ "handoff": {
524
+ "type": "object",
525
+ "description": "the context handoff this child received (ADR-0078); absent means nothing crossed",
526
+ "additionalProperties": false,
527
+ "required": [
528
+ "mode",
529
+ "sections",
530
+ "bytes",
531
+ "truncatedBytes"
532
+ ],
533
+ "properties": {
534
+ "mode": {
535
+ "enum": [
536
+ "files",
537
+ "pruned",
538
+ "summary",
539
+ "fork"
540
+ ]
541
+ },
542
+ "sections": {
543
+ "type": "integer",
544
+ "minimum": 0
545
+ },
546
+ "bytes": {
547
+ "type": "integer",
548
+ "minimum": 0
549
+ },
550
+ "truncatedBytes": {
551
+ "type": "integer",
552
+ "minimum": 0
553
+ },
554
+ "keptTurns": {
555
+ "type": "integer",
556
+ "minimum": 0
557
+ },
558
+ "droppedTurns": {
559
+ "type": "integer",
560
+ "minimum": 0
561
+ },
562
+ "rule": {
563
+ "type": "string"
564
+ }
565
+ }
566
+ },
567
+ "executor": {
568
+ "type": "string",
569
+ "enum": [
570
+ "process",
571
+ "herdr"
572
+ ]
573
+ },
574
+ "taskFrom": {
575
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
576
+ },
577
+ "taskDigest": {
578
+ "type": "string",
579
+ "pattern": "^[a-fA-F0-9]{64}$"
580
+ },
581
+ "correlation": {
582
+ "$ref": "#/$defs/correlation"
583
+ },
584
+ "refusal": {
585
+ "$ref": "#/$defs/refusal"
586
+ },
587
+ "executionId": {
588
+ "$ref": "#/$defs/executionId"
589
+ },
590
+ "parentExecutionId": {
591
+ "oneOf": [
592
+ {
593
+ "$ref": "#/$defs/executionId"
594
+ },
595
+ {
596
+ "type": "null"
597
+ }
598
+ ]
599
+ },
600
+ "taskFromExecutionId": {
601
+ "$ref": "#/$defs/executionId"
602
+ }
603
+ },
604
+ "required": [
605
+ "ledgerVersion",
606
+ "event",
607
+ "ts",
608
+ "executionId",
609
+ "parentExecutionId",
610
+ "parentId",
611
+ "childId",
612
+ "depth",
613
+ "requested",
614
+ "parentGrant",
615
+ "effective",
616
+ "denied",
617
+ "clipped",
618
+ "gatedBlocked",
619
+ "blocked",
620
+ "executor",
621
+ "taskDigest"
622
+ ],
623
+ "additionalProperties": false
624
+ },
625
+ "workspaceLease": {
626
+ "type": "object",
627
+ "properties": {
628
+ "ledgerVersion": {
629
+ "const": 3
630
+ },
631
+ "event": {
632
+ "const": "workspace_lease"
633
+ },
634
+ "ts": {
635
+ "$ref": "#/$defs/timestamp"
636
+ },
637
+ "episodeId": {
638
+ "$ref": "#/$defs/episodeId"
639
+ },
640
+ "childId": {
641
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
642
+ },
643
+ "workspaceId": {
644
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
645
+ },
646
+ "root": {
647
+ "type": "string",
648
+ "minLength": 1
649
+ },
650
+ "access": {
651
+ "type": "string",
652
+ "enum": [
653
+ "read",
654
+ "write"
655
+ ]
656
+ },
657
+ "outcome": {
658
+ "type": "string",
659
+ "enum": [
660
+ "acquired",
661
+ "uncontended",
662
+ "refused",
663
+ "released",
664
+ "released-unrecorded",
665
+ "lost",
666
+ "retained",
667
+ "timeout",
668
+ "recovered"
669
+ ]
670
+ },
671
+ "recovered": {
672
+ "oneOf": [
673
+ {
674
+ "type": "boolean"
675
+ },
676
+ {
677
+ "const": "unknown"
678
+ }
679
+ ]
680
+ },
681
+ "releaseReason": {
682
+ "type": "string"
683
+ },
684
+ "refusal": {
685
+ "$ref": "#/$defs/refusal"
686
+ },
687
+ "correlation": {
688
+ "$ref": "#/$defs/correlation"
689
+ },
690
+ "executionId": {
691
+ "$ref": "#/$defs/executionId"
692
+ },
693
+ "parentExecutionId": {
694
+ "oneOf": [
695
+ {
696
+ "$ref": "#/$defs/executionId"
697
+ },
698
+ {
699
+ "type": "null"
700
+ }
701
+ ]
702
+ }
703
+ },
704
+ "required": [
705
+ "ledgerVersion",
706
+ "event",
707
+ "ts",
708
+ "executionId",
709
+ "parentExecutionId",
710
+ "childId",
711
+ "workspaceId",
712
+ "root",
713
+ "access",
714
+ "outcome"
715
+ ],
716
+ "additionalProperties": false
717
+ },
718
+ "childLifecycle": {
719
+ "type": "object",
720
+ "properties": {
721
+ "ledgerVersion": {
722
+ "const": 3
723
+ },
724
+ "event": {
725
+ "const": "child_lifecycle"
726
+ },
727
+ "ts": {
728
+ "$ref": "#/$defs/timestamp"
729
+ },
730
+ "episodeId": {
731
+ "$ref": "#/$defs/episodeId"
732
+ },
733
+ "childId": {
734
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
735
+ },
736
+ "state": {
737
+ "type": "string",
738
+ "enum": [
739
+ "starting",
740
+ "running",
741
+ "completed",
742
+ "failed"
743
+ ]
744
+ },
745
+ "executor": {
746
+ "type": "string",
747
+ "enum": [
748
+ "process",
749
+ "herdr"
750
+ ]
751
+ },
752
+ "exitCode": {
753
+ "type": [
754
+ "integer",
755
+ "null"
756
+ ]
757
+ },
758
+ "signal": {
759
+ "oneOf": [
760
+ {
761
+ "type": "string",
762
+ "enum": [
763
+ "SIGABRT",
764
+ "SIGALRM",
765
+ "SIGBUS",
766
+ "SIGCHLD",
767
+ "SIGCONT",
768
+ "SIGFPE",
769
+ "SIGHUP",
770
+ "SIGILL",
771
+ "SIGINT",
772
+ "SIGIO",
773
+ "SIGIOT",
774
+ "SIGKILL",
775
+ "SIGPIPE",
776
+ "SIGPOLL",
777
+ "SIGPROF",
778
+ "SIGPWR",
779
+ "SIGQUIT",
780
+ "SIGSEGV",
781
+ "SIGSTKFLT",
782
+ "SIGSTOP",
783
+ "SIGSYS",
784
+ "SIGTERM",
785
+ "SIGTRAP",
786
+ "SIGTSTP",
787
+ "SIGTTIN",
788
+ "SIGTTOU",
789
+ "SIGUNUSED",
790
+ "SIGURG",
791
+ "SIGUSR1",
792
+ "SIGUSR2",
793
+ "SIGVTALRM",
794
+ "SIGWINCH",
795
+ "SIGXCPU",
796
+ "SIGXFSZ",
797
+ "SIGBREAK",
798
+ "SIGLOST",
799
+ "SIGINFO"
800
+ ]
801
+ },
802
+ {
803
+ "type": "null"
804
+ }
805
+ ]
806
+ },
807
+ "timedOut": {
808
+ "const": true
809
+ },
810
+ "aborted": {
811
+ "const": true
812
+ },
813
+ "truncated": {
814
+ "const": true
815
+ },
816
+ "reason": {
817
+ "type": "string"
818
+ },
819
+ "correlation": {
820
+ "$ref": "#/$defs/correlation"
821
+ },
822
+ "executionId": {
823
+ "$ref": "#/$defs/executionId"
824
+ },
825
+ "parentExecutionId": {
826
+ "oneOf": [
827
+ {
828
+ "$ref": "#/$defs/executionId"
829
+ },
830
+ {
831
+ "type": "null"
832
+ }
833
+ ]
834
+ },
835
+ "deadlineAt": {
836
+ "$ref": "#/$defs/timestamp"
837
+ },
838
+ "idleTimeoutMs": {
839
+ "type": "integer",
840
+ "minimum": 1,
841
+ "description": "the inactivity bound in milliseconds that governed this child beside the deadlineAt ceiling"
842
+ },
843
+ "resolvedModel": {
844
+ "oneOf": [
845
+ {
846
+ "$ref": "#/$defs/resolvedModel"
847
+ },
848
+ {
849
+ "type": "null"
850
+ }
851
+ ]
852
+ },
853
+ "modelSource": {
854
+ "$ref": "#/$defs/modelSource"
855
+ },
856
+ "thinkingLevel": {
857
+ "oneOf": [
858
+ {
859
+ "$ref": "#/$defs/thinkingLevel"
860
+ },
861
+ {
862
+ "type": "null"
863
+ }
864
+ ]
865
+ },
866
+ "thinkingSource": {
867
+ "$ref": "#/$defs/thinkingSource"
868
+ },
869
+ "tokenDetail": {
870
+ "$ref": "#/$defs/tokenDetail"
871
+ },
872
+ "usage": {
873
+ "$ref": "#/$defs/childUsage"
874
+ },
875
+ "compactionCount": {
876
+ "type": "integer",
877
+ "minimum": 0
878
+ },
879
+ "usageUnavailable": {
880
+ "enum": [
881
+ "session-missing",
882
+ "session-invalid",
883
+ "usage-missing"
884
+ ]
885
+ },
886
+ "exportedEnvironment": {
887
+ "type": "array",
888
+ "minItems": 3,
889
+ "maxItems": 3,
890
+ "uniqueItems": true,
891
+ "items": {
892
+ "enum": [
893
+ "PI_DADDY_EPISODE",
894
+ "PI_DADDY_DEFINITION",
895
+ "PI_DADDY_EXECUTION"
896
+ ]
897
+ }
898
+ },
899
+ "definitionHash": {
900
+ "type": "string",
901
+ "pattern": "^[a-f0-9]{64}$"
902
+ },
903
+ "definitionPackageVersion": {
904
+ "type": "string",
905
+ "pattern": "^[0-9A-Za-z][0-9A-Za-z.+_-]{0,127}$"
906
+ },
907
+ "herdrPaneId": {
908
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
909
+ },
910
+ "herdrAgentName": {
911
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
912
+ }
913
+ },
914
+ "required": [
915
+ "ledgerVersion",
916
+ "event",
917
+ "ts",
918
+ "executionId",
919
+ "parentExecutionId",
920
+ "childId",
921
+ "state",
922
+ "executor"
923
+ ],
924
+ "additionalProperties": false,
925
+ "not": {
926
+ "required": [
927
+ "usage",
928
+ "usageUnavailable"
929
+ ]
930
+ },
931
+ "allOf": [
932
+ {
933
+ "if": {
934
+ "properties": {
935
+ "state": {
936
+ "enum": [
937
+ "starting",
938
+ "running"
939
+ ]
940
+ }
941
+ },
942
+ "required": [
943
+ "state"
944
+ ]
945
+ },
946
+ "then": {
947
+ "required": [
948
+ "deadlineAt"
949
+ ]
950
+ }
951
+ },
952
+ {
953
+ "if": {
954
+ "anyOf": [
955
+ {
956
+ "required": [
957
+ "herdrPaneId"
958
+ ]
959
+ },
960
+ {
961
+ "required": [
962
+ "herdrAgentName"
963
+ ]
964
+ }
965
+ ]
966
+ },
967
+ "then": {
968
+ "required": [
969
+ "herdrPaneId",
970
+ "herdrAgentName"
971
+ ],
972
+ "properties": {
973
+ "executor": {
974
+ "const": "herdr"
975
+ }
976
+ }
977
+ }
978
+ }
979
+ ]
980
+ },
981
+ "resolvedModel": {
982
+ "type": "object",
983
+ "additionalProperties": false,
984
+ "required": [
985
+ "provider",
986
+ "modelId"
987
+ ],
988
+ "properties": {
989
+ "provider": {
990
+ "type": "string",
991
+ "minLength": 1
992
+ },
993
+ "modelId": {
994
+ "type": "string",
995
+ "minLength": 1
996
+ }
997
+ }
998
+ },
999
+ "thinkingLevel": {
1000
+ "type": "object",
1001
+ "additionalProperties": false,
1002
+ "required": [
1003
+ "level",
1004
+ "source"
1005
+ ],
1006
+ "properties": {
1007
+ "level": {
1008
+ "type": "string",
1009
+ "minLength": 1
1010
+ },
1011
+ "source": {
1012
+ "enum": [
1013
+ "explicit",
1014
+ "session",
1015
+ "advisor",
1016
+ "definition",
1017
+ "global",
1018
+ "pi"
1019
+ ]
1020
+ }
1021
+ }
1022
+ },
1023
+ "modelSource": {
1024
+ "enum": [
1025
+ "explicit",
1026
+ "session",
1027
+ "definition",
1028
+ "global",
1029
+ "pi"
1030
+ ]
1031
+ },
1032
+ "thinkingSource": {
1033
+ "enum": [
1034
+ "explicit",
1035
+ "session",
1036
+ "advisor",
1037
+ "definition",
1038
+ "global",
1039
+ "pi"
1040
+ ]
1041
+ },
1042
+ "tokenDetail": {
1043
+ "type": "object",
1044
+ "additionalProperties": false,
1045
+ "required": [
1046
+ "inputTokens",
1047
+ "outputTokens",
1048
+ "cacheReadTokens",
1049
+ "cacheWriteTokens",
1050
+ "reasoningTokens"
1051
+ ],
1052
+ "properties": {
1053
+ "inputTokens": {
1054
+ "$ref": "#/$defs/reportedTokenCount"
1055
+ },
1056
+ "outputTokens": {
1057
+ "$ref": "#/$defs/reportedTokenCount"
1058
+ },
1059
+ "cacheReadTokens": {
1060
+ "$ref": "#/$defs/reportedTokenCount"
1061
+ },
1062
+ "cacheWriteTokens": {
1063
+ "$ref": "#/$defs/reportedTokenCount"
1064
+ },
1065
+ "reasoningTokens": {
1066
+ "$ref": "#/$defs/reportedTokenCount"
1067
+ }
1068
+ }
1069
+ },
1070
+ "reportedTokenCount": {
1071
+ "oneOf": [
1072
+ {
1073
+ "type": "number",
1074
+ "exclusiveMinimum": 0
1075
+ },
1076
+ {
1077
+ "type": "null"
1078
+ }
1079
+ ]
1080
+ },
1081
+ "childUsage": {
1082
+ "type": "object",
1083
+ "additionalProperties": false,
1084
+ "required": [
1085
+ "input",
1086
+ "output",
1087
+ "cacheRead",
1088
+ "cacheWrite",
1089
+ "totalTokens",
1090
+ "cost"
1091
+ ],
1092
+ "properties": {
1093
+ "input": {
1094
+ "type": "number",
1095
+ "minimum": 0
1096
+ },
1097
+ "output": {
1098
+ "type": "number",
1099
+ "minimum": 0
1100
+ },
1101
+ "cacheRead": {
1102
+ "type": "number",
1103
+ "minimum": 0
1104
+ },
1105
+ "cacheWrite": {
1106
+ "type": "number",
1107
+ "minimum": 0
1108
+ },
1109
+ "reasoning": {
1110
+ "type": "number",
1111
+ "minimum": 0
1112
+ },
1113
+ "totalTokens": {
1114
+ "type": "number",
1115
+ "minimum": 0
1116
+ },
1117
+ "cost": {
1118
+ "type": "object",
1119
+ "additionalProperties": false,
1120
+ "required": [
1121
+ "input",
1122
+ "output",
1123
+ "cacheRead",
1124
+ "cacheWrite",
1125
+ "total"
1126
+ ],
1127
+ "properties": {
1128
+ "input": {
1129
+ "type": "number",
1130
+ "minimum": 0
1131
+ },
1132
+ "output": {
1133
+ "type": "number",
1134
+ "minimum": 0
1135
+ },
1136
+ "cacheRead": {
1137
+ "type": "number",
1138
+ "minimum": 0
1139
+ },
1140
+ "cacheWrite": {
1141
+ "type": "number",
1142
+ "minimum": 0
1143
+ },
1144
+ "total": {
1145
+ "type": "number",
1146
+ "minimum": 0
1147
+ }
1148
+ }
1149
+ }
1150
+ }
1151
+ },
1152
+ "executionId": {
1153
+ "type": "string",
1154
+ "pattern": "^exec:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
1155
+ },
1156
+ "costGate": {
1157
+ "type": "object",
1158
+ "properties": {
1159
+ "ledgerVersion": {
1160
+ "const": 3
1161
+ },
1162
+ "event": {
1163
+ "const": "cost_gate"
1164
+ },
1165
+ "ts": {
1166
+ "$ref": "#/$defs/timestamp"
1167
+ },
1168
+ "episodeId": {
1169
+ "$ref": "#/$defs/episodeId"
1170
+ },
1171
+ "executionId": {
1172
+ "$ref": "#/$defs/executionId"
1173
+ },
1174
+ "parentExecutionId": {
1175
+ "oneOf": [
1176
+ {
1177
+ "$ref": "#/$defs/executionId"
1178
+ },
1179
+ {
1180
+ "type": "null"
1181
+ }
1182
+ ]
1183
+ },
1184
+ "childId": {
1185
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
1186
+ },
1187
+ "gate": {
1188
+ "const": "episode_cost"
1189
+ },
1190
+ "cost": {
1191
+ "type": "number",
1192
+ "minimum": 0
1193
+ },
1194
+ "ceiling": {
1195
+ "type": "number",
1196
+ "exclusiveMinimum": 0
1197
+ },
1198
+ "outcome": {
1199
+ "enum": [
1200
+ "continued",
1201
+ "stopped"
1202
+ ]
1203
+ },
1204
+ "newCeiling": {
1205
+ "type": "number",
1206
+ "exclusiveMinimum": 0
1207
+ }
1208
+ },
1209
+ "required": [
1210
+ "ledgerVersion",
1211
+ "event",
1212
+ "ts",
1213
+ "episodeId",
1214
+ "executionId",
1215
+ "parentExecutionId",
1216
+ "childId",
1217
+ "gate",
1218
+ "cost",
1219
+ "ceiling",
1220
+ "outcome"
1221
+ ],
1222
+ "additionalProperties": false
1223
+ },
1224
+ "sessionConfig": {
1225
+ "type": "object",
1226
+ "properties": {
1227
+ "ledgerVersion": {
1228
+ "const": 3
1229
+ },
1230
+ "event": {
1231
+ "const": "session_config"
1232
+ },
1233
+ "ts": {
1234
+ "$ref": "#/$defs/timestamp"
1235
+ },
1236
+ "episodeId": {
1237
+ "$ref": "#/$defs/episodeId"
1238
+ },
1239
+ "outcome": {
1240
+ "enum": [
1241
+ "kept",
1242
+ "changed"
1243
+ ]
1244
+ },
1245
+ "trigger": {
1246
+ "enum": [
1247
+ "first-delegation",
1248
+ "grants-models"
1249
+ ]
1250
+ },
1251
+ "overrides": {
1252
+ "type": "object",
1253
+ "additionalProperties": {
1254
+ "type": "object",
1255
+ "properties": {
1256
+ "model": {
1257
+ "type": "string",
1258
+ "minLength": 1
1259
+ },
1260
+ "thinking": {
1261
+ "type": "string",
1262
+ "minLength": 1
1263
+ }
1264
+ },
1265
+ "required": [
1266
+ "model",
1267
+ "thinking"
1268
+ ],
1269
+ "additionalProperties": false
1270
+ }
1271
+ }
1272
+ },
1273
+ "required": [
1274
+ "ledgerVersion",
1275
+ "event",
1276
+ "ts",
1277
+ "episodeId",
1278
+ "outcome",
1279
+ "trigger",
1280
+ "overrides"
1281
+ ],
1282
+ "additionalProperties": false
1283
+ },
1284
+ "episodeOutcome": {
1285
+ "type": "object",
1286
+ "properties": {
1287
+ "ledgerVersion": {
1288
+ "const": 3
1289
+ },
1290
+ "event": {
1291
+ "const": "episode_outcome"
1292
+ },
1293
+ "ts": {
1294
+ "$ref": "#/$defs/timestamp"
1295
+ },
1296
+ "episodeId": {
1297
+ "$ref": "#/$defs/episodeId"
1298
+ },
1299
+ "commit": {
1300
+ "type": "string",
1301
+ "pattern": "^[0-9a-f]{40}$"
1302
+ },
1303
+ "survived": {
1304
+ "type": "boolean"
1305
+ },
1306
+ "ci": {
1307
+ "enum": [
1308
+ "green",
1309
+ "red",
1310
+ "none"
1311
+ ]
1312
+ },
1313
+ "amended": {
1314
+ "type": "boolean"
1315
+ },
1316
+ "corrected": {
1317
+ "type": "boolean"
1318
+ },
1319
+ "label": {
1320
+ "enum": [
1321
+ "positive",
1322
+ "negative",
1323
+ "unknown"
1324
+ ]
1325
+ }
1326
+ },
1327
+ "required": [
1328
+ "ledgerVersion",
1329
+ "event",
1330
+ "ts",
1331
+ "episodeId",
1332
+ "commit",
1333
+ "survived",
1334
+ "ci",
1335
+ "amended",
1336
+ "corrected",
1337
+ "label"
1338
+ ],
1339
+ "additionalProperties": false
1340
+ }
1341
+ }
1342
+ };
1343
+ //# sourceMappingURL=pi-daddy-record-v1-contract.js.map