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.
- package/README.md +120 -92
- package/RELEASE_NOTES.md +7 -3
- package/START_HERE.md +56 -224
- package/bin/xytara.js +21 -8
- package/client.js +79 -1
- package/lib/{delivery_receipt.js → delivery_receipt_verify.js} +14 -100
- package/package.json +25 -35
- package/scripts/verify_client.js +418 -0
- package/scripts/verify_release_candidate.js +146 -45
- package/.env.example +0 -173
- package/ADAPTER_START_HERE.md +0 -56
- package/BSV_TERANODE_PLATFORM_DISCONTINUITY_RUNBOOK.md +0 -126
- package/CARRIED_HANDOFF_DEMO.md +0 -60
- package/EXAMPLE_PATHS.md +0 -53
- package/FINAL_CONTRACT.md +0 -498
- package/PARTNER_READY_PATH.md +0 -71
- package/PUBLIC_DEMO_SCRIPT.md +0 -78
- package/REAL_PAYMENT_SETUP.md +0 -320
- package/SERVICE_CONTRACT.md +0 -419
- package/SUPABASE_RUNTIME_STATE_SETUP.md +0 -61
- package/TERMINOLOGY.md +0 -50
- package/WHY_XYTARA_XOONYA.md +0 -63
- package/XT1_EXECUTION_TRUTH_STANDARD.md +0 -78
- package/XYTARA_ADAPTER_PROTOCOL_TRUTH_MODEL.md +0 -75
- package/XYTARA_AUTONOMOUS_ENTRY_MODEL.md +0 -124
- package/XYTARA_DEFAULT_PATH_MODEL.md +0 -84
- package/XYTARA_EXECUTION_TRUTH_MODEL.md +0 -171
- package/XYTARA_PAYMENT_RAIL_TRUTH_MODEL.md +0 -68
- package/adapters/AUTHORING_GUIDE.md +0 -244
- package/adapters/ONBOARDING_POSTURE.md +0 -61
- package/adapters/THIRD_PARTY_SUBMISSION_PROCESS.md +0 -84
- package/adapters/adapter-manifest.schema.json +0 -283
- package/adapters/examples/example-execution-adapter.js +0 -61
- package/adapters/examples/example-execution-adapter.manifest.json +0 -81
- package/adapters/examples/example-settlement-adapter.js +0 -55
- package/adapters/examples/example-settlement-adapter.manifest.json +0 -78
- package/adapters/examples/example-third-party-acp-registration.submission-bundle.json +0 -124
- package/adapters/examples/example-third-party-erc8004-registration.submission-bundle.json +0 -121
- package/adapters/examples/example-third-party-identity-registration.certification-pack.json +0 -22
- package/adapters/examples/example-third-party-identity-registration.record.json +0 -26
- package/adapters/examples/example-third-party-identity-registration.submission-bundle.json +0 -126
- package/adapters/examples/example-third-party-langchain-registration.submission-bundle.json +0 -124
- package/adapters/examples/example-third-party-mpp-registration.submission-bundle.json +0 -120
- package/adapters/examples/example-third-party-registration.certification-pack.json +0 -22
- package/adapters/examples/example-third-party-registration.record.json +0 -28
- package/adapters/examples/example-third-party-registration.submission-bundle.json +0 -126
- package/adapters/examples/example-third-party-settlement-registration.certification-pack.json +0 -22
- package/adapters/examples/example-third-party-settlement-registration.record.json +0 -26
- package/adapters/examples/example-third-party-settlement-registration.submission-bundle.json +0 -127
- package/adapters/examples/langchain-reference-execution-adapter.js +0 -81
- package/adapters/examples/langchain-reference-execution-adapter.manifest.json +0 -79
- package/adapters/examples/langgraph-reference-execution-adapter.js +0 -81
- package/adapters/examples/langgraph-reference-execution-adapter.manifest.json +0 -79
- package/adapters/examples/minimal-third-party-execution-adapter.js +0 -61
- package/adapters/examples/minimal-third-party-execution-adapter.manifest.json +0 -79
- package/adapters/examples/minimal-third-party-execution-registration.record.json +0 -26
- package/adapters/examples/minimal-third-party-execution.certification-pack.json +0 -22
- package/adapters/examples/minimal-third-party-execution.submission-bundle.json +0 -126
- package/adapters/integration-certification-pack.schema.json +0 -82
- package/adapters/integration-registration-record.schema.json +0 -114
- package/adapters/integration-submission-bundle-set.schema.json +0 -39
- package/adapters/integration-submission-bundle.schema.json +0 -34
- package/adapters/interfaces.js +0 -56
- package/bin/xytara-release.js +0 -1429
- package/examples/_demo_env.js +0 -40
- package/examples/adapter_review_walkthrough.js +0 -54
- package/examples/export_carried_handoff.js +0 -81
- package/examples/funded_runtime_walkthrough.js +0 -71
- package/examples/partner_launch_walkthrough.js +0 -44
- package/examples/quickstart.js +0 -3256
- package/fixtures/catalog.js +0 -1156
- package/index.js +0 -395
- package/integrations/dispatch.js +0 -276
- package/integrations/registry-snapshot.schema.json +0 -36
- package/integrations/registry.js +0 -2261
- package/integrations/views.js +0 -28
- package/lib/a2a_lane_contract.js +0 -104
- package/lib/a2a_rpc.js +0 -287
- package/lib/a2c_lane_contract.js +0 -111
- package/lib/account_auth.js +0 -585
- package/lib/acp_lane_contract.js +0 -54
- package/lib/activity_audit_contract.js +0 -322
- package/lib/adapter_certification_contract.js +0 -130
- package/lib/adapter_depth_contract.js +0 -218
- package/lib/adapter_pack.js +0 -118
- package/lib/adapter_partner_pack.js +0 -89
- package/lib/adapter_promotion_pack.js +0 -89
- package/lib/adapter_protocol_truth_contract.js +0 -229
- package/lib/agent_identity.js +0 -162
- package/lib/announcement_pack.js +0 -61
- package/lib/artifact_distribution_lane_contract.js +0 -54
- package/lib/asyncapi_contract.js +0 -150
- package/lib/auth_interop_contract.js +0 -80
- package/lib/authority_binding_lifecycle_contract.js +0 -182
- package/lib/autonomous_entry_contract.js +0 -409
- package/lib/bolt_adapter.js +0 -187
- package/lib/bolt_lane_contract.js +0 -55
- package/lib/bolt_payment_front.js +0 -224
- package/lib/business_cockpit.js +0 -378
- package/lib/buyer_event_log.js +0 -230
- package/lib/buyer_safety_policy.js +0 -132
- package/lib/capability_execution_truth.js +0 -276
- package/lib/capability_registry.js +0 -633
- package/lib/catalog_contract.js +0 -966
- package/lib/catalog_family_model.js +0 -193
- package/lib/catalog_views.js +0 -55
- package/lib/cdp_jwt.js +0 -57
- package/lib/checkout_event_security.js +0 -142
- package/lib/checkout_processor_adapter.js +0 -217
- package/lib/cloudevents_contract.js +0 -80
- package/lib/command_flow.js +0 -911
- package/lib/commerce_artifacts.js +0 -591
- package/lib/commerce_authority.js +0 -449
- package/lib/commerce_bridge.js +0 -274
- package/lib/commerce_cases.js +0 -399
- package/lib/commerce_checkout.js +0 -509
- package/lib/commerce_coordination.js +0 -346
- package/lib/commerce_economics.js +0 -4017
- package/lib/commerce_identity.js +0 -578
- package/lib/commerce_quotes.js +0 -266
- package/lib/commerce_reports.js +0 -14461
- package/lib/commerce_runtime.js +0 -322
- package/lib/commerce_shell.js +0 -257
- package/lib/crypto_agility_matrix.js +0 -125
- package/lib/default_path_contract.js +0 -412
- package/lib/delivery_summary_contract.js +0 -95
- package/lib/ecosystem_entry.js +0 -64
- package/lib/erc8004_lane_contract.js +0 -65
- package/lib/event_system_lane_contract.js +0 -75
- package/lib/execution_dedupe.js +0 -86
- package/lib/execution_truth_contract.js +0 -234
- package/lib/external_credit_bridge.js +0 -142
- package/lib/external_execution_policy.js +0 -143
- package/lib/external_execution_runtime.js +0 -238
- package/lib/feature_control_lane_contract.js +0 -54
- package/lib/first_run_conversion_contract.js +0 -290
- package/lib/framework_lane_contract.js +0 -89
- package/lib/framework_provider_promotion.js +0 -235
- package/lib/full_catalog_contract.js +0 -525
- package/lib/go_live_operator_pack.js +0 -391
- package/lib/http_transport.js +0 -99
- package/lib/identity_auth.js +0 -175
- package/lib/identity_interop_contract.js +0 -82
- package/lib/integration_matrix_contract.js +0 -102
- package/lib/l402_adapter.js +0 -241
- package/lib/l402_lane_contract.js +0 -55
- package/lib/l402_payment_front.js +0 -265
- package/lib/launch_narrative.js +0 -53
- package/lib/lifecycle_continuity_contract.js +0 -115
- package/lib/machine_identity_registry_contract.js +0 -199
- package/lib/major_rails_lane_contract.js +0 -150
- package/lib/market_lane_contract.js +0 -467
- package/lib/market_lane_depth_contract.js +0 -182
- package/lib/market_lane_promotion_contract.js +0 -210
- package/lib/market_lane_trace_contract.js +0 -278
- package/lib/mcp_lane_contract.js +0 -137
- package/lib/mpp_adapter.js +0 -237
- package/lib/network_transport.js +0 -110
- package/lib/offline_verifiability_recovery_contract.js +0 -155
- package/lib/openapi_contract.js +0 -300
- package/lib/operational_receipt_contract.js +0 -165
- package/lib/operator_intelligence.js +0 -407
- package/lib/outreach_copy_pack.js +0 -51
- package/lib/outreach_message_pack.js +0 -71
- package/lib/outreach_proof.js +0 -71
- package/lib/outreach_target_pack.js +0 -60
- package/lib/partner_intelligence.js +0 -105
- package/lib/payment_config.js +0 -257
- package/lib/payment_front_registry.js +0 -53
- package/lib/payment_protocol_contract.js +0 -165
- package/lib/payment_rail_truth_contract.js +0 -324
- package/lib/payment_verification.js +0 -357
- package/lib/phase_10_closeout_pack.js +0 -45
- package/lib/phase_10_completion_pack.js +0 -76
- package/lib/phase_10_decision_record_pack.js +0 -54
- package/lib/phase_10_decision_resolution_pack.js +0 -53
- package/lib/phase_10_demand_signal_adapters_runtime_pack.js +0 -74
- package/lib/phase_10_ecosystem_backlog_triage_runtime_pack.js +0 -74
- package/lib/phase_10_freeze_baseline_pack.js +0 -67
- package/lib/phase_10_freeze_review_pack.js +0 -64
- package/lib/phase_10_gate_pack.js +0 -57
- package/lib/phase_10_long_tail_continuity_pack.js +0 -80
- package/lib/phase_10_long_tail_ecosystem_pack.js +0 -66
- package/lib/phase_10_niche_extension_registry_runtime_pack.js +0 -74
- package/lib/phase_1_claude_mcp_pack.js +0 -60
- package/lib/phase_1_claude_mcp_runtime_pack.js +0 -52
- package/lib/phase_1_ecosystem_pack.js +0 -67
- package/lib/phase_1_openai_codex_pack.js +0 -60
- package/lib/phase_1_openai_codex_runtime_pack.js +0 -52
- package/lib/phase_2_base_runtime_pack.js +0 -71
- package/lib/phase_2_base_usdc_runtime_pack.js +0 -72
- package/lib/phase_2_closeout_pack.js +0 -65
- package/lib/phase_2_completion_pack.js +0 -113
- package/lib/phase_2_decision_record_pack.js +0 -66
- package/lib/phase_2_decision_resolution_pack.js +0 -69
- package/lib/phase_2_eth_runtime_pack.js +0 -70
- package/lib/phase_2_evm_base_runtime_pack.js +0 -73
- package/lib/phase_2_evm_runtime_pack.js +0 -71
- package/lib/phase_2_flip_preview_pack.js +0 -60
- package/lib/phase_2_freeze_review_pack.js +0 -99
- package/lib/phase_2_gate_pack.js +0 -77
- package/lib/phase_2_payment_rails_pack.js +0 -71
- package/lib/phase_2_usdc_runtime_pack.js +0 -71
- package/lib/phase_3_brc_runtime_pack.js +0 -81
- package/lib/phase_3_bsv_teranode_runtime_pack.js +0 -83
- package/lib/phase_3_closeout_pack.js +0 -62
- package/lib/phase_3_completion_pack.js +0 -94
- package/lib/phase_3_decision_record_pack.js +0 -64
- package/lib/phase_3_decision_resolution_pack.js +0 -69
- package/lib/phase_3_freeze_baseline_pack.js +0 -67
- package/lib/phase_3_freeze_review_pack.js +0 -80
- package/lib/phase_3_gate_pack.js +0 -76
- package/lib/phase_3_metanet_runtime_pack.js +0 -81
- package/lib/phase_3_native_bsv_pack.js +0 -91
- package/lib/phase_3_native_continuity_pack.js +0 -82
- package/lib/phase_4_attestation_runtime_pack.js +0 -75
- package/lib/phase_4_closeout_pack.js +0 -45
- package/lib/phase_4_completion_pack.js +0 -94
- package/lib/phase_4_decision_record_pack.js +0 -54
- package/lib/phase_4_decision_resolution_pack.js +0 -45
- package/lib/phase_4_erc8004_runtime_pack.js +0 -76
- package/lib/phase_4_freeze_baseline_pack.js +0 -67
- package/lib/phase_4_freeze_review_pack.js +0 -68
- package/lib/phase_4_gate_pack.js +0 -58
- package/lib/phase_4_identity_registry_runtime_pack.js +0 -75
- package/lib/phase_4_identity_trust_pack.js +0 -73
- package/lib/phase_4_trust_continuity_pack.js +0 -86
- package/lib/phase_5_antelope_runtime_pack.js +0 -76
- package/lib/phase_5_closeout_pack.js +0 -44
- package/lib/phase_5_completion_pack.js +0 -82
- package/lib/phase_5_constellation_dag_runtime_pack.js +0 -76
- package/lib/phase_5_decision_record_pack.js +0 -54
- package/lib/phase_5_decision_resolution_pack.js +0 -45
- package/lib/phase_5_digibyte_dgb_runtime_pack.js +0 -76
- package/lib/phase_5_freeze_baseline_pack.js +0 -67
- package/lib/phase_5_freeze_review_pack.js +0 -68
- package/lib/phase_5_gate_pack.js +0 -58
- package/lib/phase_5_hedera_hbar_runtime_pack.js +0 -76
- package/lib/phase_5_kaspa_kas_runtime_pack.js +0 -76
- package/lib/phase_5_major_rails_continuity_pack.js +0 -86
- package/lib/phase_5_major_rails_pack.js +0 -110
- package/lib/phase_5_metal_runtime_pack.js +0 -76
- package/lib/phase_5_polkadot_dot_runtime_pack.js +0 -76
- package/lib/phase_5_proton_xpr_runtime_pack.js +0 -76
- package/lib/phase_5_solana_runtime_pack.js +0 -76
- package/lib/phase_6_autogen_runtime_pack.js +0 -72
- package/lib/phase_6_closeout_pack.js +0 -46
- package/lib/phase_6_completion_pack.js +0 -77
- package/lib/phase_6_decision_record_pack.js +0 -54
- package/lib/phase_6_decision_resolution_pack.js +0 -53
- package/lib/phase_6_framework_continuity_pack.js +0 -81
- package/lib/phase_6_framework_runtime_pack.js +0 -68
- package/lib/phase_6_freeze_baseline_pack.js +0 -68
- package/lib/phase_6_freeze_review_pack.js +0 -65
- package/lib/phase_6_gate_pack.js +0 -59
- package/lib/phase_6_langchain_runtime_pack.js +0 -72
- package/lib/phase_6_langgraph_runtime_pack.js +0 -72
- package/lib/phase_6_semantic_kernel_runtime_pack.js +0 -72
- package/lib/phase_7_closeout_pack.js +0 -45
- package/lib/phase_7_completion_pack.js +0 -85
- package/lib/phase_7_decision_record_pack.js +0 -53
- package/lib/phase_7_decision_resolution_pack.js +0 -53
- package/lib/phase_7_event_system_continuity_pack.js +0 -89
- package/lib/phase_7_event_system_pack.js +0 -76
- package/lib/phase_7_freeze_baseline_pack.js +0 -74
- package/lib/phase_7_freeze_review_pack.js +0 -65
- package/lib/phase_7_gate_pack.js +0 -58
- package/lib/phase_7_kafka_runtime_pack.js +0 -74
- package/lib/phase_7_mqtt_runtime_pack.js +0 -74
- package/lib/phase_7_nats_runtime_pack.js +0 -74
- package/lib/phase_7_webhook_event_bus_runtime_pack.js +0 -74
- package/lib/phase_8_closeout_pack.js +0 -46
- package/lib/phase_8_completion_pack.js +0 -82
- package/lib/phase_8_decision_record_pack.js +0 -54
- package/lib/phase_8_decision_resolution_pack.js +0 -53
- package/lib/phase_8_external_receipt_import_runtime_pack.js +0 -74
- package/lib/phase_8_external_result_import_runtime_pack.js +0 -74
- package/lib/phase_8_freeze_baseline_pack.js +0 -71
- package/lib/phase_8_freeze_review_pack.js +0 -64
- package/lib/phase_8_gate_pack.js +0 -58
- package/lib/phase_8_proof_bridge_continuity_pack.js +0 -86
- package/lib/phase_8_proof_bridges_pack.js +0 -72
- package/lib/phase_8_proof_bundle_normalization_runtime_pack.js +0 -74
- package/lib/phase_9_closeout_pack.js +0 -46
- package/lib/phase_9_completion_pack.js +0 -82
- package/lib/phase_9_custody_refs_runtime_pack.js +0 -74
- package/lib/phase_9_decision_record_pack.js +0 -54
- package/lib/phase_9_decision_resolution_pack.js +0 -53
- package/lib/phase_9_freeze_baseline_pack.js +0 -71
- package/lib/phase_9_freeze_review_pack.js +0 -64
- package/lib/phase_9_gate_pack.js +0 -58
- package/lib/phase_9_operator_accounting_bridges_runtime_pack.js +0 -74
- package/lib/phase_9_treasury_connectivity_pack.js +0 -72
- package/lib/phase_9_treasury_continuity_pack.js +0 -86
- package/lib/phase_9_treasury_destinations_runtime_pack.js +0 -74
- package/lib/phase_program_pack.js +0 -120
- package/lib/pricing_optimization_contract.js +0 -775
- package/lib/protocol_lane_contract.js +0 -117
- package/lib/provenance_lane_contract.js +0 -54
- package/lib/provider_lane_contract.js +0 -240
- package/lib/provider_network_contract.js +0 -149
- package/lib/provider_payout_execution.js +0 -155
- package/lib/provider_registry.js +0 -852
- package/lib/provider_runtime_journey_contract.js +0 -183
- package/lib/public_surface_policy_contract.js +0 -111
- package/lib/publish_plan.js +0 -51
- package/lib/rate_limiter.js +0 -81
- package/lib/record_queries.js +0 -48
- package/lib/release_candidate.js +0 -50
- package/lib/release_center.js +0 -1093
- package/lib/release_history.js +0 -205
- package/lib/release_manifest.js +0 -113
- package/lib/release_pack.js +0 -453
- package/lib/request_rate_limit.js +0 -144
- package/lib/resource_views.js +0 -31
- package/lib/revenue_launch_path_contract.js +0 -326
- package/lib/route_matchers.js +0 -34
- package/lib/route_params.js +0 -19
- package/lib/runtime_bridge.js +0 -124
- package/lib/runtime_operations_worker.js +0 -282
- package/lib/runtime_state_store.js +0 -495
- package/lib/settlement_bsv_live.js +0 -600
- package/lib/settlement_bsv_teranode.js +0 -117
- package/lib/settlement_lane_contract.js +0 -111
- package/lib/shared_signals_lane_contract.js +0 -54
- package/lib/signed_audit_provenance_contract.js +0 -83
- package/lib/soft_launch_pack.js +0 -78
- package/lib/stablecoin_lane_contract.js +0 -76
- package/lib/stripe_mpp_lane_contract.js +0 -96
- package/lib/stripe_mpp_payment_front.js +0 -258
- package/lib/telemetry_lane_contract.js +0 -54
- package/lib/treasury_destinations_contract.js +0 -764
- package/lib/treasury_egress_policy_contract.js +0 -91
- package/lib/treasury_lane_contract.js +0 -84
- package/lib/trust_portability_boundary_contract.js +0 -72
- package/lib/x402_facilitator.js +0 -198
- package/lib/x402_lane_contract.js +0 -136
- package/lib/x402_settlement_recovery.js +0 -175
- package/scripts/buyer_events_daily_report.js +0 -79
- package/scripts/registry_cli.js +0 -275
- package/scripts/state_backup_offsite.js +0 -196
- package/scripts/verify_a2a_rpc.js +0 -131
- package/scripts/verify_adapters.js +0 -554
- package/scripts/verify_agent_identity.js +0 -153
- package/scripts/verify_all.js +0 -4963
- package/scripts/verify_bolt_adapter.js +0 -128
- package/scripts/verify_buyer_event_log.js +0 -128
- package/scripts/verify_buyer_safety.js +0 -141
- package/scripts/verify_cdp_facilitator.js +0 -110
- package/scripts/verify_checkout_processor.js +0 -109
- package/scripts/verify_commerce_bridge.js +0 -177
- package/scripts/verify_control_plane_contracts.js +0 -34
- package/scripts/verify_control_plane_routes.js +0 -70
- package/scripts/verify_delivery_summary.js +0 -112
- package/scripts/verify_examples.js +0 -19
- package/scripts/verify_execution_dedupe.js +0 -189
- package/scripts/verify_execution_surfacing.js +0 -76
- package/scripts/verify_external_execution_retry.js +0 -140
- package/scripts/verify_final_activation.js +0 -191
- package/scripts/verify_first_run_conversions.js +0 -81
- package/scripts/verify_framework_provider_promotion.js +0 -152
- package/scripts/verify_full_catalog.js +0 -174
- package/scripts/verify_integrations.js +0 -620
- package/scripts/verify_l402_adapter.js +0 -86
- package/scripts/verify_lifecycle_continuity.js +0 -96
- package/scripts/verify_lifecycle_spend_binding.js +0 -88
- package/scripts/verify_market_lane_depth.js +0 -94
- package/scripts/verify_market_lane_promotion.js +0 -103
- package/scripts/verify_market_lane_traces.js +0 -98
- package/scripts/verify_market_lanes.js +0 -102
- package/scripts/verify_mpp_adapter.js +0 -128
- package/scripts/verify_operator_observability_boundary.js +0 -83
- package/scripts/verify_pricing_experiment_plan.js +0 -124
- package/scripts/verify_production_readiness.js +0 -268
- package/scripts/verify_provider_network.js +0 -819
- package/scripts/verify_provider_runtime_breadth.js +0 -109
- package/scripts/verify_provider_runtime_journeys.js +0 -111
- package/scripts/verify_rate_limiter.js +0 -52
- package/scripts/verify_refund_credit.js +0 -106
- package/scripts/verify_revenue_launch_paths.js +0 -105
- package/scripts/verify_runtime_durability.js +0 -52
- package/scripts/verify_runtime_state_guard.js +0 -117
- package/scripts/verify_service.js +0 -15421
- package/scripts/verify_settlement.js +0 -116
- package/scripts/verify_tooling.js +0 -1412
- package/scripts/verify_treasury_public_boundary.js +0 -97
- package/scripts/verify_verify_execute_settle.js +0 -209
- package/scripts/verify_x402_facilitator.js +0 -307
- package/scripts/verify_x402_settlement_recovery.js +0 -153
- package/server.js +0 -12245
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { decodePaymentSignatureHeader } = require("./x402_facilitator");
|
|
4
|
-
|
|
5
|
-
// Settlement-outcome recovery for the deferred x402 lane.
|
|
6
|
-
//
|
|
7
|
-
// A facilitator /settle that times out or drops the connection does NOT mean the transfer failed:
|
|
8
|
-
// the facilitator may already have broadcast it. Telling the buyer "you were not charged" and
|
|
9
|
-
// withholding the result could leave them charged with nothing. Instead we ask the chain: an
|
|
10
|
-
// EIP-3009 authorization that was used is a settled payment (USDC authorizationState(authorizer,
|
|
11
|
-
// nonce) == true). And every settled (or not-yet-confirmed) result is kept briefly under its
|
|
12
|
-
// payment nonce, so a buyer who lost the response — or was told to wait — can resend the SAME
|
|
13
|
-
// payment signature and receive the result instead of paying again.
|
|
14
|
-
|
|
15
|
-
const AUTHORIZATION_STATE_SELECTOR = "0xe94a0102"; // authorizationState(address,bytes32)
|
|
16
|
-
const DEFAULT_RPC_URLS = {
|
|
17
|
-
"eip155:8453": "https://mainnet.base.org",
|
|
18
|
-
"eip155:84532": "https://sepolia.base.org"
|
|
19
|
-
};
|
|
20
|
-
const REPLAY_TTL_MS = 15 * 60 * 1000;
|
|
21
|
-
const REPLAY_MAX = 1000;
|
|
22
|
-
|
|
23
|
-
function rpcUrlFor(network) {
|
|
24
|
-
const key = `XYTARA_RPC_URL_${String(network || "").replace(/[^0-9A-Za-z]/g, "_").toUpperCase()}`;
|
|
25
|
-
const fromEnv = String(process.env[key] || "").trim();
|
|
26
|
-
return fromEnv || DEFAULT_RPC_URLS[String(network || "").toLowerCase()] || null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function hex32(value, bytes) {
|
|
30
|
-
const clean = String(value || "").toLowerCase().replace(/^0x/, "");
|
|
31
|
-
if (!/^[0-9a-f]*$/.test(clean) || clean.length > bytes * 2) return null;
|
|
32
|
-
return clean.padStart(64, "0");
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// true = authorization used (payment settled), false = not used, null = could not tell.
|
|
36
|
-
async function authorizationUsed({ network, asset, authorizer, nonce }, options = {}) {
|
|
37
|
-
const url = rpcUrlFor(network);
|
|
38
|
-
const from = hex32(authorizer, 20);
|
|
39
|
-
const n = hex32(nonce, 32);
|
|
40
|
-
if (!url || !from || !n || !/^0x[0-9a-fA-F]{40}$/.test(String(asset || ""))) return null;
|
|
41
|
-
const fetchImpl = options.fetch || fetch;
|
|
42
|
-
try {
|
|
43
|
-
const response = await fetchImpl(url, {
|
|
44
|
-
method: "POST",
|
|
45
|
-
headers: { "content-type": "application/json" },
|
|
46
|
-
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_call", params: [{ to: asset, data: `${AUTHORIZATION_STATE_SELECTOR}${from}${n}` }, "latest"] }),
|
|
47
|
-
signal: AbortSignal.timeout(options.timeoutMs || 5000)
|
|
48
|
-
});
|
|
49
|
-
const json = await response.json();
|
|
50
|
-
if (!json || typeof json.result !== "string" || !/^0x[0-9a-fA-F]+$/.test(json.result)) return null;
|
|
51
|
-
return BigInt(json.result) !== 0n;
|
|
52
|
-
} catch (_) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// A just-broadcast transfer may not be mined yet: poll a few times before concluding.
|
|
58
|
-
async function confirmAuthorizationUsed(ref, options = {}) {
|
|
59
|
-
const attempts = options.attempts || 3;
|
|
60
|
-
const delayMs = options.delayMs === undefined ? 2000 : options.delayMs;
|
|
61
|
-
let sawAnswer = false;
|
|
62
|
-
for (let i = 0; i < attempts; i += 1) {
|
|
63
|
-
const used = await authorizationUsed(ref, options);
|
|
64
|
-
if (used === true) return true;
|
|
65
|
-
if (used === false) sawAnswer = true;
|
|
66
|
-
if (i < attempts - 1 && delayMs > 0) await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
67
|
-
}
|
|
68
|
-
return sawAnswer ? false : null;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// The on-chain reference of a deferred x402 verification (or of a raw payment header).
|
|
72
|
-
function authorizationRefFromVerification(verification) {
|
|
73
|
-
const deferred = verification && verification.deferred_settlement;
|
|
74
|
-
const auth = deferred && deferred.authorization;
|
|
75
|
-
const paymentPayload = auth && auth.paymentPayload;
|
|
76
|
-
const signed = paymentPayload && paymentPayload.payload && paymentPayload.payload.authorization;
|
|
77
|
-
const requirements = (auth && auth.paymentRequirements) || (paymentPayload && paymentPayload.accepted) || {};
|
|
78
|
-
if (!signed || !signed.nonce || !signed.from) return null;
|
|
79
|
-
return { network: requirements.network, asset: requirements.asset, authorizer: signed.from, nonce: signed.nonce };
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function authorizationRefFromHeaders(headers) {
|
|
83
|
-
const decoded = decodePaymentSignatureHeader((headers || {})["payment-signature"]);
|
|
84
|
-
const signed = decoded && decoded.payload && decoded.payload.authorization;
|
|
85
|
-
if (!signed || !signed.nonce || !signed.from) return null;
|
|
86
|
-
return { network: decoded.accepted.network, asset: decoded.accepted.asset, authorizer: signed.from, nonce: signed.nonce };
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function replayKey(ref) {
|
|
90
|
-
return ref ? `${String(ref.network || "").toLowerCase()}:${String(ref.nonce || "").toLowerCase()}` : null;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function ensureReplayStore(state) {
|
|
94
|
-
if (!(state.x402SettledReplays instanceof Map)) {
|
|
95
|
-
// In-memory only: non-enumerable, so it is never written to the state snapshot.
|
|
96
|
-
Object.defineProperty(state, "x402SettledReplays", { value: new Map(), enumerable: false, writable: true });
|
|
97
|
-
}
|
|
98
|
-
return state.x402SettledReplays;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function pruneReplays(store) {
|
|
102
|
-
const now = Date.now();
|
|
103
|
-
for (const [key, entry] of store) {
|
|
104
|
-
if (entry.expires_at_ms <= now) store.delete(key);
|
|
105
|
-
}
|
|
106
|
-
while (store.size > REPLAY_MAX) store.delete(store.keys().next().value);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// entry: { status: "settled" | "unconfirmed", ref, response?, finalize?: async (settlement) => response }
|
|
110
|
-
function rememberReplay(state, ref, entry) {
|
|
111
|
-
const key = replayKey(ref);
|
|
112
|
-
if (!key) return;
|
|
113
|
-
const store = ensureReplayStore(state);
|
|
114
|
-
pruneReplays(store);
|
|
115
|
-
store.set(key, { ...entry, ref, expires_at_ms: Date.now() + REPLAY_TTL_MS });
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// A resent payment that we already settled (or were confirming) gets its result, not a re-run.
|
|
119
|
-
// The payment authorization becomes public on-chain once settled, so it is not enough on its own:
|
|
120
|
-
// the resent REQUEST must match the original too (request_digest), or nothing is returned.
|
|
121
|
-
async function resolveReplay(state, headers, options = {}) {
|
|
122
|
-
const ref = authorizationRefFromHeaders(headers);
|
|
123
|
-
const key = replayKey(ref);
|
|
124
|
-
if (!key) return null;
|
|
125
|
-
const store = ensureReplayStore(state);
|
|
126
|
-
pruneReplays(store);
|
|
127
|
-
const entry = store.get(key);
|
|
128
|
-
if (!entry) return null;
|
|
129
|
-
if (String(entry.ref.authorizer || "").toLowerCase() !== String(ref.authorizer || "").toLowerCase()) return null;
|
|
130
|
-
if (!entry.request_digest || entry.request_digest !== options.request_digest) {
|
|
131
|
-
return {
|
|
132
|
-
status: 409,
|
|
133
|
-
payload: {
|
|
134
|
-
ok: false,
|
|
135
|
-
reason: "payment_already_used",
|
|
136
|
-
detail: "This payment authorization was already used for a different request. Sign a new payment for this request."
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
if (entry.status === "settled" && entry.response) {
|
|
141
|
-
return { ...entry.response, payload: { ...entry.response.payload, replayed: true } };
|
|
142
|
-
}
|
|
143
|
-
const used = await confirmAuthorizationUsed(entry.ref, { attempts: 1, ...(options.rpc || {}) });
|
|
144
|
-
if (used === true && typeof entry.finalize === "function") {
|
|
145
|
-
const response = await entry.finalize({ success: true, transaction: null, network: entry.ref.network, payer: entry.ref.authorizer, recovered_from: "authorization_state" });
|
|
146
|
-
store.set(key, { ...entry, status: "settled", response, finalize: undefined });
|
|
147
|
-
return { ...response, payload: { ...response.payload, replayed: true } };
|
|
148
|
-
}
|
|
149
|
-
if (used === false) {
|
|
150
|
-
// Never settled: forget it so the payment is verified and executed normally.
|
|
151
|
-
store.delete(key);
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
return {
|
|
155
|
-
status: 409,
|
|
156
|
-
payload: {
|
|
157
|
-
ok: false,
|
|
158
|
-
reason: "settlement_outcome_unknown",
|
|
159
|
-
detail: "We are still confirming whether this payment settled on-chain. Resend the same payment signature in a minute to receive the result; do not sign a new payment.",
|
|
160
|
-
payment_settled: null
|
|
161
|
-
},
|
|
162
|
-
headers: { "Retry-After": "30" }
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
module.exports = {
|
|
167
|
-
AUTHORIZATION_STATE_SELECTOR,
|
|
168
|
-
authorizationRefFromHeaders,
|
|
169
|
-
authorizationRefFromVerification,
|
|
170
|
-
authorizationUsed,
|
|
171
|
-
confirmAuthorizationUsed,
|
|
172
|
-
rememberReplay,
|
|
173
|
-
resolveReplay,
|
|
174
|
-
rpcUrlFor
|
|
175
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// Daily buyer-journey report: reads the operator-only failure summary from the live runtime and
|
|
4
|
-
// prints it as Markdown (to $GITHUB_STEP_SUMMARY when run in Actions). Exits 1 — so GitHub emails
|
|
5
|
-
// the workflow owner — when money moved without a delivered result, or when failures that are OUR
|
|
6
|
-
// fault exceed the threshold. Exits 0 with a notice when no operator token is configured.
|
|
7
|
-
//
|
|
8
|
-
// Usage: XYTARA_OPERATOR_READ_BEARER=... node scripts/buyer_events_daily_report.js [--days 1]
|
|
9
|
-
// Env: XYTARA_URL (default https://xytara.onrender.com), BUYER_EVENTS_OURS_THRESHOLD (default 0).
|
|
10
|
-
|
|
11
|
-
const fs = require("fs");
|
|
12
|
-
|
|
13
|
-
function formatReport(summary, events, baseUrl) {
|
|
14
|
-
const t = summary.totals || {};
|
|
15
|
-
const lines = [
|
|
16
|
-
`## naxytra buyer journey — last ${summary.window_days} day(s)`,
|
|
17
|
-
"",
|
|
18
|
-
`Runtime: ${baseUrl} · generated ${summary.generated_at_iso}`,
|
|
19
|
-
"",
|
|
20
|
-
"| Paid calls served | 402 challenges | Failures | Our fault | Upstream | Buyer-side | Money moved, nothing delivered |",
|
|
21
|
-
"|---:|---:|---:|---:|---:|---:|---:|",
|
|
22
|
-
`| ${t.paid_ok || 0} | ${t.challenges_issued || 0} | ${t.failures || 0} | ${t.ours || 0} | ${t.upstream || 0} | ${t.buyer || 0} | ${t.money_moved || 0} |`,
|
|
23
|
-
""
|
|
24
|
-
];
|
|
25
|
-
const reasons = Array.isArray(summary.top_reasons) ? summary.top_reasons : [];
|
|
26
|
-
if (reasons.length) {
|
|
27
|
-
lines.push("### Top failure reasons", "", "| Service | Stage | Reason | Fault | Count |", "|---|---|---|---|---:|");
|
|
28
|
-
for (const r of reasons.slice(0, 15)) lines.push(`| ${r.service} | ${r.stage} | ${r.reason} | ${r.fault} | ${r.count} |`);
|
|
29
|
-
lines.push("");
|
|
30
|
-
}
|
|
31
|
-
const notable = (Array.isArray(events) ? events : []).filter((e) => e.money_moved || e.fault === "ours").slice(0, 20);
|
|
32
|
-
if (notable.length) {
|
|
33
|
-
lines.push("### Needs a look (money moved or our fault)", "", "| When (UTC) | Service | Route / tool | Reason | Request id |", "|---|---|---|---|---|");
|
|
34
|
-
for (const e of notable) lines.push(`| ${e.at_iso} | ${e.service} | ${e.task_or_tool || e.route || ""} | ${e.reason}${e.money_moved ? " (money moved)" : ""} | ${e.request_id || ""} |`);
|
|
35
|
-
lines.push("");
|
|
36
|
-
}
|
|
37
|
-
return lines.join("\n");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async function main() {
|
|
41
|
-
const token = String(process.env.XYTARA_OPERATOR_READ_BEARER || "").trim();
|
|
42
|
-
const baseUrl = String(process.env.XYTARA_URL || "https://xytara.onrender.com").replace(/\/+$/, "");
|
|
43
|
-
const daysArg = process.argv.indexOf("--days");
|
|
44
|
-
const days = daysArg > -1 ? Number(process.argv[daysArg + 1]) || 1 : 1;
|
|
45
|
-
const out = (text) => {
|
|
46
|
-
if (process.env.GITHUB_STEP_SUMMARY) fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, `${text}\n`);
|
|
47
|
-
console.log(text);
|
|
48
|
-
};
|
|
49
|
-
if (!token) {
|
|
50
|
-
out("Buyer journey report skipped: set the XYTARA_OPERATOR_READ_BEARER secret to enable it.");
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const headers = { authorization: `Bearer ${token}` };
|
|
54
|
-
// The runtime may be asleep on a free tier: allow for a cold start.
|
|
55
|
-
const get = async (path) => {
|
|
56
|
-
const res = await fetch(`${baseUrl}${path}`, { headers, signal: AbortSignal.timeout(90000) });
|
|
57
|
-
if (!res.ok) throw new Error(`${path} -> HTTP ${res.status}`);
|
|
58
|
-
return res.json();
|
|
59
|
-
};
|
|
60
|
-
const since = new Date(Date.now() - days * 86400000).toISOString();
|
|
61
|
-
const summary = await get(`/v1/operator/buyer-events/summary?days=${days}`);
|
|
62
|
-
const listed = await get(`/v1/operator/buyer-events?since=${encodeURIComponent(since)}&limit=200`);
|
|
63
|
-
out(formatReport(summary, listed.events, baseUrl));
|
|
64
|
-
const threshold = Number(process.env.BUYER_EVENTS_OURS_THRESHOLD || 0);
|
|
65
|
-
const totals = summary.totals || {};
|
|
66
|
-
if ((totals.money_moved || 0) > 0 || (totals.ours || 0) > threshold) {
|
|
67
|
-
console.error(`ATTENTION: money_moved=${totals.money_moved || 0}, our-fault failures=${totals.ours || 0} (threshold ${threshold}).`);
|
|
68
|
-
process.exit(1);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (require.main === module) {
|
|
73
|
-
main().catch((error) => {
|
|
74
|
-
console.error(`Buyer journey report failed: ${error && error.message ? error.message : error}`);
|
|
75
|
-
process.exit(1);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
module.exports = { formatReport };
|
package/scripts/registry_cli.js
DELETED
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const {
|
|
6
|
-
createIntegrationRegistrySnapshotFromBundles,
|
|
7
|
-
exportIntegrationSubmissionBundleSet,
|
|
8
|
-
importIntegrationSubmissionBundle,
|
|
9
|
-
summarizeIntegrationPromotionActionPreview,
|
|
10
|
-
summarizeIntegrationPromotionActionSet,
|
|
11
|
-
summarizeIntegrationPromotionActionSetList,
|
|
12
|
-
summarizeIntegrationPromotionReadiness,
|
|
13
|
-
summarizeIntegrationPromotionWorkflow,
|
|
14
|
-
summarizeIntegrationPromotionWorkflowList,
|
|
15
|
-
summarizeIntegrationRegistrySnapshotReview,
|
|
16
|
-
summarizeIntegrationSubmissionBundleReview,
|
|
17
|
-
summarizeIntegrationSubmissionBundleSetReview,
|
|
18
|
-
validateIntegrationSubmissionBundle
|
|
19
|
-
} = require("../integrations/registry");
|
|
20
|
-
|
|
21
|
-
function readJson(filePath) {
|
|
22
|
-
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function writeJson(payload) {
|
|
26
|
-
process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function resolveExampleBundle(name) {
|
|
30
|
-
const filename = name === "settlement"
|
|
31
|
-
? "example-third-party-settlement-registration.submission-bundle.json"
|
|
32
|
-
: name === "identity"
|
|
33
|
-
? "example-third-party-identity-registration.submission-bundle.json"
|
|
34
|
-
: "example-third-party-registration.submission-bundle.json";
|
|
35
|
-
return path.resolve(__dirname, "..", "adapters", "examples", filename);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function importExampleBundles() {
|
|
39
|
-
return [
|
|
40
|
-
importIntegrationSubmissionBundle(readJson(resolveExampleBundle("protocol")), {
|
|
41
|
-
source: "third_party_example",
|
|
42
|
-
protocols: ["mcp"],
|
|
43
|
-
execution_backends: ["mcp"],
|
|
44
|
-
adapter_lanes: ["mcp"],
|
|
45
|
-
task_refs: ["adapter.mcp.invoke"]
|
|
46
|
-
}),
|
|
47
|
-
importIntegrationSubmissionBundle(readJson(resolveExampleBundle("identity")), {
|
|
48
|
-
source: "third_party_example",
|
|
49
|
-
protocols: [],
|
|
50
|
-
execution_backends: ["http", "chain"],
|
|
51
|
-
adapter_lanes: ["http", "chain"],
|
|
52
|
-
task_refs: ["registry.register", "trust.handoff.emit", "trust.handoff.validate"]
|
|
53
|
-
}),
|
|
54
|
-
importIntegrationSubmissionBundle(readJson(resolveExampleBundle("settlement")), {
|
|
55
|
-
source: "third_party_example",
|
|
56
|
-
protocols: [],
|
|
57
|
-
execution_backends: ["chain"],
|
|
58
|
-
adapter_lanes: ["chain"],
|
|
59
|
-
task_refs: ["anchoring.submit"]
|
|
60
|
-
})
|
|
61
|
-
];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function parseArgs(argv) {
|
|
65
|
-
const [command, ...rest] = argv;
|
|
66
|
-
const options = {};
|
|
67
|
-
for (let index = 0; index < rest.length; index += 1) {
|
|
68
|
-
const token = rest[index];
|
|
69
|
-
if (!token.startsWith("--")) continue;
|
|
70
|
-
const key = token.slice(2);
|
|
71
|
-
const next = rest[index + 1];
|
|
72
|
-
if (!next || next.startsWith("--")) {
|
|
73
|
-
options[key] = true;
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
options[key] = next;
|
|
77
|
-
index += 1;
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
command: command || "",
|
|
81
|
-
options
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function runValidateBundle(options) {
|
|
86
|
-
const filePath = options.file
|
|
87
|
-
? path.resolve(process.cwd(), options.file)
|
|
88
|
-
: resolveExampleBundle(options.example === "settlement" ? "settlement" : options.example === "identity" ? "identity" : "protocol");
|
|
89
|
-
const bundle = readJson(filePath);
|
|
90
|
-
const validation = validateIntegrationSubmissionBundle(bundle);
|
|
91
|
-
writeJson({
|
|
92
|
-
ok: validation.ok,
|
|
93
|
-
file: filePath,
|
|
94
|
-
errors: validation.errors
|
|
95
|
-
});
|
|
96
|
-
process.exitCode = validation.ok ? 0 : 1;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function runExportBundleSet(options) {
|
|
100
|
-
const payload = exportIntegrationSubmissionBundleSet({
|
|
101
|
-
source: "third_party_example",
|
|
102
|
-
bundled: "false"
|
|
103
|
-
}, options.notes || "generated by registry_cli");
|
|
104
|
-
writeJson(payload);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function runExportSnapshot(options) {
|
|
108
|
-
const snapshot = createIntegrationRegistrySnapshotFromBundles(
|
|
109
|
-
importExampleBundles(),
|
|
110
|
-
{ source: "third_party_example" },
|
|
111
|
-
{ source: "third_party_example" }
|
|
112
|
-
);
|
|
113
|
-
writeJson({
|
|
114
|
-
generated_by: "registry_cli",
|
|
115
|
-
mode: options.mode || "examples",
|
|
116
|
-
snapshot
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function runReviewBundle(options) {
|
|
121
|
-
const filePath = options.file
|
|
122
|
-
? path.resolve(process.cwd(), options.file)
|
|
123
|
-
: resolveExampleBundle(options.example === "settlement" ? "settlement" : options.example === "identity" ? "identity" : "protocol");
|
|
124
|
-
const bundle = readJson(filePath);
|
|
125
|
-
writeJson({
|
|
126
|
-
file: filePath,
|
|
127
|
-
review: summarizeIntegrationSubmissionBundleReview(bundle)
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function runReviewBundleSet(options) {
|
|
132
|
-
const payload = exportIntegrationSubmissionBundleSet({
|
|
133
|
-
source: "third_party_example",
|
|
134
|
-
bundled: "false"
|
|
135
|
-
}, options.notes || "generated by registry_cli");
|
|
136
|
-
writeJson({
|
|
137
|
-
review: summarizeIntegrationSubmissionBundleSetReview(payload)
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function runReviewSnapshot() {
|
|
142
|
-
const snapshot = createIntegrationRegistrySnapshotFromBundles(
|
|
143
|
-
importExampleBundles(),
|
|
144
|
-
{ source: "third_party_example" },
|
|
145
|
-
{ source: "third_party_example" }
|
|
146
|
-
);
|
|
147
|
-
writeJson({
|
|
148
|
-
review: summarizeIntegrationRegistrySnapshotReview(snapshot)
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function runPromotionReadiness(options) {
|
|
153
|
-
const integrationId = options.integration || "partner.protocol.acme_mcp";
|
|
154
|
-
writeJson({
|
|
155
|
-
integration_id: integrationId,
|
|
156
|
-
review: summarizeIntegrationPromotionReadiness(integrationId)
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function runPromotionWorkflow(options) {
|
|
161
|
-
const integrationId = options.integration || "partner.protocol.acme_mcp";
|
|
162
|
-
writeJson({
|
|
163
|
-
integration_id: integrationId,
|
|
164
|
-
review: summarizeIntegrationPromotionWorkflow(integrationId)
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function runPromotionWorkflowSummary(options) {
|
|
169
|
-
writeJson({
|
|
170
|
-
review: summarizeIntegrationPromotionWorkflowList({
|
|
171
|
-
source: options.source || "",
|
|
172
|
-
bundled: options.bundled || ""
|
|
173
|
-
})
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function runPromotionActionPreview(options) {
|
|
178
|
-
writeJson({
|
|
179
|
-
review: summarizeIntegrationPromotionActionPreview({
|
|
180
|
-
integration_id: options.integration || "partner.protocol.acme_mcp",
|
|
181
|
-
action: options.action || "complete_certification"
|
|
182
|
-
})
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function runPromotionActionSet(options) {
|
|
187
|
-
const integrationId = options.integration || "partner.protocol.acme_mcp";
|
|
188
|
-
writeJson({
|
|
189
|
-
integration_id: integrationId,
|
|
190
|
-
review: summarizeIntegrationPromotionActionSet(integrationId)
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function runPromotionActionSetSummary(options) {
|
|
195
|
-
writeJson({
|
|
196
|
-
review: summarizeIntegrationPromotionActionSetList({
|
|
197
|
-
source: options.source || "",
|
|
198
|
-
bundled: options.bundled || ""
|
|
199
|
-
})
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function main() {
|
|
204
|
-
const { command, options } = parseArgs(process.argv.slice(2));
|
|
205
|
-
if (command === "validate-bundle") {
|
|
206
|
-
runValidateBundle(options);
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
if (command === "export-bundle-set") {
|
|
210
|
-
runExportBundleSet(options);
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
if (command === "export-snapshot") {
|
|
214
|
-
runExportSnapshot(options);
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
if (command === "review-bundle") {
|
|
218
|
-
runReviewBundle(options);
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
if (command === "review-bundle-set") {
|
|
222
|
-
runReviewBundleSet(options);
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
if (command === "review-snapshot") {
|
|
226
|
-
runReviewSnapshot();
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
if (command === "promotion-readiness") {
|
|
230
|
-
runPromotionReadiness(options);
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
if (command === "promotion-workflow") {
|
|
234
|
-
runPromotionWorkflow(options);
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
if (command === "promotion-workflow-summary") {
|
|
238
|
-
runPromotionWorkflowSummary(options);
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
if (command === "promotion-action-preview") {
|
|
242
|
-
runPromotionActionPreview(options);
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
if (command === "promotion-action-set") {
|
|
246
|
-
runPromotionActionSet(options);
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
if (command === "promotion-action-set-summary") {
|
|
250
|
-
runPromotionActionSetSummary(options);
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
writeJson({
|
|
255
|
-
ok: false,
|
|
256
|
-
usage: [
|
|
257
|
-
"node scripts/registry_cli.js validate-bundle [--file <path>] [--example protocol|settlement]",
|
|
258
|
-
"node scripts/registry_cli.js validate-bundle [--file <path>] [--example identity]",
|
|
259
|
-
"node scripts/registry_cli.js export-bundle-set [--notes <text>]",
|
|
260
|
-
"node scripts/registry_cli.js export-snapshot",
|
|
261
|
-
"node scripts/registry_cli.js review-bundle [--file <path>] [--example protocol|identity|settlement]",
|
|
262
|
-
"node scripts/registry_cli.js review-bundle-set [--notes <text>]",
|
|
263
|
-
"node scripts/registry_cli.js review-snapshot",
|
|
264
|
-
"node scripts/registry_cli.js promotion-readiness [--integration <integration_id>]",
|
|
265
|
-
"node scripts/registry_cli.js promotion-workflow [--integration <integration_id>]",
|
|
266
|
-
"node scripts/registry_cli.js promotion-workflow-summary [--source <source>] [--bundled true|false]",
|
|
267
|
-
"node scripts/registry_cli.js promotion-action-preview [--integration <integration_id>] [--action <action>]",
|
|
268
|
-
"node scripts/registry_cli.js promotion-action-set [--integration <integration_id>]",
|
|
269
|
-
"node scripts/registry_cli.js promotion-action-set-summary [--source <source>] [--bundled true|false]"
|
|
270
|
-
]
|
|
271
|
-
});
|
|
272
|
-
process.exitCode = 1;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
main();
|