@wowok/agent-mcp 3.4.1 → 3.4.3

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 (323) hide show
  1. package/dist/.build-stamp.json +5 -0
  2. package/dist/chain-semantics/composition-truth.js +1 -1
  3. package/dist/chain-semantics/eval-order.js +1 -1
  4. package/dist/chain-semantics/field-capability.js +1 -1
  5. package/dist/chain-semantics/freeze-map.js +1 -1
  6. package/dist/chain-semantics/fund-flow.js +1 -1
  7. package/dist/chain-semantics/guard-verbs.js +1 -1
  8. package/dist/chain-semantics/object-graph.js +1 -1
  9. package/dist/composition/audit.js +1 -1
  10. package/dist/composition/compile.d.ts +10 -3
  11. package/dist/composition/compile.js +1 -1
  12. package/dist/composition/emit-phases.d.ts +30 -2
  13. package/dist/composition/emit-phases.js +1 -1
  14. package/dist/composition/guard-fill.d.ts +8 -0
  15. package/dist/composition/guard-fill.js +1 -1
  16. package/dist/composition/inflight.js +1 -1
  17. package/dist/composition/input-normalize.js +1 -1
  18. package/dist/composition/materialize.d.ts +2 -0
  19. package/dist/composition/materialize.js +1 -1
  20. package/dist/composition/mode-gates.js +1 -1
  21. package/dist/composition/param-disclosure.js +1 -1
  22. package/dist/composition/plan-retry-ledger.d.ts +16 -0
  23. package/dist/composition/plan-retry-ledger.js +1 -1
  24. package/dist/composition/plan.d.ts +15 -1
  25. package/dist/composition/plan.js +1 -1
  26. package/dist/config/config-audit.spec.js +1 -1
  27. package/dist/config/judgment.d.ts +5 -0
  28. package/dist/config/judgment.js +1 -1
  29. package/dist/evaluation/builtins/arbitration-score.d.ts +1 -0
  30. package/dist/evaluation/builtins/arbitration-score.js +1 -1
  31. package/dist/evaluation/builtins/demand-match.js +1 -1
  32. package/dist/evaluation/builtins/graph-service.d.ts +8 -0
  33. package/dist/evaluation/builtins/graph-service.js +1 -1
  34. package/dist/evaluation/capability.d.ts +9 -0
  35. package/dist/evaluation/engine.js +1 -1
  36. package/dist/evaluation/extract.d.ts +9 -1
  37. package/dist/evaluation/extract.js +1 -1
  38. package/dist/evaluation/match-operation.js +1 -1
  39. package/dist/evaluation/match-policy.d.ts +5 -3
  40. package/dist/evaluation/match-policy.js +1 -1
  41. package/dist/evaluation/standards.d.ts +1 -0
  42. package/dist/evaluation/standards.js +1 -1
  43. package/dist/evaluation/structured-lines.js +1 -1
  44. package/dist/evaluation/types.d.ts +1 -0
  45. package/dist/extensions/capability.js +1 -1
  46. package/dist/extensions/industry-pack.js +1 -1
  47. package/dist/extensions/modes.js +1 -1
  48. package/dist/harness/recover.js +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/intent/types.d.ts +1 -1
  51. package/dist/intent/types.js +1 -1
  52. package/dist/knowledge/allocation-ledger.js +1 -1
  53. package/dist/knowledge/allocator-rail-verifier.d.ts +17 -1
  54. package/dist/knowledge/allocator-rail-verifier.js +1 -1
  55. package/dist/knowledge/arb-fund-facts.d.ts +7 -0
  56. package/dist/knowledge/arb-fund-facts.js +1 -1
  57. package/dist/knowledge/arbitration-rail-verifier.d.ts +35 -0
  58. package/dist/knowledge/arbitration-rail-verifier.js +1 -0
  59. package/dist/knowledge/arbitration-templates.js +1 -1
  60. package/dist/knowledge/audit-rules.d.ts +13 -1
  61. package/dist/knowledge/audit-rules.js +1 -1
  62. package/dist/knowledge/baselines/judgment-baselines.json +1 -0
  63. package/dist/knowledge/baselines/rules/guard.json +7 -6
  64. package/dist/knowledge/baselines/rules/progress.json +4 -4
  65. package/dist/knowledge/baselines/rules/reward.json +118 -3
  66. package/dist/knowledge/builtin-templates.d.ts +19 -2
  67. package/dist/knowledge/builtin-templates.js +1 -1
  68. package/dist/knowledge/chain-query-registry.d.ts +14 -0
  69. package/dist/knowledge/chain-query-registry.js +1 -0
  70. package/dist/knowledge/event-semantics.js +1 -1
  71. package/dist/knowledge/fee-param-bindings.d.ts +2 -0
  72. package/dist/knowledge/fee-param-bindings.js +1 -1
  73. package/dist/knowledge/getting-started.js +1 -1
  74. package/dist/knowledge/guard-binding-table.js +1 -1
  75. package/dist/knowledge/guard-binding-verifier.d.ts +7 -0
  76. package/dist/knowledge/guard-binding-verifier.js +1 -1
  77. package/dist/knowledge/guard-bindings.js +1 -1
  78. package/dist/knowledge/guard-design-patterns.d.ts +1 -1
  79. package/dist/knowledge/guard-design-patterns.js +1 -1
  80. package/dist/knowledge/guard-field-cognition.js +1 -1
  81. package/dist/knowledge/guard-host-context.js +1 -1
  82. package/dist/knowledge/guard-lint.js +1 -1
  83. package/dist/knowledge/guard-node-gates.d.ts +3 -1
  84. package/dist/knowledge/guard-node-gates.js +1 -1
  85. package/dist/knowledge/guard-puzzle.js +1 -1
  86. package/dist/knowledge/guard-render.js +1 -1
  87. package/dist/knowledge/guard-risk.js +1 -1
  88. package/dist/knowledge/guard-templates.d.ts +2 -1
  89. package/dist/knowledge/guard-templates.js +1 -1
  90. package/dist/knowledge/guard-translation.js +1 -1
  91. package/dist/knowledge/index.d.ts +2 -0
  92. package/dist/knowledge/index.js +1 -1
  93. package/dist/knowledge/industry-registry.js +1 -1
  94. package/dist/knowledge/jsonrpc-enum.js +1 -1
  95. package/dist/knowledge/knob-docs.js +1 -1
  96. package/dist/knowledge/param-schema.d.ts +1 -1
  97. package/dist/knowledge/param-schema.js +1 -1
  98. package/dist/knowledge/param-tiers.d.ts +2 -0
  99. package/dist/knowledge/param-tiers.js +1 -1
  100. package/dist/knowledge/path-oracle/products/food-delivery.js +1 -1
  101. package/dist/knowledge/pattern-resolutions.d.ts +2 -0
  102. package/dist/knowledge/pattern-resolutions.js +1 -1
  103. package/dist/knowledge/product-detail-source.d.ts +37 -0
  104. package/dist/knowledge/product-detail-source.js +1 -0
  105. package/dist/knowledge/product-doc-b5.d.ts +16 -0
  106. package/dist/knowledge/product-doc-b5.js +1 -0
  107. package/dist/knowledge/progress-ledger.js +1 -1
  108. package/dist/knowledge/projection.spec.js +1 -1
  109. package/dist/knowledge/publish-gate.d.ts +20 -0
  110. package/dist/knowledge/publish-gate.js +1 -0
  111. package/dist/knowledge/publish-readiness.d.ts +25 -0
  112. package/dist/knowledge/publish-readiness.js +1 -0
  113. package/dist/knowledge/publish-surface-contract.d.ts +16 -0
  114. package/dist/knowledge/publish-surface-contract.js +1 -0
  115. package/dist/knowledge/rail-exit-satisfiability.d.ts +25 -0
  116. package/dist/knowledge/rail-exit-satisfiability.js +1 -0
  117. package/dist/knowledge/reward-ledger.d.ts +1 -1
  118. package/dist/knowledge/reward-ledger.js +1 -1
  119. package/dist/knowledge/reward-risk.d.ts +1 -1
  120. package/dist/knowledge/reward-risk.js +1 -1
  121. package/dist/knowledge/scenario-modes.js +1 -1
  122. package/dist/knowledge/service-ledger.d.ts +3 -1
  123. package/dist/knowledge/service-ledger.js +1 -1
  124. package/dist/knowledge/template-loader.d.ts +41 -2
  125. package/dist/knowledge/template-loader.js +1 -1
  126. package/dist/knowledge/template-registry.js +1 -1
  127. package/dist/knowledge/template-scanner.d.ts +17 -0
  128. package/dist/knowledge/template-scanner.js +1 -1
  129. package/dist/knowledge/template-test-profiles.js +1 -1
  130. package/dist/knowledge/workflow-guidance.d.ts +4 -0
  131. package/dist/knowledge/workflow-guidance.js +1 -1
  132. package/dist/monitor/MonitorLoop.js +1 -1
  133. package/dist/monitor/normalize.d.ts +1 -1
  134. package/dist/monitor/normalize.js +1 -1
  135. package/dist/monitor/types.js +1 -1
  136. package/dist/participation/customer-interest.d.ts +4 -0
  137. package/dist/participation/customer-interest.js +1 -1
  138. package/dist/participation/game-context.js +1 -1
  139. package/dist/participation/node-action-advisor.d.ts +4 -0
  140. package/dist/participation/node-action-advisor.js +1 -1
  141. package/dist/participation/radar-core.js +1 -1
  142. package/dist/participation/time-window.d.ts +11 -0
  143. package/dist/participation/time-window.js +1 -1
  144. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  145. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  146. package/dist/playbooks/service-build/merchant-guide.d.ts +28 -3
  147. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  148. package/dist/playbooks/service-build/object-panorama.d.ts +4 -0
  149. package/dist/playbooks/service-build/object-panorama.js +1 -1
  150. package/dist/playbooks/service-build/participation-radar.js +1 -1
  151. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  152. package/dist/playbooks/service-build/service-panorama.js +1 -1
  153. package/dist/playbooks/service-build/service-quote.js +1 -1
  154. package/dist/review/index.js +1 -1
  155. package/dist/review/order.js +1 -1
  156. package/dist/safety/confirm-gate.js +1 -1
  157. package/dist/schema/benchmark-migration/index.d.ts +24 -0
  158. package/dist/schema/benchmark-migration/index.js +1 -1
  159. package/dist/schema/call/allocation.d.ts +11 -7
  160. package/dist/schema/call/allocation.js +1 -1
  161. package/dist/schema/call/arbitration.d.ts +4 -0
  162. package/dist/schema/call/arbitration.js +1 -1
  163. package/dist/schema/call/base.d.ts +28 -0
  164. package/dist/schema/call/base.js +1 -1
  165. package/dist/schema/call/bridge.d.ts +21 -0
  166. package/dist/schema/call/contact.d.ts +4 -0
  167. package/dist/schema/call/demand.d.ts +4 -0
  168. package/dist/schema/call/guard.d.ts +12 -0
  169. package/dist/schema/call/handler.d.ts +1 -0
  170. package/dist/schema/call/handler.js +1 -1
  171. package/dist/schema/call/machine.d.ts +16 -8
  172. package/dist/schema/call/normalize-error.d.ts +1 -0
  173. package/dist/schema/call/normalize-error.js +1 -0
  174. package/dist/schema/call/order.d.ts +7 -3
  175. package/dist/schema/call/order.js +1 -1
  176. package/dist/schema/call/payment.d.ts +7 -3
  177. package/dist/schema/call/permission.d.ts +4 -0
  178. package/dist/schema/call/personal.d.ts +4 -0
  179. package/dist/schema/call/progress.d.ts +4 -0
  180. package/dist/schema/call/progress.js +1 -1
  181. package/dist/schema/call/proof.d.ts +8 -0
  182. package/dist/schema/call/proof.js +1 -1
  183. package/dist/schema/call/receipt.js +1 -1
  184. package/dist/schema/call/repository.d.ts +4 -0
  185. package/dist/schema/call/reward.d.ts +6 -2
  186. package/dist/schema/call/reward.js +1 -1
  187. package/dist/schema/call/semantic.d.ts +2 -2
  188. package/dist/schema/call/semantic.js +1 -1
  189. package/dist/schema/call/service.d.ts +21 -7
  190. package/dist/schema/call/service.js +1 -1
  191. package/dist/schema/call/treasury.d.ts +10 -6
  192. package/dist/schema/common/index.js +1 -1
  193. package/dist/schema/envelope-unify.d.ts +1 -0
  194. package/dist/schema/envelope-unify.js +1 -1
  195. package/dist/schema/evaluation/index.d.ts +43 -0
  196. package/dist/schema/evaluation/index.js +1 -1
  197. package/dist/schema/goal/index.d.ts +14 -2
  198. package/dist/schema/goal/planning.d.ts +18 -0
  199. package/dist/schema/goal/planning.js +1 -1
  200. package/dist/schema/intent-radar/index.d.ts +12 -0
  201. package/dist/schema/intent-radar/index.js +1 -1
  202. package/dist/schema/keeper/index.d.ts +1 -0
  203. package/dist/schema/local/index.d.ts +10 -0
  204. package/dist/schema/local/index.js +1 -1
  205. package/dist/schema/local/wip.js +1 -1
  206. package/dist/schema/messenger/index.d.ts +1 -0
  207. package/dist/schema/messenger/index.js +1 -1
  208. package/dist/schema/operations.d.ts +98 -13
  209. package/dist/schema/operations.js +1 -1
  210. package/dist/schema/persona/index.d.ts +22 -0
  211. package/dist/schema/query/bi.d.ts +28 -2
  212. package/dist/schema/query/bi.js +1 -1
  213. package/dist/schema/query/index.d.ts +67 -61
  214. package/dist/schema/query/index.js +1 -1
  215. package/dist/schema/schema-version.js +1 -1
  216. package/dist/schema/workflow/index.js +1 -1
  217. package/dist/schema-query-impl/index.d.ts +1 -0
  218. package/dist/schema-query-impl/index.js +1 -1
  219. package/dist/schemas/account_operation.output.json +2 -1
  220. package/dist/schemas/benchmark_migration_operation.output.json +74 -0
  221. package/dist/schemas/benchmark_migration_operation.schema.json +33 -1
  222. package/dist/schemas/bridge_operation.output.json +2 -1
  223. package/dist/schemas/bridge_operation.schema.json +40 -0
  224. package/dist/schemas/evaluation_operation.output.json +96 -0
  225. package/dist/schemas/evaluation_operation.schema.json +39 -0
  226. package/dist/schemas/goal_operation.schema.json +32 -0
  227. package/dist/schemas/guard2file.schema.json +8 -0
  228. package/dist/schemas/index.json +1 -1
  229. package/dist/schemas/intent_radar.output.json +10 -2
  230. package/dist/schemas/intent_radar.schema.json +5 -1
  231. package/dist/schemas/keeper_operation.output.json +2 -1
  232. package/dist/schemas/local_cache_operation.output.json +2 -1
  233. package/dist/schemas/local_history_operation.output.json +2 -1
  234. package/dist/schemas/local_info_operation.output.json +2 -1
  235. package/dist/schemas/local_mark_operation.output.json +2 -1
  236. package/dist/schemas/local_mark_operation.schema.json +10 -1
  237. package/dist/schemas/machineNode2file.schema.json +8 -0
  238. package/dist/schemas/messenger_operation.output.json +2 -1
  239. package/dist/schemas/messenger_operation.schema.json +2 -1
  240. package/dist/schemas/monitor_events.output.json +2 -1
  241. package/dist/schemas/monitor_subscription.output.json +2 -1
  242. package/dist/schemas/onchain_events.output.json +206 -13
  243. package/dist/schemas/onchain_events.schema.json +16 -0
  244. package/dist/schemas/onchain_operations.output.json +22 -3
  245. package/dist/schemas/onchain_operations.schema.json +982 -327
  246. package/dist/schemas/onchain_operations_allocation.schema.json +20 -13
  247. package/dist/schemas/onchain_operations_arbitration.schema.json +9 -1
  248. package/dist/schemas/onchain_operations_contact.schema.json +8 -0
  249. package/dist/schemas/onchain_operations_demand.schema.json +8 -0
  250. package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
  251. package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
  252. package/dist/schemas/onchain_operations_guard.schema.json +655 -115
  253. package/dist/schemas/onchain_operations_machine.schema.json +11 -3
  254. package/dist/schemas/onchain_operations_order.schema.json +14 -11
  255. package/dist/schemas/onchain_operations_payment.schema.json +12 -9
  256. package/dist/schemas/onchain_operations_permission.schema.json +8 -0
  257. package/dist/schemas/onchain_operations_personal.schema.json +8 -0
  258. package/dist/schemas/onchain_operations_progress.schema.json +9 -1
  259. package/dist/schemas/onchain_operations_proof.schema.json +9 -1
  260. package/dist/schemas/onchain_operations_repository.schema.json +8 -0
  261. package/dist/schemas/onchain_operations_reward.schema.json +14 -11
  262. package/dist/schemas/onchain_operations_service.schema.json +25 -12
  263. package/dist/schemas/onchain_operations_treasury.schema.json +17 -19
  264. package/dist/schemas/onchain_table_data.output.json +52 -10
  265. package/dist/schemas/persona_operation.output.json +57 -0
  266. package/dist/schemas/persona_operation.schema.json +9 -0
  267. package/dist/schemas/query_toolkit.output.json +326 -23
  268. package/dist/schemas/query_toolkit.schema.json +18 -5
  269. package/dist/schemas/wip_file.output.json +2 -2
  270. package/dist/schemas/wip_file.schema.json +2 -2
  271. package/dist/schemas/workflow_operation.schema.json +1 -1
  272. package/dist/tools/error-catalog.d.ts +17 -0
  273. package/dist/tools/error-catalog.js +1 -0
  274. package/dist/tools/handlers/benchmark-migration.d.ts +29 -8
  275. package/dist/tools/handlers/benchmark-migration.js +1 -1
  276. package/dist/tools/handlers/config.js +1 -1
  277. package/dist/tools/handlers/entry-edge-recipe.d.ts +101 -0
  278. package/dist/tools/handlers/entry-edge-recipe.js +1 -0
  279. package/dist/tools/handlers/escrow-deficit.d.ts +10 -0
  280. package/dist/tools/handlers/escrow-deficit.js +1 -0
  281. package/dist/tools/handlers/evaluation.js +1 -1
  282. package/dist/tools/handlers/fund-rail-recipe.d.ts +10 -0
  283. package/dist/tools/handlers/fund-rail-recipe.js +1 -0
  284. package/dist/tools/handlers/intent-radar.js +1 -1
  285. package/dist/tools/handlers/local.js +1 -1
  286. package/dist/tools/handlers/mark-namespace.d.ts +30 -0
  287. package/dist/tools/handlers/mark-namespace.js +1 -0
  288. package/dist/tools/handlers/messenger.js +1 -1
  289. package/dist/tools/handlers/onchain-name-registration.d.ts +1 -0
  290. package/dist/tools/handlers/onchain-name-registration.js +1 -1
  291. package/dist/tools/handlers/onchain-name-registration.spec.js +1 -1
  292. package/dist/tools/handlers/onchain.d.ts +40 -1
  293. package/dist/tools/handlers/onchain.js +1 -1
  294. package/dist/tools/handlers/publish-binding-echo.d.ts +22 -0
  295. package/dist/tools/handlers/publish-binding-echo.js +1 -0
  296. package/dist/tools/handlers/query.d.ts +1 -1
  297. package/dist/tools/handlers/query.js +1 -1
  298. package/dist/tools/handlers/review-chain.d.ts +1 -0
  299. package/dist/tools/handlers/review-chain.js +1 -1
  300. package/dist/tools/handlers/schema-query.js +1 -1
  301. package/dist/tools/handlers/stale-build-check.d.ts +9 -0
  302. package/dist/tools/handlers/stale-build-check.js +1 -0
  303. package/dist/tools/handlers/submission-assembly.d.ts +55 -0
  304. package/dist/tools/handlers/submission-assembly.js +1 -0
  305. package/dist/tools/handlers/wip.js +1 -1
  306. package/dist/tools/index.d.ts +1 -0
  307. package/dist/tools/index.js +1 -1
  308. package/dist/tools/move-fn-index.gen.js +1 -1
  309. package/dist/tools/publish-gate-state.d.ts +5 -0
  310. package/dist/tools/publish-gate-state.js +1 -0
  311. package/dist/tools/registry/business.js +1 -1
  312. package/dist/tools/registry/onchain.js +1 -1
  313. package/dist/tools/registry/query.js +1 -1
  314. package/dist/tools/retry.js +1 -1
  315. package/dist/tools/runtime-health.js +1 -1
  316. package/dist/tools/shared.js +1 -1
  317. package/dist/tools/upgrade-check.d.ts +1 -0
  318. package/dist/tools/upgrade-check.js +1 -1
  319. package/dist/tools/wip-verify-ledger.d.ts +2 -0
  320. package/dist/tools/wip-verify-ledger.js +1 -1
  321. package/dist/tools/wrap.d.ts +15 -1
  322. package/dist/tools/wrap.js +1 -1
  323. package/package.json +5 -3
@@ -1 +1 @@
1
- import{CANONICAL_COMPILE_ORDER,compilePhaseRank}from'../knowledge/object-dependency.js';import{deriveCapabilityModes,emitModeGates}from'./mode-gates.js';import{normalizeCompileInputs,applyConditionalSelectors}from'./input-normalize.js';import{fillGuards}from'./guard-fill.js';import{auditRepoIntegrityAndCallerLegs,checkAllocatorRails,checkDaysUnitSlots,checkForeignServicePins,checkWindowTruncation,computeMoneyRailKeys,dropEmptyVecGuards,emitAllocators,emitArbitrationBindings,emitArbitrationHoist,emitEvidenceRepository,emitGuardWave,emitIdentityPhase,emitMachine,emitRewardClaimEarly,emitReviewComponent,emitReviewRepositoryEarly,emitSales,emitServiceAllocators,emitServiceConfigure,emitServiceDraft,emitServicePublish,emitSupplyChain,rewritePlanRefs}from'./emit-phases.js';export{normalizeInlineGuardTable}from'./guard-fill.js';export{normalizeCurrency}from'./emit-phases.js';export function compileTemplate(a,b,c={}){const d=c['nameBase']??a['id']['replace'](/\//g,'_'),e=c['merchantPermissionIndex']??0x3e8,f=[],g=[],{inputs:h,derivedParams:i,blockers:j}=normalizeCompileInputs(a,b,c['buildTimeMs']);f['push'](...j);const {dropKeys:k,selectorDroppedKeys:l,shape:m,rows:n,blockers:o}=applyConditionalSelectors(a,h);f['push'](...o);const {guardSpecs:p,resolvedGuards:q,unresolved:r,omitKeys:s,recoverTwinRails:t,declareReasons:u,specByKey:v,slot254Injected:w,injectedOrderHolderKeys:x,edgeBoundKeys:y,derived:{reviewMode:z,rewardMark:A,needsRepository:B},blockers:C}=fillGuards({'template':a,'base':d,'inputs':h,'guardResolutions':c['guardResolutions']??{},'selector':{'dropKeys':k,'selectorDroppedKeys':l,'shape':m,'rows':n}});f['push'](...C);const D=emitIdentityPhase({'template':a,'base':d});g['push'](...D['steps']);const E=D['needsArbitration'],{afterSalesMode:F,acceptanceMode:G,installmentMode:H,affiliateMode:I,crowdfundingMode:J,logisticsMode:K}=deriveCapabilityModes({'template':a,'inputs':h});g['push'](...emitRewardClaimEarly({'reviewMode':z,'guardSpecs':p,'resolvedGuards':q,'rewardMark':A})['steps']),f['push'](...checkDaysUnitSlots({'resolvedGuards':q})['blockers']),f['push'](...checkWindowTruncation({'resolvedGuards':q})['blockers']);const L=emitServiceDraft({'template':a,'base':d,'inputs':h});g['push'](...L['steps']),f['push'](...L['blockers']);const M=emitEvidenceRepository({'needsRepository':B,'base':d,'inputs':h,'guardSpecs':p,'resolvedGuards':q});g['push'](...M['steps']),f['push'](...M['blockers']),g['push'](...emitReviewRepositoryEarly({'reviewMode':z,'base':d,'inputs':h})['steps']),rewritePlanRefs({'base':d,'resolvedGuards':q}),f['push'](...dropEmptyVecGuards({'resolvedGuards':q,'guardSpecs':p,'steps':g})['blockers']),g['push'](...emitArbitrationHoist({'needsArbitration':E,'template':a,'base':d,'currency':L['currency']})['steps']),g['push'](...emitGuardWave({'resolvedGuards':q,'specByKey':v,'slot254Injected':w,'repoBoundPolicies':M['repoBoundPolicies'],'repoBoundStepIds':M['repoBoundStepIds']})['steps']);const N=emitMachine({'template':a,'base':d,'shape':m,'resolvedGuards':q,'specByKey':v,'injectedOrderHolderKeys':x,'merchantIndex':e});g['push'](...N['steps']),f['push'](...N['blockers']),g['push'](...emitServiceConfigure({'guardSpecs':p,'needsRepository':B})['steps']);const O=emitAllocators({'template':a,'base':d,'inputs':h,'rowsWithAttachments':n,'resolvedGuards':q,'specByKey':v}),{rows:P,rowGroups:Q,allocatorRows:R,externalMarks:S}=O;f['push'](...O['blockers']);const T=checkAllocatorRails({'rowGroups':Q,'resolvedGuards':q,'shape':m,'recoverTwinRails':t,'declares':u});f['push'](...T['blockers']);if(T['disclosures']['length']>0x0){const a4=g['find'](a5=>a5['id']==='machine');if(a4){const a5=T['disclosures']['join']('\x20');a4['notes']=a4['notes']!==undefined?a4['notes']+'\x20'+a5:a5;}}g['push'](...emitServiceAllocators({'template':a,'inputs':h,'allocatorRows':R})['steps']);const U=emitSales({'inputs':h});g['push'](...U['steps']),f['push'](...U['blockers']);const V=emitModeGates({'afterSalesMode':F,'acceptanceMode':G,'installmentMode':H,'affiliateMode':I,'crowdfundingMode':J,'logisticsMode':K},{'shape':m,'rows':P,'guardSpecs':p,'buildNotes':a['build_notes']??[],'feeParams':a['fee_params'],'arbitrationMode':a['arbitration_mode'],'inputs':h,'buildTimeMs':c['buildTimeMs']});f['push'](...V['blockers']);if(V['disclosures']['length']>0x0){const a6=g['find'](a7=>a7['id']==='machine');if(a6){const a7=V['disclosures']['join']('\x20');a6['notes']=a6['notes']!==undefined?a6['notes']+'\x20'+a7:a7;}}const W=emitReviewComponent({'template':a,'inputs':h,'reviewMode':z,'shape':m,'guardSpecs':p,'resolvedGuards':q,'specByKey':v});g['push'](...W['steps']),f['push'](...W['blockers']);const X=emitArbitrationBindings({'template':a,'inputs':h,'needsArbitration':E,'shape':m,'guardSpecs':p,'specByKey':v});g['push'](...X['steps']),f['push'](...X['blockers']),g['push'](...emitServicePublish()['steps']),g['push'](...W['fundingSteps'],...X['fundingSteps']);const {allocatorBoundKeys:Y,moneyRailKeys:Z}=computeMoneyRailKeys({'rowsWithAttachments':n,'guardSpecs':p});f['push'](...checkForeignServicePins({'resolvedGuards':q,'edgeBoundKeys':y,'moneyRailKeys':Z})['blockers']),f['push'](...auditRepoIntegrityAndCallerLegs({'steps':g,'resolvedGuards':q,'moneyRailKeys':Z,'recoverTwinRails':t})['blockers']);const a0=emitSupplyChain({'supplyChain':c['supplyChain'],'steps':g,'derivedParams':i});f['push'](...a0['blockers']);const {supplyChainEmissions:a1,fulfillmentAxis:a2}=a0;{const a8=new Map();g['forEach']((ab,ac)=>{const ad=compilePhaseRank(ab['id']);if(ad>=0x0&&!a8['has'](ad))a8['set'](ad,ac);});let a9=-0x1,aa='';for(let ab=0x0;ab<CANONICAL_COMPILE_ORDER['length'];ab++){const ac=a8['get'](ab);if(ac===undefined)continue;if(ac<a9){f['push']({'code':'COMPILE_ORDER_DRIFT','detail':'Plan\x20emission\x20drifted\x20from\x20the\x20F-05\x20canonical\x20order\x20(object-dependency.ts\x20'+('CANONICAL_COMPILE_ORDER):\x20phase\x20\x27'+CANONICAL_COMPILE_ORDER[ab]['phase']+'\x27\x20first\x20appears\x20at\x20')+('position\x20'+(ac+0x1)+',\x20but\x20phase\x20\x27'+aa+'\x27\x20already\x20appeared\x20at\x20position\x20'+(a9+0x1)+'.\x20')+'Restore\x20the\x20canonical\x20emission\x20order\x20in\x20the\x20kernel\x20—\x20the\x20plan\x20must\x20not\x20ship\x20reordered.'});break;}a9=ac,aa=CANONICAL_COMPILE_ORDER[ab]['phase'];}}const a3=r['flatMap'](ad=>{const ae=Y['has'](ad['key'])?'allocator':y['has'](ad['key'])?'machine_edge':ad['host']==='service'&&ad['key']==='buy'?'service_buy':undefined;return ae?[{'key':ad['key'],'template_id':ad['template_id'],'host':ad['host'],'site':ae,'purpose':ad['purpose']}]:[];});return{'plan':{'version':0x1,'intent':c['intent']??'compile\x20'+a['id'],'templateId':a['id'],'inputs':a2!==undefined?{...h,'fulfillment_axis':a2}:h,'steps':g,...S['size']>0x0?{'external_refs':[...S]['sort']()}:{},...a3['length']>0x0?{'pending_guards':a3}:{},...i['length']>0x0?{'derived_params':i}:{}},'guardSpecs':p,'unresolved':r,'blockers':f,'omitted':[...s],...a1['length']>0x0?{'supplyChain':a1}:{}};}
1
+ import{CANONICAL_COMPILE_ORDER,compilePhaseRank}from'../knowledge/object-dependency.js';import{deriveCapabilityModes,emitModeGates}from'./mode-gates.js';import{normalizeCompileInputs,applyConditionalSelectors}from'./input-normalize.js';import{fillGuards}from'./guard-fill.js';import{auditRepoIntegrityAndCallerLegs,checkAllocatorRails,checkDaysUnitSlots,checkEmittedStepShapes,checkForeignServicePins,checkFundRailReachability,checkWindowTopology,checkWindowTruncation,computeMoneyRailKeys,dropEmptyVecGuards,emitAllocators,emitArbitrationBindings,emitArbitrationHoist,emitEvidenceRepository,emitGuardWave,emitIdentityPhase,emitMachine,emitRewardClaimEarly,emitExperiencePoolEarly,emitReviewComponent,emitReviewRepositoryEarly,emitSales,emitServiceAllocators,emitServiceConfigure,emitServiceDraft,emitServicePublish,emitSupplyChain,rewritePlanRefs}from'./emit-phases.js';export{normalizeInlineGuardTable}from'./guard-fill.js';export{normalizeCurrency}from'./emit-phases.js';export function compileTemplate(a,b,c={}){const d=(c['nameBase']??a['id'])['replace'](/\//g,'_'),e=c['merchantPermissionIndex']??0x3e8,f=[],g=[],{inputs:h,derivedParams:i,blockers:j}=normalizeCompileInputs(a,b,c['buildTimeMs']);f['push'](...j);const {dropKeys:k,selectorDroppedKeys:l,shape:m,rows:n,blockers:o}=applyConditionalSelectors(a,h);f['push'](...o);const {guardSpecs:p,resolvedGuards:q,unresolved:r,omitKeys:s,recoverTwinRails:t,declareReasons:u,specByKey:v,slot254Injected:w,injectedOrderHolderKeys:x,edgeBoundKeys:y,derived:{reviewMode:z,rewardMark:A,needsRepository:B,experienceClaimKey:C},blockers:D}=fillGuards({'template':a,'base':d,'inputs':h,'guardResolutions':c['guardResolutions']??{},'selector':{'dropKeys':k,'selectorDroppedKeys':l,'shape':m,'rows':n}});f['push'](...D);const E=emitIdentityPhase({'template':a,'base':d});g['push'](...E['steps']);const F=E['needsArbitration'],{afterSalesMode:G,acceptanceMode:H,installmentMode:I,affiliateMode:J,crowdfundingMode:K,logisticsMode:L}=deriveCapabilityModes({'template':a,'inputs':h});g['push'](...emitRewardClaimEarly({'reviewMode':z,'guardSpecs':p,'resolvedGuards':q,'rewardMark':A})['steps']),g['push'](...emitExperiencePoolEarly({'experienceClaimKey':C,'guardSpecs':p,'resolvedGuards':q,'poolMark':d+'_experience_comp'})['steps']),f['push'](...checkDaysUnitSlots({'resolvedGuards':q})['blockers']),f['push'](...checkWindowTruncation({'resolvedGuards':q})['blockers']);const M=emitServiceDraft({'template':a,'base':d,'inputs':h});g['push'](...M['steps']),f['push'](...M['blockers']);const N=emitEvidenceRepository({'needsRepository':B,'base':d,'inputs':h,'guardSpecs':p,'resolvedGuards':q});g['push'](...N['steps']),f['push'](...N['blockers']);const O=emitReviewRepositoryEarly({'reviewMode':z,'base':d,'inputs':h});g['push'](...O['steps']);const P=[...N['runtimeWrites'],...O['runtimeWrites']];rewritePlanRefs({'base':d,'resolvedGuards':q}),f['push'](...dropEmptyVecGuards({'resolvedGuards':q,'guardSpecs':p,'steps':g})['blockers']),g['push'](...emitArbitrationHoist({'needsArbitration':F,'template':a,'base':d,'currency':M['currency']})['steps']),g['push'](...emitGuardWave({'resolvedGuards':q,'specByKey':v,'slot254Injected':w,'repoBoundPolicies':N['repoBoundPolicies'],'repoBoundStepIds':N['repoBoundStepIds']})['steps']);const Q=emitMachine({'template':a,'base':d,'shape':m,'resolvedGuards':q,'specByKey':v,'injectedOrderHolderKeys':x,'merchantIndex':e});g['push'](...Q['steps']),f['push'](...Q['blockers']),g['push'](...emitServiceConfigure({'guardSpecs':p,'needsRepository':B})['steps']);const R=emitAllocators({'template':a,'base':d,'inputs':h,'rowsWithAttachments':n,'resolvedGuards':q,'specByKey':v}),{rows:S,rowGroups:T,allocatorRows:U,externalMarks:V}=R;f['push'](...R['blockers']);const W=checkAllocatorRails({'rowGroups':T,'resolvedGuards':q,'shape':m,'recoverTwinRails':t,'declares':u});f['push'](...W['blockers']);if(W['disclosures']['length']>0x0){const a7=g['find'](a8=>a8['id']==='machine');if(a7){const a8=W['disclosures']['join']('\x20');a7['notes']=a7['notes']!==undefined?a7['notes']+'\x20'+a8:a8;}}g['push'](...emitServiceAllocators({'template':a,'inputs':h,'allocatorRows':U})['steps']);const X=emitSales({'inputs':h});g['push'](...X['steps']),f['push'](...X['blockers']);const Y=emitModeGates({'afterSalesMode':G,'acceptanceMode':H,'installmentMode':I,'affiliateMode':J,'crowdfundingMode':K,'logisticsMode':L},{'shape':m,'rows':S,'guardSpecs':p,'buildNotes':a['build_notes']??[],'feeParams':a['fee_params'],'arbitrationMode':a['arbitration_mode'],'inputs':h,'buildTimeMs':c['buildTimeMs']});f['push'](...Y['blockers']);if(Y['disclosures']['length']>0x0){const a9=g['find'](aa=>aa['id']==='machine');if(a9){const aa=Y['disclosures']['join']('\x20');a9['notes']=a9['notes']!==undefined?a9['notes']+'\x20'+aa:aa;}}const Z=emitReviewComponent({'template':a,'inputs':h,'reviewMode':z,'experienceClaimKey':C,'shape':m,'guardSpecs':p,'resolvedGuards':q,'specByKey':v});g['push'](...Z['steps']),f['push'](...Z['blockers']);const a0=emitArbitrationBindings({'template':a,'inputs':h,'needsArbitration':F,'shape':m,'guardSpecs':p,'specByKey':v});g['push'](...a0['steps']),f['push'](...a0['blockers']);if(a0['disclosures']['length']>0x0){const ab=g['find'](ac=>ac['id']==='machine');if(ab){const ac=a0['disclosures']['join']('\x20');ab['notes']=ab['notes']!==undefined?ab['notes']+'\x20'+ac:ac;}}g['push'](...emitServicePublish()['steps']),g['push'](...Z['fundingSteps'],...a0['fundingSteps']);const {allocatorBoundKeys:a1,moneyRailKeys:a2}=computeMoneyRailKeys({'rowsWithAttachments':n,'guardSpecs':p});f['push'](...checkForeignServicePins({'resolvedGuards':q,'edgeBoundKeys':y,'moneyRailKeys':a2})['blockers']),f['push'](...auditRepoIntegrityAndCallerLegs({'steps':g,'resolvedGuards':q,'moneyRailKeys':a2,'recoverTwinRails':t})['blockers']);const a3=emitSupplyChain({'supplyChain':c['supplyChain'],'steps':g,'derivedParams':i});f['push'](...a3['blockers']);const {supplyChainEmissions:a4,fulfillmentAxis:a5}=a3;{const ad=new Map();g['forEach']((ag,ah)=>{const ai=compilePhaseRank(ag['id']);if(ai>=0x0&&!ad['has'](ai))ad['set'](ai,ah);});let ae=-0x1,af='';for(let ag=0x0;ag<CANONICAL_COMPILE_ORDER['length'];ag++){const ah=ad['get'](ag);if(ah===undefined)continue;if(ah<ae){f['push']({'code':'COMPILE_ORDER_DRIFT','detail':'Plan\x20emission\x20drifted\x20from\x20the\x20F-05\x20canonical\x20order\x20(object-dependency.ts\x20'+('CANONICAL_COMPILE_ORDER):\x20phase\x20\x27'+CANONICAL_COMPILE_ORDER[ag]['phase']+'\x27\x20first\x20appears\x20at\x20')+('position\x20'+(ah+0x1)+',\x20but\x20phase\x20\x27'+af+'\x27\x20already\x20appeared\x20at\x20position\x20'+(ae+0x1)+'.\x20')+'Restore\x20the\x20canonical\x20emission\x20order\x20in\x20the\x20kernel\x20—\x20the\x20plan\x20must\x20not\x20ship\x20reordered.'});break;}ae=ah,af=CANONICAL_COMPILE_ORDER[ag]['phase'];}}f['push'](...checkEmittedStepShapes({'steps':g})['blockers']),f['push'](...checkFundRailReachability({'steps':g,'resolvedGuards':q})['blockers']);{const ai=checkWindowTopology({'template':a});if(ai['warnings']['length']>0x0){const aj=g['find'](ak=>ak['id']==='machine');if(aj){const ak=ai['warnings']['join']('\x20');aj['notes']=aj['notes']!==undefined?aj['notes']+'\x20'+ak:ak;}}}const a6=r['flatMap'](al=>{const am=a1['has'](al['key'])?'allocator':y['has'](al['key'])?'machine_edge':al['host']==='service'&&al['key']==='buy'?'service_buy':undefined;return am?[{'key':al['key'],'template_id':al['template_id'],'host':al['host'],'site':am,'purpose':al['purpose']}]:[];});return{'plan':{'version':0x1,'intent':c['intent']??'compile\x20'+a['id'],'templateId':a['id'],'inputs':a5!==undefined?{...h,'fulfillment_axis':a5}:h,'steps':g,...V['size']>0x0?{'external_refs':[...V]['sort']()}:{},...a6['length']>0x0?{'pending_guards':a6}:{},...i['length']>0x0?{'derived_params':i}:{},...P['length']>0x0?{'runtime_writes':P}:{}},'guardSpecs':p,'unresolved':r,'blockers':f,'omitted':[...s],...a4['length']>0x0?{'supplyChain':a4}:{}};}
@@ -1,5 +1,5 @@
1
1
  import type { SupplyChainEmission, SupplyChainPromise } from "./supply-chain-emit.js";
2
- import type { DerivedParam, JsonValue, PlanStep } from "./plan.js";
2
+ import type { DerivedParam, JsonValue, PlanStep, RuntimeWriteStep } from "./plan.js";
3
3
  import type { GuardFillReviewMode, ResolvedGuard } from "./guard-fill.js";
4
4
  import type { AllocatorRowData, CompilableTemplate, CompileBlocker, GuardSpec } from "./compile.js";
5
5
  export declare function normalizeCurrency(raw: string): string | undefined;
@@ -18,6 +18,14 @@ export declare function emitRewardClaimEarly({ reviewMode, guardSpecs, resolvedG
18
18
  }): {
19
19
  steps: PlanStep[];
20
20
  };
21
+ export declare function emitExperiencePoolEarly({ experienceClaimKey, guardSpecs, resolvedGuards, poolMark, }: {
22
+ experienceClaimKey?: string;
23
+ guardSpecs: GuardSpec[];
24
+ resolvedGuards: Map<string, ResolvedGuard>;
25
+ poolMark: string;
26
+ }): {
27
+ steps: PlanStep[];
28
+ };
21
29
  export declare function checkDaysUnitSlots({ resolvedGuards, }: {
22
30
  resolvedGuards: Map<string, ResolvedGuard>;
23
31
  }): {
@@ -47,6 +55,7 @@ export declare function emitEvidenceRepository({ needsRepository, base, inputs,
47
55
  steps: PlanStep[];
48
56
  repoBoundPolicies: Record<string, unknown>[];
49
57
  repoBoundStepIds: string[];
58
+ runtimeWrites: RuntimeWriteStep[];
50
59
  blockers: CompileBlocker[];
51
60
  };
52
61
  export declare function emitReviewRepositoryEarly({ reviewMode, base, inputs, }: {
@@ -55,6 +64,7 @@ export declare function emitReviewRepositoryEarly({ reviewMode, base, inputs, }:
55
64
  inputs: Record<string, JsonValue>;
56
65
  }): {
57
66
  steps: PlanStep[];
67
+ runtimeWrites: RuntimeWriteStep[];
58
68
  };
59
69
  export declare function rewritePlanRefs({ base, resolvedGuards, }: {
60
70
  base: string;
@@ -139,16 +149,33 @@ export declare function emitServiceAllocators({ template, inputs, allocatorRows,
139
149
  }): {
140
150
  steps: PlanStep[];
141
151
  };
152
+ export declare function checkEmittedStepShapes({ steps }: {
153
+ steps: PlanStep[];
154
+ }): {
155
+ blockers: CompileBlocker[];
156
+ };
157
+ export declare function checkFundRailReachability({ steps, resolvedGuards, }: {
158
+ steps: PlanStep[];
159
+ resolvedGuards: Map<string, ResolvedGuard>;
160
+ }): {
161
+ blockers: CompileBlocker[];
162
+ };
163
+ export declare function checkWindowTopology({ template }: {
164
+ template: CompilableTemplate;
165
+ }): {
166
+ warnings: string[];
167
+ };
142
168
  export declare function emitSales({ inputs }: {
143
169
  inputs: Record<string, JsonValue>;
144
170
  }): {
145
171
  steps: PlanStep[];
146
172
  blockers: CompileBlocker[];
147
173
  };
148
- export declare function emitReviewComponent({ template, inputs, reviewMode, shape, guardSpecs, resolvedGuards, specByKey, }: {
174
+ export declare function emitReviewComponent({ template, inputs, reviewMode, experienceClaimKey, shape, guardSpecs, resolvedGuards, specByKey, }: {
149
175
  template: CompilableTemplate;
150
176
  inputs: Record<string, JsonValue>;
151
177
  reviewMode: GuardFillReviewMode;
178
+ experienceClaimKey?: string;
152
179
  shape: CompilableTemplate["machine_shape"];
153
180
  guardSpecs: GuardSpec[];
154
181
  resolvedGuards: Map<string, ResolvedGuard>;
@@ -169,6 +196,7 @@ export declare function emitArbitrationBindings({ template, inputs, needsArbitra
169
196
  steps: PlanStep[];
170
197
  fundingSteps: PlanStep[];
171
198
  blockers: CompileBlocker[];
199
+ disclosures: string[];
172
200
  };
173
201
  export declare function emitServicePublish(): {
174
202
  steps: PlanStep[];