@peac/kernel 0.11.1 → 0.11.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/dist/index.mjs CHANGED
@@ -338,7 +338,8 @@ var ERRORS = {
338
338
  http_status: 400,
339
339
  title: "Attribution Chain Too Deep",
340
340
  description: "Attribution chain exceeds maximum allowed depth (8)",
341
- retriable: false,
341
+ retryable: false,
342
+ next_action: "retry_with_different_input",
342
343
  category: "attribution"
343
344
  },
344
345
  E_ATTRIBUTION_CIRCULAR_CHAIN: {
@@ -346,7 +347,8 @@ var ERRORS = {
346
347
  http_status: 400,
347
348
  title: "Attribution Circular Chain",
348
349
  description: "Circular reference detected in attribution chain",
349
- retriable: false,
350
+ retryable: false,
351
+ next_action: "retry_with_different_input",
350
352
  category: "attribution"
351
353
  },
352
354
  E_ATTRIBUTION_EXPIRED: {
@@ -354,7 +356,8 @@ var ERRORS = {
354
356
  http_status: 401,
355
357
  title: "Attribution Expired",
356
358
  description: "Attribution attestation has exceeded its expiration time",
357
- retriable: false,
359
+ retryable: false,
360
+ next_action: "retry_with_different_input",
358
361
  category: "attribution"
359
362
  },
360
363
  E_ATTRIBUTION_HASH_INVALID: {
@@ -362,7 +365,8 @@ var ERRORS = {
362
365
  http_status: 400,
363
366
  title: "Attribution Hash Invalid",
364
367
  description: "Content hash structure is invalid (wrong algorithm, encoding, or value length)",
365
- retriable: false,
368
+ retryable: false,
369
+ next_action: "retry_with_different_input",
366
370
  category: "attribution"
367
371
  },
368
372
  E_ATTRIBUTION_INVALID_FORMAT: {
@@ -370,7 +374,8 @@ var ERRORS = {
370
374
  http_status: 400,
371
375
  title: "Attribution Invalid Format",
372
376
  description: "Attribution attestation does not conform to schema",
373
- retriable: false,
377
+ retryable: false,
378
+ next_action: "retry_with_different_input",
374
379
  category: "attribution"
375
380
  },
376
381
  E_ATTRIBUTION_INVALID_REF: {
@@ -378,7 +383,8 @@ var ERRORS = {
378
383
  http_status: 400,
379
384
  title: "Attribution Invalid Reference",
380
385
  description: "Receipt reference format is invalid (must be jti:{id}, URL, or URN)",
381
- retriable: false,
386
+ retryable: false,
387
+ next_action: "retry_with_different_input",
382
388
  category: "attribution"
383
389
  },
384
390
  E_ATTRIBUTION_INVALID_WEIGHT: {
@@ -386,7 +392,8 @@ var ERRORS = {
386
392
  http_status: 400,
387
393
  title: "Attribution Invalid Weight",
388
394
  description: "Attribution weight is out of valid range (must be 0.0-1.0)",
389
- retriable: false,
395
+ retryable: false,
396
+ next_action: "retry_with_different_input",
390
397
  category: "attribution"
391
398
  },
392
399
  E_ATTRIBUTION_MISSING_SOURCES: {
@@ -394,7 +401,8 @@ var ERRORS = {
394
401
  http_status: 400,
395
402
  title: "Attribution Missing Sources",
396
403
  description: "Attribution attestation has empty sources array",
397
- retriable: false,
404
+ retryable: false,
405
+ next_action: "retry_with_different_input",
398
406
  category: "attribution"
399
407
  },
400
408
  E_ATTRIBUTION_NOT_YET_VALID: {
@@ -402,7 +410,8 @@ var ERRORS = {
402
410
  http_status: 401,
403
411
  title: "Attribution Not Yet Valid",
404
412
  description: "Attribution attestation issued_at time is in the future",
405
- retriable: true,
413
+ retryable: true,
414
+ next_action: "retry_after_delay",
406
415
  category: "attribution"
407
416
  },
408
417
  E_ATTRIBUTION_RESOLUTION_FAILED: {
@@ -410,7 +419,8 @@ var ERRORS = {
410
419
  http_status: 502,
411
420
  title: "Attribution Resolution Failed",
412
421
  description: "Failed to resolve receipt reference in attribution chain",
413
- retriable: true,
422
+ retryable: true,
423
+ next_action: "retry_after_delay",
414
424
  category: "attribution"
415
425
  },
416
426
  E_ATTRIBUTION_RESOLUTION_TIMEOUT: {
@@ -418,7 +428,8 @@ var ERRORS = {
418
428
  http_status: 504,
419
429
  title: "Attribution Resolution Timeout",
420
430
  description: "Timeout while resolving receipt reference in attribution chain",
421
- retriable: true,
431
+ retryable: true,
432
+ next_action: "retry_after_delay",
422
433
  category: "attribution"
423
434
  },
424
435
  E_ATTRIBUTION_SIZE_EXCEEDED: {
@@ -426,7 +437,8 @@ var ERRORS = {
426
437
  http_status: 400,
427
438
  title: "Attribution Size Exceeded",
428
439
  description: "Attribution attestation exceeds maximum size (64KB)",
429
- retriable: false,
440
+ retryable: false,
441
+ next_action: "retry_with_different_input",
430
442
  category: "attribution"
431
443
  },
432
444
  E_ATTRIBUTION_TOO_MANY_SOURCES: {
@@ -434,7 +446,8 @@ var ERRORS = {
434
446
  http_status: 400,
435
447
  title: "Attribution Too Many Sources",
436
448
  description: "Attribution has too many sources (maximum 100)",
437
- retriable: false,
449
+ retryable: false,
450
+ next_action: "retry_with_different_input",
438
451
  category: "attribution"
439
452
  },
440
453
  E_ATTRIBUTION_UNKNOWN_USAGE: {
@@ -442,7 +455,8 @@ var ERRORS = {
442
455
  http_status: 400,
443
456
  title: "Attribution Unknown Usage",
444
457
  description: "Attribution usage type is not recognized",
445
- retriable: false,
458
+ retryable: false,
459
+ next_action: "retry_with_different_input",
446
460
  category: "attribution"
447
461
  },
448
462
  // Bundle error codes
@@ -451,7 +465,8 @@ var ERRORS = {
451
465
  http_status: 400,
452
466
  title: "Bundle Duplicate Receipt",
453
467
  description: "Bundle contains multiple receipts with the same ID",
454
- retriable: false,
468
+ retryable: false,
469
+ next_action: "retry_with_different_input",
455
470
  category: "bundle"
456
471
  },
457
472
  E_BUNDLE_HASH_MISMATCH: {
@@ -459,7 +474,8 @@ var ERRORS = {
459
474
  http_status: 400,
460
475
  title: "Bundle Hash Mismatch",
461
476
  description: "File hash does not match value declared in manifest.json",
462
- retriable: false,
477
+ retryable: false,
478
+ next_action: "retry_with_different_input",
463
479
  category: "bundle"
464
480
  },
465
481
  E_BUNDLE_INVALID_FORMAT: {
@@ -467,7 +483,8 @@ var ERRORS = {
467
483
  http_status: 400,
468
484
  title: "Bundle Invalid Format",
469
485
  description: "Bundle archive structure is invalid (not a valid ZIP or missing required files)",
470
- retriable: false,
486
+ retryable: false,
487
+ next_action: "retry_with_different_input",
471
488
  category: "bundle"
472
489
  },
473
490
  E_BUNDLE_KEY_MISSING: {
@@ -475,7 +492,8 @@ var ERRORS = {
475
492
  http_status: 400,
476
493
  title: "Bundle Key Missing",
477
494
  description: "Required signing key not found in bundle (offline verification mode)",
478
- retriable: false,
495
+ retryable: false,
496
+ next_action: "retry_with_different_input",
479
497
  category: "bundle"
480
498
  },
481
499
  E_BUNDLE_MANIFEST_INVALID: {
@@ -483,7 +501,8 @@ var ERRORS = {
483
501
  http_status: 400,
484
502
  title: "Bundle Manifest Invalid",
485
503
  description: "manifest.json does not conform to schema or contains invalid values",
486
- retriable: false,
504
+ retryable: false,
505
+ next_action: "retry_with_different_input",
487
506
  category: "bundle"
488
507
  },
489
508
  E_BUNDLE_MANIFEST_MISSING: {
@@ -491,7 +510,8 @@ var ERRORS = {
491
510
  http_status: 400,
492
511
  title: "Bundle Manifest Missing",
493
512
  description: "manifest.json not found at bundle archive root",
494
- retriable: false,
513
+ retryable: false,
514
+ next_action: "retry_with_different_input",
495
515
  category: "bundle"
496
516
  },
497
517
  E_BUNDLE_MISSING_KEYS: {
@@ -499,7 +519,8 @@ var ERRORS = {
499
519
  http_status: 400,
500
520
  title: "Bundle Missing Keys",
501
521
  description: "No verification keys provided in bundle JWKS",
502
- retriable: false,
522
+ retryable: false,
523
+ next_action: "retry_with_different_input",
503
524
  category: "bundle"
504
525
  },
505
526
  E_BUNDLE_MISSING_RECEIPTS: {
@@ -507,7 +528,8 @@ var ERRORS = {
507
528
  http_status: 400,
508
529
  title: "Bundle Missing Receipts",
509
530
  description: "No receipts provided when creating bundle",
510
- retriable: false,
531
+ retryable: false,
532
+ next_action: "retry_with_different_input",
511
533
  category: "bundle"
512
534
  },
513
535
  E_BUNDLE_PATH_TRAVERSAL: {
@@ -515,7 +537,8 @@ var ERRORS = {
515
537
  http_status: 400,
516
538
  title: "Bundle Path Traversal",
517
539
  description: "Bundle contains path traversal attack (zip-slip vulnerability)",
518
- retriable: false,
540
+ retryable: false,
541
+ next_action: "retry_with_different_input",
519
542
  category: "bundle"
520
543
  },
521
544
  E_BUNDLE_POLICY_HASH_MISMATCH: {
@@ -523,7 +546,8 @@ var ERRORS = {
523
546
  http_status: 400,
524
547
  title: "Bundle Policy Hash Mismatch",
525
548
  description: "Policy snapshot hash does not match policy used to evaluate receipts",
526
- retriable: false,
549
+ retryable: false,
550
+ next_action: "retry_with_different_input",
527
551
  category: "bundle"
528
552
  },
529
553
  E_BUNDLE_RECEIPTS_UNORDERED: {
@@ -531,7 +555,8 @@ var ERRORS = {
531
555
  http_status: 400,
532
556
  title: "Bundle Receipts Unordered",
533
557
  description: "receipts.ndjson is not in deterministic order (issued_at, receipt_id, receipt_hash)",
534
- retriable: false,
558
+ retryable: false,
559
+ next_action: "retry_with_different_input",
535
560
  category: "bundle"
536
561
  },
537
562
  E_BUNDLE_RECEIPT_INVALID: {
@@ -539,7 +564,8 @@ var ERRORS = {
539
564
  http_status: 400,
540
565
  title: "Bundle Receipt Invalid",
541
566
  description: "Receipt JWS in bundle is malformed or missing required claims",
542
- retriable: false,
567
+ retryable: false,
568
+ next_action: "retry_with_different_input",
543
569
  category: "bundle"
544
570
  },
545
571
  E_BUNDLE_SIGNATURE_INVALID: {
@@ -547,7 +573,8 @@ var ERRORS = {
547
573
  http_status: 400,
548
574
  title: "Bundle Signature Invalid",
549
575
  description: "bundle.sig JWS verification failed over manifest hash",
550
- retriable: false,
576
+ retryable: false,
577
+ next_action: "retry_with_different_input",
551
578
  category: "bundle"
552
579
  },
553
580
  E_BUNDLE_SIZE_EXCEEDED: {
@@ -555,7 +582,8 @@ var ERRORS = {
555
582
  http_status: 400,
556
583
  title: "Bundle Size Exceeded",
557
584
  description: "Bundle exceeds size limits (entry count, entry size, or total size)",
558
- retriable: false,
585
+ retryable: false,
586
+ next_action: "retry_with_different_input",
559
587
  category: "bundle"
560
588
  },
561
589
  E_BUNDLE_TIME_RANGE_INVALID: {
@@ -563,7 +591,8 @@ var ERRORS = {
563
591
  http_status: 400,
564
592
  title: "Bundle Time Range Invalid",
565
593
  description: "Receipt issued_at is outside the bundle declared time_range",
566
- retriable: false,
594
+ retryable: false,
595
+ next_action: "retry_with_different_input",
567
596
  category: "bundle"
568
597
  },
569
598
  // Control error codes
@@ -572,7 +601,8 @@ var ERRORS = {
572
601
  http_status: 403,
573
602
  title: "Control Decision Denied",
574
603
  description: "Control engine denied authorization",
575
- retriable: false,
604
+ retryable: false,
605
+ next_action: "contact_issuer",
576
606
  category: "control"
577
607
  },
578
608
  E_CONTROL_REVIEW_REQUIRED: {
@@ -580,7 +610,8 @@ var ERRORS = {
580
610
  http_status: 202,
581
611
  title: "Review Required",
582
612
  description: "Control engine requires manual review",
583
- retriable: true,
613
+ retryable: true,
614
+ next_action: "contact_issuer",
584
615
  category: "control"
585
616
  },
586
617
  // Dispute error codes
@@ -589,7 +620,8 @@ var ERRORS = {
589
620
  http_status: 409,
590
621
  title: "Dispute Duplicate",
591
622
  description: "A dispute with this ID already exists",
592
- retriable: false,
623
+ retryable: false,
624
+ next_action: "retry_with_different_input",
593
625
  category: "dispute"
594
626
  },
595
627
  E_DISPUTE_EXPIRED: {
@@ -597,7 +629,8 @@ var ERRORS = {
597
629
  http_status: 401,
598
630
  title: "Dispute Expired",
599
631
  description: "Dispute attestation has exceeded its expiration time",
600
- retriable: false,
632
+ retryable: false,
633
+ next_action: "retry_with_different_input",
601
634
  category: "dispute"
602
635
  },
603
636
  E_DISPUTE_INVALID_FORMAT: {
@@ -605,7 +638,8 @@ var ERRORS = {
605
638
  http_status: 400,
606
639
  title: "Dispute Invalid Format",
607
640
  description: "Dispute attestation does not conform to schema",
608
- retriable: false,
641
+ retryable: false,
642
+ next_action: "retry_with_different_input",
609
643
  category: "dispute"
610
644
  },
611
645
  E_DISPUTE_INVALID_GROUNDS: {
@@ -613,7 +647,8 @@ var ERRORS = {
613
647
  http_status: 400,
614
648
  title: "Dispute Invalid Grounds",
615
649
  description: "Dispute grounds code is not recognized",
616
- retriable: false,
650
+ retryable: false,
651
+ next_action: "retry_with_different_input",
617
652
  category: "dispute"
618
653
  },
619
654
  E_DISPUTE_INVALID_ID: {
@@ -621,7 +656,8 @@ var ERRORS = {
621
656
  http_status: 400,
622
657
  title: "Dispute Invalid ID",
623
658
  description: "Dispute ID is not a valid ULID format (26 uppercase alphanumeric characters)",
624
- retriable: false,
659
+ retryable: false,
660
+ next_action: "retry_with_different_input",
625
661
  category: "dispute"
626
662
  },
627
663
  E_DISPUTE_INVALID_STATE: {
@@ -629,7 +665,8 @@ var ERRORS = {
629
665
  http_status: 400,
630
666
  title: "Dispute Invalid State",
631
667
  description: "Dispute state is not recognized",
632
- retriable: false,
668
+ retryable: false,
669
+ next_action: "retry_with_different_input",
633
670
  category: "dispute"
634
671
  },
635
672
  E_DISPUTE_INVALID_TARGET_TYPE: {
@@ -637,7 +674,8 @@ var ERRORS = {
637
674
  http_status: 400,
638
675
  title: "Dispute Invalid Target Type",
639
676
  description: "Dispute target type is not recognized (must be receipt, attribution, identity, or policy)",
640
- retriable: false,
677
+ retryable: false,
678
+ next_action: "retry_with_different_input",
641
679
  category: "dispute"
642
680
  },
643
681
  E_DISPUTE_INVALID_TRANSITION: {
@@ -645,7 +683,8 @@ var ERRORS = {
645
683
  http_status: 400,
646
684
  title: "Dispute Invalid Transition",
647
685
  description: "Invalid state transition for dispute lifecycle",
648
- retriable: false,
686
+ retryable: false,
687
+ next_action: "retry_with_different_input",
649
688
  category: "dispute"
650
689
  },
651
690
  E_DISPUTE_INVALID_TYPE: {
@@ -653,7 +692,8 @@ var ERRORS = {
653
692
  http_status: 400,
654
693
  title: "Dispute Invalid Type",
655
694
  description: "Dispute type is not recognized",
656
- retriable: false,
695
+ retryable: false,
696
+ next_action: "retry_with_different_input",
657
697
  category: "dispute"
658
698
  },
659
699
  E_DISPUTE_MISSING_RESOLUTION: {
@@ -661,7 +701,8 @@ var ERRORS = {
661
701
  http_status: 400,
662
702
  title: "Dispute Missing Resolution",
663
703
  description: "Resolution is required for terminal states (resolved, rejected, final)",
664
- retriable: false,
704
+ retryable: false,
705
+ next_action: "retry_with_different_input",
665
706
  category: "dispute"
666
707
  },
667
708
  E_DISPUTE_NOT_YET_VALID: {
@@ -669,7 +710,8 @@ var ERRORS = {
669
710
  http_status: 401,
670
711
  title: "Dispute Not Yet Valid",
671
712
  description: "Dispute attestation issued_at time is in the future",
672
- retriable: true,
713
+ retryable: true,
714
+ next_action: "retry_after_delay",
673
715
  category: "dispute"
674
716
  },
675
717
  E_DISPUTE_OTHER_REQUIRES_DESCRIPTION: {
@@ -677,7 +719,8 @@ var ERRORS = {
677
719
  http_status: 400,
678
720
  title: "Dispute Other Requires Description",
679
721
  description: "Dispute type 'other' requires description of at least 50 characters",
680
- retriable: false,
722
+ retryable: false,
723
+ next_action: "retry_with_different_input",
681
724
  category: "dispute"
682
725
  },
683
726
  E_DISPUTE_RESOLUTION_NOT_ALLOWED: {
@@ -685,7 +728,8 @@ var ERRORS = {
685
728
  http_status: 400,
686
729
  title: "Dispute Resolution Not Allowed",
687
730
  description: "Resolution is only valid for terminal states",
688
- retriable: false,
731
+ retryable: false,
732
+ next_action: "retry_with_different_input",
689
733
  category: "dispute"
690
734
  },
691
735
  E_DISPUTE_TARGET_NOT_FOUND: {
@@ -693,7 +737,8 @@ var ERRORS = {
693
737
  http_status: 404,
694
738
  title: "Dispute Target Not Found",
695
739
  description: "The target receipt, attribution, or identity being disputed was not found",
696
- retriable: true,
740
+ retryable: true,
741
+ next_action: "retry_after_delay",
697
742
  category: "dispute"
698
743
  },
699
744
  // Identity error codes
@@ -702,7 +747,8 @@ var ERRORS = {
702
747
  http_status: 400,
703
748
  title: "Identity Binding Future",
704
749
  description: "Identity binding signed_at timestamp is in the future",
705
- retriable: false,
750
+ retryable: false,
751
+ next_action: "retry_with_different_input",
706
752
  category: "identity"
707
753
  },
708
754
  E_IDENTITY_BINDING_MISMATCH: {
@@ -710,7 +756,8 @@ var ERRORS = {
710
756
  http_status: 400,
711
757
  title: "Identity Binding Mismatch",
712
758
  description: "Identity binding does not match the request being verified",
713
- retriable: false,
759
+ retryable: false,
760
+ next_action: "retry_with_different_input",
714
761
  category: "identity"
715
762
  },
716
763
  E_IDENTITY_BINDING_STALE: {
@@ -718,7 +765,8 @@ var ERRORS = {
718
765
  http_status: 401,
719
766
  title: "Identity Binding Stale",
720
767
  description: "Identity binding is too old and requires fresh binding",
721
- retriable: true,
768
+ retryable: true,
769
+ next_action: "retry_after_delay",
722
770
  category: "identity"
723
771
  },
724
772
  E_IDENTITY_DIRECTORY_UNAVAILABLE: {
@@ -726,7 +774,8 @@ var ERRORS = {
726
774
  http_status: 503,
727
775
  title: "Identity Directory Unavailable",
728
776
  description: "Failed to fetch agent key directory",
729
- retriable: true,
777
+ retryable: true,
778
+ next_action: "retry_after_delay",
730
779
  category: "identity"
731
780
  },
732
781
  E_IDENTITY_EXPIRED: {
@@ -734,7 +783,8 @@ var ERRORS = {
734
783
  http_status: 401,
735
784
  title: "Identity Expired",
736
785
  description: "Agent identity attestation has exceeded its expiration time",
737
- retriable: false,
786
+ retryable: false,
787
+ next_action: "refresh_attestation",
738
788
  category: "identity"
739
789
  },
740
790
  E_IDENTITY_INVALID_FORMAT: {
@@ -742,7 +792,8 @@ var ERRORS = {
742
792
  http_status: 400,
743
793
  title: "Identity Invalid Format",
744
794
  description: "Agent identity attestation does not conform to schema",
745
- retriable: false,
795
+ retryable: false,
796
+ next_action: "retry_with_different_input",
746
797
  category: "identity"
747
798
  },
748
799
  E_IDENTITY_KEY_EXPIRED: {
@@ -750,7 +801,8 @@ var ERRORS = {
750
801
  http_status: 401,
751
802
  title: "Identity Key Expired",
752
803
  description: "Agent signing key has expired per directory metadata",
753
- retriable: false,
804
+ retryable: false,
805
+ next_action: "refresh_attestation",
754
806
  category: "identity"
755
807
  },
756
808
  E_IDENTITY_KEY_REVOKED: {
@@ -758,7 +810,8 @@ var ERRORS = {
758
810
  http_status: 401,
759
811
  title: "Identity Key Revoked",
760
812
  description: "Agent signing key has been explicitly revoked",
761
- retriable: false,
813
+ retryable: false,
814
+ next_action: "refresh_attestation",
762
815
  category: "identity"
763
816
  },
764
817
  E_IDENTITY_KEY_UNKNOWN: {
@@ -766,7 +819,8 @@ var ERRORS = {
766
819
  http_status: 401,
767
820
  title: "Identity Key Unknown",
768
821
  description: "Key ID not found in agent key directory",
769
- retriable: true,
822
+ retryable: true,
823
+ next_action: "retry_after_delay",
770
824
  category: "identity"
771
825
  },
772
826
  E_IDENTITY_MISSING: {
@@ -774,7 +828,8 @@ var ERRORS = {
774
828
  http_status: 401,
775
829
  title: "Identity Missing",
776
830
  description: "No agent identity attestation provided in request",
777
- retriable: false,
831
+ retryable: false,
832
+ next_action: "retry_with_different_input",
778
833
  category: "identity"
779
834
  },
780
835
  E_IDENTITY_NOT_YET_VALID: {
@@ -782,7 +837,8 @@ var ERRORS = {
782
837
  http_status: 401,
783
838
  title: "Identity Not Yet Valid",
784
839
  description: "Agent identity attestation issued_at time is in the future",
785
- retriable: true,
840
+ retryable: true,
841
+ next_action: "retry_after_delay",
786
842
  category: "identity"
787
843
  },
788
844
  E_IDENTITY_PROOF_UNSUPPORTED: {
@@ -790,7 +846,8 @@ var ERRORS = {
790
846
  http_status: 400,
791
847
  title: "Identity Proof Unsupported",
792
848
  description: "Agent identity proof method is not supported",
793
- retriable: false,
849
+ retryable: false,
850
+ next_action: "retry_with_different_input",
794
851
  category: "identity"
795
852
  },
796
853
  E_IDENTITY_SIG_INVALID: {
@@ -798,7 +855,8 @@ var ERRORS = {
798
855
  http_status: 401,
799
856
  title: "Identity Signature Invalid",
800
857
  description: "Agent identity proof signature verification failed",
801
- retriable: false,
858
+ retryable: false,
859
+ next_action: "retry_with_different_input",
802
860
  category: "identity"
803
861
  },
804
862
  // Infrastructure error codes
@@ -807,7 +865,8 @@ var ERRORS = {
807
865
  http_status: 503,
808
866
  title: "Circuit Breaker Open",
809
867
  description: "Service temporarily unavailable due to circuit breaker",
810
- retriable: true,
868
+ retryable: true,
869
+ next_action: "retry_after_delay",
811
870
  category: "infrastructure"
812
871
  },
813
872
  E_INTERNAL: {
@@ -815,7 +874,8 @@ var ERRORS = {
815
874
  http_status: 500,
816
875
  title: "Internal Error",
817
876
  description: "An unexpected internal error occurred during verification",
818
- retriable: true,
877
+ retryable: true,
878
+ next_action: "retry_after_delay",
819
879
  category: "infrastructure"
820
880
  },
821
881
  E_JWKS_FETCH_FAILED: {
@@ -823,7 +883,8 @@ var ERRORS = {
823
883
  http_status: 503,
824
884
  title: "JWKS Fetch Failed",
825
885
  description: "Failed to fetch public keys from JWKS endpoint",
826
- retriable: true,
886
+ retryable: true,
887
+ next_action: "retry_after_delay",
827
888
  category: "infrastructure"
828
889
  },
829
890
  E_RATE_LIMITED: {
@@ -831,7 +892,8 @@ var ERRORS = {
831
892
  http_status: 429,
832
893
  title: "Rate Limited",
833
894
  description: "Too many requests, please retry later",
834
- retriable: true,
895
+ retryable: true,
896
+ next_action: "retry_after_delay",
835
897
  category: "infrastructure"
836
898
  },
837
899
  // Interaction error codes
@@ -840,7 +902,8 @@ var ERRORS = {
840
902
  http_status: 400,
841
903
  title: "Interaction Invalid Digest",
842
904
  description: "Digest structure is invalid (wrong value format or missing bytes)",
843
- retriable: false,
905
+ retryable: false,
906
+ next_action: "retry_with_different_input",
844
907
  category: "interaction"
845
908
  },
846
909
  E_INTERACTION_INVALID_DIGEST_ALG: {
@@ -848,7 +911,8 @@ var ERRORS = {
848
911
  http_status: 400,
849
912
  title: "Interaction Invalid Digest Algorithm",
850
913
  description: "Digest algorithm is not in the canonical set (sha-256, sha-256:trunc-64k, sha-256:trunc-1m)",
851
- retriable: false,
914
+ retryable: false,
915
+ next_action: "retry_with_different_input",
852
916
  category: "interaction"
853
917
  },
854
918
  E_INTERACTION_INVALID_EXTENSION_KEY: {
@@ -856,7 +920,8 @@ var ERRORS = {
856
920
  http_status: 400,
857
921
  title: "Interaction Invalid Extension Key",
858
922
  description: "Extension key does not match required format (reverse-DNS/name[@version])",
859
- retriable: false,
923
+ retryable: false,
924
+ next_action: "retry_with_different_input",
860
925
  category: "interaction"
861
926
  },
862
927
  E_INTERACTION_INVALID_FORMAT: {
@@ -864,7 +929,8 @@ var ERRORS = {
864
929
  http_status: 400,
865
930
  title: "Interaction Invalid Format",
866
931
  description: "Interaction evidence does not conform to InteractionEvidenceV01 schema",
867
- retriable: false,
932
+ retryable: false,
933
+ next_action: "retry_with_different_input",
868
934
  category: "interaction"
869
935
  },
870
936
  E_INTERACTION_INVALID_KIND_FORMAT: {
@@ -872,7 +938,8 @@ var ERRORS = {
872
938
  http_status: 400,
873
939
  title: "Interaction Invalid Kind Format",
874
940
  description: "Interaction kind does not match required format (lowercase, 2-128 chars, starts with letter)",
875
- retriable: false,
941
+ retryable: false,
942
+ next_action: "retry_with_different_input",
876
943
  category: "interaction"
877
944
  },
878
945
  E_INTERACTION_INVALID_TIMING: {
@@ -880,7 +947,8 @@ var ERRORS = {
880
947
  http_status: 400,
881
948
  title: "Interaction Invalid Timing",
882
949
  description: "Timing constraint violated (completed_at < started_at or invalid datetime format)",
883
- retriable: false,
950
+ retryable: false,
951
+ next_action: "retry_with_different_input",
884
952
  category: "interaction"
885
953
  },
886
954
  E_INTERACTION_KIND_RESERVED: {
@@ -888,7 +956,8 @@ var ERRORS = {
888
956
  http_status: 400,
889
957
  title: "Interaction Kind Reserved",
890
958
  description: "Interaction kind uses reserved prefix (peac.*, org.peacprotocol.*) but is not in the well-known registry",
891
- retriable: false,
959
+ retryable: false,
960
+ next_action: "retry_with_different_input",
892
961
  category: "interaction"
893
962
  },
894
963
  E_INTERACTION_MISSING_ERROR_DETAIL: {
@@ -896,7 +965,8 @@ var ERRORS = {
896
965
  http_status: 400,
897
966
  title: "Interaction Missing Error Detail",
898
967
  description: "error_code or extensions required when result.status is error",
899
- retriable: false,
968
+ retryable: false,
969
+ next_action: "retry_with_different_input",
900
970
  category: "interaction"
901
971
  },
902
972
  E_INTERACTION_MISSING_EXECUTOR: {
@@ -904,7 +974,8 @@ var ERRORS = {
904
974
  http_status: 400,
905
975
  title: "Interaction Missing Executor",
906
976
  description: "Interaction evidence is missing required executor or executor.platform field",
907
- retriable: false,
977
+ retryable: false,
978
+ next_action: "retry_with_different_input",
908
979
  category: "interaction"
909
980
  },
910
981
  E_INTERACTION_MISSING_ID: {
@@ -912,7 +983,8 @@ var ERRORS = {
912
983
  http_status: 400,
913
984
  title: "Interaction Missing ID",
914
985
  description: "Interaction evidence is missing required interaction_id field",
915
- retriable: false,
986
+ retryable: false,
987
+ next_action: "retry_with_different_input",
916
988
  category: "interaction"
917
989
  },
918
990
  E_INTERACTION_MISSING_KIND: {
@@ -920,7 +992,8 @@ var ERRORS = {
920
992
  http_status: 400,
921
993
  title: "Interaction Missing Kind",
922
994
  description: "Interaction evidence is missing required kind field",
923
- retriable: false,
995
+ retryable: false,
996
+ next_action: "retry_with_different_input",
924
997
  category: "interaction"
925
998
  },
926
999
  E_INTERACTION_MISSING_RESULT: {
@@ -928,7 +1001,8 @@ var ERRORS = {
928
1001
  http_status: 400,
929
1002
  title: "Interaction Missing Result",
930
1003
  description: "result.status is required when output is present",
931
- retriable: false,
1004
+ retryable: false,
1005
+ next_action: "retry_with_different_input",
932
1006
  category: "interaction"
933
1007
  },
934
1008
  E_INTERACTION_MISSING_STARTED_AT: {
@@ -936,7 +1010,8 @@ var ERRORS = {
936
1010
  http_status: 400,
937
1011
  title: "Interaction Missing Started At",
938
1012
  description: "Interaction evidence is missing required started_at field",
939
- retriable: false,
1013
+ retryable: false,
1014
+ next_action: "retry_with_different_input",
940
1015
  category: "interaction"
941
1016
  },
942
1017
  E_INTERACTION_MISSING_TARGET: {
@@ -944,7 +1019,8 @@ var ERRORS = {
944
1019
  http_status: 400,
945
1020
  title: "Interaction Missing Target",
946
1021
  description: "Kind prefix requires matching target field (tool.* needs tool, http.*/fs.* need resource)",
947
- retriable: false,
1022
+ retryable: false,
1023
+ next_action: "retry_with_different_input",
948
1024
  category: "interaction"
949
1025
  },
950
1026
  // Ucp error codes
@@ -953,7 +1029,8 @@ var ERRORS = {
953
1029
  http_status: 500,
954
1030
  title: "UCP Evidence Serialization Failed",
955
1031
  description: "Failed to serialize UCP evidence to YAML format",
956
- retriable: false,
1032
+ retryable: false,
1033
+ next_action: "retry_with_different_input",
957
1034
  category: "ucp"
958
1035
  },
959
1036
  E_UCP_KEY_ALGORITHM_MISMATCH: {
@@ -961,7 +1038,8 @@ var ERRORS = {
961
1038
  http_status: 401,
962
1039
  title: "UCP Key Algorithm Mismatch",
963
1040
  description: "Key type is not EC as required for ECDSA signatures",
964
- retriable: false,
1041
+ retryable: false,
1042
+ next_action: "retry_with_different_input",
965
1043
  category: "ucp"
966
1044
  },
967
1045
  E_UCP_KEY_CURVE_MISMATCH: {
@@ -969,7 +1047,8 @@ var ERRORS = {
969
1047
  http_status: 401,
970
1048
  title: "UCP Key Curve Mismatch",
971
1049
  description: "Key curve does not match signature algorithm (ES256=P-256, ES384=P-384, ES512=P-521)",
972
- retriable: false,
1050
+ retryable: false,
1051
+ next_action: "retry_with_different_input",
973
1052
  category: "ucp"
974
1053
  },
975
1054
  E_UCP_KEY_NOT_FOUND: {
@@ -977,7 +1056,8 @@ var ERRORS = {
977
1056
  http_status: 401,
978
1057
  title: "UCP Key Not Found",
979
1058
  description: "Key ID from signature not found in business UCP profile",
980
- retriable: true,
1059
+ retryable: true,
1060
+ next_action: "retry_after_delay",
981
1061
  category: "ucp"
982
1062
  },
983
1063
  E_UCP_ORDER_INVALID: {
@@ -985,7 +1065,8 @@ var ERRORS = {
985
1065
  http_status: 400,
986
1066
  title: "UCP Order Invalid",
987
1067
  description: "UCP order object does not conform to expected schema",
988
- retriable: false,
1068
+ retryable: false,
1069
+ next_action: "retry_with_different_input",
989
1070
  category: "ucp"
990
1071
  },
991
1072
  E_UCP_ORDER_MISSING_ID: {
@@ -993,7 +1074,8 @@ var ERRORS = {
993
1074
  http_status: 400,
994
1075
  title: "UCP Order Missing ID",
995
1076
  description: "UCP order is missing required id field",
996
- retriable: false,
1077
+ retryable: false,
1078
+ next_action: "retry_with_different_input",
997
1079
  category: "ucp"
998
1080
  },
999
1081
  E_UCP_ORDER_MISSING_LINE_ITEMS: {
@@ -1001,7 +1083,8 @@ var ERRORS = {
1001
1083
  http_status: 400,
1002
1084
  title: "UCP Order Missing Line Items",
1003
1085
  description: "UCP order is missing required line_items array",
1004
- retriable: false,
1086
+ retryable: false,
1087
+ next_action: "retry_with_different_input",
1005
1088
  category: "ucp"
1006
1089
  },
1007
1090
  E_UCP_ORDER_MISSING_TOTALS: {
@@ -1009,7 +1092,8 @@ var ERRORS = {
1009
1092
  http_status: 400,
1010
1093
  title: "UCP Order Missing Totals",
1011
1094
  description: "UCP order is missing required totals array or total entry",
1012
- retriable: false,
1095
+ retryable: false,
1096
+ next_action: "retry_with_different_input",
1013
1097
  category: "ucp"
1014
1098
  },
1015
1099
  E_UCP_PAYLOAD_EMPTY: {
@@ -1017,7 +1101,8 @@ var ERRORS = {
1017
1101
  http_status: 400,
1018
1102
  title: "UCP Payload Empty",
1019
1103
  description: "Webhook request body is empty",
1020
- retriable: false,
1104
+ retryable: false,
1105
+ next_action: "retry_with_different_input",
1021
1106
  category: "ucp"
1022
1107
  },
1023
1108
  E_UCP_PAYLOAD_NOT_JSON: {
@@ -1025,7 +1110,8 @@ var ERRORS = {
1025
1110
  http_status: 400,
1026
1111
  title: "UCP Payload Not JSON",
1027
1112
  description: "Webhook request body is not valid JSON",
1028
- retriable: false,
1113
+ retryable: false,
1114
+ next_action: "retry_with_different_input",
1029
1115
  category: "ucp"
1030
1116
  },
1031
1117
  E_UCP_PAYLOAD_TOO_LARGE: {
@@ -1033,7 +1119,8 @@ var ERRORS = {
1033
1119
  http_status: 400,
1034
1120
  title: "UCP Payload Too Large",
1035
1121
  description: "Webhook request body exceeds maximum allowed size",
1036
- retriable: false,
1122
+ retryable: false,
1123
+ next_action: "retry_with_different_input",
1037
1124
  category: "ucp"
1038
1125
  },
1039
1126
  E_UCP_PROFILE_FETCH_FAILED: {
@@ -1041,7 +1128,8 @@ var ERRORS = {
1041
1128
  http_status: 502,
1042
1129
  title: "UCP Profile Fetch Failed",
1043
1130
  description: "Failed to fetch business UCP profile from /.well-known/ucp",
1044
- retriable: true,
1131
+ retryable: true,
1132
+ next_action: "retry_after_delay",
1045
1133
  category: "ucp"
1046
1134
  },
1047
1135
  E_UCP_PROFILE_INVALID: {
@@ -1049,7 +1137,8 @@ var ERRORS = {
1049
1137
  http_status: 502,
1050
1138
  title: "UCP Profile Invalid",
1051
1139
  description: "Business UCP profile does not conform to expected schema",
1052
- retriable: false,
1140
+ retryable: false,
1141
+ next_action: "retry_with_different_input",
1053
1142
  category: "ucp"
1054
1143
  },
1055
1144
  E_UCP_PROFILE_NO_SIGNING_KEYS: {
@@ -1057,7 +1146,8 @@ var ERRORS = {
1057
1146
  http_status: 502,
1058
1147
  title: "UCP Profile No Signing Keys",
1059
1148
  description: "Business UCP profile has empty or missing signing_keys array",
1060
- retriable: false,
1149
+ retryable: false,
1150
+ next_action: "retry_with_different_input",
1061
1151
  category: "ucp"
1062
1152
  },
1063
1153
  E_UCP_SIGNATURE_ALGORITHM_UNSUPPORTED: {
@@ -1065,7 +1155,8 @@ var ERRORS = {
1065
1155
  http_status: 400,
1066
1156
  title: "UCP Signature Algorithm Unsupported",
1067
1157
  description: "Signature algorithm is not ES256, ES384, or ES512",
1068
- retriable: false,
1158
+ retryable: false,
1159
+ next_action: "retry_with_different_input",
1069
1160
  category: "ucp"
1070
1161
  },
1071
1162
  E_UCP_SIGNATURE_B64_INVALID: {
@@ -1073,7 +1164,8 @@ var ERRORS = {
1073
1164
  http_status: 400,
1074
1165
  title: "UCP Signature b64 Invalid",
1075
1166
  description: "b64=false requires 'b64' in 'crit' array per RFC 7797",
1076
- retriable: false,
1167
+ retryable: false,
1168
+ next_action: "retry_with_different_input",
1077
1169
  category: "ucp"
1078
1170
  },
1079
1171
  E_UCP_SIGNATURE_INVALID: {
@@ -1081,7 +1173,8 @@ var ERRORS = {
1081
1173
  http_status: 401,
1082
1174
  title: "UCP Signature Invalid",
1083
1175
  description: "Webhook signature verification failed against payload",
1084
- retriable: false,
1176
+ retryable: false,
1177
+ next_action: "retry_with_different_input",
1085
1178
  category: "ucp"
1086
1179
  },
1087
1180
  E_UCP_SIGNATURE_MALFORMED: {
@@ -1089,7 +1182,8 @@ var ERRORS = {
1089
1182
  http_status: 400,
1090
1183
  title: "UCP Signature Malformed",
1091
1184
  description: "Request-Signature header is not a valid detached JWS (RFC 7797)",
1092
- retriable: false,
1185
+ retryable: false,
1186
+ next_action: "retry_with_different_input",
1093
1187
  category: "ucp"
1094
1188
  },
1095
1189
  E_UCP_SIGNATURE_MISSING: {
@@ -1097,7 +1191,8 @@ var ERRORS = {
1097
1191
  http_status: 400,
1098
1192
  title: "UCP Signature Missing",
1099
1193
  description: "Request-Signature header is missing from UCP webhook request",
1100
- retriable: false,
1194
+ retryable: false,
1195
+ next_action: "retry_with_different_input",
1101
1196
  category: "ucp"
1102
1197
  },
1103
1198
  E_UCP_VERIFICATION_FAILED: {
@@ -1105,7 +1200,8 @@ var ERRORS = {
1105
1200
  http_status: 401,
1106
1201
  title: "UCP Verification Failed",
1107
1202
  description: "All verification attempts failed (raw and JCS canonicalized)",
1108
- retriable: false,
1203
+ retryable: false,
1204
+ next_action: "retry_with_different_input",
1109
1205
  category: "ucp"
1110
1206
  },
1111
1207
  // Validation error codes
@@ -1114,7 +1210,8 @@ var ERRORS = {
1114
1210
  http_status: 400,
1115
1211
  title: "Kernel Constraint Violation",
1116
1212
  description: "Receipt claims exceed a kernel constraint (max keys, max depth, max string length, max evidence bytes, or similar structural limit)",
1117
- retriable: false,
1213
+ retryable: false,
1214
+ next_action: "retry_with_different_input",
1118
1215
  category: "validation"
1119
1216
  },
1120
1217
  E_EVIDENCE_NOT_JSON: {
@@ -1122,7 +1219,8 @@ var ERRORS = {
1122
1219
  http_status: 400,
1123
1220
  title: "Evidence Not JSON-Safe",
1124
1221
  description: "Evidence contains non-JSON-safe values (NaN, Infinity, undefined, BigInt, Date, Map, Set, functions, symbols, class instances, or cycles)",
1125
- retriable: false,
1222
+ retryable: false,
1223
+ next_action: "retry_with_different_input",
1126
1224
  category: "validation"
1127
1225
  },
1128
1226
  E_EXPIRED: {
@@ -1130,7 +1228,8 @@ var ERRORS = {
1130
1228
  http_status: 400,
1131
1229
  title: "Receipt Expired",
1132
1230
  description: "Receipt has exceeded its expiration time",
1133
- retriable: false,
1231
+ retryable: false,
1232
+ next_action: "retry_with_different_input",
1134
1233
  category: "validation"
1135
1234
  },
1136
1235
  E_INVALID_AMOUNT: {
@@ -1138,7 +1237,8 @@ var ERRORS = {
1138
1237
  http_status: 400,
1139
1238
  title: "Invalid Amount",
1140
1239
  description: "Payment amount is invalid or out of allowed range",
1141
- retriable: false,
1240
+ retryable: false,
1241
+ next_action: "retry_with_different_input",
1142
1242
  category: "validation"
1143
1243
  },
1144
1244
  E_INVALID_AUDIENCE: {
@@ -1146,7 +1246,8 @@ var ERRORS = {
1146
1246
  http_status: 400,
1147
1247
  title: "Invalid Audience",
1148
1248
  description: "Receipt audience claim does not match expected value",
1149
- retriable: false,
1249
+ retryable: false,
1250
+ next_action: "retry_with_different_input",
1150
1251
  category: "validation"
1151
1252
  },
1152
1253
  E_INVALID_CURRENCY: {
@@ -1154,7 +1255,8 @@ var ERRORS = {
1154
1255
  http_status: 400,
1155
1256
  title: "Invalid Currency",
1156
1257
  description: "Currency code is not a valid ISO 4217 code",
1157
- retriable: false,
1258
+ retryable: false,
1259
+ next_action: "retry_with_different_input",
1158
1260
  category: "validation"
1159
1261
  },
1160
1262
  E_INVALID_FORMAT: {
@@ -1162,7 +1264,8 @@ var ERRORS = {
1162
1264
  http_status: 400,
1163
1265
  title: "Invalid Format",
1164
1266
  description: "Receipt does not conform to JWS format",
1165
- retriable: false,
1267
+ retryable: false,
1268
+ next_action: "retry_with_different_input",
1166
1269
  category: "validation"
1167
1270
  },
1168
1271
  E_INVALID_ISSUER: {
@@ -1170,7 +1273,8 @@ var ERRORS = {
1170
1273
  http_status: 400,
1171
1274
  title: "Invalid Issuer",
1172
1275
  description: "Receipt issuer claim is invalid or untrusted",
1173
- retriable: false,
1276
+ retryable: false,
1277
+ next_action: "retry_with_different_input",
1174
1278
  category: "validation"
1175
1279
  },
1176
1280
  E_INVALID_RAIL: {
@@ -1178,7 +1282,8 @@ var ERRORS = {
1178
1282
  http_status: 400,
1179
1283
  title: "Invalid Payment Rail",
1180
1284
  description: "Payment rail identifier is not recognized",
1181
- retriable: false,
1285
+ retryable: false,
1286
+ next_action: "retry_with_different_input",
1182
1287
  category: "validation"
1183
1288
  },
1184
1289
  E_INVALID_RECEIPT_ID: {
@@ -1186,7 +1291,8 @@ var ERRORS = {
1186
1291
  http_status: 400,
1187
1292
  title: "Invalid Receipt ID",
1188
1293
  description: "Receipt ID (rid) does not match expected value",
1189
- retriable: false,
1294
+ retryable: false,
1295
+ next_action: "retry_with_different_input",
1190
1296
  category: "validation"
1191
1297
  },
1192
1298
  E_INVALID_SUBJECT: {
@@ -1194,7 +1300,8 @@ var ERRORS = {
1194
1300
  http_status: 400,
1195
1301
  title: "Invalid Subject",
1196
1302
  description: "Receipt subject claim does not match expected value",
1197
- retriable: false,
1303
+ retryable: false,
1304
+ next_action: "retry_with_different_input",
1198
1305
  category: "validation"
1199
1306
  },
1200
1307
  E_MISSING_EXP: {
@@ -1202,7 +1309,8 @@ var ERRORS = {
1202
1309
  http_status: 400,
1203
1310
  title: "Missing Expiration",
1204
1311
  description: "Receipt is missing required exp claim",
1205
- retriable: false,
1312
+ retryable: false,
1313
+ next_action: "retry_with_different_input",
1206
1314
  category: "validation"
1207
1315
  },
1208
1316
  E_MISSING_REQUIRED_CLAIM: {
@@ -1210,7 +1318,8 @@ var ERRORS = {
1210
1318
  http_status: 400,
1211
1319
  title: "Missing Required Claim",
1212
1320
  description: "Receipt is missing a required JWT claim",
1213
- retriable: false,
1321
+ retryable: false,
1322
+ next_action: "retry_with_different_input",
1214
1323
  category: "validation"
1215
1324
  },
1216
1325
  E_NOT_YET_VALID: {
@@ -1218,7 +1327,8 @@ var ERRORS = {
1218
1327
  http_status: 400,
1219
1328
  title: "Not Yet Valid",
1220
1329
  description: "Receipt nbf (not before) time is in the future",
1221
- retriable: true,
1330
+ retryable: true,
1331
+ next_action: "retry_after_delay",
1222
1332
  category: "validation"
1223
1333
  },
1224
1334
  E_PARSE_ATTESTATION_INVALID: {
@@ -1226,7 +1336,8 @@ var ERRORS = {
1226
1336
  http_status: 400,
1227
1337
  title: "Attestation Receipt Invalid",
1228
1338
  description: "Receipt classified as attestation but fails attestation schema validation",
1229
- retriable: false,
1339
+ retryable: false,
1340
+ next_action: "retry_with_different_input",
1230
1341
  category: "validation"
1231
1342
  },
1232
1343
  E_PARSE_COMMERCE_INVALID: {
@@ -1234,7 +1345,8 @@ var ERRORS = {
1234
1345
  http_status: 400,
1235
1346
  title: "Commerce Receipt Invalid",
1236
1347
  description: "Receipt has commerce fields (amt/cur/payment) but fails commerce schema validation",
1237
- retriable: false,
1348
+ retryable: false,
1349
+ next_action: "retry_with_different_input",
1238
1350
  category: "validation"
1239
1351
  },
1240
1352
  E_PARSE_INVALID_INPUT: {
@@ -1242,7 +1354,8 @@ var ERRORS = {
1242
1354
  http_status: 400,
1243
1355
  title: "Parse Invalid Input",
1244
1356
  description: "Input to receipt parser is not a non-null object",
1245
- retriable: false,
1357
+ retryable: false,
1358
+ next_action: "retry_with_different_input",
1246
1359
  category: "validation"
1247
1360
  },
1248
1361
  // Verification error codes
@@ -1251,7 +1364,8 @@ var ERRORS = {
1251
1364
  http_status: 400,
1252
1365
  title: "Invalid Signature",
1253
1366
  description: "Receipt signature verification failed",
1254
- retriable: false,
1367
+ retryable: false,
1368
+ next_action: "abort",
1255
1369
  category: "verification"
1256
1370
  },
1257
1371
  E_KEY_NOT_FOUND: {
@@ -1259,7 +1373,8 @@ var ERRORS = {
1259
1373
  http_status: 400,
1260
1374
  title: "Key Not Found",
1261
1375
  description: "Public key with specified kid not found in JWKS",
1262
- retriable: false,
1376
+ retryable: false,
1377
+ next_action: "retry_with_different_key",
1263
1378
  category: "verification"
1264
1379
  },
1265
1380
  // Verifier error codes
@@ -1268,7 +1383,8 @@ var ERRORS = {
1268
1383
  http_status: 400,
1269
1384
  title: "Extension Too Large",
1270
1385
  description: "Receipt extension data exceeds maximum size limit (64 KB)",
1271
- retriable: false,
1386
+ retryable: false,
1387
+ next_action: "abort",
1272
1388
  category: "verifier"
1273
1389
  },
1274
1390
  E_VERIFY_INSECURE_SCHEME_BLOCKED: {
@@ -1276,7 +1392,8 @@ var ERRORS = {
1276
1392
  http_status: 403,
1277
1393
  title: "Insecure Scheme Blocked",
1278
1394
  description: "Non-HTTPS URL encountered during issuer discovery (issuer URL or jwks_uri)",
1279
- retriable: false,
1395
+ retryable: false,
1396
+ next_action: "abort",
1280
1397
  category: "verifier"
1281
1398
  },
1282
1399
  E_VERIFY_INVALID_TRANSPORT: {
@@ -1284,7 +1401,8 @@ var ERRORS = {
1284
1401
  http_status: 400,
1285
1402
  title: "Invalid Transport",
1286
1403
  description: "Multiple PEAC-Receipt or PEAC-Receipt-Pointer headers detected (ambiguous transport)",
1287
- retriable: false,
1404
+ retryable: false,
1405
+ next_action: "abort",
1288
1406
  category: "verifier"
1289
1407
  },
1290
1408
  E_VERIFY_ISSUER_CONFIG_INVALID: {
@@ -1292,7 +1410,8 @@ var ERRORS = {
1292
1410
  http_status: 502,
1293
1411
  title: "Issuer Config Invalid",
1294
1412
  description: "peac-issuer.json is not valid JSON or does not conform to issuer config schema",
1295
- retriable: false,
1413
+ retryable: false,
1414
+ next_action: "abort",
1296
1415
  category: "verifier"
1297
1416
  },
1298
1417
  E_VERIFY_ISSUER_CONFIG_MISSING: {
@@ -1300,7 +1419,8 @@ var ERRORS = {
1300
1419
  http_status: 502,
1301
1420
  title: "Issuer Config Missing",
1302
1421
  description: "peac-issuer.json not found or not fetchable at issuer origin",
1303
- retriable: true,
1422
+ retryable: true,
1423
+ next_action: "retry_after_delay",
1304
1424
  category: "verifier"
1305
1425
  },
1306
1426
  E_VERIFY_ISSUER_MISMATCH: {
@@ -1308,7 +1428,8 @@ var ERRORS = {
1308
1428
  http_status: 403,
1309
1429
  title: "Issuer Mismatch",
1310
1430
  description: "issuer field in peac-issuer.json does not match the expected issuer origin",
1311
- retriable: false,
1431
+ retryable: false,
1432
+ next_action: "abort",
1312
1433
  category: "verifier"
1313
1434
  },
1314
1435
  E_VERIFY_ISSUER_NOT_ALLOWED: {
@@ -1316,7 +1437,8 @@ var ERRORS = {
1316
1437
  http_status: 403,
1317
1438
  title: "Issuer Not Allowed",
1318
1439
  description: "Receipt issuer is not in the verifier policy allowlist",
1319
- retriable: false,
1440
+ retryable: false,
1441
+ next_action: "abort",
1320
1442
  category: "verifier"
1321
1443
  },
1322
1444
  E_VERIFY_JWKS_INVALID: {
@@ -1324,7 +1446,8 @@ var ERRORS = {
1324
1446
  http_status: 502,
1325
1447
  title: "JWKS Invalid",
1326
1448
  description: "JWKS response is not valid JSON or missing required keys array",
1327
- retriable: false,
1449
+ retryable: false,
1450
+ next_action: "abort",
1328
1451
  category: "verifier"
1329
1452
  },
1330
1453
  E_VERIFY_JWKS_TOO_LARGE: {
@@ -1332,7 +1455,8 @@ var ERRORS = {
1332
1455
  http_status: 400,
1333
1456
  title: "JWKS Too Large",
1334
1457
  description: "JWKS response exceeds maximum size limit (64 KB)",
1335
- retriable: false,
1458
+ retryable: false,
1459
+ next_action: "abort",
1336
1460
  category: "verifier"
1337
1461
  },
1338
1462
  E_VERIFY_JWKS_TOO_MANY_KEYS: {
@@ -1340,7 +1464,8 @@ var ERRORS = {
1340
1464
  http_status: 400,
1341
1465
  title: "JWKS Too Many Keys",
1342
1466
  description: "JWKS contains more than maximum allowed keys (20)",
1343
- retriable: false,
1467
+ retryable: false,
1468
+ next_action: "abort",
1344
1469
  category: "verifier"
1345
1470
  },
1346
1471
  E_VERIFY_JWKS_URI_INVALID: {
@@ -1348,7 +1473,8 @@ var ERRORS = {
1348
1473
  http_status: 502,
1349
1474
  title: "JWKS URI Invalid",
1350
1475
  description: "jwks_uri in peac-issuer.json is not a valid HTTPS URL",
1351
- retriable: false,
1476
+ retryable: false,
1477
+ next_action: "abort",
1352
1478
  category: "verifier"
1353
1479
  },
1354
1480
  E_VERIFY_KEY_FETCH_BLOCKED: {
@@ -1356,7 +1482,8 @@ var ERRORS = {
1356
1482
  http_status: 403,
1357
1483
  title: "Key Fetch Blocked",
1358
1484
  description: "JWKS discovery blocked by SSRF protection (private IP, non-HTTPS, or blocked redirect)",
1359
- retriable: false,
1485
+ retryable: false,
1486
+ next_action: "abort",
1360
1487
  category: "verifier"
1361
1488
  },
1362
1489
  E_VERIFY_KEY_FETCH_FAILED: {
@@ -1364,7 +1491,8 @@ var ERRORS = {
1364
1491
  http_status: 502,
1365
1492
  title: "Key Fetch Failed",
1366
1493
  description: "Network error while fetching JWKS from issuer",
1367
- retriable: true,
1494
+ retryable: true,
1495
+ next_action: "retry_after_delay",
1368
1496
  category: "verifier"
1369
1497
  },
1370
1498
  E_VERIFY_KEY_FETCH_TIMEOUT: {
@@ -1372,7 +1500,8 @@ var ERRORS = {
1372
1500
  http_status: 504,
1373
1501
  title: "Key Fetch Timeout",
1374
1502
  description: "JWKS discovery timed out (5 second limit)",
1375
- retriable: true,
1503
+ retryable: true,
1504
+ next_action: "retry_after_delay",
1376
1505
  category: "verifier"
1377
1506
  },
1378
1507
  E_VERIFY_MALFORMED_RECEIPT: {
@@ -1380,7 +1509,8 @@ var ERRORS = {
1380
1509
  http_status: 400,
1381
1510
  title: "Malformed Receipt",
1382
1511
  description: "Cannot parse receipt as JWS Compact Serialization",
1383
- retriable: false,
1512
+ retryable: false,
1513
+ next_action: "abort",
1384
1514
  category: "verifier"
1385
1515
  },
1386
1516
  E_VERIFY_POINTER_DIGEST_MISMATCH: {
@@ -1388,7 +1518,8 @@ var ERRORS = {
1388
1518
  http_status: 400,
1389
1519
  title: "Pointer Digest Mismatch",
1390
1520
  description: "Fetched receipt SHA-256 digest does not match pointer declaration",
1391
- retriable: false,
1521
+ retryable: false,
1522
+ next_action: "abort",
1392
1523
  category: "verifier"
1393
1524
  },
1394
1525
  E_VERIFY_POINTER_FETCH_BLOCKED: {
@@ -1396,7 +1527,8 @@ var ERRORS = {
1396
1527
  http_status: 403,
1397
1528
  title: "Pointer Fetch Blocked",
1398
1529
  description: "Pointer URL fetch blocked by SSRF protection (private IP, non-HTTPS, or blocked redirect)",
1399
- retriable: false,
1530
+ retryable: false,
1531
+ next_action: "abort",
1400
1532
  category: "verifier"
1401
1533
  },
1402
1534
  E_VERIFY_POINTER_FETCH_FAILED: {
@@ -1404,7 +1536,8 @@ var ERRORS = {
1404
1536
  http_status: 502,
1405
1537
  title: "Pointer Fetch Failed",
1406
1538
  description: "Network error while fetching receipt from pointer URL",
1407
- retriable: true,
1539
+ retryable: true,
1540
+ next_action: "retry_after_delay",
1408
1541
  category: "verifier"
1409
1542
  },
1410
1543
  E_VERIFY_POINTER_FETCH_TIMEOUT: {
@@ -1412,7 +1545,8 @@ var ERRORS = {
1412
1545
  http_status: 504,
1413
1546
  title: "Pointer Fetch Timeout",
1414
1547
  description: "Pointer URL fetch timed out (5 second limit)",
1415
- retriable: true,
1548
+ retryable: true,
1549
+ next_action: "retry_after_delay",
1416
1550
  category: "verifier"
1417
1551
  },
1418
1552
  E_VERIFY_POINTER_FETCH_TOO_LARGE: {
@@ -1420,7 +1554,8 @@ var ERRORS = {
1420
1554
  http_status: 413,
1421
1555
  title: "Pointer Fetch Too Large",
1422
1556
  description: "Pointer URL response exceeds maximum size limit (256 KB)",
1423
- retriable: false,
1557
+ retryable: false,
1558
+ next_action: "abort",
1424
1559
  category: "verifier"
1425
1560
  },
1426
1561
  E_VERIFY_POLICY_VIOLATION: {
@@ -1428,7 +1563,8 @@ var ERRORS = {
1428
1563
  http_status: 403,
1429
1564
  title: "Policy Violation",
1430
1565
  description: "Receipt violates verifier trust policy",
1431
- retriable: false,
1566
+ retryable: false,
1567
+ next_action: "abort",
1432
1568
  category: "verifier"
1433
1569
  },
1434
1570
  E_VERIFY_RECEIPT_TOO_LARGE: {
@@ -1436,7 +1572,8 @@ var ERRORS = {
1436
1572
  http_status: 413,
1437
1573
  title: "Receipt Too Large",
1438
1574
  description: "Receipt exceeds maximum size limit (256 KB)",
1439
- retriable: false,
1575
+ retryable: false,
1576
+ next_action: "abort",
1440
1577
  category: "verifier"
1441
1578
  },
1442
1579
  E_VERIFY_SCHEMA_INVALID: {
@@ -1444,7 +1581,8 @@ var ERRORS = {
1444
1581
  http_status: 400,
1445
1582
  title: "Schema Invalid",
1446
1583
  description: "Receipt claims do not conform to expected schema",
1447
- retriable: false,
1584
+ retryable: false,
1585
+ next_action: "abort",
1448
1586
  category: "verifier"
1449
1587
  },
1450
1588
  // Workflow error codes
@@ -1453,7 +1591,8 @@ var ERRORS = {
1453
1591
  http_status: 400,
1454
1592
  title: "Invalid Workflow Context",
1455
1593
  description: "Workflow context does not conform to WorkflowContextSchema",
1456
- retriable: false,
1594
+ retryable: false,
1595
+ next_action: "retry_with_different_input",
1457
1596
  category: "workflow"
1458
1597
  },
1459
1598
  E_WORKFLOW_CYCLE_DETECTED: {
@@ -1461,7 +1600,8 @@ var ERRORS = {
1461
1600
  http_status: 400,
1462
1601
  title: "Workflow Cycle Detected",
1463
1602
  description: "Workflow DAG contains a cycle (not acyclic)",
1464
- retriable: false,
1603
+ retryable: false,
1604
+ next_action: "retry_with_different_input",
1465
1605
  category: "workflow"
1466
1606
  },
1467
1607
  E_WORKFLOW_DAG_INVALID: {
@@ -1469,7 +1609,8 @@ var ERRORS = {
1469
1609
  http_status: 400,
1470
1610
  title: "Invalid Workflow DAG",
1471
1611
  description: "Workflow DAG semantics violated (self-parent, duplicate parents, or cycle detected)",
1472
- retriable: false,
1612
+ retryable: false,
1613
+ next_action: "retry_with_different_input",
1473
1614
  category: "workflow"
1474
1615
  },
1475
1616
  E_WORKFLOW_ID_INVALID: {
@@ -1477,7 +1618,8 @@ var ERRORS = {
1477
1618
  http_status: 400,
1478
1619
  title: "Invalid Workflow ID",
1479
1620
  description: "Workflow ID does not match required format (wf_{ulid|uuid})",
1480
- retriable: false,
1621
+ retryable: false,
1622
+ next_action: "retry_with_different_input",
1481
1623
  category: "workflow"
1482
1624
  },
1483
1625
  E_WORKFLOW_LIMIT_EXCEEDED: {
@@ -1485,7 +1627,8 @@ var ERRORS = {
1485
1627
  http_status: 400,
1486
1628
  title: "Workflow Limit Exceeded",
1487
1629
  description: "Workflow exceeds defined limits (parent count, ID length, etc.)",
1488
- retriable: false,
1630
+ retryable: false,
1631
+ next_action: "retry_with_different_input",
1489
1632
  category: "workflow"
1490
1633
  },
1491
1634
  E_WORKFLOW_PARENT_NOT_FOUND: {
@@ -1493,7 +1636,8 @@ var ERRORS = {
1493
1636
  http_status: 400,
1494
1637
  title: "Parent Step Not Found",
1495
1638
  description: "Referenced parent step ID does not exist in the workflow",
1496
- retriable: false,
1639
+ retryable: false,
1640
+ next_action: "retry_with_different_input",
1497
1641
  category: "workflow"
1498
1642
  },
1499
1643
  E_WORKFLOW_STEP_ID_INVALID: {
@@ -1501,7 +1645,8 @@ var ERRORS = {
1501
1645
  http_status: 400,
1502
1646
  title: "Invalid Step ID",
1503
1647
  description: "Step ID does not match required format (step_{ulid|uuid})",
1504
- retriable: false,
1648
+ retryable: false,
1649
+ next_action: "retry_with_different_input",
1505
1650
  category: "workflow"
1506
1651
  },
1507
1652
  E_WORKFLOW_SUMMARY_INVALID: {
@@ -1509,15 +1654,16 @@ var ERRORS = {
1509
1654
  http_status: 400,
1510
1655
  title: "Invalid Workflow Summary",
1511
1656
  description: "Workflow summary attestation does not conform to schema",
1512
- retriable: false,
1657
+ retryable: false,
1658
+ next_action: "retry_with_different_input",
1513
1659
  category: "workflow"
1514
1660
  }
1515
1661
  };
1516
1662
  function getError(code) {
1517
1663
  return ERRORS[code];
1518
1664
  }
1519
- function isRetriable(code) {
1520
- return ERRORS[code]?.retriable ?? false;
1665
+ function isRetryable(code) {
1666
+ return ERRORS[code]?.retryable ?? false;
1521
1667
  }
1522
1668
  var BUNDLE_ERRORS = {
1523
1669
  DUPLICATE_RECEIPT: "E_BUNDLE_DUPLICATE_RECEIPT",
@@ -1707,7 +1853,8 @@ function needsPurposeVary(purposeEnforced) {
1707
1853
 
1708
1854
  // src/carrier.ts
1709
1855
  var PEAC_RECEIPT_HEADER = "PEAC-Receipt";
1856
+ var PEAC_RECEIPT_URL_HEADER = "PEAC-Receipt-URL";
1710
1857
 
1711
- export { AGENT_PROTOCOLS, ALGORITHMS, BUNDLE_ERRORS, BUNDLE_VERSION, CONSTANTS, CONTROL_ENGINES, DISCOVERY, DISPUTE_ERRORS, ERRORS, ERROR_CATEGORIES, ERROR_CODES, HASH, HEADERS, ISSUER_CONFIG, JWKS, LIMITS, PAYMENT_RAILS, PEAC_RECEIPT_HEADER, POLICY, PRIVATE_IP_RANGES, RECEIPT, REGISTRIES, TRANSPORT_METHODS, VARY_HEADERS, VERIFICATION_MODES, VERIFICATION_REPORT_VERSION, VERIFIER_LIMITS, VERIFIER_NETWORK, VERIFIER_POLICY_VERSION, WIRE_TYPE, WIRE_VERSION, applyPurposeVary, findAgentProtocol, findControlEngine, findPaymentRail, findTransportMethod, formatHash, getError, getPeacVaryHeaders, isRetriable, isValidHash, needsPurposeVary, parseHash };
1858
+ export { AGENT_PROTOCOLS, ALGORITHMS, BUNDLE_ERRORS, BUNDLE_VERSION, CONSTANTS, CONTROL_ENGINES, DISCOVERY, DISPUTE_ERRORS, ERRORS, ERROR_CATEGORIES, ERROR_CODES, HASH, HEADERS, ISSUER_CONFIG, JWKS, LIMITS, PAYMENT_RAILS, PEAC_RECEIPT_HEADER, PEAC_RECEIPT_URL_HEADER, POLICY, PRIVATE_IP_RANGES, RECEIPT, REGISTRIES, TRANSPORT_METHODS, VARY_HEADERS, VERIFICATION_MODES, VERIFICATION_REPORT_VERSION, VERIFIER_LIMITS, VERIFIER_NETWORK, VERIFIER_POLICY_VERSION, WIRE_TYPE, WIRE_VERSION, applyPurposeVary, findAgentProtocol, findControlEngine, findPaymentRail, findTransportMethod, formatHash, getError, getPeacVaryHeaders, isRetryable, isValidHash, needsPurposeVary, parseHash };
1712
1859
  //# sourceMappingURL=index.mjs.map
1713
1860
  //# sourceMappingURL=index.mjs.map