xytara 2.1.0 → 2.3.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 (163) hide show
  1. package/.env.example +5 -1
  2. package/ADAPTER_START_HERE.md +56 -0
  3. package/CARRIED_HANDOFF_DEMO.md +60 -0
  4. package/EXAMPLE_PATHS.md +53 -0
  5. package/OPERATIONS_RUNBOOK.md +65 -0
  6. package/OPERATOR_START_HERE.md +63 -0
  7. package/PARTNER_READY_PATH.md +71 -0
  8. package/PROGRAM_COMPLETE_RELEASE.md +63 -0
  9. package/PROGRAM_STATUS.md +57 -0
  10. package/PUBLIC_DEMO_SCRIPT.md +78 -0
  11. package/PUBLISH_PLAN.md +7 -5
  12. package/README.md +66 -0
  13. package/RELEASE_CHECKLIST.md +8 -2
  14. package/RELEASE_NOTES.md +19 -8
  15. package/START_HERE.md +32 -0
  16. package/SUPABASE_RUNTIME_STATE_SETUP.md +61 -0
  17. package/WHY_XYTARA_XOONYA.md +63 -0
  18. package/adapters/examples/minimal-third-party-execution-adapter.js +61 -0
  19. package/adapters/examples/minimal-third-party-execution-adapter.manifest.json +79 -0
  20. package/adapters/examples/minimal-third-party-execution-registration.record.json +26 -0
  21. package/adapters/examples/minimal-third-party-execution.certification-pack.json +22 -0
  22. package/adapters/examples/minimal-third-party-execution.submission-bundle.json +126 -0
  23. package/bin/xytara-release.js +1251 -1
  24. package/examples/adapter_review_walkthrough.js +53 -0
  25. package/examples/export_carried_handoff.js +80 -0
  26. package/examples/funded_runtime_walkthrough.js +70 -0
  27. package/examples/partner_launch_walkthrough.js +43 -0
  28. package/examples/quickstart.js +3255 -0
  29. package/index.js +7 -1
  30. package/lib/adapter_pack.js +118 -0
  31. package/lib/adapter_partner_pack.js +89 -0
  32. package/lib/adapter_promotion_pack.js +89 -0
  33. package/lib/commerce_client.js +38 -0
  34. package/lib/commerce_economics.js +304 -0
  35. package/lib/operator_intelligence.js +90 -0
  36. package/lib/outreach_copy_pack.js +51 -0
  37. package/lib/outreach_message_pack.js +71 -0
  38. package/lib/outreach_target_pack.js +60 -0
  39. package/lib/partner_intelligence.js +105 -0
  40. package/lib/phase_10_closeout_pack.js +45 -0
  41. package/lib/phase_10_completion_pack.js +76 -0
  42. package/lib/phase_10_decision_record_pack.js +54 -0
  43. package/lib/phase_10_decision_resolution_pack.js +53 -0
  44. package/lib/phase_10_demand_signal_adapters_runtime_pack.js +74 -0
  45. package/lib/phase_10_ecosystem_backlog_triage_runtime_pack.js +74 -0
  46. package/lib/phase_10_freeze_baseline_pack.js +67 -0
  47. package/lib/phase_10_freeze_review_pack.js +64 -0
  48. package/lib/phase_10_gate_pack.js +57 -0
  49. package/lib/phase_10_long_tail_continuity_pack.js +80 -0
  50. package/lib/phase_10_long_tail_ecosystem_pack.js +66 -0
  51. package/lib/phase_10_niche_extension_registry_runtime_pack.js +74 -0
  52. package/lib/phase_1_claude_mcp_pack.js +60 -0
  53. package/lib/phase_1_claude_mcp_runtime_pack.js +52 -0
  54. package/lib/phase_1_ecosystem_pack.js +67 -0
  55. package/lib/phase_1_openai_codex_pack.js +60 -0
  56. package/lib/phase_1_openai_codex_runtime_pack.js +52 -0
  57. package/lib/phase_2_base_runtime_pack.js +71 -0
  58. package/lib/phase_2_base_usdc_runtime_pack.js +72 -0
  59. package/lib/phase_2_closeout_pack.js +65 -0
  60. package/lib/phase_2_completion_pack.js +113 -0
  61. package/lib/phase_2_decision_record_pack.js +66 -0
  62. package/lib/phase_2_decision_resolution_pack.js +69 -0
  63. package/lib/phase_2_eth_runtime_pack.js +70 -0
  64. package/lib/phase_2_evm_base_runtime_pack.js +73 -0
  65. package/lib/phase_2_evm_runtime_pack.js +71 -0
  66. package/lib/phase_2_flip_preview_pack.js +60 -0
  67. package/lib/phase_2_freeze_review_pack.js +99 -0
  68. package/lib/phase_2_gate_pack.js +77 -0
  69. package/lib/phase_2_payment_rails_pack.js +71 -0
  70. package/lib/phase_2_usdc_runtime_pack.js +71 -0
  71. package/lib/phase_3_brc_runtime_pack.js +81 -0
  72. package/lib/phase_3_bsv_teranode_runtime_pack.js +83 -0
  73. package/lib/phase_3_closeout_pack.js +62 -0
  74. package/lib/phase_3_completion_pack.js +94 -0
  75. package/lib/phase_3_decision_record_pack.js +64 -0
  76. package/lib/phase_3_decision_resolution_pack.js +69 -0
  77. package/lib/phase_3_freeze_baseline_pack.js +67 -0
  78. package/lib/phase_3_freeze_review_pack.js +80 -0
  79. package/lib/phase_3_gate_pack.js +76 -0
  80. package/lib/phase_3_metanet_runtime_pack.js +81 -0
  81. package/lib/phase_3_native_bsv_pack.js +91 -0
  82. package/lib/phase_3_native_continuity_pack.js +82 -0
  83. package/lib/phase_4_attestation_runtime_pack.js +75 -0
  84. package/lib/phase_4_closeout_pack.js +45 -0
  85. package/lib/phase_4_completion_pack.js +94 -0
  86. package/lib/phase_4_decision_record_pack.js +54 -0
  87. package/lib/phase_4_decision_resolution_pack.js +45 -0
  88. package/lib/phase_4_erc8004_runtime_pack.js +76 -0
  89. package/lib/phase_4_freeze_baseline_pack.js +67 -0
  90. package/lib/phase_4_freeze_review_pack.js +68 -0
  91. package/lib/phase_4_gate_pack.js +58 -0
  92. package/lib/phase_4_identity_registry_runtime_pack.js +75 -0
  93. package/lib/phase_4_identity_trust_pack.js +73 -0
  94. package/lib/phase_4_trust_continuity_pack.js +86 -0
  95. package/lib/phase_5_antelope_runtime_pack.js +76 -0
  96. package/lib/phase_5_closeout_pack.js +44 -0
  97. package/lib/phase_5_completion_pack.js +82 -0
  98. package/lib/phase_5_decision_record_pack.js +54 -0
  99. package/lib/phase_5_decision_resolution_pack.js +45 -0
  100. package/lib/phase_5_freeze_baseline_pack.js +67 -0
  101. package/lib/phase_5_freeze_review_pack.js +68 -0
  102. package/lib/phase_5_gate_pack.js +58 -0
  103. package/lib/phase_5_major_rails_continuity_pack.js +86 -0
  104. package/lib/phase_5_major_rails_pack.js +74 -0
  105. package/lib/phase_5_proton_xpr_runtime_pack.js +76 -0
  106. package/lib/phase_5_solana_runtime_pack.js +76 -0
  107. package/lib/phase_6_autogen_runtime_pack.js +72 -0
  108. package/lib/phase_6_closeout_pack.js +46 -0
  109. package/lib/phase_6_completion_pack.js +77 -0
  110. package/lib/phase_6_decision_record_pack.js +54 -0
  111. package/lib/phase_6_decision_resolution_pack.js +53 -0
  112. package/lib/phase_6_framework_continuity_pack.js +81 -0
  113. package/lib/phase_6_framework_runtime_pack.js +68 -0
  114. package/lib/phase_6_freeze_baseline_pack.js +68 -0
  115. package/lib/phase_6_freeze_review_pack.js +65 -0
  116. package/lib/phase_6_gate_pack.js +59 -0
  117. package/lib/phase_6_langchain_runtime_pack.js +72 -0
  118. package/lib/phase_6_langgraph_runtime_pack.js +72 -0
  119. package/lib/phase_6_semantic_kernel_runtime_pack.js +72 -0
  120. package/lib/phase_7_closeout_pack.js +45 -0
  121. package/lib/phase_7_completion_pack.js +85 -0
  122. package/lib/phase_7_decision_record_pack.js +53 -0
  123. package/lib/phase_7_decision_resolution_pack.js +53 -0
  124. package/lib/phase_7_event_system_continuity_pack.js +89 -0
  125. package/lib/phase_7_event_system_pack.js +76 -0
  126. package/lib/phase_7_freeze_baseline_pack.js +74 -0
  127. package/lib/phase_7_freeze_review_pack.js +65 -0
  128. package/lib/phase_7_gate_pack.js +58 -0
  129. package/lib/phase_7_kafka_runtime_pack.js +74 -0
  130. package/lib/phase_7_mqtt_runtime_pack.js +74 -0
  131. package/lib/phase_7_nats_runtime_pack.js +74 -0
  132. package/lib/phase_7_webhook_event_bus_runtime_pack.js +74 -0
  133. package/lib/phase_8_closeout_pack.js +46 -0
  134. package/lib/phase_8_completion_pack.js +82 -0
  135. package/lib/phase_8_decision_record_pack.js +54 -0
  136. package/lib/phase_8_decision_resolution_pack.js +53 -0
  137. package/lib/phase_8_external_receipt_import_runtime_pack.js +74 -0
  138. package/lib/phase_8_external_result_import_runtime_pack.js +74 -0
  139. package/lib/phase_8_freeze_baseline_pack.js +71 -0
  140. package/lib/phase_8_freeze_review_pack.js +64 -0
  141. package/lib/phase_8_gate_pack.js +58 -0
  142. package/lib/phase_8_proof_bridge_continuity_pack.js +86 -0
  143. package/lib/phase_8_proof_bridges_pack.js +72 -0
  144. package/lib/phase_8_proof_bundle_normalization_runtime_pack.js +74 -0
  145. package/lib/phase_9_closeout_pack.js +46 -0
  146. package/lib/phase_9_completion_pack.js +82 -0
  147. package/lib/phase_9_custody_refs_runtime_pack.js +74 -0
  148. package/lib/phase_9_decision_record_pack.js +54 -0
  149. package/lib/phase_9_decision_resolution_pack.js +53 -0
  150. package/lib/phase_9_freeze_baseline_pack.js +71 -0
  151. package/lib/phase_9_freeze_review_pack.js +64 -0
  152. package/lib/phase_9_gate_pack.js +58 -0
  153. package/lib/phase_9_operator_accounting_bridges_runtime_pack.js +74 -0
  154. package/lib/phase_9_treasury_connectivity_pack.js +72 -0
  155. package/lib/phase_9_treasury_continuity_pack.js +86 -0
  156. package/lib/phase_9_treasury_destinations_runtime_pack.js +74 -0
  157. package/lib/phase_program_pack.js +120 -0
  158. package/lib/release_center.js +970 -0
  159. package/lib/release_history.js +1 -1
  160. package/lib/runtime_state_store.js +212 -27
  161. package/lib/soft_launch_pack.js +78 -0
  162. package/package.json +13 -1
  163. package/server.js +2110 -235
package/server.js CHANGED
@@ -64,6 +64,10 @@ const {
64
64
  previewRailCredits,
65
65
  applyRailCredits,
66
66
  buildCreditBalanceSummary,
67
+ buildWalletSummary,
68
+ buildWalletLedgerSummary,
69
+ buildEconomicsIntelligenceSummary,
70
+ buildTreasuryIntelligenceSummary,
67
71
  buildTreasurySummary,
68
72
  buildLedgerExport,
69
73
  buildTreasuryDrilldown,
@@ -230,6 +234,42 @@ const {
230
234
  buildReleaseHistory,
231
235
  summarizeReleaseHistory
232
236
  } = require("./lib/release_history");
237
+ const {
238
+ buildAdapterPack,
239
+ summarizeAdapterPack
240
+ } = require("./lib/adapter_pack");
241
+ const {
242
+ buildAdapterPromotionPack,
243
+ summarizeAdapterPromotionPack
244
+ } = require("./lib/adapter_promotion_pack");
245
+ const {
246
+ buildAdapterPartnerPack,
247
+ summarizeAdapterPartnerPack
248
+ } = require("./lib/adapter_partner_pack");
249
+ const {
250
+ buildPartnerIntelligencePack,
251
+ summarizePartnerIntelligencePack
252
+ } = require("./lib/partner_intelligence");
253
+ const {
254
+ buildOperatorIntelligencePack,
255
+ summarizeOperatorIntelligencePack
256
+ } = require("./lib/operator_intelligence");
257
+ const {
258
+ buildSoftLaunchPack,
259
+ summarizeSoftLaunchPack
260
+ } = require("./lib/soft_launch_pack");
261
+ const {
262
+ buildOutreachCopyPack,
263
+ summarizeOutreachCopyPack
264
+ } = require("./lib/outreach_copy_pack");
265
+ const {
266
+ buildOutreachTargetPack,
267
+ summarizeOutreachTargetPack
268
+ } = require("./lib/outreach_target_pack");
269
+ const {
270
+ buildOutreachMessagePack,
271
+ summarizeOutreachMessagePack
272
+ } = require("./lib/outreach_message_pack");
233
273
  const {
234
274
  buildPublishPlan,
235
275
  summarizePublishPlan
@@ -254,6 +294,478 @@ const {
254
294
  buildReleaseCandidatePack,
255
295
  summarizeReleaseCandidatePack
256
296
  } = require("./lib/release_candidate");
297
+ const {
298
+ buildPhaseProgramPack,
299
+ summarizePhaseProgramPack
300
+ } = require("./lib/phase_program_pack");
301
+ const {
302
+ buildPhase1EcosystemPack,
303
+ summarizePhase1EcosystemPack
304
+ } = require("./lib/phase_1_ecosystem_pack");
305
+ const {
306
+ buildPhase1OpenaiCodexPack,
307
+ summarizePhase1OpenaiCodexPack
308
+ } = require("./lib/phase_1_openai_codex_pack");
309
+ const {
310
+ buildPhase1ClaudeMcpPack,
311
+ summarizePhase1ClaudeMcpPack
312
+ } = require("./lib/phase_1_claude_mcp_pack");
313
+ const {
314
+ buildPhase1OpenaiCodexRuntimePack,
315
+ summarizePhase1OpenaiCodexRuntimePack
316
+ } = require("./lib/phase_1_openai_codex_runtime_pack");
317
+ const {
318
+ buildPhase1ClaudeMcpRuntimePack,
319
+ summarizePhase1ClaudeMcpRuntimePack
320
+ } = require("./lib/phase_1_claude_mcp_runtime_pack");
321
+ const {
322
+ buildPhase2PaymentRailsPack,
323
+ summarizePhase2PaymentRailsPack
324
+ } = require("./lib/phase_2_payment_rails_pack");
325
+ const {
326
+ buildPhase2EvmBaseRuntimePack,
327
+ summarizePhase2EvmBaseRuntimePack
328
+ } = require("./lib/phase_2_evm_base_runtime_pack");
329
+ const {
330
+ buildPhase2BaseUsdcRuntimePack,
331
+ summarizePhase2BaseUsdcRuntimePack
332
+ } = require("./lib/phase_2_base_usdc_runtime_pack");
333
+ const {
334
+ buildPhase2EthRuntimePack,
335
+ summarizePhase2EthRuntimePack
336
+ } = require("./lib/phase_2_eth_runtime_pack");
337
+ const {
338
+ buildPhase2EvmRuntimePack,
339
+ summarizePhase2EvmRuntimePack
340
+ } = require("./lib/phase_2_evm_runtime_pack");
341
+ const {
342
+ buildPhase2BaseRuntimePack,
343
+ summarizePhase2BaseRuntimePack
344
+ } = require("./lib/phase_2_base_runtime_pack");
345
+ const {
346
+ buildPhase2UsdcRuntimePack,
347
+ summarizePhase2UsdcRuntimePack
348
+ } = require("./lib/phase_2_usdc_runtime_pack");
349
+ const {
350
+ buildPhase2CompletionPack,
351
+ summarizePhase2CompletionPack
352
+ } = require("./lib/phase_2_completion_pack");
353
+ const {
354
+ buildPhase2FreezeReviewPack,
355
+ summarizePhase2FreezeReviewPack
356
+ } = require("./lib/phase_2_freeze_review_pack");
357
+ const {
358
+ buildPhase2GatePack,
359
+ summarizePhase2GatePack
360
+ } = require("./lib/phase_2_gate_pack");
361
+ const {
362
+ buildPhase2CloseoutPack,
363
+ summarizePhase2CloseoutPack
364
+ } = require("./lib/phase_2_closeout_pack");
365
+ const {
366
+ buildPhase2DecisionRecordPack,
367
+ summarizePhase2DecisionRecordPack
368
+ } = require("./lib/phase_2_decision_record_pack");
369
+ const {
370
+ buildPhase2DecisionResolutionPack,
371
+ summarizePhase2DecisionResolutionPack
372
+ } = require("./lib/phase_2_decision_resolution_pack");
373
+ const {
374
+ buildPhase2FlipPreviewPack,
375
+ summarizePhase2FlipPreviewPack
376
+ } = require("./lib/phase_2_flip_preview_pack");
377
+ const {
378
+ buildPhase3NativeBsvPack,
379
+ summarizePhase3NativeBsvPack
380
+ } = require("./lib/phase_3_native_bsv_pack");
381
+ const {
382
+ buildPhase3BsvTeranodeRuntimePack,
383
+ summarizePhase3BsvTeranodeRuntimePack
384
+ } = require("./lib/phase_3_bsv_teranode_runtime_pack");
385
+ const {
386
+ buildPhase3MetanetRuntimePack,
387
+ summarizePhase3MetanetRuntimePack
388
+ } = require("./lib/phase_3_metanet_runtime_pack");
389
+ const {
390
+ buildPhase3BrcRuntimePack,
391
+ summarizePhase3BrcRuntimePack
392
+ } = require("./lib/phase_3_brc_runtime_pack");
393
+ const {
394
+ buildPhase3NativeContinuityPack,
395
+ summarizePhase3NativeContinuityPack
396
+ } = require("./lib/phase_3_native_continuity_pack");
397
+ const {
398
+ buildPhase3FreezeBaselinePack,
399
+ summarizePhase3FreezeBaselinePack
400
+ } = require("./lib/phase_3_freeze_baseline_pack");
401
+ const {
402
+ buildPhase4IdentityTrustPack,
403
+ summarizePhase4IdentityTrustPack
404
+ } = require("./lib/phase_4_identity_trust_pack");
405
+ const {
406
+ buildPhase4Erc8004RuntimePack,
407
+ summarizePhase4Erc8004RuntimePack
408
+ } = require("./lib/phase_4_erc8004_runtime_pack");
409
+ const {
410
+ buildPhase4IdentityRegistryRuntimePack,
411
+ summarizePhase4IdentityRegistryRuntimePack
412
+ } = require("./lib/phase_4_identity_registry_runtime_pack");
413
+ const {
414
+ buildPhase4AttestationRuntimePack,
415
+ summarizePhase4AttestationRuntimePack
416
+ } = require("./lib/phase_4_attestation_runtime_pack");
417
+ const {
418
+ buildPhase4TrustContinuityPack,
419
+ summarizePhase4TrustContinuityPack
420
+ } = require("./lib/phase_4_trust_continuity_pack");
421
+ const {
422
+ buildPhase4CompletionPack,
423
+ summarizePhase4CompletionPack
424
+ } = require("./lib/phase_4_completion_pack");
425
+ const {
426
+ buildPhase4FreezeReviewPack,
427
+ summarizePhase4FreezeReviewPack
428
+ } = require("./lib/phase_4_freeze_review_pack");
429
+ const {
430
+ buildPhase4FreezeBaselinePack,
431
+ summarizePhase4FreezeBaselinePack
432
+ } = require("./lib/phase_4_freeze_baseline_pack");
433
+ const {
434
+ buildPhase4GatePack,
435
+ summarizePhase4GatePack
436
+ } = require("./lib/phase_4_gate_pack");
437
+ const {
438
+ buildPhase4CloseoutPack,
439
+ summarizePhase4CloseoutPack
440
+ } = require("./lib/phase_4_closeout_pack");
441
+ const {
442
+ buildPhase4DecisionRecordPack,
443
+ summarizePhase4DecisionRecordPack
444
+ } = require("./lib/phase_4_decision_record_pack");
445
+ const {
446
+ buildPhase4DecisionResolutionPack,
447
+ summarizePhase4DecisionResolutionPack
448
+ } = require("./lib/phase_4_decision_resolution_pack");
449
+ const {
450
+ buildPhase5MajorRailsPack,
451
+ summarizePhase5MajorRailsPack
452
+ } = require("./lib/phase_5_major_rails_pack");
453
+ const {
454
+ buildPhase5MajorRailsContinuityPack,
455
+ summarizePhase5MajorRailsContinuityPack
456
+ } = require("./lib/phase_5_major_rails_continuity_pack");
457
+ const {
458
+ buildPhase5CompletionPack,
459
+ summarizePhase5CompletionPack
460
+ } = require("./lib/phase_5_completion_pack");
461
+ const {
462
+ buildPhase5FreezeReviewPack,
463
+ summarizePhase5FreezeReviewPack
464
+ } = require("./lib/phase_5_freeze_review_pack");
465
+ const {
466
+ buildPhase5FreezeBaselinePack,
467
+ summarizePhase5FreezeBaselinePack
468
+ } = require("./lib/phase_5_freeze_baseline_pack");
469
+ const {
470
+ buildPhase5GatePack,
471
+ summarizePhase5GatePack
472
+ } = require("./lib/phase_5_gate_pack");
473
+ const {
474
+ buildPhase5CloseoutPack,
475
+ summarizePhase5CloseoutPack
476
+ } = require("./lib/phase_5_closeout_pack");
477
+ const {
478
+ buildPhase5DecisionRecordPack,
479
+ summarizePhase5DecisionRecordPack
480
+ } = require("./lib/phase_5_decision_record_pack");
481
+ const {
482
+ buildPhase5DecisionResolutionPack,
483
+ summarizePhase5DecisionResolutionPack
484
+ } = require("./lib/phase_5_decision_resolution_pack");
485
+ const {
486
+ buildPhase5SolanaRuntimePack,
487
+ summarizePhase5SolanaRuntimePack
488
+ } = require("./lib/phase_5_solana_runtime_pack");
489
+ const {
490
+ buildPhase5AntelopeRuntimePack,
491
+ summarizePhase5AntelopeRuntimePack
492
+ } = require("./lib/phase_5_antelope_runtime_pack");
493
+ const {
494
+ buildPhase5ProtonXprRuntimePack,
495
+ summarizePhase5ProtonXprRuntimePack
496
+ } = require("./lib/phase_5_proton_xpr_runtime_pack");
497
+ const {
498
+ buildPhase6FrameworkRuntimePack,
499
+ summarizePhase6FrameworkRuntimePack
500
+ } = require("./lib/phase_6_framework_runtime_pack");
501
+ const {
502
+ buildPhase6LanggraphRuntimePack,
503
+ summarizePhase6LanggraphRuntimePack
504
+ } = require("./lib/phase_6_langgraph_runtime_pack");
505
+ const {
506
+ buildPhase6LangchainRuntimePack,
507
+ summarizePhase6LangchainRuntimePack
508
+ } = require("./lib/phase_6_langchain_runtime_pack");
509
+ const {
510
+ buildPhase6AutogenRuntimePack,
511
+ summarizePhase6AutogenRuntimePack
512
+ } = require("./lib/phase_6_autogen_runtime_pack");
513
+ const {
514
+ buildPhase6SemanticKernelRuntimePack,
515
+ summarizePhase6SemanticKernelRuntimePack
516
+ } = require("./lib/phase_6_semantic_kernel_runtime_pack");
517
+ const {
518
+ buildPhase6FrameworkContinuityPack,
519
+ summarizePhase6FrameworkContinuityPack
520
+ } = require("./lib/phase_6_framework_continuity_pack");
521
+ const {
522
+ buildPhase6CompletionPack,
523
+ summarizePhase6CompletionPack
524
+ } = require("./lib/phase_6_completion_pack");
525
+ const {
526
+ buildPhase6FreezeReviewPack,
527
+ summarizePhase6FreezeReviewPack
528
+ } = require("./lib/phase_6_freeze_review_pack");
529
+ const {
530
+ buildPhase6FreezeBaselinePack,
531
+ summarizePhase6FreezeBaselinePack
532
+ } = require("./lib/phase_6_freeze_baseline_pack");
533
+ const {
534
+ buildPhase6GatePack,
535
+ summarizePhase6GatePack
536
+ } = require("./lib/phase_6_gate_pack");
537
+ const {
538
+ buildPhase6CloseoutPack,
539
+ summarizePhase6CloseoutPack
540
+ } = require("./lib/phase_6_closeout_pack");
541
+ const {
542
+ buildPhase6DecisionRecordPack,
543
+ summarizePhase6DecisionRecordPack
544
+ } = require("./lib/phase_6_decision_record_pack");
545
+ const {
546
+ buildPhase6DecisionResolutionPack,
547
+ summarizePhase6DecisionResolutionPack
548
+ } = require("./lib/phase_6_decision_resolution_pack");
549
+ const {
550
+ buildPhase7EventSystemPack,
551
+ summarizePhase7EventSystemPack
552
+ } = require("./lib/phase_7_event_system_pack");
553
+ const {
554
+ buildPhase7KafkaRuntimePack,
555
+ summarizePhase7KafkaRuntimePack
556
+ } = require("./lib/phase_7_kafka_runtime_pack");
557
+ const {
558
+ buildPhase7NatsRuntimePack,
559
+ summarizePhase7NatsRuntimePack
560
+ } = require("./lib/phase_7_nats_runtime_pack");
561
+ const {
562
+ buildPhase7MqttRuntimePack,
563
+ summarizePhase7MqttRuntimePack
564
+ } = require("./lib/phase_7_mqtt_runtime_pack");
565
+ const {
566
+ buildPhase7WebhookEventBusRuntimePack,
567
+ summarizePhase7WebhookEventBusRuntimePack
568
+ } = require("./lib/phase_7_webhook_event_bus_runtime_pack");
569
+ const {
570
+ buildPhase7EventSystemContinuityPack,
571
+ summarizePhase7EventSystemContinuityPack
572
+ } = require("./lib/phase_7_event_system_continuity_pack");
573
+ const {
574
+ buildPhase7CompletionPack,
575
+ summarizePhase7CompletionPack
576
+ } = require("./lib/phase_7_completion_pack");
577
+ const {
578
+ buildPhase7FreezeBaselinePack,
579
+ summarizePhase7FreezeBaselinePack
580
+ } = require("./lib/phase_7_freeze_baseline_pack");
581
+ const {
582
+ buildPhase7FreezeReviewPack,
583
+ summarizePhase7FreezeReviewPack
584
+ } = require("./lib/phase_7_freeze_review_pack");
585
+ const {
586
+ buildPhase7GatePack,
587
+ summarizePhase7GatePack
588
+ } = require("./lib/phase_7_gate_pack");
589
+ const {
590
+ buildPhase7CloseoutPack,
591
+ summarizePhase7CloseoutPack
592
+ } = require("./lib/phase_7_closeout_pack");
593
+ const {
594
+ buildPhase7DecisionRecordPack,
595
+ summarizePhase7DecisionRecordPack
596
+ } = require("./lib/phase_7_decision_record_pack");
597
+ const {
598
+ buildPhase7DecisionResolutionPack,
599
+ summarizePhase7DecisionResolutionPack
600
+ } = require("./lib/phase_7_decision_resolution_pack");
601
+ const {
602
+ buildPhase8ProofBridgesPack,
603
+ summarizePhase8ProofBridgesPack
604
+ } = require("./lib/phase_8_proof_bridges_pack");
605
+ const {
606
+ buildPhase8ProofBridgeContinuityPack,
607
+ summarizePhase8ProofBridgeContinuityPack
608
+ } = require("./lib/phase_8_proof_bridge_continuity_pack");
609
+ const {
610
+ buildPhase8CompletionPack,
611
+ summarizePhase8CompletionPack
612
+ } = require("./lib/phase_8_completion_pack");
613
+ const {
614
+ buildPhase8FreezeBaselinePack,
615
+ summarizePhase8FreezeBaselinePack
616
+ } = require("./lib/phase_8_freeze_baseline_pack");
617
+ const {
618
+ buildPhase8FreezeReviewPack,
619
+ summarizePhase8FreezeReviewPack
620
+ } = require("./lib/phase_8_freeze_review_pack");
621
+ const {
622
+ buildPhase8GatePack,
623
+ summarizePhase8GatePack
624
+ } = require("./lib/phase_8_gate_pack");
625
+ const {
626
+ buildPhase8CloseoutPack,
627
+ summarizePhase8CloseoutPack
628
+ } = require("./lib/phase_8_closeout_pack");
629
+ const {
630
+ buildPhase8DecisionRecordPack,
631
+ summarizePhase8DecisionRecordPack
632
+ } = require("./lib/phase_8_decision_record_pack");
633
+ const {
634
+ buildPhase8DecisionResolutionPack,
635
+ summarizePhase8DecisionResolutionPack
636
+ } = require("./lib/phase_8_decision_resolution_pack");
637
+ const {
638
+ buildPhase8ExternalResultImportRuntimePack,
639
+ summarizePhase8ExternalResultImportRuntimePack
640
+ } = require("./lib/phase_8_external_result_import_runtime_pack");
641
+ const {
642
+ buildPhase8ExternalReceiptImportRuntimePack,
643
+ summarizePhase8ExternalReceiptImportRuntimePack
644
+ } = require("./lib/phase_8_external_receipt_import_runtime_pack");
645
+ const {
646
+ buildPhase8ProofBundleNormalizationRuntimePack,
647
+ summarizePhase8ProofBundleNormalizationRuntimePack
648
+ } = require("./lib/phase_8_proof_bundle_normalization_runtime_pack");
649
+ const {
650
+ buildPhase9TreasuryConnectivityPack,
651
+ summarizePhase9TreasuryConnectivityPack
652
+ } = require("./lib/phase_9_treasury_connectivity_pack");
653
+ const {
654
+ buildPhase9TreasuryContinuityPack,
655
+ summarizePhase9TreasuryContinuityPack
656
+ } = require("./lib/phase_9_treasury_continuity_pack");
657
+ const {
658
+ buildPhase9CompletionPack,
659
+ summarizePhase9CompletionPack
660
+ } = require("./lib/phase_9_completion_pack");
661
+ const {
662
+ buildPhase9FreezeBaselinePack,
663
+ summarizePhase9FreezeBaselinePack
664
+ } = require("./lib/phase_9_freeze_baseline_pack");
665
+ const {
666
+ buildPhase9FreezeReviewPack,
667
+ summarizePhase9FreezeReviewPack
668
+ } = require("./lib/phase_9_freeze_review_pack");
669
+ const {
670
+ buildPhase9GatePack,
671
+ summarizePhase9GatePack
672
+ } = require("./lib/phase_9_gate_pack");
673
+ const {
674
+ buildPhase9CloseoutPack,
675
+ summarizePhase9CloseoutPack
676
+ } = require("./lib/phase_9_closeout_pack");
677
+ const {
678
+ buildPhase9DecisionRecordPack,
679
+ summarizePhase9DecisionRecordPack
680
+ } = require("./lib/phase_9_decision_record_pack");
681
+ const {
682
+ buildPhase9DecisionResolutionPack,
683
+ summarizePhase9DecisionResolutionPack
684
+ } = require("./lib/phase_9_decision_resolution_pack");
685
+ const {
686
+ buildPhase9TreasuryDestinationsRuntimePack,
687
+ summarizePhase9TreasuryDestinationsRuntimePack
688
+ } = require("./lib/phase_9_treasury_destinations_runtime_pack");
689
+ const {
690
+ buildPhase9CustodyRefsRuntimePack,
691
+ summarizePhase9CustodyRefsRuntimePack
692
+ } = require("./lib/phase_9_custody_refs_runtime_pack");
693
+ const {
694
+ buildPhase9OperatorAccountingBridgesRuntimePack,
695
+ summarizePhase9OperatorAccountingBridgesRuntimePack
696
+ } = require("./lib/phase_9_operator_accounting_bridges_runtime_pack");
697
+ const {
698
+ buildPhase10LongTailEcosystemPack,
699
+ summarizePhase10LongTailEcosystemPack
700
+ } = require("./lib/phase_10_long_tail_ecosystem_pack");
701
+ const {
702
+ buildPhase10LongTailContinuityPack,
703
+ summarizePhase10LongTailContinuityPack
704
+ } = require("./lib/phase_10_long_tail_continuity_pack");
705
+ const {
706
+ buildPhase10CompletionPack,
707
+ summarizePhase10CompletionPack
708
+ } = require("./lib/phase_10_completion_pack");
709
+ const {
710
+ buildPhase10FreezeReviewPack,
711
+ summarizePhase10FreezeReviewPack
712
+ } = require("./lib/phase_10_freeze_review_pack");
713
+ const {
714
+ buildPhase10FreezeBaselinePack,
715
+ summarizePhase10FreezeBaselinePack
716
+ } = require("./lib/phase_10_freeze_baseline_pack");
717
+ const {
718
+ buildPhase10GatePack,
719
+ summarizePhase10GatePack
720
+ } = require("./lib/phase_10_gate_pack");
721
+ const {
722
+ buildPhase10CloseoutPack,
723
+ summarizePhase10CloseoutPack
724
+ } = require("./lib/phase_10_closeout_pack");
725
+ const {
726
+ buildPhase10DecisionRecordPack,
727
+ summarizePhase10DecisionRecordPack
728
+ } = require("./lib/phase_10_decision_record_pack");
729
+ const {
730
+ buildPhase10DecisionResolutionPack,
731
+ summarizePhase10DecisionResolutionPack
732
+ } = require("./lib/phase_10_decision_resolution_pack");
733
+ const {
734
+ buildPhase10DemandSignalAdaptersRuntimePack,
735
+ summarizePhase10DemandSignalAdaptersRuntimePack
736
+ } = require("./lib/phase_10_demand_signal_adapters_runtime_pack");
737
+ const {
738
+ buildPhase10NicheExtensionRegistryRuntimePack,
739
+ summarizePhase10NicheExtensionRegistryRuntimePack
740
+ } = require("./lib/phase_10_niche_extension_registry_runtime_pack");
741
+ const {
742
+ buildPhase10EcosystemBacklogTriageRuntimePack,
743
+ summarizePhase10EcosystemBacklogTriageRuntimePack
744
+ } = require("./lib/phase_10_ecosystem_backlog_triage_runtime_pack");
745
+ const {
746
+ buildPhase3CompletionPack,
747
+ summarizePhase3CompletionPack
748
+ } = require("./lib/phase_3_completion_pack");
749
+ const {
750
+ buildPhase3FreezeReviewPack,
751
+ summarizePhase3FreezeReviewPack
752
+ } = require("./lib/phase_3_freeze_review_pack");
753
+ const {
754
+ buildPhase3GatePack,
755
+ summarizePhase3GatePack
756
+ } = require("./lib/phase_3_gate_pack");
757
+ const {
758
+ buildPhase3CloseoutPack,
759
+ summarizePhase3CloseoutPack
760
+ } = require("./lib/phase_3_closeout_pack");
761
+ const {
762
+ buildPhase3DecisionRecordPack,
763
+ summarizePhase3DecisionRecordPack
764
+ } = require("./lib/phase_3_decision_record_pack");
765
+ const {
766
+ buildPhase3DecisionResolutionPack,
767
+ summarizePhase3DecisionResolutionPack
768
+ } = require("./lib/phase_3_decision_resolution_pack");
257
769
  const {
258
770
  getIntegration,
259
771
  listIntegrations,
@@ -295,16 +807,51 @@ const { createRuntimeStateStore } = require("./lib/runtime_state_store");
295
807
  const state = createRuntimeState();
296
808
  const runtimeStateStore = createRuntimeStateStore({
297
809
  filePath: process.env.XYTARA_STATE_FILE,
298
- intervalMs: process.env.XYTARA_STATE_SNAPSHOT_INTERVAL_MS
810
+ intervalMs: process.env.XYTARA_STATE_SNAPSHOT_INTERVAL_MS,
811
+ supabaseUrl: process.env.XYTARA_SUPABASE_URL,
812
+ supabaseServiceRoleKey: process.env.XYTARA_SUPABASE_SERVICE_ROLE_KEY,
813
+ supabaseTable: process.env.XYTARA_SUPABASE_STATE_TABLE,
814
+ stateKey: process.env.XYTARA_SUPABASE_STATE_KEY
299
815
  });
300
- if (runtimeStateStore.enabled()) {
301
- const restored = runtimeStateStore.load(state);
302
- console.log(
303
- restored
304
- ? `xytara restored runtime state from ${runtimeStateStore.filePath}`
305
- : `xytara runtime state snapshots enabled at ${runtimeStateStore.filePath}`
306
- );
307
- }
816
+ const runtimeStateReady = Promise.resolve(runtimeStateStore.load(state))
817
+ .then((restored) => {
818
+ if (runtimeStateStore.enabled()) {
819
+ const durabilityInspect = runtimeStateStore.inspect();
820
+ const storageLabel = durabilityInspect.storage_mode === "supabase"
821
+ ? `Supabase table ${durabilityInspect.supabase_table} (${durabilityInspect.supabase_state_key})`
822
+ : runtimeStateStore.filePath;
823
+ console.log(
824
+ restored
825
+ ? `xytara restored runtime state from ${storageLabel}`
826
+ : `xytara runtime state snapshots enabled at ${storageLabel}`
827
+ );
828
+ if (durabilityInspect.storage_mode === "file" && durabilityInspect.directory_exists !== true) {
829
+ console.warn(
830
+ `xytara runtime state snapshot directory does not exist yet: ${durabilityInspect.directory_path}`
831
+ );
832
+ }
833
+ if (durabilityInspect.storage_mode === "file" && durabilityInspect.directory_writable !== true) {
834
+ console.warn(
835
+ `xytara runtime state snapshot directory is not writable: ${durabilityInspect.directory_path}`
836
+ );
837
+ }
838
+ if (durabilityInspect.storage_mode === "supabase" && durabilityInspect.remote_reachable !== true) {
839
+ console.warn("xytara runtime state Supabase endpoint is not reachable");
840
+ }
841
+ if (durabilityInspect.storage_mode === "supabase" && durabilityInspect.remote_table_ready !== true) {
842
+ console.warn(`xytara runtime state Supabase table is not ready: ${durabilityInspect.supabase_table}`);
843
+ }
844
+ } else {
845
+ console.warn(
846
+ "xytara runtime state snapshots are disabled; grants, entitlements, and usage meters will reset on restart unless XYTARA_STATE_FILE or XYTARA_SUPABASE_* persistence is configured"
847
+ );
848
+ }
849
+ return restored;
850
+ })
851
+ .catch((error) => {
852
+ console.error("xytara runtime state restore failed", error);
853
+ return false;
854
+ });
308
855
 
309
856
  function getCreditBridgeBearerToken() {
310
857
  const value = typeof process.env.XYTARA_CREDIT_BRIDGE_BEARER_TOKEN === "string"
@@ -383,11 +930,16 @@ function buildRuntimeDurabilitySummary() {
383
930
  ? runtimeStateStore.inspect()
384
931
  : {
385
932
  enabled: runtimeStateStore.enabled(),
933
+ storage_mode: runtimeStateStore.storageMode || "memory",
386
934
  file_path: runtimeStateStore.filePath || null,
387
935
  interval_ms: runtimeStateStore.intervalMs || null
388
936
  };
389
937
  const blockers = [];
390
938
  if (inspect.enabled !== true) blockers.push("runtime_state_snapshot_disabled");
939
+ if (inspect.storage_mode === "file" && inspect.enabled === true && inspect.directory_exists !== true) blockers.push("runtime_state_snapshot_directory_missing");
940
+ if (inspect.storage_mode === "file" && inspect.enabled === true && inspect.directory_writable !== true) blockers.push("runtime_state_snapshot_directory_not_writable");
941
+ if (inspect.storage_mode === "supabase" && inspect.enabled === true && inspect.remote_reachable !== true) blockers.push("runtime_state_supabase_unreachable");
942
+ if (inspect.storage_mode === "supabase" && inspect.enabled === true && inspect.remote_table_ready !== true) blockers.push("runtime_state_supabase_table_not_ready");
391
943
  if (inspect.enabled === true && inspect.snapshot_exists !== true) blockers.push("runtime_state_snapshot_missing");
392
944
  if (inspect.last_flush_succeeded === false) blockers.push("runtime_state_last_flush_failed");
393
945
  return {
@@ -399,6 +951,11 @@ function buildRuntimeDurabilitySummary() {
399
951
  : "snapshot_enabled_not_yet_persisted"
400
952
  : "volatile_runtime_state",
401
953
  blockers,
954
+ operator_guidance: inspect.storage_mode === "supabase"
955
+ ? "keep XYTARA_SUPABASE_URL, XYTARA_SUPABASE_SERVICE_ROLE_KEY, XYTARA_SUPABASE_STATE_TABLE, and XYTARA_SUPABASE_STATE_KEY configured so grants, entitlements, and usage meters survive restart"
956
+ : inspect.enabled === true
957
+ ? "store XYTARA_STATE_FILE on persistent disk so grants, entitlements, and usage meters survive restart"
958
+ : "configure XYTARA_STATE_FILE on persistent disk or XYTARA_SUPABASE_* remote persistence to preserve grants, entitlements, and usage meters across restart",
402
959
  ...inspect
403
960
  };
404
961
  }
@@ -2407,280 +2964,1566 @@ function buildPreparedContinuationAdapterDefaultOperatingPathBundle(portableHand
2407
2964
  };
2408
2965
  }
2409
2966
 
2410
- function buildPreparedContinuationDefaultOperatingPathRunSummary(portableHandoff, continuation) {
2411
- const operatingPath = buildPreparedContinuationAdapterDefaultOperatingPathSummary(portableHandoff, continuation);
2412
- return {
2413
- ok: operatingPath.ok === true,
2414
- operating_path_ref: operatingPath.operating_path_ref || null,
2415
- default_operating_path_ref: operatingPath.operating_path_ref
2416
- ? `default.${operatingPath.operating_path_ref}`
2417
- : null,
2418
- stable_default_operating_path_ids: Array.isArray(operatingPath.default_operating_path_ids)
2419
- ? operatingPath.default_operating_path_ids
2420
- : [],
2421
- default_operating_path_carry: operatingPath.operating_path_carry || {},
2422
- operating_path_ready_by_default: operatingPath.adapter_ready_by_default === true,
2423
- next_surface: "/v1/proof-center/result-package-handoff/review/operating-path-run"
2424
- };
2425
- }
2967
+ function buildPreparedContinuationDefaultOperatingPathRunSummary(portableHandoff, continuation) {
2968
+ const operatingPath = buildPreparedContinuationAdapterDefaultOperatingPathSummary(portableHandoff, continuation);
2969
+ return {
2970
+ ok: operatingPath.ok === true,
2971
+ operating_path_ref: operatingPath.operating_path_ref || null,
2972
+ default_operating_path_ref: operatingPath.operating_path_ref
2973
+ ? `default.${operatingPath.operating_path_ref}`
2974
+ : null,
2975
+ stable_default_operating_path_ids: Array.isArray(operatingPath.default_operating_path_ids)
2976
+ ? operatingPath.default_operating_path_ids
2977
+ : [],
2978
+ default_operating_path_carry: operatingPath.operating_path_carry || {},
2979
+ operating_path_ready_by_default: operatingPath.adapter_ready_by_default === true,
2980
+ next_surface: "/v1/proof-center/result-package-handoff/review/operating-path-run"
2981
+ };
2982
+ }
2983
+
2984
+ function buildPreparedContinuationAdapterCompleteDefaultPathSummary(portableHandoff, continuation) {
2985
+ const operatingPath = buildPreparedContinuationDefaultOperatingPathRunSummary(portableHandoff, continuation);
2986
+ return {
2987
+ ok: operatingPath.ok === true,
2988
+ default_operating_path_ref: operatingPath.default_operating_path_ref || null,
2989
+ complete_default_path_ref: operatingPath.default_operating_path_ref
2990
+ ? `complete.${operatingPath.default_operating_path_ref}`
2991
+ : null,
2992
+ complete_default_path_ids: Array.isArray(operatingPath.stable_default_operating_path_ids)
2993
+ ? operatingPath.stable_default_operating_path_ids
2994
+ : [],
2995
+ complete_default_path_carry: operatingPath.default_operating_path_carry || {},
2996
+ adapter_complete_by_default: operatingPath.operating_path_ready_by_default === true,
2997
+ next_surface: "/v1/proof-center/result-package-handoff/review/complete-default-path"
2998
+ };
2999
+ }
3000
+
3001
+ function buildPreparedContinuationAdapterCompleteDefaultPathBundle(portableHandoff, continuation) {
3002
+ const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
3003
+ const summary = buildPreparedContinuationAdapterCompleteDefaultPathSummary(portableHandoff, continuation);
3004
+ return {
3005
+ ok: true,
3006
+ complete_default_path_summary: summary,
3007
+ complete_default_path_template: {
3008
+ ok: true,
3009
+ complete_default_path_ref: summary.complete_default_path_ref || null,
3010
+ target_surface: "/v1/proof-center/result-package-handoff/review/complete-default-path",
3011
+ request_template: {
3012
+ handoff_bundle: handoff
3013
+ },
3014
+ stable_boundary_ids: Array.isArray(summary.complete_default_path_ids) ? summary.complete_default_path_ids : []
3015
+ }
3016
+ };
3017
+ }
3018
+
3019
+ function buildPreparedContinuationDefaultCompletePathRunSummary(portableHandoff, continuation) {
3020
+ const completePath = buildPreparedContinuationAdapterCompleteDefaultPathSummary(portableHandoff, continuation);
3021
+ return {
3022
+ ok: completePath.ok === true,
3023
+ complete_default_path_ref: completePath.complete_default_path_ref || null,
3024
+ default_complete_default_path_ref: completePath.complete_default_path_ref
3025
+ ? `default.${completePath.complete_default_path_ref}`
3026
+ : null,
3027
+ stable_default_complete_default_path_ids: Array.isArray(completePath.complete_default_path_ids)
3028
+ ? completePath.complete_default_path_ids
3029
+ : [],
3030
+ default_complete_default_path_carry: completePath.complete_default_path_carry || {},
3031
+ complete_default_path_ready: completePath.adapter_complete_by_default === true,
3032
+ next_surface: "/v1/proof-center/result-package-handoff/review/complete-default-path-run"
3033
+ };
3034
+ }
3035
+
3036
+ function buildInteractionResultPackageContinuationRequestTemplate(portableHandoff, continuation) {
3037
+ const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
3038
+ return {
3039
+ ok: true,
3040
+ continuation_ref: continuation && continuation.continuation_ref ? continuation.continuation_ref : null,
3041
+ target_surface: "/v1/proof-center/result-package-handoff/run",
3042
+ review_surface: "/v1/proof-center/result-package-handoff/review",
3043
+ request_template: {
3044
+ handoff_bundle: handoff,
3045
+ evidence_refs: handoff.proof_ref ? [handoff.proof_ref] : [],
3046
+ options: {
3047
+ legacy_identity_material_hex: "<required_for_local_demo_signing>"
3048
+ }
3049
+ }
3050
+ };
3051
+ }
3052
+
3053
+ function buildOperationsDashboard(filters) {
3054
+ const disputes = listRecords(state.disputes, filters);
3055
+ const refunds = listRecords(state.refunds, filters);
3056
+ const remediationTickets = listRecords(state.remediationTickets, filters);
3057
+ const transactions = listTransactionRecords(filters);
3058
+ const receipts = listReceiptRecords(filters);
3059
+ const deliveries = listRecords(state.deliveries, filters);
3060
+ return summarizeOperationsDashboardPayload({
3061
+ open_issues: {
3062
+ disputes,
3063
+ refunds,
3064
+ remediation_tickets: remediationTickets
3065
+ },
3066
+ execution_exceptions: {
3067
+ transactions,
3068
+ receipts,
3069
+ deliveries,
3070
+ remediation_tickets: remediationTickets
3071
+ }
3072
+ });
3073
+ }
3074
+
3075
+ function buildAttentionRecords(filters) {
3076
+ const dashboard = buildOperationsDashboard(filters);
3077
+ const refs = dashboard && dashboard.attention_refs ? dashboard.attention_refs : {};
3078
+ const disputes = (Array.isArray(refs.dispute_ids) ? refs.dispute_ids : [])
3079
+ .map((id) => summarizeDisputePayload(state.disputes.get(id)))
3080
+ .filter((entry) => entry && entry.dispute_id);
3081
+ const refunds = (Array.isArray(refs.refund_ids) ? refs.refund_ids : [])
3082
+ .map((id) => summarizeRefundPayload(state.refunds.get(id)))
3083
+ .filter((entry) => entry && entry.refund_id);
3084
+ const remediationTickets = (Array.isArray(refs.ticket_ids) ? refs.ticket_ids : [])
3085
+ .map((id) => summarizeRemediationTicketPayload(state.remediationTickets.get(id)))
3086
+ .filter((entry) => entry && entry.ticket_id);
3087
+ const transactions = (Array.isArray(refs.transaction_ids) ? refs.transaction_ids : [])
3088
+ .map((id) => summarizeTransactionPayload(state.transactions.get(id)))
3089
+ .filter((entry) => entry && entry.transaction_id);
3090
+ const receipts = (Array.isArray(refs.receipt_ids) ? refs.receipt_ids : [])
3091
+ .map((id) => summarizeReceiptPayload(state.receipts.get(id)))
3092
+ .filter((entry) => entry && entry.receipt_id);
3093
+ const deliveries = (Array.isArray(refs.delivery_ids) ? refs.delivery_ids : [])
3094
+ .map((id) => summarizeDeliveryPayload(state.deliveries.get(id)))
3095
+ .filter((entry) => entry && entry.delivery_id);
3096
+ return {
3097
+ dashboard,
3098
+ disputes,
3099
+ refunds,
3100
+ remediation_tickets: remediationTickets,
3101
+ transactions,
3102
+ receipts,
3103
+ deliveries
3104
+ };
3105
+ }
3106
+
3107
+ function buildOperatorShellSummaryPayload(body) {
3108
+ const requestBody = body && typeof body === "object" && !Array.isArray(body) ? body : {};
3109
+ const accountId = requestBody.account_id || "acct_demo";
3110
+ const runtimeDurability = buildRuntimeDurabilitySummary();
3111
+ const nativeSettlementReadiness = buildNativeSettlementReadinessSummary();
3112
+ return buildOperatorShellSummary({
3113
+ account_id: accountId,
3114
+ operations_dashboard: buildOperationsDashboard({ account_id: accountId }),
3115
+ operator_export_pack: buildOperatorExportPack(state, { account_id: accountId }, listRecords, {
3116
+ runtime_durability: runtimeDurability,
3117
+ native_settlement_readiness: nativeSettlementReadiness
3118
+ }),
3119
+ economics_operator_view: buildOperatorView(state, accountId),
3120
+ economics_operator_dashboard: buildOperatorDashboard(state, accountId),
3121
+ entitlement_replenishment_summary: buildEntitlementReplenishmentSummary(state, accountId),
3122
+ hosted_checkout_operator_summary: buildHostedCheckoutOperatorSummary(state, accountId),
3123
+ coordination_operator_view: buildCoordinationOperatorView(requestBody),
3124
+ coordination_admin_view: buildCoordinationAdminView(requestBody),
3125
+ runtime_durability: runtimeDurability,
3126
+ native_settlement_readiness: nativeSettlementReadiness
3127
+ });
3128
+ }
3129
+
3130
+ async function routeRequest(req, res) {
3131
+ const url = new URL(req.url, "http://127.0.0.1");
3132
+ hydrateQuoteStates(state);
3133
+ hydratePendingExecutions(state);
3134
+
3135
+ if (req.method === "GET" && url.pathname === "/health") {
3136
+ sendJson(res, 200, {
3137
+ status: "ok",
3138
+ service: "xytara",
3139
+ readiness: "ready",
3140
+ runtime_durability: buildRuntimeDurabilitySummary(),
3141
+ native_settlement_readiness: buildNativeSettlementReadinessSummary()
3142
+ });
3143
+ return;
3144
+ }
3145
+
3146
+ if (req.method === "GET" && url.pathname === "/v1/release-pack") {
3147
+ sendJson(res, 200, buildReleasePack());
3148
+ return;
3149
+ }
3150
+
3151
+ if (req.method === "GET" && url.pathname === "/v1/release-pack/summary") {
3152
+ sendJson(res, 200, summarizeReleasePack());
3153
+ return;
3154
+ }
3155
+
3156
+ if (req.method === "GET" && url.pathname === "/v1/release-pack/comparison") {
3157
+ sendJson(res, 200, buildComparisonPack());
3158
+ return;
3159
+ }
3160
+
3161
+ if (req.method === "GET" && url.pathname === "/v1/release-pack/comparison/summary") {
3162
+ sendJson(res, 200, summarizeComparisonPack());
3163
+ return;
3164
+ }
3165
+
3166
+ if (req.method === "GET" && url.pathname === "/v1/release-pack/adoption") {
3167
+ sendJson(res, 200, buildAdoptionPack());
3168
+ return;
3169
+ }
3170
+
3171
+ if (req.method === "GET" && url.pathname === "/v1/release-pack/adoption/summary") {
3172
+ sendJson(res, 200, summarizeAdoptionPack());
3173
+ return;
3174
+ }
3175
+
3176
+ if (req.method === "GET" && url.pathname === "/v1/release-pack/scenarios") {
3177
+ sendJson(res, 200, buildScenarioPack());
3178
+ return;
3179
+ }
3180
+
3181
+ if (req.method === "GET" && url.pathname === "/v1/release-pack/scenarios/summary") {
3182
+ sendJson(res, 200, summarizeScenarioPack());
3183
+ return;
3184
+ }
3185
+
3186
+ if (req.method === "GET" && url.pathname === "/v1/release-pack/launch") {
3187
+ sendJson(res, 200, buildLaunchPack({
3188
+ liveReadiness: buildNativeSettlementReadinessSummary()
3189
+ }));
3190
+ return;
3191
+ }
3192
+
3193
+ if (req.method === "GET" && url.pathname === "/v1/release-pack/launch/summary") {
3194
+ sendJson(res, 200, summarizeLaunchPack({
3195
+ liveReadiness: buildNativeSettlementReadinessSummary()
3196
+ }));
3197
+ return;
3198
+ }
3199
+
3200
+ if (req.method === "GET" && url.pathname === "/v1/release-manifest") {
3201
+ sendJson(res, 200, buildReleaseManifest());
3202
+ return;
3203
+ }
3204
+
3205
+ if (req.method === "GET" && url.pathname === "/v1/release-manifest/summary") {
3206
+ sendJson(res, 200, summarizeReleaseManifest());
3207
+ return;
3208
+ }
3209
+
3210
+ if (req.method === "GET" && url.pathname === "/v1/release-notes") {
3211
+ sendJson(res, 200, buildLaunchNotes());
3212
+ return;
3213
+ }
3214
+
3215
+ if (req.method === "GET" && url.pathname === "/v1/release-notes/summary") {
3216
+ sendJson(res, 200, summarizeLaunchNotes());
3217
+ return;
3218
+ }
3219
+
3220
+ if (req.method === "GET" && url.pathname === "/v1/release-center") {
3221
+ sendJson(res, 200, buildReleaseCenter({
3222
+ liveReadiness: buildNativeSettlementReadinessSummary()
3223
+ }));
3224
+ return;
3225
+ }
3226
+
3227
+ if (req.method === "GET" && url.pathname === "/v1/release-center/summary") {
3228
+ sendJson(res, 200, summarizeReleaseCenter({
3229
+ liveReadiness: buildNativeSettlementReadinessSummary()
3230
+ }));
3231
+ return;
3232
+ }
3233
+
3234
+ if (req.method === "GET" && url.pathname === "/v1/release-history") {
3235
+ sendJson(res, 200, buildReleaseHistory());
3236
+ return;
3237
+ }
3238
+
3239
+ if (req.method === "GET" && url.pathname === "/v1/release-history/summary") {
3240
+ sendJson(res, 200, summarizeReleaseHistory());
3241
+ return;
3242
+ }
3243
+
3244
+ if (req.method === "GET" && url.pathname === "/v1/adapter-pack") {
3245
+ sendJson(res, 200, buildAdapterPack());
3246
+ return;
3247
+ }
3248
+
3249
+ if (req.method === "GET" && url.pathname === "/v1/adapter-pack/summary") {
3250
+ sendJson(res, 200, summarizeAdapterPack());
3251
+ return;
3252
+ }
3253
+
3254
+ if (req.method === "GET" && url.pathname === "/v1/adapter-promotion") {
3255
+ sendJson(res, 200, buildAdapterPromotionPack());
3256
+ return;
3257
+ }
3258
+
3259
+ if (req.method === "GET" && url.pathname === "/v1/adapter-promotion/summary") {
3260
+ sendJson(res, 200, summarizeAdapterPromotionPack());
3261
+ return;
3262
+ }
3263
+
3264
+ if (req.method === "GET" && url.pathname === "/v1/adapter-partners") {
3265
+ sendJson(res, 200, buildAdapterPartnerPack());
3266
+ return;
3267
+ }
3268
+
3269
+ if (req.method === "GET" && url.pathname === "/v1/adapter-partners/summary") {
3270
+ sendJson(res, 200, summarizeAdapterPartnerPack());
3271
+ return;
3272
+ }
3273
+
3274
+ if (req.method === "GET" && url.pathname === "/v1/partner-intelligence") {
3275
+ sendJson(res, 200, buildPartnerIntelligencePack());
3276
+ return;
3277
+ }
3278
+
3279
+ if (req.method === "GET" && url.pathname === "/v1/partner-intelligence/summary") {
3280
+ sendJson(res, 200, summarizePartnerIntelligencePack());
3281
+ return;
3282
+ }
3283
+
3284
+ if (req.method === "GET" && url.pathname === "/v1/operator-intelligence") {
3285
+ sendJson(res, 200, buildOperatorIntelligencePack(state, {
3286
+ account_id: url.searchParams.get("account_id") || "acct_demo"
3287
+ }));
3288
+ return;
3289
+ }
3290
+
3291
+ if (req.method === "GET" && url.pathname === "/v1/operator-intelligence/summary") {
3292
+ sendJson(res, 200, summarizeOperatorIntelligencePack(state, {
3293
+ account_id: url.searchParams.get("account_id") || "acct_demo"
3294
+ }));
3295
+ return;
3296
+ }
3297
+
3298
+ if (req.method === "POST" && url.pathname === "/v1/operator-intelligence") {
3299
+ const body = await readJsonBody(req);
3300
+ sendJson(res, 200, buildOperatorIntelligencePack(state, body));
3301
+ return;
3302
+ }
3303
+
3304
+ if (req.method === "POST" && url.pathname === "/v1/operator-intelligence/summary") {
3305
+ const body = await readJsonBody(req);
3306
+ sendJson(res, 200, summarizeOperatorIntelligencePack(state, body));
3307
+ return;
3308
+ }
3309
+
3310
+ if (req.method === "GET" && url.pathname === "/v1/soft-launch") {
3311
+ sendJson(res, 200, buildSoftLaunchPack());
3312
+ return;
3313
+ }
3314
+
3315
+ if (req.method === "GET" && url.pathname === "/v1/soft-launch/summary") {
3316
+ sendJson(res, 200, summarizeSoftLaunchPack());
3317
+ return;
3318
+ }
3319
+
3320
+ if (req.method === "GET" && url.pathname === "/v1/outreach-copy") {
3321
+ sendJson(res, 200, buildOutreachCopyPack());
3322
+ return;
3323
+ }
3324
+
3325
+ if (req.method === "GET" && url.pathname === "/v1/outreach-copy/summary") {
3326
+ sendJson(res, 200, summarizeOutreachCopyPack());
3327
+ return;
3328
+ }
3329
+
3330
+ if (req.method === "GET" && url.pathname === "/v1/outreach-targets") {
3331
+ sendJson(res, 200, buildOutreachTargetPack());
3332
+ return;
3333
+ }
3334
+
3335
+ if (req.method === "GET" && url.pathname === "/v1/outreach-targets/summary") {
3336
+ sendJson(res, 200, summarizeOutreachTargetPack());
3337
+ return;
3338
+ }
3339
+
3340
+ if (req.method === "GET" && url.pathname === "/v1/outreach-messages") {
3341
+ sendJson(res, 200, buildOutreachMessagePack());
3342
+ return;
3343
+ }
3344
+
3345
+ if (req.method === "GET" && url.pathname === "/v1/outreach-messages/summary") {
3346
+ sendJson(res, 200, summarizeOutreachMessagePack());
3347
+ return;
3348
+ }
3349
+
3350
+ if (req.method === "GET" && url.pathname === "/v1/phases") {
3351
+ sendJson(res, 200, buildPhaseProgramPack());
3352
+ return;
3353
+ }
3354
+
3355
+ if (req.method === "GET" && url.pathname === "/v1/phases/summary") {
3356
+ sendJson(res, 200, summarizePhaseProgramPack());
3357
+ return;
3358
+ }
3359
+
3360
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-1") {
3361
+ sendJson(res, 200, buildPhase1EcosystemPack());
3362
+ return;
3363
+ }
3364
+
3365
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-1/summary") {
3366
+ sendJson(res, 200, summarizePhase1EcosystemPack());
3367
+ return;
3368
+ }
3369
+
3370
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-1/openai-codex") {
3371
+ sendJson(res, 200, buildPhase1OpenaiCodexPack());
3372
+ return;
3373
+ }
3374
+
3375
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-1/openai-codex/summary") {
3376
+ sendJson(res, 200, summarizePhase1OpenaiCodexPack());
3377
+ return;
3378
+ }
3379
+
3380
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-1/openai-codex/runtime") {
3381
+ sendJson(res, 200, buildPhase1OpenaiCodexRuntimePack());
3382
+ return;
3383
+ }
3384
+
3385
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-1/openai-codex/runtime/summary") {
3386
+ sendJson(res, 200, summarizePhase1OpenaiCodexRuntimePack());
3387
+ return;
3388
+ }
3389
+
3390
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-1/claude-mcp") {
3391
+ sendJson(res, 200, buildPhase1ClaudeMcpPack());
3392
+ return;
3393
+ }
3394
+
3395
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-1/claude-mcp/summary") {
3396
+ sendJson(res, 200, summarizePhase1ClaudeMcpPack());
3397
+ return;
3398
+ }
3399
+
3400
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-1/claude-mcp/runtime") {
3401
+ sendJson(res, 200, buildPhase1ClaudeMcpRuntimePack());
3402
+ return;
3403
+ }
3404
+
3405
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-1/claude-mcp/runtime/summary") {
3406
+ sendJson(res, 200, summarizePhase1ClaudeMcpRuntimePack());
3407
+ return;
3408
+ }
3409
+
3410
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2") {
3411
+ sendJson(res, 200, buildPhase2PaymentRailsPack());
3412
+ return;
3413
+ }
3414
+
3415
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/summary") {
3416
+ sendJson(res, 200, summarizePhase2PaymentRailsPack());
3417
+ return;
3418
+ }
3419
+
3420
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/completion") {
3421
+ sendJson(res, 200, buildPhase2CompletionPack());
3422
+ return;
3423
+ }
3424
+
3425
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/completion/summary") {
3426
+ sendJson(res, 200, summarizePhase2CompletionPack());
3427
+ return;
3428
+ }
3429
+
3430
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/freeze-review") {
3431
+ sendJson(res, 200, buildPhase2FreezeReviewPack());
3432
+ return;
3433
+ }
3434
+
3435
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/freeze-review/summary") {
3436
+ sendJson(res, 200, summarizePhase2FreezeReviewPack());
3437
+ return;
3438
+ }
3439
+
3440
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/gate") {
3441
+ sendJson(res, 200, buildPhase2GatePack());
3442
+ return;
3443
+ }
3444
+
3445
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/gate/summary") {
3446
+ sendJson(res, 200, summarizePhase2GatePack());
3447
+ return;
3448
+ }
3449
+
3450
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/closeout") {
3451
+ sendJson(res, 200, buildPhase2CloseoutPack());
3452
+ return;
3453
+ }
3454
+
3455
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/closeout/summary") {
3456
+ sendJson(res, 200, summarizePhase2CloseoutPack());
3457
+ return;
3458
+ }
3459
+
3460
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/decision-record") {
3461
+ sendJson(res, 200, buildPhase2DecisionRecordPack());
3462
+ return;
3463
+ }
3464
+
3465
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/decision-record/summary") {
3466
+ sendJson(res, 200, summarizePhase2DecisionRecordPack());
3467
+ return;
3468
+ }
3469
+
3470
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/decision-resolution") {
3471
+ sendJson(res, 200, buildPhase2DecisionResolutionPack());
3472
+ return;
3473
+ }
3474
+
3475
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/decision-resolution/summary") {
3476
+ sendJson(res, 200, summarizePhase2DecisionResolutionPack());
3477
+ return;
3478
+ }
3479
+
3480
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/flip-preview") {
3481
+ sendJson(res, 200, buildPhase2FlipPreviewPack());
3482
+ return;
3483
+ }
3484
+
3485
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/flip-preview/summary") {
3486
+ sendJson(res, 200, summarizePhase2FlipPreviewPack());
3487
+ return;
3488
+ }
3489
+
3490
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/evm-base") {
3491
+ sendJson(res, 200, buildPhase2EvmBaseRuntimePack());
3492
+ return;
3493
+ }
3494
+
3495
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/evm-base/summary") {
3496
+ sendJson(res, 200, summarizePhase2EvmBaseRuntimePack());
3497
+ return;
3498
+ }
3499
+
3500
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/base-usdc") {
3501
+ sendJson(res, 200, buildPhase2BaseUsdcRuntimePack());
3502
+ return;
3503
+ }
3504
+
3505
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/base-usdc/summary") {
3506
+ sendJson(res, 200, summarizePhase2BaseUsdcRuntimePack());
3507
+ return;
3508
+ }
3509
+
3510
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/eth") {
3511
+ sendJson(res, 200, buildPhase2EthRuntimePack());
3512
+ return;
3513
+ }
3514
+
3515
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/eth/summary") {
3516
+ sendJson(res, 200, summarizePhase2EthRuntimePack());
3517
+ return;
3518
+ }
3519
+
3520
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3") {
3521
+ sendJson(res, 200, buildPhase3NativeBsvPack());
3522
+ return;
3523
+ }
3524
+
3525
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/summary") {
3526
+ sendJson(res, 200, summarizePhase3NativeBsvPack());
3527
+ return;
3528
+ }
3529
+
3530
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/native-continuity") {
3531
+ sendJson(res, 200, buildPhase3NativeContinuityPack());
3532
+ return;
3533
+ }
3534
+
3535
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/native-continuity/summary") {
3536
+ sendJson(res, 200, summarizePhase3NativeContinuityPack());
3537
+ return;
3538
+ }
3539
+
3540
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/freeze-baseline") {
3541
+ sendJson(res, 200, buildPhase3FreezeBaselinePack());
3542
+ return;
3543
+ }
3544
+
3545
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/freeze-baseline/summary") {
3546
+ sendJson(res, 200, summarizePhase3FreezeBaselinePack());
3547
+ return;
3548
+ }
3549
+
3550
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/completion") {
3551
+ sendJson(res, 200, buildPhase3CompletionPack());
3552
+ return;
3553
+ }
3554
+
3555
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/completion/summary") {
3556
+ sendJson(res, 200, summarizePhase3CompletionPack());
3557
+ return;
3558
+ }
3559
+
3560
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/freeze-review") {
3561
+ sendJson(res, 200, buildPhase3FreezeReviewPack());
3562
+ return;
3563
+ }
3564
+
3565
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/freeze-review/summary") {
3566
+ sendJson(res, 200, summarizePhase3FreezeReviewPack());
3567
+ return;
3568
+ }
3569
+
3570
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/gate") {
3571
+ sendJson(res, 200, buildPhase3GatePack());
3572
+ return;
3573
+ }
3574
+
3575
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/gate/summary") {
3576
+ sendJson(res, 200, summarizePhase3GatePack());
3577
+ return;
3578
+ }
3579
+
3580
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/closeout") {
3581
+ sendJson(res, 200, buildPhase3CloseoutPack());
3582
+ return;
3583
+ }
3584
+
3585
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/closeout/summary") {
3586
+ sendJson(res, 200, summarizePhase3CloseoutPack());
3587
+ return;
3588
+ }
3589
+
3590
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/decision-record") {
3591
+ sendJson(res, 200, buildPhase3DecisionRecordPack());
3592
+ return;
3593
+ }
3594
+
3595
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/decision-record/summary") {
3596
+ sendJson(res, 200, summarizePhase3DecisionRecordPack());
3597
+ return;
3598
+ }
3599
+
3600
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/decision-resolution") {
3601
+ sendJson(res, 200, buildPhase3DecisionResolutionPack());
3602
+ return;
3603
+ }
3604
+
3605
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/decision-resolution/summary") {
3606
+ sendJson(res, 200, summarizePhase3DecisionResolutionPack());
3607
+ return;
3608
+ }
3609
+
3610
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/bsv-teranode") {
3611
+ sendJson(res, 200, buildPhase3BsvTeranodeRuntimePack());
3612
+ return;
3613
+ }
3614
+
3615
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/bsv-teranode/summary") {
3616
+ sendJson(res, 200, summarizePhase3BsvTeranodeRuntimePack());
3617
+ return;
3618
+ }
3619
+
3620
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/metanet") {
3621
+ sendJson(res, 200, buildPhase3MetanetRuntimePack());
3622
+ return;
3623
+ }
3624
+
3625
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/metanet/summary") {
3626
+ sendJson(res, 200, summarizePhase3MetanetRuntimePack());
3627
+ return;
3628
+ }
3629
+
3630
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/brc") {
3631
+ sendJson(res, 200, buildPhase3BrcRuntimePack());
3632
+ return;
3633
+ }
3634
+
3635
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-3/brc/summary") {
3636
+ sendJson(res, 200, summarizePhase3BrcRuntimePack());
3637
+ return;
3638
+ }
3639
+
3640
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4") {
3641
+ sendJson(res, 200, buildPhase4IdentityTrustPack());
3642
+ return;
3643
+ }
3644
+
3645
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/summary") {
3646
+ sendJson(res, 200, summarizePhase4IdentityTrustPack());
3647
+ return;
3648
+ }
3649
+
3650
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/erc8004") {
3651
+ sendJson(res, 200, buildPhase4Erc8004RuntimePack());
3652
+ return;
3653
+ }
3654
+
3655
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/erc8004/summary") {
3656
+ sendJson(res, 200, summarizePhase4Erc8004RuntimePack());
3657
+ return;
3658
+ }
3659
+
3660
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/identity-registry") {
3661
+ sendJson(res, 200, buildPhase4IdentityRegistryRuntimePack());
3662
+ return;
3663
+ }
3664
+
3665
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/identity-registry/summary") {
3666
+ sendJson(res, 200, summarizePhase4IdentityRegistryRuntimePack());
3667
+ return;
3668
+ }
3669
+
3670
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/attestation") {
3671
+ sendJson(res, 200, buildPhase4AttestationRuntimePack());
3672
+ return;
3673
+ }
3674
+
3675
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/attestation/summary") {
3676
+ sendJson(res, 200, summarizePhase4AttestationRuntimePack());
3677
+ return;
3678
+ }
3679
+
3680
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/trust-continuity") {
3681
+ sendJson(res, 200, buildPhase4TrustContinuityPack());
3682
+ return;
3683
+ }
3684
+
3685
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/trust-continuity/summary") {
3686
+ sendJson(res, 200, summarizePhase4TrustContinuityPack());
3687
+ return;
3688
+ }
3689
+
3690
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/completion") {
3691
+ sendJson(res, 200, buildPhase4CompletionPack());
3692
+ return;
3693
+ }
3694
+
3695
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/completion/summary") {
3696
+ sendJson(res, 200, summarizePhase4CompletionPack());
3697
+ return;
3698
+ }
3699
+
3700
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/freeze-review") {
3701
+ sendJson(res, 200, buildPhase4FreezeReviewPack());
3702
+ return;
3703
+ }
3704
+
3705
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/freeze-baseline") {
3706
+ sendJson(res, 200, buildPhase4FreezeBaselinePack());
3707
+ return;
3708
+ }
3709
+
3710
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/freeze-baseline/summary") {
3711
+ sendJson(res, 200, summarizePhase4FreezeBaselinePack());
3712
+ return;
3713
+ }
3714
+
3715
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/freeze-review/summary") {
3716
+ sendJson(res, 200, summarizePhase4FreezeReviewPack());
3717
+ return;
3718
+ }
3719
+
3720
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/gate") {
3721
+ sendJson(res, 200, buildPhase4GatePack());
3722
+ return;
3723
+ }
3724
+
3725
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/gate/summary") {
3726
+ sendJson(res, 200, summarizePhase4GatePack());
3727
+ return;
3728
+ }
3729
+
3730
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/closeout") {
3731
+ sendJson(res, 200, buildPhase4CloseoutPack());
3732
+ return;
3733
+ }
3734
+
3735
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/closeout/summary") {
3736
+ sendJson(res, 200, summarizePhase4CloseoutPack());
3737
+ return;
3738
+ }
3739
+
3740
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/decision-record") {
3741
+ sendJson(res, 200, buildPhase4DecisionRecordPack());
3742
+ return;
3743
+ }
3744
+
3745
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/decision-record/summary") {
3746
+ sendJson(res, 200, summarizePhase4DecisionRecordPack());
3747
+ return;
3748
+ }
3749
+
3750
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/decision-resolution") {
3751
+ sendJson(res, 200, buildPhase4DecisionResolutionPack());
3752
+ return;
3753
+ }
3754
+
3755
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-4/decision-resolution/summary") {
3756
+ sendJson(res, 200, summarizePhase4DecisionResolutionPack());
3757
+ return;
3758
+ }
3759
+
3760
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5") {
3761
+ sendJson(res, 200, buildPhase5MajorRailsPack());
3762
+ return;
3763
+ }
3764
+
3765
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/summary") {
3766
+ sendJson(res, 200, summarizePhase5MajorRailsPack());
3767
+ return;
3768
+ }
3769
+
3770
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/major-rails-continuity") {
3771
+ sendJson(res, 200, buildPhase5MajorRailsContinuityPack());
3772
+ return;
3773
+ }
3774
+
3775
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/major-rails-continuity/summary") {
3776
+ sendJson(res, 200, summarizePhase5MajorRailsContinuityPack());
3777
+ return;
3778
+ }
3779
+
3780
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/completion") {
3781
+ sendJson(res, 200, buildPhase5CompletionPack());
3782
+ return;
3783
+ }
3784
+
3785
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/completion/summary") {
3786
+ sendJson(res, 200, summarizePhase5CompletionPack());
3787
+ return;
3788
+ }
3789
+
3790
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/freeze-review") {
3791
+ sendJson(res, 200, buildPhase5FreezeReviewPack());
3792
+ return;
3793
+ }
3794
+
3795
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/freeze-review/summary") {
3796
+ sendJson(res, 200, summarizePhase5FreezeReviewPack());
3797
+ return;
3798
+ }
3799
+
3800
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/freeze-baseline") {
3801
+ sendJson(res, 200, buildPhase5FreezeBaselinePack());
3802
+ return;
3803
+ }
3804
+
3805
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/freeze-baseline/summary") {
3806
+ sendJson(res, 200, summarizePhase5FreezeBaselinePack());
3807
+ return;
3808
+ }
3809
+
3810
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/gate") {
3811
+ sendJson(res, 200, buildPhase5GatePack());
3812
+ return;
3813
+ }
3814
+
3815
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/gate/summary") {
3816
+ sendJson(res, 200, summarizePhase5GatePack());
3817
+ return;
3818
+ }
3819
+
3820
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/closeout") {
3821
+ sendJson(res, 200, buildPhase5CloseoutPack());
3822
+ return;
3823
+ }
3824
+
3825
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/closeout/summary") {
3826
+ sendJson(res, 200, summarizePhase5CloseoutPack());
3827
+ return;
3828
+ }
3829
+
3830
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/decision-record") {
3831
+ sendJson(res, 200, buildPhase5DecisionRecordPack());
3832
+ return;
3833
+ }
3834
+
3835
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/decision-record/summary") {
3836
+ sendJson(res, 200, summarizePhase5DecisionRecordPack());
3837
+ return;
3838
+ }
3839
+
3840
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/decision-resolution") {
3841
+ sendJson(res, 200, buildPhase5DecisionResolutionPack());
3842
+ return;
3843
+ }
3844
+
3845
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/decision-resolution/summary") {
3846
+ sendJson(res, 200, summarizePhase5DecisionResolutionPack());
3847
+ return;
3848
+ }
3849
+
3850
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/solana") {
3851
+ sendJson(res, 200, buildPhase5SolanaRuntimePack());
3852
+ return;
3853
+ }
3854
+
3855
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/solana/summary") {
3856
+ sendJson(res, 200, summarizePhase5SolanaRuntimePack());
3857
+ return;
3858
+ }
3859
+
3860
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/antelope") {
3861
+ sendJson(res, 200, buildPhase5AntelopeRuntimePack());
3862
+ return;
3863
+ }
3864
+
3865
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/antelope/summary") {
3866
+ sendJson(res, 200, summarizePhase5AntelopeRuntimePack());
3867
+ return;
3868
+ }
3869
+
3870
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/proton-xpr") {
3871
+ sendJson(res, 200, buildPhase5ProtonXprRuntimePack());
3872
+ return;
3873
+ }
3874
+
3875
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-5/proton-xpr/summary") {
3876
+ sendJson(res, 200, summarizePhase5ProtonXprRuntimePack());
3877
+ return;
3878
+ }
3879
+
3880
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6") {
3881
+ sendJson(res, 200, buildPhase6FrameworkRuntimePack());
3882
+ return;
3883
+ }
3884
+
3885
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/summary") {
3886
+ sendJson(res, 200, summarizePhase6FrameworkRuntimePack());
3887
+ return;
3888
+ }
3889
+
3890
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/langgraph") {
3891
+ sendJson(res, 200, buildPhase6LanggraphRuntimePack());
3892
+ return;
3893
+ }
3894
+
3895
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/langgraph/summary") {
3896
+ sendJson(res, 200, summarizePhase6LanggraphRuntimePack());
3897
+ return;
3898
+ }
3899
+
3900
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/langchain") {
3901
+ sendJson(res, 200, buildPhase6LangchainRuntimePack());
3902
+ return;
3903
+ }
3904
+
3905
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/langchain/summary") {
3906
+ sendJson(res, 200, summarizePhase6LangchainRuntimePack());
3907
+ return;
3908
+ }
3909
+
3910
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/autogen") {
3911
+ sendJson(res, 200, buildPhase6AutogenRuntimePack());
3912
+ return;
3913
+ }
3914
+
3915
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/autogen/summary") {
3916
+ sendJson(res, 200, summarizePhase6AutogenRuntimePack());
3917
+ return;
3918
+ }
3919
+
3920
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/semantic-kernel") {
3921
+ sendJson(res, 200, buildPhase6SemanticKernelRuntimePack());
3922
+ return;
3923
+ }
3924
+
3925
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/semantic-kernel/summary") {
3926
+ sendJson(res, 200, summarizePhase6SemanticKernelRuntimePack());
3927
+ return;
3928
+ }
3929
+
3930
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/framework-continuity") {
3931
+ sendJson(res, 200, buildPhase6FrameworkContinuityPack());
3932
+ return;
3933
+ }
3934
+
3935
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/framework-continuity/summary") {
3936
+ sendJson(res, 200, summarizePhase6FrameworkContinuityPack());
3937
+ return;
3938
+ }
3939
+
3940
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/completion") {
3941
+ sendJson(res, 200, buildPhase6CompletionPack());
3942
+ return;
3943
+ }
3944
+
3945
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/completion/summary") {
3946
+ sendJson(res, 200, summarizePhase6CompletionPack());
3947
+ return;
3948
+ }
3949
+
3950
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/freeze-review") {
3951
+ sendJson(res, 200, buildPhase6FreezeReviewPack());
3952
+ return;
3953
+ }
3954
+
3955
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/freeze-review/summary") {
3956
+ sendJson(res, 200, summarizePhase6FreezeReviewPack());
3957
+ return;
3958
+ }
3959
+
3960
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/freeze-baseline") {
3961
+ sendJson(res, 200, buildPhase6FreezeBaselinePack());
3962
+ return;
3963
+ }
3964
+
3965
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/freeze-baseline/summary") {
3966
+ sendJson(res, 200, summarizePhase6FreezeBaselinePack());
3967
+ return;
3968
+ }
3969
+
3970
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/gate") {
3971
+ sendJson(res, 200, buildPhase6GatePack());
3972
+ return;
3973
+ }
3974
+
3975
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/gate/summary") {
3976
+ sendJson(res, 200, summarizePhase6GatePack());
3977
+ return;
3978
+ }
3979
+
3980
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/closeout") {
3981
+ sendJson(res, 200, buildPhase6CloseoutPack());
3982
+ return;
3983
+ }
3984
+
3985
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/closeout/summary") {
3986
+ sendJson(res, 200, summarizePhase6CloseoutPack());
3987
+ return;
3988
+ }
3989
+
3990
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/decision-record") {
3991
+ sendJson(res, 200, buildPhase6DecisionRecordPack());
3992
+ return;
3993
+ }
3994
+
3995
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/decision-record/summary") {
3996
+ sendJson(res, 200, summarizePhase6DecisionRecordPack());
3997
+ return;
3998
+ }
3999
+
4000
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/decision-resolution") {
4001
+ sendJson(res, 200, buildPhase6DecisionResolutionPack());
4002
+ return;
4003
+ }
4004
+
4005
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-6/decision-resolution/summary") {
4006
+ sendJson(res, 200, summarizePhase6DecisionResolutionPack());
4007
+ return;
4008
+ }
4009
+
4010
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7") {
4011
+ sendJson(res, 200, buildPhase7EventSystemPack());
4012
+ return;
4013
+ }
4014
+
4015
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/summary") {
4016
+ sendJson(res, 200, summarizePhase7EventSystemPack());
4017
+ return;
4018
+ }
4019
+
4020
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/kafka") {
4021
+ sendJson(res, 200, buildPhase7KafkaRuntimePack());
4022
+ return;
4023
+ }
4024
+
4025
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/kafka/summary") {
4026
+ sendJson(res, 200, summarizePhase7KafkaRuntimePack());
4027
+ return;
4028
+ }
4029
+
4030
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/nats") {
4031
+ sendJson(res, 200, buildPhase7NatsRuntimePack());
4032
+ return;
4033
+ }
4034
+
4035
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/nats/summary") {
4036
+ sendJson(res, 200, summarizePhase7NatsRuntimePack());
4037
+ return;
4038
+ }
4039
+
4040
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/mqtt") {
4041
+ sendJson(res, 200, buildPhase7MqttRuntimePack());
4042
+ return;
4043
+ }
4044
+
4045
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/mqtt/summary") {
4046
+ sendJson(res, 200, summarizePhase7MqttRuntimePack());
4047
+ return;
4048
+ }
4049
+
4050
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/webhook-event-bus") {
4051
+ sendJson(res, 200, buildPhase7WebhookEventBusRuntimePack());
4052
+ return;
4053
+ }
4054
+
4055
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/webhook-event-bus/summary") {
4056
+ sendJson(res, 200, summarizePhase7WebhookEventBusRuntimePack());
4057
+ return;
4058
+ }
4059
+
4060
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/event-system-continuity") {
4061
+ sendJson(res, 200, buildPhase7EventSystemContinuityPack());
4062
+ return;
4063
+ }
4064
+
4065
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/event-system-continuity/summary") {
4066
+ sendJson(res, 200, summarizePhase7EventSystemContinuityPack());
4067
+ return;
4068
+ }
4069
+
4070
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/completion") {
4071
+ sendJson(res, 200, buildPhase7CompletionPack());
4072
+ return;
4073
+ }
4074
+
4075
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/completion/summary") {
4076
+ sendJson(res, 200, summarizePhase7CompletionPack());
4077
+ return;
4078
+ }
4079
+
4080
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/freeze-review") {
4081
+ sendJson(res, 200, buildPhase7FreezeReviewPack());
4082
+ return;
4083
+ }
4084
+
4085
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/freeze-baseline") {
4086
+ sendJson(res, 200, buildPhase7FreezeBaselinePack());
4087
+ return;
4088
+ }
4089
+
4090
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/freeze-baseline/summary") {
4091
+ sendJson(res, 200, summarizePhase7FreezeBaselinePack());
4092
+ return;
4093
+ }
4094
+
4095
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/freeze-review/summary") {
4096
+ sendJson(res, 200, summarizePhase7FreezeReviewPack());
4097
+ return;
4098
+ }
4099
+
4100
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/gate") {
4101
+ sendJson(res, 200, buildPhase7GatePack());
4102
+ return;
4103
+ }
4104
+
4105
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/gate/summary") {
4106
+ sendJson(res, 200, summarizePhase7GatePack());
4107
+ return;
4108
+ }
4109
+
4110
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/closeout") {
4111
+ sendJson(res, 200, buildPhase7CloseoutPack());
4112
+ return;
4113
+ }
4114
+
4115
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/closeout/summary") {
4116
+ sendJson(res, 200, summarizePhase7CloseoutPack());
4117
+ return;
4118
+ }
4119
+
4120
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/decision-record") {
4121
+ sendJson(res, 200, buildPhase7DecisionRecordPack());
4122
+ return;
4123
+ }
4124
+
4125
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/decision-record/summary") {
4126
+ sendJson(res, 200, summarizePhase7DecisionRecordPack());
4127
+ return;
4128
+ }
4129
+
4130
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/decision-resolution") {
4131
+ sendJson(res, 200, buildPhase7DecisionResolutionPack());
4132
+ return;
4133
+ }
4134
+
4135
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-7/decision-resolution/summary") {
4136
+ sendJson(res, 200, summarizePhase7DecisionResolutionPack());
4137
+ return;
4138
+ }
4139
+
4140
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8") {
4141
+ sendJson(res, 200, buildPhase8ProofBridgesPack());
4142
+ return;
4143
+ }
4144
+
4145
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/summary") {
4146
+ sendJson(res, 200, summarizePhase8ProofBridgesPack());
4147
+ return;
4148
+ }
4149
+
4150
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/proof-bridge-continuity") {
4151
+ sendJson(res, 200, buildPhase8ProofBridgeContinuityPack());
4152
+ return;
4153
+ }
4154
+
4155
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/proof-bridge-continuity/summary") {
4156
+ sendJson(res, 200, summarizePhase8ProofBridgeContinuityPack());
4157
+ return;
4158
+ }
4159
+
4160
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/completion") {
4161
+ sendJson(res, 200, buildPhase8CompletionPack());
4162
+ return;
4163
+ }
4164
+
4165
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/completion/summary") {
4166
+ sendJson(res, 200, summarizePhase8CompletionPack());
4167
+ return;
4168
+ }
4169
+
4170
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/freeze-baseline") {
4171
+ sendJson(res, 200, buildPhase8FreezeBaselinePack());
4172
+ return;
4173
+ }
4174
+
4175
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/freeze-baseline/summary") {
4176
+ sendJson(res, 200, summarizePhase8FreezeBaselinePack());
4177
+ return;
4178
+ }
4179
+
4180
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/freeze-review") {
4181
+ sendJson(res, 200, buildPhase8FreezeReviewPack());
4182
+ return;
4183
+ }
4184
+
4185
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/freeze-review/summary") {
4186
+ sendJson(res, 200, summarizePhase8FreezeReviewPack());
4187
+ return;
4188
+ }
4189
+
4190
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/gate") {
4191
+ sendJson(res, 200, buildPhase8GatePack());
4192
+ return;
4193
+ }
4194
+
4195
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/gate/summary") {
4196
+ sendJson(res, 200, summarizePhase8GatePack());
4197
+ return;
4198
+ }
4199
+
4200
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/closeout") {
4201
+ sendJson(res, 200, buildPhase8CloseoutPack());
4202
+ return;
4203
+ }
4204
+
4205
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/closeout/summary") {
4206
+ sendJson(res, 200, summarizePhase8CloseoutPack());
4207
+ return;
4208
+ }
4209
+
4210
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/decision-record") {
4211
+ sendJson(res, 200, buildPhase8DecisionRecordPack());
4212
+ return;
4213
+ }
4214
+
4215
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/decision-record/summary") {
4216
+ sendJson(res, 200, summarizePhase8DecisionRecordPack());
4217
+ return;
4218
+ }
4219
+
4220
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/decision-resolution") {
4221
+ sendJson(res, 200, buildPhase8DecisionResolutionPack());
4222
+ return;
4223
+ }
4224
+
4225
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/decision-resolution/summary") {
4226
+ sendJson(res, 200, summarizePhase8DecisionResolutionPack());
4227
+ return;
4228
+ }
4229
+
4230
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/external-result-import") {
4231
+ sendJson(res, 200, buildPhase8ExternalResultImportRuntimePack());
4232
+ return;
4233
+ }
4234
+
4235
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/external-result-import/summary") {
4236
+ sendJson(res, 200, summarizePhase8ExternalResultImportRuntimePack());
4237
+ return;
4238
+ }
4239
+
4240
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/external-receipt-import") {
4241
+ sendJson(res, 200, buildPhase8ExternalReceiptImportRuntimePack());
4242
+ return;
4243
+ }
4244
+
4245
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/external-receipt-import/summary") {
4246
+ sendJson(res, 200, summarizePhase8ExternalReceiptImportRuntimePack());
4247
+ return;
4248
+ }
4249
+
4250
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/proof-bundle-normalization") {
4251
+ sendJson(res, 200, buildPhase8ProofBundleNormalizationRuntimePack());
4252
+ return;
4253
+ }
4254
+
4255
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-8/proof-bundle-normalization/summary") {
4256
+ sendJson(res, 200, summarizePhase8ProofBundleNormalizationRuntimePack());
4257
+ return;
4258
+ }
4259
+
4260
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9") {
4261
+ sendJson(res, 200, buildPhase9TreasuryConnectivityPack());
4262
+ return;
4263
+ }
4264
+
4265
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/summary") {
4266
+ sendJson(res, 200, summarizePhase9TreasuryConnectivityPack());
4267
+ return;
4268
+ }
4269
+
4270
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/treasury-continuity") {
4271
+ sendJson(res, 200, buildPhase9TreasuryContinuityPack());
4272
+ return;
4273
+ }
4274
+
4275
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/treasury-continuity/summary") {
4276
+ sendJson(res, 200, summarizePhase9TreasuryContinuityPack());
4277
+ return;
4278
+ }
4279
+
4280
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/completion") {
4281
+ sendJson(res, 200, buildPhase9CompletionPack());
4282
+ return;
4283
+ }
4284
+
4285
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/completion/summary") {
4286
+ sendJson(res, 200, summarizePhase9CompletionPack());
4287
+ return;
4288
+ }
4289
+
4290
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/freeze-baseline") {
4291
+ sendJson(res, 200, buildPhase9FreezeBaselinePack());
4292
+ return;
4293
+ }
4294
+
4295
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/freeze-baseline/summary") {
4296
+ sendJson(res, 200, summarizePhase9FreezeBaselinePack());
4297
+ return;
4298
+ }
4299
+
4300
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/freeze-review") {
4301
+ sendJson(res, 200, buildPhase9FreezeReviewPack());
4302
+ return;
4303
+ }
4304
+
4305
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/freeze-review/summary") {
4306
+ sendJson(res, 200, summarizePhase9FreezeReviewPack());
4307
+ return;
4308
+ }
4309
+
4310
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/gate") {
4311
+ sendJson(res, 200, buildPhase9GatePack());
4312
+ return;
4313
+ }
4314
+
4315
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/gate/summary") {
4316
+ sendJson(res, 200, summarizePhase9GatePack());
4317
+ return;
4318
+ }
4319
+
4320
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/closeout") {
4321
+ sendJson(res, 200, buildPhase9CloseoutPack());
4322
+ return;
4323
+ }
4324
+
4325
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/closeout/summary") {
4326
+ sendJson(res, 200, summarizePhase9CloseoutPack());
4327
+ return;
4328
+ }
4329
+
4330
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/decision-record") {
4331
+ sendJson(res, 200, buildPhase9DecisionRecordPack());
4332
+ return;
4333
+ }
4334
+
4335
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/decision-record/summary") {
4336
+ sendJson(res, 200, summarizePhase9DecisionRecordPack());
4337
+ return;
4338
+ }
4339
+
4340
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/decision-resolution") {
4341
+ sendJson(res, 200, buildPhase9DecisionResolutionPack());
4342
+ return;
4343
+ }
4344
+
4345
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/decision-resolution/summary") {
4346
+ sendJson(res, 200, summarizePhase9DecisionResolutionPack());
4347
+ return;
4348
+ }
4349
+
4350
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/treasury-destinations") {
4351
+ sendJson(res, 200, buildPhase9TreasuryDestinationsRuntimePack());
4352
+ return;
4353
+ }
4354
+
4355
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/treasury-destinations/summary") {
4356
+ sendJson(res, 200, summarizePhase9TreasuryDestinationsRuntimePack());
4357
+ return;
4358
+ }
4359
+
4360
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/custody-refs") {
4361
+ sendJson(res, 200, buildPhase9CustodyRefsRuntimePack());
4362
+ return;
4363
+ }
4364
+
4365
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/custody-refs/summary") {
4366
+ sendJson(res, 200, summarizePhase9CustodyRefsRuntimePack());
4367
+ return;
4368
+ }
4369
+
4370
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/operator-accounting-bridges") {
4371
+ sendJson(res, 200, buildPhase9OperatorAccountingBridgesRuntimePack());
4372
+ return;
4373
+ }
4374
+
4375
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-9/operator-accounting-bridges/summary") {
4376
+ sendJson(res, 200, summarizePhase9OperatorAccountingBridgesRuntimePack());
4377
+ return;
4378
+ }
2426
4379
 
2427
- function buildPreparedContinuationAdapterCompleteDefaultPathSummary(portableHandoff, continuation) {
2428
- const operatingPath = buildPreparedContinuationDefaultOperatingPathRunSummary(portableHandoff, continuation);
2429
- return {
2430
- ok: operatingPath.ok === true,
2431
- default_operating_path_ref: operatingPath.default_operating_path_ref || null,
2432
- complete_default_path_ref: operatingPath.default_operating_path_ref
2433
- ? `complete.${operatingPath.default_operating_path_ref}`
2434
- : null,
2435
- complete_default_path_ids: Array.isArray(operatingPath.stable_default_operating_path_ids)
2436
- ? operatingPath.stable_default_operating_path_ids
2437
- : [],
2438
- complete_default_path_carry: operatingPath.default_operating_path_carry || {},
2439
- adapter_complete_by_default: operatingPath.operating_path_ready_by_default === true,
2440
- next_surface: "/v1/proof-center/result-package-handoff/review/complete-default-path"
2441
- };
2442
- }
4380
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10") {
4381
+ sendJson(res, 200, buildPhase10LongTailEcosystemPack());
4382
+ return;
4383
+ }
2443
4384
 
2444
- function buildPreparedContinuationAdapterCompleteDefaultPathBundle(portableHandoff, continuation) {
2445
- const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
2446
- const summary = buildPreparedContinuationAdapterCompleteDefaultPathSummary(portableHandoff, continuation);
2447
- return {
2448
- ok: true,
2449
- complete_default_path_summary: summary,
2450
- complete_default_path_template: {
2451
- ok: true,
2452
- complete_default_path_ref: summary.complete_default_path_ref || null,
2453
- target_surface: "/v1/proof-center/result-package-handoff/review/complete-default-path",
2454
- request_template: {
2455
- handoff_bundle: handoff
2456
- },
2457
- stable_boundary_ids: Array.isArray(summary.complete_default_path_ids) ? summary.complete_default_path_ids : []
2458
- }
2459
- };
2460
- }
4385
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/summary") {
4386
+ sendJson(res, 200, summarizePhase10LongTailEcosystemPack());
4387
+ return;
4388
+ }
2461
4389
 
2462
- function buildPreparedContinuationDefaultCompletePathRunSummary(portableHandoff, continuation) {
2463
- const completePath = buildPreparedContinuationAdapterCompleteDefaultPathSummary(portableHandoff, continuation);
2464
- return {
2465
- ok: completePath.ok === true,
2466
- complete_default_path_ref: completePath.complete_default_path_ref || null,
2467
- default_complete_default_path_ref: completePath.complete_default_path_ref
2468
- ? `default.${completePath.complete_default_path_ref}`
2469
- : null,
2470
- stable_default_complete_default_path_ids: Array.isArray(completePath.complete_default_path_ids)
2471
- ? completePath.complete_default_path_ids
2472
- : [],
2473
- default_complete_default_path_carry: completePath.complete_default_path_carry || {},
2474
- complete_default_path_ready: completePath.adapter_complete_by_default === true,
2475
- next_surface: "/v1/proof-center/result-package-handoff/review/complete-default-path-run"
2476
- };
2477
- }
4390
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/long-tail-continuity") {
4391
+ sendJson(res, 200, buildPhase10LongTailContinuityPack());
4392
+ return;
4393
+ }
2478
4394
 
2479
- function buildInteractionResultPackageContinuationRequestTemplate(portableHandoff, continuation) {
2480
- const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
2481
- return {
2482
- ok: true,
2483
- continuation_ref: continuation && continuation.continuation_ref ? continuation.continuation_ref : null,
2484
- target_surface: "/v1/proof-center/result-package-handoff/run",
2485
- review_surface: "/v1/proof-center/result-package-handoff/review",
2486
- request_template: {
2487
- handoff_bundle: handoff,
2488
- evidence_refs: handoff.proof_ref ? [handoff.proof_ref] : [],
2489
- options: {
2490
- legacy_identity_material_hex: "<required_for_local_demo_signing>"
2491
- }
2492
- }
2493
- };
2494
- }
4395
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/long-tail-continuity/summary") {
4396
+ sendJson(res, 200, summarizePhase10LongTailContinuityPack());
4397
+ return;
4398
+ }
2495
4399
 
2496
- function buildOperationsDashboard(filters) {
2497
- const disputes = listRecords(state.disputes, filters);
2498
- const refunds = listRecords(state.refunds, filters);
2499
- const remediationTickets = listRecords(state.remediationTickets, filters);
2500
- const transactions = listTransactionRecords(filters);
2501
- const receipts = listReceiptRecords(filters);
2502
- const deliveries = listRecords(state.deliveries, filters);
2503
- return summarizeOperationsDashboardPayload({
2504
- open_issues: {
2505
- disputes,
2506
- refunds,
2507
- remediation_tickets: remediationTickets
2508
- },
2509
- execution_exceptions: {
2510
- transactions,
2511
- receipts,
2512
- deliveries,
2513
- remediation_tickets: remediationTickets
2514
- }
2515
- });
2516
- }
4400
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/completion") {
4401
+ sendJson(res, 200, buildPhase10CompletionPack());
4402
+ return;
4403
+ }
2517
4404
 
2518
- function buildAttentionRecords(filters) {
2519
- const dashboard = buildOperationsDashboard(filters);
2520
- const refs = dashboard && dashboard.attention_refs ? dashboard.attention_refs : {};
2521
- const disputes = (Array.isArray(refs.dispute_ids) ? refs.dispute_ids : [])
2522
- .map((id) => summarizeDisputePayload(state.disputes.get(id)))
2523
- .filter((entry) => entry && entry.dispute_id);
2524
- const refunds = (Array.isArray(refs.refund_ids) ? refs.refund_ids : [])
2525
- .map((id) => summarizeRefundPayload(state.refunds.get(id)))
2526
- .filter((entry) => entry && entry.refund_id);
2527
- const remediationTickets = (Array.isArray(refs.ticket_ids) ? refs.ticket_ids : [])
2528
- .map((id) => summarizeRemediationTicketPayload(state.remediationTickets.get(id)))
2529
- .filter((entry) => entry && entry.ticket_id);
2530
- const transactions = (Array.isArray(refs.transaction_ids) ? refs.transaction_ids : [])
2531
- .map((id) => summarizeTransactionPayload(state.transactions.get(id)))
2532
- .filter((entry) => entry && entry.transaction_id);
2533
- const receipts = (Array.isArray(refs.receipt_ids) ? refs.receipt_ids : [])
2534
- .map((id) => summarizeReceiptPayload(state.receipts.get(id)))
2535
- .filter((entry) => entry && entry.receipt_id);
2536
- const deliveries = (Array.isArray(refs.delivery_ids) ? refs.delivery_ids : [])
2537
- .map((id) => summarizeDeliveryPayload(state.deliveries.get(id)))
2538
- .filter((entry) => entry && entry.delivery_id);
2539
- return {
2540
- dashboard,
2541
- disputes,
2542
- refunds,
2543
- remediation_tickets: remediationTickets,
2544
- transactions,
2545
- receipts,
2546
- deliveries
2547
- };
2548
- }
4405
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/completion/summary") {
4406
+ sendJson(res, 200, summarizePhase10CompletionPack());
4407
+ return;
4408
+ }
2549
4409
 
2550
- function buildOperatorShellSummaryPayload(body) {
2551
- const requestBody = body && typeof body === "object" && !Array.isArray(body) ? body : {};
2552
- const accountId = requestBody.account_id || "acct_demo";
2553
- const runtimeDurability = buildRuntimeDurabilitySummary();
2554
- const nativeSettlementReadiness = buildNativeSettlementReadinessSummary();
2555
- return buildOperatorShellSummary({
2556
- account_id: accountId,
2557
- operations_dashboard: buildOperationsDashboard({ account_id: accountId }),
2558
- operator_export_pack: buildOperatorExportPack(state, { account_id: accountId }, listRecords, {
2559
- runtime_durability: runtimeDurability,
2560
- native_settlement_readiness: nativeSettlementReadiness
2561
- }),
2562
- economics_operator_view: buildOperatorView(state, accountId),
2563
- economics_operator_dashboard: buildOperatorDashboard(state, accountId),
2564
- entitlement_replenishment_summary: buildEntitlementReplenishmentSummary(state, accountId),
2565
- hosted_checkout_operator_summary: buildHostedCheckoutOperatorSummary(state, accountId),
2566
- coordination_operator_view: buildCoordinationOperatorView(requestBody),
2567
- coordination_admin_view: buildCoordinationAdminView(requestBody),
2568
- runtime_durability: runtimeDurability,
2569
- native_settlement_readiness: nativeSettlementReadiness
2570
- });
2571
- }
4410
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/freeze-review") {
4411
+ sendJson(res, 200, buildPhase10FreezeReviewPack());
4412
+ return;
4413
+ }
2572
4414
 
2573
- async function routeRequest(req, res) {
2574
- const url = new URL(req.url, "http://127.0.0.1");
2575
- hydrateQuoteStates(state);
2576
- hydratePendingExecutions(state);
4415
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/freeze-review/summary") {
4416
+ sendJson(res, 200, summarizePhase10FreezeReviewPack());
4417
+ return;
4418
+ }
2577
4419
 
2578
- if (req.method === "GET" && url.pathname === "/health") {
2579
- sendJson(res, 200, {
2580
- status: "ok",
2581
- service: "xytara",
2582
- readiness: "ready",
2583
- runtime_durability: buildRuntimeDurabilitySummary(),
2584
- native_settlement_readiness: buildNativeSettlementReadinessSummary()
2585
- });
4420
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/freeze-baseline") {
4421
+ sendJson(res, 200, buildPhase10FreezeBaselinePack());
2586
4422
  return;
2587
4423
  }
2588
4424
 
2589
- if (req.method === "GET" && url.pathname === "/v1/release-pack") {
2590
- sendJson(res, 200, buildReleasePack());
4425
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/freeze-baseline/summary") {
4426
+ sendJson(res, 200, summarizePhase10FreezeBaselinePack());
2591
4427
  return;
2592
4428
  }
2593
4429
 
2594
- if (req.method === "GET" && url.pathname === "/v1/release-pack/summary") {
2595
- sendJson(res, 200, summarizeReleasePack());
4430
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/gate") {
4431
+ sendJson(res, 200, buildPhase10GatePack());
2596
4432
  return;
2597
4433
  }
2598
4434
 
2599
- if (req.method === "GET" && url.pathname === "/v1/release-pack/comparison") {
2600
- sendJson(res, 200, buildComparisonPack());
4435
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/gate/summary") {
4436
+ sendJson(res, 200, summarizePhase10GatePack());
2601
4437
  return;
2602
4438
  }
2603
4439
 
2604
- if (req.method === "GET" && url.pathname === "/v1/release-pack/comparison/summary") {
2605
- sendJson(res, 200, summarizeComparisonPack());
4440
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/closeout") {
4441
+ sendJson(res, 200, buildPhase10CloseoutPack());
2606
4442
  return;
2607
4443
  }
2608
4444
 
2609
- if (req.method === "GET" && url.pathname === "/v1/release-pack/adoption") {
2610
- sendJson(res, 200, buildAdoptionPack());
4445
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/closeout/summary") {
4446
+ sendJson(res, 200, summarizePhase10CloseoutPack());
2611
4447
  return;
2612
4448
  }
2613
4449
 
2614
- if (req.method === "GET" && url.pathname === "/v1/release-pack/adoption/summary") {
2615
- sendJson(res, 200, summarizeAdoptionPack());
4450
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/decision-record") {
4451
+ sendJson(res, 200, buildPhase10DecisionRecordPack());
2616
4452
  return;
2617
4453
  }
2618
4454
 
2619
- if (req.method === "GET" && url.pathname === "/v1/release-pack/scenarios") {
2620
- sendJson(res, 200, buildScenarioPack());
4455
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/decision-record/summary") {
4456
+ sendJson(res, 200, summarizePhase10DecisionRecordPack());
2621
4457
  return;
2622
4458
  }
2623
4459
 
2624
- if (req.method === "GET" && url.pathname === "/v1/release-pack/scenarios/summary") {
2625
- sendJson(res, 200, summarizeScenarioPack());
4460
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/decision-resolution") {
4461
+ sendJson(res, 200, buildPhase10DecisionResolutionPack());
2626
4462
  return;
2627
4463
  }
2628
4464
 
2629
- if (req.method === "GET" && url.pathname === "/v1/release-pack/launch") {
2630
- sendJson(res, 200, buildLaunchPack({
2631
- liveReadiness: buildNativeSettlementReadinessSummary()
2632
- }));
4465
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/decision-resolution/summary") {
4466
+ sendJson(res, 200, summarizePhase10DecisionResolutionPack());
2633
4467
  return;
2634
4468
  }
2635
4469
 
2636
- if (req.method === "GET" && url.pathname === "/v1/release-pack/launch/summary") {
2637
- sendJson(res, 200, summarizeLaunchPack({
2638
- liveReadiness: buildNativeSettlementReadinessSummary()
2639
- }));
4470
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/demand-signal-adapters") {
4471
+ sendJson(res, 200, buildPhase10DemandSignalAdaptersRuntimePack());
2640
4472
  return;
2641
4473
  }
2642
4474
 
2643
- if (req.method === "GET" && url.pathname === "/v1/release-manifest") {
2644
- sendJson(res, 200, buildReleaseManifest());
4475
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/demand-signal-adapters/summary") {
4476
+ sendJson(res, 200, summarizePhase10DemandSignalAdaptersRuntimePack());
2645
4477
  return;
2646
4478
  }
2647
4479
 
2648
- if (req.method === "GET" && url.pathname === "/v1/release-manifest/summary") {
2649
- sendJson(res, 200, summarizeReleaseManifest());
4480
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/niche-extension-registry") {
4481
+ sendJson(res, 200, buildPhase10NicheExtensionRegistryRuntimePack());
2650
4482
  return;
2651
4483
  }
2652
4484
 
2653
- if (req.method === "GET" && url.pathname === "/v1/release-notes") {
2654
- sendJson(res, 200, buildLaunchNotes());
4485
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/niche-extension-registry/summary") {
4486
+ sendJson(res, 200, summarizePhase10NicheExtensionRegistryRuntimePack());
2655
4487
  return;
2656
4488
  }
2657
4489
 
2658
- if (req.method === "GET" && url.pathname === "/v1/release-notes/summary") {
2659
- sendJson(res, 200, summarizeLaunchNotes());
4490
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/ecosystem-backlog-triage") {
4491
+ sendJson(res, 200, buildPhase10EcosystemBacklogTriageRuntimePack());
2660
4492
  return;
2661
4493
  }
2662
4494
 
2663
- if (req.method === "GET" && url.pathname === "/v1/release-center") {
2664
- sendJson(res, 200, buildReleaseCenter({
2665
- liveReadiness: buildNativeSettlementReadinessSummary()
2666
- }));
4495
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-10/ecosystem-backlog-triage/summary") {
4496
+ sendJson(res, 200, summarizePhase10EcosystemBacklogTriageRuntimePack());
2667
4497
  return;
2668
4498
  }
2669
4499
 
2670
- if (req.method === "GET" && url.pathname === "/v1/release-center/summary") {
2671
- sendJson(res, 200, summarizeReleaseCenter({
2672
- liveReadiness: buildNativeSettlementReadinessSummary()
2673
- }));
4500
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/evm") {
4501
+ sendJson(res, 200, buildPhase2EvmRuntimePack());
2674
4502
  return;
2675
4503
  }
2676
4504
 
2677
- if (req.method === "GET" && url.pathname === "/v1/release-history") {
2678
- sendJson(res, 200, buildReleaseHistory());
4505
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/evm/summary") {
4506
+ sendJson(res, 200, summarizePhase2EvmRuntimePack());
2679
4507
  return;
2680
4508
  }
2681
4509
 
2682
- if (req.method === "GET" && url.pathname === "/v1/release-history/summary") {
2683
- sendJson(res, 200, summarizeReleaseHistory());
4510
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/base") {
4511
+ sendJson(res, 200, buildPhase2BaseRuntimePack());
4512
+ return;
4513
+ }
4514
+
4515
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/base/summary") {
4516
+ sendJson(res, 200, summarizePhase2BaseRuntimePack());
4517
+ return;
4518
+ }
4519
+
4520
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/usdc") {
4521
+ sendJson(res, 200, buildPhase2UsdcRuntimePack());
4522
+ return;
4523
+ }
4524
+
4525
+ if (req.method === "GET" && url.pathname === "/v1/phases/phase-2/usdc/summary") {
4526
+ sendJson(res, 200, summarizePhase2UsdcRuntimePack());
2684
4527
  return;
2685
4528
  }
2686
4529
 
@@ -3962,6 +5805,30 @@ async function routeRequest(req, res) {
3962
5805
  return;
3963
5806
  }
3964
5807
 
5808
+ if (req.method === "GET" && url.pathname.startsWith("/v1/economics/accounts/") && url.pathname.endsWith("/wallet")) {
5809
+ const accountId = getDecodedSuffixId(url.pathname, "/v1/economics/accounts/").replace(/\/wallet$/, "");
5810
+ sendJson(res, 200, buildWalletSummary(state, accountId));
5811
+ return;
5812
+ }
5813
+
5814
+ if (req.method === "GET" && url.pathname.startsWith("/v1/economics/accounts/") && url.pathname.endsWith("/wallet-ledger-summary")) {
5815
+ const accountId = getDecodedSuffixId(url.pathname, "/v1/economics/accounts/").replace(/\/wallet-ledger-summary$/, "");
5816
+ sendJson(res, 200, buildWalletLedgerSummary(state, accountId));
5817
+ return;
5818
+ }
5819
+
5820
+ if (req.method === "GET" && url.pathname.startsWith("/v1/economics/accounts/") && url.pathname.endsWith("/intelligence-summary")) {
5821
+ const accountId = getDecodedSuffixId(url.pathname, "/v1/economics/accounts/").replace(/\/intelligence-summary$/, "");
5822
+ sendJson(res, 200, buildEconomicsIntelligenceSummary(state, accountId));
5823
+ return;
5824
+ }
5825
+
5826
+ if (req.method === "GET" && url.pathname.startsWith("/v1/economics/accounts/") && url.pathname.endsWith("/treasury-intelligence-summary")) {
5827
+ const accountId = getDecodedSuffixId(url.pathname, "/v1/economics/accounts/").replace(/\/treasury-intelligence-summary$/, "");
5828
+ sendJson(res, 200, buildTreasuryIntelligenceSummary(state, accountId));
5829
+ return;
5830
+ }
5831
+
3965
5832
  if (req.method === "GET" && url.pathname.startsWith("/v1/economics/accounts/") && url.pathname.endsWith("/metering-summary")) {
3966
5833
  const accountId = getDecodedSuffixId(url.pathname, "/v1/economics/accounts/").replace(/\/metering-summary$/, "");
3967
5834
  sendJson(res, 200, buildUsageMeteringSummary(state, accountId));
@@ -6155,26 +8022,34 @@ function createServer() {
6155
8022
  }
6156
8023
  });
6157
8024
  }
6158
- routeRequest(req, res).catch((error) => {
6159
- sendJson(res, 500, { ok: false, reason: error.message });
6160
- });
8025
+ runtimeStateReady
8026
+ .then(() => routeRequest(req, res))
8027
+ .catch((error) => {
8028
+ sendJson(res, 500, { ok: false, reason: error.message });
8029
+ });
6161
8030
  });
6162
8031
  }
6163
8032
 
6164
8033
  if (require.main === module) {
6165
- const port = Number(process.env.XYTARA_PORT || 4320);
6166
- const host = process.env.XYTARA_HOST || "127.0.0.1";
6167
- const server = createServer();
6168
- runtimeStateStore.start(state);
6169
- server.listen(port, host, () => {
6170
- console.log(`xytara listening on http://${host}:${port}`);
8034
+ (async () => {
8035
+ const port = Number(process.env.XYTARA_PORT || 4320);
8036
+ const host = process.env.XYTARA_HOST || "127.0.0.1";
8037
+ const server = createServer();
8038
+ await runtimeStateReady;
8039
+ runtimeStateStore.start(state);
8040
+ server.listen(port, host, () => {
8041
+ console.log(`xytara listening on http://${host}:${port}`);
8042
+ });
8043
+ const shutdown = async () => {
8044
+ await runtimeStateStore.stop(state);
8045
+ server.close(() => process.exit(0));
8046
+ };
8047
+ process.on("SIGINT", shutdown);
8048
+ process.on("SIGTERM", shutdown);
8049
+ })().catch((error) => {
8050
+ console.error(error);
8051
+ process.exitCode = 1;
6171
8052
  });
6172
- const shutdown = () => {
6173
- runtimeStateStore.stop(state);
6174
- server.close(() => process.exit(0));
6175
- };
6176
- process.on("SIGINT", shutdown);
6177
- process.on("SIGTERM", shutdown);
6178
8053
  }
6179
8054
 
6180
8055
  module.exports = {