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,966 +0,0 @@
1
- "use strict";
2
-
3
- const { catalog, findCreditPack, findTask, findWorkflow } = require("../fixtures/catalog");
4
-
5
- function buildDefaultTransactionTaskPacks() {
6
- const center = buildDefaultTransactionCenter();
7
- const defaultSettlementMode = center.default_settlement && center.default_settlement.settlement_mode
8
- ? center.default_settlement.settlement_mode
9
- : null;
10
- const defaultPaymentProtocol = center.default_payment && center.default_payment.protocol
11
- ? center.default_payment.protocol
12
- : null;
13
- const suggestedPaths = Array.isArray(center.suggested_paths) ? center.suggested_paths : [];
14
- const defaultMcpPath = suggestedPaths.find((entry) => entry && entry.path_id === "default_mcp_x402_path") || null;
15
- const defaultA2cPath = suggestedPaths.find((entry) => entry && entry.path_id === "default_a2c_tooling_flow") || null;
16
- return [
17
- {
18
- pack_ref: "default.mcp.tool.invoke",
19
- title: "Default MCP Tool Invoke",
20
- description: "Run one MCP tool through the built-in default transaction path.",
21
- pack_kind: "task_set",
22
- usage_mode: "direct_invoke",
23
- default_protocol: "mcp",
24
- default_payment_protocol: defaultPaymentProtocol,
25
- default_settlement_mode: defaultSettlementMode,
26
- suggested_path_id: defaultMcpPath ? defaultMcpPath.path_id : null,
27
- selection_reason: "first_party_default_task_pack",
28
- task_refs: ["adapter.mcp.invoke"],
29
- workflow_ref: null,
30
- required_inputs: ["tool_name"],
31
- optional_inputs: ["arguments", "settlement_mode", "payment_protocol"]
32
- },
33
- {
34
- pack_ref: "default.a2c.tooling.run",
35
- title: "Default A2C Tooling Run",
36
- description: "Open an A2C session, preview a tooling pack, and invoke an MCP tool through the default path.",
37
- pack_kind: "workflow_pack",
38
- usage_mode: "guided_flow",
39
- default_protocol: "mcp",
40
- default_payment_protocol: defaultPaymentProtocol,
41
- default_settlement_mode: defaultSettlementMode,
42
- suggested_path_id: defaultA2cPath ? defaultA2cPath.path_id : null,
43
- selection_reason: "first_party_default_workflow_pack",
44
- task_refs: ["a2c.session.open", "a2c.pack.preview", "adapter.mcp.invoke"],
45
- workflow_ref: "a2c.tooling.flow",
46
- required_inputs: ["agent_id", "channel_ref", "pack_ref", "tool_name"],
47
- optional_inputs: ["arguments", "settlement_mode", "payment_protocol"]
48
- },
49
- {
50
- pack_ref: "default.identity.anchor.run",
51
- title: "Default Identity Anchor Run",
52
- description: "Preview identity attestation, register the record, link it, and anchor the resulting commitment.",
53
- pack_kind: "workflow_pack",
54
- usage_mode: "guided_flow",
55
- default_protocol: null,
56
- default_payment_protocol: defaultPaymentProtocol,
57
- default_settlement_mode: defaultSettlementMode,
58
- suggested_path_id: null,
59
- selection_reason: "first_party_default_identity_pack",
60
- task_refs: ["identity.attest.preview", "registry.register", "identity.registry.link", "anchoring.submit"],
61
- workflow_ref: "identity.anchor.flow",
62
- required_inputs: ["subject_id", "record_type", "registry_record_id", "commitment_hash"],
63
- optional_inputs: ["registry_scope", "settlement_mode", "payment_protocol"]
64
- }
65
- ];
66
- }
67
-
68
- function buildDefaultTransactionGuidedLoops() {
69
- const center = buildDefaultTransactionCenter();
70
- const taskPacks = buildDefaultTransactionTaskPacks();
71
- const economics = buildDefaultTransactionEconomics();
72
- const buildLoop = (loopRef, packRef, title, description, stages) => {
73
- const pack = taskPacks.find((entry) => entry && entry.pack_ref === packRef) || null;
74
- return {
75
- loop_ref: loopRef,
76
- pack_ref: packRef,
77
- title,
78
- description,
79
- stage_count: Array.isArray(stages) ? stages.length : 0,
80
- stages: Array.isArray(stages) ? stages : [],
81
- default_protocol: pack && pack.default_protocol ? pack.default_protocol : center.default_protocol.protocol,
82
- default_payment_protocol: economics.payment_protocol,
83
- default_settlement_mode: economics.default_settlement_mode,
84
- suggested_path_id: pack && pack.suggested_path_id ? pack.suggested_path_id : null,
85
- workflow_ref: pack && pack.workflow_ref ? pack.workflow_ref : null
86
- };
87
- };
88
- return [
89
- buildLoop(
90
- "default.mcp.loop",
91
- "default.mcp.tool.invoke",
92
- "Default MCP Loop",
93
- "Preview, quote, pay, invoke, and inspect one MCP tool through the built-in first-party path.",
94
- ["preview", "quote", "pay", "invoke", "inspect"]
95
- ),
96
- buildLoop(
97
- "default.a2c.tooling.loop",
98
- "default.a2c.tooling.run",
99
- "Default A2C Tooling Loop",
100
- "Open a session, preview a pack, invoke a tool, and inspect the resulting linked records.",
101
- ["preview", "quote", "pay", "session", "invoke", "inspect"]
102
- ),
103
- buildLoop(
104
- "default.identity.anchor.loop",
105
- "default.identity.anchor.run",
106
- "Default Identity Anchor Loop",
107
- "Preview identity attestation, register, link, anchor, and inspect the resulting default transaction records.",
108
- ["preview", "quote", "pay", "register", "anchor", "inspect"]
109
- )
110
- ];
111
- }
112
-
113
- function buildTransactionClassPacks() {
114
- const center = buildDefaultTransactionCenter();
115
- const defaultSettlementMode = center.default_settlement && center.default_settlement.settlement_mode
116
- ? center.default_settlement.settlement_mode
117
- : null;
118
- const defaultPaymentProtocol = center.default_payment && center.default_payment.protocol
119
- ? center.default_payment.protocol
120
- : null;
121
- return [
122
- {
123
- class_pack_ref: "transaction.trust.receipt",
124
- title: "Trust Receipt Transaction",
125
- description: "Verify trust posture and validate the paired receipt as one grouped transaction class.",
126
- workflow_ref: "trust.flow",
127
- task_refs: ["trust.verify", "receipt.validate"],
128
- category: "trust",
129
- proof_handoff_kind: "receipt_validation",
130
- default_payment_protocol: defaultPaymentProtocol,
131
- default_settlement_mode: defaultSettlementMode,
132
- required_inputs: ["subject_id", "receipt_id"],
133
- optional_inputs: ["payment_protocol", "settlement_mode"]
134
- },
135
- {
136
- class_pack_ref: "transaction.runtime.consequence",
137
- title: "Runtime Consequence Transaction",
138
- description: "Emit a runtime consequence and anchor the resulting commitment as one grouped transaction class.",
139
- workflow_ref: "runtime.consequence.flow",
140
- task_refs: ["runtime.emit", "runtime.anchor"],
141
- category: "runtime",
142
- proof_handoff_kind: "runtime_anchor",
143
- default_payment_protocol: defaultPaymentProtocol,
144
- default_settlement_mode: defaultSettlementMode,
145
- required_inputs: ["intent_id", "event_type", "event_commitment"],
146
- optional_inputs: ["payment_protocol", "settlement_mode"]
147
- },
148
- {
149
- class_pack_ref: "transaction.admission.settlement",
150
- title: "Admission Settlement Transaction",
151
- description: "Preview admission and submit settlement as one grouped transaction class.",
152
- workflow_ref: "admission.settlement.flow",
153
- task_refs: ["admission.preview", "settlement.submit"],
154
- category: "admission",
155
- proof_handoff_kind: "admission_settlement",
156
- default_payment_protocol: defaultPaymentProtocol,
157
- default_settlement_mode: defaultSettlementMode,
158
- required_inputs: ["source_zone_id", "target_zone_id", "intent_id"],
159
- optional_inputs: ["interaction_class", "payment_protocol", "settlement_mode"]
160
- },
161
- {
162
- class_pack_ref: "transaction.registry.anchor",
163
- title: "Registry Anchor Transaction",
164
- description: "Register a record and anchor its commitment as one grouped transaction class.",
165
- workflow_ref: "registry.anchor.flow",
166
- task_refs: ["registry.register", "anchoring.submit"],
167
- category: "registry",
168
- proof_handoff_kind: "registry_anchor",
169
- default_payment_protocol: defaultPaymentProtocol,
170
- default_settlement_mode: defaultSettlementMode,
171
- required_inputs: ["subject_id", "record_type", "commitment_hash"],
172
- optional_inputs: ["payment_protocol", "settlement_mode"]
173
- },
174
- {
175
- class_pack_ref: "transaction.job.commitment",
176
- title: "Job Commitment Transaction",
177
- description: "Quote, reserve, and commit a job as one grouped transaction class.",
178
- workflow_ref: "job.commitment.flow",
179
- task_refs: ["jobs.quote", "jobs.reserve", "jobs.commit"],
180
- category: "jobs",
181
- proof_handoff_kind: "job_commitment",
182
- default_payment_protocol: defaultPaymentProtocol,
183
- default_settlement_mode: defaultSettlementMode,
184
- required_inputs: ["job_type", "job_id"],
185
- optional_inputs: ["payment_protocol", "settlement_mode"]
186
- }
187
- ];
188
- }
189
-
190
- function buildPrecommitInteractionPacks() {
191
- const center = buildDefaultTransactionCenter();
192
- const defaultSettlementMode = center.default_settlement && center.default_settlement.settlement_mode
193
- ? center.default_settlement.settlement_mode
194
- : null;
195
- const defaultPaymentProtocol = center.default_payment && center.default_payment.protocol
196
- ? center.default_payment.protocol
197
- : null;
198
- return [
199
- {
200
- precommit_pack_ref: "precommit.a2a.settlement.readiness",
201
- title: "A2A Settlement Readiness",
202
- description: "Negotiate, preview admission, and confirm commit posture before a committed settlement-class transaction.",
203
- category: "a2a",
204
- protocol: "a2a",
205
- task_refs: ["a2a.negotiate", "admission.preview", "a2a.commit"],
206
- default_payment_protocol: defaultPaymentProtocol,
207
- default_settlement_mode: defaultSettlementMode,
208
- commitment_signal: "a2a.commit",
209
- readiness_kind: "settlement_commit_readiness",
210
- recommended_next_surface: "/v1/transaction-center/transaction-class-packs/run",
211
- recommended_next_ref: "transaction.admission.settlement",
212
- required_inputs: ["counterparty_agent_id", "intent_id", "source_zone_id", "target_zone_id"],
213
- optional_inputs: ["task_pack_ref", "negotiation_mode", "interaction_class", "payment_protocol", "settlement_mode"]
214
- },
215
- {
216
- precommit_pack_ref: "precommit.a2c.tooling.readiness",
217
- title: "A2C Tooling Readiness",
218
- description: "Open the session, preview the tooling pack, and confirm admission posture before committed tooling execution.",
219
- category: "a2c",
220
- protocol: "a2c",
221
- task_refs: ["a2c.session.open", "a2c.pack.preview", "admission.preview"],
222
- default_payment_protocol: defaultPaymentProtocol,
223
- default_settlement_mode: defaultSettlementMode,
224
- commitment_signal: "a2c.pack.preview",
225
- readiness_kind: "tooling_commit_readiness",
226
- recommended_next_surface: "/v1/transaction-center/task-packs/invoke",
227
- recommended_next_ref: "default.a2c.tooling.run",
228
- required_inputs: ["agent_id", "channel_ref", "pack_ref", "source_zone_id", "target_zone_id"],
229
- optional_inputs: ["interaction_class", "payment_protocol", "settlement_mode"]
230
- },
231
- {
232
- precommit_pack_ref: "precommit.job.commitment.readiness",
233
- title: "Job Commitment Readiness",
234
- description: "Quote, preview admission, and reserve the job before committing the full job transaction class.",
235
- category: "jobs",
236
- protocol: "job",
237
- task_refs: ["jobs.quote", "admission.preview", "jobs.reserve"],
238
- default_payment_protocol: defaultPaymentProtocol,
239
- default_settlement_mode: defaultSettlementMode,
240
- commitment_signal: "jobs.reserve",
241
- readiness_kind: "job_commitment_readiness",
242
- recommended_next_surface: "/v1/transaction-center/transaction-class-packs/run",
243
- recommended_next_ref: "transaction.job.commitment",
244
- required_inputs: ["job_type", "job_id", "source_zone_id", "target_zone_id", "intent_id"],
245
- optional_inputs: ["interaction_class", "payment_protocol", "settlement_mode"]
246
- }
247
- ];
248
- }
249
-
250
- function buildInteractionSpinePaths() {
251
- const center = buildDefaultTransactionCenter();
252
- const defaultSettlementMode = center.default_settlement && center.default_settlement.settlement_mode
253
- ? center.default_settlement.settlement_mode
254
- : null;
255
- const defaultPaymentProtocol = center.default_payment && center.default_payment.protocol
256
- ? center.default_payment.protocol
257
- : null;
258
- return [
259
- {
260
- spine_path_ref: "spine.a2a.settlement",
261
- title: "A2A Settlement Spine",
262
- description: "Compose negotiation, admission, commit, and settlement as one grouped machine-interaction spine path.",
263
- category: "a2a",
264
- protocol: "a2a",
265
- precommit_pack_ref: "precommit.a2a.settlement.readiness",
266
- committed_ref: "transaction.admission.settlement",
267
- task_refs: ["a2a.negotiate", "admission.preview", "a2a.commit", "settlement.submit"],
268
- default_payment_protocol: defaultPaymentProtocol,
269
- default_settlement_mode: defaultSettlementMode,
270
- proof_followthrough: "default.proof.bundle.loop",
271
- required_inputs: ["counterparty_agent_id", "intent_id", "source_zone_id", "target_zone_id"],
272
- optional_inputs: ["task_pack_ref", "negotiation_mode", "interaction_class", "payment_protocol", "settlement_mode"]
273
- },
274
- {
275
- spine_path_ref: "spine.a2c.tooling",
276
- title: "A2C Tooling Spine",
277
- description: "Compose session open, pack preview, admission posture, and committed tooling execution as one grouped path.",
278
- category: "a2c",
279
- protocol: "a2c",
280
- precommit_pack_ref: "precommit.a2c.tooling.readiness",
281
- committed_ref: "default.a2c.tooling.run",
282
- task_refs: ["a2c.session.open", "a2c.pack.preview", "admission.preview", "adapter.mcp.invoke"],
283
- default_payment_protocol: defaultPaymentProtocol,
284
- default_settlement_mode: defaultSettlementMode,
285
- proof_followthrough: "default.proof.bundle.loop",
286
- required_inputs: ["agent_id", "channel_ref", "pack_ref", "tool_name", "source_zone_id", "target_zone_id"],
287
- optional_inputs: ["arguments", "interaction_class", "payment_protocol", "settlement_mode"]
288
- },
289
- {
290
- spine_path_ref: "spine.job.commitment",
291
- title: "Job Commitment Spine",
292
- description: "Compose quote, admission, reserve, and commit as one grouped job interaction spine path.",
293
- category: "jobs",
294
- protocol: "job",
295
- precommit_pack_ref: "precommit.job.commitment.readiness",
296
- committed_ref: "transaction.job.commitment",
297
- task_refs: ["jobs.quote", "admission.preview", "jobs.reserve", "jobs.commit"],
298
- default_payment_protocol: defaultPaymentProtocol,
299
- default_settlement_mode: defaultSettlementMode,
300
- proof_followthrough: "default.proof.bundle.loop",
301
- required_inputs: ["job_type", "job_id", "source_zone_id", "target_zone_id"],
302
- optional_inputs: ["intent_id", "interaction_class", "payment_protocol", "settlement_mode"]
303
- }
304
- ];
305
- }
306
-
307
- function buildInteractionResultPackages() {
308
- return buildInteractionSpinePaths().map((path) => ({
309
- result_package_ref: path && path.spine_path_ref ? `result.${path.spine_path_ref}` : null,
310
- source_kind: "interaction_spine_path",
311
- source_ref: path && path.spine_path_ref ? path.spine_path_ref : null,
312
- title: path && path.title ? `${path.title} Result Package` : "Interaction Result Package",
313
- description: path && path.description
314
- ? `${path.description} Preserve the composed output as a stable result-side package and proof-handoff seam.`
315
- : "Preserve the composed output as a stable result-side package and proof-handoff seam.",
316
- category: path && path.category ? path.category : null,
317
- protocol: path && path.protocol ? path.protocol : null,
318
- precommit_pack_ref: path && path.precommit_pack_ref ? path.precommit_pack_ref : null,
319
- committed_ref: path && path.committed_ref ? path.committed_ref : null,
320
- proof_followthrough: path && path.proof_followthrough ? path.proof_followthrough : null,
321
- portable_handoff_surface: "/v1/transaction-center/result-packages/export",
322
- portable_proof_surface: "/v1/proof-center/result-package-handoff/run",
323
- default_payment_protocol: path && path.default_payment_protocol ? path.default_payment_protocol : null,
324
- default_settlement_mode: path && path.default_settlement_mode ? path.default_settlement_mode : null,
325
- seam_layers: [
326
- "execution_consequence",
327
- "payment_settlement_treasury",
328
- "proof_handoff"
329
- ],
330
- required_inputs: Array.isArray(path && path.required_inputs) ? path.required_inputs : [],
331
- optional_inputs: Array.isArray(path && path.optional_inputs) ? path.optional_inputs : []
332
- }));
333
- }
334
-
335
- function buildInteractionResultPackageContinuationTemplates() {
336
- return buildInteractionResultPackages().map((resultPackage) => ({
337
- continuation_ref: resultPackage && resultPackage.result_package_ref
338
- ? `continue.${resultPackage.result_package_ref}`
339
- : null,
340
- result_package_ref: resultPackage && resultPackage.result_package_ref ? resultPackage.result_package_ref : null,
341
- source_ref: resultPackage && resultPackage.source_ref ? resultPackage.source_ref : null,
342
- title: resultPackage && resultPackage.title
343
- ? `${resultPackage.title} Continuation`
344
- : "Interaction Result Package Continuation",
345
- description: resultPackage && resultPackage.description
346
- ? `${resultPackage.description} Continue through the reusable default path into proof-native follow-through.`
347
- : "Continue through the reusable default path into proof-native follow-through.",
348
- continuation_kind: "proof_native_default",
349
- default_next_surface: "/v1/transaction-center/result-package-continuations/run",
350
- default_export_surface: "/v1/transaction-center/result-packages/export",
351
- default_proof_surface: "/v1/proof-center/result-package-handoff/run",
352
- committed_ref: resultPackage && resultPackage.committed_ref ? resultPackage.committed_ref : null,
353
- precommit_pack_ref: resultPackage && resultPackage.precommit_pack_ref ? resultPackage.precommit_pack_ref : null,
354
- seam_layers: Array.isArray(resultPackage && resultPackage.seam_layers) ? resultPackage.seam_layers : [],
355
- required_inputs: Array.isArray(resultPackage && resultPackage.required_inputs) ? resultPackage.required_inputs : [],
356
- optional_inputs: Array.isArray(resultPackage && resultPackage.optional_inputs) ? resultPackage.optional_inputs : []
357
- }));
358
- }
359
-
360
- function buildDefaultTransactionCenter() {
361
- const settlementProfiles = Array.isArray(catalog.settlement_profiles) ? catalog.settlement_profiles : [];
362
- const defaultSettlementProfile = settlementProfiles[0] || null;
363
- const settlementModes = settlementProfiles
364
- .map((profile) => profile && profile.mode)
365
- .filter(Boolean);
366
- return {
367
- ok: true,
368
- brand: "xytara",
369
- product: "default transaction center",
370
- payment_scheme: catalog.payment_scheme,
371
- default_protocol: {
372
- protocol: "mcp",
373
- integration_id: "builtin.protocol.mcp",
374
- task_ref: "adapter.mcp.invoke",
375
- workflow_refs: ["a2c.tooling.flow"],
376
- selection_reason: "production_default_protocol_lane"
377
- },
378
- default_payment: {
379
- protocol: "x402",
380
- integration_id: "builtin.payment.x402",
381
- payment_scheme: catalog.payment_scheme,
382
- supported_settlement_modes: settlementModes,
383
- selection_reason: "production_default_payment_lane"
384
- },
385
- default_settlement: {
386
- integration_id: "builtin.settlement.chain",
387
- settlement_mode: defaultSettlementProfile && defaultSettlementProfile.mode ? defaultSettlementProfile.mode : null,
388
- adapter: defaultSettlementProfile && defaultSettlementProfile.adapter ? defaultSettlementProfile.adapter : null,
389
- asset: defaultSettlementProfile && defaultSettlementProfile.asset ? defaultSettlementProfile.asset : null,
390
- payee_agent_id: defaultSettlementProfile && defaultSettlementProfile.payee_agent_id ? defaultSettlementProfile.payee_agent_id : null,
391
- payee_label: defaultSettlementProfile && defaultSettlementProfile.payee_label ? defaultSettlementProfile.payee_label : null,
392
- supported_modes: settlementModes,
393
- profile_count: settlementProfiles.length
394
- },
395
- default_treasury: {
396
- destination_kind: "account_treasury",
397
- destination_template: "treasury_{account_id}",
398
- settlement_mode: defaultSettlementProfile && defaultSettlementProfile.mode ? defaultSettlementProfile.mode : null,
399
- payee_agent_id: defaultSettlementProfile && defaultSettlementProfile.payee_agent_id ? defaultSettlementProfile.payee_agent_id : null,
400
- payee_label: defaultSettlementProfile && defaultSettlementProfile.payee_label ? defaultSettlementProfile.payee_label : null
401
- },
402
- suggested_paths: [
403
- {
404
- path_id: "default_mcp_x402_path",
405
- path_kind: "first_party_default",
406
- protocol: "mcp",
407
- payment_protocol: "x402",
408
- settlement_mode: defaultSettlementProfile && defaultSettlementProfile.mode ? defaultSettlementProfile.mode : null,
409
- task_ref: "adapter.mcp.invoke",
410
- integration_ids: ["builtin.protocol.mcp", "builtin.payment.x402", "builtin.settlement.chain"]
411
- },
412
- {
413
- path_id: "default_a2c_tooling_flow",
414
- path_kind: "first_party_default",
415
- protocol: "mcp",
416
- payment_protocol: "x402",
417
- settlement_mode: defaultSettlementProfile && defaultSettlementProfile.mode ? defaultSettlementProfile.mode : null,
418
- workflow_ref: "a2c.tooling.flow",
419
- integration_ids: ["builtin.protocol.mcp", "builtin.payment.x402", "builtin.settlement.chain"]
420
- }
421
- ]
422
- };
423
- }
424
-
425
- function summarizeDefaultTransactionCenter() {
426
- const center = buildDefaultTransactionCenter();
427
- return {
428
- ok: true,
429
- brand: center.brand,
430
- product: center.product,
431
- payment_scheme: center.payment_scheme,
432
- default_protocol: center.default_protocol.protocol,
433
- default_payment_protocol: center.default_payment.protocol,
434
- default_settlement_mode: center.default_settlement.settlement_mode,
435
- default_treasury_kind: center.default_treasury.destination_kind,
436
- settlement_mode_count: Array.isArray(center.default_settlement.supported_modes) ? center.default_settlement.supported_modes.length : 0,
437
- settlement_modes: center.default_settlement.supported_modes,
438
- suggested_path_count: Array.isArray(center.suggested_paths) ? center.suggested_paths.length : 0,
439
- suggested_paths: center.suggested_paths
440
- };
441
- }
442
-
443
- function buildDefaultTransactionEconomics() {
444
- const center = buildDefaultTransactionCenter();
445
- const settlement = center.default_settlement || {};
446
- const payment = center.default_payment || {};
447
- const treasury = center.default_treasury || {};
448
- return {
449
- ok: true,
450
- brand: center.brand,
451
- product: "default transaction economics",
452
- payment_protocol: payment.protocol || null,
453
- payment_scheme: payment.payment_scheme || center.payment_scheme || null,
454
- default_settlement_mode: settlement.settlement_mode || null,
455
- supported_settlement_modes: Array.isArray(settlement.supported_modes) ? settlement.supported_modes : [],
456
- settlement_adapter: settlement.adapter || null,
457
- settlement_asset: settlement.asset || null,
458
- payee_agent_id: settlement.payee_agent_id || null,
459
- payee_label: settlement.payee_label || null,
460
- treasury_destination_kind: treasury.destination_kind || null,
461
- treasury_destination_template: treasury.destination_template || null,
462
- suggested_path_ids: Array.isArray(center.suggested_paths)
463
- ? center.suggested_paths.map((entry) => entry && entry.path_id).filter(Boolean)
464
- : []
465
- };
466
- }
467
-
468
- function summarizeDefaultTransactionEconomics() {
469
- const economics = buildDefaultTransactionEconomics();
470
- return {
471
- ok: true,
472
- brand: economics.brand,
473
- product: economics.product,
474
- payment_protocol: economics.payment_protocol,
475
- payment_scheme: economics.payment_scheme,
476
- default_settlement_mode: economics.default_settlement_mode,
477
- settlement_mode_count: economics.supported_settlement_modes.length,
478
- supported_settlement_modes: economics.supported_settlement_modes,
479
- treasury_destination_kind: economics.treasury_destination_kind,
480
- payee_agent_id: economics.payee_agent_id,
481
- suggested_path_count: economics.suggested_path_ids.length,
482
- suggested_path_ids: economics.suggested_path_ids
483
- };
484
- }
485
-
486
- function buildDefaultTransactionTaskPackCatalog() {
487
- const center = buildDefaultTransactionCenter();
488
- const packs = buildDefaultTransactionTaskPacks();
489
- return {
490
- ok: true,
491
- brand: center.brand,
492
- product: "default transaction task packs",
493
- default_protocol: center.default_protocol && center.default_protocol.protocol ? center.default_protocol.protocol : null,
494
- default_payment_protocol: center.default_payment && center.default_payment.protocol ? center.default_payment.protocol : null,
495
- default_settlement_mode: center.default_settlement && center.default_settlement.settlement_mode ? center.default_settlement.settlement_mode : null,
496
- pack_count: packs.length,
497
- packs
498
- };
499
- }
500
-
501
- function summarizeDefaultTransactionTaskPacks() {
502
- const catalogResponse = buildDefaultTransactionTaskPackCatalog();
503
- const packs = Array.isArray(catalogResponse.packs) ? catalogResponse.packs : [];
504
- return {
505
- ok: true,
506
- brand: catalogResponse.brand,
507
- product: catalogResponse.product,
508
- default_protocol: catalogResponse.default_protocol,
509
- default_payment_protocol: catalogResponse.default_payment_protocol,
510
- default_settlement_mode: catalogResponse.default_settlement_mode,
511
- pack_count: packs.length,
512
- pack_refs: packs.map((entry) => entry && entry.pack_ref).filter(Boolean),
513
- direct_pack_count: packs.filter((entry) => entry && entry.pack_kind === "task_set").length,
514
- workflow_pack_count: packs.filter((entry) => entry && entry.pack_kind === "workflow_pack").length,
515
- packs
516
- };
517
- }
518
-
519
- function getDefaultTransactionTaskPack(ref) {
520
- const normalized = String(ref || "").trim();
521
- if (!normalized) return null;
522
- return buildDefaultTransactionTaskPacks().find((entry) => entry && entry.pack_ref === normalized) || null;
523
- }
524
-
525
- function buildDefaultTransactionGuidedLoopCatalog() {
526
- const center = buildDefaultTransactionCenter();
527
- const loops = buildDefaultTransactionGuidedLoops();
528
- return {
529
- ok: true,
530
- brand: center.brand,
531
- product: "default transaction guided loops",
532
- default_protocol: center.default_protocol && center.default_protocol.protocol ? center.default_protocol.protocol : null,
533
- default_payment_protocol: center.default_payment && center.default_payment.protocol ? center.default_payment.protocol : null,
534
- default_settlement_mode: center.default_settlement && center.default_settlement.settlement_mode ? center.default_settlement.settlement_mode : null,
535
- loop_count: loops.length,
536
- loops
537
- };
538
- }
539
-
540
- function summarizeDefaultTransactionGuidedLoops() {
541
- const catalogResponse = buildDefaultTransactionGuidedLoopCatalog();
542
- const loops = Array.isArray(catalogResponse.loops) ? catalogResponse.loops : [];
543
- return {
544
- ok: true,
545
- brand: catalogResponse.brand,
546
- product: catalogResponse.product,
547
- default_protocol: catalogResponse.default_protocol,
548
- default_payment_protocol: catalogResponse.default_payment_protocol,
549
- default_settlement_mode: catalogResponse.default_settlement_mode,
550
- loop_count: loops.length,
551
- loop_refs: loops.map((entry) => entry && entry.loop_ref).filter(Boolean),
552
- loops
553
- };
554
- }
555
-
556
- function getDefaultTransactionGuidedLoop(ref) {
557
- const normalized = String(ref || "").trim();
558
- if (!normalized) return null;
559
- return buildDefaultTransactionGuidedLoops().find((entry) => entry && entry.loop_ref === normalized) || null;
560
- }
561
-
562
- function buildTransactionClassPackCatalog() {
563
- const center = buildDefaultTransactionCenter();
564
- const packs = buildTransactionClassPacks();
565
- return {
566
- ok: true,
567
- brand: center.brand,
568
- product: "transaction class packs",
569
- default_payment_protocol: center.default_payment && center.default_payment.protocol ? center.default_payment.protocol : null,
570
- default_settlement_mode: center.default_settlement && center.default_settlement.settlement_mode ? center.default_settlement.settlement_mode : null,
571
- class_pack_count: packs.length,
572
- class_packs: packs
573
- };
574
- }
575
-
576
- function buildPrecommitInteractionPackCatalog() {
577
- const center = buildDefaultTransactionCenter();
578
- const packs = buildPrecommitInteractionPacks();
579
- return {
580
- ok: true,
581
- brand: center.brand,
582
- product: "precommit interaction packs",
583
- default_payment_protocol: center.default_payment && center.default_payment.protocol ? center.default_payment.protocol : null,
584
- default_settlement_mode: center.default_settlement && center.default_settlement.settlement_mode ? center.default_settlement.settlement_mode : null,
585
- precommit_pack_count: packs.length,
586
- precommit_packs: packs
587
- };
588
- }
589
-
590
- function buildInteractionSpinePathCatalog() {
591
- const center = buildDefaultTransactionCenter();
592
- const paths = buildInteractionSpinePaths();
593
- return {
594
- ok: true,
595
- brand: center.brand,
596
- product: "interaction spine paths",
597
- default_payment_protocol: center.default_payment && center.default_payment.protocol ? center.default_payment.protocol : null,
598
- default_settlement_mode: center.default_settlement && center.default_settlement.settlement_mode ? center.default_settlement.settlement_mode : null,
599
- spine_path_count: paths.length,
600
- spine_paths: paths
601
- };
602
- }
603
-
604
- function buildInteractionResultPackageCatalog() {
605
- const center = buildDefaultTransactionCenter();
606
- const packages = buildInteractionResultPackages();
607
- return {
608
- ok: true,
609
- brand: center.brand,
610
- product: "interaction result packages",
611
- default_payment_protocol: center.default_payment && center.default_payment.protocol ? center.default_payment.protocol : null,
612
- default_settlement_mode: center.default_settlement && center.default_settlement.settlement_mode ? center.default_settlement.settlement_mode : null,
613
- result_package_count: packages.length,
614
- result_packages: packages
615
- };
616
- }
617
-
618
- function buildInteractionResultPackageContinuationCatalog() {
619
- const center = buildDefaultTransactionCenter();
620
- const templates = buildInteractionResultPackageContinuationTemplates();
621
- return {
622
- ok: true,
623
- brand: center.brand,
624
- product: "interaction result package continuations",
625
- default_payment_protocol: center.default_payment && center.default_payment.protocol ? center.default_payment.protocol : null,
626
- default_settlement_mode: center.default_settlement && center.default_settlement.settlement_mode ? center.default_settlement.settlement_mode : null,
627
- continuation_count: templates.length,
628
- continuations: templates
629
- };
630
- }
631
-
632
- function summarizeTransactionClassPacks() {
633
- const catalogResponse = buildTransactionClassPackCatalog();
634
- const packs = Array.isArray(catalogResponse.class_packs) ? catalogResponse.class_packs : [];
635
- return {
636
- ok: true,
637
- brand: catalogResponse.brand,
638
- product: catalogResponse.product,
639
- default_payment_protocol: catalogResponse.default_payment_protocol,
640
- default_settlement_mode: catalogResponse.default_settlement_mode,
641
- class_pack_count: packs.length,
642
- class_pack_refs: packs.map((entry) => entry && entry.class_pack_ref).filter(Boolean),
643
- categories: Array.from(new Set(packs.map((entry) => entry && entry.category).filter(Boolean))),
644
- class_packs: packs
645
- };
646
- }
647
-
648
- function summarizePrecommitInteractionPacks() {
649
- const catalogResponse = buildPrecommitInteractionPackCatalog();
650
- const packs = Array.isArray(catalogResponse.precommit_packs) ? catalogResponse.precommit_packs : [];
651
- return {
652
- ok: true,
653
- brand: catalogResponse.brand,
654
- product: catalogResponse.product,
655
- default_payment_protocol: catalogResponse.default_payment_protocol,
656
- default_settlement_mode: catalogResponse.default_settlement_mode,
657
- precommit_pack_count: packs.length,
658
- precommit_pack_refs: packs.map((entry) => entry && entry.precommit_pack_ref).filter(Boolean),
659
- categories: Array.from(new Set(packs.map((entry) => entry && entry.category).filter(Boolean))),
660
- precommit_packs: packs
661
- };
662
- }
663
-
664
- function summarizeInteractionSpinePaths() {
665
- const catalogResponse = buildInteractionSpinePathCatalog();
666
- const paths = Array.isArray(catalogResponse.spine_paths) ? catalogResponse.spine_paths : [];
667
- return {
668
- ok: true,
669
- brand: catalogResponse.brand,
670
- product: catalogResponse.product,
671
- default_payment_protocol: catalogResponse.default_payment_protocol,
672
- default_settlement_mode: catalogResponse.default_settlement_mode,
673
- spine_path_count: paths.length,
674
- spine_path_refs: paths.map((entry) => entry && entry.spine_path_ref).filter(Boolean),
675
- categories: Array.from(new Set(paths.map((entry) => entry && entry.category).filter(Boolean))),
676
- spine_paths: paths
677
- };
678
- }
679
-
680
- function summarizeInteractionResultPackages() {
681
- const catalogResponse = buildInteractionResultPackageCatalog();
682
- const packages = Array.isArray(catalogResponse.result_packages) ? catalogResponse.result_packages : [];
683
- return {
684
- ok: true,
685
- brand: catalogResponse.brand,
686
- product: catalogResponse.product,
687
- default_payment_protocol: catalogResponse.default_payment_protocol,
688
- default_settlement_mode: catalogResponse.default_settlement_mode,
689
- result_package_count: packages.length,
690
- result_package_refs: packages.map((entry) => entry && entry.result_package_ref).filter(Boolean),
691
- source_refs: packages.map((entry) => entry && entry.source_ref).filter(Boolean),
692
- seam_layers: Array.from(new Set(packages.flatMap((entry) => Array.isArray(entry && entry.seam_layers) ? entry.seam_layers : []))),
693
- result_packages: packages
694
- };
695
- }
696
-
697
- function summarizeInteractionResultPackageContinuations() {
698
- const catalogResponse = buildInteractionResultPackageContinuationCatalog();
699
- const templates = Array.isArray(catalogResponse.continuations) ? catalogResponse.continuations : [];
700
- return {
701
- ok: true,
702
- brand: catalogResponse.brand,
703
- product: catalogResponse.product,
704
- default_payment_protocol: catalogResponse.default_payment_protocol,
705
- default_settlement_mode: catalogResponse.default_settlement_mode,
706
- continuation_count: templates.length,
707
- continuation_refs: templates.map((entry) => entry && entry.continuation_ref).filter(Boolean),
708
- result_package_refs: templates.map((entry) => entry && entry.result_package_ref).filter(Boolean),
709
- continuations: templates
710
- };
711
- }
712
-
713
- function getTransactionClassPack(ref) {
714
- const normalized = String(ref || "").trim();
715
- if (!normalized) return null;
716
- return buildTransactionClassPacks().find((entry) => entry && entry.class_pack_ref === normalized) || null;
717
- }
718
-
719
- function getPrecommitInteractionPack(ref) {
720
- const normalized = String(ref || "").trim();
721
- if (!normalized) return null;
722
- return buildPrecommitInteractionPacks().find((entry) => entry && entry.precommit_pack_ref === normalized) || null;
723
- }
724
-
725
- function getInteractionSpinePath(ref) {
726
- const normalized = String(ref || "").trim();
727
- if (!normalized) return null;
728
- return buildInteractionSpinePaths().find((entry) => entry && entry.spine_path_ref === normalized) || null;
729
- }
730
-
731
- function getInteractionResultPackage(ref) {
732
- const normalized = String(ref || "").trim();
733
- if (!normalized) return null;
734
- return buildInteractionResultPackages().find((entry) => entry && entry.result_package_ref === normalized) || null;
735
- }
736
-
737
- function getInteractionResultPackageContinuation(ref) {
738
- const normalized = String(ref || "").trim();
739
- if (!normalized) return null;
740
- return buildInteractionResultPackageContinuationTemplates().find((entry) => entry && entry.continuation_ref === normalized) || null;
741
- }
742
-
743
- function buildCatalogResponse() {
744
- return {
745
- ok: true,
746
- brand: "xytara",
747
- product: "governed transaction rail",
748
- version: catalog.version,
749
- catalog_version: catalog.version,
750
- currency: catalog.currency,
751
- payment_scheme: catalog.payment_scheme,
752
- plans: catalog.plans,
753
- capabilities: catalog.capabilities,
754
- adapters: catalog.adapters,
755
- settlement_profiles: catalog.settlement_profiles,
756
- task_categories: catalog.task_categories,
757
- workflows: catalog.workflows,
758
- surfaces: catalog.surfaces,
759
- tasks: catalog.tasks
760
- };
761
- }
762
-
763
- function summarizeCatalog() {
764
- const fullCatalog = buildCatalogResponse();
765
- return {
766
- ok: true,
767
- brand: fullCatalog.brand,
768
- product: fullCatalog.product,
769
- version: fullCatalog.catalog_version,
770
- currency: fullCatalog.currency,
771
- payment_scheme: fullCatalog.payment_scheme,
772
- capabilities: fullCatalog.capabilities,
773
- adapters: fullCatalog.adapters,
774
- task_count: fullCatalog.tasks.length,
775
- workflow_count: fullCatalog.workflows.length,
776
- category_count: fullCatalog.task_categories.length,
777
- task_categories: fullCatalog.task_categories,
778
- settlement_profile_count: fullCatalog.settlement_profiles.length,
779
- settlement_profiles: fullCatalog.settlement_profiles,
780
- workflows: fullCatalog.workflows,
781
- tasks: fullCatalog.tasks.map((task) => ({
782
- task_ref: task.public_task_ref,
783
- internal_task_ref: task.task_ref,
784
- public_task_ref: task.public_task_ref,
785
- aliases: task.public_aliases,
786
- category: task.public_category,
787
- title: task.public_title,
788
- execution_mode: task.execution_mode,
789
- pricing_band: task.pricing_band,
790
- public_launch_price: task.public_launch_price,
791
- pricing_note: task.pricing_note,
792
- latency_class: task.latency_class,
793
- failure_posture: task.failure_posture,
794
- task_family: task.task_family,
795
- lifecycle_stage: task.lifecycle_stage,
796
- market_class: task.market_class,
797
- claim_status: task.claim_status,
798
- evidence_status: task.evidence_status,
799
- capabilities: task.capabilities,
800
- adapters: task.adapters
801
- })),
802
- workflow_summaries: fullCatalog.workflows.map((workflow) => ({
803
- workflow_ref: workflow.workflow_ref,
804
- aliases: workflow.aliases,
805
- category: workflow.category,
806
- title: workflow.title,
807
- task_count: workflow.task_count,
808
- latency_class: workflow.latency_class,
809
- failure_posture: workflow.failure_posture,
810
- pricing_basis: workflow.pricing_basis
811
- }))
812
- };
813
- }
814
-
815
- function getCatalog() {
816
- return buildCatalogResponse();
817
- }
818
-
819
- function getTaskDetail(ref) {
820
- const task = findTask(ref);
821
- if (!task) {
822
- return null;
823
- }
824
- return {
825
- task_ref: task.task_ref,
826
- public_task_ref: task.public_task_ref,
827
- aliases: task.public_aliases,
828
- category: task.public_category,
829
- title: task.public_title,
830
- execution_mode: task.execution_mode,
831
- pricing_band: task.pricing_band,
832
- public_launch_price: task.public_launch_price,
833
- pricing_note: task.pricing_note,
834
- latency_class: task.latency_class,
835
- failure_posture: task.failure_posture,
836
- task_family: task.task_family,
837
- lifecycle_stage: task.lifecycle_stage,
838
- market_class: task.market_class,
839
- claim_status: task.claim_status,
840
- evidence_status: task.evidence_status,
841
- input_schema: task.input_schema,
842
- capabilities: task.capabilities,
843
- adapters: task.adapters
844
- };
845
- }
846
-
847
- function buildWorkflowShape(workflow) {
848
- const workflowTasks = (Array.isArray(workflow.task_refs) ? workflow.task_refs : [])
849
- .map((taskRef) => findTask(taskRef))
850
- .filter(Boolean)
851
- .map((task) => ({
852
- public_task_ref: task.public_task_ref,
853
- task_ref: task.task_ref,
854
- title: task.public_title,
855
- category: task.public_category,
856
- latency_class: task.latency_class,
857
- failure_posture: task.failure_posture,
858
- task_family: task.task_family,
859
- lifecycle_stage: task.lifecycle_stage,
860
- market_class: task.market_class,
861
- claim_status: task.claim_status,
862
- evidence_status: task.evidence_status,
863
- pricing_band: task.pricing_band,
864
- public_launch_price: task.public_launch_price
865
- }));
866
- return {
867
- ...workflow,
868
- pricing_note: "Workflow pricing is determined by the quoted task set, not a fixed bundle price.",
869
- task_refs: workflowTasks.map((task) => task.public_task_ref || task.task_ref),
870
- task_count: workflowTasks.length,
871
- tasks: workflowTasks
872
- };
873
- }
874
-
875
- function getWorkflowList() {
876
- return catalog.workflows.map(buildWorkflowShape);
877
- }
878
-
879
- function getWorkflowDetail(ref) {
880
- const workflow = findWorkflow(ref);
881
- if (!workflow) {
882
- return null;
883
- }
884
- return buildWorkflowShape(workflow);
885
- }
886
-
887
- function getCreditPackList() {
888
- return (Array.isArray(catalog.credit_packs) ? catalog.credit_packs : []).map((pack) => ({
889
- ...pack
890
- }));
891
- }
892
-
893
- function getCreditPackDetail(ref) {
894
- const pack = findCreditPack(ref);
895
- if (!pack) {
896
- return null;
897
- }
898
- return {
899
- ...pack
900
- };
901
- }
902
-
903
- function summarizeCreditPacks() {
904
- const packs = getCreditPackList();
905
- const categoryCounts = packs.reduce((acc, pack) => {
906
- const key = pack && pack.category ? pack.category : "unknown";
907
- acc[key] = (acc[key] || 0) + 1;
908
- return acc;
909
- }, {});
910
- const pricingBandCoverage = Array.from(new Set(
911
- packs.flatMap((pack) => Array.isArray(pack && pack.task_band_targets) ? pack.task_band_targets : []).filter(Boolean)
912
- )).sort((left, right) => String(left).localeCompare(String(right)));
913
- return {
914
- ok: true,
915
- credit_pack_count: packs.length,
916
- categories: Object.entries(categoryCounts)
917
- .map(([category, pack_count]) => ({ category, pack_count }))
918
- .sort((left, right) => String(left.category).localeCompare(String(right.category))),
919
- pricing_band_coverage_count: pricingBandCoverage.length,
920
- pricing_band_coverage: pricingBandCoverage,
921
- credit_packs: packs.map((pack) => ({
922
- pack_id: pack.pack_id,
923
- title: pack.title,
924
- category: pack.category,
925
- issued_units: pack.issued_units,
926
- intended_usage_posture: pack.intended_usage_posture
927
- }))
928
- };
929
- }
930
-
931
- module.exports = {
932
- buildCatalogResponse,
933
- buildDefaultTransactionEconomics,
934
- buildDefaultTransactionCenter,
935
- buildDefaultTransactionGuidedLoopCatalog,
936
- buildInteractionResultPackageCatalog,
937
- buildInteractionResultPackageContinuationCatalog,
938
- buildInteractionSpinePathCatalog,
939
- buildPrecommitInteractionPackCatalog,
940
- buildDefaultTransactionTaskPackCatalog,
941
- buildTransactionClassPackCatalog,
942
- getCreditPackDetail,
943
- getCreditPackList,
944
- getCatalog,
945
- getDefaultTransactionGuidedLoop,
946
- getDefaultTransactionTaskPack,
947
- getInteractionResultPackage,
948
- getInteractionResultPackageContinuation,
949
- getInteractionSpinePath,
950
- getPrecommitInteractionPack,
951
- getTransactionClassPack,
952
- getTaskDetail,
953
- getWorkflowDetail,
954
- getWorkflowList,
955
- summarizeCatalog,
956
- summarizeDefaultTransactionCenter,
957
- summarizeDefaultTransactionEconomics,
958
- summarizeDefaultTransactionGuidedLoops,
959
- summarizeDefaultTransactionTaskPacks,
960
- summarizeCreditPacks,
961
- summarizeInteractionResultPackageContinuations,
962
- summarizeInteractionResultPackages,
963
- summarizeInteractionSpinePaths,
964
- summarizePrecommitInteractionPacks,
965
- summarizeTransactionClassPacks
966
- };