@reclaimprotocol/agent 0.1.34 → 0.1.36

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 (49) hide show
  1. package/README.md +3 -3
  2. package/lib/mcp/api/operations.gen.js +340 -150
  3. package/lib/mcp/instructions.js +3 -3
  4. package/lib/mcp/start.js +8 -7
  5. package/lib/mcp/tools/agent/build.js +2 -0
  6. package/lib/mcp/tools/agent/check-attestor.d.ts +5 -0
  7. package/lib/mcp/tools/agent/check-attestor.js +37 -0
  8. package/lib/mcp/tools/agent/live-view.js +42 -18
  9. package/lib/mcp/tools/agent/proof.d.ts +12 -0
  10. package/lib/mcp/tools/agent/proof.js +32 -0
  11. package/lib/mcp/tools/agent/shared.d.ts +2 -1
  12. package/lib/mcp/tools/agent/shared.js +28 -24
  13. package/lib/mcp/tools/agent/start-integration.js +5 -4
  14. package/lib/mcp/tools/verification/build.d.ts +3 -1
  15. package/lib/mcp/tools/verification/build.js +10 -2
  16. package/lib/mcp/tools/verification/callback-listener.d.ts +51 -0
  17. package/lib/mcp/tools/verification/callback-listener.js +163 -0
  18. package/lib/mcp/tools/verification/index.d.ts +2 -0
  19. package/lib/mcp/tools/verification/index.js +2 -0
  20. package/lib/mcp/tools/verification/proxy-callback-events.d.ts +77 -0
  21. package/lib/mcp/tools/verification/proxy-callback-events.js +383 -0
  22. package/lib/mcp/tools/verification/read-callback-events.d.ts +3 -0
  23. package/lib/mcp/tools/verification/read-callback-events.js +135 -0
  24. package/lib/mcp/tools/verification/result.d.ts +6 -0
  25. package/lib/mcp/tools/verification/result.js +1 -1
  26. package/lib/proof/check-attestor.d.ts +67 -0
  27. package/lib/proof/check-attestor.js +156 -0
  28. package/package.json +2 -2
  29. package/skill/SKILL.builder.md +7 -1
  30. package/skill/SKILL.common.md +21 -9
  31. package/skill/builder-mode.md +25 -12
  32. package/skill/start-integration.md +37 -11
  33. package/skill/verification-client-integration.md +81 -18
  34. package/src/mcp/api/operations.gen.ts +344 -150
  35. package/src/mcp/instructions.ts +3 -3
  36. package/src/mcp/start.ts +9 -7
  37. package/src/mcp/tools/agent/build.ts +2 -0
  38. package/src/mcp/tools/agent/check-attestor.ts +49 -0
  39. package/src/mcp/tools/agent/live-view.ts +42 -18
  40. package/src/mcp/tools/agent/proof.ts +55 -0
  41. package/src/mcp/tools/agent/shared.ts +33 -23
  42. package/src/mcp/tools/agent/start-integration.ts +5 -4
  43. package/src/mcp/tools/verification/build.ts +10 -2
  44. package/src/mcp/tools/verification/callback-listener.ts +203 -0
  45. package/src/mcp/tools/verification/index.ts +2 -0
  46. package/src/mcp/tools/verification/proxy-callback-events.ts +484 -0
  47. package/src/mcp/tools/verification/read-callback-events.ts +160 -0
  48. package/src/mcp/tools/verification/result.ts +1 -1
  49. package/src/proof/check-attestor.ts +209 -0
@@ -1,5 +1,5 @@
1
1
  // AUTO-GENERATED by packages/app/scripts/mcp-tools-gen.ts
2
- // from packages/app/openapi.yaml (spec v0.1.0, source sha256:e2db795ab15c).
2
+ // from packages/app/openapi.yaml (spec v0.1.0, source sha256:96339e8dff91).
3
3
  // The hash catches drift the version misses (a spec can change without a
4
4
  // version bump) — do not remove it as "redundant" with the version.
5
5
  // Run `npm run openapi:gen --workspace=packages/app` to regenerate. Do not edit by hand.
@@ -502,7 +502,7 @@ export const MCP_TOOLS = {
502
502
  annotations: {"openWorldHint":false},
503
503
  },
504
504
  "CreateCallbackSubscription": {
505
- description: "Register a callback subscription\n\nRegisters a destination for verification results on the organization\nthe presented `OrgToken` resolves to. The body is just `callbackUrl`\nand `events`. At least one subscription must exist for the org before a\nverification session can be created. Delivery is scoped by org: terminal\nresults are ECIES-encrypted to the org's eth public key when its\n`canEncryptResult` is enabled (see `PUT /orgs/{orgId}/keypair`), else\ndelivered as plaintext.\n",
505
+ description: "Register a callback subscription\n\nRegisters a destination for verification results on the organization\nthe presented `OrgToken` resolves to. At least one subscription must\nexist for the org before you can create a verification session.\nDelivery is scoped by org: terminal results are ECIES-encrypted to the\norg's eth public key when its `canEncryptResult` is enabled (see\n`PUT /orgs/{orgId}/keypair`), else delivered as plaintext.\n\nTo receive results at a URL, send `callbackUrl` and `events`. Builder\nPOSTs each delivery to that URL.\n\nTo read results without a public URL during local development, send\n`deliveryMode: \"pull\"`. Builder keeps the deliveries and you read them\nwith `GET /verifications/callback-events`. A pull subscription is a\n90-second lease: it receives events and satisfies the session-creation\ncheck only while the lease is unexpired. Send the same request about\nevery 30 seconds to renew it, and call\n`POST /verifications/callback-listener/release` when you stop. Production\nneeds a webhook subscription. An org has at most one pull subscription.\nIf it already exists, Builder renews it and returns it with status 200.\nIf the body includes `events`, they replace the subscription's events;\nif it omits them, the existing events are kept.\n",
506
506
  inputSchema: toZod({
507
507
  "type": "object",
508
508
  "properties": {
@@ -519,83 +519,180 @@ export const MCP_TOOLS = {
519
519
  }
520
520
  },
521
521
  "body": {
522
- "type": "object",
523
- "additionalProperties": false,
524
- "description": "Body for `POST /verifications/callback-subscriptions`. The owning organization is resolved from the presented `OrgToken`; delivery is scoped to that org and encrypted to its credential when set.",
525
- "required": [
526
- "callbackUrl",
527
- "events"
528
- ],
529
- "properties": {
530
- "callbackUrl": {
531
- "type": "string",
532
- "pattern": "^https?://",
533
- "description": "Callback URL or template. Supported placeholders are `{{sessionId}}` and top-level scalar context keys.",
534
- "maxLength": 2000
522
+ "description": "Body for `POST /verifications/callback-subscriptions`. The owning organization is resolved from the presented `OrgToken`; delivery is scoped to that org and encrypted to its credential when set. Send `callbackUrl` for a webhook, or `deliveryMode: \"pull\"` for a subscription you read.",
523
+ "oneOf": [
524
+ {
525
+ "type": "object",
526
+ "additionalProperties": false,
527
+ "description": "A subscription that Builder POSTs each delivery to.",
528
+ "required": [
529
+ "callbackUrl",
530
+ "events"
531
+ ],
532
+ "properties": {
533
+ "deliveryMode": {
534
+ "type": "string",
535
+ "description": "Omit it or send `webhook`.",
536
+ "enum": [
537
+ "webhook"
538
+ ]
539
+ },
540
+ "callbackUrl": {
541
+ "type": "string",
542
+ "pattern": "^https?://",
543
+ "description": "Callback URL or template. Supported placeholders are `{{sessionId}}` and top-level scalar context keys.",
544
+ "maxLength": 2000
545
+ },
546
+ "events": {
547
+ "type": "array",
548
+ "minItems": 1,
549
+ "maxItems": 51,
550
+ "items": {
551
+ "type": "string",
552
+ "description": "Canonical Builder lifecycle event. Names use lower snake case; metadata uses camel case. Provider events include providerId, resolvedVersion, and ordinal. Request events also include requestId. New values are additive, so clients must tolerate unknown response values. For field requirements and funnel semantics, see docs/verification-analytics-events.md.",
553
+ "enum": [
554
+ "billing_required",
555
+ "session_pending",
556
+ "verification_client_opened",
557
+ "verification_client_ready",
558
+ "verification_client_warning",
559
+ "verification_client_visibility_shown",
560
+ "verification_client_visibility_hidden",
561
+ "verification_diagnostics_mode_changed",
562
+ "verification_cancelled",
563
+ "consent_viewed",
564
+ "consent_scrolled",
565
+ "consent_agreed",
566
+ "verification_browser_started",
567
+ "verification_browser_ready",
568
+ "verification_browser_reconnect_started",
569
+ "verification_browser_reconnected",
570
+ "verification_browser_failed",
571
+ "verification_provider_started",
572
+ "provider_config",
573
+ "provider_script_log",
574
+ "network_request_observed",
575
+ "verification_page_ready",
576
+ "verification_request_interceptor_ready",
577
+ "verification_provider_completed",
578
+ "auth_required",
579
+ "auth_submitted",
580
+ "auth_challenge_remains",
581
+ "auth_rejected",
582
+ "auth_submission_failed",
583
+ "auth_challenge_completed",
584
+ "auth_gate_not_detected",
585
+ "authenticated",
586
+ "user_interaction_started",
587
+ "user_input_started",
588
+ "user_interaction_summary",
589
+ "verification_inactivity_detected",
590
+ "request_matched",
591
+ "request_match_failed",
592
+ "request_claim_parameters_captured",
593
+ "request_claim_created",
594
+ "request_claim_retrying",
595
+ "request_claim_completed",
596
+ "request_claim_rejected",
597
+ "request_claim_failed",
598
+ "verification_proofs_completed",
599
+ "verification_result_submitting",
600
+ "verification_result_submission_failed",
601
+ "verification_success",
602
+ "verification_rejected",
603
+ "verification_error",
604
+ "session_expired"
605
+ ]
606
+ }
607
+ }
608
+ }
535
609
  },
536
- "events": {
537
- "type": "array",
538
- "minItems": 1,
539
- "maxItems": 51,
540
- "items": {
541
- "type": "string",
542
- "description": "Canonical Builder lifecycle event. Names use lower snake case; metadata uses camel case. Provider events include providerId, resolvedVersion, and ordinal. Request events also include requestId. New values are additive, so clients must tolerate unknown response values. For field requirements and funnel semantics, see docs/verification-analytics-events.md.",
543
- "enum": [
544
- "billing_required",
545
- "session_pending",
546
- "verification_client_opened",
547
- "verification_client_ready",
548
- "verification_client_warning",
549
- "verification_client_visibility_shown",
550
- "verification_client_visibility_hidden",
551
- "verification_diagnostics_mode_changed",
552
- "verification_cancelled",
553
- "consent_viewed",
554
- "consent_scrolled",
555
- "consent_agreed",
556
- "verification_browser_started",
557
- "verification_browser_ready",
558
- "verification_browser_reconnect_started",
559
- "verification_browser_reconnected",
560
- "verification_browser_failed",
561
- "verification_provider_started",
562
- "provider_config",
563
- "provider_script_log",
564
- "network_request_observed",
565
- "verification_page_ready",
566
- "verification_request_interceptor_ready",
567
- "verification_provider_completed",
568
- "auth_required",
569
- "auth_submitted",
570
- "auth_challenge_remains",
571
- "auth_rejected",
572
- "auth_submission_failed",
573
- "auth_challenge_completed",
574
- "auth_gate_not_detected",
575
- "authenticated",
576
- "user_interaction_started",
577
- "user_input_started",
578
- "user_interaction_summary",
579
- "verification_inactivity_detected",
580
- "request_matched",
581
- "request_match_failed",
582
- "request_claim_parameters_captured",
583
- "request_claim_created",
584
- "request_claim_retrying",
585
- "request_claim_completed",
586
- "request_claim_rejected",
587
- "request_claim_failed",
588
- "verification_proofs_completed",
589
- "verification_result_submitting",
590
- "verification_result_submission_failed",
591
- "verification_success",
592
- "verification_rejected",
593
- "verification_error",
594
- "session_expired"
595
- ]
610
+ {
611
+ "type": "object",
612
+ "additionalProperties": false,
613
+ "description": "A subscription whose deliveries wait for you to read them. It has no URL. An org has at most one.",
614
+ "required": [
615
+ "deliveryMode"
616
+ ],
617
+ "properties": {
618
+ "deliveryMode": {
619
+ "type": "string",
620
+ "enum": [
621
+ "pull"
622
+ ]
623
+ },
624
+ "callbackUrl": {
625
+ "description": "Not allowed. A pull subscription has no URL.",
626
+ "not": {
627
+
628
+ }
629
+ },
630
+ "events": {
631
+ "type": "array",
632
+ "description": "Events to keep. Defaults to every event.",
633
+ "minItems": 1,
634
+ "maxItems": 51,
635
+ "items": {
636
+ "type": "string",
637
+ "description": "Canonical Builder lifecycle event. Names use lower snake case; metadata uses camel case. Provider events include providerId, resolvedVersion, and ordinal. Request events also include requestId. New values are additive, so clients must tolerate unknown response values. For field requirements and funnel semantics, see docs/verification-analytics-events.md.",
638
+ "enum": [
639
+ "billing_required",
640
+ "session_pending",
641
+ "verification_client_opened",
642
+ "verification_client_ready",
643
+ "verification_client_warning",
644
+ "verification_client_visibility_shown",
645
+ "verification_client_visibility_hidden",
646
+ "verification_diagnostics_mode_changed",
647
+ "verification_cancelled",
648
+ "consent_viewed",
649
+ "consent_scrolled",
650
+ "consent_agreed",
651
+ "verification_browser_started",
652
+ "verification_browser_ready",
653
+ "verification_browser_reconnect_started",
654
+ "verification_browser_reconnected",
655
+ "verification_browser_failed",
656
+ "verification_provider_started",
657
+ "provider_config",
658
+ "provider_script_log",
659
+ "network_request_observed",
660
+ "verification_page_ready",
661
+ "verification_request_interceptor_ready",
662
+ "verification_provider_completed",
663
+ "auth_required",
664
+ "auth_submitted",
665
+ "auth_challenge_remains",
666
+ "auth_rejected",
667
+ "auth_submission_failed",
668
+ "auth_challenge_completed",
669
+ "auth_gate_not_detected",
670
+ "authenticated",
671
+ "user_interaction_started",
672
+ "user_input_started",
673
+ "user_interaction_summary",
674
+ "verification_inactivity_detected",
675
+ "request_matched",
676
+ "request_match_failed",
677
+ "request_claim_parameters_captured",
678
+ "request_claim_created",
679
+ "request_claim_retrying",
680
+ "request_claim_completed",
681
+ "request_claim_rejected",
682
+ "request_claim_failed",
683
+ "verification_proofs_completed",
684
+ "verification_result_submitting",
685
+ "verification_result_submission_failed",
686
+ "verification_success",
687
+ "verification_rejected",
688
+ "verification_error",
689
+ "session_expired"
690
+ ]
691
+ }
692
+ }
596
693
  }
597
694
  }
598
- }
695
+ ]
599
696
  },
600
697
  "orgToken": {
601
698
  "type": "string",
@@ -681,83 +778,180 @@ export const MCP_TOOLS = {
681
778
  }
682
779
  },
683
780
  "body": {
684
- "type": "object",
685
- "additionalProperties": false,
686
- "description": "Body for `POST /orgs/{orgId}/callback-subscriptions`. The owning organization comes from the path; bearer-authenticated and gated on org membership. Delivery is scoped to the org and encrypted to its credential when set.",
687
- "required": [
688
- "callbackUrl",
689
- "events"
690
- ],
691
- "properties": {
692
- "callbackUrl": {
693
- "type": "string",
694
- "pattern": "^https?://",
695
- "description": "Callback URL or template. Supported placeholders are `{{sessionId}}` and top-level scalar context keys.",
696
- "maxLength": 2000
781
+ "description": "Body for `POST /orgs/{orgId}/callback-subscriptions`. The owning organization comes from the path; bearer-authenticated and gated on org membership. Delivery is scoped to the org and encrypted to its credential when set. Send `callbackUrl` for a webhook, or `deliveryMode: \"pull\"` for a subscription you read.",
782
+ "oneOf": [
783
+ {
784
+ "type": "object",
785
+ "additionalProperties": false,
786
+ "description": "A subscription that Builder POSTs each delivery to.",
787
+ "required": [
788
+ "callbackUrl",
789
+ "events"
790
+ ],
791
+ "properties": {
792
+ "deliveryMode": {
793
+ "type": "string",
794
+ "description": "Omit it or send `webhook`.",
795
+ "enum": [
796
+ "webhook"
797
+ ]
798
+ },
799
+ "callbackUrl": {
800
+ "type": "string",
801
+ "pattern": "^https?://",
802
+ "description": "Callback URL or template. Supported placeholders are `{{sessionId}}` and top-level scalar context keys.",
803
+ "maxLength": 2000
804
+ },
805
+ "events": {
806
+ "type": "array",
807
+ "minItems": 1,
808
+ "maxItems": 51,
809
+ "items": {
810
+ "type": "string",
811
+ "description": "Canonical Builder lifecycle event. Names use lower snake case; metadata uses camel case. Provider events include providerId, resolvedVersion, and ordinal. Request events also include requestId. New values are additive, so clients must tolerate unknown response values. For field requirements and funnel semantics, see docs/verification-analytics-events.md.",
812
+ "enum": [
813
+ "billing_required",
814
+ "session_pending",
815
+ "verification_client_opened",
816
+ "verification_client_ready",
817
+ "verification_client_warning",
818
+ "verification_client_visibility_shown",
819
+ "verification_client_visibility_hidden",
820
+ "verification_diagnostics_mode_changed",
821
+ "verification_cancelled",
822
+ "consent_viewed",
823
+ "consent_scrolled",
824
+ "consent_agreed",
825
+ "verification_browser_started",
826
+ "verification_browser_ready",
827
+ "verification_browser_reconnect_started",
828
+ "verification_browser_reconnected",
829
+ "verification_browser_failed",
830
+ "verification_provider_started",
831
+ "provider_config",
832
+ "provider_script_log",
833
+ "network_request_observed",
834
+ "verification_page_ready",
835
+ "verification_request_interceptor_ready",
836
+ "verification_provider_completed",
837
+ "auth_required",
838
+ "auth_submitted",
839
+ "auth_challenge_remains",
840
+ "auth_rejected",
841
+ "auth_submission_failed",
842
+ "auth_challenge_completed",
843
+ "auth_gate_not_detected",
844
+ "authenticated",
845
+ "user_interaction_started",
846
+ "user_input_started",
847
+ "user_interaction_summary",
848
+ "verification_inactivity_detected",
849
+ "request_matched",
850
+ "request_match_failed",
851
+ "request_claim_parameters_captured",
852
+ "request_claim_created",
853
+ "request_claim_retrying",
854
+ "request_claim_completed",
855
+ "request_claim_rejected",
856
+ "request_claim_failed",
857
+ "verification_proofs_completed",
858
+ "verification_result_submitting",
859
+ "verification_result_submission_failed",
860
+ "verification_success",
861
+ "verification_rejected",
862
+ "verification_error",
863
+ "session_expired"
864
+ ]
865
+ }
866
+ }
867
+ }
697
868
  },
698
- "events": {
699
- "type": "array",
700
- "minItems": 1,
701
- "maxItems": 51,
702
- "items": {
703
- "type": "string",
704
- "description": "Canonical Builder lifecycle event. Names use lower snake case; metadata uses camel case. Provider events include providerId, resolvedVersion, and ordinal. Request events also include requestId. New values are additive, so clients must tolerate unknown response values. For field requirements and funnel semantics, see docs/verification-analytics-events.md.",
705
- "enum": [
706
- "billing_required",
707
- "session_pending",
708
- "verification_client_opened",
709
- "verification_client_ready",
710
- "verification_client_warning",
711
- "verification_client_visibility_shown",
712
- "verification_client_visibility_hidden",
713
- "verification_diagnostics_mode_changed",
714
- "verification_cancelled",
715
- "consent_viewed",
716
- "consent_scrolled",
717
- "consent_agreed",
718
- "verification_browser_started",
719
- "verification_browser_ready",
720
- "verification_browser_reconnect_started",
721
- "verification_browser_reconnected",
722
- "verification_browser_failed",
723
- "verification_provider_started",
724
- "provider_config",
725
- "provider_script_log",
726
- "network_request_observed",
727
- "verification_page_ready",
728
- "verification_request_interceptor_ready",
729
- "verification_provider_completed",
730
- "auth_required",
731
- "auth_submitted",
732
- "auth_challenge_remains",
733
- "auth_rejected",
734
- "auth_submission_failed",
735
- "auth_challenge_completed",
736
- "auth_gate_not_detected",
737
- "authenticated",
738
- "user_interaction_started",
739
- "user_input_started",
740
- "user_interaction_summary",
741
- "verification_inactivity_detected",
742
- "request_matched",
743
- "request_match_failed",
744
- "request_claim_parameters_captured",
745
- "request_claim_created",
746
- "request_claim_retrying",
747
- "request_claim_completed",
748
- "request_claim_rejected",
749
- "request_claim_failed",
750
- "verification_proofs_completed",
751
- "verification_result_submitting",
752
- "verification_result_submission_failed",
753
- "verification_success",
754
- "verification_rejected",
755
- "verification_error",
756
- "session_expired"
757
- ]
869
+ {
870
+ "type": "object",
871
+ "additionalProperties": false,
872
+ "description": "A subscription whose deliveries wait for you to read them. It has no URL. An org has at most one.",
873
+ "required": [
874
+ "deliveryMode"
875
+ ],
876
+ "properties": {
877
+ "deliveryMode": {
878
+ "type": "string",
879
+ "enum": [
880
+ "pull"
881
+ ]
882
+ },
883
+ "callbackUrl": {
884
+ "description": "Not allowed. A pull subscription has no URL.",
885
+ "not": {
886
+
887
+ }
888
+ },
889
+ "events": {
890
+ "type": "array",
891
+ "description": "Events to keep. Defaults to every event.",
892
+ "minItems": 1,
893
+ "maxItems": 51,
894
+ "items": {
895
+ "type": "string",
896
+ "description": "Canonical Builder lifecycle event. Names use lower snake case; metadata uses camel case. Provider events include providerId, resolvedVersion, and ordinal. Request events also include requestId. New values are additive, so clients must tolerate unknown response values. For field requirements and funnel semantics, see docs/verification-analytics-events.md.",
897
+ "enum": [
898
+ "billing_required",
899
+ "session_pending",
900
+ "verification_client_opened",
901
+ "verification_client_ready",
902
+ "verification_client_warning",
903
+ "verification_client_visibility_shown",
904
+ "verification_client_visibility_hidden",
905
+ "verification_diagnostics_mode_changed",
906
+ "verification_cancelled",
907
+ "consent_viewed",
908
+ "consent_scrolled",
909
+ "consent_agreed",
910
+ "verification_browser_started",
911
+ "verification_browser_ready",
912
+ "verification_browser_reconnect_started",
913
+ "verification_browser_reconnected",
914
+ "verification_browser_failed",
915
+ "verification_provider_started",
916
+ "provider_config",
917
+ "provider_script_log",
918
+ "network_request_observed",
919
+ "verification_page_ready",
920
+ "verification_request_interceptor_ready",
921
+ "verification_provider_completed",
922
+ "auth_required",
923
+ "auth_submitted",
924
+ "auth_challenge_remains",
925
+ "auth_rejected",
926
+ "auth_submission_failed",
927
+ "auth_challenge_completed",
928
+ "auth_gate_not_detected",
929
+ "authenticated",
930
+ "user_interaction_started",
931
+ "user_input_started",
932
+ "user_interaction_summary",
933
+ "verification_inactivity_detected",
934
+ "request_matched",
935
+ "request_match_failed",
936
+ "request_claim_parameters_captured",
937
+ "request_claim_created",
938
+ "request_claim_retrying",
939
+ "request_claim_completed",
940
+ "request_claim_rejected",
941
+ "request_claim_failed",
942
+ "verification_proofs_completed",
943
+ "verification_result_submitting",
944
+ "verification_result_submission_failed",
945
+ "verification_success",
946
+ "verification_rejected",
947
+ "verification_error",
948
+ "session_expired"
949
+ ]
950
+ }
951
+ }
758
952
  }
759
953
  }
760
- }
954
+ ]
761
955
  }
762
956
  },
763
957
  "required": [
@@ -77,9 +77,9 @@ const TOPIC_SUMMARIES: Record<string, string> = {
77
77
  + 'providers, and going live.',
78
78
  'discover': 'Reusing existing providers: finding, resolving, and '
79
79
  + 'creating a verification session.',
80
- 'integration': 'After start_integration: org key, callback, frontend and '
81
- + 'backend over the HTTP session API; `api=2` and result '
82
- + 'verification.',
80
+ 'integration': 'After start_integration: org key, callback (local '
81
+ + 'proxy_callback_events or deployed webhook), frontend and backend '
82
+ + 'over the HTTP session API; `api=2` and result verification.',
83
83
  'user-script': 'The navigation script (jsUserScripts): sign-in redirect, '
84
84
  + 'multi-page walk, test_user_script with keep.',
85
85
  'interception': 'injectionType / interceptorType, live interception, the '
package/src/mcp/start.ts CHANGED
@@ -31,6 +31,8 @@ import {
31
31
  buildVerificationTools,
32
32
  disposeAgentState,
33
33
  readSession,
34
+ releaseAllListeners,
35
+ stopAllForwarders,
34
36
  } from './tools/index.ts'
35
37
  import { BUILDER_MODE_INSTRUCTIONS } from './instructions.ts'
36
38
  import { registerToolList } from './server.ts'
@@ -133,7 +135,7 @@ export async function startMcpServer() {
133
135
  // the session can end without a single tool call: the developer closes their
134
136
  // agent, the client kills the server, stdin drops. Nothing ran here before,
135
137
  // which left a container up after the session that made it was gone.
136
- if(agentToolsEnabled) {
138
+ if(agentToolsEnabled || !oldMode) {
137
139
  installShutdownHooks(() => agentState)
138
140
  }
139
141
 
@@ -160,11 +162,7 @@ function installShutdownHooks(state: () => AgentState | undefined): void {
160
162
 
161
163
  shuttingDown = true
162
164
  const current = state()
163
- if(!current) {
164
- process.exit(0)
165
- }
166
-
167
- LOGGER.info({ reason }, 'releasing the browser before exit')
165
+ LOGGER.info({ reason }, 'releasing resources before exit')
168
166
  // Bounded: a wedged `docker stop` must not keep the process alive, but
169
167
  // nor should we skip cleanup that would have finished in a second.
170
168
  const timer = setTimeout(() => {
@@ -172,7 +170,11 @@ function installShutdownHooks(state: () => AgentState | undefined): void {
172
170
  process.exit(0)
173
171
  }, SHUTDOWN_GRACE_MS)
174
172
  timer.unref()
175
- void disposeAgentState(current)
173
+ void Promise.all([
174
+ stopAllForwarders(),
175
+ releaseAllListeners(),
176
+ current && disposeAgentState(current),
177
+ ])
176
178
  .catch((err: unknown) => {
177
179
  LOGGER.warn({ err }, 'teardown failed')
178
180
  })
@@ -17,6 +17,7 @@ import { type RegisteredTool } from '../../server.ts'
17
17
  import { analyzeTool } from './analyze.ts'
18
18
  import { type AttachState, attachTool } from './attach.ts'
19
19
  import { type CaptureStore, captureTools, resetCaptures } from './capture.ts'
20
+ import { checkAttestorTool } from './check-attestor.ts'
20
21
  import { listTabsTool } from './eval.ts'
21
22
  import { howItWorksTool } from './how-it-works.ts'
22
23
  import { liveViewTools } from './live-view.ts'
@@ -83,6 +84,7 @@ export function buildAgentTools(
83
84
  }
84
85
 
85
86
  tools.push(analyzeTool(state.captures))
87
+ tools.push(checkAttestorTool())
86
88
  // navigate / eval_in_page / wait_for_page / get_cookies / list_requests /
87
89
  // find_requests_containing / propose_provider / replay_request / run_proof —
88
90
  // shared with the cloud loop, bound to each capture's local backend.