xytara 3.1.16 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/README.md +120 -92
  2. package/RELEASE_NOTES.md +7 -3
  3. package/START_HERE.md +56 -224
  4. package/bin/xytara.js +21 -8
  5. package/client.js +79 -1
  6. package/lib/{delivery_receipt.js → delivery_receipt_verify.js} +14 -100
  7. package/package.json +25 -35
  8. package/scripts/verify_client.js +418 -0
  9. package/scripts/verify_release_candidate.js +146 -45
  10. package/.env.example +0 -173
  11. package/ADAPTER_START_HERE.md +0 -56
  12. package/BSV_TERANODE_PLATFORM_DISCONTINUITY_RUNBOOK.md +0 -126
  13. package/CARRIED_HANDOFF_DEMO.md +0 -60
  14. package/EXAMPLE_PATHS.md +0 -53
  15. package/FINAL_CONTRACT.md +0 -498
  16. package/PARTNER_READY_PATH.md +0 -71
  17. package/PUBLIC_DEMO_SCRIPT.md +0 -78
  18. package/REAL_PAYMENT_SETUP.md +0 -320
  19. package/SERVICE_CONTRACT.md +0 -419
  20. package/SUPABASE_RUNTIME_STATE_SETUP.md +0 -61
  21. package/TERMINOLOGY.md +0 -50
  22. package/WHY_XYTARA_XOONYA.md +0 -63
  23. package/XT1_EXECUTION_TRUTH_STANDARD.md +0 -78
  24. package/XYTARA_ADAPTER_PROTOCOL_TRUTH_MODEL.md +0 -75
  25. package/XYTARA_AUTONOMOUS_ENTRY_MODEL.md +0 -124
  26. package/XYTARA_DEFAULT_PATH_MODEL.md +0 -84
  27. package/XYTARA_EXECUTION_TRUTH_MODEL.md +0 -171
  28. package/XYTARA_PAYMENT_RAIL_TRUTH_MODEL.md +0 -68
  29. package/adapters/AUTHORING_GUIDE.md +0 -244
  30. package/adapters/ONBOARDING_POSTURE.md +0 -61
  31. package/adapters/THIRD_PARTY_SUBMISSION_PROCESS.md +0 -84
  32. package/adapters/adapter-manifest.schema.json +0 -283
  33. package/adapters/examples/example-execution-adapter.js +0 -61
  34. package/adapters/examples/example-execution-adapter.manifest.json +0 -81
  35. package/adapters/examples/example-settlement-adapter.js +0 -55
  36. package/adapters/examples/example-settlement-adapter.manifest.json +0 -78
  37. package/adapters/examples/example-third-party-acp-registration.submission-bundle.json +0 -124
  38. package/adapters/examples/example-third-party-erc8004-registration.submission-bundle.json +0 -121
  39. package/adapters/examples/example-third-party-identity-registration.certification-pack.json +0 -22
  40. package/adapters/examples/example-third-party-identity-registration.record.json +0 -26
  41. package/adapters/examples/example-third-party-identity-registration.submission-bundle.json +0 -126
  42. package/adapters/examples/example-third-party-langchain-registration.submission-bundle.json +0 -124
  43. package/adapters/examples/example-third-party-mpp-registration.submission-bundle.json +0 -120
  44. package/adapters/examples/example-third-party-registration.certification-pack.json +0 -22
  45. package/adapters/examples/example-third-party-registration.record.json +0 -28
  46. package/adapters/examples/example-third-party-registration.submission-bundle.json +0 -126
  47. package/adapters/examples/example-third-party-settlement-registration.certification-pack.json +0 -22
  48. package/adapters/examples/example-third-party-settlement-registration.record.json +0 -26
  49. package/adapters/examples/example-third-party-settlement-registration.submission-bundle.json +0 -127
  50. package/adapters/examples/langchain-reference-execution-adapter.js +0 -81
  51. package/adapters/examples/langchain-reference-execution-adapter.manifest.json +0 -79
  52. package/adapters/examples/langgraph-reference-execution-adapter.js +0 -81
  53. package/adapters/examples/langgraph-reference-execution-adapter.manifest.json +0 -79
  54. package/adapters/examples/minimal-third-party-execution-adapter.js +0 -61
  55. package/adapters/examples/minimal-third-party-execution-adapter.manifest.json +0 -79
  56. package/adapters/examples/minimal-third-party-execution-registration.record.json +0 -26
  57. package/adapters/examples/minimal-third-party-execution.certification-pack.json +0 -22
  58. package/adapters/examples/minimal-third-party-execution.submission-bundle.json +0 -126
  59. package/adapters/integration-certification-pack.schema.json +0 -82
  60. package/adapters/integration-registration-record.schema.json +0 -114
  61. package/adapters/integration-submission-bundle-set.schema.json +0 -39
  62. package/adapters/integration-submission-bundle.schema.json +0 -34
  63. package/adapters/interfaces.js +0 -56
  64. package/bin/xytara-release.js +0 -1429
  65. package/examples/_demo_env.js +0 -40
  66. package/examples/adapter_review_walkthrough.js +0 -54
  67. package/examples/export_carried_handoff.js +0 -81
  68. package/examples/funded_runtime_walkthrough.js +0 -71
  69. package/examples/partner_launch_walkthrough.js +0 -44
  70. package/examples/quickstart.js +0 -3256
  71. package/fixtures/catalog.js +0 -1156
  72. package/index.js +0 -395
  73. package/integrations/dispatch.js +0 -276
  74. package/integrations/registry-snapshot.schema.json +0 -36
  75. package/integrations/registry.js +0 -2261
  76. package/integrations/views.js +0 -28
  77. package/lib/a2a_lane_contract.js +0 -104
  78. package/lib/a2a_rpc.js +0 -287
  79. package/lib/a2c_lane_contract.js +0 -111
  80. package/lib/account_auth.js +0 -585
  81. package/lib/acp_lane_contract.js +0 -54
  82. package/lib/activity_audit_contract.js +0 -322
  83. package/lib/adapter_certification_contract.js +0 -130
  84. package/lib/adapter_depth_contract.js +0 -218
  85. package/lib/adapter_pack.js +0 -118
  86. package/lib/adapter_partner_pack.js +0 -89
  87. package/lib/adapter_promotion_pack.js +0 -89
  88. package/lib/adapter_protocol_truth_contract.js +0 -229
  89. package/lib/agent_identity.js +0 -162
  90. package/lib/announcement_pack.js +0 -61
  91. package/lib/artifact_distribution_lane_contract.js +0 -54
  92. package/lib/asyncapi_contract.js +0 -150
  93. package/lib/auth_interop_contract.js +0 -80
  94. package/lib/authority_binding_lifecycle_contract.js +0 -182
  95. package/lib/autonomous_entry_contract.js +0 -409
  96. package/lib/bolt_adapter.js +0 -187
  97. package/lib/bolt_lane_contract.js +0 -55
  98. package/lib/bolt_payment_front.js +0 -224
  99. package/lib/business_cockpit.js +0 -378
  100. package/lib/buyer_event_log.js +0 -230
  101. package/lib/buyer_safety_policy.js +0 -132
  102. package/lib/capability_execution_truth.js +0 -276
  103. package/lib/capability_registry.js +0 -633
  104. package/lib/catalog_contract.js +0 -966
  105. package/lib/catalog_family_model.js +0 -193
  106. package/lib/catalog_views.js +0 -55
  107. package/lib/cdp_jwt.js +0 -57
  108. package/lib/checkout_event_security.js +0 -142
  109. package/lib/checkout_processor_adapter.js +0 -217
  110. package/lib/cloudevents_contract.js +0 -80
  111. package/lib/command_flow.js +0 -911
  112. package/lib/commerce_artifacts.js +0 -591
  113. package/lib/commerce_authority.js +0 -449
  114. package/lib/commerce_bridge.js +0 -274
  115. package/lib/commerce_cases.js +0 -399
  116. package/lib/commerce_checkout.js +0 -509
  117. package/lib/commerce_coordination.js +0 -346
  118. package/lib/commerce_economics.js +0 -4017
  119. package/lib/commerce_identity.js +0 -578
  120. package/lib/commerce_quotes.js +0 -266
  121. package/lib/commerce_reports.js +0 -14461
  122. package/lib/commerce_runtime.js +0 -322
  123. package/lib/commerce_shell.js +0 -257
  124. package/lib/crypto_agility_matrix.js +0 -125
  125. package/lib/default_path_contract.js +0 -412
  126. package/lib/delivery_summary_contract.js +0 -95
  127. package/lib/ecosystem_entry.js +0 -64
  128. package/lib/erc8004_lane_contract.js +0 -65
  129. package/lib/event_system_lane_contract.js +0 -75
  130. package/lib/execution_dedupe.js +0 -86
  131. package/lib/execution_truth_contract.js +0 -234
  132. package/lib/external_credit_bridge.js +0 -142
  133. package/lib/external_execution_policy.js +0 -143
  134. package/lib/external_execution_runtime.js +0 -238
  135. package/lib/feature_control_lane_contract.js +0 -54
  136. package/lib/first_run_conversion_contract.js +0 -290
  137. package/lib/framework_lane_contract.js +0 -89
  138. package/lib/framework_provider_promotion.js +0 -235
  139. package/lib/full_catalog_contract.js +0 -525
  140. package/lib/go_live_operator_pack.js +0 -391
  141. package/lib/http_transport.js +0 -99
  142. package/lib/identity_auth.js +0 -175
  143. package/lib/identity_interop_contract.js +0 -82
  144. package/lib/integration_matrix_contract.js +0 -102
  145. package/lib/l402_adapter.js +0 -241
  146. package/lib/l402_lane_contract.js +0 -55
  147. package/lib/l402_payment_front.js +0 -265
  148. package/lib/launch_narrative.js +0 -53
  149. package/lib/lifecycle_continuity_contract.js +0 -115
  150. package/lib/machine_identity_registry_contract.js +0 -199
  151. package/lib/major_rails_lane_contract.js +0 -150
  152. package/lib/market_lane_contract.js +0 -467
  153. package/lib/market_lane_depth_contract.js +0 -182
  154. package/lib/market_lane_promotion_contract.js +0 -210
  155. package/lib/market_lane_trace_contract.js +0 -278
  156. package/lib/mcp_lane_contract.js +0 -137
  157. package/lib/mpp_adapter.js +0 -237
  158. package/lib/network_transport.js +0 -110
  159. package/lib/offline_verifiability_recovery_contract.js +0 -155
  160. package/lib/openapi_contract.js +0 -300
  161. package/lib/operational_receipt_contract.js +0 -165
  162. package/lib/operator_intelligence.js +0 -407
  163. package/lib/outreach_copy_pack.js +0 -51
  164. package/lib/outreach_message_pack.js +0 -71
  165. package/lib/outreach_proof.js +0 -71
  166. package/lib/outreach_target_pack.js +0 -60
  167. package/lib/partner_intelligence.js +0 -105
  168. package/lib/payment_config.js +0 -257
  169. package/lib/payment_front_registry.js +0 -53
  170. package/lib/payment_protocol_contract.js +0 -165
  171. package/lib/payment_rail_truth_contract.js +0 -324
  172. package/lib/payment_verification.js +0 -357
  173. package/lib/phase_10_closeout_pack.js +0 -45
  174. package/lib/phase_10_completion_pack.js +0 -76
  175. package/lib/phase_10_decision_record_pack.js +0 -54
  176. package/lib/phase_10_decision_resolution_pack.js +0 -53
  177. package/lib/phase_10_demand_signal_adapters_runtime_pack.js +0 -74
  178. package/lib/phase_10_ecosystem_backlog_triage_runtime_pack.js +0 -74
  179. package/lib/phase_10_freeze_baseline_pack.js +0 -67
  180. package/lib/phase_10_freeze_review_pack.js +0 -64
  181. package/lib/phase_10_gate_pack.js +0 -57
  182. package/lib/phase_10_long_tail_continuity_pack.js +0 -80
  183. package/lib/phase_10_long_tail_ecosystem_pack.js +0 -66
  184. package/lib/phase_10_niche_extension_registry_runtime_pack.js +0 -74
  185. package/lib/phase_1_claude_mcp_pack.js +0 -60
  186. package/lib/phase_1_claude_mcp_runtime_pack.js +0 -52
  187. package/lib/phase_1_ecosystem_pack.js +0 -67
  188. package/lib/phase_1_openai_codex_pack.js +0 -60
  189. package/lib/phase_1_openai_codex_runtime_pack.js +0 -52
  190. package/lib/phase_2_base_runtime_pack.js +0 -71
  191. package/lib/phase_2_base_usdc_runtime_pack.js +0 -72
  192. package/lib/phase_2_closeout_pack.js +0 -65
  193. package/lib/phase_2_completion_pack.js +0 -113
  194. package/lib/phase_2_decision_record_pack.js +0 -66
  195. package/lib/phase_2_decision_resolution_pack.js +0 -69
  196. package/lib/phase_2_eth_runtime_pack.js +0 -70
  197. package/lib/phase_2_evm_base_runtime_pack.js +0 -73
  198. package/lib/phase_2_evm_runtime_pack.js +0 -71
  199. package/lib/phase_2_flip_preview_pack.js +0 -60
  200. package/lib/phase_2_freeze_review_pack.js +0 -99
  201. package/lib/phase_2_gate_pack.js +0 -77
  202. package/lib/phase_2_payment_rails_pack.js +0 -71
  203. package/lib/phase_2_usdc_runtime_pack.js +0 -71
  204. package/lib/phase_3_brc_runtime_pack.js +0 -81
  205. package/lib/phase_3_bsv_teranode_runtime_pack.js +0 -83
  206. package/lib/phase_3_closeout_pack.js +0 -62
  207. package/lib/phase_3_completion_pack.js +0 -94
  208. package/lib/phase_3_decision_record_pack.js +0 -64
  209. package/lib/phase_3_decision_resolution_pack.js +0 -69
  210. package/lib/phase_3_freeze_baseline_pack.js +0 -67
  211. package/lib/phase_3_freeze_review_pack.js +0 -80
  212. package/lib/phase_3_gate_pack.js +0 -76
  213. package/lib/phase_3_metanet_runtime_pack.js +0 -81
  214. package/lib/phase_3_native_bsv_pack.js +0 -91
  215. package/lib/phase_3_native_continuity_pack.js +0 -82
  216. package/lib/phase_4_attestation_runtime_pack.js +0 -75
  217. package/lib/phase_4_closeout_pack.js +0 -45
  218. package/lib/phase_4_completion_pack.js +0 -94
  219. package/lib/phase_4_decision_record_pack.js +0 -54
  220. package/lib/phase_4_decision_resolution_pack.js +0 -45
  221. package/lib/phase_4_erc8004_runtime_pack.js +0 -76
  222. package/lib/phase_4_freeze_baseline_pack.js +0 -67
  223. package/lib/phase_4_freeze_review_pack.js +0 -68
  224. package/lib/phase_4_gate_pack.js +0 -58
  225. package/lib/phase_4_identity_registry_runtime_pack.js +0 -75
  226. package/lib/phase_4_identity_trust_pack.js +0 -73
  227. package/lib/phase_4_trust_continuity_pack.js +0 -86
  228. package/lib/phase_5_antelope_runtime_pack.js +0 -76
  229. package/lib/phase_5_closeout_pack.js +0 -44
  230. package/lib/phase_5_completion_pack.js +0 -82
  231. package/lib/phase_5_constellation_dag_runtime_pack.js +0 -76
  232. package/lib/phase_5_decision_record_pack.js +0 -54
  233. package/lib/phase_5_decision_resolution_pack.js +0 -45
  234. package/lib/phase_5_digibyte_dgb_runtime_pack.js +0 -76
  235. package/lib/phase_5_freeze_baseline_pack.js +0 -67
  236. package/lib/phase_5_freeze_review_pack.js +0 -68
  237. package/lib/phase_5_gate_pack.js +0 -58
  238. package/lib/phase_5_hedera_hbar_runtime_pack.js +0 -76
  239. package/lib/phase_5_kaspa_kas_runtime_pack.js +0 -76
  240. package/lib/phase_5_major_rails_continuity_pack.js +0 -86
  241. package/lib/phase_5_major_rails_pack.js +0 -110
  242. package/lib/phase_5_metal_runtime_pack.js +0 -76
  243. package/lib/phase_5_polkadot_dot_runtime_pack.js +0 -76
  244. package/lib/phase_5_proton_xpr_runtime_pack.js +0 -76
  245. package/lib/phase_5_solana_runtime_pack.js +0 -76
  246. package/lib/phase_6_autogen_runtime_pack.js +0 -72
  247. package/lib/phase_6_closeout_pack.js +0 -46
  248. package/lib/phase_6_completion_pack.js +0 -77
  249. package/lib/phase_6_decision_record_pack.js +0 -54
  250. package/lib/phase_6_decision_resolution_pack.js +0 -53
  251. package/lib/phase_6_framework_continuity_pack.js +0 -81
  252. package/lib/phase_6_framework_runtime_pack.js +0 -68
  253. package/lib/phase_6_freeze_baseline_pack.js +0 -68
  254. package/lib/phase_6_freeze_review_pack.js +0 -65
  255. package/lib/phase_6_gate_pack.js +0 -59
  256. package/lib/phase_6_langchain_runtime_pack.js +0 -72
  257. package/lib/phase_6_langgraph_runtime_pack.js +0 -72
  258. package/lib/phase_6_semantic_kernel_runtime_pack.js +0 -72
  259. package/lib/phase_7_closeout_pack.js +0 -45
  260. package/lib/phase_7_completion_pack.js +0 -85
  261. package/lib/phase_7_decision_record_pack.js +0 -53
  262. package/lib/phase_7_decision_resolution_pack.js +0 -53
  263. package/lib/phase_7_event_system_continuity_pack.js +0 -89
  264. package/lib/phase_7_event_system_pack.js +0 -76
  265. package/lib/phase_7_freeze_baseline_pack.js +0 -74
  266. package/lib/phase_7_freeze_review_pack.js +0 -65
  267. package/lib/phase_7_gate_pack.js +0 -58
  268. package/lib/phase_7_kafka_runtime_pack.js +0 -74
  269. package/lib/phase_7_mqtt_runtime_pack.js +0 -74
  270. package/lib/phase_7_nats_runtime_pack.js +0 -74
  271. package/lib/phase_7_webhook_event_bus_runtime_pack.js +0 -74
  272. package/lib/phase_8_closeout_pack.js +0 -46
  273. package/lib/phase_8_completion_pack.js +0 -82
  274. package/lib/phase_8_decision_record_pack.js +0 -54
  275. package/lib/phase_8_decision_resolution_pack.js +0 -53
  276. package/lib/phase_8_external_receipt_import_runtime_pack.js +0 -74
  277. package/lib/phase_8_external_result_import_runtime_pack.js +0 -74
  278. package/lib/phase_8_freeze_baseline_pack.js +0 -71
  279. package/lib/phase_8_freeze_review_pack.js +0 -64
  280. package/lib/phase_8_gate_pack.js +0 -58
  281. package/lib/phase_8_proof_bridge_continuity_pack.js +0 -86
  282. package/lib/phase_8_proof_bridges_pack.js +0 -72
  283. package/lib/phase_8_proof_bundle_normalization_runtime_pack.js +0 -74
  284. package/lib/phase_9_closeout_pack.js +0 -46
  285. package/lib/phase_9_completion_pack.js +0 -82
  286. package/lib/phase_9_custody_refs_runtime_pack.js +0 -74
  287. package/lib/phase_9_decision_record_pack.js +0 -54
  288. package/lib/phase_9_decision_resolution_pack.js +0 -53
  289. package/lib/phase_9_freeze_baseline_pack.js +0 -71
  290. package/lib/phase_9_freeze_review_pack.js +0 -64
  291. package/lib/phase_9_gate_pack.js +0 -58
  292. package/lib/phase_9_operator_accounting_bridges_runtime_pack.js +0 -74
  293. package/lib/phase_9_treasury_connectivity_pack.js +0 -72
  294. package/lib/phase_9_treasury_continuity_pack.js +0 -86
  295. package/lib/phase_9_treasury_destinations_runtime_pack.js +0 -74
  296. package/lib/phase_program_pack.js +0 -120
  297. package/lib/pricing_optimization_contract.js +0 -775
  298. package/lib/protocol_lane_contract.js +0 -117
  299. package/lib/provenance_lane_contract.js +0 -54
  300. package/lib/provider_lane_contract.js +0 -240
  301. package/lib/provider_network_contract.js +0 -149
  302. package/lib/provider_payout_execution.js +0 -155
  303. package/lib/provider_registry.js +0 -852
  304. package/lib/provider_runtime_journey_contract.js +0 -183
  305. package/lib/public_surface_policy_contract.js +0 -111
  306. package/lib/publish_plan.js +0 -51
  307. package/lib/rate_limiter.js +0 -81
  308. package/lib/record_queries.js +0 -48
  309. package/lib/release_candidate.js +0 -50
  310. package/lib/release_center.js +0 -1093
  311. package/lib/release_history.js +0 -205
  312. package/lib/release_manifest.js +0 -113
  313. package/lib/release_pack.js +0 -453
  314. package/lib/request_rate_limit.js +0 -144
  315. package/lib/resource_views.js +0 -31
  316. package/lib/revenue_launch_path_contract.js +0 -326
  317. package/lib/route_matchers.js +0 -34
  318. package/lib/route_params.js +0 -19
  319. package/lib/runtime_bridge.js +0 -124
  320. package/lib/runtime_operations_worker.js +0 -282
  321. package/lib/runtime_state_store.js +0 -495
  322. package/lib/settlement_bsv_live.js +0 -600
  323. package/lib/settlement_bsv_teranode.js +0 -117
  324. package/lib/settlement_lane_contract.js +0 -111
  325. package/lib/shared_signals_lane_contract.js +0 -54
  326. package/lib/signed_audit_provenance_contract.js +0 -83
  327. package/lib/soft_launch_pack.js +0 -78
  328. package/lib/stablecoin_lane_contract.js +0 -76
  329. package/lib/stripe_mpp_lane_contract.js +0 -96
  330. package/lib/stripe_mpp_payment_front.js +0 -258
  331. package/lib/telemetry_lane_contract.js +0 -54
  332. package/lib/treasury_destinations_contract.js +0 -764
  333. package/lib/treasury_egress_policy_contract.js +0 -91
  334. package/lib/treasury_lane_contract.js +0 -84
  335. package/lib/trust_portability_boundary_contract.js +0 -72
  336. package/lib/x402_facilitator.js +0 -198
  337. package/lib/x402_lane_contract.js +0 -136
  338. package/lib/x402_settlement_recovery.js +0 -175
  339. package/scripts/buyer_events_daily_report.js +0 -79
  340. package/scripts/registry_cli.js +0 -275
  341. package/scripts/state_backup_offsite.js +0 -196
  342. package/scripts/verify_a2a_rpc.js +0 -131
  343. package/scripts/verify_adapters.js +0 -554
  344. package/scripts/verify_agent_identity.js +0 -153
  345. package/scripts/verify_all.js +0 -4963
  346. package/scripts/verify_bolt_adapter.js +0 -128
  347. package/scripts/verify_buyer_event_log.js +0 -128
  348. package/scripts/verify_buyer_safety.js +0 -141
  349. package/scripts/verify_cdp_facilitator.js +0 -110
  350. package/scripts/verify_checkout_processor.js +0 -109
  351. package/scripts/verify_commerce_bridge.js +0 -177
  352. package/scripts/verify_control_plane_contracts.js +0 -34
  353. package/scripts/verify_control_plane_routes.js +0 -70
  354. package/scripts/verify_delivery_summary.js +0 -112
  355. package/scripts/verify_examples.js +0 -19
  356. package/scripts/verify_execution_dedupe.js +0 -189
  357. package/scripts/verify_execution_surfacing.js +0 -76
  358. package/scripts/verify_external_execution_retry.js +0 -140
  359. package/scripts/verify_final_activation.js +0 -191
  360. package/scripts/verify_first_run_conversions.js +0 -81
  361. package/scripts/verify_framework_provider_promotion.js +0 -152
  362. package/scripts/verify_full_catalog.js +0 -174
  363. package/scripts/verify_integrations.js +0 -620
  364. package/scripts/verify_l402_adapter.js +0 -86
  365. package/scripts/verify_lifecycle_continuity.js +0 -96
  366. package/scripts/verify_lifecycle_spend_binding.js +0 -88
  367. package/scripts/verify_market_lane_depth.js +0 -94
  368. package/scripts/verify_market_lane_promotion.js +0 -103
  369. package/scripts/verify_market_lane_traces.js +0 -98
  370. package/scripts/verify_market_lanes.js +0 -102
  371. package/scripts/verify_mpp_adapter.js +0 -128
  372. package/scripts/verify_operator_observability_boundary.js +0 -83
  373. package/scripts/verify_pricing_experiment_plan.js +0 -124
  374. package/scripts/verify_production_readiness.js +0 -268
  375. package/scripts/verify_provider_network.js +0 -819
  376. package/scripts/verify_provider_runtime_breadth.js +0 -109
  377. package/scripts/verify_provider_runtime_journeys.js +0 -111
  378. package/scripts/verify_rate_limiter.js +0 -52
  379. package/scripts/verify_refund_credit.js +0 -106
  380. package/scripts/verify_revenue_launch_paths.js +0 -105
  381. package/scripts/verify_runtime_durability.js +0 -52
  382. package/scripts/verify_runtime_state_guard.js +0 -117
  383. package/scripts/verify_service.js +0 -15421
  384. package/scripts/verify_settlement.js +0 -116
  385. package/scripts/verify_tooling.js +0 -1412
  386. package/scripts/verify_treasury_public_boundary.js +0 -97
  387. package/scripts/verify_verify_execute_settle.js +0 -209
  388. package/scripts/verify_x402_facilitator.js +0 -307
  389. package/scripts/verify_x402_settlement_recovery.js +0 -153
  390. package/server.js +0 -12245
@@ -1,196 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- // Off-site, encrypted backups of the runtime's durable state (the Supabase snapshot row).
5
- //
6
- // backup <out_dir> read the live row, sanity-check it, gzip + AES-256-GCM encrypt
7
- // it, verify the ciphertext decrypts back, write <out_dir>/
8
- // xytara-state-<persisted>.enc + manifest.json (no secrets)
9
- // decrypt <file.enc> <out.json> decrypt a backup to the plain row { state_key, persisted_at_iso,
10
- // snapshot }
11
- // restore <file.enc> --runtime-stopped [--state-key k]
12
- // write a decrypted backup back as the live row. ONLY with the
13
- // runtime stopped (suspended on Render): a running runtime would
14
- // overwrite it with its in-memory state on the next flush.
15
- // selftest offline round-trip check (used by verify:all)
16
- //
17
- // Env: XYTARA_SUPABASE_URL, XYTARA_SUPABASE_SERVICE_ROLE_KEY, XYTARA_SUPABASE_STATE_TABLE
18
- // (default xytara_runtime_state), XYTARA_SUPABASE_STATE_KEY (default "default"), STATE_BACKUP_KEY
19
- // (base64, 32 bytes — keep a copy OFF this system: without it no backup can be decrypted),
20
- // STATE_BACKUP_MIN_PROVIDERS (default 1), STATE_BACKUP_MIN_BYTES (default 10000).
21
- // The snapshot contains secrets (provider owner secrets, auth tokens): it is only ever written
22
- // encrypted, and the manifest carries counts and digests only.
23
-
24
- const crypto = require("crypto");
25
- const fs = require("fs");
26
- const path = require("path");
27
- const zlib = require("zlib");
28
-
29
- const ENVELOPE_VERSION = "xytara-state-backup/1";
30
-
31
- function fail(message) {
32
- console.error(`state backup: ${message}`);
33
- process.exit(1);
34
- }
35
-
36
- function backupKey() {
37
- const raw = String(process.env.STATE_BACKUP_KEY || "").trim();
38
- if (!raw) fail("STATE_BACKUP_KEY is not set");
39
- const key = Buffer.from(raw, "base64");
40
- if (key.length !== 32) fail("STATE_BACKUP_KEY must be 32 bytes, base64-encoded");
41
- return key;
42
- }
43
-
44
- function encrypt(rowJson, key) {
45
- const plaintext = zlib.gzipSync(Buffer.from(rowJson, "utf8"), { level: 9 });
46
- const iv = crypto.randomBytes(12);
47
- const cipher = crypto.createCipheriv("aes-256-gcm", key, iv);
48
- cipher.setAAD(Buffer.from(ENVELOPE_VERSION, "utf8"));
49
- const ciphertext = Buffer.concat([cipher.update(plaintext), cipher.final()]);
50
- return {
51
- v: ENVELOPE_VERSION,
52
- alg: "AES-256-GCM",
53
- compression: "gzip",
54
- iv: iv.toString("base64"),
55
- tag: cipher.getAuthTag().toString("base64"),
56
- plaintext_sha256: crypto.createHash("sha256").update(rowJson, "utf8").digest("hex"),
57
- ciphertext: ciphertext.toString("base64")
58
- };
59
- }
60
-
61
- function decrypt(envelope, key) {
62
- if (!envelope || envelope.v !== ENVELOPE_VERSION) throw new Error("not a xytara state backup envelope");
63
- const decipher = crypto.createDecipheriv("aes-256-gcm", key, Buffer.from(envelope.iv, "base64"));
64
- decipher.setAAD(Buffer.from(ENVELOPE_VERSION, "utf8"));
65
- decipher.setAuthTag(Buffer.from(envelope.tag, "base64"));
66
- const plaintext = Buffer.concat([decipher.update(Buffer.from(envelope.ciphertext, "base64")), decipher.final()]);
67
- const rowJson = zlib.gunzipSync(plaintext).toString("utf8");
68
- if (crypto.createHash("sha256").update(rowJson, "utf8").digest("hex") !== envelope.plaintext_sha256) {
69
- throw new Error("decrypted content digest mismatch");
70
- }
71
- return rowJson;
72
- }
73
-
74
- function entryCount(value) {
75
- if (value && value.__runtime_state_kind && Array.isArray(value.value)) return value.value.length;
76
- if (Array.isArray(value)) return value.length;
77
- return value && typeof value === "object" ? Object.keys(value).length : 0;
78
- }
79
-
80
- function summarize(row, rowJson) {
81
- const snapshot = row.snapshot || {};
82
- const counts = {};
83
- for (const key of ["providerRegistry", "providerSettlementLedger", "providerPayouts", "externalCreditGrants", "accountSpendCredentials", "transactions", "deliveryReceipts", "quotes"]) {
84
- if (snapshot[key] !== undefined) counts[key] = entryCount(snapshot[key]);
85
- }
86
- return { state_key: row.state_key, persisted_at_iso: row.persisted_at_iso, snapshot_bytes: Buffer.byteLength(JSON.stringify(snapshot), "utf8"), row_bytes: Buffer.byteLength(rowJson, "utf8"), section_count: Object.keys(snapshot).length, counts };
87
- }
88
-
89
- function supabaseConfig() {
90
- const url = String(process.env.XYTARA_SUPABASE_URL || "").trim().replace(/\/+$/, "");
91
- const serviceKey = String(process.env.XYTARA_SUPABASE_SERVICE_ROLE_KEY || "").trim();
92
- if (!url || !serviceKey) fail("XYTARA_SUPABASE_URL and XYTARA_SUPABASE_SERVICE_ROLE_KEY are required");
93
- return {
94
- url,
95
- serviceKey,
96
- table: String(process.env.XYTARA_SUPABASE_STATE_TABLE || "xytara_runtime_state").trim(),
97
- stateKey: String(process.env.XYTARA_SUPABASE_STATE_KEY || "default").trim()
98
- };
99
- }
100
-
101
- async function fetchRow(cfg) {
102
- const endpoint = `${cfg.url}/rest/v1/${encodeURIComponent(cfg.table)}?state_key=eq.${encodeURIComponent(cfg.stateKey)}&select=state_key,snapshot,persisted_at_iso&limit=1`;
103
- let lastError = null;
104
- for (let attempt = 1; attempt <= 4; attempt += 1) {
105
- try {
106
- const response = await fetch(endpoint, {
107
- headers: { apikey: cfg.serviceKey, authorization: `Bearer ${cfg.serviceKey}` },
108
- signal: AbortSignal.timeout(45000)
109
- });
110
- if (!response.ok) throw new Error(`HTTP ${response.status}: ${(await response.text()).slice(0, 200)}`);
111
- const rows = await response.json();
112
- if (!Array.isArray(rows) || !rows[0]) throw new Error(`no row for state_key "${cfg.stateKey}"`);
113
- return rows[0];
114
- } catch (error) {
115
- lastError = error;
116
- if (attempt < 4) await new Promise((resolve) => setTimeout(resolve, attempt * 15000));
117
- }
118
- }
119
- throw lastError;
120
- }
121
-
122
- async function backup(outDir) {
123
- if (!outDir) fail("usage: backup <out_dir>");
124
- const key = backupKey();
125
- const row = await fetchRow(supabaseConfig()).catch((error) => fail(`could not read the state row: ${error.message}`));
126
- const rowJson = JSON.stringify(row);
127
- const summary = summarize(row, rowJson);
128
- // Sanity gate: a near-empty snapshot means something already went wrong — fail loudly (the
129
- // failed scheduled run is the alert) instead of quietly storing an empty backup.
130
- const minProviders = Number(process.env.STATE_BACKUP_MIN_PROVIDERS || 1);
131
- const minBytes = Number(process.env.STATE_BACKUP_MIN_BYTES || 10000);
132
- if ((summary.counts.providerRegistry || 0) < minProviders) fail(`snapshot has ${summary.counts.providerRegistry || 0} providers (< ${minProviders}): refusing to treat it as healthy`);
133
- if (summary.snapshot_bytes < minBytes) fail(`snapshot is only ${summary.snapshot_bytes} bytes (< ${minBytes}): refusing to treat it as healthy`);
134
- const envelope = encrypt(rowJson, key);
135
- if (decrypt(envelope, key) !== rowJson) fail("round-trip check failed");
136
- fs.mkdirSync(outDir, { recursive: true });
137
- const stamp = String(row.persisted_at_iso || new Date().toISOString()).replace(/[^0-9A-Za-z]/g, "").slice(0, 15);
138
- const fileName = `xytara-state-${stamp}.enc`;
139
- fs.writeFileSync(path.join(outDir, fileName), JSON.stringify(envelope));
140
- const manifest = { v: ENVELOPE_VERSION, file: fileName, created_at_iso: new Date().toISOString(), plaintext_sha256: envelope.plaintext_sha256, ...summary };
141
- fs.writeFileSync(path.join(outDir, "manifest.json"), JSON.stringify(manifest, null, 2));
142
- console.log(JSON.stringify(manifest, null, 2));
143
- }
144
-
145
- function decryptCommand(inFile, outFile) {
146
- if (!inFile || !outFile) fail("usage: decrypt <file.enc> <out.json>");
147
- const rowJson = decrypt(JSON.parse(fs.readFileSync(inFile, "utf8")), backupKey());
148
- fs.writeFileSync(outFile, rowJson);
149
- console.log(JSON.stringify(summarize(JSON.parse(rowJson), rowJson), null, 2));
150
- }
151
-
152
- async function restoreCommand(inFile, args) {
153
- if (!inFile || !args.includes("--runtime-stopped")) {
154
- fail("usage: restore <file.enc> --runtime-stopped [--state-key k] (suspend the runtime first, or it will overwrite the restored row)");
155
- }
156
- const cfg = supabaseConfig();
157
- const keyIndex = args.indexOf("--state-key");
158
- const stateKey = keyIndex >= 0 && args[keyIndex + 1] ? args[keyIndex + 1] : cfg.stateKey;
159
- const row = JSON.parse(decrypt(JSON.parse(fs.readFileSync(inFile, "utf8")), backupKey()));
160
- const response = await fetch(`${cfg.url}/rest/v1/${encodeURIComponent(cfg.table)}?on_conflict=state_key`, {
161
- method: "POST",
162
- headers: { apikey: cfg.serviceKey, authorization: `Bearer ${cfg.serviceKey}`, "content-type": "application/json", prefer: "resolution=merge-duplicates,return=minimal" },
163
- body: JSON.stringify([{ state_key: stateKey, snapshot: row.snapshot, persisted_at_iso: row.persisted_at_iso }]),
164
- signal: AbortSignal.timeout(60000)
165
- });
166
- if (!response.ok) fail(`restore write failed: HTTP ${response.status}`);
167
- console.log(`restored ${row.state_key}@${row.persisted_at_iso} into state_key "${stateKey}". Resume the runtime now.`);
168
- }
169
-
170
- function selftest() {
171
- const key = crypto.randomBytes(32);
172
- const row = { state_key: "default", persisted_at_iso: "2026-10-17T00:00:00.000Z", snapshot: { providerRegistry: { __runtime_state_kind: "Map", value: [["p", { status: "active", owner_secret: "prvown_x" }]] } } };
173
- const rowJson = JSON.stringify(row);
174
- const envelope = encrypt(rowJson, key);
175
- if (decrypt(envelope, key) !== rowJson) fail("selftest: round trip mismatch");
176
- if (JSON.stringify(envelope).includes("prvown_x")) fail("selftest: plaintext secret visible in the envelope");
177
- let wrongKeyRejected = false;
178
- try { decrypt(envelope, crypto.randomBytes(32)); } catch (_) { wrongKeyRejected = true; }
179
- if (!wrongKeyRejected) fail("selftest: a wrong key decrypted the backup");
180
- const tampered = { ...envelope, ciphertext: Buffer.from(Buffer.from(envelope.ciphertext, "base64").map((b, i) => (i === 0 ? b ^ 1 : b))).toString("base64") };
181
- let tamperRejected = false;
182
- try { decrypt(tampered, key); } catch (_) { tamperRejected = true; }
183
- if (!tamperRejected) fail("selftest: tampered ciphertext was accepted");
184
- console.log("xytara state-backup selftest passed (round trip, no plaintext secrets, wrong key + tamper rejected)");
185
- }
186
-
187
- async function main() {
188
- const [command, ...args] = process.argv.slice(2);
189
- if (command === "backup") return backup(args[0]);
190
- if (command === "decrypt") return decryptCommand(args[0], args[1]);
191
- if (command === "restore") return restoreCommand(args[0], args);
192
- if (command === "selftest") return selftest();
193
- fail("usage: state_backup_offsite.js backup <out_dir> | decrypt <file.enc> <out.json> | restore <file.enc> --runtime-stopped | selftest");
194
- }
195
-
196
- main().catch((error) => fail(error && error.message ? error.message : String(error)));
@@ -1,131 +0,0 @@
1
- "use strict";
2
-
3
- // Verifies the A2A JSON-RPC endpoint with the in-band x402 payment extension
4
- // (lib/a2a_rpc.js). The facilitator verify/settle and the command executor are
5
- // injected as mocks so this runs offline and moves no money.
6
-
7
- const assert = require("assert");
8
- const {
9
- handleA2ARpc,
10
- META_PAYLOAD,
11
- META_STATUS,
12
- META_REQUIRED,
13
- META_ERROR
14
- } = require("../lib/a2a_rpc");
15
-
16
- const accepts = [
17
- { scheme: "exact", network: "eip155:84532", asset: "0xUSDC", amount: "1000", payTo: "0xPAYTO", extra: { name: "USDC", version: "2" } }
18
- ];
19
- const config = { verification_mode: "x402_facilitator", x402: { accepts, facilitator_url: "https://facilitator", settle: true } };
20
-
21
- function deps(overrides) {
22
- return Object.assign(
23
- {
24
- createFacilitator: () => ({}),
25
- verifyX402Payment: async () => ({ ok: true, authorization: { payer: "0xPAYER", paymentRequirements: accepts[0] } }),
26
- settleX402Payment: async () => ({ ok: true, settlement: { success: true, transaction: "0xTX", network: "eip155:84532" } }),
27
- encodeReceipt: (s) => Buffer.from(JSON.stringify(s), "utf8").toString("base64"),
28
- executeAuthorized: async (state, payload, authz) => ({ status: 200, payload: { ok: true, ran: payload.task_ref, azmode: authz.verification_mode } }),
29
- buildNamedTaskPayload: (ref, body) => ({ command: ref, task_ref: ref, body }),
30
- state: {}
31
- },
32
- overrides || {}
33
- );
34
- }
35
-
36
- function send(params, ctxOverrides) {
37
- return handleA2ARpc(
38
- { jsonrpc: "2.0", id: 1, method: "message/send", params },
39
- Object.assign({ config, resourceUrl: "https://xytara.onrender.com/v1/a2a", deps: deps() }, ctxOverrides || {})
40
- );
41
- }
42
-
43
- async function main() {
44
- // 1. Unpaid -> input-required + x402 requirements in-band.
45
- let out = await send({ message: { metadata: { task_ref: "a2a.negotiate" } } });
46
- assert.strictEqual(out.http, 200);
47
- assert.strictEqual(out.body.result.status.state, "input-required");
48
- assert.strictEqual(out.body.result.status.message.metadata[META_STATUS], "payment-required");
49
- assert.deepStrictEqual(out.body.result.status.message.metadata[META_REQUIRED].accepts, accepts);
50
-
51
- // 2. Paid -> completed + PAYMENT-RESPONSE + executed through the x402 authz context.
52
- out = await send({ message: { metadata: { task_ref: "a2a.negotiate", [META_PAYLOAD]: "BASE64PAYLOAD" } } });
53
- assert.strictEqual(out.body.result.status.state, "completed");
54
- assert.strictEqual(out.body.result.status.message.metadata[META_STATUS], "payment-completed");
55
- assert.ok(out.headers && out.headers["PAYMENT-RESPONSE"], "settled 200 must carry PAYMENT-RESPONSE");
56
- assert.strictEqual(out.body.result.artifacts[0].parts[0].data.ran, "a2a.negotiate");
57
- assert.strictEqual(out.body.result.artifacts[0].parts[0].data.azmode, "x402_facilitator");
58
-
59
- // 2b. Paid but the skill execution fails -> "failed", and the payment is NOT settled
60
- // (verify -> execute -> settle: a failed skill never charges the paying agent).
61
- let settleCalls = 0;
62
- out = await send(
63
- { message: { metadata: { task_ref: "a2a.negotiate", [META_PAYLOAD]: "B64" } } },
64
- { deps: deps({
65
- executeAuthorized: async () => ({ status: 500, payload: { ok: false, reason: "boom" } }),
66
- settleX402Payment: async () => { settleCalls += 1; return { ok: true, settlement: { success: true } }; }
67
- }) }
68
- );
69
- assert.strictEqual(out.body.result.status.state, "failed");
70
- assert.strictEqual(out.body.result.status.message.metadata[META_STATUS], "not-charged");
71
- assert.strictEqual(settleCalls, 0, "a failed skill must not be settled");
72
- assert.ok(!(out.headers && out.headers["PAYMENT-RESPONSE"]), "nothing settled, so no receipt");
73
- assert.strictEqual(out.body.result.artifacts.length, 0);
74
-
75
- // 2c. A skill nothing can execute -> refused up front: no payment requested at all.
76
- out = await send(
77
- { message: { metadata: { task_ref: "a2a.negotiate" } } },
78
- { deps: deps({ assessExecutability: () => ({ ok: false, payload: { reason: "capability_not_executable", detail: "no target", executable_task_refs: ["adapter.mcp.invoke"] } }) }) }
79
- );
80
- assert.strictEqual(out.body.result.status.state, "failed");
81
- assert.strictEqual(out.body.result.status.message.metadata[META_STATUS], "not-required");
82
- assert.ok(/adapter\.mcp\.invoke/.test(out.body.result.status.message.metadata[META_ERROR]), "the refusal names what IS executable");
83
-
84
- // 2d. Settle times out but the authorization is used on-chain -> completed, not a lost payment.
85
- out = await send(
86
- { message: { metadata: { task_ref: "a2a.negotiate", [META_PAYLOAD]: "B64" } } },
87
- { deps: deps({
88
- verifyX402Payment: async () => ({ ok: true, authorization: { payer: "0xPAYER", paymentRequirements: accepts[0], paymentPayload: { payload: { authorization: { from: "0xPAYER", nonce: "0x01" } } } } }),
89
- settleX402Payment: async () => ({ ok: false, reason: "facilitator_unreachable" }),
90
- confirmAuthorizationUsed: async () => true
91
- }) }
92
- );
93
- assert.strictEqual(out.body.result.status.state, "completed", "a settled-on-chain payment delivers despite the facilitator timeout");
94
-
95
- // 3. Verify fails -> payment-rejected.
96
- out = await send(
97
- { message: { metadata: { [META_PAYLOAD]: "BAD" } } },
98
- { deps: deps({ verifyX402Payment: async () => ({ ok: false, reason: "payment_verification_failed", detail: "insufficient_balance" }) }) }
99
- );
100
- assert.strictEqual(out.body.result.status.state, "failed");
101
- assert.strictEqual(out.body.result.status.message.metadata[META_STATUS], "payment-rejected");
102
-
103
- // 4. Settle fails -> payment-failed.
104
- out = await send(
105
- { message: { metadata: { [META_PAYLOAD]: "OK" } } },
106
- { deps: deps({ settleX402Payment: async () => ({ ok: false, reason: "payment_settlement_failed", detail: "facilitator" }) }) }
107
- );
108
- assert.strictEqual(out.body.result.status.message.metadata[META_STATUS], "payment-failed");
109
-
110
- // 5. Unknown method -> -32601.
111
- out = await handleA2ARpc({ jsonrpc: "2.0", id: 9, method: "tasks/cancel" }, { config, resourceUrl: "x", deps: deps() });
112
- assert.strictEqual(out.body.error.code, -32601);
113
-
114
- // 6. x402 mode off -> -32010.
115
- out = await handleA2ARpc(
116
- { jsonrpc: "2.0", id: 9, method: "message/send", params: { message: {} } },
117
- { config: { verification_mode: "local_signed", x402: { accepts } }, resourceUrl: "x", deps: deps() }
118
- );
119
- assert.strictEqual(out.body.error.code, -32010);
120
-
121
- // 7. Non-2.0 envelope -> -32600.
122
- out = await handleA2ARpc({ id: 1, method: "message/send" }, { config, resourceUrl: "x", deps: deps() });
123
- assert.strictEqual(out.body.error.code, -32600);
124
-
125
- console.log("verify_a2a_rpc: all A2A x402 JSON-RPC checks passed");
126
- }
127
-
128
- main().catch((error) => {
129
- console.error("verify_a2a_rpc failed:", error && error.message ? error.message : error);
130
- process.exitCode = 1;
131
- });