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
package/integrations/views.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { buildMissingResponse } = require("../lib/resource_views");
|
|
4
|
-
|
|
5
|
-
function buildIntegrationListResponse(payload) {
|
|
6
|
-
return {
|
|
7
|
-
status: 200,
|
|
8
|
-
payload
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function buildIntegrationDetailResponse(integration) {
|
|
13
|
-
if (!integration) {
|
|
14
|
-
return buildMissingResponse("integration_not_found");
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
status: 200,
|
|
18
|
-
payload: {
|
|
19
|
-
ok: true,
|
|
20
|
-
integration
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
module.exports = {
|
|
26
|
-
buildIntegrationDetailResponse,
|
|
27
|
-
buildIntegrationListResponse
|
|
28
|
-
};
|
package/lib/a2a_lane_contract.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
buildPrecommitInteractionPackCatalog,
|
|
5
|
-
buildInteractionSpinePathCatalog,
|
|
6
|
-
buildTransactionClassPackCatalog,
|
|
7
|
-
summarizePrecommitInteractionPacks,
|
|
8
|
-
summarizeInteractionSpinePaths,
|
|
9
|
-
summarizeTransactionClassPacks,
|
|
10
|
-
buildDefaultTransactionCenter,
|
|
11
|
-
summarizeDefaultTransactionCenter
|
|
12
|
-
} = require("./catalog_contract");
|
|
13
|
-
|
|
14
|
-
function buildA2ALanePack() {
|
|
15
|
-
const center = buildDefaultTransactionCenter();
|
|
16
|
-
const centerSummary = summarizeDefaultTransactionCenter();
|
|
17
|
-
const precommitCatalog = buildPrecommitInteractionPackCatalog();
|
|
18
|
-
const spineCatalog = buildInteractionSpinePathCatalog();
|
|
19
|
-
const classCatalog = buildTransactionClassPackCatalog();
|
|
20
|
-
const precommitPacks = Array.isArray(precommitCatalog.packs) ? precommitCatalog.packs : [];
|
|
21
|
-
const spinePaths = Array.isArray(spineCatalog.paths) ? spineCatalog.paths : [];
|
|
22
|
-
const classPacks = Array.isArray(classCatalog.class_packs) ? classCatalog.class_packs : [];
|
|
23
|
-
|
|
24
|
-
const readinessPack = precommitPacks.find((entry) => entry.precommit_pack_ref === "precommit.a2a.settlement.readiness") || null;
|
|
25
|
-
const settlementSpine = spinePaths.find((entry) => entry.spine_path_ref === "spine.a2a.settlement") || null;
|
|
26
|
-
const committedClass = classPacks.find((entry) => entry.class_pack_ref === "transaction.admission.settlement") || null;
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
product: "xytara",
|
|
30
|
-
category: "machine-commerce-a2a-lane-pack",
|
|
31
|
-
pack_version: "xytara-a2a-lane-pack-v1",
|
|
32
|
-
lane_state: "first_party_a2a_present",
|
|
33
|
-
default_protocol: "a2a",
|
|
34
|
-
default_payment_protocol: centerSummary.default_payment_protocol,
|
|
35
|
-
default_settlement_mode: centerSummary.default_settlement_mode,
|
|
36
|
-
default_transaction_center: center,
|
|
37
|
-
readiness_pack: readinessPack,
|
|
38
|
-
settlement_spine: settlementSpine,
|
|
39
|
-
committed_class_pack: committedClass,
|
|
40
|
-
precommit_summary: summarizePrecommitInteractionPacks(),
|
|
41
|
-
spine_summary: summarizeInteractionSpinePaths(),
|
|
42
|
-
class_summary: summarizeTransactionClassPacks(),
|
|
43
|
-
first_run_flows: [
|
|
44
|
-
{
|
|
45
|
-
flow_ref: "precommit.a2a.settlement.readiness",
|
|
46
|
-
recommended_reason: "best first A2A readiness and negotiation view",
|
|
47
|
-
example_surfaces: {
|
|
48
|
-
negotiate_ref: "/v1/a2a/negotiate",
|
|
49
|
-
admission_preview_ref: "/v1/admission/preview",
|
|
50
|
-
commit_ref: "/v1/a2a/commit"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
flow_ref: "spine.a2a.settlement",
|
|
55
|
-
recommended_reason: "best first full A2A settlement path",
|
|
56
|
-
example_surfaces: {
|
|
57
|
-
flow_ref: "/v1/a2a",
|
|
58
|
-
settlement_flow_ref: "/v1/a2a/flows/settlement",
|
|
59
|
-
cross_zone_preview_ref: "/v1/coordination-center/cross-zone-preview"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
supported_surfaces: {
|
|
64
|
-
negotiate_ref: "/v1/a2a/negotiate",
|
|
65
|
-
commit_ref: "/v1/a2a/commit",
|
|
66
|
-
settlement_flow_ref: "/v1/a2a/flows/settlement",
|
|
67
|
-
admission_preview_ref: "/v1/admission/preview",
|
|
68
|
-
handshake_preview_ref: "/v1/coordination-center/handshake-preview",
|
|
69
|
-
cross_zone_preview_ref: "/v1/coordination-center/cross-zone-preview",
|
|
70
|
-
auth_profile_ref: "/v1/auth-profiles",
|
|
71
|
-
openapi_ref: "/openapi.json",
|
|
72
|
-
asyncapi_ref: "/asyncapi.json",
|
|
73
|
-
cloudevents_ref: "/cloudevents.json"
|
|
74
|
-
},
|
|
75
|
-
recommended_sequence: [
|
|
76
|
-
"preview_counterparty_and_task_pack_intent",
|
|
77
|
-
"negotiate_a2a",
|
|
78
|
-
"preview_admission_posture",
|
|
79
|
-
"commit_a2a",
|
|
80
|
-
"run_settlement_spine_or_committed_class",
|
|
81
|
-
"inspect_transaction_and_proof_followthrough"
|
|
82
|
-
]
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function summarizeA2ALanePack() {
|
|
87
|
-
const pack = buildA2ALanePack();
|
|
88
|
-
return {
|
|
89
|
-
product: "xytara",
|
|
90
|
-
category: "machine-commerce-a2a-lane-pack-summary",
|
|
91
|
-
summary_version: "xytara-a2a-lane-pack-summary-v1",
|
|
92
|
-
lane_state: pack.lane_state,
|
|
93
|
-
default_payment_protocol: pack.default_payment_protocol,
|
|
94
|
-
default_settlement_mode: pack.default_settlement_mode,
|
|
95
|
-
first_run_flow_count: pack.first_run_flows.length,
|
|
96
|
-
settlement_spine_ref: pack.settlement_spine ? pack.settlement_spine.spine_path_ref : null,
|
|
97
|
-
linked_surfaces: pack.supported_surfaces
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
module.exports = {
|
|
102
|
-
buildA2ALanePack,
|
|
103
|
-
summarizeA2ALanePack
|
|
104
|
-
};
|
package/lib/a2a_rpc.js
DELETED
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// A2A JSON-RPC endpoint with the x402 payment extension (in-band).
|
|
4
|
-
//
|
|
5
|
-
// Spec shape (A2A + x402 extension): payment travels inside the A2A message
|
|
6
|
-
// metadata, not an HTTP header. An unpaid `message/send` returns a Task in
|
|
7
|
-
// state `input-required` whose status message metadata carries
|
|
8
|
-
// `x402.payment.status: "payment-required"` and `x402.payment.required` (the
|
|
9
|
-
// advertised x402 accepts). The caller re-sends `message/send` with the signed
|
|
10
|
-
// x402 authorization in `x402.payment.payload`; we verify + settle it through
|
|
11
|
-
// the same proven facilitator path used by the HTTP x402 routes, run the
|
|
12
|
-
// requested task, and return a `completed` Task carrying the settlement in
|
|
13
|
-
// `x402.payment.receipts` (plus a PAYMENT-RESPONSE header for header-aware
|
|
14
|
-
// clients).
|
|
15
|
-
//
|
|
16
|
-
// This module is dependency-injected so it can be unit-tested without a live
|
|
17
|
-
// facilitator or network: see verify.js.
|
|
18
|
-
|
|
19
|
-
const crypto = require("crypto");
|
|
20
|
-
|
|
21
|
-
// x402 A2A extension URI (declared in the agent card capabilities.extensions).
|
|
22
|
-
const X402_EXTENSION_URI = "https://github.com/google-a2a/a2a-x402/tree/main/spec/v0.1";
|
|
23
|
-
|
|
24
|
-
// Metadata keys defined by the x402 A2A extension.
|
|
25
|
-
const META_STATUS = "x402.payment.status";
|
|
26
|
-
const META_REQUIRED = "x402.payment.required";
|
|
27
|
-
const META_PAYLOAD = "x402.payment.payload";
|
|
28
|
-
const META_RECEIPTS = "x402.payment.receipts";
|
|
29
|
-
const META_ERROR = "x402.payment.error";
|
|
30
|
-
|
|
31
|
-
function uuid() {
|
|
32
|
-
return crypto.randomUUID();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function jsonrpcResult(id, result) {
|
|
36
|
-
return { jsonrpc: "2.0", id: typeof id === "undefined" ? null : id, result };
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function jsonrpcError(id, code, message, data) {
|
|
40
|
-
return {
|
|
41
|
-
jsonrpc: "2.0",
|
|
42
|
-
id: typeof id === "undefined" ? null : id,
|
|
43
|
-
error: { code, message, ...(typeof data === "undefined" ? {} : { data }) }
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function agentMessage(text, metadata) {
|
|
48
|
-
return {
|
|
49
|
-
role: "agent",
|
|
50
|
-
kind: "message",
|
|
51
|
-
messageId: uuid(),
|
|
52
|
-
parts: [{ kind: "text", text }],
|
|
53
|
-
...(metadata ? { metadata } : {})
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function paymentRequiredTask({ taskId, contextId, accepts, skillTaskRef }) {
|
|
58
|
-
return {
|
|
59
|
-
id: taskId,
|
|
60
|
-
contextId,
|
|
61
|
-
kind: "task",
|
|
62
|
-
status: {
|
|
63
|
-
state: "input-required",
|
|
64
|
-
message: agentMessage(
|
|
65
|
-
`Payment required to run "${skillTaskRef}". Re-send message/send with the signed x402 authorization in metadata["${META_PAYLOAD}"].`,
|
|
66
|
-
{
|
|
67
|
-
[META_STATUS]: "payment-required",
|
|
68
|
-
[META_REQUIRED]: { x402Version: 2, scheme: "exact", accepts }
|
|
69
|
-
}
|
|
70
|
-
),
|
|
71
|
-
timestamp: new Date().toISOString()
|
|
72
|
-
},
|
|
73
|
-
artifacts: [],
|
|
74
|
-
history: []
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function failedTask({ taskId, contextId, paymentStatus, error }) {
|
|
79
|
-
return {
|
|
80
|
-
id: taskId,
|
|
81
|
-
contextId,
|
|
82
|
-
kind: "task",
|
|
83
|
-
status: {
|
|
84
|
-
state: "failed",
|
|
85
|
-
message: agentMessage(`Payment ${paymentStatus}: ${error || "error"}`, {
|
|
86
|
-
[META_STATUS]: paymentStatus,
|
|
87
|
-
[META_ERROR]: error || null
|
|
88
|
-
}),
|
|
89
|
-
timestamp: new Date().toISOString()
|
|
90
|
-
},
|
|
91
|
-
artifacts: [],
|
|
92
|
-
history: []
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function completedTask({ taskId, contextId, resultPayload, settlement }) {
|
|
97
|
-
return {
|
|
98
|
-
id: taskId,
|
|
99
|
-
contextId,
|
|
100
|
-
kind: "task",
|
|
101
|
-
status: {
|
|
102
|
-
state: "completed",
|
|
103
|
-
message: agentMessage("Completed and settled.", {
|
|
104
|
-
[META_STATUS]: "payment-completed",
|
|
105
|
-
[META_RECEIPTS]: [settlement]
|
|
106
|
-
}),
|
|
107
|
-
timestamp: new Date().toISOString()
|
|
108
|
-
},
|
|
109
|
-
artifacts: [
|
|
110
|
-
{
|
|
111
|
-
artifactId: uuid(),
|
|
112
|
-
name: "result",
|
|
113
|
-
parts: [{ kind: "data", data: resultPayload }]
|
|
114
|
-
}
|
|
115
|
-
],
|
|
116
|
-
history: []
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Pull the task reference + body an agent wants to run out of the A2A message.
|
|
121
|
-
// Accepts an explicit `task_ref`/`skill_id`/`skill` in message.metadata, plus a
|
|
122
|
-
// params/body object (metadata.params | metadata.body | a DataPart's data).
|
|
123
|
-
function resolveSkill(message) {
|
|
124
|
-
const meta = (message && message.metadata) || {};
|
|
125
|
-
const skillTaskRef = String(meta.task_ref || meta.skill_id || meta.skill || "a2a.negotiate");
|
|
126
|
-
let body = meta.params || meta.body || null;
|
|
127
|
-
if (!body && message && Array.isArray(message.parts)) {
|
|
128
|
-
const dataPart = message.parts.find((p) => p && p.kind === "data" && p.data && typeof p.data === "object");
|
|
129
|
-
if (dataPart) body = dataPart.data;
|
|
130
|
-
}
|
|
131
|
-
return { skillTaskRef, body: body && typeof body === "object" ? body : {} };
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Handle a single `message/send` call. Returns { http, headers, body }.
|
|
135
|
-
// `ctx` = { config, resourceUrl, deps } where deps has the injected runtime
|
|
136
|
-
// functions (facilitator factory, verify/settle, receipt encoder, authorized
|
|
137
|
-
// executor, task-payload builder, and `state`).
|
|
138
|
-
async function handleMessageSend(rpc, ctx) {
|
|
139
|
-
const id = rpc.id;
|
|
140
|
-
const params = rpc.params || {};
|
|
141
|
-
const message = params.message || {};
|
|
142
|
-
const meta = message.metadata || {};
|
|
143
|
-
|
|
144
|
-
const config = ctx.config || {};
|
|
145
|
-
const x402 = config.x402 || {};
|
|
146
|
-
const accepts = Array.isArray(x402.accepts) ? x402.accepts : [];
|
|
147
|
-
|
|
148
|
-
if (config.verification_mode !== "x402_facilitator") {
|
|
149
|
-
return { http: 200, body: jsonrpcError(id, -32010, "x402 settlement is not enabled on this runtime") };
|
|
150
|
-
}
|
|
151
|
-
if (!accepts.length) {
|
|
152
|
-
return { http: 200, body: jsonrpcError(id, -32011, "x402 accepts are not configured") };
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const taskId = uuid();
|
|
156
|
-
const contextId = message.contextId || message.taskId || uuid();
|
|
157
|
-
const { skillTaskRef, body } = resolveSkill(message);
|
|
158
|
-
|
|
159
|
-
// Never ask for (or take) payment for a skill nothing can execute.
|
|
160
|
-
const taskPayloadDraft = ctx.deps.buildNamedTaskPayload(skillTaskRef, body, skillTaskRef);
|
|
161
|
-
const executability = typeof ctx.deps.assessExecutability === "function" ? ctx.deps.assessExecutability(taskPayloadDraft) : { ok: true };
|
|
162
|
-
if (!executability.ok) {
|
|
163
|
-
const refusal = executability.payload || {};
|
|
164
|
-
return {
|
|
165
|
-
http: 200,
|
|
166
|
-
body: jsonrpcResult(id, failedTask({
|
|
167
|
-
taskId,
|
|
168
|
-
contextId,
|
|
169
|
-
paymentStatus: "not-required",
|
|
170
|
-
error: `${refusal.reason || "capability_not_executable"}: ${refusal.detail || "this skill cannot run here"}${Array.isArray(refusal.executable_task_refs) ? ` Executable: ${refusal.executable_task_refs.join(", ")}.` : ""}`
|
|
171
|
-
}))
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
const payload = meta[META_PAYLOAD];
|
|
176
|
-
if (!payload) {
|
|
177
|
-
// In-band 402: Task(input-required) carrying the x402 requirements.
|
|
178
|
-
return {
|
|
179
|
-
http: 200,
|
|
180
|
-
body: jsonrpcResult(id, paymentRequiredTask({ taskId, contextId, accepts, skillTaskRef }))
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// Payment present: verify + settle via the same facilitator path as the HTTP routes.
|
|
185
|
-
const facilitator = ctx.deps.createFacilitator({
|
|
186
|
-
url: x402.facilitator_url,
|
|
187
|
-
headers: x402.facilitator_headers,
|
|
188
|
-
timeoutMs: x402.facilitator_timeout_ms,
|
|
189
|
-
cdp: x402.cdp
|
|
190
|
-
});
|
|
191
|
-
const paymentHeader =
|
|
192
|
-
typeof payload === "string" ? payload : Buffer.from(JSON.stringify(payload), "utf8").toString("base64");
|
|
193
|
-
|
|
194
|
-
const auth = await ctx.deps.verifyX402Payment({
|
|
195
|
-
paymentHeader,
|
|
196
|
-
accepts,
|
|
197
|
-
resourceUrl: ctx.resourceUrl || null,
|
|
198
|
-
facilitator
|
|
199
|
-
});
|
|
200
|
-
if (!auth.ok) {
|
|
201
|
-
return {
|
|
202
|
-
http: 200,
|
|
203
|
-
body: jsonrpcResult(id, failedTask({ taskId, contextId, paymentStatus: "payment-rejected", error: auth.detail || auth.reason }))
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const requirements = (auth.authorization && auth.authorization.paymentRequirements) || {};
|
|
208
|
-
const requestPayload = {
|
|
209
|
-
...ctx.deps.buildNamedTaskPayload(skillTaskRef, body, skillTaskRef),
|
|
210
|
-
payment_protocol: "x402"
|
|
211
|
-
};
|
|
212
|
-
const authorizationContext = {
|
|
213
|
-
verification_mode: "x402_facilitator",
|
|
214
|
-
wallet_id: (auth.authorization && auth.authorization.payer) || "x402_payer",
|
|
215
|
-
payment_payload: {
|
|
216
|
-
x402_payer: (auth.authorization && auth.authorization.payer) || null,
|
|
217
|
-
x402_network: requirements.network || null,
|
|
218
|
-
x402_asset: requirements.asset || null,
|
|
219
|
-
x402_amount: requirements.amount || null
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
// Verify -> execute -> settle: the payment is only settled once the skill has produced its
|
|
224
|
-
// result, so a failed skill never charges the paying agent.
|
|
225
|
-
const exec = await ctx.deps.executeAuthorized(ctx.deps.state, requestPayload, authorizationContext);
|
|
226
|
-
const execOk = Boolean(exec) && exec.status === 200 && (!exec.payload || exec.payload.ok !== false);
|
|
227
|
-
if (!execOk) {
|
|
228
|
-
const reason = (exec && exec.payload && exec.payload.reason) || "execution_failed";
|
|
229
|
-
return {
|
|
230
|
-
http: 200,
|
|
231
|
-
body: jsonrpcResult(id, failedTask({ taskId, contextId, paymentStatus: "not-charged", error: `${reason}: the skill did not run, so the payment was not settled — retry` }))
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
let settled = await ctx.deps.settleX402Payment({ authorization: auth.authorization, facilitator, settle: x402.settle });
|
|
236
|
-
if (!settled.ok && settled.reason === "facilitator_unreachable" && typeof ctx.deps.confirmAuthorizationUsed === "function") {
|
|
237
|
-
// The facilitator may have broadcast before timing out: if the authorization is used on-chain, it settled.
|
|
238
|
-
const signed = auth.authorization && auth.authorization.paymentPayload && auth.authorization.paymentPayload.payload
|
|
239
|
-
&& auth.authorization.paymentPayload.payload.authorization;
|
|
240
|
-
const used = signed ? await ctx.deps.confirmAuthorizationUsed({ network: requirements.network, asset: requirements.asset, authorizer: signed.from, nonce: signed.nonce }) : null;
|
|
241
|
-
if (used === true) {
|
|
242
|
-
settled = { ok: true, settlement: { success: true, transaction: null, network: requirements.network, payer: signed.from, recovered_from: "authorization_state" } };
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
if (!settled.ok) {
|
|
246
|
-
return {
|
|
247
|
-
http: 200,
|
|
248
|
-
body: jsonrpcResult(id, failedTask({ taskId, contextId, paymentStatus: "payment-failed", error: `${settled.detail || settled.reason} (the result was withheld; if this payment later shows as settled on-chain, contact us with the payment nonce)` }))
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
const receipt = ctx.deps.encodeReceipt(settled.settlement);
|
|
252
|
-
const task = completedTask({ taskId, contextId, resultPayload: exec.payload, settlement: settled.settlement });
|
|
253
|
-
return {
|
|
254
|
-
http: 200,
|
|
255
|
-
headers: { "PAYMENT-RESPONSE": receipt, "Cache-Control": "no-store" },
|
|
256
|
-
body: jsonrpcResult(id, task)
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
// Top-level JSON-RPC dispatcher for POST /v1/a2a.
|
|
261
|
-
async function handleA2ARpc(rpc, ctx) {
|
|
262
|
-
if (!rpc || typeof rpc !== "object" || Array.isArray(rpc)) {
|
|
263
|
-
return { http: 200, body: jsonrpcError(null, -32600, "Invalid Request: expected a single JSON-RPC 2.0 object") };
|
|
264
|
-
}
|
|
265
|
-
if (rpc.jsonrpc !== "2.0") {
|
|
266
|
-
return { http: 200, body: jsonrpcError(rpc.id, -32600, "Invalid Request: jsonrpc must be \"2.0\"") };
|
|
267
|
-
}
|
|
268
|
-
if (rpc.method === "message/send") {
|
|
269
|
-
return handleMessageSend(rpc, ctx);
|
|
270
|
-
}
|
|
271
|
-
if (rpc.method === "message/stream") {
|
|
272
|
-
return { http: 200, body: jsonrpcError(rpc.id, -32004, "Streaming is not supported by this agent (capabilities.streaming=false)") };
|
|
273
|
-
}
|
|
274
|
-
return { http: 200, body: jsonrpcError(rpc.id, -32601, `Method not found: ${rpc.method}`) };
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
module.exports = {
|
|
278
|
-
handleA2ARpc,
|
|
279
|
-
handleMessageSend,
|
|
280
|
-
resolveSkill,
|
|
281
|
-
X402_EXTENSION_URI,
|
|
282
|
-
META_STATUS,
|
|
283
|
-
META_REQUIRED,
|
|
284
|
-
META_PAYLOAD,
|
|
285
|
-
META_RECEIPTS,
|
|
286
|
-
META_ERROR
|
|
287
|
-
};
|
package/lib/a2c_lane_contract.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
buildDefaultTransactionTaskPackCatalog,
|
|
5
|
-
buildDefaultTransactionGuidedLoopCatalog,
|
|
6
|
-
buildPrecommitInteractionPackCatalog,
|
|
7
|
-
buildInteractionSpinePathCatalog,
|
|
8
|
-
summarizeDefaultTransactionTaskPacks,
|
|
9
|
-
summarizeDefaultTransactionGuidedLoops,
|
|
10
|
-
summarizePrecommitInteractionPacks,
|
|
11
|
-
summarizeInteractionSpinePaths,
|
|
12
|
-
buildDefaultTransactionCenter,
|
|
13
|
-
summarizeDefaultTransactionCenter
|
|
14
|
-
} = require("./catalog_contract");
|
|
15
|
-
|
|
16
|
-
function buildA2CLanePack() {
|
|
17
|
-
const center = buildDefaultTransactionCenter();
|
|
18
|
-
const centerSummary = summarizeDefaultTransactionCenter();
|
|
19
|
-
const taskPackCatalog = buildDefaultTransactionTaskPackCatalog();
|
|
20
|
-
const guidedLoopCatalog = buildDefaultTransactionGuidedLoopCatalog();
|
|
21
|
-
const precommitCatalog = buildPrecommitInteractionPackCatalog();
|
|
22
|
-
const spineCatalog = buildInteractionSpinePathCatalog();
|
|
23
|
-
|
|
24
|
-
const taskPacks = Array.isArray(taskPackCatalog.packs) ? taskPackCatalog.packs : [];
|
|
25
|
-
const guidedLoops = Array.isArray(guidedLoopCatalog.loops) ? guidedLoopCatalog.loops : [];
|
|
26
|
-
const precommitPacks = Array.isArray(precommitCatalog.packs) ? precommitCatalog.packs : [];
|
|
27
|
-
const spinePaths = Array.isArray(spineCatalog.paths) ? spineCatalog.paths : [];
|
|
28
|
-
|
|
29
|
-
const defaultTaskPack = taskPacks.find((entry) => entry.pack_ref === "default.a2c.tooling.run") || null;
|
|
30
|
-
const defaultGuidedLoop = guidedLoops.find((entry) => entry.loop_ref === "default.a2c.tooling.loop") || null;
|
|
31
|
-
const readinessPack = precommitPacks.find((entry) => entry.precommit_pack_ref === "precommit.a2c.tooling.readiness") || null;
|
|
32
|
-
const toolingSpine = spinePaths.find((entry) => entry.spine_path_ref === "spine.a2c.tooling") || null;
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
product: "xytara",
|
|
36
|
-
category: "machine-commerce-a2c-lane-pack",
|
|
37
|
-
pack_version: "xytara-a2c-lane-pack-v1",
|
|
38
|
-
lane_state: "first_party_a2c_present",
|
|
39
|
-
default_protocol: "a2c",
|
|
40
|
-
default_payment_protocol: centerSummary.default_payment_protocol,
|
|
41
|
-
default_settlement_mode: centerSummary.default_settlement_mode,
|
|
42
|
-
default_transaction_center: center,
|
|
43
|
-
default_task_pack: defaultTaskPack,
|
|
44
|
-
default_guided_loop: defaultGuidedLoop,
|
|
45
|
-
readiness_pack: readinessPack,
|
|
46
|
-
tooling_spine: toolingSpine,
|
|
47
|
-
task_pack_summary: summarizeDefaultTransactionTaskPacks(),
|
|
48
|
-
guided_loop_summary: summarizeDefaultTransactionGuidedLoops(),
|
|
49
|
-
precommit_summary: summarizePrecommitInteractionPacks(),
|
|
50
|
-
spine_summary: summarizeInteractionSpinePaths(),
|
|
51
|
-
first_run_flows: [
|
|
52
|
-
{
|
|
53
|
-
flow_ref: "precommit.a2c.tooling.readiness",
|
|
54
|
-
recommended_reason: "best first A2C readiness and session-preview path",
|
|
55
|
-
example_surfaces: {
|
|
56
|
-
session_open_ref: "/v1/a2c/sessions/open",
|
|
57
|
-
pack_preview_ref: "/v1/a2c/packs/preview",
|
|
58
|
-
admission_preview_ref: "/v1/admission/preview"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
flow_ref: "default.a2c.tooling.run",
|
|
63
|
-
recommended_reason: "best first committed A2C-to-MCP tooling path",
|
|
64
|
-
example_surfaces: {
|
|
65
|
-
lane_ref: "/v1/a2c",
|
|
66
|
-
tooling_flow_ref: "/v1/a2c/flows/tooling",
|
|
67
|
-
mcp_lane_ref: "/v1/mcp"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
supported_surfaces: {
|
|
72
|
-
session_open_ref: "/v1/a2c/sessions/open",
|
|
73
|
-
pack_preview_ref: "/v1/a2c/packs/preview",
|
|
74
|
-
tooling_flow_ref: "/v1/a2c/flows/tooling",
|
|
75
|
-
admission_preview_ref: "/v1/admission/preview",
|
|
76
|
-
mcp_lane_ref: "/v1/mcp",
|
|
77
|
-
auth_profile_ref: "/v1/auth-profiles",
|
|
78
|
-
openapi_ref: "/openapi.json",
|
|
79
|
-
asyncapi_ref: "/asyncapi.json",
|
|
80
|
-
cloudevents_ref: "/cloudevents.json"
|
|
81
|
-
},
|
|
82
|
-
recommended_sequence: [
|
|
83
|
-
"open_a2c_session",
|
|
84
|
-
"preview_a2c_pack",
|
|
85
|
-
"inspect_admission_posture",
|
|
86
|
-
"run_default_a2c_tooling_flow",
|
|
87
|
-
"invoke_the_underlying_mcp_tool_path",
|
|
88
|
-
"inspect_transaction_and_proof_followthrough"
|
|
89
|
-
]
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function summarizeA2CLanePack() {
|
|
94
|
-
const pack = buildA2CLanePack();
|
|
95
|
-
return {
|
|
96
|
-
product: "xytara",
|
|
97
|
-
category: "machine-commerce-a2c-lane-pack-summary",
|
|
98
|
-
summary_version: "xytara-a2c-lane-pack-summary-v1",
|
|
99
|
-
lane_state: pack.lane_state,
|
|
100
|
-
default_payment_protocol: pack.default_payment_protocol,
|
|
101
|
-
default_settlement_mode: pack.default_settlement_mode,
|
|
102
|
-
first_run_flow_count: pack.first_run_flows.length,
|
|
103
|
-
default_task_pack_ref: pack.default_task_pack ? pack.default_task_pack.pack_ref : null,
|
|
104
|
-
linked_surfaces: pack.supported_surfaces
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
module.exports = {
|
|
109
|
-
buildA2CLanePack,
|
|
110
|
-
summarizeA2CLanePack
|
|
111
|
-
};
|