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,2261 +0,0 @@
1
- "use strict";
2
-
3
- const executionExampleManifest = require("../adapters/examples/example-execution-adapter.manifest.json");
4
- const settlementExampleManifest = require("../adapters/examples/example-settlement-adapter.manifest.json");
5
- const exampleThirdPartyRegistrationRecord = require("../adapters/examples/example-third-party-registration.record.json");
6
- const exampleThirdPartyIdentityRegistrationRecord = require("../adapters/examples/example-third-party-identity-registration.record.json");
7
- const exampleThirdPartySettlementRegistrationRecord = require("../adapters/examples/example-third-party-settlement-registration.record.json");
8
- const { catalog } = require("../fixtures/catalog");
9
-
10
- function clone(value) {
11
- return JSON.parse(JSON.stringify(value));
12
- }
13
-
14
- function sortStrings(values) {
15
- return Array.from(new Set((Array.isArray(values) ? values : []).filter(Boolean))).sort();
16
- }
17
-
18
- function collectTaskRefsByAdapter(adapterName) {
19
- return (Array.isArray(catalog.tasks) ? catalog.tasks : [])
20
- .filter((task) => Array.isArray(task.adapters) && task.adapters.includes(adapterName))
21
- .map((task) => task.public_task_ref);
22
- }
23
-
24
- function collectWorkflowRefsByTaskRefs(taskRefs) {
25
- const allowed = new Set(Array.isArray(taskRefs) ? taskRefs : []);
26
- return (Array.isArray(catalog.workflows) ? catalog.workflows : [])
27
- .filter((workflow) => Array.isArray(workflow.task_refs) && workflow.task_refs.some((taskRef) => allowed.has(taskRef)))
28
- .map((workflow) => workflow.workflow_ref);
29
- }
30
-
31
- function createBuiltinBreadthIntegration({
32
- integration_id,
33
- display_name,
34
- description,
35
- adapter_class,
36
- capabilities = [],
37
- protocols = [],
38
- settlement_modes = [],
39
- execution_backends = [],
40
- adapter_lanes = [],
41
- task_refs = [],
42
- workflow_refs = [],
43
- required_secrets = [],
44
- required_permissions = [],
45
- supported_profiles = ["default"],
46
- pricing_basis = "per_task",
47
- latency_class = "mixed",
48
- proof_mode = "adjacent_reference_only"
49
- }) {
50
- return {
51
- integration_id,
52
- display_name,
53
- description,
54
- adapter_class,
55
- adapter_version: "1.26.0",
56
- interface_version: "commerce-adapter-interface/v1",
57
- bundled: true,
58
- source: "builtin",
59
- status: "available",
60
- certification_state: "certified",
61
- certification_scope: ["builtin_registry", "service_contract", "sdk_contract"],
62
- integration_maturity: "production_supported",
63
- selection_priority: 250,
64
- capabilities: sortStrings(capabilities),
65
- protocols: sortStrings(protocols),
66
- settlement_modes: sortStrings(settlement_modes),
67
- execution_backends: sortStrings(execution_backends),
68
- adapter_lanes: sortStrings(adapter_lanes),
69
- task_refs: sortStrings(task_refs),
70
- workflow_refs: sortStrings(workflow_refs),
71
- required_secrets: sortStrings(required_secrets),
72
- required_permissions: sortStrings(required_permissions),
73
- supported_profiles: sortStrings(supported_profiles),
74
- supported_regions: ["global"],
75
- pricing_basis,
76
- latency_class,
77
- proof_contract: {
78
- emits_proof_compatible_facts: true,
79
- proof_mode
80
- },
81
- health_contract: {
82
- check_kind: "internal",
83
- supports_readiness: true
84
- },
85
- idempotency_contract: {
86
- strategy: "quote_bound_selection",
87
- scope: "integration_selection"
88
- },
89
- failure_contract: {
90
- categories: ["invalid_input", "timeout", "upstream_unavailable"],
91
- retryable_categories: ["timeout", "upstream_unavailable"]
92
- },
93
- compatibility: {
94
- node: ">=18",
95
- commerce_contract: "xytara/v1"
96
- },
97
- operational_readiness: {
98
- supports_default_selection: false,
99
- supports_forced_selection: true,
100
- lifecycle: "managed_builtin",
101
- health_source: "internal"
102
- },
103
- selection_hints: {
104
- default_for_task_refs: [],
105
- default_for_protocols: [],
106
- default_for_settlement_modes: []
107
- }
108
- };
109
- }
110
-
111
- function mapManifestToIntegration(manifest, extras = {}) {
112
- const taskRefs = sortStrings(extras.task_refs);
113
- return {
114
- integration_id: manifest.adapter_id,
115
- display_name: manifest.display_name,
116
- description: manifest.description,
117
- adapter_class: manifest.adapter_class,
118
- adapter_version: manifest.adapter_version,
119
- interface_version: manifest.interface_version,
120
- bundled: extras.bundled !== false,
121
- source: extras.source || "example",
122
- status: extras.status || "available",
123
- certification_state: extras.certification_state || "reference_example",
124
- certification_scope: sortStrings(extras.certification_scope || ["contract_shape"]),
125
- integration_maturity: extras.integration_maturity || "reference_example",
126
- selection_priority: Number.isFinite(Number(extras.selection_priority)) ? Number(extras.selection_priority) : 900,
127
- capabilities: sortStrings(manifest.capabilities),
128
- protocols: sortStrings(extras.protocols),
129
- settlement_modes: sortStrings(manifest.supported_settlement_modes),
130
- execution_backends: sortStrings(extras.execution_backends),
131
- adapter_lanes: sortStrings(extras.adapter_lanes),
132
- task_refs: taskRefs,
133
- workflow_refs: sortStrings(extras.workflow_refs || collectWorkflowRefsByTaskRefs(taskRefs)),
134
- required_secrets: sortStrings(manifest.required_secrets),
135
- required_permissions: sortStrings(manifest.required_permissions),
136
- supported_profiles: sortStrings(manifest.supported_profiles),
137
- supported_regions: sortStrings(manifest.supported_regions),
138
- pricing_basis: manifest.pricing_basis || null,
139
- latency_class: manifest.latency_class || null,
140
- proof_contract: manifest.proof_contract || null,
141
- health_contract: manifest.health_contract || null,
142
- idempotency_contract: manifest.idempotency_contract || null,
143
- failure_contract: manifest.failure_contract || null,
144
- compatibility: manifest.compatibility || {},
145
- operational_readiness: {
146
- supports_default_selection: extras.supports_default_selection === true,
147
- supports_forced_selection: extras.supports_forced_selection !== false,
148
- lifecycle: extras.lifecycle || "reference",
149
- health_source: extras.health_source || "self_reported"
150
- },
151
- selection_hints: {
152
- default_for_task_refs: sortStrings(extras.default_for_task_refs || taskRefs),
153
- default_for_protocols: sortStrings(extras.default_for_protocols || extras.protocols),
154
- default_for_settlement_modes: sortStrings(extras.default_for_settlement_modes || manifest.supported_settlement_modes)
155
- }
156
- };
157
- }
158
-
159
- function buildIntegrationRegistrationView(integration, registrationRecord) {
160
- const integrationEntry = integration || {};
161
- const record = registrationRecord && typeof registrationRecord === "object" ? registrationRecord : null;
162
- const selectionPriority = record && Number.isFinite(Number(record.selection_priority))
163
- ? Number(record.selection_priority)
164
- : integrationEntry.selection_priority;
165
- return {
166
- registration_state: record ? record.registration_state : "unregistered",
167
- bundled: record ? record.bundled : integrationEntry.bundled === true,
168
- default_selection_enabled: record
169
- ? record.default_selection_enabled === true
170
- : !!(
171
- integrationEntry.operational_readiness &&
172
- integrationEntry.operational_readiness.supports_default_selection
173
- ),
174
- requires_explicit_selection: record
175
- ? record.requires_explicit_selection === true
176
- : !(
177
- integrationEntry.operational_readiness &&
178
- integrationEntry.operational_readiness.supports_default_selection
179
- ),
180
- selection_priority: selectionPriority,
181
- registered_at: record ? record.registered_at : null,
182
- registered_by: record ? record.registered_by || null : null,
183
- verified_with: sortStrings(record && record.verified_with),
184
- notes: record ? record.notes || null : null
185
- };
186
- }
187
-
188
- function buildIntegrationView(integration, registrationRecord) {
189
- const entry = clone(integration);
190
- entry.registration = buildIntegrationRegistrationView(entry, registrationRecord);
191
- return entry;
192
- }
193
-
194
- function createRegisteredIntegrationFromManifest(manifest, registrationRecord, extras = {}) {
195
- const record = registrationRecord && typeof registrationRecord === "object" ? registrationRecord : {};
196
- const integration = mapManifestToIntegration(manifest, {
197
- ...extras,
198
- bundled: Object.prototype.hasOwnProperty.call(record, "bundled")
199
- ? record.bundled
200
- : extras.bundled,
201
- certification_state: record.certification_state || extras.certification_state,
202
- certification_scope: record.certification_scope || extras.certification_scope,
203
- integration_maturity: record.integration_maturity || extras.integration_maturity,
204
- selection_priority: Object.prototype.hasOwnProperty.call(record, "selection_priority")
205
- ? record.selection_priority
206
- : extras.selection_priority,
207
- supports_default_selection: Object.prototype.hasOwnProperty.call(record, "default_selection_enabled")
208
- ? record.default_selection_enabled
209
- : extras.supports_default_selection,
210
- lifecycle: record.registration_state || extras.lifecycle,
211
- default_for_task_refs: record.default_selection_enabled === true
212
- ? extras.default_for_task_refs
213
- : [],
214
- default_for_protocols: record.default_selection_enabled === true
215
- ? extras.default_for_protocols
216
- : [],
217
- default_for_settlement_modes: record.default_selection_enabled === true
218
- ? extras.default_for_settlement_modes
219
- : []
220
- });
221
- return buildIntegrationView(integration, record);
222
- }
223
-
224
- function validateIntegrationRegistration(manifest, registrationRecord) {
225
- const errors = [];
226
- const manifestEntry = manifest && typeof manifest === "object" ? manifest : {};
227
- const record = registrationRecord && typeof registrationRecord === "object" ? registrationRecord : {};
228
-
229
- if (!manifestEntry.adapter_id) {
230
- errors.push("manifest.adapter_id is required");
231
- }
232
- if (!record.integration_id) {
233
- errors.push("registration_record.integration_id is required");
234
- }
235
- if (!record.adapter_id) {
236
- errors.push("registration_record.adapter_id is required");
237
- }
238
- if (!record.adapter_class) {
239
- errors.push("registration_record.adapter_class is required");
240
- }
241
- if (manifestEntry.adapter_id && record.adapter_id && manifestEntry.adapter_id !== record.adapter_id) {
242
- errors.push("manifest.adapter_id must match registration_record.adapter_id");
243
- }
244
- if (manifestEntry.adapter_id && record.integration_id && manifestEntry.adapter_id !== record.integration_id) {
245
- errors.push("manifest.adapter_id must match registration_record.integration_id");
246
- }
247
- if (manifestEntry.adapter_class && record.adapter_class && manifestEntry.adapter_class !== record.adapter_class) {
248
- errors.push("manifest.adapter_class must match registration_record.adapter_class");
249
- }
250
-
251
- return {
252
- ok: errors.length === 0,
253
- errors
254
- };
255
- }
256
-
257
- function validateIntegrationCertificationPack(certificationPack) {
258
- const pack = certificationPack && typeof certificationPack === "object" ? certificationPack : {};
259
- const errors = [];
260
- if (!pack.integration_id) errors.push("certification_pack.integration_id is required");
261
- if (!pack.adapter_id) errors.push("certification_pack.adapter_id is required");
262
- if (!pack.adapter_class) errors.push("certification_pack.adapter_class is required");
263
- if (!pack.certification_state) errors.push("certification_pack.certification_state is required");
264
- if (!Array.isArray(pack.certification_scope) || pack.certification_scope.length < 1) {
265
- errors.push("certification_pack.certification_scope must contain at least one entry");
266
- }
267
- if (!Array.isArray(pack.verified_with) || pack.verified_with.length < 1) {
268
- errors.push("certification_pack.verified_with must contain at least one entry");
269
- }
270
- if (!pack.submitted_at) errors.push("certification_pack.submitted_at is required");
271
- return {
272
- ok: errors.length === 0,
273
- errors
274
- };
275
- }
276
-
277
- function validateIntegrationSubmission(manifest, registrationRecord, certificationPack) {
278
- const registrationValidation = validateIntegrationRegistration(manifest, registrationRecord);
279
- const certificationValidation = validateIntegrationCertificationPack(certificationPack);
280
- const errors = registrationValidation.errors.concat(certificationValidation.errors);
281
- const manifestEntry = manifest && typeof manifest === "object" ? manifest : {};
282
- const record = registrationRecord && typeof registrationRecord === "object" ? registrationRecord : {};
283
- const pack = certificationPack && typeof certificationPack === "object" ? certificationPack : {};
284
-
285
- if (manifestEntry.adapter_id && pack.adapter_id && manifestEntry.adapter_id !== pack.adapter_id) {
286
- errors.push("manifest.adapter_id must match certification_pack.adapter_id");
287
- }
288
- if (record.integration_id && pack.integration_id && record.integration_id !== pack.integration_id) {
289
- errors.push("registration_record.integration_id must match certification_pack.integration_id");
290
- }
291
- if (record.adapter_class && pack.adapter_class && record.adapter_class !== pack.adapter_class) {
292
- errors.push("registration_record.adapter_class must match certification_pack.adapter_class");
293
- }
294
- if (record.certification_state && pack.certification_state && record.certification_state !== pack.certification_state) {
295
- errors.push("registration_record.certification_state must match certification_pack.certification_state");
296
- }
297
-
298
- return {
299
- ok: errors.length === 0,
300
- errors
301
- };
302
- }
303
-
304
- function importRegisteredIntegration(manifest, registrationRecord, extras = {}) {
305
- const validation = validateIntegrationRegistration(manifest, registrationRecord);
306
- if (!validation.ok) {
307
- const error = new Error(`invalid integration registration:\n${validation.errors.join("\n")}`);
308
- error.code = "invalid_integration_registration";
309
- error.validation = validation;
310
- throw error;
311
- }
312
- return createRegisteredIntegrationFromManifest(manifest, registrationRecord, extras);
313
- }
314
-
315
- function createIntegrationRegistrySnapshot(integrations, filters = {}) {
316
- const rows = Array.isArray(integrations) ? integrations.map(clone) : [];
317
- return {
318
- snapshot_version: "xytara/integration-registry-snapshot/v1",
319
- generated_at: new Date().toISOString(),
320
- integration_count: rows.length,
321
- filters: clone(filters || {}),
322
- integrations: rows
323
- };
324
- }
325
-
326
- function exportIntegrationRegistrySnapshot(filters = {}) {
327
- return createIntegrationRegistrySnapshot(listIntegrations(filters), filters);
328
- }
329
-
330
- function validateIntegrationRegistrySnapshot(snapshot) {
331
- const entry = snapshot && typeof snapshot === "object" ? snapshot : {};
332
- const errors = [];
333
- if (!entry.snapshot_version) errors.push("snapshot.snapshot_version is required");
334
- if (!entry.generated_at) errors.push("snapshot.generated_at is required");
335
- if (!Number.isInteger(entry.integration_count) || entry.integration_count < 0) {
336
- errors.push("snapshot.integration_count must be a non-negative integer");
337
- }
338
- if (!Array.isArray(entry.integrations)) {
339
- errors.push("snapshot.integrations must be an array");
340
- } else if (entry.integration_count !== entry.integrations.length) {
341
- errors.push("snapshot.integration_count must match snapshot.integrations.length");
342
- }
343
- return {
344
- ok: errors.length === 0,
345
- errors
346
- };
347
- }
348
-
349
- function validateIntegrationSubmissionBundle(bundle) {
350
- const entry = bundle && typeof bundle === "object" ? bundle : {};
351
- const errors = [];
352
- if (!entry.bundle_version) {
353
- errors.push("submission_bundle.bundle_version is required");
354
- }
355
- if (!entry.manifest || typeof entry.manifest !== "object") {
356
- errors.push("submission_bundle.manifest is required");
357
- }
358
- if (!entry.registration_record || typeof entry.registration_record !== "object") {
359
- errors.push("submission_bundle.registration_record is required");
360
- }
361
- if (!entry.certification_pack || typeof entry.certification_pack !== "object") {
362
- errors.push("submission_bundle.certification_pack is required");
363
- }
364
- const submissionValidation = validateIntegrationSubmission(
365
- entry.manifest,
366
- entry.registration_record,
367
- entry.certification_pack
368
- );
369
- return {
370
- ok: errors.length === 0 && submissionValidation.ok,
371
- errors: errors.concat(submissionValidation.errors)
372
- };
373
- }
374
-
375
- function createIntegrationSubmissionBundle(bundleInput = {}, extras = {}) {
376
- const manifest = clone(bundleInput.manifest || {});
377
- const registrationRecord = clone(bundleInput.registration_record || {});
378
- const certificationPack = clone(bundleInput.certification_pack || {});
379
- const importedIntegration = importRegisteredIntegration(manifest, registrationRecord, extras);
380
- const snapshotEntry = clone(bundleInput.snapshot_entry || importedIntegration);
381
- return {
382
- bundle_version: "xytara/integration-submission-bundle/v1",
383
- manifest,
384
- registration_record: registrationRecord,
385
- certification_pack: certificationPack,
386
- snapshot_entry: snapshotEntry,
387
- notes: typeof bundleInput.notes === "string" ? bundleInput.notes : null
388
- };
389
- }
390
-
391
- function importIntegrationSubmissionBundle(bundleInput = {}, extras = {}) {
392
- const bundle = createIntegrationSubmissionBundle(bundleInput, extras);
393
- const validation = validateIntegrationSubmissionBundle(bundle);
394
- if (!validation.ok) {
395
- const error = new Error(`invalid integration submission bundle:\n${validation.errors.join("\n")}`);
396
- error.code = "invalid_integration_submission_bundle";
397
- error.validation = validation;
398
- throw error;
399
- }
400
- return bundle;
401
- }
402
-
403
- function createIntegrationRegistrySnapshotFromBundles(bundles, filters = {}, bundleExtras = {}) {
404
- const bundleList = Array.isArray(bundles) ? bundles : [];
405
- const integrations = bundleList.map((bundle) => importIntegrationSubmissionBundle(bundle, bundleExtras).snapshot_entry);
406
- return createIntegrationRegistrySnapshot(integrations, {
407
- ...clone(filters || {}),
408
- snapshot_source: "submission_bundle"
409
- });
410
- }
411
-
412
- function exportIntegrationSubmissionBundles(filters = {}) {
413
- return listIntegrations(filters)
414
- .filter((integration) => integration.source === "third_party_example")
415
- .map((integration) => {
416
- const registrationRecord = clone(INTEGRATION_REGISTRATION_RECORDS[integration.integration_id] || {});
417
- const certificationPack = {
418
- integration_id: integration.integration_id,
419
- adapter_id: integration.integration_id,
420
- adapter_class: integration.adapter_class,
421
- certification_state: integration.certification_state,
422
- certification_scope: clone(integration.certification_scope || []),
423
- verified_with: clone(integration.registration.verified_with || []),
424
- submitted_at: integration.registration.registered_at || new Date().toISOString(),
425
- submitted_by: integration.registration.registered_by || "unknown",
426
- last_verified_contract_version: "xytara/v1",
427
- notes: integration.registration.notes || null
428
- };
429
- const manifest = {
430
- adapter_id: integration.integration_id,
431
- adapter_class: integration.adapter_class,
432
- adapter_version: integration.adapter_version,
433
- interface_version: integration.interface_version,
434
- display_name: integration.display_name,
435
- description: integration.description,
436
- capabilities: clone(integration.capabilities || []),
437
- required_secrets: clone(integration.required_secrets || []),
438
- required_permissions: clone(integration.required_permissions || []),
439
- supported_profiles: clone(integration.supported_profiles || []),
440
- supported_regions: clone(integration.supported_regions || []),
441
- supported_settlement_modes: clone(integration.settlement_modes || []),
442
- pricing_basis: integration.pricing_basis,
443
- latency_class: integration.latency_class,
444
- registration_contract: {
445
- integration_id: integration.integration_id,
446
- integration_maturity: integration.integration_maturity,
447
- bundled: integration.registration.bundled,
448
- default_selection_enabled: integration.registration.default_selection_enabled,
449
- requires_explicit_selection: integration.registration.requires_explicit_selection
450
- },
451
- certification_contract: {
452
- certification_state: integration.certification_state,
453
- certification_scope: clone(integration.certification_scope || []),
454
- verified_with: clone(integration.registration.verified_with || []),
455
- last_verified_contract_version: "xytara/v1"
456
- },
457
- compatibility: clone(integration.compatibility || {}),
458
- health_contract: clone(integration.health_contract || {}),
459
- idempotency_contract: clone(integration.idempotency_contract || {}),
460
- failure_contract: clone(integration.failure_contract || {}),
461
- proof_contract: clone(integration.proof_contract || {})
462
- };
463
- return createIntegrationSubmissionBundle({
464
- manifest,
465
- registration_record: registrationRecord,
466
- certification_pack: certificationPack,
467
- snapshot_entry: integration,
468
- notes: integration.registration.notes || null
469
- }, {
470
- source: integration.source,
471
- protocols: clone(integration.protocols || []),
472
- execution_backends: clone(integration.execution_backends || []),
473
- adapter_lanes: clone(integration.adapter_lanes || []),
474
- task_refs: clone(integration.task_refs || []),
475
- workflow_refs: clone(integration.workflow_refs || [])
476
- });
477
- });
478
- }
479
-
480
- function createIntegrationSubmissionBundleSet(bundles, filters = {}, notes = null) {
481
- const bundleList = Array.isArray(bundles) ? bundles.map(clone) : [];
482
- return {
483
- bundle_set_version: "xytara/integration-submission-bundle-set/v1",
484
- generated_at: new Date().toISOString(),
485
- bundle_count: bundleList.length,
486
- filters: clone(filters || {}),
487
- bundles: bundleList,
488
- notes: typeof notes === "string" ? notes : null
489
- };
490
- }
491
-
492
- function validateIntegrationSubmissionBundleSet(bundleSet) {
493
- const entry = bundleSet && typeof bundleSet === "object" ? bundleSet : {};
494
- const errors = [];
495
- if (!entry.bundle_set_version) errors.push("bundle_set.bundle_set_version is required");
496
- if (!entry.generated_at) errors.push("bundle_set.generated_at is required");
497
- if (!Number.isInteger(entry.bundle_count) || entry.bundle_count < 0) {
498
- errors.push("bundle_set.bundle_count must be a non-negative integer");
499
- }
500
- if (!Array.isArray(entry.bundles)) {
501
- errors.push("bundle_set.bundles must be an array");
502
- } else if (entry.bundle_count !== entry.bundles.length) {
503
- errors.push("bundle_set.bundle_count must match bundle_set.bundles.length");
504
- } else {
505
- entry.bundles.forEach((bundle, index) => {
506
- const validation = validateIntegrationSubmissionBundle(bundle);
507
- if (!validation.ok) {
508
- validation.errors.forEach((error) => {
509
- errors.push(`bundle_set.bundles[${index}]: ${error}`);
510
- });
511
- }
512
- });
513
- }
514
- return {
515
- ok: errors.length === 0,
516
- errors
517
- };
518
- }
519
-
520
- function exportIntegrationSubmissionBundleSet(filters = {}, notes = null) {
521
- return createIntegrationSubmissionBundleSet(
522
- exportIntegrationSubmissionBundles(filters),
523
- filters,
524
- notes
525
- );
526
- }
527
-
528
- function summarizeCounts(values, fieldName) {
529
- return sortStrings(values).map((value) => ({
530
- [fieldName]: value,
531
- count: values.filter((entry) => entry === value).length
532
- }));
533
- }
534
-
535
- function summarizeStructuredCounts(entries, fields = []) {
536
- const rows = Array.isArray(entries) ? entries.filter((entry) => entry && typeof entry === "object") : [];
537
- const normalizedFields = Array.isArray(fields) ? fields.filter(Boolean) : [];
538
- const seen = new Map();
539
-
540
- rows.forEach((entry) => {
541
- const key = normalizedFields.map((field) => String(entry[field] || "")).join("::");
542
- if (!seen.has(key)) {
543
- const item = {};
544
- normalizedFields.forEach((field) => {
545
- item[field] = entry[field] || null;
546
- });
547
- item.count = 0;
548
- seen.set(key, item);
549
- }
550
- seen.get(key).count += 1;
551
- });
552
-
553
- return Array.from(seen.values()).sort((left, right) => {
554
- const leftKey = normalizedFields.map((field) => String(left[field] || "")).join("::");
555
- const rightKey = normalizedFields.map((field) => String(right[field] || "")).join("::");
556
- return leftKey.localeCompare(rightKey);
557
- });
558
- }
559
-
560
- function buildPromotionReadinessSummary(input = {}) {
561
- const registration = input.registration && typeof input.registration === "object" ? input.registration : {};
562
- const certification = input.certification && typeof input.certification === "object" ? input.certification : {};
563
- const integration = input.integration && typeof input.integration === "object" ? input.integration : {};
564
- const blockers = [];
565
- const registrationState = registration.registration_state || null;
566
- const certificationState = certification.certification_state || integration.certification_state || null;
567
- const maturity = integration.integration_maturity || null;
568
- const defaultSelectionEnabled = registration.default_selection_enabled === true;
569
- const requiresExplicitSelection = registration.requires_explicit_selection === true;
570
- const bundled = registration.bundled === true;
571
-
572
- if (!registrationState) blockers.push("registration_state_missing");
573
- if (!certificationState) blockers.push("certification_state_missing");
574
- if (!maturity) blockers.push("integration_maturity_missing");
575
- if (certificationState !== "certified") blockers.push("not_certified");
576
- if (maturity !== "production_default") blockers.push("not_marked_production_default");
577
- if (!defaultSelectionEnabled) blockers.push("default_selection_disabled");
578
- if (requiresExplicitSelection) blockers.push("still_requires_explicit_selection");
579
- if (!bundled) blockers.push("not_bundled_for_default_rollout");
580
-
581
- const reviewReady = registrationState === "staging_registered";
582
- const selectionReady = defaultSelectionEnabled || requiresExplicitSelection;
583
- const explicitSelectionReady = requiresExplicitSelection || defaultSelectionEnabled;
584
- const productionDefaultReady = blockers.length === 0;
585
-
586
- let posture = "unknown";
587
- if (productionDefaultReady) {
588
- posture = "production_default_ready";
589
- } else if (reviewReady && certificationState === "certified") {
590
- posture = "promotion_candidate";
591
- } else if (reviewReady) {
592
- posture = "staged_review";
593
- } else if (selectionReady) {
594
- posture = "selectable_non_default";
595
- }
596
-
597
- return {
598
- registration_state: registrationState,
599
- certification_state: certificationState,
600
- integration_maturity: maturity,
601
- selection_ready: selectionReady,
602
- explicit_selection_ready: explicitSelectionReady,
603
- default_eligible: defaultSelectionEnabled,
604
- production_default_ready: productionDefaultReady,
605
- review_ready: reviewReady,
606
- posture,
607
- blockers
608
- };
609
- }
610
-
611
- function summarizePromotionBlockerCategories(blockers = []) {
612
- const values = Array.isArray(blockers) ? blockers : [];
613
- const categories = [];
614
- if (values.some((entry) => entry === "registration_state_missing")) {
615
- categories.push({
616
- category: "registration",
617
- severity: "high",
618
- owner: "integration_author"
619
- });
620
- }
621
- if (values.some((entry) => entry === "certification_state_missing" || entry === "not_certified")) {
622
- categories.push({
623
- category: "certification",
624
- severity: "high",
625
- owner: "review_operator"
626
- });
627
- }
628
- if (values.some((entry) => entry === "integration_maturity_missing" || entry === "not_marked_production_default")) {
629
- categories.push({
630
- category: "maturity",
631
- severity: "medium",
632
- owner: "review_operator"
633
- });
634
- }
635
- if (values.some((entry) => entry === "default_selection_disabled" || entry === "still_requires_explicit_selection")) {
636
- categories.push({
637
- category: "selection",
638
- severity: "medium",
639
- owner: "platform_operator"
640
- });
641
- }
642
- if (values.some((entry) => entry === "not_bundled_for_default_rollout")) {
643
- categories.push({
644
- category: "rollout",
645
- severity: "low",
646
- owner: "release_operator"
647
- });
648
- }
649
- return summarizeStructuredCounts(categories, ["category", "severity", "owner"]);
650
- }
651
-
652
- function buildCertificationGapSummary(readiness = {}, integration = {}) {
653
- const blockers = Array.isArray(readiness.blockers) ? readiness.blockers : [];
654
- const certificationScope = Array.isArray(integration.certification_scope) ? integration.certification_scope.filter(Boolean) : [];
655
- const verifiedWith = integration.registration && Array.isArray(integration.registration.verified_with)
656
- ? integration.registration.verified_with.filter(Boolean)
657
- : [];
658
- const missingRequirements = [];
659
- const productionReady = readiness.production_default_ready === true;
660
-
661
- if (blockers.includes("certification_state_missing") || blockers.includes("not_certified")) {
662
- missingRequirements.push("certification_state");
663
- }
664
- if (!productionReady && certificationScope.length < 1) {
665
- missingRequirements.push("certification_scope");
666
- }
667
- if (!productionReady && verifiedWith.length < 1) {
668
- missingRequirements.push("verified_with");
669
- }
670
-
671
- return {
672
- certification_state: readiness.certification_state || null,
673
- certification_scope_count: certificationScope.length,
674
- verified_with_count: verifiedWith.length,
675
- missing_requirements: missingRequirements,
676
- certifiable: missingRequirements.length === 0
677
- };
678
- }
679
-
680
- function buildNextTransitionSummary(readiness = {}) {
681
- const blockers = Array.isArray(readiness.blockers) ? readiness.blockers : [];
682
- if (readiness.production_default_ready === true) {
683
- return {
684
- action: "maintain_production_default",
685
- reason: "integration already satisfies production-default posture",
686
- requirements: [],
687
- later_actions: []
688
- };
689
- }
690
- if (blockers.includes("registration_state_missing")) {
691
- return {
692
- action: "register_integration",
693
- reason: "integration is missing a registration state",
694
- requirements: ["registration_state"],
695
- later_actions: ["complete_certification", "promote_maturity", "enable_default_selection", "bundle_for_default_rollout"]
696
- };
697
- }
698
- if (blockers.includes("not_certified") || blockers.includes("certification_state_missing")) {
699
- return {
700
- action: "complete_certification",
701
- reason: "integration is not yet certified",
702
- requirements: ["certification_state"],
703
- later_actions: ["promote_maturity", "enable_default_selection", "bundle_for_default_rollout"]
704
- };
705
- }
706
- if (blockers.includes("not_marked_production_default") || blockers.includes("integration_maturity_missing")) {
707
- return {
708
- action: "promote_maturity",
709
- reason: "integration maturity is not yet aligned with production default rollout",
710
- requirements: ["integration_maturity"],
711
- later_actions: ["enable_default_selection", "bundle_for_default_rollout"]
712
- };
713
- }
714
- if (blockers.includes("default_selection_disabled") || blockers.includes("still_requires_explicit_selection")) {
715
- return {
716
- action: "enable_default_selection",
717
- reason: "integration remains explicit-selection only",
718
- requirements: ["default_selection_enabled", "requires_explicit_selection=false"],
719
- later_actions: blockers.includes("not_bundled_for_default_rollout") ? ["bundle_for_default_rollout"] : []
720
- };
721
- }
722
- if (blockers.includes("not_bundled_for_default_rollout")) {
723
- return {
724
- action: "bundle_for_default_rollout",
725
- reason: "integration is not yet bundled for production default rollout",
726
- requirements: ["bundled=true"],
727
- later_actions: []
728
- };
729
- }
730
- return {
731
- action: "review_manually",
732
- reason: "integration posture needs operator review",
733
- requirements: [],
734
- later_actions: []
735
- };
736
- }
737
-
738
- function buildPromotionRecommendationSummary(readiness = {}) {
739
- const nextTransition = buildNextTransitionSummary(readiness);
740
- if (readiness.production_default_ready === true) {
741
- return {
742
- recommendation: "eligible_for_production_default",
743
- rationale: "integration is ready for production-default posture"
744
- };
745
- }
746
- if (readiness.review_ready === true && readiness.default_eligible === false) {
747
- return {
748
- recommendation: "keep_staged_until_requirements_clear",
749
- rationale: nextTransition.reason
750
- };
751
- }
752
- if (readiness.review_ready === true) {
753
- return {
754
- recommendation: "review_for_promotion",
755
- rationale: nextTransition.reason
756
- };
757
- }
758
- return {
759
- recommendation: "complete_prerequisites_first",
760
- rationale: nextTransition.reason
761
- };
762
- }
763
-
764
- const PROMOTION_ACTION_DEFINITIONS = {
765
- register_integration: {
766
- action: "register_integration",
767
- title: "Register Integration",
768
- stage: "registration",
769
- description: "Move an integration into an explicit staged registration posture."
770
- },
771
- complete_certification: {
772
- action: "complete_certification",
773
- title: "Complete Certification",
774
- stage: "certification",
775
- description: "Mark the integration as certified for the current public contract."
776
- },
777
- promote_maturity: {
778
- action: "promote_maturity",
779
- title: "Promote Maturity",
780
- stage: "maturity",
781
- description: "Align integration maturity with production-default rollout posture."
782
- },
783
- enable_default_selection: {
784
- action: "enable_default_selection",
785
- title: "Enable Default Selection",
786
- stage: "selection",
787
- description: "Allow the integration to participate in default selection instead of explicit-only use."
788
- },
789
- bundle_for_default_rollout: {
790
- action: "bundle_for_default_rollout",
791
- title: "Bundle For Default Rollout",
792
- stage: "rollout",
793
- description: "Mark the integration as bundled for production-default rollout."
794
- },
795
- maintain_production_default: {
796
- action: "maintain_production_default",
797
- title: "Maintain Production Default",
798
- stage: "steady_state",
799
- description: "Confirm the integration already satisfies production-default posture."
800
- }
801
- };
802
-
803
- function getPromotionActionDefinition(action) {
804
- const lookup = String(action || "").trim();
805
- return PROMOTION_ACTION_DEFINITIONS[lookup] || null;
806
- }
807
-
808
- function clonePromotionSubject(summary = {}) {
809
- return {
810
- registration: clone(summary.registration || {}),
811
- certification_state: summary.certification_state || null,
812
- integration_maturity: summary.integration_maturity || null
813
- };
814
- }
815
-
816
- function simulatePromotionActionSubject(summary = {}, action) {
817
- const subject = clonePromotionSubject(summary);
818
- switch (action) {
819
- case "register_integration":
820
- subject.registration.registration_state = "staging_registered";
821
- if (subject.registration.default_selection_enabled !== true) {
822
- subject.registration.default_selection_enabled = false;
823
- }
824
- if (subject.registration.requires_explicit_selection !== false) {
825
- subject.registration.requires_explicit_selection = true;
826
- }
827
- break;
828
- case "complete_certification":
829
- subject.certification_state = "certified";
830
- break;
831
- case "promote_maturity":
832
- subject.integration_maturity = "production_default";
833
- break;
834
- case "enable_default_selection":
835
- subject.registration.default_selection_enabled = true;
836
- subject.registration.requires_explicit_selection = false;
837
- break;
838
- case "bundle_for_default_rollout":
839
- subject.registration.bundled = true;
840
- break;
841
- case "maintain_production_default":
842
- break;
843
- default:
844
- break;
845
- }
846
- return subject;
847
- }
848
-
849
- function buildPromotionActionResultingReadiness(summary = {}, subject = {}) {
850
- return buildPromotionReadinessSummary({
851
- registration: subject.registration,
852
- certification: {
853
- certification_state: subject.certification_state || summary.certification_state || null
854
- },
855
- integration: {
856
- integration_maturity: subject.integration_maturity || summary.integration_maturity || null
857
- }
858
- });
859
- }
860
-
861
- function buildPromotionActionStateChanges(current = {}, simulated = {}) {
862
- const changes = [];
863
- const currentRegistration = current.registration || {};
864
- const simulatedRegistration = simulated.registration || {};
865
- const fieldPairs = [
866
- ["registration.registration_state", currentRegistration.registration_state, simulatedRegistration.registration_state],
867
- ["registration.default_selection_enabled", currentRegistration.default_selection_enabled, simulatedRegistration.default_selection_enabled],
868
- ["registration.requires_explicit_selection", currentRegistration.requires_explicit_selection, simulatedRegistration.requires_explicit_selection],
869
- ["registration.bundled", currentRegistration.bundled, simulatedRegistration.bundled],
870
- ["certification_state", current.certification_state, simulated.certification_state],
871
- ["integration_maturity", current.integration_maturity, simulated.integration_maturity]
872
- ];
873
- fieldPairs.forEach(([field, fromValue, toValue]) => {
874
- if (fromValue !== toValue) {
875
- changes.push({
876
- field,
877
- from: fromValue === undefined ? null : fromValue,
878
- to: toValue === undefined ? null : toValue
879
- });
880
- }
881
- });
882
- return changes;
883
- }
884
-
885
- function validatePromotionActionRequest(request = {}) {
886
- const entry = request && typeof request === "object" && !Array.isArray(request) ? request : {};
887
- const errors = [];
888
- const integrationId = String(entry.integration_id || "").trim();
889
- const action = String(entry.action || "").trim();
890
- if (!integrationId) {
891
- errors.push("promotion_action_request.integration_id is required");
892
- }
893
- if (!action) {
894
- errors.push("promotion_action_request.action is required");
895
- } else if (!getPromotionActionDefinition(action)) {
896
- errors.push("promotion_action_request.action must be a supported promotion action");
897
- }
898
- return {
899
- ok: errors.length === 0,
900
- errors,
901
- request: {
902
- integration_id: integrationId || null,
903
- action: action || null
904
- }
905
- };
906
- }
907
-
908
- function summarizeIntegrationPromotionActionPreview(request = {}) {
909
- const validation = validatePromotionActionRequest(request);
910
- if (!validation.ok) {
911
- return {
912
- ok: false,
913
- reason: "invalid_promotion_action_request",
914
- errors: validation.errors
915
- };
916
- }
917
- const workflow = summarizeIntegrationPromotionWorkflow(validation.request.integration_id);
918
- if (!workflow.ok) {
919
- return workflow;
920
- }
921
-
922
- const action = validation.request.action;
923
- const definition = getPromotionActionDefinition(action);
924
- const currentSubject = clonePromotionSubject(workflow);
925
- const simulatedSubject = simulatePromotionActionSubject(workflow, action);
926
- const resultingReadiness = buildPromotionActionResultingReadiness(workflow, simulatedSubject);
927
- const stateChanges = buildPromotionActionStateChanges(currentSubject, simulatedSubject);
928
- const currentNextAction = workflow.next_transition && workflow.next_transition.action
929
- ? workflow.next_transition.action
930
- : null;
931
- const currentLaterActions = Array.isArray(workflow.next_transition && workflow.next_transition.later_actions)
932
- ? workflow.next_transition.later_actions
933
- : [];
934
- const validNow = currentNextAction === action || currentLaterActions.includes(action);
935
- const invalidReasons = [];
936
- if (!validNow) {
937
- invalidReasons.push(action === "maintain_production_default"
938
- ? "integration_is_not_yet_production_default_ready"
939
- : "action_is_not_currently_recommended_from_present_posture");
940
- }
941
-
942
- return {
943
- ok: true,
944
- integration_id: workflow.integration_id,
945
- display_name: workflow.display_name,
946
- adapter_class: workflow.adapter_class,
947
- source: workflow.source,
948
- request: clone(validation.request),
949
- action: clone(definition),
950
- current_posture: {
951
- registration_state: workflow.registration.registration_state || null,
952
- certification_state: workflow.certification_state || null,
953
- integration_maturity: workflow.integration_maturity || null,
954
- promotion_readiness: clone(workflow.promotion_readiness || {})
955
- },
956
- valid_now: validNow,
957
- is_recommended_next: currentNextAction === action,
958
- invalid_reasons: invalidReasons,
959
- requirements: currentNextAction === action
960
- ? clone(workflow.next_transition.requirements || [])
961
- : clone(buildNextTransitionSummary(resultingReadiness).requirements || []),
962
- blockers: clone(workflow.promotion_readiness.blockers || []),
963
- blocker_categories: clone(workflow.blocker_categories || []),
964
- resulting_posture: {
965
- registration_state: simulatedSubject.registration.registration_state || null,
966
- certification_state: simulatedSubject.certification_state || null,
967
- integration_maturity: simulatedSubject.integration_maturity || null,
968
- promotion_readiness: clone(resultingReadiness)
969
- },
970
- state_changes: stateChanges,
971
- current_transition: clone(workflow.next_transition || {}),
972
- resulting_transition: buildNextTransitionSummary(resultingReadiness)
973
- };
974
- }
975
-
976
- function summarizeIntegrationPromotionActionSet(integrationOrId) {
977
- const workflow = summarizeIntegrationPromotionWorkflow(integrationOrId);
978
- if (!workflow.ok) {
979
- return workflow;
980
- }
981
- const actionOrder = [
982
- workflow.next_transition && workflow.next_transition.action ? workflow.next_transition.action : null,
983
- ...(Array.isArray(workflow.next_transition && workflow.next_transition.later_actions)
984
- ? workflow.next_transition.later_actions
985
- : []),
986
- "maintain_production_default"
987
- ].filter(Boolean);
988
- const actions = sortStrings(actionOrder).map((action) => summarizeIntegrationPromotionActionPreview({
989
- integration_id: workflow.integration_id,
990
- action
991
- }));
992
- return {
993
- ...workflow,
994
- action_count: actions.length,
995
- valid_now_count: actions.filter((entry) => entry.valid_now === true).length,
996
- actions
997
- };
998
- }
999
-
1000
- function summarizeIntegrationPromotionActionSetList(filters = {}) {
1001
- const integrations = listIntegrations(filters).map((integration) => summarizeIntegrationPromotionActionSet(integration));
1002
- return {
1003
- ok: true,
1004
- integration_count: integrations.length,
1005
- valid_now_count: integrations.reduce((total, entry) => total + Number(entry.valid_now_count || 0), 0),
1006
- recommended_actions: summarizeCounts(
1007
- integrations
1008
- .map((entry) => entry.next_transition && entry.next_transition.action)
1009
- .filter(Boolean),
1010
- "action"
1011
- ),
1012
- valid_actions: summarizeCounts(
1013
- integrations
1014
- .flatMap((entry) => Array.isArray(entry.actions) ? entry.actions : [])
1015
- .filter((entry) => entry.valid_now === true)
1016
- .map((entry) => entry.request && entry.request.action)
1017
- .filter(Boolean),
1018
- "action"
1019
- ),
1020
- integrations
1021
- };
1022
- }
1023
-
1024
- function buildPromotionActionQueues(integrations = []) {
1025
- const rows = Array.isArray(integrations) ? integrations.filter((entry) => entry && entry.next_transition) : [];
1026
- const groups = new Map();
1027
-
1028
- rows.forEach((entry) => {
1029
- const action = entry.next_transition && entry.next_transition.action
1030
- ? entry.next_transition.action
1031
- : "review_manually";
1032
- if (!groups.has(action)) {
1033
- groups.set(action, []);
1034
- }
1035
- groups.get(action).push(entry);
1036
- });
1037
-
1038
- return Array.from(groups.keys()).sort().map((action) => {
1039
- const entries = groups.get(action) || [];
1040
- const blockerEntries = entries.flatMap((entry) => entry.blocker_categories || []);
1041
- return {
1042
- action,
1043
- count: entries.length,
1044
- recommendation_counts: summarizeCounts(
1045
- entries.map((entry) => entry.promotion_recommendation && entry.promotion_recommendation.recommendation).filter(Boolean),
1046
- "recommendation"
1047
- ),
1048
- owner_queue: summarizeCounts(
1049
- blockerEntries.map((entry) => entry.owner).filter(Boolean),
1050
- "owner"
1051
- ),
1052
- severity_queue: summarizeCounts(
1053
- blockerEntries.map((entry) => entry.severity).filter(Boolean),
1054
- "severity"
1055
- ),
1056
- integration_ids: entries.map((entry) => entry.integration_id).filter(Boolean).sort(),
1057
- integrations: entries.map((entry) => ({
1058
- integration_id: entry.integration_id,
1059
- display_name: entry.display_name,
1060
- adapter_class: entry.adapter_class,
1061
- recommendation: entry.promotion_recommendation && entry.promotion_recommendation.recommendation,
1062
- review_ready: entry.promotion_readiness && entry.promotion_readiness.review_ready === true,
1063
- production_default_ready: entry.promotion_readiness && entry.promotion_readiness.production_default_ready === true
1064
- }))
1065
- };
1066
- });
1067
- }
1068
-
1069
- function buildSubmissionBundleReviewWarnings(bundle) {
1070
- const warnings = [];
1071
- const registrationRecord = bundle && bundle.registration_record && typeof bundle.registration_record === "object"
1072
- ? bundle.registration_record
1073
- : {};
1074
- const certificationPack = bundle && bundle.certification_pack && typeof bundle.certification_pack === "object"
1075
- ? bundle.certification_pack
1076
- : {};
1077
-
1078
- if (registrationRecord.registration_state === "staging_registered") {
1079
- warnings.push("integration is staging-registered and should be reviewed before broader promotion");
1080
- }
1081
- if (registrationRecord.requires_explicit_selection === true) {
1082
- warnings.push("integration requires explicit selection and should not be treated as default");
1083
- }
1084
- if (registrationRecord.default_selection_enabled !== true) {
1085
- warnings.push("integration is not currently eligible for default selection");
1086
- }
1087
- if (certificationPack.certification_state && certificationPack.certification_state !== "certified") {
1088
- warnings.push("integration is not yet fully certified");
1089
- }
1090
-
1091
- return warnings;
1092
- }
1093
-
1094
- function summarizeIntegrationSubmissionBundleReview(bundleInput = {}) {
1095
- const bundle = clone(bundleInput || {});
1096
- const validation = validateIntegrationSubmissionBundle(bundle);
1097
- const snapshotEntry = bundle.snapshot_entry && typeof bundle.snapshot_entry === "object"
1098
- ? clone(bundle.snapshot_entry)
1099
- : {};
1100
- const manifest = bundle.manifest && typeof bundle.manifest === "object" ? bundle.manifest : {};
1101
- const registrationRecord = bundle.registration_record && typeof bundle.registration_record === "object"
1102
- ? bundle.registration_record
1103
- : {};
1104
- const certificationPack = bundle.certification_pack && typeof bundle.certification_pack === "object"
1105
- ? bundle.certification_pack
1106
- : {};
1107
- const integrationId = registrationRecord.integration_id || manifest.adapter_id || snapshotEntry.integration_id || null;
1108
- const adapterClass = registrationRecord.adapter_class || manifest.adapter_class || snapshotEntry.adapter_class || null;
1109
- const protocols = sortStrings(snapshotEntry.protocols);
1110
- const settlementModes = sortStrings(snapshotEntry.settlement_modes || manifest.supported_settlement_modes);
1111
- const taskRefs = sortStrings(snapshotEntry.task_refs);
1112
- const workflowRefs = sortStrings(snapshotEntry.workflow_refs);
1113
- const warnings = buildSubmissionBundleReviewWarnings(bundle);
1114
- const promotionReadiness = buildPromotionReadinessSummary({
1115
- registration: {
1116
- registration_state: registrationRecord.registration_state || null,
1117
- bundled: registrationRecord.bundled === true,
1118
- default_selection_enabled: registrationRecord.default_selection_enabled === true,
1119
- requires_explicit_selection: registrationRecord.requires_explicit_selection === true
1120
- },
1121
- certification: {
1122
- certification_state: certificationPack.certification_state || snapshotEntry.certification_state || null
1123
- },
1124
- integration: {
1125
- integration_maturity: registrationRecord.integration_maturity || snapshotEntry.integration_maturity || null,
1126
- certification_state: certificationPack.certification_state || snapshotEntry.certification_state || null
1127
- }
1128
- });
1129
-
1130
- return {
1131
- ok: validation.ok,
1132
- review_kind: "integration_submission_bundle",
1133
- validation,
1134
- integration: {
1135
- integration_id: integrationId,
1136
- display_name: manifest.display_name || snapshotEntry.display_name || null,
1137
- adapter_id: manifest.adapter_id || registrationRecord.adapter_id || null,
1138
- adapter_class: adapterClass,
1139
- adapter_version: manifest.adapter_version || snapshotEntry.adapter_version || null,
1140
- source: snapshotEntry.source || null,
1141
- certification_state: certificationPack.certification_state || snapshotEntry.certification_state || null,
1142
- integration_maturity: registrationRecord.integration_maturity || snapshotEntry.integration_maturity || null,
1143
- protocols,
1144
- settlement_modes: settlementModes,
1145
- task_refs: taskRefs,
1146
- workflow_refs: workflowRefs
1147
- },
1148
- registration: {
1149
- registration_state: registrationRecord.registration_state || null,
1150
- bundled: registrationRecord.bundled === true,
1151
- default_selection_enabled: registrationRecord.default_selection_enabled === true,
1152
- requires_explicit_selection: registrationRecord.requires_explicit_selection === true,
1153
- selection_priority: Number.isFinite(Number(registrationRecord.selection_priority))
1154
- ? Number(registrationRecord.selection_priority)
1155
- : null,
1156
- registered_at: registrationRecord.registered_at || null,
1157
- registered_by: registrationRecord.registered_by || null
1158
- },
1159
- certification: {
1160
- certification_state: certificationPack.certification_state || null,
1161
- certification_scope: sortStrings(certificationPack.certification_scope),
1162
- verified_with: sortStrings(certificationPack.verified_with),
1163
- submitted_at: certificationPack.submitted_at || null,
1164
- submitted_by: certificationPack.submitted_by || null
1165
- },
1166
- promotion_readiness: promotionReadiness,
1167
- review_summary: {
1168
- warning_count: warnings.length,
1169
- warnings,
1170
- capability_count: Array.isArray(manifest.capabilities) ? manifest.capabilities.length : 0,
1171
- protocol_count: protocols.length,
1172
- settlement_mode_count: settlementModes.length,
1173
- task_count: taskRefs.length,
1174
- workflow_count: workflowRefs.length,
1175
- selectable_via_explicit_request: registrationRecord.requires_explicit_selection === true
1176
- || registrationRecord.default_selection_enabled === true,
1177
- default_eligible: registrationRecord.default_selection_enabled === true,
1178
- production_default_ready: promotionReadiness.production_default_ready
1179
- }
1180
- };
1181
- }
1182
-
1183
- function summarizeIntegrationSubmissionBundleSetReview(bundleSetInput = {}) {
1184
- const bundleSet = clone(bundleSetInput || {});
1185
- const validation = validateIntegrationSubmissionBundleSet(bundleSet);
1186
- const bundleReviews = (Array.isArray(bundleSet.bundles) ? bundleSet.bundles : []).map((bundle) =>
1187
- summarizeIntegrationSubmissionBundleReview(bundle)
1188
- );
1189
- const adapterClasses = bundleReviews.map((review) => review.integration.adapter_class).filter(Boolean);
1190
- const registrationStates = bundleReviews.map((review) => review.registration.registration_state).filter(Boolean);
1191
- const certificationStates = bundleReviews.map((review) => review.certification.certification_state).filter(Boolean);
1192
-
1193
- return {
1194
- ok: validation.ok,
1195
- review_kind: "integration_submission_bundle_set",
1196
- validation,
1197
- bundle_set_version: bundleSet.bundle_set_version || null,
1198
- bundle_count: Array.isArray(bundleSet.bundles) ? bundleSet.bundles.length : 0,
1199
- generated_at: bundleSet.generated_at || null,
1200
- filters: clone(bundleSet.filters || {}),
1201
- notes: typeof bundleSet.notes === "string" ? bundleSet.notes : null,
1202
- review_summary: {
1203
- warning_count: bundleReviews.reduce((total, review) => total + review.review_summary.warning_count, 0),
1204
- explicit_selection_required_count: bundleReviews.filter((review) => review.registration.requires_explicit_selection).length,
1205
- default_eligible_count: bundleReviews.filter((review) => review.registration.default_selection_enabled).length,
1206
- production_default_ready_count: bundleReviews.filter((review) => review.promotion_readiness.production_default_ready).length,
1207
- review_ready_count: bundleReviews.filter((review) => review.promotion_readiness.review_ready).length,
1208
- bundled_count: bundleReviews.filter((review) => review.registration.bundled).length,
1209
- adapter_classes: summarizeCounts(adapterClasses, "adapter_class"),
1210
- registration_states: summarizeCounts(registrationStates, "registration_state"),
1211
- certification_states: summarizeCounts(certificationStates, "certification_state"),
1212
- postures: summarizeCounts(bundleReviews.map((review) => review.promotion_readiness.posture).filter(Boolean), "posture")
1213
- },
1214
- bundles: bundleReviews
1215
- };
1216
- }
1217
-
1218
- function summarizeIntegrationRegistrySnapshotReview(snapshotInput = {}) {
1219
- const snapshot = clone(snapshotInput || {});
1220
- const validation = validateIntegrationRegistrySnapshot(snapshot);
1221
- const integrations = Array.isArray(snapshot.integrations) ? snapshot.integrations : [];
1222
- const adapterClasses = integrations.map((integration) => integration.adapter_class).filter(Boolean);
1223
- const sources = integrations.map((integration) => integration.source).filter(Boolean);
1224
- const certificationStates = integrations.map((integration) => integration.certification_state).filter(Boolean);
1225
- const registrationStates = integrations
1226
- .map((integration) => integration.registration && integration.registration.registration_state)
1227
- .filter(Boolean);
1228
- const promotionReviews = integrations.map((integration) => buildPromotionReadinessSummary({
1229
- registration: integration.registration,
1230
- certification: {
1231
- certification_state: integration.certification_state || null
1232
- },
1233
- integration
1234
- }));
1235
-
1236
- return {
1237
- ok: validation.ok,
1238
- review_kind: "integration_registry_snapshot",
1239
- validation,
1240
- snapshot_version: snapshot.snapshot_version || null,
1241
- integration_count: integrations.length,
1242
- generated_at: snapshot.generated_at || null,
1243
- filters: clone(snapshot.filters || {}),
1244
- review_summary: {
1245
- production_default_count: integrations.filter((integration) => integration.integration_maturity === "production_default").length,
1246
- staged_registration_count: integrations.filter((integration) => integration.registration && integration.registration.registration_state === "staging_registered").length,
1247
- explicit_selection_required_count: integrations.filter((integration) => integration.registration && integration.registration.requires_explicit_selection === true).length,
1248
- default_selection_enabled_count: integrations.filter((integration) => integration.registration && integration.registration.default_selection_enabled === true).length,
1249
- production_default_ready_count: promotionReviews.filter((review) => review.production_default_ready).length,
1250
- review_ready_count: promotionReviews.filter((review) => review.review_ready).length,
1251
- adapter_classes: summarizeCounts(adapterClasses, "adapter_class"),
1252
- sources: summarizeCounts(sources, "source"),
1253
- certification_states: summarizeCounts(certificationStates, "certification_state"),
1254
- registration_states: summarizeCounts(registrationStates, "registration_state"),
1255
- postures: summarizeCounts(promotionReviews.map((review) => review.posture).filter(Boolean), "posture")
1256
- }
1257
- };
1258
- }
1259
-
1260
- function summarizeIntegrationPromotionReadiness(integrationOrId) {
1261
- const integration = typeof integrationOrId === "string"
1262
- ? getIntegration(integrationOrId)
1263
- : clone(integrationOrId || null);
1264
- if (!integration) {
1265
- return {
1266
- ok: false,
1267
- reason: "integration_not_found"
1268
- };
1269
- }
1270
- return {
1271
- ok: true,
1272
- integration_id: integration.integration_id,
1273
- display_name: integration.display_name,
1274
- adapter_class: integration.adapter_class,
1275
- source: integration.source,
1276
- registration: clone(integration.registration || {}),
1277
- certification_state: integration.certification_state || null,
1278
- integration_maturity: integration.integration_maturity || null,
1279
- promotion_readiness: buildPromotionReadinessSummary({
1280
- registration: integration.registration,
1281
- certification: {
1282
- certification_state: integration.certification_state || null
1283
- },
1284
- integration
1285
- })
1286
- };
1287
- }
1288
-
1289
- function summarizeIntegrationPromotionWorkflow(integrationOrId) {
1290
- const summary = summarizeIntegrationPromotionReadiness(integrationOrId);
1291
- if (!summary.ok) {
1292
- return summary;
1293
- }
1294
- const readiness = clone(summary.promotion_readiness || {});
1295
- return {
1296
- ...summary,
1297
- certification_gaps: buildCertificationGapSummary(readiness, summary),
1298
- blocker_categories: summarizePromotionBlockerCategories(readiness.blockers),
1299
- next_transition: buildNextTransitionSummary(readiness),
1300
- promotion_recommendation: buildPromotionRecommendationSummary(readiness)
1301
- };
1302
- }
1303
-
1304
- function summarizeIntegrationPromotionWorkflowList(filters = {}) {
1305
- const integrations = listIntegrations(filters).map((integration) => summarizeIntegrationPromotionWorkflow(integration));
1306
- const blockerCategoryEntries = integrations.flatMap((entry) => entry.blocker_categories || []);
1307
- return {
1308
- ok: true,
1309
- integration_count: integrations.length,
1310
- review_ready_count: integrations.filter((entry) => entry.promotion_readiness.review_ready).length,
1311
- production_default_ready_count: integrations.filter((entry) => entry.promotion_readiness.production_default_ready).length,
1312
- certifiable_count: integrations.filter((entry) => entry.certification_gaps.certifiable).length,
1313
- next_actions: summarizeCounts(
1314
- integrations.map((entry) => entry.next_transition.action).filter(Boolean),
1315
- "action"
1316
- ),
1317
- recommendations: summarizeCounts(
1318
- integrations.map((entry) => entry.promotion_recommendation.recommendation).filter(Boolean),
1319
- "recommendation"
1320
- ),
1321
- blocker_categories: summarizeStructuredCounts(
1322
- blockerCategoryEntries,
1323
- ["category", "severity", "owner"]
1324
- ),
1325
- owner_queue: summarizeCounts(
1326
- blockerCategoryEntries.map((entry) => entry.owner).filter(Boolean),
1327
- "owner"
1328
- ),
1329
- severity_queue: summarizeCounts(
1330
- blockerCategoryEntries.map((entry) => entry.severity).filter(Boolean),
1331
- "severity"
1332
- ),
1333
- next_action_queues: buildPromotionActionQueues(integrations),
1334
- integrations
1335
- };
1336
- }
1337
-
1338
- function buildBuiltInIntegrations() {
1339
- const httpTaskRefs = collectTaskRefsByAdapter("http");
1340
- const mcpTaskRefs = collectTaskRefsByAdapter("mcp");
1341
- const chainTaskRefs = collectTaskRefsByAdapter("chain");
1342
- const settlementModes = (Array.isArray(catalog.settlement_profiles) ? catalog.settlement_profiles : []).map((profile) => profile.mode);
1343
-
1344
- return [
1345
- {
1346
- integration_id: "builtin.execution.http",
1347
- display_name: "Built-In HTTP Execution",
1348
- description: "Default execution path for task and workflow lanes served directly by xytara.",
1349
- adapter_class: "execution_adapter",
1350
- adapter_version: "1.4.0",
1351
- interface_version: "commerce-adapter-interface/v1",
1352
- bundled: true,
1353
- source: "builtin",
1354
- status: "available",
1355
- certification_state: "certified",
1356
- certification_scope: ["builtin_runtime", "service_contract", "sdk_contract"],
1357
- integration_maturity: "production_default",
1358
- selection_priority: 100,
1359
- capabilities: sortStrings(
1360
- (Array.isArray(catalog.tasks) ? catalog.tasks : [])
1361
- .filter((task) => Array.isArray(task.adapters) && task.adapters.includes("http"))
1362
- .flatMap((task) => task.capabilities || [])
1363
- ),
1364
- protocols: [],
1365
- settlement_modes: [],
1366
- execution_backends: ["http"],
1367
- adapter_lanes: ["http"],
1368
- task_refs: sortStrings(httpTaskRefs),
1369
- workflow_refs: sortStrings(collectWorkflowRefsByTaskRefs(httpTaskRefs)),
1370
- required_secrets: [],
1371
- required_permissions: [],
1372
- supported_profiles: ["default"],
1373
- supported_regions: ["global"],
1374
- pricing_basis: "per_task",
1375
- latency_class: "mixed",
1376
- proof_contract: {
1377
- emits_proof_compatible_facts: true,
1378
- proof_mode: "execution_facts_only"
1379
- },
1380
- health_contract: {
1381
- check_kind: "internal",
1382
- supports_readiness: true
1383
- },
1384
- idempotency_contract: {
1385
- strategy: "command_quote_binding",
1386
- scope: "task_execution"
1387
- },
1388
- failure_contract: {
1389
- categories: ["invalid_input", "timeout", "upstream_unavailable"],
1390
- retryable_categories: ["timeout", "upstream_unavailable"]
1391
- },
1392
- compatibility: {
1393
- node: ">=18",
1394
- commerce_contract: "xytara/v1"
1395
- },
1396
- operational_readiness: {
1397
- supports_default_selection: true,
1398
- supports_forced_selection: true,
1399
- lifecycle: "managed_builtin",
1400
- health_source: "internal"
1401
- },
1402
- selection_hints: {
1403
- default_for_task_refs: sortStrings(httpTaskRefs),
1404
- default_for_protocols: [],
1405
- default_for_settlement_modes: []
1406
- }
1407
- },
1408
- {
1409
- integration_id: "builtin.protocol.mcp",
1410
- display_name: "Built-In MCP Protocol Lane",
1411
- description: "Built-in machine protocol lane for MCP tool discovery and invocation through the commerce flow.",
1412
- adapter_class: "agent_protocol_adapter",
1413
- adapter_version: "1.4.0",
1414
- interface_version: "commerce-adapter-interface/v1",
1415
- bundled: true,
1416
- source: "builtin",
1417
- status: "available",
1418
- certification_state: "certified",
1419
- certification_scope: ["builtin_runtime", "service_contract", "sdk_contract"],
1420
- integration_maturity: "production_default",
1421
- selection_priority: 80,
1422
- capabilities: ["adapter.mcp.invoke"],
1423
- protocols: ["mcp"],
1424
- settlement_modes: [],
1425
- execution_backends: ["mcp"],
1426
- adapter_lanes: ["mcp"],
1427
- task_refs: sortStrings(mcpTaskRefs),
1428
- workflow_refs: sortStrings(collectWorkflowRefsByTaskRefs(mcpTaskRefs)),
1429
- required_secrets: [],
1430
- required_permissions: [],
1431
- supported_profiles: ["default"],
1432
- supported_regions: ["global"],
1433
- pricing_basis: "per_task",
1434
- latency_class: "near_real_time",
1435
- proof_contract: {
1436
- emits_proof_compatible_facts: true,
1437
- proof_mode: "protocol_invocation_facts"
1438
- },
1439
- health_contract: {
1440
- check_kind: "internal",
1441
- supports_readiness: true
1442
- },
1443
- idempotency_contract: {
1444
- strategy: "quote_bound_invocation",
1445
- scope: "protocol_invocation"
1446
- },
1447
- failure_contract: {
1448
- categories: ["invalid_input", "timeout", "upstream_unavailable"],
1449
- retryable_categories: ["timeout", "upstream_unavailable"]
1450
- },
1451
- compatibility: {
1452
- node: ">=18",
1453
- commerce_contract: "xytara/v1"
1454
- },
1455
- operational_readiness: {
1456
- supports_default_selection: true,
1457
- supports_forced_selection: true,
1458
- lifecycle: "managed_builtin",
1459
- health_source: "internal"
1460
- },
1461
- selection_hints: {
1462
- default_for_task_refs: sortStrings(mcpTaskRefs),
1463
- default_for_protocols: ["mcp"],
1464
- default_for_settlement_modes: []
1465
- }
1466
- },
1467
- {
1468
- integration_id: "builtin.payment.x402",
1469
- display_name: "Built-In x402 Payment Admission",
1470
- description: "Built-in exact-payment challenge lane for x402-style machine payment admission.",
1471
- adapter_class: "payment_rail_adapter",
1472
- adapter_version: "1.4.0",
1473
- interface_version: "commerce-adapter-interface/v1",
1474
- bundled: true,
1475
- source: "builtin",
1476
- status: "available",
1477
- certification_state: "certified",
1478
- certification_scope: ["builtin_runtime", "service_contract", "sdk_contract"],
1479
- integration_maturity: "production_default",
1480
- selection_priority: 60,
1481
- capabilities: ["payment.admission", "payment.challenge", "payment.exact"],
1482
- protocols: ["x402"],
1483
- settlement_modes: sortStrings(settlementModes),
1484
- execution_backends: [],
1485
- adapter_lanes: ["x402"],
1486
- task_refs: [],
1487
- workflow_refs: [],
1488
- required_secrets: [],
1489
- required_permissions: [],
1490
- supported_profiles: ["default"],
1491
- supported_regions: ["global"],
1492
- pricing_basis: "quote_then_settle",
1493
- latency_class: "near_real_time",
1494
- proof_contract: {
1495
- emits_proof_compatible_facts: true,
1496
- proof_mode: "payment_admission_facts"
1497
- },
1498
- health_contract: {
1499
- check_kind: "internal",
1500
- supports_readiness: true
1501
- },
1502
- idempotency_contract: {
1503
- strategy: "quote_id",
1504
- scope: "payment_admission"
1505
- },
1506
- failure_contract: {
1507
- categories: ["invalid_input", "quote_expired", "payment_missing"],
1508
- retryable_categories: []
1509
- },
1510
- compatibility: {
1511
- node: ">=18",
1512
- commerce_contract: "xytara/v1"
1513
- },
1514
- operational_readiness: {
1515
- supports_default_selection: true,
1516
- supports_forced_selection: true,
1517
- lifecycle: "managed_builtin",
1518
- health_source: "internal"
1519
- },
1520
- selection_hints: {
1521
- default_for_task_refs: [],
1522
- default_for_protocols: ["x402"],
1523
- default_for_settlement_modes: sortStrings(settlementModes)
1524
- }
1525
- },
1526
- {
1527
- integration_id: "builtin.payment.l402",
1528
- display_name: "Built-In L402 Payment Admission",
1529
- description: "Built-in L402-style Lightning payment admission through a gateway-signed payment front.",
1530
- adapter_class: "payment_rail_adapter",
1531
- adapter_version: "1.4.0",
1532
- interface_version: "commerce-adapter-interface/v1",
1533
- bundled: true,
1534
- source: "builtin",
1535
- status: "available",
1536
- certification_state: "certified",
1537
- certification_scope: ["builtin_runtime", "service_contract", "sdk_contract"],
1538
- integration_maturity: "production_supported",
1539
- selection_priority: 65,
1540
- capabilities: ["payment.admission", "payment.challenge", "payment.permissionless_front"],
1541
- protocols: ["l402"],
1542
- settlement_modes: sortStrings(settlementModes),
1543
- execution_backends: [],
1544
- adapter_lanes: ["l402"],
1545
- task_refs: [],
1546
- workflow_refs: [],
1547
- required_secrets: ["XYTARA_L402_SHARED_SECRET"],
1548
- required_permissions: [],
1549
- supported_profiles: ["default"],
1550
- supported_regions: ["global"],
1551
- pricing_basis: "quote_then_settle",
1552
- latency_class: "near_real_time",
1553
- proof_contract: {
1554
- emits_proof_compatible_facts: true,
1555
- proof_mode: "payment_admission_facts"
1556
- },
1557
- health_contract: {
1558
- check_kind: "internal",
1559
- supports_readiness: true
1560
- },
1561
- idempotency_contract: {
1562
- strategy: "quote_id",
1563
- scope: "payment_admission"
1564
- },
1565
- failure_contract: {
1566
- categories: ["invalid_input", "quote_expired", "payment_missing"],
1567
- retryable_categories: []
1568
- },
1569
- compatibility: {
1570
- node: ">=18",
1571
- commerce_contract: "xytara/v1"
1572
- },
1573
- operational_readiness: {
1574
- supports_default_selection: false,
1575
- supports_forced_selection: true,
1576
- lifecycle: "managed_builtin",
1577
- health_source: "internal"
1578
- },
1579
- selection_hints: {
1580
- default_for_task_refs: [],
1581
- default_for_protocols: [],
1582
- default_for_settlement_modes: sortStrings(settlementModes)
1583
- }
1584
- },
1585
- {
1586
- integration_id: "builtin.payment.bolt",
1587
- display_name: "Built-In BOLT Payment Admission",
1588
- description: "Built-in BOLT-style UTXO/SPV payment admission through a signed proof-carrying payment front.",
1589
- adapter_class: "payment_rail_adapter",
1590
- adapter_version: "1.4.0",
1591
- interface_version: "commerce-adapter-interface/v1",
1592
- bundled: true,
1593
- source: "builtin",
1594
- status: "available",
1595
- certification_state: "certified",
1596
- certification_scope: ["builtin_runtime", "service_contract", "sdk_contract"],
1597
- integration_maturity: "production_supported",
1598
- selection_priority: 66,
1599
- capabilities: ["payment.admission", "payment.challenge", "payment.permissionless_front", "payment.spv_proof"],
1600
- protocols: ["bolt"],
1601
- settlement_modes: sortStrings(settlementModes),
1602
- execution_backends: [],
1603
- adapter_lanes: ["bolt"],
1604
- task_refs: [],
1605
- workflow_refs: [],
1606
- required_secrets: ["XYTARA_BOLT_SHARED_SECRET"],
1607
- required_permissions: [],
1608
- supported_profiles: ["default"],
1609
- supported_regions: ["global"],
1610
- pricing_basis: "quote_then_settle",
1611
- latency_class: "near_real_time",
1612
- proof_contract: {
1613
- emits_proof_compatible_facts: true,
1614
- proof_mode: "spv_or_block_header_verifiable_payment_facts"
1615
- },
1616
- health_contract: {
1617
- check_kind: "internal",
1618
- supports_readiness: true
1619
- },
1620
- idempotency_contract: {
1621
- strategy: "quote_id",
1622
- scope: "payment_admission"
1623
- },
1624
- failure_contract: {
1625
- categories: ["invalid_input", "quote_expired", "payment_missing"],
1626
- retryable_categories: []
1627
- },
1628
- compatibility: {
1629
- node: ">=18",
1630
- commerce_contract: "xytara/v1"
1631
- },
1632
- operational_readiness: {
1633
- supports_default_selection: false,
1634
- supports_forced_selection: true,
1635
- lifecycle: "managed_builtin",
1636
- health_source: "internal"
1637
- },
1638
- selection_hints: {
1639
- default_for_task_refs: [],
1640
- default_for_protocols: [],
1641
- default_for_settlement_modes: sortStrings(settlementModes)
1642
- }
1643
- },
1644
- {
1645
- integration_id: "builtin.settlement.chain",
1646
- display_name: "Built-In Chain Settlement",
1647
- description: "Built-in settlement lane spanning the canonical chain-backed settlement profiles bundled in xytara.",
1648
- adapter_class: "settlement_adapter",
1649
- adapter_version: "1.4.0",
1650
- interface_version: "commerce-adapter-interface/v1",
1651
- bundled: true,
1652
- source: "builtin",
1653
- status: "available",
1654
- certification_state: "certified",
1655
- certification_scope: ["builtin_runtime", "service_contract", "sdk_contract"],
1656
- integration_maturity: "production_default",
1657
- selection_priority: 90,
1658
- capabilities: sortStrings(
1659
- (Array.isArray(catalog.tasks) ? catalog.tasks : [])
1660
- .filter((task) => Array.isArray(task.adapters) && task.adapters.includes("chain"))
1661
- .flatMap((task) => task.capabilities || [])
1662
- ),
1663
- protocols: [],
1664
- settlement_modes: sortStrings(settlementModes),
1665
- execution_backends: ["chain"],
1666
- adapter_lanes: ["chain"],
1667
- task_refs: sortStrings(chainTaskRefs),
1668
- workflow_refs: sortStrings(collectWorkflowRefsByTaskRefs(chainTaskRefs)),
1669
- required_secrets: [],
1670
- required_permissions: [],
1671
- supported_profiles: ["default", "anchored"],
1672
- supported_regions: ["global"],
1673
- pricing_basis: "per_settlement",
1674
- latency_class: "governed_async",
1675
- proof_contract: {
1676
- emits_proof_compatible_facts: true,
1677
- proof_mode: "settlement_reference_only"
1678
- },
1679
- health_contract: {
1680
- check_kind: "internal",
1681
- supports_readiness: true
1682
- },
1683
- idempotency_contract: {
1684
- strategy: "quote_and_target_binding",
1685
- scope: "settlement_request"
1686
- },
1687
- failure_contract: {
1688
- categories: ["invalid_input", "timeout", "upstream_unavailable", "settlement_failure"],
1689
- retryable_categories: ["timeout", "upstream_unavailable"]
1690
- },
1691
- compatibility: {
1692
- node: ">=18",
1693
- commerce_contract: "xytara/v1"
1694
- },
1695
- operational_readiness: {
1696
- supports_default_selection: true,
1697
- supports_forced_selection: true,
1698
- lifecycle: "managed_builtin",
1699
- health_source: "internal"
1700
- },
1701
- selection_hints: {
1702
- default_for_task_refs: sortStrings(chainTaskRefs),
1703
- default_for_protocols: [],
1704
- default_for_settlement_modes: sortStrings(settlementModes)
1705
- }
1706
- },
1707
- {
1708
- integration_id: "builtin.identity.registry",
1709
- display_name: "Built-In Registry Identity Surface",
1710
- description: "Built-in registry and anchoring surface used by trust, registry, and lifecycle records.",
1711
- adapter_class: "identity_registry_adapter",
1712
- adapter_version: "1.4.0",
1713
- interface_version: "commerce-adapter-interface/v1",
1714
- bundled: true,
1715
- source: "builtin",
1716
- status: "available",
1717
- certification_state: "certified",
1718
- certification_scope: ["builtin_runtime", "service_contract", "sdk_contract"],
1719
- integration_maturity: "production_default",
1720
- selection_priority: 70,
1721
- capabilities: ["registry.register", "anchoring.submit", "trust.handoff.emit", "trust.handoff.validate"],
1722
- protocols: [],
1723
- settlement_modes: [],
1724
- execution_backends: ["http", "chain"],
1725
- adapter_lanes: ["http", "chain"],
1726
- task_refs: sortStrings(["registry.register", "anchoring.submit", "trust.handoff.emit", "trust.handoff.validate"]),
1727
- workflow_refs: sortStrings(["registry.anchor.flow", "trust.flow"]),
1728
- required_secrets: [],
1729
- required_permissions: [],
1730
- supported_profiles: ["registry", "trust"],
1731
- supported_regions: ["global"],
1732
- pricing_basis: "per_task",
1733
- latency_class: "mixed",
1734
- proof_contract: {
1735
- emits_proof_compatible_facts: true,
1736
- proof_mode: "registry_reference_facts"
1737
- },
1738
- health_contract: {
1739
- check_kind: "internal",
1740
- supports_readiness: true
1741
- },
1742
- idempotency_contract: {
1743
- strategy: "record_ref_binding",
1744
- scope: "registry_request"
1745
- },
1746
- failure_contract: {
1747
- categories: ["invalid_input", "timeout", "upstream_unavailable"],
1748
- retryable_categories: ["timeout", "upstream_unavailable"]
1749
- },
1750
- compatibility: {
1751
- node: ">=18",
1752
- commerce_contract: "xytara/v1"
1753
- },
1754
- operational_readiness: {
1755
- supports_default_selection: true,
1756
- supports_forced_selection: true,
1757
- lifecycle: "managed_builtin",
1758
- health_source: "internal"
1759
- },
1760
- selection_hints: {
1761
- default_for_task_refs: sortStrings(["registry.register", "anchoring.submit", "trust.handoff.emit", "trust.handoff.validate"]),
1762
- default_for_protocols: [],
1763
- default_for_settlement_modes: []
1764
- }
1765
- },
1766
- createBuiltinBreadthIntegration({
1767
- integration_id: "builtin.protocol.a2a",
1768
- display_name: "Built-In A2A Protocol Surface",
1769
- description: "Built-in explicit agent-to-agent protocol surface for negotiation, commit, and settlement flow handoff.",
1770
- adapter_class: "agent_protocol_adapter",
1771
- capabilities: ["a2a.negotiate", "a2a.commit"],
1772
- protocols: ["a2a"],
1773
- execution_backends: ["a2a"],
1774
- adapter_lanes: ["a2a"],
1775
- task_refs: ["a2a.negotiate", "a2a.commit"],
1776
- workflow_refs: ["a2a.settlement.flow"],
1777
- supported_profiles: ["interaction"]
1778
- }),
1779
- createBuiltinBreadthIntegration({
1780
- integration_id: "builtin.protocol.acp",
1781
- display_name: "Built-In ACP Protocol Surface",
1782
- description: "Built-in explicit ACP integration surface for third-party commerce and agent marketplace bridging.",
1783
- adapter_class: "agent_protocol_adapter",
1784
- capabilities: ["protocol.acp.bridge"],
1785
- protocols: ["acp"],
1786
- execution_backends: ["acp"],
1787
- adapter_lanes: ["acp"],
1788
- supported_profiles: ["marketplace", "interaction"]
1789
- }),
1790
- createBuiltinBreadthIntegration({
1791
- integration_id: "builtin.protocol.mqtt",
1792
- display_name: "Built-In MQTT Protocol Surface",
1793
- description: "Built-in MQTT-facing protocol surface for message-driven machine interaction ingestion.",
1794
- adapter_class: "agent_protocol_adapter",
1795
- capabilities: ["protocol.mqtt.bridge"],
1796
- protocols: ["mqtt"],
1797
- execution_backends: ["mqtt"],
1798
- adapter_lanes: ["mqtt"],
1799
- supported_profiles: ["message_bus"]
1800
- }),
1801
- createBuiltinBreadthIntegration({
1802
- integration_id: "builtin.protocol.grpc",
1803
- display_name: "Built-In gRPC Protocol Surface",
1804
- description: "Built-in gRPC-facing protocol surface for service-to-service commerce integration.",
1805
- adapter_class: "agent_protocol_adapter",
1806
- capabilities: ["protocol.grpc.bridge"],
1807
- protocols: ["grpc"],
1808
- execution_backends: ["grpc"],
1809
- adapter_lanes: ["grpc"],
1810
- supported_profiles: ["service_mesh"]
1811
- }),
1812
- createBuiltinBreadthIntegration({
1813
- integration_id: "builtin.protocol.kafka",
1814
- display_name: "Built-In Kafka Protocol Surface",
1815
- description: "Built-in Kafka-facing protocol surface for streaming commerce/event ingress.",
1816
- adapter_class: "agent_protocol_adapter",
1817
- capabilities: ["protocol.kafka.bridge"],
1818
- protocols: ["kafka"],
1819
- execution_backends: ["kafka"],
1820
- adapter_lanes: ["kafka"],
1821
- supported_profiles: ["streaming"]
1822
- }),
1823
- createBuiltinBreadthIntegration({
1824
- integration_id: "builtin.protocol.nats",
1825
- display_name: "Built-In NATS Protocol Surface",
1826
- description: "Built-in NATS-facing protocol surface for lightweight message-bus integration.",
1827
- adapter_class: "agent_protocol_adapter",
1828
- capabilities: ["protocol.nats.bridge"],
1829
- protocols: ["nats"],
1830
- execution_backends: ["nats"],
1831
- adapter_lanes: ["nats"],
1832
- supported_profiles: ["streaming"]
1833
- }),
1834
- createBuiltinBreadthIntegration({
1835
- integration_id: "builtin.protocol.ros2",
1836
- display_name: "Built-In ROS2 Protocol Surface",
1837
- description: "Built-in ROS2-facing protocol surface for robotics-adjacent machine interaction integration.",
1838
- adapter_class: "agent_protocol_adapter",
1839
- capabilities: ["protocol.ros2.bridge"],
1840
- protocols: ["ros2"],
1841
- execution_backends: ["ros2"],
1842
- adapter_lanes: ["ros2"],
1843
- supported_profiles: ["robotics"]
1844
- }),
1845
- createBuiltinBreadthIntegration({
1846
- integration_id: "builtin.execution.langchain",
1847
- display_name: "Built-In LangChain Execution Surface",
1848
- description: "Built-in execution-front surface for LangChain-style orchestration interoperability.",
1849
- adapter_class: "execution_adapter",
1850
- capabilities: ["execution.langchain.chain"],
1851
- execution_backends: ["langchain"],
1852
- adapter_lanes: ["langchain"],
1853
- supported_profiles: ["agent_runtime"]
1854
- }),
1855
- createBuiltinBreadthIntegration({
1856
- integration_id: "builtin.execution.langgraph",
1857
- display_name: "Built-In LangGraph Execution Surface",
1858
- description: "Built-in execution-front surface for LangGraph-style graph orchestration interoperability.",
1859
- adapter_class: "execution_adapter",
1860
- capabilities: ["execution.langgraph.graph"],
1861
- execution_backends: ["langgraph"],
1862
- adapter_lanes: ["langgraph"],
1863
- supported_profiles: ["agent_runtime"]
1864
- }),
1865
- createBuiltinBreadthIntegration({
1866
- integration_id: "builtin.execution.semantic_kernel",
1867
- display_name: "Built-In Semantic Kernel Execution Surface",
1868
- description: "Built-in execution-front surface for Semantic Kernel-style orchestration interoperability.",
1869
- adapter_class: "execution_adapter",
1870
- capabilities: ["execution.semantic_kernel.plan"],
1871
- execution_backends: ["semantic_kernel"],
1872
- adapter_lanes: ["semantic_kernel"],
1873
- supported_profiles: ["agent_runtime"]
1874
- }),
1875
- createBuiltinBreadthIntegration({
1876
- integration_id: "builtin.execution.autogen",
1877
- display_name: "Built-In AutoGen Execution Surface",
1878
- description: "Built-in execution-front surface for AutoGen-style multi-agent orchestration interoperability.",
1879
- adapter_class: "execution_adapter",
1880
- capabilities: ["execution.autogen.session"],
1881
- execution_backends: ["autogen"],
1882
- adapter_lanes: ["autogen"],
1883
- supported_profiles: ["agent_runtime"]
1884
- }),
1885
- createBuiltinBreadthIntegration({
1886
- integration_id: "builtin.execution.crewai",
1887
- display_name: "Built-In CrewAI Execution Surface",
1888
- description: "Built-in execution-front surface for CrewAI-style workflow interoperability.",
1889
- adapter_class: "execution_adapter",
1890
- capabilities: ["execution.crewai.crew"],
1891
- execution_backends: ["crewai"],
1892
- adapter_lanes: ["crewai"],
1893
- supported_profiles: ["agent_runtime"]
1894
- }),
1895
- createBuiltinBreadthIntegration({
1896
- integration_id: "builtin.execution.llamaindex",
1897
- display_name: "Built-In LlamaIndex Execution Surface",
1898
- description: "Built-in execution-front surface for LlamaIndex-style retrieval and agent interoperability.",
1899
- adapter_class: "execution_adapter",
1900
- capabilities: ["execution.llamaindex.workflow"],
1901
- execution_backends: ["llamaindex"],
1902
- adapter_lanes: ["llamaindex"],
1903
- supported_profiles: ["agent_runtime", "retrieval"]
1904
- }),
1905
- createBuiltinBreadthIntegration({
1906
- integration_id: "builtin.payment.mpp",
1907
- display_name: "Built-In MPP Payment Surface",
1908
- description: "Built-in multi-party payment admission surface for broader machine payment interoperability.",
1909
- adapter_class: "payment_rail_adapter",
1910
- capabilities: ["payment.mpp.admission"],
1911
- protocols: ["mpp"],
1912
- settlement_modes: sortStrings(settlementModes),
1913
- adapter_lanes: ["mpp"],
1914
- required_secrets: ["XYTARA_MPP_SHARED_SECRET"],
1915
- supported_profiles: ["payment"]
1916
- }),
1917
- createBuiltinBreadthIntegration({
1918
- integration_id: "builtin.identity.erc8004",
1919
- display_name: "Built-In ERC-8004 Identity Surface",
1920
- description: "Built-in ERC-8004-oriented identity action surface for broader machine identity interoperability.",
1921
- adapter_class: "identity_registry_adapter",
1922
- capabilities: ["identity.erc8004.action"],
1923
- protocols: ["erc8004"],
1924
- execution_backends: ["erc8004"],
1925
- adapter_lanes: ["erc8004"],
1926
- supported_profiles: ["identity", "registry"]
1927
- })
1928
- ];
1929
- }
1930
-
1931
- const EXAMPLE_INTEGRATIONS = [
1932
- mapManifestToIntegration(executionExampleManifest, {
1933
- source: "example",
1934
- execution_backends: ["echo"],
1935
- adapter_lanes: ["http"],
1936
- certification_state: "reference_example",
1937
- certification_scope: ["contract_shape"],
1938
- integration_maturity: "reference_example",
1939
- selection_priority: 950,
1940
- supports_default_selection: false,
1941
- supports_forced_selection: true,
1942
- lifecycle: "example_only",
1943
- health_source: "self_reported",
1944
- default_for_task_refs: [],
1945
- default_for_protocols: [],
1946
- default_for_settlement_modes: []
1947
- }),
1948
- mapManifestToIntegration(settlementExampleManifest, {
1949
- source: "example",
1950
- adapter_lanes: ["chain"],
1951
- certification_state: "reference_example",
1952
- certification_scope: ["contract_shape"],
1953
- integration_maturity: "reference_example",
1954
- selection_priority: 960,
1955
- supports_default_selection: false,
1956
- supports_forced_selection: true,
1957
- lifecycle: "example_only",
1958
- health_source: "self_reported",
1959
- default_for_task_refs: [],
1960
- default_for_protocols: [],
1961
- default_for_settlement_modes: []
1962
- }),
1963
- createRegisteredIntegrationFromManifest({
1964
- adapter_id: exampleThirdPartyRegistrationRecord.adapter_id,
1965
- adapter_class: exampleThirdPartyRegistrationRecord.adapter_class,
1966
- adapter_version: "0.1.0",
1967
- interface_version: "commerce-adapter-interface/v1",
1968
- display_name: "Acme MCP Partner Adapter",
1969
- description: "Reference third-party MCP integration showing how staged non-bundled registration should appear in discovery.",
1970
- capabilities: ["adapter.mcp.invoke"],
1971
- compatibility: {
1972
- node: ">=18",
1973
- commerce_contract: "xytara/v1",
1974
- proof_contract: "xoonya/v1"
1975
- },
1976
- health_contract: {
1977
- check_kind: "self_reported",
1978
- supports_readiness: true
1979
- },
1980
- idempotency_contract: {
1981
- strategy: "quote_bound_invocation",
1982
- scope: "protocol_invocation"
1983
- },
1984
- failure_contract: {
1985
- categories: ["invalid_input", "timeout", "upstream_unavailable"],
1986
- retryable_categories: ["timeout", "upstream_unavailable"]
1987
- },
1988
- proof_contract: {
1989
- emits_proof_compatible_facts: true,
1990
- proof_mode: "protocol_invocation_facts"
1991
- },
1992
- latency_class: "near_real_time",
1993
- pricing_basis: "per_task",
1994
- required_secrets: ["ACME_MCP_TOKEN"],
1995
- required_permissions: ["network:outbound"],
1996
- supported_profiles: ["partner"],
1997
- supported_regions: ["global"],
1998
- supported_settlement_modes: exampleThirdPartyRegistrationRecord.settlement_modes
1999
- }, exampleThirdPartyRegistrationRecord, {
2000
- source: "third_party_example",
2001
- status: "available",
2002
- certification_scope: ["self_attested_contract_shape", "staging_smoke"],
2003
- protocols: sortStrings(exampleThirdPartyRegistrationRecord.protocols),
2004
- execution_backends: ["mcp"],
2005
- adapter_lanes: ["mcp"],
2006
- task_refs: sortStrings(exampleThirdPartyRegistrationRecord.task_refs),
2007
- workflow_refs: [],
2008
- supports_forced_selection: true,
2009
- health_source: "self_reported"
2010
- }),
2011
- createRegisteredIntegrationFromManifest({
2012
- adapter_id: exampleThirdPartyIdentityRegistrationRecord.adapter_id,
2013
- adapter_class: exampleThirdPartyIdentityRegistrationRecord.adapter_class,
2014
- adapter_version: "0.1.0",
2015
- interface_version: "commerce-adapter-interface/v1",
2016
- display_name: "Attest Registry Partner Identity Adapter",
2017
- description: "Reference third-party identity registry integration showing how staged non-bundled identity registration should appear in discovery.",
2018
- capabilities: ["registry.register", "trust.handoff.emit", "trust.handoff.validate"],
2019
- compatibility: {
2020
- node: ">=18",
2021
- commerce_contract: "xytara/v1",
2022
- proof_contract: "xoonya/v1"
2023
- },
2024
- health_contract: {
2025
- check_kind: "self_reported",
2026
- supports_readiness: true
2027
- },
2028
- idempotency_contract: {
2029
- strategy: "record_ref_binding",
2030
- scope: "registry_request"
2031
- },
2032
- failure_contract: {
2033
- categories: ["invalid_input", "timeout", "upstream_unavailable"],
2034
- retryable_categories: ["timeout", "upstream_unavailable"]
2035
- },
2036
- proof_contract: {
2037
- emits_proof_compatible_facts: true,
2038
- proof_mode: "registry_reference_facts"
2039
- },
2040
- latency_class: "near_real_time",
2041
- pricing_basis: "per_task",
2042
- required_secrets: ["ATTEST_REGISTRY_TOKEN"],
2043
- required_permissions: ["network:outbound"],
2044
- supported_profiles: ["partner", "registry", "trust"],
2045
- supported_regions: ["global"],
2046
- supported_settlement_modes: []
2047
- }, exampleThirdPartyIdentityRegistrationRecord, {
2048
- source: "third_party_example",
2049
- status: "available",
2050
- certification_scope: ["self_attested_contract_shape", "staging_identity_smoke"],
2051
- protocols: sortStrings(exampleThirdPartyIdentityRegistrationRecord.protocols),
2052
- execution_backends: ["http", "chain"],
2053
- adapter_lanes: ["http", "chain"],
2054
- task_refs: sortStrings(exampleThirdPartyIdentityRegistrationRecord.task_refs),
2055
- workflow_refs: [],
2056
- supports_forced_selection: true,
2057
- health_source: "self_reported"
2058
- }),
2059
- createRegisteredIntegrationFromManifest({
2060
- adapter_id: exampleThirdPartySettlementRegistrationRecord.adapter_id,
2061
- adapter_class: exampleThirdPartySettlementRegistrationRecord.adapter_class,
2062
- adapter_version: "0.1.0",
2063
- interface_version: "commerce-adapter-interface/v1",
2064
- display_name: "Lattice Anchor Settlement Adapter",
2065
- description: "Reference third-party settlement integration showing how staged non-bundled settlement registration should appear in discovery.",
2066
- capabilities: ["anchoring.submit", "settlement.reference"],
2067
- compatibility: {
2068
- node: ">=18",
2069
- commerce_contract: "xytara/v1",
2070
- proof_contract: "xoonya/v1"
2071
- },
2072
- health_contract: {
2073
- check_kind: "self_reported",
2074
- supports_readiness: true
2075
- },
2076
- idempotency_contract: {
2077
- strategy: "quote_and_target_binding",
2078
- scope: "settlement_request"
2079
- },
2080
- failure_contract: {
2081
- categories: ["invalid_input", "timeout", "upstream_unavailable", "settlement_failure"],
2082
- retryable_categories: ["timeout", "upstream_unavailable"]
2083
- },
2084
- proof_contract: {
2085
- emits_proof_compatible_facts: true,
2086
- proof_mode: "settlement_reference_only"
2087
- },
2088
- latency_class: "governed_async",
2089
- pricing_basis: "per_settlement",
2090
- required_secrets: ["LATTICE_SETTLEMENT_TOKEN"],
2091
- required_permissions: ["network:outbound"],
2092
- supported_profiles: ["partner", "anchored"],
2093
- supported_regions: ["global"],
2094
- supported_settlement_modes: exampleThirdPartySettlementRegistrationRecord.settlement_modes
2095
- }, exampleThirdPartySettlementRegistrationRecord, {
2096
- source: "third_party_example",
2097
- status: "available",
2098
- certification_scope: ["self_attested_contract_shape", "staging_settlement_smoke"],
2099
- protocols: sortStrings(exampleThirdPartySettlementRegistrationRecord.protocols),
2100
- execution_backends: ["chain"],
2101
- adapter_lanes: ["chain"],
2102
- task_refs: sortStrings(exampleThirdPartySettlementRegistrationRecord.task_refs),
2103
- workflow_refs: [],
2104
- supports_forced_selection: true,
2105
- health_source: "self_reported"
2106
- })
2107
- ];
2108
-
2109
- const INTEGRATIONS = buildBuiltInIntegrations().concat(EXAMPLE_INTEGRATIONS).map(clone);
2110
-
2111
- const INTEGRATION_REGISTRATION_RECORDS = {
2112
- [exampleThirdPartyRegistrationRecord.integration_id]: clone(exampleThirdPartyRegistrationRecord),
2113
- [exampleThirdPartyIdentityRegistrationRecord.integration_id]: clone(exampleThirdPartyIdentityRegistrationRecord),
2114
- [exampleThirdPartySettlementRegistrationRecord.integration_id]: clone(exampleThirdPartySettlementRegistrationRecord)
2115
- };
2116
-
2117
- function listIntegrations(filters = {}) {
2118
- const normalized = {
2119
- adapter_class: String(filters.adapter_class || filters.class || "").trim(),
2120
- protocol: String(filters.protocol || "").trim(),
2121
- settlement_mode: String(filters.settlement_mode || "").trim(),
2122
- capability: String(filters.capability || "").trim(),
2123
- task_ref: String(filters.task_ref || "").trim(),
2124
- source: String(filters.source || "").trim(),
2125
- certification_state: String(filters.certification_state || "").trim(),
2126
- integration_maturity: String(filters.integration_maturity || filters.maturity || "").trim(),
2127
- bundled: String(filters.bundled || "").trim()
2128
- };
2129
- return INTEGRATIONS.filter((integration) => {
2130
- if (normalized.adapter_class && integration.adapter_class !== normalized.adapter_class) return false;
2131
- if (normalized.protocol && !integration.protocols.includes(normalized.protocol)) return false;
2132
- if (normalized.settlement_mode && !integration.settlement_modes.includes(normalized.settlement_mode)) return false;
2133
- if (normalized.capability && !integration.capabilities.includes(normalized.capability)) return false;
2134
- if (normalized.task_ref && !integration.task_refs.includes(normalized.task_ref)) return false;
2135
- if (normalized.source && integration.source !== normalized.source) return false;
2136
- if (normalized.certification_state && integration.certification_state !== normalized.certification_state) return false;
2137
- if (normalized.integration_maturity && integration.integration_maturity !== normalized.integration_maturity) return false;
2138
- if (normalized.bundled && String(integration.bundled) !== normalized.bundled) return false;
2139
- return true;
2140
- }).map((integration) => buildIntegrationView(integration, INTEGRATION_REGISTRATION_RECORDS[integration.integration_id]));
2141
- }
2142
-
2143
- function getIntegration(integrationId) {
2144
- const lookup = String(integrationId || "").trim();
2145
- const found = INTEGRATIONS.find((integration) => integration.integration_id === lookup);
2146
- return found ? buildIntegrationView(found, INTEGRATION_REGISTRATION_RECORDS[found.integration_id]) : null;
2147
- }
2148
-
2149
- function summarizeIntegrations(filters = {}) {
2150
- const integrations = listIntegrations(filters);
2151
- return {
2152
- ok: true,
2153
- integration_count: integrations.length,
2154
- integration_ids: integrations.map((integration) => integration.integration_id),
2155
- class_count: sortStrings(integrations.map((integration) => integration.adapter_class)).length,
2156
- protocol_count: sortStrings(integrations.flatMap((integration) => integration.protocols)).length,
2157
- settlement_mode_count: sortStrings(integrations.flatMap((integration) => integration.settlement_modes)).length,
2158
- certified_integration_count: integrations.filter((integration) => integration.certification_state === "certified").length,
2159
- production_default_count: integrations.filter((integration) => integration.integration_maturity === "production_default").length,
2160
- integrations: integrations.map((integration) => ({
2161
- integration_id: integration.integration_id,
2162
- display_name: integration.display_name,
2163
- adapter_class: integration.adapter_class,
2164
- source: integration.source,
2165
- certification_state: integration.certification_state,
2166
- integration_maturity: integration.integration_maturity,
2167
- registration_state: integration.registration.registration_state,
2168
- bundled: integration.registration.bundled,
2169
- selection_priority: integration.selection_priority,
2170
- protocols: integration.protocols,
2171
- settlement_modes: integration.settlement_modes,
2172
- task_count: integration.task_refs.length,
2173
- workflow_count: integration.workflow_refs.length,
2174
- capability_count: integration.capabilities.length
2175
- }))
2176
- };
2177
- }
2178
-
2179
- function summarizeIntegrationClasses(filters = {}) {
2180
- const integrations = listIntegrations(filters);
2181
- const classes = sortStrings(integrations.map((integration) => integration.adapter_class)).map((adapterClass) => ({
2182
- adapter_class: adapterClass,
2183
- integration_count: integrations.filter((integration) => integration.adapter_class === adapterClass).length
2184
- }));
2185
- return {
2186
- ok: true,
2187
- adapter_class_count: classes.length,
2188
- adapter_classes: classes
2189
- };
2190
- }
2191
-
2192
- function summarizeIntegrationProtocols(filters = {}) {
2193
- const integrations = listIntegrations(filters);
2194
- const protocols = sortStrings(integrations.flatMap((integration) => integration.protocols)).map((protocol) => ({
2195
- protocol,
2196
- integration_count: integrations.filter((integration) => integration.protocols.includes(protocol)).length
2197
- }));
2198
- return {
2199
- ok: true,
2200
- protocol_count: protocols.length,
2201
- protocols
2202
- };
2203
- }
2204
-
2205
- function summarizeIntegrationSettlementModes(filters = {}) {
2206
- const integrations = listIntegrations(filters);
2207
- const settlementModes = sortStrings(integrations.flatMap((integration) => integration.settlement_modes)).map((settlementMode) => ({
2208
- settlement_mode: settlementMode,
2209
- integration_count: integrations.filter((integration) => integration.settlement_modes.includes(settlementMode)).length
2210
- }));
2211
- return {
2212
- ok: true,
2213
- settlement_mode_count: settlementModes.length,
2214
- settlement_modes: settlementModes
2215
- };
2216
- }
2217
-
2218
- // 1.3.0 Phase 1 anchor:
2219
- // The next workflow layer should stay read-only and build on top of
2220
- // summarizeIntegrationPromotionReadiness(...), adding:
2221
- // - promotion recommendation summaries
2222
- // - next eligible transition summaries
2223
- // - normalized blocker categories
2224
- // without introducing mutation flows or persistent registry state.
2225
-
2226
- module.exports = {
2227
- getIntegration,
2228
- listIntegrations,
2229
- summarizeIntegrations,
2230
- summarizeIntegrationClasses,
2231
- summarizeIntegrationProtocols,
2232
- summarizeIntegrationSettlementModes,
2233
- validateIntegrationRegistration,
2234
- validateIntegrationCertificationPack,
2235
- validateIntegrationSubmission,
2236
- importRegisteredIntegration,
2237
- createIntegrationRegistrySnapshot,
2238
- exportIntegrationRegistrySnapshot,
2239
- validateIntegrationRegistrySnapshot,
2240
- validateIntegrationSubmissionBundle,
2241
- createIntegrationSubmissionBundle,
2242
- importIntegrationSubmissionBundle,
2243
- createIntegrationRegistrySnapshotFromBundles,
2244
- exportIntegrationSubmissionBundles,
2245
- createIntegrationSubmissionBundleSet,
2246
- validateIntegrationSubmissionBundleSet,
2247
- exportIntegrationSubmissionBundleSet,
2248
- summarizeIntegrationSubmissionBundleReview,
2249
- summarizeIntegrationSubmissionBundleSetReview,
2250
- summarizeIntegrationRegistrySnapshotReview,
2251
- summarizeIntegrationPromotionReadiness,
2252
- summarizeIntegrationPromotionWorkflow,
2253
- summarizeIntegrationPromotionWorkflowList,
2254
- validatePromotionActionRequest,
2255
- summarizeIntegrationPromotionActionPreview,
2256
- summarizeIntegrationPromotionActionSet,
2257
- summarizeIntegrationPromotionActionSetList,
2258
- createRegisteredIntegrationFromManifest,
2259
- buildIntegrationRegistrationView,
2260
- buildIntegrationView
2261
- };