@wowok/agent-mcp 3.3.7 → 3.3.9

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 (173) hide show
  1. package/dist/chain-semantics/fund-flow.js +1 -1
  2. package/dist/chain-semantics/guard-verbs.js +1 -1
  3. package/dist/chain-semantics/object-graph.js +1 -1
  4. package/dist/communication/message-cursors.d.ts +35 -0
  5. package/dist/communication/message-cursors.js +1 -0
  6. package/dist/communication/wts-attestation.d.ts +5 -0
  7. package/dist/communication/wts-attestation.js +1 -1
  8. package/dist/composition/audit.js +1 -1
  9. package/dist/composition/compile.d.ts +2 -2
  10. package/dist/composition/compile.js +1 -1
  11. package/dist/composition/inflight.d.ts +7 -0
  12. package/dist/composition/inflight.js +1 -1
  13. package/dist/composition/materialize.d.ts +4 -1
  14. package/dist/composition/materialize.js +1 -1
  15. package/dist/config/index.d.ts +1 -0
  16. package/dist/config/index.js +1 -1
  17. package/dist/config/store-policy.d.ts +14 -0
  18. package/dist/config/store-policy.js +1 -0
  19. package/dist/config/store-policy.spec.d.ts +1 -0
  20. package/dist/config/store-policy.spec.js +1 -0
  21. package/dist/customer/industry-risks.js +1 -1
  22. package/dist/customer/user-preferences.js +1 -1
  23. package/dist/evaluation/builtins/graph-service.spec.js +1 -1
  24. package/dist/evaluation/engine.js +1 -1
  25. package/dist/experience/realtime-feedback.js +1 -1
  26. package/dist/extensions/business-modules.d.ts +1 -1
  27. package/dist/extensions/business-modules.js +1 -1
  28. package/dist/extensions/industry-pack.js +1 -1
  29. package/dist/extensions/modes.js +1 -1
  30. package/dist/graph/onchain/analyze.js +1 -1
  31. package/dist/graph/onchain/expand.js +1 -1
  32. package/dist/graph/onchain/exposure.js +1 -1
  33. package/dist/graph/onchain/facts.d.ts +1 -0
  34. package/dist/graph/onchain/facts.js +1 -1
  35. package/dist/graph/onchain/facts.spec.js +1 -1
  36. package/dist/harness/recover.js +1 -1
  37. package/dist/knowledge/acquisition-flywheel.js +1 -1
  38. package/dist/knowledge/allocation-ledger.d.ts +1 -0
  39. package/dist/knowledge/allocation-ledger.js +1 -1
  40. package/dist/knowledge/allocator-rail-verifier.d.ts +6 -2
  41. package/dist/knowledge/allocator-rail-verifier.js +1 -1
  42. package/dist/knowledge/arbitration-ledger.js +1 -1
  43. package/dist/knowledge/audit-rules.d.ts +37 -0
  44. package/dist/knowledge/audit-rules.js +1 -1
  45. package/dist/knowledge/baselines/rules/plan.json +32 -2
  46. package/dist/knowledge/builtin-templates.d.ts +13 -1
  47. package/dist/knowledge/builtin-templates.js +1 -1
  48. package/dist/knowledge/commission-landing.d.ts +26 -0
  49. package/dist/knowledge/commission-landing.js +1 -0
  50. package/dist/knowledge/discount-threshold.js +1 -1
  51. package/dist/knowledge/fund-layer.d.ts +7 -0
  52. package/dist/knowledge/fund-layer.js +1 -1
  53. package/dist/knowledge/getting-started.js +1 -1
  54. package/dist/knowledge/guard-design-patterns.d.ts +1 -1
  55. package/dist/knowledge/guard-design-patterns.js +1 -1
  56. package/dist/knowledge/guard-puzzle.js +1 -1
  57. package/dist/knowledge/guard-render.d.ts +7 -0
  58. package/dist/knowledge/guard-render.js +1 -1
  59. package/dist/knowledge/guard-risk.js +1 -1
  60. package/dist/knowledge/guard-templates.d.ts +1 -1
  61. package/dist/knowledge/guard-templates.js +1 -1
  62. package/dist/knowledge/guard-translation.js +1 -1
  63. package/dist/knowledge/index.js +1 -1
  64. package/dist/knowledge/industry-generalizer.js +1 -1
  65. package/dist/knowledge/industry-registry.d.ts +1 -1
  66. package/dist/knowledge/industry-registry.js +1 -1
  67. package/dist/knowledge/industry-strategy.js +1 -1
  68. package/dist/knowledge/jsonrpc-enum.js +1 -1
  69. package/dist/knowledge/machine-fork-watch.d.ts +9 -0
  70. package/dist/knowledge/machine-fork-watch.js +1 -0
  71. package/dist/knowledge/migration-preflight.js +1 -1
  72. package/dist/knowledge/projection.spec.js +1 -1
  73. package/dist/knowledge/scenario-modes.d.ts +8 -2
  74. package/dist/knowledge/scenario-modes.js +1 -1
  75. package/dist/knowledge/semantic-ir.d.ts +24 -5
  76. package/dist/knowledge/semantic-ir.js +1 -1
  77. package/dist/knowledge/service-ledger.js +1 -1
  78. package/dist/knowledge/strategy-manuals.js +1 -1
  79. package/dist/knowledge/template-index.js +1 -1
  80. package/dist/knowledge/template-loader.d.ts +11 -0
  81. package/dist/knowledge/template-loader.js +1 -1
  82. package/dist/knowledge/template-registry.js +1 -1
  83. package/dist/knowledge/template-scanner.d.ts +4 -2
  84. package/dist/knowledge/template-scanner.js +1 -1
  85. package/dist/knowledge/template-validation.js +1 -1
  86. package/dist/knowledge/tools-reference.js +1 -1
  87. package/dist/monitor/MonitorLoop.js +1 -1
  88. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  89. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  90. package/dist/playbooks/service-build/merchant-guide.d.ts +12 -6
  91. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  92. package/dist/playbooks/service-build/migration-planner.d.ts +10 -2
  93. package/dist/playbooks/service-build/migration-planner.js +1 -1
  94. package/dist/playbooks/service-build/mode-actions.d.ts +1 -0
  95. package/dist/playbooks/service-build/mode-actions.js +1 -1
  96. package/dist/playbooks/service-build/object-panorama.js +1 -1
  97. package/dist/playbooks/service-build/participation-radar.js +1 -1
  98. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  99. package/dist/playbooks/service-build/service-panorama.js +1 -1
  100. package/dist/playbooks/service-build/service-quote.js +1 -1
  101. package/dist/playbooks/service-build/service-quote.spec.js +1 -1
  102. package/dist/review/index.js +1 -1
  103. package/dist/safety/confirm-gate.js +1 -1
  104. package/dist/schema/benchmark-migration/index.d.ts +72 -1
  105. package/dist/schema/benchmark-migration/index.js +1 -1
  106. package/dist/schema/call/allocation.d.ts +3 -0
  107. package/dist/schema/call/allocation.js +1 -1
  108. package/dist/schema/call/base.d.ts +24 -0
  109. package/dist/schema/call/bridge.d.ts +6 -0
  110. package/dist/schema/call/error-codes.d.ts +1 -1
  111. package/dist/schema/call/error-codes.js +1 -1
  112. package/dist/schema/call/order.js +1 -1
  113. package/dist/schema/call/semantic.js +1 -1
  114. package/dist/schema/call/service.js +1 -1
  115. package/dist/schema/common/index.js +1 -1
  116. package/dist/schema/config/index.d.ts +24 -0
  117. package/dist/schema/config/index.js +1 -1
  118. package/dist/schema/goal/index.d.ts +14 -0
  119. package/dist/schema/goal/planning.d.ts +26 -0
  120. package/dist/schema/goal/planning.js +1 -1
  121. package/dist/schema/industry-pack/index.d.ts +9 -1
  122. package/dist/schema/industry-pack/modes.d.ts +9 -1
  123. package/dist/schema/industry-pack/modes.js +1 -1
  124. package/dist/schema/local/index.d.ts +60 -0
  125. package/dist/schema/local/index.js +1 -1
  126. package/dist/schema/messenger/index.d.ts +278 -1
  127. package/dist/schema/messenger/index.js +1 -1
  128. package/dist/schema/operations.d.ts +1 -0
  129. package/dist/schema/query/bi.d.ts +38 -0
  130. package/dist/schema/query/bi.js +1 -1
  131. package/dist/schema/query/index.d.ts +3 -0
  132. package/dist/schema/query/index.js +1 -1
  133. package/dist/schema/schema-version.js +1 -1
  134. package/dist/schema/service-clone/index.d.ts +17 -0
  135. package/dist/schema/service-clone/index.js +1 -1
  136. package/dist/schema-query-impl/index.js +1 -1
  137. package/dist/schemas/account_operation.output.json +6 -0
  138. package/dist/schemas/benchmark_migration_operation.output.json +254 -2
  139. package/dist/schemas/benchmark_migration_operation.schema.json +87 -5
  140. package/dist/schemas/bridge_operation.output.json +6 -0
  141. package/dist/schemas/config_operation.output.json +95 -0
  142. package/dist/schemas/config_operation.schema.json +16 -1
  143. package/dist/schemas/goal_operation.schema.json +22 -0
  144. package/dist/schemas/index.json +1 -1
  145. package/dist/schemas/industry_pack_operation.output.json +4 -0
  146. package/dist/schemas/industry_pack_operation.schema.json +40 -3
  147. package/dist/schemas/local_cache_operation.output.json +6 -0
  148. package/dist/schemas/local_history_operation.output.json +6 -0
  149. package/dist/schemas/local_info_operation.output.json +6 -0
  150. package/dist/schemas/local_mark_operation.output.json +6 -0
  151. package/dist/schemas/messenger_operation.output.json +609 -1
  152. package/dist/schemas/messenger_operation.schema.json +96 -1
  153. package/dist/schemas/onchain_operations.output.json +6 -0
  154. package/dist/schemas/onchain_operations.schema.json +334 -7
  155. package/dist/schemas/onchain_operations_allocation.schema.json +10 -1
  156. package/dist/schemas/onchain_operations_guard.schema.json +318 -0
  157. package/dist/schemas/onchain_operations_order.schema.json +1 -1
  158. package/dist/schemas/onchain_operations_service.schema.json +5 -5
  159. package/dist/schemas/query_toolkit.output.json +271 -8
  160. package/dist/schemas/service_clone_operation.output.json +79 -0
  161. package/dist/tools/handlers/benchmark-migration.d.ts +14 -0
  162. package/dist/tools/handlers/benchmark-migration.js +1 -1
  163. package/dist/tools/handlers/config.js +1 -1
  164. package/dist/tools/handlers/messenger.js +1 -1
  165. package/dist/tools/handlers/onchain.d.ts +19 -1
  166. package/dist/tools/handlers/onchain.js +1 -1
  167. package/dist/tools/handlers/query.d.ts +1 -0
  168. package/dist/tools/handlers/query.js +1 -1
  169. package/dist/tools/handlers/service-clone.d.ts +18 -0
  170. package/dist/tools/handlers/service-clone.js +1 -1
  171. package/dist/tools/registry/business.js +1 -1
  172. package/dist/tools/wrap.js +1 -1
  173. package/package.json +2 -2
@@ -1 +1 @@
1
- import{describe,it,expect,vi,beforeEach}from'vitest';const {sdkMocks}=vi['hoisted'](()=>({'sdkMocks':{'network_get':vi['fn'](),'localMarkList':vi['fn'](),'query_objects':vi['fn'](),'query_serviceContext':vi['fn'](),'resolveAddress':vi['fn']()}}));vi['mock']('@wowok/wowok',async a=>{const b=await a();return{...b,'Config':{'Instance':()=>({'network_get':sdkMocks['network_get']})},'LocalMark':{'Instance':()=>({'list':sdkMocks['localMarkList']})},'query_objects':sdkMocks['query_objects'],'query_serviceContext':sdkMocks['query_serviceContext']};}),vi['mock']('../../tools/handlers/name-resolution.js',()=>({'resolveAddress':sdkMocks['resolveAddress']})),vi['mock']('./facet-money.js',()=>({'formatMoneyAnnotation':async a=>({'display':a})}));import{handleServiceQuote}from'./service-quote.js';const SVC='0x'+'1'['repeat'](0x40),COUPON='0x'+'2'['repeat'](0x40),OTHER_SVC='0x'+'3'['repeat'](0x40),FLEXIBLE='Flexible\x20—\x20canal\x20view\x20double',LIST_TOTAL=0x35a4e900n;function makeCoupon(a={}){const b=Date['now']();return{'object':COUPON,'name':'bk3t-promo15','discount_type':0x0,'off':0x5dc,'benchmark':null,'time_start':b-0x5265c00,'time_end':b+0x5265c00,'service':SVC,'transferable':![],...a};}function quoteInput(a={}){return{'query_type':'service_quote','service_address':'bk3t-canal-stay','items':[{'name':FLEXIBLE,'quantity':0x1}],'context_network':'mainnet',...a};}beforeEach(()=>{vi['clearAllMocks'](),sdkMocks['network_get']['mockResolvedValue']('mainnet'),sdkMocks['localMarkList']['mockResolvedValue']([{'name':'bk3t-canal-stay'}]),sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}]}}),sdkMocks['resolveAddress']['mockImplementation'](async a=>{if(a==='bk3t-canal-stay')return SVC;if(a==='bk3t-promo15'||a===COUPON)return COUPON;throw new Error('unresolvable:\x20'+a);}),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon()]});}),describe('service_quote\x20discount\x20pricing\x20(F-10)',()=>{it('no\x20discount\x20requested\x20→\x20undiscounted\x20total,\x20discount\x20block\x20null\x20(pre-fix\x20behavior\x20preserved)',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['discount'])['toBeNull'](),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('RATES\x20coupon\x20applies\x20with\x20integer\x20floor\x20division\x20—\x20reproduces\x20the\x20live\x20order\x20C\x20number',async()=>{const a=await handleServiceQuote(quoteInput({'discount':'bk3t-promo15'}));expect(a['discount'])['not']['toBeNull'](),expect(a['discount']['type'])['toBe']('rates'),expect(a['discount']['applied'])['toBe'](!![]),expect(a['discount']['list_total'])['toBe']('900000000'),expect(a['discount']['final_total'])['toBe']('765000000'),expect(a['total_pay']['balance'])['toBe']('765000000'),expect(a['total_pay']['note'])['toContain']('Discounted\x20total');}),it('MINUS\x20coupon\x20subtracts\x20a\x20fixed\x20amount\x20and\x20clamps\x20at\x20zero',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x5f5e100})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['type'])['toBe']('minus'),expect(a['discount']['final_total'])['toBe']('800000000'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x77359400})]});const b=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(b['discount']['final_total'])['toBe']('0'),expect(b['discount']['note'])['toContain']('DEAD\x20BASKET'),expect(b['discount']['note'])['toContain']('REFUSES\x20zero-total'),expect(b['discount']['note'])['toContain']('allow_zero_total'),expect(b['discount']['note'])['toContain']('NOT\x20unlock\x20this\x20buy'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x5f5e100})]});const c=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(c['discount']['note'])['toContain']('Discounted\x20total\x20shown\x20—\x20order_new.buy.total_pay.balance\x20must\x20equal\x20final_total.'),expect(c['discount']['note'])['toContain']('BURN-ON-USE'),expect(c['discount']['note'])['toContain']('CANCELLATION\x20REFUNDS\x20THE\x20DISCOUNTED\x20AMOUNT\x20ONLY');}),it('unmet\x20benchmark\x20→\x20applied:false\x20+\x20attach\x20warning,\x20total\x20stays\x20at\x20list\x20price\x20(NOT\x20thrown)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'benchmark':(LIST_TOTAL+0x1n)['toString']()})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['applied'])['toBe'](![]),expect(a['discount']['benchmark_met'])['toBe'](![]),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']()),expect(a['discount']['note'])['toContain']('REJECTS'),expect(a['discount']['note'])['toContain']('coupon\x20preserved');}),it('benchmark\x20exactly\x20met\x20→\x20applies\x20(chain\x20uses\x20>=)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'benchmark':LIST_TOTAL['toString']()})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['applied'])['toBe'](!![]),expect(a['discount']['final_total'])['toBe']('765000000');}),it('benchmark\x20None\x20always\x20applies\x20(corrected\x20old\x20docs\x20claim)',async()=>{const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['benchmark'])['toBeNull'](),expect(a['discount']['applied'])['toBe'](!![]);}),it('coupon\x20bound\x20to\x20another\x20service\x20→\x20rejected\x20like\x20the\x20chain\x20abort\x20(E_SERVICE_DISCOUNT_NOT_MATCH)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'service':OTHER_SVC})]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/E_SERVICE_DISCOUNT_NOT_MATCH/);}),it('coupon\x20outside\x20its\x20time\x20window\x20→\x20rejected\x20like\x20the\x20chain\x20abort\x20(E_DISCOUNT_TIME_INVALID)',async()=>{const a=Date['now']();sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'time_start':a+0x3e8,'time_end':a+0x186a0})]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/E_DISCOUNT_TIME_INVALID/);}),it('unknown\x20coupon\x20object\x20→\x20clear\x20rejection,\x20never\x20a\x20silent\x20full-price\x20quote',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/not found/);});});const REWARD='0x'+'4'['repeat'](0x40),CLAIM_GUARD='0x'+'5'['repeat'](0x40);function makeReward(a={}){return{'object':REWARD,'description':'5-star\x20review\x20reward','balance':'500000000','record_count':0x3,'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'expiration_time':Date['now']()+0x5265c00}],...a};}function svcWithRewards(...a){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}],'rewards':a}});}describe('service_quote\x20reward\x20terms\x20(review\x20component\x20b2-5)',()=>{it('no\x20rewards\x20on\x20the\x20Service\x20→\x20reward_terms\x20null',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['toBeNull']();}),it('fixed\x20amount\x20+\x20live\x20window\x20→\x20terms\x20with\x20coverage\x20estimate,\x20expired:false,\x20no\x20gaps',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward()]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['not']['toBeNull']();const b=a['reward_terms']['rewards'][0x0];expect(b['reward'])['toBe'](REWARD),expect(b['description'])['toBe']('5-star\x20review\x20reward'),expect(b['pool_balance'])['toBe']('500000000'),expect(b['record_count'])['toBe'](0x3),expect(b['claims'][0x0]['guard'])['toBe'](CLAIM_GUARD),expect(b['claims'][0x0]['amount_type'])['toBe']('fixed'),expect(b['claims'][0x0]['amount'])['toBe']('100000000'),expect(b['claims'][0x0]['expired'])['toBe'](![]),expect(b['coverage'])['toMatch'](/~5 further claim/),expect(a['reward_terms']['data_gaps'])['toEqual']([]),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('empty\x20pool\x20→\x20EMPTY\x20coverage\x20warning;\x20expired\x20window\x20→\x20expired:true',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'balance':'0','guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'expiration_time':Date['now']()-0x3e8}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0];expect(b['claims'][0x0]['expired'])['toBe'](!![]),expect(b['coverage'])['toContain']('EMPTY'),expect(b['coverage'])['toContain']('E_INSUFFICIENT_BALANCE');}),it('guard_submission\x20amount\x20→\x20coverage\x20null\x20(guard-decided),\x20amount\x20carries\x20the\x20submission\x20identifier',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x0,'value':0x7}}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0];expect(b['claims'][0x0]['amount_type'])['toBe']('guard_submission'),expect(b['claims'][0x0]['amount'])['toContain']('7'),expect(b['claims'][0x0]['amount_display'])['toBeNull'](),expect(b['coverage'])['toBeNull']();}),it('no\x20window\x20set\x20→\x20expiration\x20null\x20and\x20expired\x20null\x20(claimable\x20until\x20guard\x20removal)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'}}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['expiration_time'])['toBeNull'](),expect(b['expiration_display'])['toBeNull'](),expect(b['expired'])['toBeNull']();}),it('unreadable\x20reward\x20object\x20→\x20data_gaps\x20note,\x20quote\x20still\x20succeeds\x20(fail-soft)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['not']['toBeNull'](),expect(a['reward_terms']['rewards'])['toEqual']([]),expect(a['reward_terms']['data_gaps'][0x0])['toContain'](REWARD),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('reward\x20lookup\x20throws\x20→\x20whole\x20lookup\x20degrades\x20to\x20one\x20gap\x20note,\x20never\x20thrown',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockRejectedValue'](new Error('rpc\x20down'));const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'])['toEqual']([]),expect(a['reward_terms']['data_gaps'][0x0])['toContain']('rpc\x20down'),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());});});function svcWithFund(a){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}],'compensation_fund':a}});}describe('service_quote\x20compensation_fund_coverage\x20(b6-11)',()=>{it('no\x20fund\x20→\x20covered:false\x20with\x20the\x20no-protection\x20disclosure\x20(never\x20blocked)',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage'])['not']['toBeNull'](),expect(a['compensation_fund_coverage']['fund_balance'])['toBe']('0'),expect(a['compensation_fund_coverage']['required_for_this_basket'])['toBe']('2700000000'),expect(a['compensation_fund_coverage']['covered'])['toBe'](![]),expect(a['compensation_fund_coverage']['note'])['toContain']('WITHOUT\x20a\x20compensation\x20fund'),expect(a['compensation_fund_coverage']['note'])['toContain']('never\x20blocked');}),it('fund\x20at/over\x203x\x20the\x20basket\x20→\x20covered:true',async()=>{svcWithFund('2700000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['covered'])['toBe'](!![]),expect(a['compensation_fund_coverage']['note'])['toContain']('payable\x20from\x20the\x20pool');}),it('fund\x20short\x20→\x20covered:false\x20and\x20the\x20note\x20names\x20the\x20buy-time\x20block\x20+\x20error\x20code',async()=>{svcWithFund('100000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['covered'])['toBe'](![]),expect(a['compensation_fund_coverage']['note'])['toContain']('BLOCKED'),expect(a['compensation_fund_coverage']['note'])['toContain']('compensation_fund_below_order_ceiling'),expect(a['compensation_fund_coverage']['note'])['toContain']('compensation_fund_add');}),it('shortfall\x20states\x20the\x20exact\x20top-up\x20(required\x20-\x20fund;\x20etsy-gf\x20R1:\x20no\x20reader\x20subtraction)',async()=>{svcWithFund('1000000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['shortfall'])['toBe']('1700000000'),expect(a['compensation_fund_coverage']['note'])['toContain']('by'),svcWithFund('2700000000');const b=await handleServiceQuote(quoteInput());expect(b['compensation_fund_coverage']['shortfall'])['toBe']('0'),svcWithFund('0');const c=await handleServiceQuote(quoteInput());expect(c['compensation_fund_coverage']['shortfall'])['toBe']('2700000000');}),it('F-OF2-06:\x20max_coverable_order\x20names\x20the\x20storefront\x20price\x20cap\x20(fund/3)\x20in\x20every\x20fund\x20state',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['max_coverable_order'])['toBe']('0'),svcWithFund('2700000000');const b=await handleServiceQuote(quoteInput());expect(b['compensation_fund_coverage']['max_coverable_order'])['toBe']('900000000'),expect(b['compensation_fund_coverage']['note'])['toContain']('ceiling'),svcWithFund('1000000000');const c=await handleServiceQuote(quoteInput());expect(c['compensation_fund_coverage']['max_coverable_order'])['toBe']('333333333'),expect(c['compensation_fund_coverage']['note'])['toContain']('orders\x20above');}),it('required\x20base\x20is\x20the\x20DISCOUNTED\x20total\x20(what\x20the\x20order\x20actually\x20pays)',async()=>{svcWithFund('2295000000');const a=await handleServiceQuote(quoteInput({'discount':'bk3t-promo15'}));expect(a['total_pay']['balance'])['toBe']('765000000'),expect(a['compensation_fund_coverage']['required_for_this_basket'])['toBe']('2295000000'),expect(a['compensation_fund_coverage']['covered'])['toBe'](!![]);});});
1
+ import{describe,it,expect,vi,beforeEach}from'vitest';const {sdkMocks}=vi['hoisted'](()=>({'sdkMocks':{'network_get':vi['fn'](),'localMarkList':vi['fn'](),'query_objects':vi['fn'](),'query_serviceContext':vi['fn'](),'resolveAddress':vi['fn']()}}));vi['mock']('@wowok/wowok',async a=>{const b=await a();return{...b,'Config':{'Instance':()=>({'network_get':sdkMocks['network_get']})},'LocalMark':{'Instance':()=>({'list':sdkMocks['localMarkList']})},'query_objects':sdkMocks['query_objects'],'query_serviceContext':sdkMocks['query_serviceContext']};}),vi['mock']('../../tools/handlers/name-resolution.js',()=>({'resolveAddress':sdkMocks['resolveAddress']})),vi['mock']('./facet-money.js',()=>({'formatMoneyAnnotation':async a=>({'display':a})}));import{handleServiceQuote}from'./service-quote.js';const SVC='0x'+'1'['repeat'](0x40),COUPON='0x'+'2'['repeat'](0x40),OTHER_SVC='0x'+'3'['repeat'](0x40),BUYER='0x'+'b'['repeat'](0x40),FLEXIBLE='Flexible\x20—\x20canal\x20view\x20double',LIST_TOTAL=0x35a4e900n;function makeCoupon(a={}){const b=Date['now']();return{'object':COUPON,'name':'bk3t-promo15','discount_type':0x0,'off':0x5dc,'benchmark':null,'time_start':b-0x5265c00,'time_end':b+0x5265c00,'service':SVC,'transferable':![],'owner':{'AddressOwner':BUYER},...a};}function quoteInput(a={}){return{'query_type':'service_quote','service_address':'bk3t-canal-stay','items':[{'name':FLEXIBLE,'quantity':0x1}],'context_network':'mainnet',...a};}beforeEach(()=>{vi['clearAllMocks'](),sdkMocks['network_get']['mockResolvedValue']('mainnet'),sdkMocks['localMarkList']['mockResolvedValue']([{'name':'bk3t-canal-stay'}]),sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}]}}),sdkMocks['resolveAddress']['mockImplementation'](async a=>{if(a==='bk3t-canal-stay')return SVC;if(a==='bk3t-promo15'||a===COUPON)return COUPON;throw new Error('unresolvable:\x20'+a);}),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon()]});}),describe('service_quote\x20discount\x20pricing\x20(F-10)',()=>{it('no\x20discount\x20requested\x20→\x20undiscounted\x20total,\x20discount\x20block\x20null\x20(pre-fix\x20behavior\x20preserved)',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['discount'])['toBeNull'](),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('RATES\x20coupon\x20applies\x20with\x20integer\x20floor\x20division\x20—\x20reproduces\x20the\x20live\x20order\x20C\x20number',async()=>{const a=await handleServiceQuote(quoteInput({'discount':'bk3t-promo15'}));expect(a['discount'])['not']['toBeNull'](),expect(a['discount']['type'])['toBe']('rates'),expect(a['discount']['applied'])['toBe'](!![]),expect(a['discount']['list_total'])['toBe']('900000000'),expect(a['discount']['final_total'])['toBe']('765000000'),expect(a['total_pay']['balance'])['toBe']('765000000'),expect(a['total_pay']['note'])['toContain']('FLOOR\x20semantics'),expect(a['discount']['owned_by'])['toBe'](BUYER),expect(a['discount']['ownership_note'])['toContain']('owned\x20by\x20'+BUYER),expect(a['discount']['ownership_note'])['toContain']('only\x20the\x20holder\x20can\x20redeem'),expect(a['discount']['ownership_note'])['toContain']('cannot\x20be\x20applied\x20to\x20your\x20order'),expect(a['discount']['ownership_note'])['toContain']('Refunds\x20settle\x20the\x20post-coupon\x20amount\x20only');}),it('MINUS\x20coupon\x20subtracts\x20a\x20fixed\x20amount\x20and\x20clamps\x20at\x20zero',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x5f5e100})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['type'])['toBe']('minus'),expect(a['discount']['final_total'])['toBe']('800000000'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x77359400})]});const b=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(b['discount']['final_total'])['toBe']('0'),expect(b['discount']['note'])['toContain']('DEAD\x20BASKET'),expect(b['discount']['note'])['toContain']('REFUSES\x20zero-total'),expect(b['discount']['note'])['toContain']('allow_zero_total'),expect(b['discount']['note'])['toContain']('NOT\x20unlock\x20this\x20buy'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'discount_type':0x1,'off':0x5f5e100})]});const c=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(c['discount']['note'])['toContain']('Discounted\x20total\x20shown\x20—\x20order_new.buy.total_pay.balance\x20must\x20be\x20>=\x20this\x20final_total'),expect(c['discount']['note'])['toContain']('BURN-ON-USE'),expect(c['discount']['note'])['toContain']('CANCELLATION\x20REFUNDS\x20THE\x20DISCOUNTED\x20AMOUNT\x20ONLY');}),it('unmet\x20benchmark\x20→\x20applied:false\x20+\x20attach\x20warning,\x20total\x20stays\x20at\x20list\x20price\x20(NOT\x20thrown)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'benchmark':(LIST_TOTAL+0x1n)['toString']()})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['applied'])['toBe'](![]),expect(a['discount']['benchmark_met'])['toBe'](![]),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']()),expect(a['discount']['note'])['toContain']('REJECTS'),expect(a['discount']['note'])['toContain']('coupon\x20preserved');}),it('benchmark\x20exactly\x20met\x20→\x20applies\x20(chain\x20uses\x20>=)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'benchmark':LIST_TOTAL['toString']()})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['applied'])['toBe'](!![]),expect(a['discount']['final_total'])['toBe']('765000000');}),it('benchmark\x20None\x20always\x20applies\x20(corrected\x20old\x20docs\x20claim)',async()=>{const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['benchmark'])['toBeNull'](),expect(a['discount']['applied'])['toBe'](!![]);}),it('coupon\x20bound\x20to\x20another\x20service\x20→\x20rejected\x20like\x20the\x20chain\x20abort\x20(E_SERVICE_DISCOUNT_NOT_MATCH)',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'service':OTHER_SVC})]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/E_SERVICE_DISCOUNT_NOT_MATCH/);}),it('coupon\x20outside\x20its\x20time\x20window\x20→\x20rejected\x20like\x20the\x20chain\x20abort\x20(E_DISCOUNT_TIME_INVALID)',async()=>{const a=Date['now']();sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'time_start':a+0x3e8,'time_end':a+0x186a0})]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/E_DISCOUNT_TIME_INVALID/);}),it('KB-02\x20attribution:\x20owner\x20unwraps\x20from\x20the\x20ObjectOwner\x20enum\x20shapes\x20and\x20stays\x20fail-soft\x20when\x20unreadable',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'owner':{'ObjectOwner':BUYER}})]});const a=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(a['discount']['owned_by'])['toBe'](BUYER),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'owner':BUYER})]});const b=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(b['discount']['owned_by'])['toBe'](BUYER),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeCoupon({'owner':undefined})]});const c=await handleServiceQuote(quoteInput({'discount':COUPON}));expect(c['discount']['owned_by'])['toBeNull'](),expect(c['discount']['ownership_note'])['toContain']('could\x20not\x20be\x20read'),expect(c['discount']['ownership_note'])['toContain']('only\x20the\x20holder\x20can\x20redeem'),expect(c['discount']['ownership_note'])['toContain']('have\x20the\x20owner\x20transfer\x20it\x20first');}),it('unknown\x20coupon\x20object\x20→\x20clear\x20rejection,\x20never\x20a\x20silent\x20full-price\x20quote',async()=>{sdkMocks['query_objects']['mockResolvedValue']({'objects':[]}),await expect(handleServiceQuote(quoteInput({'discount':COUPON})))['rejects']['toThrow'](/not found/);}),it('paused\x20service\x20(bs29\x20R-16)\x20→\x20paused:true\x20+\x20PAUSED\x20warning\x20on\x20the\x20total_pay\x20note',async()=>{sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','paused':!![],'sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}]}});const a=await handleServiceQuote(quoteInput());expect(a['paused'])['toBe'](!![]),expect(a['total_pay']['note'])['toContain']('SERVICE\x20PAUSED'),expect(a['total_pay']['note'])['toContain']('pause:false'),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']()),sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','bPaused':!![],'sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}]}});const b=await handleServiceQuote(quoteInput());expect(b['paused'])['toBe'](!![]);});});const REWARD='0x'+'4'['repeat'](0x40),CLAIM_GUARD='0x'+'5'['repeat'](0x40);function makeReward(a={}){return{'object':REWARD,'description':'5-star\x20review\x20reward','balance':'500000000','record_count':0x3,'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'expiration_time':Date['now']()+0x5265c00}],...a};}function svcWithRewards(...a){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}],'rewards':a}});}describe('service_quote\x20reward\x20terms\x20(review\x20component\x20b2-5)',()=>{it('no\x20rewards\x20on\x20the\x20Service\x20→\x20reward_terms\x20null',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['toBeNull']();}),it('fixed\x20amount\x20+\x20live\x20window\x20→\x20terms\x20with\x20coverage\x20estimate,\x20expired:false,\x20no\x20gaps',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward()]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['not']['toBeNull']();const b=a['reward_terms']['rewards'][0x0];expect(b['reward'])['toBe'](REWARD),expect(b['description'])['toBe']('5-star\x20review\x20reward'),expect(b['pool_balance'])['toBe']('500000000'),expect(b['record_count'])['toBe'](0x3),expect(b['claims'][0x0]['guard'])['toBe'](CLAIM_GUARD),expect(b['claims'][0x0]['amount_type'])['toBe']('fixed'),expect(b['claims'][0x0]['amount'])['toBe']('100000000'),expect(b['claims'][0x0]['expired'])['toBe'](![]),expect(b['coverage'])['toMatch'](/~5 further claim/),expect(a['reward_terms']['data_gaps'])['toEqual']([]),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('empty\x20pool\x20→\x20EMPTY\x20coverage\x20warning;\x20expired\x20window\x20→\x20expired:true',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'balance':'0','guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'expiration_time':Date['now']()-0x3e8}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0];expect(b['claims'][0x0]['expired'])['toBe'](!![]),expect(b['coverage'])['toContain']('EMPTY'),expect(b['coverage'])['toContain']('E_INSUFFICIENT_BALANCE');}),it('guard_submission\x20amount\x20→\x20coverage\x20null\x20(guard-decided),\x20amount\x20carries\x20the\x20submission\x20identifier',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x0,'value':0x7}}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0];expect(b['claims'][0x0]['amount_type'])['toBe']('guard_submission'),expect(b['claims'][0x0]['amount'])['toContain']('7'),expect(b['claims'][0x0]['amount_display'])['toBeNull'](),expect(b['coverage'])['toBeNull']();}),it('no\x20window\x20set\x20→\x20expiration\x20null\x20and\x20expired\x20null\x20(claimable\x20until\x20guard\x20removal)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'}}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['expiration_time'])['toBeNull'](),expect(b['expiration_display'])['toBeNull'](),expect(b['expired'])['toBeNull'](),expect(b['claim_window'])['toBeNull']();}),it('R-09\x20claim\x20window\x20decodes\x20from\x20the\x20guard\x27s\x20Clock\x20comparison\x20(order.time\x20+\x20600s\x20upper)',async()=>{svcWithRewards(REWARD);const a={'object':CLAIM_GUARD,'root':[{'type':'logic_as_u256_lesser_or_equal','nodes':[{'type':'context','context':'Clock'},{'type':'calc_number_add','nodes':[{'type':'query','query':'order.time'},{'type':'identifier','identifier':'600000'}]}]}],'table':[{'identifier':'600000','b_submission':![],'value':0x927c0}]};sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward()]})['mockResolvedValueOnce']({'objects':[a]});const b=await handleServiceQuote(quoteInput()),d=b['reward_terms']['rewards'][0x0]['claims'][0x0];expect(d['claim_window'])['toEqual']({'opens_after_s':null,'closes_after_s':0x258,'anchor':'order.time'}),expect(d['min_rating'])['toBeNull'](),expect(b['reward_terms']['data_gaps'])['toEqual']([]);}),it('unreadable\x20reward\x20object\x20→\x20data_gaps\x20note,\x20quote\x20still\x20succeeds\x20(fail-soft)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms'])['not']['toBeNull'](),expect(a['reward_terms']['rewards'])['toEqual']([]),expect(a['reward_terms']['data_gaps'][0x0])['toContain'](REWARD),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('reward\x20lookup\x20throws\x20→\x20whole\x20lookup\x20degrades\x20to\x20one\x20gap\x20note,\x20never\x20thrown',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockRejectedValue'](new Error('rpc\x20down'));const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'])['toEqual']([]),expect(a['reward_terms']['data_gaps'][0x0])['toContain']('rpc\x20down'),expect(a['total_pay']['balance'])['toBe'](LIST_TOTAL['toString']());}),it('unstamped\x20claim\x20guard\x20→\x20replay_scope\x20once_per_recipient_guard\x20with\x20abort\x2013\x20+\x20254\x20note',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward()]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['replay_scope'];expect(b['scope'])['toBe']('once_per_recipient_guard'),expect(b['detail'])['toContain']('for\x20LIFE'),expect(b['detail'])['toContain']('abort\x2013'),expect(b['detail'])['toContain']('E_CLAIM_ALREADY_MADE'),expect(b['per_order_note'])['toContain']('254'),expect(b['per_order_note'])['toContain']('store_from_id');}),it('store_from_id=0\x20→\x20replay_scope\x20once_per_order',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'store_from_id':0x0}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['replay_scope'];expect(b['scope'])['toBe']('once_per_order'),expect(b['detail'])['toContain']('per\x20(recipient,\x20guard,\x20order)');}),it('stamp\x20on\x20a\x20non-Order\x20slot\x20→\x20replay_scope\x20once_per_stamp\x20(no\x20overclaim)',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'100000000'},'store_from_id':0x2}]})]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['replay_scope'];expect(b['scope'])['toBe']('once_per_stamp'),expect(b['detail'])['toContain']('slots:\x202'),expect(b['detail'])['toContain']('per-ORDER\x20only\x20when');}),it('mixed\x20stamped/unstamped\x20guards\x20→\x20replay_scope\x20mixed;\x20no\x20guards\x20→\x20unknown',async()=>{svcWithRewards(REWARD),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[{'guard':CLAIM_GUARD,'amount':{'type':0x1,'value':'1'},'store_from_id':0x0},{'guard':'0x'+'6'['repeat'](0x40),'amount':{'type':0x1,'value':'1'}}]})]});const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'][0x0]['replay_scope']['scope'])['toBe']('mixed'),expect(a['reward_terms']['rewards'][0x0]['replay_scope']['detail'])['toContain']('1\x20of\x202'),sdkMocks['query_objects']['mockResolvedValue']({'objects':[makeReward({'guards':[]})]});const b=await handleServiceQuote(quoteInput());expect(b['reward_terms']['rewards'][0x0]['replay_scope']['scope'])['toBe']('unknown');});});function ratingFloorGuard(a={}){return{'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_as_u256_greater_or_equal','nodes':[{'type':'query','query':'repository.data.rating'},{'type':'identifier','identifier':'4'}]}]},'table':[{'identifier':0x4,'b_submission':![],'value':0x4}],...a};}function mockRewardThenGuard(a){sdkMocks['query_objects']['mockResolvedValueOnce']({'objects':[makeReward()]})['mockResolvedValueOnce']({'objects':[a]});}describe('service_quote\x20min_rating\x20signal\x20detection\x20(R2-02)',()=>{it('UTF-8\x20byte-array\x20rating\x20key\x20→\x20the\x20floor\x20decodes\x20(NOT\x20null)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard({'rating_key':[0x72,0x61,0x74,0x69,0x6e,0x67]}));const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('>=\x204'),expect(a['reward_terms']['data_gaps'])['toEqual']([]);}),it('hex-encoded\x20rating\x20key\x20→\x20the\x20floor\x20decodes\x20(NOT\x20null)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard({'rating_key_hex':'726174696e67'}));const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'][0x0]['claims'][0x0]['min_rating'])['toBe']('>=\x204');}),it('base64-encoded\x20rating\x20key\x20→\x20the\x20floor\x20decodes\x20(NOT\x20null)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard({'rating_key_b64':'cmF0aW5n'}));const a=await handleServiceQuote(quoteInput());expect(a['reward_terms']['rewards'][0x0]['claims'][0x0]['min_rating'])['toBe']('>=\x204');}),it('no\x20rating\x20signal\x20at\x20all\x20→\x20min_rating\x20stays\x20null\x20(unconditional,\x20NOT\x20unknown)',async()=>{svcWithRewards(REWARD),mockRewardThenGuard(ratingFloorGuard());const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBeNull'](),expect(a['reward_terms']['data_gaps'])['toEqual']([]);}),it('rating\x20signal\x20present\x20but\x20the\x20structure\x20is\x20not\x20a\x20decodable\x20floor\x20→\x20unknown\x20+\x20data_gaps\x20disclosure',async()=>{svcWithRewards(REWARD),mockRewardThenGuard({'object':CLAIM_GUARD,'root':{'type':'logic_and','nodes':[{'type':'logic_equal','nodes':[{'type':'query','query':'repository.data.rating'},{'type':'identifier','identifier':'4'}]}]},'table':[{'identifier':0x4,'b_submission':![],'value':0x4}],'rating_key':[0x72,0x61,0x74,0x69,0x6e,0x67]});const a=await handleServiceQuote(quoteInput()),b=a['reward_terms']['rewards'][0x0]['claims'][0x0];expect(b['min_rating'])['toBe']('unknown'),expect(a['reward_terms']['data_gaps']['some'](d=>d['includes']('min_rating=unknown')))['toBe'](!![]);});});function svcWithFund(a){sdkMocks['query_serviceContext']['mockResolvedValue']({'service':{'type_raw':'Service<0x2::wow::WOW>','sales':[{'name':FLEXIBLE,'price':{'balance':LIST_TOTAL['toString']()},'suspension':![]}],'compensation_fund':a}});}describe('service_quote\x20compensation_fund_coverage\x20(b6-11)',()=>{it('no\x20fund\x20→\x20covered:false\x20with\x20the\x20no-protection\x20disclosure\x20(never\x20blocked)',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage'])['not']['toBeNull'](),expect(a['compensation_fund_coverage']['fund_balance'])['toBe']('0'),expect(a['compensation_fund_coverage']['required_for_this_basket'])['toBe']('2700000000'),expect(a['compensation_fund_coverage']['covered'])['toBe'](![]),expect(a['compensation_fund_coverage']['note'])['toContain']('WITHOUT\x20a\x20compensation\x20fund'),expect(a['compensation_fund_coverage']['note'])['toContain']('never\x20blocked');}),it('fund\x20at/over\x203x\x20the\x20basket\x20→\x20covered:true',async()=>{svcWithFund('2700000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['covered'])['toBe'](!![]),expect(a['compensation_fund_coverage']['note'])['toContain']('payable\x20from\x20the\x20pool');}),it('fund\x20short\x20→\x20covered:false\x20and\x20the\x20note\x20names\x20the\x20warning\x20+\x20error\x20code\x20anchor',async()=>{svcWithFund('100000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['covered'])['toBe'](![]),expect(a['compensation_fund_coverage']['note'])['toContain']('PROCEEDS\x20with\x20a\x20warning'),expect(a['compensation_fund_coverage']['note'])['toContain']('compensation_fund_below_order_ceiling'),expect(a['compensation_fund_coverage']['note'])['toContain']('compensation_fund_add');}),it('shortfall\x20states\x20the\x20exact\x20top-up\x20(required\x20-\x20fund;\x20etsy-gf\x20R1:\x20no\x20reader\x20subtraction)',async()=>{svcWithFund('1000000000');const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['shortfall'])['toBe']('1700000000'),expect(a['compensation_fund_coverage']['note'])['toContain']('by'),svcWithFund('2700000000');const b=await handleServiceQuote(quoteInput());expect(b['compensation_fund_coverage']['shortfall'])['toBe']('0'),svcWithFund('0');const c=await handleServiceQuote(quoteInput());expect(c['compensation_fund_coverage']['shortfall'])['toBe']('2700000000');}),it('F-OF2-06:\x20max_coverable_order\x20names\x20the\x20storefront\x20price\x20cap\x20(fund/3)\x20in\x20every\x20fund\x20state',async()=>{const a=await handleServiceQuote(quoteInput());expect(a['compensation_fund_coverage']['max_coverable_order'])['toBe']('0'),svcWithFund('2700000000');const b=await handleServiceQuote(quoteInput());expect(b['compensation_fund_coverage']['max_coverable_order'])['toBe']('900000000'),expect(b['compensation_fund_coverage']['note'])['toContain']('ceiling'),svcWithFund('1000000000');const c=await handleServiceQuote(quoteInput());expect(c['compensation_fund_coverage']['max_coverable_order'])['toBe']('333333333'),expect(c['compensation_fund_coverage']['note'])['toContain']('orders\x20above');}),it('required\x20base\x20is\x20the\x20DISCOUNTED\x20total\x20(what\x20the\x20order\x20actually\x20pays)',async()=>{svcWithFund('2295000000');const a=await handleServiceQuote(quoteInput({'discount':'bk3t-promo15'}));expect(a['total_pay']['balance'])['toBe']('765000000'),expect(a['compensation_fund_coverage']['required_for_this_basket'])['toBe']('2295000000'),expect(a['compensation_fund_coverage']['covered'])['toBe'](!![]);});});
@@ -1 +1 @@
1
- import{objectTypeFromAddress,ObjectType}from'@wowok/wowok';import{resolveAddress as a403a}from'../tools/handlers/name-resolution.js';import{handleObjectPanorama}from'../playbooks/service-build/object-panorama.js';import{handleServicePanorama}from'../playbooks/service-build/service-panorama.js';import{handleMachinePanorama}from'../playbooks/service-build/machine-panorama.js';import{assembleOrderReview}from'./order.js';import{assembleServiceReview}from'./service.js';import{assembleMachineReview}from'./machine.js';import{assembleArbReview}from'./arb.js';import{assembleDemandReview}from'./demand.js';import{assembleRepositoryReview}from'./repository.js';import{assembleProgressReview}from'./progress.js';export const REVIEW_PACK_TYPES=['Order','Service','Arb','Demand','Repository','Progress','Machine'];export async function handleReviewPack(a){const b=a['object_address'];if(!b)throw new Error('\x27object_address\x27\x20is\x20required\x20for\x20review_pack');const c=await a403a(b,'object_address'),d=objectTypeFromAddress(c);if(d===ObjectType['Order']){const g=await handleObjectPanorama(a);if(g['object_type']!=='Order')throw new Error('review_pack:\x20expected\x20an\x20Order,\x20resolved\x20to\x20'+g['object_type']);return assembleOrderReview(g);}if(d===ObjectType['Service']){const h=await handleServicePanorama({...a,'service_address':c});return assembleServiceReview(h);}if(d===ObjectType['Machine']){const i=await handleMachinePanorama({...a,'object_address':c});if(i['machineAddress']?.['toLowerCase']()!==c['toLowerCase']())throw new Error('review_pack:\x20expected\x20a\x20Machine,\x20resolved\x20to\x20'+i['machineAddress']);return assembleMachineReview(i);}const e={[ObjectType['Arb']]:assembleArbReview,[ObjectType['Demand']]:assembleDemandReview,[ObjectType['Repository']]:assembleRepositoryReview,[ObjectType['Progress']]:assembleProgressReview},f=d?e[d]:undefined;if(f){const j=await handleObjectPanorama(a);if(j['object_type']!==d)throw new Error('review_pack:\x20expected\x20a\x20'+d+',\x20resolved\x20to\x20'+j['object_type']);return f(j);}throw new Error('review_pack:\x20unsupported\x20object\x20type\x20\x27'+(d??'unknown')+'\x27\x20—\x20supported:\x20'+REVIEW_PACK_TYPES['join'](',\x20')+'.\x20Other\x20types\x20keep\x20object_panorama\x20/\x20machine_panorama\x20/\x20service_panorama.');}
1
+ import{objectTypeFromAddress,ObjectType}from'@wowok/wowok';import{resolveAddress as a408a}from'../tools/handlers/name-resolution.js';import{handleObjectPanorama}from'../playbooks/service-build/object-panorama.js';import{handleServicePanorama}from'../playbooks/service-build/service-panorama.js';import{handleMachinePanorama}from'../playbooks/service-build/machine-panorama.js';import{assembleOrderReview}from'./order.js';import{assembleServiceReview}from'./service.js';import{assembleMachineReview}from'./machine.js';import{assembleArbReview}from'./arb.js';import{assembleDemandReview}from'./demand.js';import{assembleRepositoryReview}from'./repository.js';import{assembleProgressReview}from'./progress.js';export const REVIEW_PACK_TYPES=['Order','Service','Arb','Demand','Repository','Progress','Machine'];export async function handleReviewPack(a){const b=a['object_address'];if(!b)throw new Error('\x27object_address\x27\x20is\x20required\x20for\x20review_pack');const c=await a408a(b,'object_address'),d=objectTypeFromAddress(c);if(d===ObjectType['Order']){const g=await handleObjectPanorama(a);if(g['object_type']!=='Order')throw new Error('review_pack:\x20expected\x20an\x20Order,\x20resolved\x20to\x20'+g['object_type']);return assembleOrderReview(g);}if(d===ObjectType['Service']){const h=await handleServicePanorama({...a,'service_address':c});return assembleServiceReview(h);}if(d===ObjectType['Machine']){const i=await handleMachinePanorama({...a,'object_address':c});if(i['machineAddress']?.['toLowerCase']()!==c['toLowerCase']())throw new Error('review_pack:\x20expected\x20a\x20Machine,\x20resolved\x20to\x20'+i['machineAddress']);return assembleMachineReview(i);}const e={[ObjectType['Arb']]:assembleArbReview,[ObjectType['Demand']]:assembleDemandReview,[ObjectType['Repository']]:assembleRepositoryReview,[ObjectType['Progress']]:assembleProgressReview},f=d?e[d]:undefined;if(f){const j=await handleObjectPanorama(a);if(j['object_type']!==d)throw new Error('review_pack:\x20expected\x20a\x20'+d+',\x20resolved\x20to\x20'+j['object_type']);return f(j);}throw new Error('review_pack:\x20unsupported\x20object\x20type\x20\x27'+(d??'unknown')+'\x27\x20—\x20supported:\x20'+REVIEW_PACK_TYPES['join'](',\x20')+'.\x20Other\x20types\x20keep\x20object_panorama\x20/\x20machine_panorama\x20/\x20service_panorama.');}
@@ -1 +1 @@
1
- import{CONFIRMATION_RULES,resolveOverrideId}from'../knowledge/safety-rules.js';import{isEnabled as a419a}from'../config/index.js';import{isPlanPreapproved}from'../goal/plan-approval.js';export function isConfirmGateEnabled(){return a419a('confirm_gate');}const internalErrorCounts={};function logInternalError(a,b){const c=a;internalErrorCounts[c]=(internalErrorCounts[c]??0x0)+0x1;const d=internalErrorCounts[c];console['warn']('[ConfirmGate]\x20internal_error\x20context=\x22'+a+'\x22\x20count='+d+'\x20error='+(b instanceof Error?b['message']:String(b)));}export function getFailMode(a){switch(a){case'irreversible':case'publish':case'amount':return'closed';case'standard':case'none':default:return'open';}}function buildInternalErrorResult(a,b,c){const d=b instanceof Error?b['message']:b!==undefined?String(b):undefined;return{'pass':![],'level':'irreversible','preview':{'level':'irreversible','operation':a,'irreversible':!![],'warnings':[...c?['ConfirmGate\x20rule\x20\x27'+c+'\x27\x20matched\x20but\x20its\x20preview\x20could\x20not\x20be\x20generated.']:['An\x20error\x20occurred\x20while\x20matching\x20confirmation\x20rules.'],...d!==undefined?['Reason:\x20'+d]:[],'The\x20operation\x20was\x20NOT\x20executed.\x20Review\x20the\x20parameters\x20for\x20malformed\x20values\x20(e.g.\x20decimal\x20amounts\x20instead\x20of\x20smallest-unit\x20integers)\x20before\x20confirming.']},'rule_id':'internal_error'};}function emitGuardQuietNotice(a,b,c,d,f){try{const g=f['preview'](a,b,c),h=['[ConfirmGate]\x20guard\x20CREATE\x20proceeded\x20WITHOUT\x20interactive\x20confirmation\x20(confirm_mode:\x20'+d+').','\x20\x20Object:\x20'+String(g['object']??'(unnamed)')+'\x20\x20Network:\x20'+String(g['network']??'?'),...(g['warnings']??[])['map'](i=>'\x20\x20-\x20'+i),'\x20\x20Immutable\x20after\x20creation\x20—\x20changes\x20require\x20a\x20NEW\x20guard\x20+\x20rebind.\x20Verify\x20with\x20analyze_guard_semantics\x20after\x20creation.'];console['warn'](h['join']('\x0a'));}catch(i){console['warn']('[ConfirmGate]\x20guard\x20CREATE\x20proceeded\x20in\x20'+d+'\x20mode\x20(manifest\x20unavailable:\x20'+(i instanceof Error?i['message']:String(i))+')');}}export function confirmGate(a,b,c,d,f,g){if(!isConfirmGateEnabled())return{'pass':!![]};if(c?.['confirmed']===!![])return{'pass':!![]};if(c?.['dry_run']===!![])return{'pass':!![]};let h,i=null;try{h=CONFIRMATION_RULES['find'](n=>{try{return n['when'](a,b,c);}catch(o){logInternalError('rule_when:'+n['id'],o);if(getFailMode(n['level'])==='closed')throw o;return![];}});}catch(n){i=n;}if(i)return logInternalError('rule_search',i),buildInternalErrorResult(a,i);if(!h)return{'pass':!![]};if(getFailMode(h['level'])==='open'&&isPlanPreapproved(c))return{'pass':!![]};const j=resolveOverrideId(h['id'],a),k=j?f?.[j]:undefined;if(k==='auto')return{'pass':!![]};const l=c?.['confirm_mode']==='quiet'||c?.['confirm_mode']==='streamlined'?c['confirm_mode']:'full';if(l!=='full'&&k!=='block'&&getFailMode(h['level'])==='open')return{'pass':!![]};if(h['id']==='guard_create_immutable'&&l!=='full'&&k!=='block')return emitGuardQuietNotice(a,b,c,l,h),{'pass':!![]};if(k!=='block'&&g?.['intent_bypass']!==![]&&h['bypass_on_explicit_intent']&&d&&d['length']>0x0){const o=d['map'](q=>q['toLowerCase']()),p=h['bypass_on_explicit_intent']['some'](q=>o['some'](r=>r['includes'](q['toLowerCase']())));if(p)return{'pass':!![]};}let m;try{m=h['preview'](a,b,c);}catch(q){logInternalError('rule_preview:'+h['id'],q);if(getFailMode(h['level'])==='closed')return buildInternalErrorResult(a,q,h['id']);return{'pass':!![]};}return{'pass':![],'level':h['level'],'preview':m,'rule_id':h['id']};}export function isExplicitlyConfirmed(a){return a?.['confirmed']===!![];}
1
+ import{CONFIRMATION_RULES,resolveOverrideId}from'../knowledge/safety-rules.js';import{isEnabled as a424a}from'../config/index.js';import{isPlanPreapproved}from'../goal/plan-approval.js';export function isConfirmGateEnabled(){return a424a('confirm_gate');}const internalErrorCounts={};function logInternalError(a,b){const c=a;internalErrorCounts[c]=(internalErrorCounts[c]??0x0)+0x1;const d=internalErrorCounts[c];console['warn']('[ConfirmGate]\x20internal_error\x20context=\x22'+a+'\x22\x20count='+d+'\x20error='+(b instanceof Error?b['message']:String(b)));}export function getFailMode(a){switch(a){case'irreversible':case'publish':case'amount':return'closed';case'standard':case'none':default:return'open';}}function buildInternalErrorResult(a,b,c){const d=b instanceof Error?b['message']:b!==undefined?String(b):undefined;return{'pass':![],'level':'irreversible','preview':{'level':'irreversible','operation':a,'irreversible':!![],'warnings':[...c?['ConfirmGate\x20rule\x20\x27'+c+'\x27\x20matched\x20but\x20its\x20preview\x20could\x20not\x20be\x20generated.']:['An\x20error\x20occurred\x20while\x20matching\x20confirmation\x20rules.'],...d!==undefined?['Reason:\x20'+d]:[],'The\x20operation\x20was\x20NOT\x20executed.\x20Review\x20the\x20parameters\x20for\x20malformed\x20values\x20(e.g.\x20decimal\x20amounts\x20instead\x20of\x20smallest-unit\x20integers)\x20before\x20confirming.']},'rule_id':'internal_error'};}function emitGuardQuietNotice(a,b,c,d,f){try{const g=f['preview'](a,b,c),h=['[ConfirmGate]\x20guard\x20CREATE\x20proceeded\x20WITHOUT\x20interactive\x20confirmation\x20(confirm_mode:\x20'+d+').','\x20\x20Object:\x20'+String(g['object']??'(unnamed)')+'\x20\x20Network:\x20'+String(g['network']??'?'),...(g['warnings']??[])['map'](i=>'\x20\x20-\x20'+i),'\x20\x20Immutable\x20after\x20creation\x20—\x20changes\x20require\x20a\x20NEW\x20guard\x20+\x20rebind.\x20Verify\x20with\x20analyze_guard_semantics\x20after\x20creation.'];console['warn'](h['join']('\x0a'));}catch(i){console['warn']('[ConfirmGate]\x20guard\x20CREATE\x20proceeded\x20in\x20'+d+'\x20mode\x20(manifest\x20unavailable:\x20'+(i instanceof Error?i['message']:String(i))+')');}}export function confirmGate(a,b,c,d,f,g){if(!isConfirmGateEnabled())return{'pass':!![]};if(c?.['confirmed']===!![])return{'pass':!![]};if(c?.['dry_run']===!![])return{'pass':!![]};let h,i=null;try{h=CONFIRMATION_RULES['find'](n=>{try{return n['when'](a,b,c);}catch(o){logInternalError('rule_when:'+n['id'],o);if(getFailMode(n['level'])==='closed')throw o;return![];}});}catch(n){i=n;}if(i)return logInternalError('rule_search',i),buildInternalErrorResult(a,i);if(!h)return{'pass':!![]};if(getFailMode(h['level'])==='open'&&isPlanPreapproved(c))return{'pass':!![]};const j=resolveOverrideId(h['id'],a),k=j?f?.[j]:undefined;if(k==='auto')return{'pass':!![]};const l=c?.['confirm_mode']==='quiet'||c?.['confirm_mode']==='streamlined'?c['confirm_mode']:'full';if(l!=='full'&&k!=='block'&&getFailMode(h['level'])==='open')return{'pass':!![]};if(h['id']==='guard_create_immutable'&&l!=='full'&&k!=='block')return emitGuardQuietNotice(a,b,c,l,h),{'pass':!![]};if(k!=='block'&&g?.['intent_bypass']!==![]&&h['bypass_on_explicit_intent']&&d&&d['length']>0x0){const o=d['map'](q=>q['toLowerCase']()),p=h['bypass_on_explicit_intent']['some'](q=>o['some'](r=>r['includes'](q['toLowerCase']())));if(p)return{'pass':!![]};}let m;try{m=h['preview'](a,b,c);}catch(q){logInternalError('rule_preview:'+h['id'],q);if(getFailMode(h['level'])==='closed')return buildInternalErrorResult(a,q,h['id']);return{'pass':!![]};}return{'pass':![],'level':h['level'],'preview':m,'rule_id':h['id']};}export function isExplicitlyConfirmed(a){return a?.['confirmed']===!![];}
@@ -4,6 +4,7 @@ export declare const BenchmarkMigrationSchema: z.ZodObject<{
4
4
  template_list: "template_list";
5
5
  template_get: "template_get";
6
6
  template_generate: "template_generate";
7
+ plan_execute: "plan_execute";
7
8
  template_scan: "template_scan";
8
9
  migration_import: "migration_import";
9
10
  migration_review: "migration_review";
@@ -13,7 +14,7 @@ export declare const BenchmarkMigrationSchema: z.ZodObject<{
13
14
  industry: z.ZodOptional<z.ZodString>;
14
15
  description: z.ZodOptional<z.ZodString>;
15
16
  semantic_ir: z.ZodOptional<z.ZodObject<{
16
- schema_version: z.ZodLiteral<1>;
17
+ schema_version: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
17
18
  locale: z.ZodString;
18
19
  traits: z.ZodOptional<z.ZodArray<z.ZodObject<{
19
20
  trait: z.ZodString;
@@ -44,6 +45,13 @@ export declare const BenchmarkMigrationSchema: z.ZodObject<{
44
45
  }, z.core.$strict>>;
45
46
  quote: z.ZodOptional<z.ZodString>;
46
47
  }, z.core.$strict>>>;
48
+ discovery: z.ZodOptional<z.ZodObject<{
49
+ industry: z.ZodOptional<z.ZodString>;
50
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
51
+ product_ref: z.ZodOptional<z.ZodString>;
52
+ english_summary: z.ZodOptional<z.ZodString>;
53
+ confidence: z.ZodOptional<z.ZodNumber>;
54
+ }, z.core.$strict>>;
47
55
  provenance: z.ZodObject<{
48
56
  source: z.ZodEnum<{
49
57
  human: "human";
@@ -104,6 +112,13 @@ export declare const BenchmarkMigrationSchema: z.ZodObject<{
104
112
  none: "none";
105
113
  flexible: "flexible";
106
114
  }>>;
115
+ logistics_mode: z.ZodOptional<z.ZodEnum<{
116
+ none: "none";
117
+ courier: "courier";
118
+ carrier: "carrier";
119
+ merchant_managed: "merchant_managed";
120
+ pickup_point: "pickup_point";
121
+ }>>;
107
122
  sales: z.ZodOptional<z.ZodArray<z.ZodObject<{
108
123
  incentive: z.ZodOptional<z.ZodObject<{
109
124
  amount: z.ZodString;
@@ -118,6 +133,10 @@ export declare const BenchmarkMigrationSchema: z.ZodObject<{
118
133
  mainnet: "mainnet";
119
134
  localnet: "localnet";
120
135
  }>>;
136
+ plan: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
137
+ completed_steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
138
+ previous_outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
139
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
121
140
  }, z.core.$strict>;
122
141
  export type BenchmarkMigrationInput = z.infer<typeof BenchmarkMigrationSchema>;
123
142
  export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
@@ -141,7 +160,13 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
141
160
  supplier: "supplier";
142
161
  both: "both";
143
162
  }>;
163
+ tags: z.ZodArray<z.ZodString>;
144
164
  }, z.core.$strip>>;
165
+ discovery_vocabulary: z.ZodObject<{
166
+ industries: z.ZodArray<z.ZodString>;
167
+ tags: z.ZodArray<z.ZodString>;
168
+ product_refs: z.ZodArray<z.ZodString>;
169
+ }, z.core.$strip>;
145
170
  load_errors: z.ZodArray<z.ZodString>;
146
171
  }, z.core.$strip>, z.ZodObject<{
147
172
  action: z.ZodLiteral<"template_get">;
@@ -172,6 +197,12 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
172
197
  red_flags: z.ZodArray<z.ZodString>;
173
198
  }, z.core.$strip>;
174
199
  plan: z.ZodRecord<z.ZodString, z.ZodUnknown>;
200
+ stale_build: z.ZodObject<{
201
+ stale: z.ZodBoolean;
202
+ known: z.ZodBoolean;
203
+ lag_minutes: z.ZodNullable<z.ZodNumber>;
204
+ detail: z.ZodString;
205
+ }, z.core.$strip>;
175
206
  verdict: z.ZodObject<{
176
207
  buildable: z.ZodBoolean;
177
208
  blockers: z.ZodArray<z.ZodString>;
@@ -206,6 +237,12 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
206
237
  }, z.core.$strip>>;
207
238
  red_flags: z.ZodArray<z.ZodString>;
208
239
  }, z.core.$strip>;
240
+ stale_build: z.ZodObject<{
241
+ stale: z.ZodBoolean;
242
+ known: z.ZodBoolean;
243
+ lag_minutes: z.ZodNullable<z.ZodNumber>;
244
+ detail: z.ZodString;
245
+ }, z.core.$strip>;
209
246
  }, z.core.$strip>, z.ZodObject<{
210
247
  next_action: z.ZodString;
211
248
  semantic_ir_digest: z.ZodOptional<z.ZodString>;
@@ -218,6 +255,19 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
218
255
  detected_industry: z.ZodString;
219
256
  matched_template: z.ZodString;
220
257
  }, z.core.$strip>;
258
+ template_match: z.ZodObject<{
259
+ source: z.ZodEnum<{
260
+ keywords: "keywords";
261
+ product_ref: "product_ref";
262
+ explicit: "explicit";
263
+ discovery_product_ref: "discovery_product_ref";
264
+ discovery_tags: "discovery_tags";
265
+ ir_industry_fallback: "ir_industry_fallback";
266
+ industry_leader: "industry_leader";
267
+ }>;
268
+ confidence: z.ZodNumber;
269
+ matched_tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
270
+ }, z.core.$strip>;
221
271
  mapped: z.ZodArray<z.ZodObject<{
222
272
  source_element: z.ZodString;
223
273
  target_object: z.ZodOptional<z.ZodString>;
@@ -267,6 +317,19 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
267
317
  detected_industry: z.ZodString;
268
318
  matched_template: z.ZodString;
269
319
  }, z.core.$strip>;
320
+ template_match: z.ZodObject<{
321
+ source: z.ZodEnum<{
322
+ keywords: "keywords";
323
+ product_ref: "product_ref";
324
+ explicit: "explicit";
325
+ discovery_product_ref: "discovery_product_ref";
326
+ discovery_tags: "discovery_tags";
327
+ ir_industry_fallback: "ir_industry_fallback";
328
+ industry_leader: "industry_leader";
329
+ }>;
330
+ confidence: z.ZodNumber;
331
+ matched_tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
332
+ }, z.core.$strip>;
270
333
  mapped: z.ZodArray<z.ZodObject<{
271
334
  source_element: z.ZodString;
272
335
  target_object: z.ZodOptional<z.ZodString>;
@@ -349,6 +412,14 @@ export declare const BenchmarkMigrationOutputSchema: z.ZodObject<{
349
412
  mainnet: "mainnet";
350
413
  localnet: "localnet";
351
414
  }>;
415
+ }, z.core.$strip>, z.ZodObject<{
416
+ action: z.ZodLiteral<"plan_execute">;
417
+ completed: z.ZodBoolean;
418
+ steps: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
419
+ outputs: z.ZodRecord<z.ZodString, z.ZodString>;
420
+ preflight: z.ZodRecord<z.ZodString, z.ZodUnknown>;
421
+ readback: z.ZodRecord<z.ZodString, z.ZodUnknown>;
422
+ next_action: z.ZodString;
352
423
  }, z.core.$strip>], "action">;
353
424
  }, z.core.$strict>;
354
425
  export type BenchmarkMigrationOutput = z.infer<typeof BenchmarkMigrationOutputSchema>;
@@ -1 +1 @@
1
- import{z}from'zod';import{GuardResolutionInputSchema}from'../goal/planning.js';import{SemanticIRInputSchema}from'../../knowledge/semantic-ir.js';const TemplateSummarySchema=z['object']({'id':z['string']()['describe']('Template\x20id\x20\x27<industry>/<variant>\x27,\x20e.g.\x20\x27retail/scale-marketplace\x27.'),'industry':z['string']()['describe']('Industry\x20vertical.'),'variant':z['string']()['describe']('Business-model\x20variant\x20slug.'),'product_ref':z['string']()['optional']()['describe']('Benchmark\x20product\x20slug\x20this\x20archetype\x20models\x20(e.g.\x20\x27amazon\x27).\x20The\x20only\x20sanctioned\x20company\x20name;\x20users\x20can\x20pick\x20a\x20template\x20by\x20naming\x20the\x20incumbent\x20product.'),'archetype':z['enum'](['leader','challenger']),'key_risk':z['string']()['describe']('Primary\x20risk\x20this\x20template\x20mitigates.'),'node_count':z['number']()['describe']('Machine\x20node\x20count.'),'guard_count':z['number']()['describe']('Guard\x20template\x20count.'),'recommended_role':z['enum'](['merchant','supplier','both'])})['describe']('Compact\x20template\x20listing\x20row.'),TemplateScanFindingSchema=z['object']({'rule_id':z['string']()['optional']()['describe']('Rule\x20id\x20when\x20known\x20(e.g.\x20\x27R-M3-01\x27,\x20\x27R1\x27).'),'severity':z['enum'](['low','medium','high','critical']),'title':z['string'](),'detail':z['string'](),'suggestion':z['string']()})['describe']('One\x20pre-deploy\x20risk\x20finding.'),MigrationEntrySchema=z['object']({'source_element':z['string']()['describe']('Competitor-side\x20element.'),'target_object':z['string']()['optional']()['describe']('WoWok\x20object/mechanism\x20it\x20maps\x20to.'),'mapping_note':z['string']()['describe']('One-line\x20mapping\x20explanation.'),'reason':z['string']()['optional']()['describe']('Why\x20it\x20cannot\x20be\x20migrated,\x20or\x20why\x20it\x20needs\x20a\x20decision.')})['describe']('One\x20competitor\x20element\x20and\x20its\x20WoWok\x20mapping\x20outcome.'),MigrationLogSchema=z['object']({'source':z['object']({'url':z['string']()['optional'](),'description':z['string'](),'detected_industry':z['string'](),'matched_template':z['string']()['describe']('Matched\x20template\x20id\x20\x27<industry>/<variant>\x27.')})['describe']('Migration\x20source\x20provenance.'),'mapped':z['array'](MigrationEntrySchema)['describe']('Elements\x20that\x20map\x20cleanly\x20to\x20WoWok\x20objects.'),'unmapped':z['array'](MigrationEntrySchema)['describe']('Elements\x20that\x20cannot\x20be\x20migrated,\x20with\x20reasons.'),'manual_review':z['array'](MigrationEntrySchema)['describe']('Elements\x20requiring\x20an\x20explicit\x20user\x20decision.'),'wowok_advantages':z['array'](z['string']())['describe']('WoWok\x20platform\x20advantages\x20surfaced\x20during\x20migration.'),'customizable_modules':z['array'](z['string']())['describe']('Business-module\x20ids\x20the\x20user\x20can\x20customize.'),'role_assessment':z['object']({'recommended':z['string'](),'rationale':z['string'](),'alternatives':z['array'](z['string']())})['describe']('Merchant\x20vs\x20supplier\x20role\x20assessment.'),'risk_check':z['object']({'passed':z['boolean'](),'findings':z['array'](z['string']())})['describe']('Dry-run\x20risk\x20check\x20against\x20the\x20matched\x20template.'),'network':z['enum'](['testnet','mainnet','localnet'])['describe']('Target\x20network\x20(default\x20testnet).\x20\x27localnet\x27\x20labels\x20plans\x20validated\x20against\x20a\x20local\x20net\x20—\x20the\x20migration\x20pipeline\x20is\x20network-agnostic,\x20this\x20is\x20provenance\x20metadata,\x20not\x20an\x20execution\x20target.')})['describe']('Structured\x20competitor-migration\x20log.'),SaleItemIncentiveSchema=z['object']({'amount':z['string']()['describe']('Incentive\x20amount\x20as\x20a\x20buyer-readable\x20string\x20(e.g.\x20\x225\x20USDC\x22\x20or\x20\x221000000000\x20WOW\x20smallest\x20units\x22).\x20Quote-time\x20disclosure\x20only\x20—\x20fund\x20the\x20actual\x20rail\x20separately\x20(e.g.\x20the\x20template\x27s\x20review_reward_pool).'),'conditions':z['string']()['describe']('What\x20the\x20buyer\x20must\x20do\x20to\x20earn\x20it\x20(e.g.\x20\x22leave\x20a\x20written\x20+\x20rated\x20review\x20of\x20the\x20delivered\x20work\x22).\x20Must\x20be\x20perceptible\x20BEFORE\x20the\x20order\x20is\x20placed.'),'basis':z['string']()['describe']('Accrual\x20scope:\x20\x22per-order\x22\x20/\x20\x22once-per-buyer\x22\x20/\x20\x22once-per-buyer-per-order\x22.\x20Matches\x20the\x20claim\x20guard\x27s\x20replay\x20semantics\x20—\x20a\x20recipient-only\x20gate\x20is\x20once-per-buyer-for-life,\x20an\x20order-scoped\x20stamp\x20is\x20per-order\x20(SV-2).'),'claim_window':z['string']()['describe']('How\x20long\x20the\x20buyer\x20has\x20to\x20claim\x20(e.g.\x20\x2214\x20days\x20from\x20the\x20review\x22).\x20Mirror\x20the\x20reward\x20claim\x20guard\x27s\x20window\x20fee_param\x20so\x20the\x20quote\x20never\x20promises\x20more\x20than\x20the\x20rail\x20pays.')})['strict']()['describe']('Optional\x20structured\x20incentive\x20for\x20one\x20sale\x20item\x20(G-07):\x20buyer-perceivable\x20reward\x20terms\x20carried\x20to\x20the\x20compiled\x20plan\x20for\x20quote-time\x20disclosure.\x20DECLARATION\x20ONLY\x20—\x20the\x20chain\x20SaleItem\x20has\x20no\x20such\x20field;\x20the\x20actual\x20payout\x20rail\x20is\x20configured\x20separately.'),SaleItemPlanSchema=z['object']({'incentive':SaleItemIncentiveSchema['optional']()})['passthrough']()['describe']('One\x20sellable\x20SKU\x20in\x20the\x20plan\x20catalog:\x20the\x20chain\x20SaleItem\x20fields\x20plus\x20the\x20optional\x20structured\x20`incentive`\x20declaration\x20(G-07).\x20Unknown\x20keys\x20pass\x20through\x20so\x20chain-side\x20fields\x20can\x20evolve\x20without\x20schema\x20changes.');export const BenchmarkMigrationSchema=z['object']({'action':z['enum'](['template_list','template_get','template_generate','template_scan','migration_import','migration_review','migration_apply'])['describe']('Action:\x20\x27template_list\x27\x20=\x20list\x20the\x20loaded\x20MD\x20industry\x20templates\x20(optional\x20industry\x20filter);\x20'+'\x27template_get\x27\x20=\x20fetch\x20one\x20template\x20by\x20id\x20(template_id\x20required);\x20'+'\x27template_generate\x27\x20=\x20generate\x20a\x20creation\x20plan\x20from\x20a\x20template\x20via\x20the\x20merchant-guide\x20'+'pipeline\x20(template_id\x20required;\x20scan-first\x20—\x20CRITICAL\x20findings\x20block;\x20never\x20executes\x20on-chain);\x20'+'\x27template_scan\x27\x20=\x20pre-deploy\x20risk\x20scan\x20of\x20one\x20template\x20(template_id\x20required;\x20returns\x20'+'risk_level/findings/red_flags\x20plus\x20a\x20drift\x20face\x20—\x20disk-vs-catalog\x20provenance\x20of\x20the\x20'+'scanned\x20body;\x20CRITICAL\x20blocks\x20generation/apply);\x20'+'\x27migration_import\x27\x20=\x20competitor\x20URL/description\x20→\x20migration\x20plan\x20+\x20MigrationLog\x20'+'(description\x20required);\x20'+'\x27migration_review\x27\x20=\x20surface\x20the\x20MigrationLog\x20for\x20user\x20confirmation\x20(log\x20required);\x20'+'\x27migration_apply\x27\x20=\x20run\x20the\x20approved\x20template\x20through\x20the\x20merchant-guide\x20pipeline\x20'+'(template_id\x20required;\x20scan-first\x20—\x20CRITICAL\x20findings\x20block;\x20default\x20network\x20testnet).'),'template_id':z['string']()['optional']()['describe']('Template\x20id\x20\x27<industry>/<variant>\x27\x20(required\x20for\x20template_get\x20/\x20template_generate\x20/\x20template_scan\x20/\x20migration_apply),\x20e.g.\x20\x27retail/scale-marketplace\x27.'),'industry':z['string']()['optional']()['describe']('Industry\x20filter\x20for\x20template_list;\x20industry\x20hint\x20for\x20migration_import.\x20'+'Any\x20registered\x20industry\x20is\x20accepted\x20(builtin:\x20freelance,\x20rental,\x20education,\x20'+'travel,\x20subscription,\x20retail;\x20plus\x20custom\x20industries\x20registered\x20via\x20industry\x20packs).\x20'+'Aliases\x20are\x20resolved\x20(e.g.\x20\x27ecommerce\x27\x20→\x20\x27retail\x27).'),'description':z['string']()['optional']()['describe']('Natural-language\x20business/competitor\x20description\x20(required\x20for\x20migration_import;\x20used\x20by\x20template_generate\x20as\x20the\x20intent\x20text).'),'semantic_ir':SemanticIRInputSchema['optional']()['describe']('Canonical\x20Semantic\x20IR\x20produced\x20by\x20the\x20CALLING\x20agent\x20for\x20a\x20NON-ENGLISH\x20(or\x20lexicon-outside)\x20description\x20—\x20this\x20server\x20runs\x20no\x20LLM.\x20'+'The\x20server\x20validates\x20it,\x20then\x20reuses\x20it\x20on\x20the\x20same\x20deterministic\x20surfaces\x20as\x20recommend_industry:\x20'+'(a)\x20migration_import\x20narrows\x20template\x20matching\x20to\x20the\x20IR-resolved\x20industry\x20(an\x20explicit\x20product_ref\x20or\x20\x27industry\x27\x20hint\x20still\x20wins);\x20'+'(b)\x20template_generate\x20/\x20migration_apply\x20read\x20the\x20numeric\x20claim\x20\x27reward_pool_amount\x27\x20as\x20the\x20review-reward\x20pool\x20prefill\x20—\x20'+'explicit\x20fee_overrides\x20>\x20IR\x20claim\x20>\x20the\x20English\x20regex\x20fallback.\x20'+'Shape:\x20{schema_version:\x201,\x20locale:\x20\x27<BCP-47>\x27,\x20traits?,\x20domains?,\x20claims?:\x20[{key,\x20value,\x20confidence?}],\x20provenance:\x20{source:\x20\x27caller_llm\x27}}.\x20'+'Unknown\x20traits/domains/claims\x20and\x20out-of-vocabulary\x20values\x20are\x20dropped\x20and\x20reported\x20in\x20semantic_ir_issues.'),'url':z['string']()['optional']()['describe']('Competitor\x20store/profile\x20URL\x20for\x20migration_import\x20(recorded\x20as\x20provenance\x20only).'),'fee_overrides':z['record'](z['string'](),z['union']([z['number'](),z['string']()]))['optional']()['describe']('Template\x20fee-parameter\x20overrides\x20for\x20template_generate\x20(e.g.\x20commission_rate_bps).'),'guard_resolutions':z['record'](z['string'](),GuardResolutionInputSchema)['optional']()['describe']('Judgment-layer\x20resolutions\x20for\x20pending\x20guard\x20designs\x20(C6-DEEP),\x20keyed\x20by\x20plan.pending_guard_designs[].key.\x20'+'A\x20blocked\x20migration_apply/template_generate\x20lists\x20every\x20unresolved\x20design\x20—\x20resolve\x20each\x20here\x20'+'(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20or\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id)\x20and\x20re-run\x20the\x20action.\x20'+'Advisory\x20designs\x20that\x20do\x20not\x20apply\x20to\x20this\x20shop\x20may\x20be\x20resolved\x20with\x20{kind:\x27omit\x27}\x20instead\x20'+'(run75747\x20F-38:\x20honored\x20only\x20for\x20designs\x20with\x20no\x20inbound\x20binding;\x20an\x20omit\x20of\x20a\x20bound\x20design\x20'+'is\x20refused\x20with\x20GUARD_OMIT_UNSUPPORTED).\x20'+'The\x20audit\x20freeze\x20gate\x20still\x20decides:\x20resolutions\x20only\x20unblock\x20a\x20plan\x20whose\x20closed\x20audit\x20is\x20clean.'),'review_mode':z['enum'](['review','review_reward','none'])['optional']()['describe']('Per-build\x20review-rail\x20mode\x20(v53\x20templates).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20review_mode\x20applies.'),'reward_funding':z['string']()['optional']()['describe']('Review\x20reward\x20pool\x20funding,\x20smallest-unit\x20string.\x20HARD-REQUIRED\x20when\x20the\x20effective\x20review\x20mode\x20is\x20review_reward\x20(INV-4):\x20template_generate\x20refuses\x20the\x20build\x20up-front\x20with\x20error_code\x20\x27reward_funding_required\x27\x20rather\x20than\x20promising\x20an\x20unfunded\x20incentive\x20—\x20pass\x20this,\x20or\x20drop\x20the\x20mode\x20explicitly\x20(review_mode\x20\x27review\x27\x20keeps\x20the\x20rail\x20without\x20the\x20bounty;\x20\x27none\x27\x20removes\x20the\x20rail).\x20The\x20compile\x20kernel\x20also\x20blocks\x20with\x20REVIEW_REWARD_UNFUNDED\x20—\x20this\x20input\x20gate\x20just\x20fails\x20before\x20the\x20pipeline\x20runs.'),'reward_claim_amount':z['string']()['optional']()['describe']('Per-claim\x20reward\x20bounty\x20mounted\x20on\x20the\x20claim\x20guard_add,\x20smallest-unit\x20string.\x20Schema-required\x20on\x20the\x20mount\x20(BK15-F09):\x20compile\x20blocks\x20with\x20REVIEW_REWARD_AMOUNT_MISSING\x20when\x20absent\x20—\x20the\x20kernel\x20never\x20fabricates\x20a\x20real-money\x20parameter.'),'after_sales_mode':z['enum'](['return','exchange','warranty','none'])['optional']()['describe']('Per-build\x20after-sales\x20mode\x20(D12\x20refactor\x204).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20after_sales_mode\x20applies.\x20Declaring\x20a\x20mode\x20with\x20no\x20backing\x20rail\x20in\x20machine_shape\x20is\x20a\x20compile\x20blocker\x20(AFTER_SALES_RAIL_MISSING).'),'acceptance_mode':z['enum'](['milestone','contest','bounty','agent','none'])['optional']()['describe']('Per-build\x20acceptance/judging\x20mode\x20(D12\x20refactor\x202).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20acceptance_mode\x20applies.\x20A\x20judge-decided\x20mode\x20(contest/bounty/agent)\x20without\x20arbitration_mode\x20\x27third_party\x27\x20is\x20a\x20compile\x20blocker\x20(ACCEPTANCE_JUDGE_NOT_INDEPENDENT);\x20a\x20finite\x20revision_rounds_max\x20with\x20no\x20counter\x20Repository\x20guard\x20is\x20a\x20compile\x20blocker\x20(ACCEPTANCE_REVISION_UNBOUNDED).'),'installment_mode':z['enum'](['deposit_balance','milestone_n','none'])['optional']()['describe']('Per-build\x20installment/deposit\x20mode\x20(D12\x20refactor\x203).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20installment_mode\x20applies.\x20A\x20capture\x20forward\x20with\x20no\x20fund-gate\x20Guard\x20is\x20a\x20compile\x20blocker\x20(INSTALLMENT_FUNDING_UNGATED);\x20a\x20deposit-held\x20state\x20with\x20no\x20exit\x20rail\x20is\x20a\x20compile\x20blocker\x20(INSTALLMENT_DEPOSIT_STRANDED).'),'affiliate_mode':z['enum'](['commission','none'])['optional']()['describe']('Per-build\x20affiliate\x20commission\x20overlay\x20(D12\x20batch\x205).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20affiliate_mode\x20applies.\x20A\x20declared\x20commission\x20overlay\x20with\x20no\x20commission\x20rail\x20is\x20a\x20compile\x20blocker\x20(AFFILIATE_RAIL_MISSING);\x20a\x20commission\x20with\x20no\x20post-lock\x20no-clawback\x20disclosure\x20build_note\x20is\x20a\x20compile\x20blocker\x20(AFFILIATE_CLAWBACK_UNDISCLOSED).'),'crowdfunding_mode':z['enum'](['threshold','flexible','none'])['optional']()['describe']('Per-build\x20crowdfunding\x20campaign\x20overlay\x20(D12\x20batch\x207).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20crowdfunding_mode\x20applies.\x20A\x20declared\x20threshold/flexible\x20overlay\x20with\x20no\x20two-leg\x20escrow-exit\x20gate\x20(release\x20XOR\x20refund,\x20D-BUG-2)\x20is\x20a\x20compile\x20blocker\x20(CROWDFUNDING_THRESHOLD_GATE_MISSING);\x20a\x20threshold\x20gate\x20whose\x20aggregate\x20is\x20NOT\x20a\x20writer-bound\x20sum-where\x20(id_from\x20signer)\x20is\x20a\x20compile\x20blocker\x20(CROWDFUNDING_AGGREGATE_UNBOUND);\x20a\x20missing\x20L-04/L-01/L-05\x20disclosure\x20build_note\x20is\x20a\x20compile\x20blocker\x20(CROWDFUNDING_DISCLOSURE_MISSING).'),'sales':z['array'](SaleItemPlanSchema)['optional']()['describe']('The\x20sellable\x20SKU\x20catalog\x20(upwc-cat-261017\x20CAT-A1\x20/\x20PLAN-SALES-01).\x20REQUIRED\x20for\x20template_generate\x20(A-2,\x20amz9-ln-261023):\x20an\x20empty/absent\x20catalog\x20is\x20refused\x20up-front\x20with\x20error_code\x20\x27sales_required\x27\x20—\x20the\x20published\x20Service\x20would\x20freeze\x20with\x20sales:\x20[]\x20and\x20every\x20order_new\x20aborts;\x20PLAN-SALES-01\x20is\x20now\x20an\x20INPUT\x20error\x20on\x20this\x20action,\x20not\x20a\x20post-hoc\x20audit\x20finding.\x20migration_apply\x20keeps\x20the\x20audit-finding\x20posture\x20(it\x20confirms\x20an\x20already-reviewed\x20import).\x20Item\x20shape\x20follows\x20the\x20chain\x27s\x20SaleItem:\x20{\x20name,\x20price,\x20quantity?,\x20wip_hash?\x20}\x20with\x20price\x20in\x20smallest\x20units.\x20OPTIONAL\x20per\x20item:\x20a\x20structured\x20`incentive`\x20object\x20(G-07:\x20{\x20amount,\x20conditions,\x20basis,\x20claim_window\x20},\x20all\x20strings)\x20declaring\x20the\x20buyer-perceivable\x20reward\x20terms\x20—\x20carried\x20verbatim\x20into\x20the\x20compiled\x20plan\x27s\x20service_sales\x20step\x20for\x20quote-time\x20disclosure;\x20it\x20is\x20plan\x20metadata\x20only\x20and\x20never\x20an\x20on-chain\x20SaleItem\x20field.'),'log':z['record'](z['string'](),z['unknown']())['optional']()['describe']('A\x20prior\x20MigrationLog\x20(required\x20for\x20migration_review).'),'network':z['enum'](['testnet','mainnet','localnet'])['optional']()['describe']('Target\x20network\x20for\x20migration_import\x20/\x20migration_apply\x20(default\x20testnet;\x20mainnet\x20requires\x20explicit\x20user\x20confirmation;\x20\x27localnet\x27\x20is\x20a\x20provenance\x20label\x20for\x20locally\x20validated\x20plans\x20—\x20the\x20pipeline\x20never\x20executes\x20on-chain).')})['strict']();const ScanSummarySchema=z['object']({'risk_level':z['enum'](['low','medium','high','critical']),'passed':z['boolean'](),'finding_count':z['number'](),'findings_by_severity':z['record'](z['string'](),z['number']())['describe']('Finding\x20count\x20keyed\x20by\x20severity.'),'findings':z['array'](TemplateScanFindingSchema)['describe']('Every\x20finding\x20with\x20its\x20rule\x20id,\x20detail\x20and\x20suggestion.'),'red_flags':z['array'](z['string']())})['describe']('Pre-deploy\x20scan\x20summary\x20(generation/apply\x20only\x20runs\x20when\x20passed).'),SemanticIrEcho={'semantic_ir_digest':z['string']()['optional']()['describe']('sha256\x20of\x20the\x20frozen\x20Semantic\x20IR\x20artifact\x20(present\x20only\x20when\x20semantic_ir\x20was\x20supplied).'),'semantic_ir_issues':z['array'](z['string']())['optional']()['describe']('IR\x20claims\x20dropped/clamped/conflicting\x20during\x20validation\x20(unknown\x20vocabulary,\x20inverted\x20span,\x20sub-threshold\x20confidence).')};export const BenchmarkMigrationOutputSchema=z['object']({'result':z['discriminatedUnion']('action',[z['object']({'action':z['literal']('template_list'),'count':z['number']()['describe']('Number\x20of\x20templates\x20returned.'),'templates':z['array'](TemplateSummarySchema)['describe']('Template\x20listing\x20rows.'),'load_errors':z['array'](z['string']())['describe']('Template\x20files\x20that\x20failed\x20to\x20load/validate\x20(never\x20silently\x20dropped).')}),z['object']({'action':z['literal']('template_get'),'template':z['record'](z['string'](),z['unknown']())['describe']('Full\x20template\x20object\x20(machine_shape/guards/allocator/fee_params/body/...).')}),z['object']({'action':z['literal']('template_generate'),'template_id':z['string'](),...SemanticIrEcho,'scan':ScanSummarySchema,'plan':z['record'](z['string'](),z['unknown']())['describe']('Creation\x20plan\x20from\x20the\x20merchant-guide\x20pipeline\x20(never\x20executed\x20on-chain).'),'verdict':z['object']({'buildable':z['boolean'](),'blockers':z['array'](z['string']())})['describe']('Single\x20aggregate\x20ruling\x20over\x20the\x20three\x20signal\x20faces\x20(scan.passed\x20/\x20plan.graph_validation.valid\x20/\x20plan.audit.blocking)\x20—\x20the\x20authoritative\x20go/no-go\x20(bkmn-261012\x20F-M62);\x20the\x20individual\x20faces\x20stay\x20advisory.'),'next_action':z['string']()['describe']('Top-level\x20forwarding\x20of\x20the\x20materialization\x20contract\x20(C6):\x20the\x20guide\x27s\x20\x27Plan\x20ready.\x20Materialize:\x20...\x27\x20text\x20verbatim\x20when\x20the\x20audit\x20is\x20clean;\x20a\x20BLOCKED\x20reroute\x20back\x20to\x20this\x20action\x20otherwise.')}),z['object']({'action':z['literal']('template_scan'),'scan':z['object']({'template_id':z['string'](),'risk_level':z['enum'](['low','medium','high','critical']),'passed':z['boolean'](),'findings':z['array'](TemplateScanFindingSchema),'red_flags':z['array'](z['string']())})['describe']('Full\x20pre-deploy\x20scan\x20result.')}),z['object']({'action':z['literal']('migration_import'),'log':MigrationLogSchema['describe']('The\x20structured\x20migration\x20log.'),'inference_source':z['enum'](['keywords','semantic_ir','semantic_ir+keywords'])['optional']()['describe']('Which\x20layer\x20resolved\x20the\x20industry:\x20\x27keywords\x27\x20=\x20English\x20lexical\x20match\x20only;\x20\x27semantic_ir\x27\x20=\x20'+'the\x20caller\x27s\x20IR\x20decided;\x20\x27semantic_ir+keywords\x27\x20=\x20both\x20contributed.\x20Present\x20only\x20when\x20semantic_ir\x20was\x20supplied.'),...SemanticIrEcho,'next_action':z['string']()['describe']('Next\x20chain\x20step:\x20run\x20migration_review\x20with\x20this\x20log\x20(C6\x20—\x20the\x20chain\x20is\x20self-describing,\x20no\x20agent\x20re-exploration).')}),z['object']({'action':z['literal']('migration_review'),'log':MigrationLogSchema['describe']('The\x20migration\x20log\x20under\x20review.'),'review_summary':z['object']({'mapped_count':z['number'](),'unmapped_count':z['number'](),'manual_review_count':z['number'](),'risk_passed':z['boolean']()})['describe']('Counts\x20+\x20risk\x20status\x20for\x20the\x20confirmation\x20screen.'),'next_action':z['string']()['describe']('Next\x20chain\x20step:\x20migration_apply\x20with\x20the\x20matched\x20template\x20when\x20the\x20review\x20is\x20clean;\x20surface\x20the\x20unmapped/manual_review\x20items\x20for\x20a\x20user\x20decision\x20otherwise.')}),z['object']({'action':z['literal']('migration_apply'),'template_id':z['string'](),'network':z['enum'](['testnet','mainnet','localnet']),...SemanticIrEcho,'scan':ScanSummarySchema,'plan':z['record'](z['string'](),z['unknown']())['describe']('Creation\x20plan\x20from\x20the\x20merchant-guide\x20pipeline\x20(never\x20executed\x20on-chain).'),'verdict':z['object']({'buildable':z['boolean'](),'blockers':z['array'](z['string']())})['describe']('Single\x20aggregate\x20ruling\x20over\x20the\x20three\x20signal\x20faces\x20(scan.passed\x20/\x20plan.graph_validation.valid\x20/\x20plan.audit.blocking)\x20—\x20the\x20authoritative\x20go/no-go\x20(bkmn-261012\x20F-M62);\x20the\x20individual\x20faces\x20stay\x20advisory.'),'next_action':z['string']()['describe']('Top-level\x20forwarding\x20of\x20the\x20materialization\x20contract\x20(C6):\x20the\x20guide\x27s\x20\x27Plan\x20ready.\x20Materialize:\x20...\x27\x20text\x20verbatim\x20when\x20the\x20audit\x20is\x20clean;\x20a\x20BLOCKED\x20reroute\x20back\x20to\x20this\x20action\x20otherwise.')})])})['strict']();
1
+ import{z}from'zod';import{GuardResolutionInputSchema}from'../goal/planning.js';import{SemanticIRInputSchema}from'../../knowledge/semantic-ir.js';const TemplateSummarySchema=z['object']({'id':z['string']()['describe']('Template\x20id\x20\x27<industry>/<variant>\x27,\x20e.g.\x20\x27retail/scale-marketplace\x27.'),'industry':z['string']()['describe']('Industry\x20vertical.'),'variant':z['string']()['describe']('Business-model\x20variant\x20slug.'),'product_ref':z['string']()['optional']()['describe']('Benchmark\x20product\x20slug\x20this\x20archetype\x20models\x20(e.g.\x20\x27amazon\x27).\x20The\x20only\x20sanctioned\x20company\x20name;\x20users\x20can\x20pick\x20a\x20template\x20by\x20naming\x20the\x20incumbent\x20product.'),'archetype':z['enum'](['leader','challenger']),'key_risk':z['string']()['describe']('Primary\x20risk\x20this\x20template\x20mitigates.'),'node_count':z['number']()['describe']('Machine\x20node\x20count.'),'guard_count':z['number']()['describe']('Guard\x20template\x20count.'),'recommended_role':z['enum'](['merchant','supplier','both']),'tags':z['array'](z['string']())['describe']('Canonical\x20discovery\x20tags\x20this\x20template\x20answers\x20to\x20(curated\x20business-model\x20tags\x20+\x20its\x20variant\x20slug).\x20These\x20are\x20the\x20tokens\x20a\x20Semantic\x20IR\x20`discovery.tags`\x20entry\x20may\x20use.')})['describe']('Compact\x20template\x20listing\x20row.'),TemplateScanFindingSchema=z['object']({'rule_id':z['string']()['optional']()['describe']('Rule\x20id\x20when\x20known\x20(e.g.\x20\x27R-M3-01\x27,\x20\x27R1\x27).'),'severity':z['enum'](['low','medium','high','critical']),'title':z['string'](),'detail':z['string'](),'suggestion':z['string']()})['describe']('One\x20pre-deploy\x20risk\x20finding.'),StaleBuildDisclosureSchema=z['object']({'stale':z['boolean']()['describe']('4R-01\x20residual:\x20true\x20only\x20when\x20the\x20shared\x20src-vs-dist\x20mtime\x20detector\x20RESOLVED\x20and\x20found\x20the\x20running\x20dist\x20OLDER\x20than\x20the\x20workspace\x20src\x20—\x20the\x20scan/plan\x20verdicts\x20may\x20describe\x20superseded\x20template\x20knowledge.'),'known':z['boolean']()['describe']('False\x20when\x20the\x20detector\x20could\x20not\x20resolve\x20(installed\x20dist-only\x20package,\x20build\x20in\x20progress,\x20stat\x20error).\x20stale\x20is\x20then\x20NOT\x20evidence\x20of\x20freshness\x20—\x20treat\x20verdicts\x20as\x20unconfirmed.\x20Fail-open:\x20never\x20an\x20error.'),'lag_minutes':z['number']()['nullable']()['describe']('Whole\x20minutes\x20the\x20newest\x20compiled\x20artifact\x20lags\x20the\x20newest\x20source\x20file\x20(null\x20when\x20unknown).'),'detail':z['string']()['describe']('Human-readable\x20freshness\x20statement\x20(src/dist\x20mtime\x20lag)\x20with\x20the\x20rebuild\x20remediation\x20when\x20stale.')})['describe']('Always-present\x20stale-build\x20disclosure\x20on\x20template_scan\x20/\x20template_generate\x20(reuses\x20computeSrcDistStaleness;\x20no\x20parallel\x20detector).'),MigrationEntrySchema=z['object']({'source_element':z['string']()['describe']('Competitor-side\x20element.'),'target_object':z['string']()['optional']()['describe']('WoWok\x20object/mechanism\x20it\x20maps\x20to.'),'mapping_note':z['string']()['describe']('One-line\x20mapping\x20explanation.'),'reason':z['string']()['optional']()['describe']('Why\x20it\x20cannot\x20be\x20migrated,\x20or\x20why\x20it\x20needs\x20a\x20decision.')})['describe']('One\x20competitor\x20element\x20and\x20its\x20WoWok\x20mapping\x20outcome.'),MigrationLogSchema=z['object']({'source':z['object']({'url':z['string']()['optional'](),'description':z['string'](),'detected_industry':z['string'](),'matched_template':z['string']()['describe']('Matched\x20template\x20id\x20\x27<industry>/<variant>\x27.')})['describe']('Migration\x20source\x20provenance.'),'template_match':z['object']({'source':z['enum'](['explicit','product_ref','discovery_product_ref','discovery_tags','keywords','ir_industry_fallback','industry_leader'])['describe']('Which\x20deterministic\x20pass\x20chose\x20the\x20template:\x20\x27explicit\x27\x20=\x20caller\x27s\x20template_id;\x20'+'\x27product_ref\x27\x20=\x20a\x20benchmark\x20product\x20named\x20in\x20the\x20text;\x20\x27discovery_product_ref\x27\x20=\x20the\x20'+'Semantic\x20IR\x20resolved\x20the\x20benchmark\x20product;\x20\x27discovery_tags\x27\x20=\x20the\x20IR\x27s\x20canonical\x20tags\x20'+'scored\x20the\x20variant;\x20\x27keywords\x27\x20=\x20English\x20keyword\x20scoring;\x20\x27ir_industry_fallback\x27\x20=\x20the\x20'+'IR\x20proved\x20the\x20industry\x20only;\x20\x27industry_leader\x27\x20=\x20an\x20explicit\x20industry\x20hint\x20with\x20no\x20match.'),'confidence':z['number']()['describe']('Match\x20confidence\x200-1\x20(only\x20an\x20exact\x20benchmark-product\x20hit\x20is\x201.0).'),'matched_tags':z['array'](z['string']())['optional']()['describe']('IR\x20tags\x20that\x20hit\x20this\x20template\x20(discovery_tags\x20only).')})['describe']('Template-match\x20provenance\x20—\x20why\x20this\x20template,\x20without\x20re-running\x20the\x20matcher.'),'mapped':z['array'](MigrationEntrySchema)['describe']('Elements\x20that\x20map\x20cleanly\x20to\x20WoWok\x20objects.'),'unmapped':z['array'](MigrationEntrySchema)['describe']('Elements\x20that\x20cannot\x20be\x20migrated,\x20with\x20reasons.'),'manual_review':z['array'](MigrationEntrySchema)['describe']('Elements\x20requiring\x20an\x20explicit\x20user\x20decision.'),'wowok_advantages':z['array'](z['string']())['describe']('WoWok\x20platform\x20advantages\x20surfaced\x20during\x20migration.'),'customizable_modules':z['array'](z['string']())['describe']('Business-module\x20ids\x20the\x20user\x20can\x20customize.'),'role_assessment':z['object']({'recommended':z['string'](),'rationale':z['string'](),'alternatives':z['array'](z['string']())})['describe']('Merchant\x20vs\x20supplier\x20role\x20assessment.'),'risk_check':z['object']({'passed':z['boolean'](),'findings':z['array'](z['string']())})['describe']('Dry-run\x20risk\x20check\x20against\x20the\x20matched\x20template.'),'network':z['enum'](['testnet','mainnet','localnet'])['describe']('Target\x20network\x20(default\x20testnet).\x20\x27localnet\x27\x20labels\x20plans\x20validated\x20against\x20a\x20local\x20net\x20—\x20the\x20migration\x20pipeline\x20is\x20network-agnostic,\x20this\x20is\x20provenance\x20metadata,\x20not\x20an\x20execution\x20target.')})['describe']('Structured\x20competitor-migration\x20log.'),SaleItemIncentiveSchema=z['object']({'amount':z['string']()['describe']('Incentive\x20amount\x20as\x20a\x20buyer-readable\x20string\x20(e.g.\x20\x225\x20USDC\x22\x20or\x20\x221000000000\x20WOW\x20smallest\x20units\x22).\x20Quote-time\x20disclosure\x20only\x20—\x20fund\x20the\x20actual\x20rail\x20separately\x20(e.g.\x20the\x20template\x27s\x20review_reward_pool).'),'conditions':z['string']()['describe']('What\x20the\x20buyer\x20must\x20do\x20to\x20earn\x20it\x20(e.g.\x20\x22leave\x20a\x20written\x20+\x20rated\x20review\x20of\x20the\x20delivered\x20work\x22).\x20Must\x20be\x20perceptible\x20BEFORE\x20the\x20order\x20is\x20placed.'),'basis':z['string']()['describe']('Accrual\x20scope:\x20\x22per-order\x22\x20/\x20\x22once-per-buyer\x22\x20/\x20\x22once-per-buyer-per-order\x22.\x20Matches\x20the\x20claim\x20guard\x27s\x20replay\x20semantics\x20—\x20a\x20recipient-only\x20gate\x20is\x20once-per-buyer-for-life,\x20an\x20order-scoped\x20stamp\x20is\x20per-order\x20(SV-2).'),'claim_window':z['string']()['describe']('How\x20long\x20the\x20buyer\x20has\x20to\x20claim\x20(e.g.\x20\x2214\x20days\x20from\x20the\x20review\x22).\x20Mirror\x20the\x20reward\x20claim\x20guard\x27s\x20window\x20fee_param\x20so\x20the\x20quote\x20never\x20promises\x20more\x20than\x20the\x20rail\x20pays.')})['strict']()['describe']('Optional\x20structured\x20incentive\x20for\x20one\x20sale\x20item\x20(G-07):\x20buyer-perceivable\x20reward\x20terms\x20carried\x20to\x20the\x20compiled\x20plan\x20for\x20quote-time\x20disclosure.\x20DECLARATION\x20ONLY\x20—\x20the\x20chain\x20SaleItem\x20has\x20no\x20such\x20field;\x20the\x20actual\x20payout\x20rail\x20is\x20configured\x20separately.'),SaleItemPlanSchema=z['object']({'incentive':SaleItemIncentiveSchema['optional']()})['passthrough']()['describe']('One\x20sellable\x20SKU\x20in\x20the\x20plan\x20catalog:\x20the\x20chain\x20SaleItem\x20fields\x20plus\x20the\x20optional\x20structured\x20`incentive`\x20declaration\x20(G-07).\x20Unknown\x20keys\x20pass\x20through\x20so\x20chain-side\x20fields\x20can\x20evolve\x20without\x20schema\x20changes.');export const BenchmarkMigrationSchema=z['object']({'action':z['enum'](['template_list','template_get','template_generate','template_scan','migration_import','migration_review','migration_apply','plan_execute'])['describe']('Action:\x20\x27template_list\x27\x20=\x20list\x20the\x20loaded\x20MD\x20industry\x20templates\x20(optional\x20industry\x20filter);\x20'+'\x27template_get\x27\x20=\x20fetch\x20one\x20template\x20by\x20id\x20(template_id\x20required);\x20'+'\x27template_generate\x27\x20=\x20generate\x20a\x20creation\x20plan\x20from\x20a\x20template\x20via\x20the\x20merchant-guide\x20'+'pipeline\x20(template_id\x20required;\x20scan-first\x20—\x20CRITICAL\x20findings\x20block;\x20never\x20executes\x20on-chain);\x20'+'\x27template_scan\x27\x20=\x20pre-deploy\x20risk\x20scan\x20of\x20one\x20template\x20(template_id\x20required;\x20returns\x20'+'risk_level/findings/red_flags\x20plus\x20a\x20drift\x20face\x20—\x20disk-vs-catalog\x20provenance\x20of\x20the\x20'+'scanned\x20body;\x20CRITICAL\x20blocks\x20generation/apply);\x20'+'\x27migration_import\x27\x20=\x20competitor\x20URL/description\x20→\x20migration\x20plan\x20+\x20MigrationLog\x20'+'(description\x20required);\x20'+'\x27migration_review\x27\x20=\x20surface\x20the\x20MigrationLog\x20for\x20user\x20confirmation\x20(log\x20required);\x20'+'\x27migration_apply\x27\x20=\x20run\x20the\x20approved\x20template\x20through\x20the\x20merchant-guide\x20pipeline\x20'+'(template_id\x20required;\x20scan-first\x20—\x20CRITICAL\x20findings\x20block;\x20default\x20network\x20testnet);\x20'+'\x27plan_execute\x27\x20=\x20ONE-CLICK\x20DEPLOYMENT\x20(AR-5,\x20bsn7\x20T-06/R-01):\x20materialize\x20the\x20plan\x20returned\x20by\x20'+'template_generate\x20on-chain\x20—\x20preflight\x20freeze\x20gate,\x20topological\x20create/publish/configure,\x20readback.\x20'+'Resumable:\x20on\x20a\x20mid-run\x20failure,\x20re-send\x20with\x20completed_steps\x20+\x20previous_outputs\x20from\x20the\x20failed\x20'+'response\x20instead\x20of\x20re-running\x20from\x20scratch\x20(duplicate\x20objects).'),'template_id':z['string']()['optional']()['describe']('Template\x20id\x20\x27<industry>/<variant>\x27\x20(required\x20for\x20template_get\x20/\x20template_generate\x20/\x20template_scan\x20/\x20migration_apply),\x20e.g.\x20\x27retail/scale-marketplace\x27.'),'industry':z['string']()['optional']()['describe']('Industry\x20filter\x20for\x20template_list;\x20industry\x20hint\x20for\x20migration_import.\x20'+'Any\x20registered\x20industry\x20is\x20accepted\x20(builtin:\x20freelance,\x20rental,\x20education,\x20'+'travel,\x20subscription,\x20retail;\x20plus\x20custom\x20industries\x20registered\x20via\x20industry\x20packs).\x20'+'Aliases\x20are\x20resolved\x20(e.g.\x20\x27ecommerce\x27\x20→\x20\x27retail\x27).'),'description':z['string']()['optional']()['describe']('Natural-language\x20business/competitor\x20description\x20(required\x20for\x20migration_import;\x20used\x20by\x20template_generate\x20as\x20the\x20intent\x20text).'),'semantic_ir':SemanticIRInputSchema['optional']()['describe']('Canonical\x20Semantic\x20IR\x20produced\x20by\x20the\x20CALLING\x20agent\x20for\x20a\x20NON-ENGLISH\x20(or\x20lexicon-outside)\x20description\x20—\x20this\x20server\x20runs\x20no\x20LLM.\x20'+'The\x20server\x20validates\x20it,\x20then\x20reuses\x20it\x20on\x20the\x20same\x20deterministic\x20surfaces\x20as\x20recommend_industry:\x20'+'(a)\x20migration_import\x20narrows\x20template\x20matching\x20to\x20the\x20IR-resolved\x20industry\x20and,\x20when\x20discovery.tags\x20are\x20supplied,\x20'+'selects\x20the\x20business-model\x20VARIANT\x20by\x20canonical\x20tag\x20coverage\x20(an\x20explicit\x20product_ref\x20or\x20\x27industry\x27\x20hint\x20still\x20wins);\x20'+'(b)\x20template_generate\x20/\x20migration_apply\x20read\x20the\x20numeric\x20claim\x20\x27reward_pool_amount\x27\x20as\x20the\x20review-reward\x20pool\x20prefill\x20—\x20'+'explicit\x20fee_overrides\x20>\x20IR\x20claim\x20>\x20the\x20English\x20regex\x20fallback.\x20'+'Shape:\x20{schema_version:\x202\x20(1\x20still\x20accepted),\x20locale:\x20\x27<BCP-47>\x27,\x20traits?,\x20domains?,\x20claims?:\x20[{key,\x20value,\x20confidence?}],\x20'+'discovery?:\x20{industry?,\x20tags?:\x20string[],\x20product_ref?,\x20english_summary?,\x20confidence?},\x20provenance:\x20{source:\x20\x27caller_llm\x27}}.\x20'+'discovery.tags\x20use\x20the\x20CLOSED\x20language-neutral\x20vocabulary\x20returned\x20by\x20template_list.discovery_vocabulary\x20'+'(canonical\x20English\x20business-model\x20tokens;\x20never\x20locale\x20words\x20—\x20translate\x20in\x20the\x20caller).\x20'+'discovery.product_ref\x20is\x20a\x20benchmark-product\x20slug,\x20discovery.industry\x20a\x20registered\x20industry,\x20and\x20discovery.english_summary\x20'+'is\x20a\x20canonical\x20English\x20restatement\x20used\x20only\x20for\x20keyword\x20fallback.\x20'+'Unknown\x20traits/domains/claims/tags/industries/product_refs\x20are\x20dropped\x20and\x20reported\x20in\x20semantic_ir_issues;\x20spans\x20and\x20quotes\x20'+'must\x20be\x20copied\x20verbatim\x20from\x20the\x20description\x20(unlocatable\x20evidence\x20is\x20dropped).'),'url':z['string']()['optional']()['describe']('Competitor\x20store/profile\x20URL\x20for\x20migration_import\x20(recorded\x20as\x20provenance\x20only).'),'fee_overrides':z['record'](z['string'](),z['union']([z['number'](),z['string']()]))['optional']()['describe']('Template\x20fee-parameter\x20overrides\x20for\x20template_generate\x20(e.g.\x20commission_rate_bps).'),'guard_resolutions':z['record'](z['string'](),GuardResolutionInputSchema)['optional']()['describe']('Judgment-layer\x20resolutions\x20for\x20pending\x20guard\x20designs\x20(C6-DEEP),\x20keyed\x20by\x20plan.pending_guard_designs[].key.\x20'+'A\x20blocked\x20migration_apply/template_generate\x20lists\x20every\x20unresolved\x20design\x20—\x20resolve\x20each\x20here\x20'+'(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20or\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id)\x20and\x20re-run\x20the\x20action.\x20'+'Advisory\x20designs\x20that\x20do\x20not\x20apply\x20to\x20this\x20shop\x20may\x20be\x20resolved\x20with\x20{kind:\x27omit\x27}\x20instead\x20'+'(run75747\x20F-38:\x20honored\x20only\x20for\x20designs\x20with\x20no\x20inbound\x20binding;\x20an\x20omit\x20of\x20a\x20bound\x20design\x20'+'is\x20refused\x20with\x20GUARD_OMIT_UNSUPPORTED).\x20'+'The\x20audit\x20freeze\x20gate\x20still\x20decides:\x20resolutions\x20only\x20unblock\x20a\x20plan\x20whose\x20closed\x20audit\x20is\x20clean.'),'review_mode':z['enum'](['review','review_reward','none'])['optional']()['describe']('Per-build\x20review-rail\x20mode\x20(v53\x20templates).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20review_mode\x20applies.'),'reward_funding':z['string']()['optional']()['describe']('Review\x20reward\x20pool\x20funding,\x20smallest-unit\x20string.\x20HARD-REQUIRED\x20when\x20the\x20effective\x20review\x20mode\x20is\x20review_reward\x20(INV-4):\x20template_generate\x20refuses\x20the\x20build\x20up-front\x20with\x20error_code\x20\x27reward_funding_required\x27\x20rather\x20than\x20promising\x20an\x20unfunded\x20incentive\x20—\x20pass\x20this,\x20or\x20drop\x20the\x20mode\x20explicitly\x20(review_mode\x20\x27review\x27\x20keeps\x20the\x20rail\x20without\x20the\x20bounty;\x20\x27none\x27\x20removes\x20the\x20rail).\x20The\x20compile\x20kernel\x20also\x20blocks\x20with\x20REVIEW_REWARD_UNFUNDED\x20—\x20this\x20input\x20gate\x20just\x20fails\x20before\x20the\x20pipeline\x20runs.'),'reward_claim_amount':z['string']()['optional']()['describe']('Per-claim\x20reward\x20bounty\x20mounted\x20on\x20the\x20claim\x20guard_add,\x20smallest-unit\x20string.\x20Schema-required\x20on\x20the\x20mount\x20(BK15-F09):\x20compile\x20blocks\x20with\x20REVIEW_REWARD_AMOUNT_MISSING\x20when\x20absent\x20—\x20the\x20kernel\x20never\x20fabricates\x20a\x20real-money\x20parameter.'),'after_sales_mode':z['enum'](['return','exchange','warranty','none'])['optional']()['describe']('Per-build\x20after-sales\x20mode\x20(D12\x20refactor\x204).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20after_sales_mode\x20applies.\x20Declaring\x20a\x20mode\x20with\x20no\x20backing\x20rail\x20in\x20machine_shape\x20is\x20a\x20compile\x20blocker\x20(AFTER_SALES_RAIL_MISSING).'),'acceptance_mode':z['enum'](['milestone','contest','bounty','agent','none'])['optional']()['describe']('Per-build\x20acceptance/judging\x20mode\x20(D12\x20refactor\x202).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20acceptance_mode\x20applies.\x20A\x20judge-decided\x20mode\x20(contest/bounty/agent)\x20without\x20arbitration_mode\x20\x27third_party\x27\x20is\x20a\x20compile\x20blocker\x20(ACCEPTANCE_JUDGE_NOT_INDEPENDENT);\x20a\x20finite\x20revision_rounds_max\x20with\x20no\x20counter\x20Repository\x20guard\x20is\x20a\x20compile\x20blocker\x20(ACCEPTANCE_REVISION_UNBOUNDED).'),'installment_mode':z['enum'](['deposit_balance','milestone_n','none'])['optional']()['describe']('Per-build\x20installment/deposit\x20mode\x20(D12\x20refactor\x203).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20installment_mode\x20applies.\x20A\x20capture\x20forward\x20with\x20no\x20fund-gate\x20Guard\x20is\x20a\x20compile\x20blocker\x20(INSTALLMENT_FUNDING_UNGATED);\x20a\x20deposit-held\x20state\x20with\x20no\x20exit\x20rail\x20is\x20a\x20compile\x20blocker\x20(INSTALLMENT_DEPOSIT_STRANDED).'),'affiliate_mode':z['enum'](['commission','none'])['optional']()['describe']('Per-build\x20affiliate\x20commission\x20overlay\x20(D12\x20batch\x205).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20affiliate_mode\x20applies.\x20A\x20declared\x20commission\x20overlay\x20with\x20no\x20commission\x20rail\x20is\x20a\x20compile\x20blocker\x20(AFFILIATE_RAIL_MISSING);\x20a\x20commission\x20with\x20no\x20post-lock\x20no-clawback\x20disclosure\x20build_note\x20is\x20a\x20compile\x20blocker\x20(AFFILIATE_CLAWBACK_UNDISCLOSED).'),'crowdfunding_mode':z['enum'](['threshold','flexible','none'])['optional']()['describe']('Per-build\x20crowdfunding\x20campaign\x20overlay\x20(D12\x20batch\x207).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20crowdfunding_mode\x20applies.\x20A\x20declared\x20threshold/flexible\x20overlay\x20with\x20no\x20two-leg\x20escrow-exit\x20gate\x20(release\x20XOR\x20refund,\x20D-BUG-2)\x20is\x20a\x20compile\x20blocker\x20(CROWDFUNDING_THRESHOLD_GATE_MISSING);\x20a\x20threshold\x20gate\x20whose\x20aggregate\x20is\x20NOT\x20a\x20writer-bound\x20sum-where\x20(id_from\x20signer)\x20is\x20a\x20compile\x20blocker\x20(CROWDFUNDING_AGGREGATE_UNBOUND);\x20a\x20missing\x20L-04/L-01/L-05\x20disclosure\x20build_note\x20is\x20a\x20compile\x20blocker\x20(CROWDFUNDING_DISCLOSURE_MISSING).'),'logistics_mode':z['enum'](['none','carrier','merchant_managed','courier','pickup_point'])['optional']()['describe']('Per-build\x20fulfillment\x20topology\x20(K3\x20batch\x20C,\x20K-2).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20logistics_mode\x20applies.\x20A\x20declared\x20topology\x20the\x20machine_shape\x20cannot\x20honor\x20is\x20a\x20compile\x20blocker:\x20courier\x20with\x20no\x20named_operator\x20handover\x20rail\x20(LOGISTICS_COURIER_RAIL_MISSING)\x20or\x20a\x20pooled\x20delivery\x20fee\x20(LOGISTICS_COURIER_FEE_POOLED);\x20pickup_point\x20without\x20the\x20absolute\x20batch\x20cutoff\x20or\x20the\x20unclaimed-goods\x20exit\x20window\x20(LOGISTICS_PICKUP_CUTOFF_MISSING);\x20carrier\x20without\x20tracking\x20evidence\x20(LOGISTICS_CARRIER_EVIDENCE_MISSING);\x20any\x20physical\x20mode\x20without\x20a\x20transit-loss\x20story\x20(LOGISTICS_TRANSIT_LOSS_UNCOVERED);\x20courier/pickup_point\x20without\x20the\x20two\x20dispatch\x20disclosures\x20(LOGISTICS_DISPATCH_UNDISCLOSED).'),'sales':z['array'](SaleItemPlanSchema)['optional']()['describe']('The\x20sellable\x20SKU\x20catalog\x20(upwc-cat-261017\x20CAT-A1\x20/\x20PLAN-SALES-01).\x20REQUIRED\x20for\x20template_generate\x20(A-2,\x20amz9-ln-261023):\x20an\x20empty/absent\x20catalog\x20is\x20refused\x20up-front\x20with\x20error_code\x20\x27sales_required\x27\x20—\x20the\x20published\x20Service\x20would\x20freeze\x20with\x20sales:\x20[]\x20and\x20every\x20order_new\x20aborts;\x20PLAN-SALES-01\x20is\x20now\x20an\x20INPUT\x20error\x20on\x20this\x20action,\x20not\x20a\x20post-hoc\x20audit\x20finding.\x20migration_apply\x20keeps\x20the\x20audit-finding\x20posture\x20(it\x20confirms\x20an\x20already-reviewed\x20import).\x20Item\x20shape\x20follows\x20the\x20chain\x27s\x20SaleItem:\x20{\x20name,\x20price,\x20quantity?,\x20wip_hash?\x20}\x20with\x20price\x20in\x20smallest\x20units.\x20OPTIONAL\x20per\x20item:\x20a\x20structured\x20`incentive`\x20object\x20(G-07:\x20{\x20amount,\x20conditions,\x20basis,\x20claim_window\x20},\x20all\x20strings)\x20declaring\x20the\x20buyer-perceivable\x20reward\x20terms\x20—\x20carried\x20verbatim\x20into\x20the\x20compiled\x20plan\x27s\x20service_sales\x20step\x20for\x20quote-time\x20disclosure;\x20it\x20is\x20plan\x20metadata\x20only\x20and\x20never\x20an\x20on-chain\x20SaleItem\x20field.'),'log':z['record'](z['string'](),z['unknown']())['optional']()['describe']('A\x20prior\x20MigrationLog\x20(required\x20for\x20migration_review).'),'network':z['enum'](['testnet','mainnet','localnet'])['optional']()['describe']('Target\x20network\x20for\x20migration_import\x20/\x20migration_apply\x20(default\x20testnet;\x20mainnet\x20requires\x20explicit\x20user\x20confirmation;\x20\x27localnet\x27\x20is\x20a\x20provenance\x20label\x20for\x20locally\x20validated\x20plans\x20—\x20the\x20pipeline\x20never\x20executes\x20on-chain).'),'plan':z['record'](z['string'](),z['unknown']())['optional']()['describe']('The\x20creation\x20plan\x20to\x20execute\x20(required\x20for\x20plan_execute):\x20pass\x20the\x20object\x20returned\x20under\x20\x27plan\x27\x20by\x20template_generate\x20VERBATIM\x20—\x20mutating\x20steps\x20by\x20hand\x20is\x20what\x20the\x2032-manual-write\x20era\x20did.\x20Executing\x20requires\x20verdict.buildable=true;\x20a\x20blocked\x20plan\x20is\x20refused\x20at\x20the\x20freeze\x20gate.'),'completed_steps':z['array'](z['string']())['optional']()['describe']('plan_execute\x20resume\x20(AR-5):\x20step\x20ids\x20already\x20EXECUTED\x20in\x20a\x20prior\x20run\x20(from\x20the\x20failed\x20response\x27s\x20steps[].stepId\x20where\x20status=\x27executed\x27).\x20Those\x20steps\x20are\x20adopted,\x20not\x20re-executed.'),'previous_outputs':z['record'](z['string'](),z['string']())['optional']()['describe']('plan_execute\x20resume\x20(AR-5):\x20step\x20id\x20->\x20created\x20on-chain\x20address\x20map\x20from\x20the\x20prior\x20run\x27s\x20outputs\x20field,\x20so\x20$ref\x20bindings\x20resolve\x20against\x20the\x20objects\x20that\x20ALREADY\x20exist.'),'env':z['record'](z['string'](),z['unknown']())['optional']()['describe']('Environment\x20for\x20on-chain\x20execution\x20(plan_execute):\x20forwarded\x20to\x20the\x20executor\x20(e.g.\x20{\x20network:\x20\x27testnet\x27\x20}).')})['strict']();const ScanSummarySchema=z['object']({'risk_level':z['enum'](['low','medium','high','critical']),'passed':z['boolean'](),'finding_count':z['number'](),'findings_by_severity':z['record'](z['string'](),z['number']())['describe']('Finding\x20count\x20keyed\x20by\x20severity.'),'findings':z['array'](TemplateScanFindingSchema)['describe']('Every\x20finding\x20with\x20its\x20rule\x20id,\x20detail\x20and\x20suggestion.'),'red_flags':z['array'](z['string']())})['describe']('Pre-deploy\x20scan\x20summary\x20(generation/apply\x20only\x20runs\x20when\x20passed).'),SemanticIrEcho={'semantic_ir_digest':z['string']()['optional']()['describe']('sha256\x20of\x20the\x20frozen\x20Semantic\x20IR\x20artifact\x20(present\x20only\x20when\x20semantic_ir\x20was\x20supplied).'),'semantic_ir_issues':z['array'](z['string']())['optional']()['describe']('IR\x20claims\x20dropped/clamped/conflicting\x20during\x20validation\x20(unknown\x20vocabulary,\x20inverted\x20span,\x20sub-threshold\x20confidence).')};export const BenchmarkMigrationOutputSchema=z['object']({'result':z['discriminatedUnion']('action',[z['object']({'action':z['literal']('template_list'),'count':z['number']()['describe']('Number\x20of\x20templates\x20returned.'),'templates':z['array'](TemplateSummarySchema)['describe']('Template\x20listing\x20rows.'),'discovery_vocabulary':z['object']({'industries':z['array'](z['string']())['describe']('Registered\x20industry\x20names\x20a\x20Semantic\x20IR\x20discovery.industry\x20may\x20use.'),'tags':z['array'](z['string']())['describe']('The\x20CLOSED\x20canonical\x20discovery-tag\x20vocabulary\x20a\x20Semantic\x20IR\x20discovery.tags\x20entry\x20may\x20use.'),'product_refs':z['array'](z['string']())['describe']('Benchmark-product\x20slugs\x20a\x20Semantic\x20IR\x20discovery.product_ref\x20may\x20use.')})['describe']('The\x20closed,\x20language-neutral\x20vocabulary\x20for\x20Semantic\x20IR\x20discovery\x20evidence\x20—\x20callers\x20translate\x20into\x20these\x20tokens;\x20the\x20server\x20drops\x20anything\x20else\x20and\x20reports\x20it.'),'load_errors':z['array'](z['string']())['describe']('Template\x20files\x20that\x20failed\x20to\x20load/validate\x20(never\x20silently\x20dropped).')}),z['object']({'action':z['literal']('template_get'),'template':z['record'](z['string'](),z['unknown']())['describe']('Full\x20template\x20object\x20(machine_shape/guards/allocator/fee_params/body/...).')}),z['object']({'action':z['literal']('template_generate'),'template_id':z['string'](),...SemanticIrEcho,'scan':ScanSummarySchema,'plan':z['record'](z['string'](),z['unknown']())['describe']('Creation\x20plan\x20from\x20the\x20merchant-guide\x20pipeline\x20(never\x20executed\x20on-chain).'),'stale_build':StaleBuildDisclosureSchema,'verdict':z['object']({'buildable':z['boolean'](),'blockers':z['array'](z['string']())})['describe']('Single\x20aggregate\x20ruling\x20over\x20the\x20three\x20signal\x20faces\x20(scan.passed\x20/\x20plan.graph_validation.valid\x20/\x20plan.audit.blocking)\x20—\x20the\x20authoritative\x20go/no-go\x20(bkmn-261012\x20F-M62);\x20the\x20individual\x20faces\x20stay\x20advisory.'),'next_action':z['string']()['describe']('Top-level\x20forwarding\x20of\x20the\x20materialization\x20contract\x20(C6):\x20the\x20guide\x27s\x20\x27Plan\x20ready.\x20Materialize:\x20...\x27\x20text\x20verbatim\x20when\x20the\x20audit\x20is\x20clean;\x20a\x20BLOCKED\x20reroute\x20back\x20to\x20this\x20action\x20otherwise.')}),z['object']({'action':z['literal']('template_scan'),'scan':z['object']({'template_id':z['string'](),'risk_level':z['enum'](['low','medium','high','critical']),'passed':z['boolean'](),'findings':z['array'](TemplateScanFindingSchema),'red_flags':z['array'](z['string']())})['describe']('Full\x20pre-deploy\x20scan\x20result.'),'stale_build':StaleBuildDisclosureSchema}),z['object']({'action':z['literal']('migration_import'),'log':MigrationLogSchema['describe']('The\x20structured\x20migration\x20log.'),'inference_source':z['enum'](['keywords','semantic_ir','semantic_ir+keywords'])['optional']()['describe']('Which\x20layer\x20resolved\x20the\x20industry:\x20\x27keywords\x27\x20=\x20English\x20lexical\x20match\x20only;\x20\x27semantic_ir\x27\x20=\x20'+'the\x20caller\x27s\x20IR\x20decided;\x20\x27semantic_ir+keywords\x27\x20=\x20both\x20contributed.\x20Present\x20only\x20when\x20semantic_ir\x20was\x20supplied.'),...SemanticIrEcho,'next_action':z['string']()['describe']('Next\x20chain\x20step:\x20run\x20migration_review\x20with\x20this\x20log\x20(C6\x20—\x20the\x20chain\x20is\x20self-describing,\x20no\x20agent\x20re-exploration).')}),z['object']({'action':z['literal']('migration_review'),'log':MigrationLogSchema['describe']('The\x20migration\x20log\x20under\x20review.'),'review_summary':z['object']({'mapped_count':z['number'](),'unmapped_count':z['number'](),'manual_review_count':z['number'](),'risk_passed':z['boolean']()})['describe']('Counts\x20+\x20risk\x20status\x20for\x20the\x20confirmation\x20screen.'),'next_action':z['string']()['describe']('Next\x20chain\x20step:\x20migration_apply\x20with\x20the\x20matched\x20template\x20when\x20the\x20review\x20is\x20clean;\x20surface\x20the\x20unmapped/manual_review\x20items\x20for\x20a\x20user\x20decision\x20otherwise.')}),z['object']({'action':z['literal']('migration_apply'),'template_id':z['string'](),'network':z['enum'](['testnet','mainnet','localnet']),...SemanticIrEcho,'scan':ScanSummarySchema,'plan':z['record'](z['string'](),z['unknown']())['describe']('Creation\x20plan\x20from\x20the\x20merchant-guide\x20pipeline\x20(never\x20executed\x20on-chain).'),'verdict':z['object']({'buildable':z['boolean'](),'blockers':z['array'](z['string']())})['describe']('Single\x20aggregate\x20ruling\x20over\x20the\x20three\x20signal\x20faces\x20(scan.passed\x20/\x20plan.graph_validation.valid\x20/\x20plan.audit.blocking)\x20—\x20the\x20authoritative\x20go/no-go\x20(bkmn-261012\x20F-M62);\x20the\x20individual\x20faces\x20stay\x20advisory.'),'next_action':z['string']()['describe']('Top-level\x20forwarding\x20of\x20the\x20materialization\x20contract\x20(C6):\x20the\x20guide\x27s\x20\x27Plan\x20ready.\x20Materialize:\x20...\x27\x20text\x20verbatim\x20when\x20the\x20audit\x20is\x20clean;\x20a\x20BLOCKED\x20reroute\x20back\x20to\x20this\x20action\x20otherwise.')}),z['object']({'action':z['literal']('plan_execute'),'completed':z['boolean']()['describe']('True\x20when\x20EVERY\x20step\x20executed\x20(store\x20fully\x20deployed).'),'steps':z['array'](z['record'](z['string'](),z['unknown']()))['describe']('Per-step\x20results:\x20{\x20stepId,\x20status:\x20executed|failed|blocked,\x20digest?,\x20address?,\x20error?\x20}.'),'outputs':z['record'](z['string'](),z['string']())['describe']('step\x20id\x20->\x20created\x20on-chain\x20address\x20(create\x20steps).\x20Feed\x20back\x20as\x20previous_outputs\x20when\x20resuming.'),'preflight':z['record'](z['string'](),z['unknown']())['describe']('Freeze-gate\x20audit\x20the\x20run\x20was\x20gated\x20on\x20(issues\x20+\x20findings).'),'readback':z['record'](z['string'](),z['unknown']())['describe']('Post-execution\x20conservation/readback\x20checks.'),'next_action':z['string']()['describe']('One-click\x20forwarding:\x20deploy-complete\x20guidance,\x20or\x20the\x20resume\x20recipe\x20(completed_steps\x20+\x20previous_outputs)\x20after\x20a\x20mid-run\x20failure.')})])})['strict']();
@@ -71,6 +71,7 @@ export declare const CallAllocation_OperateSchema: z.ZodObject<{
71
71
  }, z.core.$strict>>;
72
72
  }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
73
73
  alloc_by_guard: z.ZodOptional<z.ZodString>;
74
+ alloc_batch: z.ZodOptional<z.ZodArray<z.ZodString>>;
74
75
  acknowledge_dual_payout: z.ZodOptional<z.ZodBoolean>;
75
76
  formula_spec_set: z.ZodOptional<z.ZodObject<{
76
77
  allocator_index: z.ZodNumber;
@@ -148,6 +149,7 @@ export declare const CallAllocation_DataSchema: z.ZodUnion<readonly [z.ZodObject
148
149
  }, z.core.$strict>>;
149
150
  }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
150
151
  alloc_by_guard: z.ZodOptional<z.ZodString>;
152
+ alloc_batch: z.ZodOptional<z.ZodArray<z.ZodString>>;
151
153
  acknowledge_dual_payout: z.ZodOptional<z.ZodBoolean>;
152
154
  formula_spec_set: z.ZodOptional<z.ZodObject<{
153
155
  allocator_index: z.ZodNumber;
@@ -226,6 +228,7 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
226
228
  }, z.core.$strict>>;
227
229
  }, z.core.$strict>, z.ZodLiteral<"recently">]>>;
228
230
  alloc_by_guard: z.ZodOptional<z.ZodString>;
231
+ alloc_batch: z.ZodOptional<z.ZodArray<z.ZodString>>;
229
232
  acknowledge_dual_payout: z.ZodOptional<z.ZodBoolean>;
230
233
  formula_spec_set: z.ZodOptional<z.ZodObject<{
231
234
  allocator_index: z.ZodNumber;
@@ -1 +1 @@
1
- import{z}from'zod';import{CoinParamSchema,CallEnvSchema,SubmissionCallSchema,TypeNamedObjectSchema}from'./base.js';import{AllocatorsSchema,PaymentInfoSchema,RepositoryDataWhereSchema}from'../query/index.js';import{NameOrAddressSchema,ReceivedBalanceOrRecentlySchema,RECEIVE_FORMAT_BLOCK_BALANCE}from'../common/index.js';export const CallAllocation_CreateSchema=z['object']({'object':TypeNamedObjectSchema['describe']('REQUIRED\x20for\x20creating\x20new\x20object.\x20Provide\x20{name:\x20\x27yourName\x27,\x20type:\x20\x27Allocation\x27}\x20to\x20create\x20and\x20name\x20the\x20new\x20Allocation\x20object.'),'allocators':AllocatorsSchema,'coin':CoinParamSchema,'payment_info':PaymentInfoSchema,'allow_unanchored':z['boolean']()['optional']()['describe']('docs#11\x20escape\x20hatch:\x20explicitly\x20allow\x20creating\x20an\x20Allocation\x20whose\x20payment_info\x20has\x20NO\x20for_object\x20anchor\x20while\x20any\x20sharing\x20row\x20uses\x20a\x20GuardIdentifier\x20recipient.\x20'+'Unanchored\x20+\x20GuardIdentifier\x20lets\x20any\x20guard-passing\x20caller\x20redirect\x20the\x20submitted\x20payout\x20address\x20to\x20an\x20arbitrary\x20address\x20—\x20'+'anchor\x20it\x20with\x20payment_info.for_object\x20instead.\x20Set\x20true\x20ONLY\x20after\x20the\x20user\x20explicitly\x20accepts\x20that\x20risk.\x20Default:\x20blocked.')})['strict']()['describe']('Create\x20a\x20new\x20Allocation\x20object.\x20Set\x20\x27object\x27\x20field\x20with\x20{name:\x20\x27yourName\x27,\x20type:\x20\x27Allocation\x27}\x20to\x20name\x20the\x20new\x20object.\x20Notice:\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.');export const FormulaSpecSchema=z['object']({'repo':NameOrAddressSchema['describe']('Repository\x20object\x20(ID\x20or\x20LocalMark\x20name)\x20whose\x20policy-key\x20data\x20table\x20is\x20scanned\x20at\x20alloc()\x20time\x20to\x20produce\x20the\x20scalar.\x20'+'Resolved\x20to\x20an\x20address\x20before\x20the\x20call.'),'key':z['string']()['describe']('Policy\x20key\x20(String)\x20inside\x20that\x20Repository\x20whose\x20data\x20rows\x20are\x20the\x20candidate\x20set.\x20Max\x2064\x20bytes.'),'selector':z['union']([z['literal'](0x0),z['literal'](0x1)])['describe']('Which\x20aggregate\x20produces\x20the\x20scalar:\x200\x20=\x20RECORD\x20COUNT\x20(u64\x20—\x20how\x20many\x20candidate\x20rows\x20match\x20the\x20predicate),\x20'+'1\x20=\x20VALUE\x20SUM\x20(u256\x20—\x20sum\x20of\x20the\x20matching\x20rows\x27\x20numeric\x20payloads,\x20overflow-safe).\x20Any\x20other\x20value\x20is\x20refused\x20on-chain\x20(EFORMULA_SPEC_INVALID=24).'),'predicate':RepositoryDataWhereSchema['describe']('Predicate\x20filter\x20applied\x20to\x20each\x20candidate\x27s\x20stored\x20value\x20—\x20SAME\x20wire\x20format\x20as\x20the\x20repository\x20count/sum-where\x20guard\x20queries\x20(1173/1174).\x20'+'kind\x20must\x20match\x20the\x20policy\x20value\x20type;\x20mismatching\x20entries\x20are\x20skipped\x20honestly\x20(never\x20an\x20error).'),'ids':z['array'](z['string']())['describe']('EXPLICIT\x20candidate\x20object\x20IDs\x20(vector<address>)\x20to\x20scan.\x20Duplicates\x20are\x20deduped;\x20max\x20100\x20candidates;\x20'+'an\x20EMPTY\x20list\x20matches\x20no\x20records\x20(scalar\x200)\x20—\x20there\x20is\x20no\x20\x27all\x20objects\x27\x20wildcard.')})['strict']()['describe']('Runtime\x20pricing\x20spec\x20for\x20one\x20Formula\x20sharing\x20slot\x20(FormulaSpec).\x20Payout\x20for\x20that\x20leg\x20=\x20clamp(sharing_coefficient_bps\x20×\x20scalar\x20/\x2010000,\x200,\x20headroom),\x20'+'where\x20scalar\x20=\x20the\x20selected\x20aggregate\x20over\x20the\x20Repository\x20rows.\x20Binding\x20REPLACES\x20any\x20previous\x20spec\x20for\x20the\x20slot;\x20the\x20plan\x20shape\x20itself\x20'+'(which\x20slots\x20are\x20Formula,\x20coefficients)\x20is\x20immutable\x20and\x20was\x20fixed\x20when\x20the\x20allocator\x20was\x20declared.');export const CallAllocation_OperateSchema=z['object']({'object':NameOrAddressSchema['describe']('REQUIRED\x20for\x20operating\x20existing\x20object.\x20Provide\x20the\x20Allocation\x20object\x20ID\x20or\x20existing\x20name\x20to\x20reference\x20the\x20target\x20object.'),'received_coins':ReceivedBalanceOrRecentlySchema['optional']()['describe']('Unwrap\x20the\x20CoinWrapper\x20objects\x20received\x20by\x20the\x20Allocation\x20object\x20and\x20deposit\x20them\x20into\x20the\x20pending\x20allocation\x20balance.'+RECEIVE_FORMAT_BLOCK_BALANCE),'alloc_by_guard':NameOrAddressSchema['optional']()['describe']('Verify\x20the\x20specified\x20Guard\x20and\x20execute\x20the\x20corresponding\x20fund\x20distribution.\x20'+'GENERIC\x20SEMANTICS:\x20an\x20Allocation\x20distributes\x20whatever\x20balance\x20it\x20holds\x20—\x20order\x20funds,\x20payroll,\x20dividends,\x20bounties.\x20'+'It\x20defines\x20no\x20scenario-specific\x20rule:\x20eligibility\x20(including\x20issuer\x20identity\x20for\x20standalone\x20use,\x20e.g.\x20an\x20org\x20admin)\x20'+'and\x20differentiation\x20inputs\x20are\x20expressed\x20as\x20Guard\x20constraints,\x20all\x20public\x20and\x20auditable.\x20'+'RECIPIENT\x20RESOLUTION\x20(Recipient\x20enum):\x20'+'Entity\x20→\x20fixed\x20address;\x20Signer\x20→\x20transaction\x20sender;\x20GuardIdentifier\x20n\x20→\x20the\x20address\x20submitted\x20for\x20identifier\x20n\x20(resolved\x20from\x20the\x20passport\x27s\x20submission\x20record).\x20'+'ORDER\x20PATTERN\x20(canonical):\x20the\x20Guard\x20table\x20needs\x20ONE\x20submitted\x20Order,\x20constrained\x20by\x20the\x20Guard\x20(e.g.\x20order.service\x20==\x20host\x20service,\x20'+'progress\x20at\x20a\x20qualifying\x20node,\x20signer\x20==\x20order.owner);\x20that\x20order\x20submission\x20IS\x20the\x20recipient\x20slot.\x20Whoever\x20triggers\x20the\x20distribution,\x20funds\x20necessarily\x20'+'land\x20at\x20an\x20Order\x20OBJECT;\x20delivered\x20CoinWrappers\x20are\x20owned\x20by\x20the\x20order\x20and\x20can\x20be\x20extracted\x20only\x20by\x20the\x20Order\x20object\x20itself\x20'+'(Wow\x20ownership)\x20—\x20the\x20coins\x20then\x20go\x20to\x20the\x20order\x27s\x20current\x20owner.\x20Object\x20receipt\x20=\x20owner\x20receipt.\x20'+'POST-DISTRIBUTION\x20CLAIM\x20(required\x20step):\x20each\x20recipient\x20gets\x20a\x20CoinWrapper\x20(not\x20spendable\x20coins)\x20—\x20EOA\x20wallet\x20→\x20operation_type=\x27payment\x27\x20RECEIVE\x20mode\x20'+'{object:\x27<coinwrapper_id>\x27,\x20receive:true};\x20Order\x20object\x20→\x20operation_type=\x27order\x27\x20{object:\x27<order_id>\x27,\x20receive:\x27recently\x27};\x20Treasury\x20object\x20→\x20treasury\x20receive.\x20'+'Find\x20pending\x20CoinWrappers\x20via\x20query_toolkit\x20query_type=\x27onchain_received\x27;\x20verify\x20via\x20the\x20immutable\x20Payment\x20object\x20(allocation.payment\x20array).\x20'+'RISK:\x20safety\x20follows\x20from\x20the\x20sufficiency\x20of\x20the\x20Guard\x20constraints,\x20not\x20the\x20recipient\x20form\x20—\x20analyze\x20the\x20recipient\x20constraint\x20audit\x20before\x20publish;\x20'+'structural\x20residuals\x20(unavoidable):\x20permissionless\x20alloc\x20allows\x20forced\x20settlement\x20timing,\x20the\x20submitted\x20order\x20is\x20not\x20bound\x20to\x20the\x20settled\x20allocation,\x20'+'and\x20allocators/guards\x20are\x20immutable\x20after\x20publish.'),'acknowledge_dual_payout':z['boolean']()['optional']()['describe']('A-1\x20(amz9-ln-261023)\x20explicit\x20opt-in\x20for\x20a\x20KNOWN\x20double\x20payout:\x20when\x20a\x20submitted\x20order\x20already\x20received\x20'+'arbitration\x20compensation\x20(order.claimed_by\x20set)\x20and\x20this\x20call\x20would\x20ALSO\x20release\x20its\x20escrow\x20(refund\x20track),\x20'+'the\x20call\x20is\x20REFUSED\x20unless\x20this\x20flag\x20is\x20true.\x20The\x20two\x20payout\x20tracks\x20are\x20independent\x20by\x20design\x20—\x20the\x20chain\x20'+'will\x20not\x20net\x20or\x20stop\x20the\x20second\x20payout\x20(the\x20escrow\x20receive\x20path\x20has\x20no\x20claimed_by\x20gate),\x20BUT\x20a\x20rail\x20paired\x20'+'on\x20order.claimed_by\x20(refund\x20none\x20/\x20recover\x20some)\x20may\x20guard-reject\x20the\x20second\x20payout\x20on-chain;\x20that\x20rejection\x20'+'is\x20the\x20designed\x20mutual\x20exclusion,\x20and\x20the\x20escrow\x20exits\x20via\x20the\x20paired\x20rail.\x20Buyer\x20NET\x20view:\x20total\x20received\x20=\x20'+'compensation\x20+\x20escrow\x20refund.\x20Leave\x20unset\x20for\x20normal\x20refunds\x20of\x20un-awarded\x20orders.'),'formula_spec_set':z['object']({'allocator_index':z['number']()['int']()['min'](0x0)['describe']('Index\x20of\x20the\x20allocator\x20within\x20allocators.allocators\x20(0-based).\x20Must\x20address\x20an\x20EXISTING\x20allocator,\x20else\x20refused\x20on-chain\x20(EFORMULA_SPEC_INVALID=24).'),'slot_index':z['number']()['int']()['min'](0x0)['describe']('Index\x20of\x20the\x20sharing\x20row\x20within\x20that\x20allocator\x27s\x20sharing[]\x20(0-based).\x20Must\x20address\x20a\x20slot\x20whose\x20mode\x20is\x20Formula,\x20else\x20refused\x20on-chain\x20(EFORMULA_SPEC_INVALID=24).'),'spec':FormulaSpecSchema})['strict']()['optional']()['describe']('Bind\x20(or\x20replace)\x20the\x20runtime\x20pricing\x20spec\x20of\x20ONE\x20Formula\x20sharing\x20slot\x20of\x20this\x20Allocation\x20—\x20no\x20re-declaration\x20of\x20the\x20allocator\x20plan,\x20'+'no\x20fund\x20movement.\x20Only\x20the\x20DATA\x20SOURCE\x20(which\x20repository\x20aggregate\x20prices\x20the\x20slot)\x20is\x20set\x20here;\x20the\x20slot\x20itself\x20must\x20already\x20be\x20declared\x20as\x20a\x20'+'Formula\x20leg\x20(mode\x204).\x20An\x20unbound\x20Formula\x20slot\x20prices\x20its\x20scalar\x20as\x200.')})['strict']()['describe']('Operate\x20on\x20an\x20existing\x20Allocation\x20object.\x20Set\x20\x27object\x27\x20field\x20with\x20the\x20object\x20ID\x20or\x20existing\x20name\x20to\x20specify\x20the\x20target.');export const CallAllocation_DataSchema=z['union']([CallAllocation_CreateSchema,CallAllocation_OperateSchema])['describe']('On-chain\x20Allocation\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Use\x20CallAllocation_CreateSchema\x20by\x20setting\x20\x27object\x27\x20with\x20OBJECT\x20format\x20{name,\x20type_parameter,\x20...}.\x20(2)\x20OPERATE\x20EXISTING:\x20Use\x20CallAllocation_OperateSchema\x20by\x20setting\x20\x27object\x27\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20');export const CallAllocation_InputSchema=z['object']({'data':CallAllocation_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
1
+ import{z}from'zod';import{CoinParamSchema,CallEnvSchema,SubmissionCallSchema,TypeNamedObjectSchema}from'./base.js';import{AllocatorsSchema,PaymentInfoSchema,RepositoryDataWhereSchema}from'../query/index.js';import{NameOrAddressSchema,ReceivedBalanceOrRecentlySchema,RECEIVE_FORMAT_BLOCK_BALANCE}from'../common/index.js';export const CallAllocation_CreateSchema=z['object']({'object':TypeNamedObjectSchema['describe']('REQUIRED\x20for\x20creating\x20new\x20object.\x20Provide\x20{name:\x20\x27yourName\x27,\x20type:\x20\x27Allocation\x27}\x20to\x20create\x20and\x20name\x20the\x20new\x20Allocation\x20object.'),'allocators':AllocatorsSchema,'coin':CoinParamSchema,'payment_info':PaymentInfoSchema,'allow_unanchored':z['boolean']()['optional']()['describe']('docs#11\x20escape\x20hatch:\x20explicitly\x20allow\x20creating\x20an\x20Allocation\x20whose\x20payment_info\x20has\x20NO\x20for_object\x20anchor\x20while\x20any\x20sharing\x20row\x20uses\x20a\x20GuardIdentifier\x20recipient.\x20'+'Unanchored\x20+\x20GuardIdentifier\x20lets\x20any\x20guard-passing\x20caller\x20redirect\x20the\x20submitted\x20payout\x20address\x20to\x20an\x20arbitrary\x20address\x20—\x20'+'anchor\x20it\x20with\x20payment_info.for_object\x20instead.\x20Set\x20true\x20ONLY\x20after\x20the\x20user\x20explicitly\x20accepts\x20that\x20risk.\x20Default:\x20blocked.')})['strict']()['describe']('Create\x20a\x20new\x20Allocation\x20object.\x20Set\x20\x27object\x27\x20field\x20with\x20{name:\x20\x27yourName\x27,\x20type:\x20\x27Allocation\x27}\x20to\x20name\x20the\x20new\x20object.\x20Notice:\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.');export const FormulaSpecSchema=z['object']({'repo':NameOrAddressSchema['describe']('Repository\x20object\x20(ID\x20or\x20LocalMark\x20name)\x20whose\x20policy-key\x20data\x20table\x20is\x20scanned\x20at\x20alloc()\x20time\x20to\x20produce\x20the\x20scalar.\x20'+'Resolved\x20to\x20an\x20address\x20before\x20the\x20call.'),'key':z['string']()['describe']('Policy\x20key\x20(String)\x20inside\x20that\x20Repository\x20whose\x20data\x20rows\x20are\x20the\x20candidate\x20set.\x20Max\x2064\x20bytes.'),'selector':z['union']([z['literal'](0x0),z['literal'](0x1)])['describe']('Which\x20aggregate\x20produces\x20the\x20scalar:\x200\x20=\x20RECORD\x20COUNT\x20(u64\x20—\x20how\x20many\x20candidate\x20rows\x20match\x20the\x20predicate),\x20'+'1\x20=\x20VALUE\x20SUM\x20(u256\x20—\x20sum\x20of\x20the\x20matching\x20rows\x27\x20numeric\x20payloads,\x20overflow-safe).\x20Any\x20other\x20value\x20is\x20refused\x20on-chain\x20(EFORMULA_SPEC_INVALID=24).'),'predicate':RepositoryDataWhereSchema['describe']('Predicate\x20filter\x20applied\x20to\x20each\x20candidate\x27s\x20stored\x20value\x20—\x20SAME\x20wire\x20format\x20as\x20the\x20repository\x20count/sum-where\x20guard\x20queries\x20(1173/1174).\x20'+'kind\x20must\x20match\x20the\x20policy\x20value\x20type;\x20mismatching\x20entries\x20are\x20skipped\x20honestly\x20(never\x20an\x20error).'),'ids':z['array'](z['string']())['describe']('EXPLICIT\x20candidate\x20object\x20IDs\x20(vector<address>)\x20to\x20scan.\x20Duplicates\x20are\x20deduped;\x20max\x20100\x20candidates;\x20'+'an\x20EMPTY\x20list\x20matches\x20no\x20records\x20(scalar\x200)\x20—\x20there\x20is\x20no\x20\x27all\x20objects\x27\x20wildcard.')})['strict']()['describe']('Runtime\x20pricing\x20spec\x20for\x20one\x20Formula\x20sharing\x20slot\x20(FormulaSpec).\x20Payout\x20for\x20that\x20leg\x20=\x20clamp(sharing_coefficient_bps\x20×\x20scalar\x20/\x2010000,\x200,\x20headroom),\x20'+'where\x20scalar\x20=\x20the\x20selected\x20aggregate\x20over\x20the\x20Repository\x20rows.\x20Binding\x20REPLACES\x20any\x20previous\x20spec\x20for\x20the\x20slot;\x20the\x20plan\x20shape\x20itself\x20'+'(which\x20slots\x20are\x20Formula,\x20coefficients)\x20is\x20immutable\x20and\x20was\x20fixed\x20when\x20the\x20allocator\x20was\x20declared.');export const CallAllocation_OperateSchema=z['object']({'object':NameOrAddressSchema['describe']('REQUIRED\x20for\x20operating\x20existing\x20object.\x20Provide\x20the\x20Allocation\x20object\x20ID\x20or\x20existing\x20name\x20to\x20reference\x20the\x20target\x20object.'),'received_coins':ReceivedBalanceOrRecentlySchema['optional']()['describe']('Unwrap\x20the\x20CoinWrapper\x20objects\x20received\x20by\x20the\x20Allocation\x20object\x20and\x20deposit\x20them\x20into\x20the\x20pending\x20allocation\x20balance.'+RECEIVE_FORMAT_BLOCK_BALANCE),'alloc_by_guard':NameOrAddressSchema['optional']()['describe']('Verify\x20the\x20specified\x20Guard\x20and\x20execute\x20the\x20corresponding\x20fund\x20distribution.\x20'+'GENERIC\x20SEMANTICS:\x20an\x20Allocation\x20distributes\x20whatever\x20balance\x20it\x20holds\x20—\x20order\x20funds,\x20payroll,\x20dividends,\x20bounties.\x20'+'It\x20defines\x20no\x20scenario-specific\x20rule:\x20eligibility\x20(including\x20issuer\x20identity\x20for\x20standalone\x20use,\x20e.g.\x20an\x20org\x20admin)\x20'+'and\x20differentiation\x20inputs\x20are\x20expressed\x20as\x20Guard\x20constraints,\x20all\x20public\x20and\x20auditable.\x20'+'RECIPIENT\x20RESOLUTION\x20(Recipient\x20enum):\x20'+'Entity\x20→\x20fixed\x20address;\x20Signer\x20→\x20transaction\x20sender;\x20GuardIdentifier\x20n\x20→\x20the\x20address\x20submitted\x20for\x20identifier\x20n\x20(resolved\x20from\x20the\x20passport\x27s\x20submission\x20record).\x20'+'ORDER\x20PATTERN\x20(canonical):\x20the\x20Guard\x20table\x20needs\x20ONE\x20submitted\x20Order,\x20constrained\x20by\x20the\x20Guard\x20(e.g.\x20order.service\x20==\x20host\x20service,\x20'+'progress\x20at\x20a\x20qualifying\x20node,\x20signer\x20==\x20order.owner);\x20that\x20order\x20submission\x20IS\x20the\x20recipient\x20slot.\x20Whoever\x20triggers\x20the\x20distribution,\x20funds\x20necessarily\x20'+'land\x20at\x20an\x20Order\x20OBJECT;\x20delivered\x20CoinWrappers\x20are\x20owned\x20by\x20the\x20order\x20and\x20can\x20be\x20extracted\x20only\x20by\x20the\x20Order\x20object\x20itself\x20'+'(Wow\x20ownership)\x20—\x20the\x20coins\x20then\x20go\x20to\x20the\x20order\x27s\x20current\x20owner.\x20Object\x20receipt\x20=\x20owner\x20receipt.\x20'+'POST-DISTRIBUTION\x20CLAIM\x20(required\x20step):\x20each\x20recipient\x20gets\x20a\x20CoinWrapper\x20(not\x20spendable\x20coins)\x20—\x20EOA\x20wallet\x20→\x20operation_type=\x27payment\x27\x20RECEIVE\x20mode\x20'+'{object:\x27<coinwrapper_id>\x27,\x20receive:true};\x20Order\x20object\x20→\x20operation_type=\x27order\x27\x20{object:\x27<order_id>\x27,\x20receive:\x27recently\x27};\x20Treasury\x20object\x20→\x20treasury\x20receive.\x20'+'Find\x20pending\x20CoinWrappers\x20via\x20query_toolkit\x20query_type=\x27onchain_received\x27;\x20verify\x20via\x20the\x20immutable\x20Payment\x20object\x20(allocation.payment\x20array).\x20'+'RISK:\x20safety\x20follows\x20from\x20the\x20sufficiency\x20of\x20the\x20Guard\x20constraints,\x20not\x20the\x20recipient\x20form\x20—\x20analyze\x20the\x20recipient\x20constraint\x20audit\x20before\x20publish;\x20'+'structural\x20residuals\x20(unavoidable):\x20permissionless\x20alloc\x20allows\x20forced\x20settlement\x20timing,\x20the\x20submitted\x20order\x20is\x20not\x20bound\x20to\x20the\x20settled\x20allocation,\x20'+'and\x20allocators/guards\x20are\x20immutable\x20after\x20publish.'),'alloc_batch':NameOrAddressSchema['array']()['min'](0x1)['optional']()['describe']('Q8-F01\x20AGGREGATE\x20RELEASE\x20—\x20sweep\x20SEVERAL\x20pools\x20in\x20ONE\x20transaction\x20(allocation::alloc_batch).\x20'+'Provide\x20the\x20COMPLETE\x20pool\x20list\x20INCLUDING\x20\x27object\x27:\x20the\x20anchor\x20Allocation\x20addressed\x20by\x20this\x20operation\x20must\x20'+'appear\x20in\x20the\x20list,\x20and\x20the\x20SDK\x20refuses\x20a\x20list\x20that\x20omits\x20it.\x20REQUIRES\x20alloc_by_guard\x20—\x20that\x20one\x20Guard\x20'+'defines\x20the\x20release\x20and\x20is\x20applied\x20to\x20every\x20pool.\x20'+'WHY\x20THIS\x20EXISTS:\x20a\x20crowdfunding\x20settlement\x20holds\x20each\x20backer\x27s\x20escrow\x20in\x20its\x20own\x20Allocation\x20under\x20the\x20SAME\x20'+'release/refund\x20Guard;\x20with\x20single-pool\x20calls\x20a\x20keeper\x20needs\x20N\x20ordered\x20transactions,\x20and\x20any\x20keeper\x20that\x20stops\x20'+'at\x20the\x20first\x20failure\x20strands\x20the\x20remaining\x20pools\x20while\x20the\x20release\x20reports\x20done.\x20'+'ALL-OR-NOTHING:\x20one\x20pool\x20aborting\x20reverts\x20the\x20whole\x20batch.\x20'+'PRE-FILTER\x20drained\x20pools\x20before\x20building\x20the\x20call\x20—\x20a\x20zero-balance\x20pool\x20aborts\x20the\x20ENTIRE\x20batch\x20with\x20'+'EZERO_DISTRIBUTION\x20(14)\x20and\x20nothing\x20is\x20released;\x20an\x20empty\x20candidate\x20set\x20means\x20there\x20is\x20genuinely\x20nothing\x20to\x20'+'release\x20(an\x20empty\x20list\x20is\x20refused\x20with\x20EEMPTY_POOL_BATCH\x2026\x20instead\x20of\x20a\x20fake\x20success).\x20'+'EVERY\x20pool\x20must\x20carry\x20an\x20allocator\x20BOUND\x20to\x20alloc_by_guard:\x20an\x20unbound\x20pool\x20completes\x20the\x20sweep\x20having\x20'+'distributed\x20NOTHING,\x20so\x20the\x20SDK\x20verifies\x20membership\x20pool-by-pool\x20and\x20REFUSES\x20the\x20call\x20before\x20any\x20gas\x20is\x20spent.\x20'+'Each\x20recipient\x20still\x20receives\x20a\x20CoinWrapper\x20and\x20claims\x20it\x20through\x20the\x20normal\x20POST-DISTRIBUTION\x20CLAIM\x20step\x20—\x20'+'batching\x20changes\x20the\x20release\x20atomicity,\x20not\x20the\x20claim\x20path.'),'acknowledge_dual_payout':z['boolean']()['optional']()['describe']('A-1\x20(amz9-ln-261023;\x20keeper\x20posture\x20拍板⑧\x20dm-mtw-261027)\x20explicit\x20opt-in\x20for\x20a\x20KNOWN\x20double\x20payout:\x20when\x20a\x20submitted\x20order\x20already\x20received\x20'+'arbitration\x20compensation\x20(order.claimed_by\x20set)\x20and\x20this\x20call\x20would\x20ALSO\x20release\x20its\x20escrow\x20(refund\x20track),\x20'+'the\x20call\x20is\x20REFUSED\x20unless\x20this\x20flag\x20is\x20true.\x20The\x20two\x20payout\x20tracks\x20are\x20independent\x20by\x20design\x20—\x20the\x20chain\x20'+'will\x20not\x20net\x20or\x20stop\x20the\x20second\x20payout\x20(the\x20escrow\x20receive\x20path\x20has\x20no\x20claimed_by\x20gate),\x20BUT\x20a\x20rail\x20paired\x20'+'on\x20order.claimed_by\x20(refund\x20none\x20/\x20recover\x20some)\x20may\x20guard-reject\x20the\x20second\x20payout\x20on-chain;\x20that\x20rejection\x20'+'is\x20the\x20designed\x20mutual\x20exclusion,\x20and\x20the\x20escrow\x20exits\x20via\x20the\x20paired\x20rail.\x20Buyer\x20NET\x20view:\x20total\x20received\x20=\x20'+'compensation\x20+\x20escrow\x20refund.\x20Leave\x20unset\x20for\x20normal\x20refunds\x20of\x20un-awarded\x20orders.\x20AUTOMATION\x20RULE:\x20this\x20flag\x20'+'is\x20the\x20HUMAN\x20operator\x27s\x20netting\x20decision\x20—\x20an\x20automated\x20keeper\x20that\x20receives\x20dual_payout_unconfirmed\x20must\x20STOP\x20'+'retrying\x20and\x20escalate\x20(never\x20set\x20the\x20flag\x20itself);\x20a\x20retry\x20loop\x20wastes\x20gas\x20and\x20a\x20silent\x20stop\x20strands\x20the\x20payout.\x20D-1\x20(ksr\x205R-08):\x20the\x20flag\x20is\x20additionally\x20honored\x20ONLY\x20when\x20the\x20'+'executing\x20store\x20carries\x20a\x20human-recorded\x20preauthorization\x20(config_operation\x20store_dual_payout_set\x20{account,\x20'+'confirm:true},\x20then\x20store_dual_payout_get\x20shows\x20preauthorized=true);\x20without\x20it\x20the\x20gate\x20answers\x20'+'dual_payout_preauthorization_required\x20—\x20record\x20the\x20standing\x20decision\x20first,\x20then\x20re-send.'),'formula_spec_set':z['object']({'allocator_index':z['number']()['int']()['min'](0x0)['describe']('Index\x20of\x20the\x20allocator\x20within\x20allocators.allocators\x20(0-based).\x20Must\x20address\x20an\x20EXISTING\x20allocator,\x20else\x20refused\x20on-chain\x20(EFORMULA_SPEC_INVALID=24).'),'slot_index':z['number']()['int']()['min'](0x0)['describe']('Index\x20of\x20the\x20sharing\x20row\x20within\x20that\x20allocator\x27s\x20sharing[]\x20(0-based).\x20Must\x20address\x20a\x20slot\x20whose\x20mode\x20is\x20Formula,\x20else\x20refused\x20on-chain\x20(EFORMULA_SPEC_INVALID=24).'),'spec':FormulaSpecSchema})['strict']()['optional']()['describe']('Bind\x20(or\x20replace)\x20the\x20runtime\x20pricing\x20spec\x20of\x20ONE\x20Formula\x20sharing\x20slot\x20of\x20this\x20Allocation\x20—\x20no\x20re-declaration\x20of\x20the\x20allocator\x20plan,\x20'+'no\x20fund\x20movement.\x20Only\x20the\x20DATA\x20SOURCE\x20(which\x20repository\x20aggregate\x20prices\x20the\x20slot)\x20is\x20set\x20here;\x20the\x20slot\x20itself\x20must\x20already\x20be\x20declared\x20as\x20a\x20'+'Formula\x20leg\x20(mode\x204).\x20An\x20unbound\x20Formula\x20slot\x20prices\x20its\x20scalar\x20as\x200.')})['strict']()['describe']('Operate\x20on\x20an\x20existing\x20Allocation\x20object.\x20Set\x20\x27object\x27\x20field\x20with\x20the\x20object\x20ID\x20or\x20existing\x20name\x20to\x20specify\x20the\x20target.');export const CallAllocation_DataSchema=z['union']([CallAllocation_CreateSchema,CallAllocation_OperateSchema])['describe']('On-chain\x20Allocation\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Use\x20CallAllocation_CreateSchema\x20by\x20setting\x20\x27object\x27\x20with\x20OBJECT\x20format\x20{name,\x20type_parameter,\x20...}.\x20(2)\x20OPERATE\x20EXISTING:\x20Use\x20CallAllocation_OperateSchema\x20by\x20setting\x20\x27object\x27\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20');export const CallAllocation_InputSchema=z['object']({'data':CallAllocation_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();