@wowok/agent-mcp 3.4.4 → 3.4.5

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 (191) hide show
  1. package/dist/.build-stamp.json +3 -3
  2. package/dist/chain-semantics/composition-truth.js +1 -1
  3. package/dist/composition/audit.js +1 -1
  4. package/dist/composition/compile.js +1 -1
  5. package/dist/composition/emit-phases.js +1 -1
  6. package/dist/composition/guard-fill.js +1 -1
  7. package/dist/composition/input-normalize.js +1 -1
  8. package/dist/composition/materialize.js +1 -1
  9. package/dist/composition/mode-gates.js +1 -1
  10. package/dist/composition/param-disclosure.js +1 -1
  11. package/dist/composition/plan-run-store.js +1 -0
  12. package/dist/composition/reflux.js +1 -1
  13. package/dist/composition/role-bindings.js +1 -0
  14. package/dist/composition/shape-expand.js +1 -1
  15. package/dist/composition/supply-chain-emit.js +1 -1
  16. package/dist/config/judgment.d.ts +13 -25
  17. package/dist/config/judgment.js +1 -1
  18. package/dist/config/match-policy-file.js +1 -1
  19. package/dist/config/rule-engine.d.ts +4 -10
  20. package/dist/config/rule-engine.js +1 -1
  21. package/dist/config/template-params.js +1 -1
  22. package/dist/evaluation/engine.js +1 -1
  23. package/dist/experience/realtime-feedback.js +1 -1
  24. package/dist/extensions/capability.js +1 -1
  25. package/dist/graph/onchain/expand.js +1 -1
  26. package/dist/graph/onchain/exposure.js +1 -1
  27. package/dist/harness/forward-roster-preflight.js +1 -0
  28. package/dist/keeper/detectors.js +1 -1
  29. package/dist/knowledge/allocator-rail-verifier.js +1 -1
  30. package/dist/knowledge/arb-operation-face.js +1 -1
  31. package/dist/knowledge/arbitration-rail-verifier.js +1 -1
  32. package/dist/knowledge/audit-rules.d.ts +17 -1
  33. package/dist/knowledge/audit-rules.js +1 -1
  34. package/dist/knowledge/baselines/rules/alloc_audit.json.good.sha256 +1 -0
  35. package/dist/knowledge/baselines/rules/allocation.json.good.sha256 +1 -0
  36. package/dist/knowledge/baselines/rules/arb.json.good.sha256 +1 -0
  37. package/dist/knowledge/baselines/rules/arbitration.json.good.sha256 +1 -0
  38. package/dist/knowledge/baselines/rules/bridge.json.good.sha256 +1 -0
  39. package/dist/knowledge/baselines/rules/contact.json.good.sha256 +1 -0
  40. package/dist/knowledge/baselines/rules/demand.json.good.sha256 +1 -0
  41. package/dist/knowledge/baselines/rules/graph.json.good.sha256 +1 -0
  42. package/dist/knowledge/baselines/rules/guard.json.good.sha256 +1 -0
  43. package/dist/knowledge/baselines/rules/machine.json.good.sha256 +1 -0
  44. package/dist/knowledge/baselines/rules/oracle.json.good.sha256 +1 -0
  45. package/dist/knowledge/baselines/rules/order.json.good.sha256 +1 -0
  46. package/dist/knowledge/baselines/rules/payment.json.good.sha256 +1 -0
  47. package/dist/knowledge/baselines/rules/permission.json.good.sha256 +1 -0
  48. package/dist/knowledge/baselines/rules/personal.json.good.sha256 +1 -0
  49. package/dist/knowledge/baselines/rules/plan.json +153 -33
  50. package/dist/knowledge/baselines/rules/plan.json.good +153 -33
  51. package/dist/knowledge/baselines/rules/plan.json.good.sha256 +1 -0
  52. package/dist/knowledge/baselines/rules/progress.json.good.sha256 +1 -0
  53. package/dist/knowledge/baselines/rules/proof.json.good.sha256 +1 -0
  54. package/dist/knowledge/baselines/rules/registrar.json.good.sha256 +1 -0
  55. package/dist/knowledge/baselines/rules/repository.json.good.sha256 +1 -0
  56. package/dist/knowledge/baselines/rules/resource.json.good.sha256 +1 -0
  57. package/dist/knowledge/baselines/rules/reward.json.good.sha256 +1 -0
  58. package/dist/knowledge/baselines/rules/service.json.good.sha256 +1 -0
  59. package/dist/knowledge/baselines/rules/treasury.json.good.sha256 +1 -0
  60. package/dist/knowledge/baselines/rules/util.json.good.sha256 +1 -0
  61. package/dist/knowledge/builtin-templates.d.ts +1 -1
  62. package/dist/knowledge/builtin-templates.js +1 -1
  63. package/dist/knowledge/discount-threshold.js +1 -1
  64. package/dist/knowledge/fee-param-bindings.js +1 -1
  65. package/dist/knowledge/getting-started.js +1 -1
  66. package/dist/knowledge/guard-binding-table.js +1 -1
  67. package/dist/knowledge/guard-design-patterns.js +1 -1
  68. package/dist/knowledge/guard-templates.d.ts +3 -2
  69. package/dist/knowledge/guard-templates.js +1 -1
  70. package/dist/knowledge/index.js +1 -1
  71. package/dist/knowledge/industry-registry.js +1 -1
  72. package/dist/knowledge/jsonrpc-enum.js +1 -1
  73. package/dist/knowledge/knob-docs.js +1 -1
  74. package/dist/knowledge/machine-topology.js +1 -1
  75. package/dist/knowledge/param-schema.js +1 -1
  76. package/dist/knowledge/param-tiers.js +1 -1
  77. package/dist/knowledge/path-oracle/products/alibaba-1688.js +1 -1
  78. package/dist/knowledge/path-oracle/products/amazon.js +1 -1
  79. package/dist/knowledge/path-oracle/products/booking-com.js +1 -1
  80. package/dist/knowledge/path-oracle/products/contra.js +1 -1
  81. package/dist/knowledge/path-oracle/products/costco.js +1 -1
  82. package/dist/knowledge/path-oracle/products/duoduo-maicai.js +1 -1
  83. package/dist/knowledge/path-oracle/products/etsy.js +1 -1
  84. package/dist/knowledge/path-oracle/products/gamefound.js +1 -1
  85. package/dist/knowledge/path-oracle/products/gofundme.js +1 -1
  86. package/dist/knowledge/path-oracle/products/klook.js +1 -1
  87. package/dist/knowledge/path-oracle/products/ninety-nine-designs.js +1 -1
  88. package/dist/knowledge/path-oracle/products/pinduoduo-kuaituantuan.js +1 -1
  89. package/dist/knowledge/path-oracle/products/shansong.js +1 -1
  90. package/dist/knowledge/path-oracle/products/taobao-presale.js +1 -1
  91. package/dist/knowledge/path-oracle/products/upwork-catalog.js +1 -1
  92. package/dist/knowledge/path-oracle/products/upwork.js +1 -1
  93. package/dist/knowledge/pattern-resolutions.js +1 -1
  94. package/dist/knowledge/protocol-facts.js +1 -1
  95. package/dist/knowledge/publish-gate.js +1 -1
  96. package/dist/knowledge/publish-surface-contract.js +1 -1
  97. package/dist/knowledge/template-loader.js +1 -1
  98. package/dist/knowledge/template-registry.js +1 -1
  99. package/dist/knowledge/template-scanner.js +1 -1
  100. package/dist/knowledge/time-units.js +1 -0
  101. package/dist/knowledge/tools-reference.js +1 -1
  102. package/dist/knowledge/workflow-guidance.js +1 -1
  103. package/dist/monitor/MonitorLoop.js +1 -1
  104. package/dist/participation/radar-core.js +1 -1
  105. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  106. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  107. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  108. package/dist/playbooks/service-build/migration-planner.js +1 -1
  109. package/dist/playbooks/service-build/object-panorama.js +1 -1
  110. package/dist/playbooks/service-build/participation-radar.js +1 -1
  111. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  112. package/dist/playbooks/service-build/service-panorama.js +1 -1
  113. package/dist/playbooks/service-build/service-quote.js +1 -1
  114. package/dist/review/index.js +1 -1
  115. package/dist/safety/confirm-gate.js +1 -1
  116. package/dist/schema/benchmark-migration/index.d.ts +110 -2
  117. package/dist/schema/benchmark-migration/index.js +1 -1
  118. package/dist/schema/boundary-coercion.js +1 -0
  119. package/dist/schema/call/arbitration.js +1 -1
  120. package/dist/schema/call/base.js +1 -1
  121. package/dist/schema/call/handler.js +1 -1
  122. package/dist/schema/call/machine.d.ts +56 -8
  123. package/dist/schema/call/order.d.ts +37 -10
  124. package/dist/schema/call/order.js +1 -1
  125. package/dist/schema/call/permission.d.ts +210 -30
  126. package/dist/schema/call/personal.d.ts +56 -8
  127. package/dist/schema/call/progress.d.ts +28 -4
  128. package/dist/schema/call/semantic.js +1 -1
  129. package/dist/schema/call/service.d.ts +84 -12
  130. package/dist/schema/common/index.d.ts +14 -2
  131. package/dist/schema/common/index.js +1 -1
  132. package/dist/schema/evaluation/index.js +1 -1
  133. package/dist/schema/goal/index.d.ts +1 -1
  134. package/dist/schema/goal/planning.js +1 -1
  135. package/dist/schema/local/index.js +1 -1
  136. package/dist/schema/messenger/index.d.ts +168 -24
  137. package/dist/schema/messenger/index.js +1 -1
  138. package/dist/schema/operations.d.ts +655 -22
  139. package/dist/schema/operations.js +1 -1
  140. package/dist/schema/persona/index.d.ts +22 -110
  141. package/dist/schema/query/index.js +1 -1
  142. package/dist/schema/schema-version.js +1 -1
  143. package/dist/schema/workflow/index.d.ts +4 -0
  144. package/dist/schema/workflow/index.js +1 -1
  145. package/dist/schema-query-impl/index.js +1 -1
  146. package/dist/schemas/benchmark_migration_operation.schema.json +1 -1
  147. package/dist/schemas/evaluation_operation.schema.json +1 -1
  148. package/dist/schemas/goal_operation.schema.json +1 -1
  149. package/dist/schemas/guard_rebind_replacement.schema.json +1 -0
  150. package/dist/schemas/index.json +1 -1
  151. package/dist/schemas/messenger_operation.schema.json +1 -1
  152. package/dist/schemas/onchain_operations.schema.json +1 -1
  153. package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
  154. package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1
  155. package/dist/schemas/onchain_operations_contact.schema.json +1 -1
  156. package/dist/schemas/onchain_operations_demand.schema.json +1 -1
  157. package/dist/schemas/onchain_operations_gen_passport.schema.json +1 -1
  158. package/dist/schemas/onchain_operations_machine.schema.json +1 -1
  159. package/dist/schemas/onchain_operations_order.schema.json +1 -1
  160. package/dist/schemas/onchain_operations_permission.schema.json +1 -1
  161. package/dist/schemas/onchain_operations_personal.schema.json +1 -1
  162. package/dist/schemas/onchain_operations_progress.schema.json +1 -1
  163. package/dist/schemas/onchain_operations_proof.schema.json +1 -1
  164. package/dist/schemas/onchain_operations_repository.schema.json +1 -1
  165. package/dist/schemas/onchain_operations_reward.schema.json +1 -1
  166. package/dist/schemas/onchain_operations_service.schema.json +1 -1
  167. package/dist/schemas/onchain_operations_treasury.schema.json +1 -1
  168. package/dist/schemas/persona_operation.schema.json +1 -1
  169. package/dist/schemas/time_convert.schema.json +1 -0
  170. package/dist/schemas/wip_file.schema.json +1 -1
  171. package/dist/schemas/workflow_operation.schema.json +1 -1
  172. package/dist/tools/handlers/benchmark-migration.js +1 -1
  173. package/dist/tools/handlers/config.js +1 -1
  174. package/dist/tools/handlers/fund-rail-recipe.js +1 -1
  175. package/dist/tools/handlers/guard-rebind-replacement.js +1 -0
  176. package/dist/tools/handlers/local.js +1 -1
  177. package/dist/tools/handlers/mark-namespace.js +1 -1
  178. package/dist/tools/handlers/onchain.js +1 -1
  179. package/dist/tools/handlers/query.js +1 -1
  180. package/dist/tools/handlers/settle-sweep.js +1 -1
  181. package/dist/tools/handlers/time-convert.js +1 -0
  182. package/dist/tools/handlers/wip.js +1 -1
  183. package/dist/tools/handlers/workflow.js +1 -1
  184. package/dist/tools/index.d.ts +1 -0
  185. package/dist/tools/index.js +1 -1
  186. package/dist/tools/registry/business.js +1 -1
  187. package/dist/tools/registry/local.js +1 -1
  188. package/dist/tools/registry/onchain.js +1 -1
  189. package/dist/tools/wip-verify-ledger.js +1 -1
  190. package/dist/tools/wrap.js +1 -1
  191. package/package.json +6 -5
@@ -1 +1 @@
1
- import{batchQueryObjectsByIds,fetchMachineNodes}from'../graph/onchain/sdk-batch.js';function toBigInt(a){if(a===null||a===undefined)return null;if(typeof a==='bigint')return a;if(typeof a==='number')return Number['isFinite'](a)?BigInt(Math['trunc'](a)):null;if(typeof a==='string'){const b=a['trim']();if(b==='')return null;if(!/^\d+$/['test'](b)){const c=b['match'](/^(\d+)/);return c?BigInt(c[0x1]):null;}return BigInt(b);}return null;}export function evaluateDiscountThreshold(a,b){const c=toBigInt(a)??0x0n,d=toBigInt(b);return{'listTotal':c,'benchmark':d,'applies':d===null?!![]:c>=d};}function quantityOf(a){const b=a?.['quantity']??a?.['stock'],c=toBigInt(b);return c===null||c<0x0n?0x0n:c;}export function describeBenchmarkIssueRisk(a){const b=toBigInt(a);if(b===null||b===0x0n)return null;return'Coupon\x20threshold\x20set\x20to\x20'+b+'\x20(smallest\x20units):\x20the\x20discount\x20applies\x20ONLY\x20to\x20orders\x20'+('whose\x20total\x20is\x20>=\x20'+b+'.\x20An\x20order\x20below\x20that\x20threshold\x20CANNOT\x20use\x20this\x20coupon:\x20')+'attaching\x20it\x20at\x20buy\x20aborts\x20(error\x2038\x20—\x20the\x20transaction\x20rolls\x20back,\x20nothing\x20is\x20paid,\x20'+'and\x20the\x20coupon\x20is\x20preserved),\x20while\x20dropping\x20it\x20means\x20the\x20buyer\x20pays\x20FULL\x20price\x20'+'and\x20keeps\x20the\x20coupon\x20for\x20a\x20future\x20order.\x20'+'Leave\x20\x27benchmark\x27\x20unset\x20for\x20an\x20unconditional\x20discount.';}export async function checkDiscountThresholdBeforeBuy(a,b,c){const d=a?.['order_new']?.['buy'],e=d?.['discount'];if(typeof e!=='string'||e['trim']()==='')return null;const f=Array['isArray'](d?.['items'])?d['items']:[];if(f['length']===0x0)return null;let g,h;try{g=await c['resolveAddress'](String(a?.['object']??'')),h=await c['resolveAddress'](e);}catch{return null;}if(!g||!h)return null;let i;try{i=await c['fetchObjects']([g,h],b);}catch{return null;}const j=new Map();for(const v of i??[]){if(v?.['object'])j['set'](String(v['object'])['toLowerCase'](),v);}const k=j['get'](g['toLowerCase']()),l=j['get'](h['toLowerCase']());if(!k||!l)return null;const m=Array['isArray'](k['sales'])?k['sales']:[];if(m['length']===0x0)return null;const n=new Map();for(const w of m){if(typeof w?.['name']!=='string')continue;const x=toBigInt(w['price']);if(x!==null)n['set'](w['name'],x);}let q=0x0n,r=!![];for(const y of f){const z=typeof y?.['name']==='string'?n['get'](y['name']):undefined;if(z===undefined){r=![];break;}q+=z*quantityOf(y);}if(!r)return null;const t=l['benchmark'];if(t===null||t===undefined)return null;const u=evaluateDiscountThreshold(q,t);if(u['applies'])return null;return'⛔\x20THIS\x20COUPON\x20CANNOT\x20APPLY\x20TO\x20THIS\x20ORDER\x20—\x20order\x20not\x20placed\x0a\x0a'+('Coupon\x20'+e+'\x20carries\x20a\x20threshold\x20of\x20'+u['benchmark']+'\x20(smallest\x20units).\x0a')+('This\x20order\x20totals\x20'+u['listTotal']+'\x20before\x20discount,\x20which\x20is\x20BELOW\x20the\x20threshold.\x0a\x0a')+'What\x20would\x20happen\x20on\x20chain:\x20with\x20the\x20coupon\x20attached,\x20buy\x20aborts\x20(error\x2038)\x20and\x20the\x20whole\x20'+'transaction\x20rolls\x20back\x20—\x20nothing\x20is\x20paid\x20and\x20the\x20coupon\x20is\x20preserved.\x20Without\x20the\x20coupon,\x20'+'the\x20order\x20completes\x20at\x20FULL\x20price\x20and\x20the\x20coupon\x20survives\x20for\x20a\x20future\x20order.\x0a\x0a'+'Fixes\x20(pick\x20one):\x0a'+('\x20\x20•\x20Raise\x20this\x20order\x27s\x20total\x20to\x20>=\x20'+u['benchmark']+'\x20(add\x20items\x20/\x20buy\x20a\x20larger\x20quantity).\x0a')+('\x20\x20•\x20Drop\x20\x27discount\x27\x20from\x20this\x20order\x20and\x20pay\x20the\x20list\x20price\x20'+u['listTotal']+',\x20keeping\x20the\x20coupon.\x0a')+'\x20\x20•\x20Use\x20a\x20coupon\x20issued\x20WITHOUT\x20a\x20threshold\x20(unconditional).\x0a'+'Note:\x20a\x20coupon\x20with\x20NO\x20threshold\x20always\x20applies\x20—\x20omitting\x20it\x20is\x20not\x20the\x20problem\x20here.';}export function simulateCouponFinal(a,b,c){const d=toBigInt(a)??0x0n,e=toBigInt(c)??0x0n;if(Number(b)===0x0){const f=d*e/0x2710n;return d>f?d-f:0x0n;}return d>e?d-e:0x0n;}export function evaluateDiscountFloor(a,b,c,d){const e=Array['isArray'](a)?a:[];let f=null;for(const g of e){const h=toBigInt(g?.['price']);if(h===null)continue;if(f===null||h<f)f=h;}if(f===null)return{'cheapestPrice':null,'finalOnCheapest':null,'freeTierDeclared':d};return{'cheapestPrice':f,'finalOnCheapest':simulateCouponFinal(f,b,c),'freeTierDeclared':d};}function scanBalanceGate(a,b){const c=Array['isArray'](b)?b:[],d=new Map();for(const f of c){if(typeof f!=='object'||f===null)continue;const g=f,h=typeof g['identifier']==='number'?g['identifier']:typeof g['identifier']==='string'&&/^\d+$/['test'](g['identifier'])?Number(g['identifier']):undefined;if(h!==undefined)d['set'](h,g);}const e=i=>{if(typeof i!=='object'||i===null)return{'threshold':null,'legPresent':![]};const j=i;if(j['type']==='logic_as_u256_greater_or_equal'&&Array['isArray'](j['nodes'])&&j['nodes']['length']>=0x2){const m=j['nodes'][0x0],n=j['nodes'][0x1],o=m?.['type']==='query'?m['query']:undefined,p=o==='allocation.balance'||String(o)==='1051',s=n?.['type']==='identifier'&&typeof n['identifier']==='number'?n['identifier']:undefined;if(p&&s!==undefined){const t=d['get'](s);if(t&&t['b_submission']!==!![]){const u=t['value_type'];if(u===undefined||u===null||u==='U64'||u===0x6){const w=toBigInt(t['value']);if(w!==null)return{'threshold':w,'legPresent':!![]};}}return{'threshold':null,'legPresent':!![]};}}const l=Array['isArray'](j['nodes'])?j['nodes']:[];for(const x of l){const y=e(x);if(y['legPresent'])return y;}if(j['node']!==undefined){const z=e(j['node']);if(z['legPresent'])return z;}return{'threshold':null,'legPresent':![]};};return e(a);}export function findBalanceGateThreshold(a,b){return scanBalanceGate(a,b)['threshold'];}export async function checkDiscountBalanceGateBeforeIssue(a,b,c){const d=a?.['discount'];if(d==null||typeof d!=='object')return{'block':null,'warning':null};const e=p=>'BALANCE-GATE\x20CHECK\x20SKIPPED\x20(HIS-44):\x20'+p+'.\x20A\x20compiled\x20escrow\x20balance\x20gate\x20on\x20this\x20Service\x27s\x20machine\x20'+'NEUTRALIZES\x20discount\x20coupons\x20(the\x20buy\x20escrows\x20the\x20discounted\x20total,\x20the\x20balance\x20phase\x27s\x20full-price\x20gate\x20'+'refuses,\x20and\x20the\x20buyer\x20tops\x20up\x20to\x20full\x20price\x20—\x20hiswkp\x20F-44/D1).\x20Verify\x20manually\x20(machine\x20forwards\x20→\x20guard\x20'+'root:\x20allocation.balance\x20>=\x20a\x20static\x20U64\x20slot)\x20before\x20distributing\x20this\x20coupon.';let f;try{f=await c['resolveAddress'](String(a?.['object']??''));}catch{f=undefined;}if(!f)return{'block':null,'warning':e('the\x20Service\x20could\x20not\x20be\x20resolved\x20from\x20\x27'+String(a?.['object']??'')+'\x27')};let h=null;try{const p=await c['fetchObjects']([f],b);h=(p??[])['find'](q=>q?.['object']&&String(q['object'])['toLowerCase']()===f['toLowerCase']())??null;}catch{h=null;}if(!h)return{'block':null,'warning':e('the\x20Service\x20object\x20could\x20not\x20be\x20read\x20('+f+')')};const i=typeof h['machine']==='string'?h['machine']['trim']():'';if(i===''||!i['startsWith']('0x'))return{'block':null,'warning':null};let j;try{j=await fetchMachineNodes(i,b);}catch{j=undefined;}if(!j)return{'block':null,'warning':e('the\x20Machine\x27s\x20workflow\x20nodes\x20could\x20not\x20be\x20read\x20('+i+')')};const k=[...new Set(j['flatMap'](q=>Array['isArray'](q?.['pairs'])?q['pairs']:[])['flatMap'](q=>Array['isArray'](q?.['forwards'])?q['forwards']:[])['map'](q=>typeof q?.['guard']==='string'?q['guard']['trim']():'')['filter'](q=>q!==''))];if(k['length']===0x0)return{'block':null,'warning':null};let l;try{l=await batchQueryObjectsByIds(k,b,!![]);}catch{l=undefined;}if(!l)return{'block':null,'warning':e('the\x20forward\x20guard\x20objects\x20could\x20not\x20be\x20read\x20('+k['join'](',\x20')+')')};let m=null,n=![];for(const q of l){if(q?.['type']!=='Guard')continue;const r=q['data']??q,s=scanBalanceGate(r?.['root'],r?.['table']);if(s['legPresent'])n=!![];s['threshold']!==null&&(m===null||s['threshold']>m)&&(m=s['threshold']);}if(!n)return{'block':null,'warning':null};if(m===null)return{'block':null,'warning':e('a\x20forward\x20guard\x20reads\x20allocation.balance\x20but\x20its\x20threshold\x20slot\x20is\x20not\x20statically\x20readable\x20'+'(submission\x20slot\x20or\x20unparsable\x20value)')};const o=evaluateDiscountFloor(h['sales'],d['discount_type'],d['discount_value'],![]);if(o['cheapestPrice']===null||o['finalOnCheapest']===null)return{'block':null,'warning':e('the\x20Service\x27s\x20sales\x20could\x20not\x20be\x20priced,\x20so\x20the\x20post-coupon\x20total\x20could\x20not\x20be\x20compared\x20against\x20'+('the\x20compiled\x20balance\x20gate\x20'+m))};if(o['finalOnCheapest']>=m)return{'block':null,'warning':null};return{'block':'⛔\x20COUPON\x20ISSUANCE\x20BLOCKED\x20—\x20balance-gate\x20neutralization\x20(HIS-44)\x0a\x0a'+('Coupon\x20\x22'+(d['name']??'<unnamed>')+'\x22\x20would\x20be\x20neutralized\x20by\x20this\x20Service\x27s\x20compiled\x20escrow\x20balance\x20')+('gate:\x20cheapest\x20sale\x20price\x20'+o['cheapestPrice']+'\x20→\x20simulated\x20post-coupon\x20total\x20'+o['finalOnCheapest']+'\x20')+('smallest\x20units,\x20but\x20the\x20machine\x27s\x20forward\x20fund\x20gate\x20freezes\x20min_balance\x20at\x20'+m+'\x20(the\x20compiled\x20')+'full\x20price).\x0a\x0a'+'What\x20would\x20happen\x20on\x20chain:\x20the\x20coupon\x20discount\x20applies\x20ONLY\x20to\x20the\x20buy-time\x20quote,\x20while\x20the\x20balance\x20phase\x27s\x20'+'guard\x20reads\x20the\x20committed\x20allocation\x20balance\x20against\x20the\x20STATIC\x20full-price\x20threshold.\x20The\x20discounted\x20'+'escrow\x20(e.g.\x207.2\x20<\x20gate\x208.0)\x20fails\x20the\x20gate\x20→\x20the\x20balance\x20phase\x20refuses\x20→\x20the\x20buyer\x20is\x20forced\x20to\x20top\x20up\x20'+'to\x20FULL\x20price.\x20Total\x20paid\x20=\x20full\x20price;\x20the\x20coupon\x20is\x20a\x20false\x20promise\x20(hiswkp\x20F-44/D1,\x20confirmed;\x20'+'issuance-face\x20block\x20ruled\x202026-11-09,\x20options\x20B+C+A).\x0a\x0a'+'Fixes\x20(pick\x20one):\x0a'+'\x20\x20•\x20Do\x20NOT\x20issue\x20discount\x20coupons\x20for\x20this\x20service\x20—\x20it\x20is\x20a\x20two-phase\x20balance-gated\x20funding\x20shape.\x20'+'Until\x20the\x20post-state\x20gate\x20channel\x20lands\x20(protocol\x20card\x20P155-2x:\x20allocation.balance_post\x20/\x20coupon-aware\x20'+'gate),\x20a\x20coupon\x20on\x20this\x20service\x20can\x20never\x20deliver\x20its\x20discount.\x0a'+'\x20\x20•\x20Run\x20the\x20discount\x20OFF-CHAIN\x20instead:\x20WIP\x20copy,\x20quote-time\x20disclosure,\x20or\x20a\x20Messenger-delivered\x20offer.\x0a'+'Boundary\x20note:\x20renewal-style\x20subscriptions\x20funded\x20via\x20order_renew\x20normally\x20carry\x20no\x20such\x20gate\x20and\x20are\x20'+'unaffected\x20by\x20this\x20check.','warning':null};}export async function checkDiscountFloorBeforeIssue(a,b,c){const d=a?.['discount'];if(d==null||typeof d!=='object')return{'block':null,'warning':null};const e=d['allow_zero_total']===!![];let f;try{f=await c['resolveAddress'](String(a?.['object']??''));}catch{f=undefined;}if(!f)return{'block':null,'warning':'FLOOR\x20CHECK\x20SKIPPED\x20(F-BS-79):\x20the\x20Service\x20could\x20not\x20be\x20resolved\x20from\x20\x27'+String(a?.['object']??'')+'\x27,\x20'+'so\x20the\x20BKN-P2\x20zero-floor\x20check\x20did\x20NOT\x20run.\x20If\x20the\x20coupon\x20zeroes\x20the\x20cheapest\x20SKU\x20the\x20issuance\x20would\x20'+'otherwise\x20be\x20blocked\x20—\x20re-resolve\x20the\x20Service\x20and\x20re-run\x20the\x20check\x20(or\x20quote\x20it\x20via\x20'+'query_toolkit\x20service_quote)\x20before\x20distributing\x20this\x20coupon.'};let g=null;try{const k=await c['fetchObjects']([f],b);g=(k??[])['find'](l=>l?.['object']&&String(l['object'])['toLowerCase']()===f['toLowerCase']())??null;}catch{g=null;}if(!g)return{'block':null,'warning':'FLOOR\x20CHECK\x20SKIPPED\x20(F-BS-79):\x20the\x20Service\x27s\x20sales\x20could\x20not\x20be\x20read\x20('+f+'),\x20so\x20the\x20BKN-P2\x20'+'zero-floor\x20check\x20did\x20NOT\x20run.\x20If\x20the\x20coupon\x20zeroes\x20the\x20cheapest\x20SKU\x20the\x20issuance\x20would\x20otherwise\x20be\x20'+'blocked\x20—\x20re-run\x20the\x20check\x20(or\x20query_toolkit\x20service_quote)\x20before\x20distributing\x20this\x20coupon.'};const h=evaluateDiscountFloor(g?.['sales'],d['discount_type'],d['discount_value'],e);if(h['finalOnCheapest']===null||h['finalOnCheapest']>0x0n)return{'block':null,'warning':null};const i='Coupon\x20\x22'+(d['name']??'<unnamed>')+'\x22\x20zeroes\x20the\x20cheapest\x20SKU\x20of\x20this\x20Service\x20'+('(cheapest\x20sale\x20price\x20'+h['cheapestPrice']+',\x20simulated\x20final\x20total\x200\x20smallest\x20units).\x0a')+'A\x20zero-total\x20order\x20is\x20REFUSED\x20by\x20the\x20chain\x27s\x20zero-total\x20gate\x20(client\x20order_new_zero_total_dead_order,\x20'+'on-chain\x20abort\x2042)\x20—\x20the\x20coupon\x20cannot\x20buy\x20anything,\x20free\x20or\x20not,\x20and\x20reward/incentive\x20rails\x20exclude\x20'+'zero-total\x20orders\x20(template\x20policy\x20v55).\x0a\x0a',j=d['discount_type']===0x0?'\x20\x20•\x20Lower\x20the\x20RATES\x20value\x20further\x20(it\x20is\x20'+d['discount_value']+';\x20keep\x20it\x20below\x2010000\x20AND\x20still\x20leave\x20>=\x201\x20smallest\x20unit\x20on\x20the\x20cheapest\x20SKU).\x0a'+'\x20\x20•\x20Lower\x20the\x20cheapest\x20SKU\x27s\x20sale\x20price\x20so\x20the\x20discounted\x20total\x20pays\x20>=\x201\x20smallest\x20unit.\x0a':'\x20\x20•\x20Lower\x20discount_value\x20(MINUS)\x20so\x20the\x20cheapest\x20SKU\x20still\x20pays\x20>=\x201\x20smallest\x20unit,\x20or\x20switch\x20to\x20discount_type\x200\x20(RATES)\x20with\x20a\x20value\x20below\x2010000.\x0a';if(e)return{'block':'⛔\x20COUPON\x20ISSUANCE\x20BLOCKED\x20—\x20zero\x20floor\x20(BKN-P2)\x0a\x0a'+i+'allow_zero_total:true\x20does\x20NOT\x20waive\x20this\x20gate\x20(BSX-F07):\x20the\x20flag\x20exists\x20nowhere\x20in\x20the\x20'+'on-chain\x20Discount\x20struct\x20and\x20never\x20unlocked\x20a\x20zero-total\x20buy\x20—\x20this\x20coupon\x20would\x20only\x20'+'dead-end\x20at\x20the\x20buyer\x27s\x20checkout.\x0a'+'Fixes\x20(pick\x20one):\x0a'+j+'\x20\x20•\x20If\x20a\x20FREE\x20product\x20is\x20the\x20intent:\x20there\x20is\x20NO\x20zero-total\x20path\x20through\x20the\x20Order\x20rails\x20—\x20'+'price\x20the\x20free\x20tier\x20at\x201\x20smallest\x20unit\x20(not\x200),\x20or\x20deliver\x20it\x20outside\x20the\x20sales\x20rails\x20'+'(e.g.\x20a\x20Demand\x20with\x20Signature\x20fulfillment).','warning':null};return{'block':'⛔\x20COUPON\x20ISSUANCE\x20BLOCKED\x20—\x20zero\x20floor\x20(BKN-P2)\x0a\x0a'+i+'Fixes\x20(pick\x20one):\x0a'+j+'\x20\x20•\x20If\x20a\x20FREE\x20product\x20is\x20the\x20intent:\x20there\x20is\x20NO\x20zero-total\x20path\x20on-chain\x20—\x20price\x20the\x20free\x20tier\x20at\x20'+'1\x20smallest\x20unit\x20instead,\x20or\x20deliver\x20it\x20outside\x20the\x20sales\x20rails.\x20(allow_zero_total\x20does\x20NOT\x20'+'waive\x20this\x20gate\x20—\x20BSX-F07.)','warning':null};}
1
+ import{batchQueryObjectsByIds,fetchMachineNodes}from'../graph/onchain/sdk-batch.js';function toBigInt(a){if(a===null||a===undefined)return null;if(typeof a==='bigint')return a;if(typeof a==='number')return Number['isFinite'](a)?BigInt(Math['trunc'](a)):null;if(typeof a==='string'){const b=a['trim']();if(b==='')return null;if(!/^\d+$/['test'](b)){const c=b['match'](/^(\d+)/);return c?BigInt(c[0x1]):null;}return BigInt(b);}return null;}export function evaluateDiscountThreshold(a,b){const c=toBigInt(a)??0x0n,d=toBigInt(b);return{'listTotal':c,'benchmark':d,'applies':d===null?!![]:c>=d};}function quantityOf(a){const b=a?.['quantity']??a?.['stock'],c=toBigInt(b);return c===null||c<0x0n?0x0n:c;}export function describeBenchmarkIssueRisk(a){const b=toBigInt(a);if(b===null||b===0x0n)return null;return'Coupon\x20threshold\x20set\x20to\x20'+b+'\x20(smallest\x20units):\x20the\x20discount\x20applies\x20ONLY\x20to\x20orders\x20'+('whose\x20total\x20is\x20>=\x20'+b+'.\x20An\x20order\x20below\x20that\x20threshold\x20CANNOT\x20use\x20this\x20coupon:\x20')+'attaching\x20it\x20at\x20buy\x20aborts\x20(error\x2038\x20—\x20the\x20transaction\x20rolls\x20back,\x20nothing\x20is\x20paid,\x20'+'and\x20the\x20coupon\x20is\x20preserved),\x20while\x20dropping\x20it\x20means\x20the\x20buyer\x20pays\x20FULL\x20price\x20'+'and\x20keeps\x20the\x20coupon\x20for\x20a\x20future\x20order.\x20'+'Leave\x20\x27benchmark\x27\x20unset\x20for\x20an\x20unconditional\x20discount.';}export async function checkDiscountThresholdBeforeBuy(a,b,c){const d=a?.['order_new']?.['buy'],e=d?.['discount'];if(typeof e!=='string'||e['trim']()==='')return null;const f=Array['isArray'](d?.['items'])?d['items']:[];if(f['length']===0x0)return null;let g,h;try{g=await c['resolveAddress'](String(a?.['object']??'')),h=await c['resolveAddress'](e);}catch{return null;}if(!g||!h)return null;let i;try{i=await c['fetchObjects']([g,h],b);}catch{return null;}const j=new Map();for(const v of i??[]){if(v?.['object'])j['set'](String(v['object'])['toLowerCase'](),v);}const k=j['get'](g['toLowerCase']()),l=j['get'](h['toLowerCase']());if(!k||!l)return null;const m=Array['isArray'](k['sales'])?k['sales']:[];if(m['length']===0x0)return null;const n=new Map();for(const w of m){if(typeof w?.['name']!=='string')continue;const x=toBigInt(w['price']);if(x!==null)n['set'](w['name'],x);}let q=0x0n,r=!![];for(const y of f){const z=typeof y?.['name']==='string'?n['get'](y['name']):undefined;if(z===undefined){r=![];break;}q+=z*quantityOf(y);}if(!r)return null;const t=l['benchmark'];if(t===null||t===undefined)return null;const u=evaluateDiscountThreshold(q,t);if(u['applies'])return null;return'⛔\x20THIS\x20COUPON\x20CANNOT\x20APPLY\x20TO\x20THIS\x20ORDER\x20—\x20order\x20not\x20placed\x0a\x0a'+('Coupon\x20'+e+'\x20carries\x20a\x20threshold\x20of\x20'+u['benchmark']+'\x20(smallest\x20units).\x0a')+('This\x20order\x20totals\x20'+u['listTotal']+'\x20before\x20discount,\x20which\x20is\x20BELOW\x20the\x20threshold.\x0a\x0a')+'What\x20would\x20happen\x20on\x20chain:\x20with\x20the\x20coupon\x20attached,\x20buy\x20aborts\x20(error\x2038)\x20and\x20the\x20whole\x20'+'transaction\x20rolls\x20back\x20—\x20nothing\x20is\x20paid\x20and\x20the\x20coupon\x20is\x20preserved.\x20Without\x20the\x20coupon,\x20'+'the\x20order\x20completes\x20at\x20FULL\x20price\x20and\x20the\x20coupon\x20survives\x20for\x20a\x20future\x20order.\x0a\x0a'+'Fixes\x20(pick\x20one):\x0a'+('\x20\x20•\x20Raise\x20this\x20order\x27s\x20total\x20to\x20>=\x20'+u['benchmark']+'\x20(add\x20items\x20/\x20buy\x20a\x20larger\x20quantity).\x0a')+('\x20\x20•\x20Drop\x20\x27discount\x27\x20from\x20this\x20order\x20and\x20pay\x20the\x20list\x20price\x20'+u['listTotal']+',\x20keeping\x20the\x20coupon.\x0a')+'\x20\x20•\x20Use\x20a\x20coupon\x20issued\x20WITHOUT\x20a\x20threshold\x20(unconditional).\x0a'+'Note:\x20a\x20coupon\x20with\x20NO\x20threshold\x20always\x20applies\x20—\x20omitting\x20it\x20is\x20not\x20the\x20problem\x20here.';}export function simulateCouponFinal(a,b,c){const d=toBigInt(a)??0x0n,e=toBigInt(c)??0x0n;if(Number(b)===0x0){const f=d*e/0x2710n;return d>f?d-f:0x0n;}return d>e?d-e:0x0n;}export function evaluateDiscountFloor(a,b,c,d){const e=Array['isArray'](a)?a:[];let f=null;for(const g of e){const h=toBigInt(g?.['price']);if(h===null)continue;if(f===null||h<f)f=h;}if(f===null)return{'cheapestPrice':null,'finalOnCheapest':null,'freeTierDeclared':d};return{'cheapestPrice':f,'finalOnCheapest':simulateCouponFinal(f,b,c),'freeTierDeclared':d};}function scanBalanceGate(a,b){const c=Array['isArray'](b)?b:[],d=new Map();for(const f of c){if(typeof f!=='object'||f===null)continue;const g=f,h=typeof g['identifier']==='number'?g['identifier']:typeof g['identifier']==='string'&&/^\d+$/['test'](g['identifier'])?Number(g['identifier']):undefined;if(h!==undefined)d['set'](h,g);}const e=i=>{if(typeof i!=='object'||i===null)return{'threshold':null,'legPresent':![]};const j=i;if(j['type']==='logic_as_u256_greater_or_equal'&&Array['isArray'](j['nodes'])&&j['nodes']['length']>=0x2){const m=j['nodes'][0x0],n=j['nodes'][0x1],o=m?.['type']==='query'?m['query']:undefined,p=o==='allocation.balance'||String(o)==='1051',s=n?.['type']==='identifier'&&typeof n['identifier']==='number'?n['identifier']:undefined;if(p&&s!==undefined){const t=d['get'](s);if(t&&t['b_submission']!==!![]){const u=t['value_type'];if(u===undefined||u===null||u==='U64'||u===0x6){const w=toBigInt(t['value']);if(w!==null)return{'threshold':w,'legPresent':!![]};}}return{'threshold':null,'legPresent':!![]};}}const l=Array['isArray'](j['nodes'])?j['nodes']:[];for(const x of l){const y=e(x);if(y['legPresent'])return y;}if(j['node']!==undefined){const z=e(j['node']);if(z['legPresent'])return z;}return{'threshold':null,'legPresent':![]};};return e(a);}export function findBalanceGateThreshold(a,b){return scanBalanceGate(a,b)['threshold'];}export async function checkDiscountBalanceGateBeforeIssue(a,b,c){const d=a?.['discount'];if(d==null||typeof d!=='object')return{'block':null,'warning':null};const e=p=>'BALANCE-GATE\x20CHECK\x20SKIPPED\x20(HIS-44):\x20'+p+'.\x20A\x20compiled\x20escrow\x20balance\x20gate\x20on\x20this\x20Service\x27s\x20machine\x20'+'NEUTRALIZES\x20discount\x20coupons\x20(the\x20buy\x20escrows\x20the\x20discounted\x20total,\x20the\x20balance\x20phase\x27s\x20full-price\x20gate\x20'+'refuses,\x20and\x20the\x20buyer\x20tops\x20up\x20to\x20full\x20price\x20—\x20hiswkp\x20F-44/D1).\x20Verify\x20manually\x20(machine\x20forwards\x20→\x20guard\x20'+'root:\x20allocation.balance\x20>=\x20a\x20static\x20U64\x20slot)\x20before\x20distributing\x20this\x20coupon.';let f;try{f=await c['resolveAddress'](String(a?.['object']??''));}catch{f=undefined;}if(!f)return{'block':null,'warning':e('the\x20Service\x20could\x20not\x20be\x20resolved\x20from\x20\x27'+String(a?.['object']??'')+'\x27')};let h=null;try{const p=await c['fetchObjects']([f],b);h=(p??[])['find'](q=>q?.['object']&&String(q['object'])['toLowerCase']()===f['toLowerCase']())??null;}catch{h=null;}if(!h)return{'block':null,'warning':e('the\x20Service\x20object\x20could\x20not\x20be\x20read\x20('+f+')')};const i=typeof h['machine']==='string'?h['machine']['trim']():'';if(i===''||!i['startsWith']('0x'))return{'block':null,'warning':null};let j;try{j=await fetchMachineNodes(i,b);}catch{j=undefined;}if(!j)return{'block':null,'warning':e('the\x20Machine\x27s\x20workflow\x20nodes\x20could\x20not\x20be\x20read\x20('+i+')')};const k=[...new Set(j['flatMap'](q=>Array['isArray'](q?.['pairs'])?q['pairs']:[])['flatMap'](q=>Array['isArray'](q?.['forwards'])?q['forwards']:[])['map'](q=>typeof q?.['guard']==='string'?q['guard']['trim']():'')['filter'](q=>q!==''))];if(k['length']===0x0)return{'block':null,'warning':null};let l;try{l=await batchQueryObjectsByIds(k,b,!![]);}catch{l=undefined;}if(!l)return{'block':null,'warning':e('the\x20forward\x20guard\x20objects\x20could\x20not\x20be\x20read\x20('+k['join'](',\x20')+')')};let m=null,n=![];for(const q of l){if(q?.['type']!=='Guard')continue;const r=q['data']??q,s=scanBalanceGate(r?.['root'],r?.['table']);if(s['legPresent'])n=!![];s['threshold']!==null&&(m===null||s['threshold']>m)&&(m=s['threshold']);}if(!n)return{'block':null,'warning':null};if(m===null)return{'block':null,'warning':e('a\x20forward\x20guard\x20reads\x20allocation.balance\x20but\x20its\x20threshold\x20slot\x20is\x20not\x20statically\x20readable\x20'+'(submission\x20slot\x20or\x20unparsable\x20value)')};const o=evaluateDiscountFloor(h['sales'],d['discount_type'],d['discount_value'],![]);if(o['cheapestPrice']===null||o['finalOnCheapest']===null)return{'block':null,'warning':e('the\x20Service\x27s\x20sales\x20could\x20not\x20be\x20priced,\x20so\x20the\x20post-coupon\x20total\x20could\x20not\x20be\x20compared\x20against\x20'+('the\x20compiled\x20balance\x20gate\x20'+m))};if(o['finalOnCheapest']>=m)return{'block':null,'warning':null};return{'block':'⛔\x20COUPON\x20ISSUANCE\x20BLOCKED\x20—\x20balance-gate\x20neutralization\x20(HIS-44)\x0a\x0a'+('Coupon\x20\x22'+(d['name']??'<unnamed>')+'\x22\x20would\x20be\x20neutralized\x20by\x20this\x20Service\x27s\x20compiled\x20escrow\x20balance\x20')+('gate:\x20cheapest\x20sale\x20price\x20'+o['cheapestPrice']+'\x20→\x20simulated\x20post-coupon\x20total\x20'+o['finalOnCheapest']+'\x20')+('smallest\x20units,\x20but\x20the\x20machine\x27s\x20forward\x20fund\x20gate\x20freezes\x20min_balance\x20at\x20'+m+'\x20(the\x20compiled\x20')+'full\x20price).\x0a\x0a'+'What\x20would\x20happen\x20on\x20chain:\x20the\x20coupon\x20discount\x20applies\x20ONLY\x20to\x20the\x20buy-time\x20quote,\x20while\x20the\x20balance\x20phase\x27s\x20'+'guard\x20reads\x20the\x20committed\x20allocation\x20balance\x20against\x20the\x20STATIC\x20full-price\x20threshold.\x20The\x20discounted\x20'+'escrow\x20(e.g.\x207.2\x20<\x20gate\x208.0)\x20fails\x20the\x20gate\x20→\x20the\x20balance\x20phase\x20refuses\x20→\x20the\x20buyer\x20is\x20forced\x20to\x20top\x20up\x20'+'to\x20FULL\x20price.\x20Total\x20paid\x20=\x20full\x20price;\x20the\x20coupon\x20is\x20a\x20false\x20promise\x20(hiswkp\x20F-44/D1,\x20confirmed;\x20'+'issuance-face\x20block\x20ruled\x202026-11-09,\x20options\x20B+C+A).\x0a\x0a'+'Fixes\x20(pick\x20one):\x0a'+'\x20\x20•\x20Do\x20NOT\x20issue\x20discount\x20coupons\x20for\x20this\x20service\x20—\x20it\x20is\x20a\x20two-phase\x20balance-gated\x20funding\x20shape.\x20'+'Published\x20machines\x20are\x20immutable,\x20so\x20on\x20THIS\x20service\x20a\x20coupon\x20can\x20never\x20deliver\x20its\x20discount\x20until\x20the\x20'+'post-state\x20gate\x20channel\x20lands\x20(protocol\x20card\x20P155-2x:\x20allocation.balance_post\x20/\x20coupon-aware\x20gate).\x0a'+'\x20\x20•\x20Rebuild\x20path\x20for\x20FUTURE\x20services\x20(HIS-44\x20cure,\x20ruling\x20B\x202026-11-09):\x20build\x20from\x20a\x20template\x20that\x20mounts\x20the\x20'+'discount-aware\x20dynamic\x20fund\x20gate\x20tpl_forward_fund_gate_order_amount\x20—\x20its\x20floor\x20reads\x20'+'allocation.balance\x20>=\x20order.amount\x20+\x20balance_amount\x20(query\x201561),\x20so\x20a\x20couponed\x20order\x20gates\x20on\x20its\x20OWN\x20'+'discounted\x20total\x20and\x20the\x20coupon\x20actually\x20delivers\x20(a\x20couponless\x20order\x20gates\x20exactly\x20at\x20full\x20price).\x0a'+'\x20\x20•\x20Run\x20the\x20discount\x20OFF-CHAIN\x20instead:\x20WIP\x20copy,\x20quote-time\x20disclosure,\x20or\x20a\x20Messenger-delivered\x20offer.\x0a'+'Boundary\x20note:\x20renewal-style\x20subscriptions\x20funded\x20via\x20order_renew\x20normally\x20carry\x20no\x20such\x20gate\x20and\x20are\x20'+'unaffected\x20by\x20this\x20check.','warning':null};}export async function checkDiscountFloorBeforeIssue(a,b,c){const d=a?.['discount'];if(d==null||typeof d!=='object')return{'block':null,'warning':null};const e=d['allow_zero_total']===!![];let f;try{f=await c['resolveAddress'](String(a?.['object']??''));}catch{f=undefined;}if(!f)return{'block':null,'warning':'FLOOR\x20CHECK\x20SKIPPED\x20(F-BS-79):\x20the\x20Service\x20could\x20not\x20be\x20resolved\x20from\x20\x27'+String(a?.['object']??'')+'\x27,\x20'+'so\x20the\x20BKN-P2\x20zero-floor\x20check\x20did\x20NOT\x20run.\x20If\x20the\x20coupon\x20zeroes\x20the\x20cheapest\x20SKU\x20the\x20issuance\x20would\x20'+'otherwise\x20be\x20blocked\x20—\x20re-resolve\x20the\x20Service\x20and\x20re-run\x20the\x20check\x20(or\x20quote\x20it\x20via\x20'+'query_toolkit\x20service_quote)\x20before\x20distributing\x20this\x20coupon.'};let g=null;try{const k=await c['fetchObjects']([f],b);g=(k??[])['find'](l=>l?.['object']&&String(l['object'])['toLowerCase']()===f['toLowerCase']())??null;}catch{g=null;}if(!g)return{'block':null,'warning':'FLOOR\x20CHECK\x20SKIPPED\x20(F-BS-79):\x20the\x20Service\x27s\x20sales\x20could\x20not\x20be\x20read\x20('+f+'),\x20so\x20the\x20BKN-P2\x20'+'zero-floor\x20check\x20did\x20NOT\x20run.\x20If\x20the\x20coupon\x20zeroes\x20the\x20cheapest\x20SKU\x20the\x20issuance\x20would\x20otherwise\x20be\x20'+'blocked\x20—\x20re-run\x20the\x20check\x20(or\x20query_toolkit\x20service_quote)\x20before\x20distributing\x20this\x20coupon.'};const h=evaluateDiscountFloor(g?.['sales'],d['discount_type'],d['discount_value'],e);if(h['finalOnCheapest']===null||h['finalOnCheapest']>0x0n)return{'block':null,'warning':null};const i='Coupon\x20\x22'+(d['name']??'<unnamed>')+'\x22\x20zeroes\x20the\x20cheapest\x20SKU\x20of\x20this\x20Service\x20'+('(cheapest\x20sale\x20price\x20'+h['cheapestPrice']+',\x20simulated\x20final\x20total\x200\x20smallest\x20units).\x0a')+'A\x20zero-total\x20order\x20is\x20REFUSED\x20by\x20the\x20chain\x27s\x20zero-total\x20gate\x20(client\x20order_new_zero_total_dead_order,\x20'+'on-chain\x20abort\x2042)\x20—\x20the\x20coupon\x20cannot\x20buy\x20anything,\x20free\x20or\x20not,\x20and\x20reward/incentive\x20rails\x20exclude\x20'+'zero-total\x20orders\x20(template\x20policy\x20v55).\x0a\x0a',j=d['discount_type']===0x0?'\x20\x20•\x20Lower\x20the\x20RATES\x20value\x20further\x20(it\x20is\x20'+d['discount_value']+';\x20keep\x20it\x20below\x2010000\x20AND\x20still\x20leave\x20>=\x201\x20smallest\x20unit\x20on\x20the\x20cheapest\x20SKU).\x0a'+'\x20\x20•\x20Lower\x20the\x20cheapest\x20SKU\x27s\x20sale\x20price\x20so\x20the\x20discounted\x20total\x20pays\x20>=\x201\x20smallest\x20unit.\x0a':'\x20\x20•\x20Lower\x20discount_value\x20(MINUS)\x20so\x20the\x20cheapest\x20SKU\x20still\x20pays\x20>=\x201\x20smallest\x20unit,\x20or\x20switch\x20to\x20discount_type\x200\x20(RATES)\x20with\x20a\x20value\x20below\x2010000.\x0a';if(e)return{'block':'⛔\x20COUPON\x20ISSUANCE\x20BLOCKED\x20—\x20zero\x20floor\x20(BKN-P2)\x0a\x0a'+i+'allow_zero_total:true\x20does\x20NOT\x20waive\x20this\x20gate\x20(BSX-F07):\x20the\x20flag\x20exists\x20nowhere\x20in\x20the\x20'+'on-chain\x20Discount\x20struct\x20and\x20never\x20unlocked\x20a\x20zero-total\x20buy\x20—\x20this\x20coupon\x20would\x20only\x20'+'dead-end\x20at\x20the\x20buyer\x27s\x20checkout.\x0a'+'Fixes\x20(pick\x20one):\x0a'+j+'\x20\x20•\x20If\x20a\x20FREE\x20product\x20is\x20the\x20intent:\x20there\x20is\x20NO\x20zero-total\x20path\x20through\x20the\x20Order\x20rails\x20—\x20'+'price\x20the\x20free\x20tier\x20at\x201\x20smallest\x20unit\x20(not\x200),\x20or\x20deliver\x20it\x20outside\x20the\x20sales\x20rails\x20'+'(e.g.\x20a\x20Demand\x20with\x20Signature\x20fulfillment).','warning':null};return{'block':'⛔\x20COUPON\x20ISSUANCE\x20BLOCKED\x20—\x20zero\x20floor\x20(BKN-P2)\x0a\x0a'+i+'Fixes\x20(pick\x20one):\x0a'+j+'\x20\x20•\x20If\x20a\x20FREE\x20product\x20is\x20the\x20intent:\x20there\x20is\x20NO\x20zero-total\x20path\x20on-chain\x20—\x20price\x20the\x20free\x20tier\x20at\x20'+'1\x20smallest\x20unit\x20instead,\x20or\x20deliver\x20it\x20outside\x20the\x20sales\x20rails.\x20(allow_zero_total\x20does\x20NOT\x20'+'waive\x20this\x20gate\x20—\x20BSX-F07.)','warning':null};}
@@ -1 +1 @@
1
- import{MS_PER_DAY,MS_PER_HOUR,TIME_GUARD_INSTANTIATIONS,TWIN_PARAM,msKnobOf,unitScale}from'./pattern-resolutions.js';const HAND_WRITTEN_BINDINGS=[{'template':'delivery/restaurant-marketplace','guard_key':'reopen_window','param':'reopen_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'once-only\x20keeper\x20reopen\x20window\x20after\x20the\x20FIRST\x20reviewed\x20entry'},{'template':'group_buy/platform-supplied-pickup','guard_key':'reopen_window','param':'reopen_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'once-only\x20keeper\x20reopen\x20window\x20after\x20the\x20FIRST\x20reviewed\x20entry'},{'template':'delivery/restaurant-marketplace','guard_key':'review_edit','param':'review_edit_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'review\x20amendment\x20window\x20—\x20how\x20long\x20after\x20submitting\x20the\x20review\x20the\x20buyer\x20may\x20append\x20amendments\x20(stage2\x20#1\x20P-10;\x20FIRST-anchored,\x20never\x20re-arms)'},{'template':'delivery/restaurant-marketplace','guard_key':'late_compensation','param':'dispatch_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'late-delivery\x20evidence:\x20delivered-minus-picked_up\x20history\x20delta\x20must\x20meet\x20the\x20promised\x20dispatch\x20window'},{'template':'delivery/on-demand-errand','guard_key':'late_compensation','param':'promise_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'late-delivery\x20evidence:\x20delivered-minus-picked_up\x20history\x20delta\x20must\x20meet\x20the\x20promised\x20delivery\x20window\x20(stage2\x20#20\x20N-02)'},{'template':'retail/warehouse-club','guard_key':'late_delivery_breach','param':'sla_late_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'W-1\x20late-delivery\x20evidence:\x20delivered-minus-shipped\x20history\x20delta\x20must\x20meet\x20the\x20promised\x20SLA\x20window\x20(F-049\x20form)'},{'template':'delivery/restaurant-marketplace','guard_key':'deliver_confirm_timeout','param':'auto_confirm_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'buyer\x20silence\x20window'},{'template':'delivery/restaurant-marketplace','guard_key':'claim_filed','param':'claim_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'serial\x20claim\x20window\x20closes'},{'template':'delivery/restaurant-marketplace','guard_key':'settle_window_gate','param':'settle_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'settlement\x20opens'},{'template':'delivery/restaurant-marketplace','guard_key':'cancel_no_capacity','param':'dispatch_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'dispatch\x20timeout\x20—\x20penalty-free\x20platform\x20force-cancel\x20(INV-FD-2)'},{'template':'delivery/restaurant-marketplace','guard_key':'accept_timeout','param':'accept_timeout_minutes','to':'duration_ms','scale':0xea60,'note':'accept\x20timeout\x20—\x20keeper\x20force-cancel\x20into\x20the\x20full-refund\x20terminal\x20when\x20the\x20kitchen\x20never\x20accepts\x20(stage2\x20#1\x20P-01)'},{'template':'delivery/restaurant-marketplace','guard_key':'ready_timeout','param':'prep_window_minutes','to':'duration_ms','scale':0xea60,'note':'prep\x20timeout\x20—\x20keeper\x20force-cancel\x20into\x20the\x20full-refund\x20terminal\x20when\x20the\x20kitchen\x20never\x20marks\x20ready\x20(stage2\x20#1\x20P-02)'},{'template':'delivery/restaurant-marketplace','guard_key':'failed_contact','param':'failed_contact_wait_minutes','to':'duration_ms','scale':0xea60,'note':'failed-contact\x20wait\x20—\x20how\x20long\x20a\x20delivered\x20order\x20may\x20sit\x20silent\x20before\x20the\x20keeper\x20returns\x20it\x20to\x20the\x20store\x20(stage2\x20#1\x20P-05)'},{'template':'delivery/restaurant-marketplace','guard_key':'redeliver_timeout','param':'redelivery_window_minutes','to':'duration_ms','scale':0xea60,'note':'redelivery\x20window\x20—\x20how\x20long\x20a\x20promised\x20second\x20ride\x20may\x20stay\x20open\x20before\x20the\x20keeper\x20refunds\x20in\x20full\x20(stage2\x20#1\x20P-07)'},{'template':'group_buy/platform-supplied-pickup','guard_key':'unclaimed_refund','param':'pickup_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'unclaimed\x20order\x20refunds'},{'template':'group_buy/platform-supplied-pickup','guard_key':'unclaimed_settle_open','param':'pickup_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'settlement\x20opens\x20after\x20pickup\x20window'},{'template':'group_buy/platform-supplied-pickup','guard_key':'unclaimed_refund_late','param':'pickup_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'keeper\x20late\x20refund\x20after\x20the\x20pickup\x20window\x20(the\x20refund_buyer\x20DEFAULT\x20exit,\x20dmcx\x20F-23)'},{'template':'group_buy/platform-supplied-pickup','guard_key':'claim_filed','param':'claim_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'serial\x20claim\x20window\x20closes'},{'template':'group_buy/platform-supplied-pickup','guard_key':'settle_window_gate','param':'settle_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'settlement\x20opens'},{'template':'group_buy/platform-supplied-pickup','guard_key':'return_window_pickup','param':'return_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'return\x20window\x20after\x20pickup'},{'template':'group_buy/platform-supplied-pickup','guard_key':'return_window_claim','param':'return_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'return\x20window\x20from\x20the\x20serial\x20claim\x20window\x20(M-T2:\x20the\x20keeper\x20can\x20open\x20claim_window\x20before\x20pickup\x20—\x20the\x20buyer\x20keeps\x20the\x20same\x20filing\x20right\x20from\x20THAT\x20rest\x20state)'},{'template':'group_buy/leader-sourced-community','guard_key':'return_window_delivered','param':'return_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'return\x20window\x20after\x20delivery'},{'template':'group_buy/leader-sourced-community','guard_key':'return_window_claim','param':'return_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'return\x20window\x20from\x20the\x20serial\x20claim\x20window\x20(M-T2:\x20distinct\x20edge,\x20own\x20key)'},{'template':'group_buy/leader-sourced-community','guard_key':'shortfall_claim','param':'return_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'shortfall\x20(missing-items)\x20filing\x20window\x20—\x20the\x20SAME\x20after-sales\x20policy\x20as\x20the\x20return\x20twins\x20(the\x20author\x20literal\x20was\x20decorative\x20without\x20this\x20row)'},{'template':'retail/vertical-handmade','guard_key':'return_window','param':'settlement_delay_days','to':'claim_window_days','note':'settle\x20delay\x20doubles\x20as\x20the\x20return\x20window\x20anchor'},{'template':'retail/vertical-handmade','guard_key':'review_window','param':'review_window_days','to':'duration_ms','scale':MS_PER_DAY,'note':'review\x20window'},{'template':'group_buy/platform-supplied-pickup','guard_key':'return_transit_timeout','param':'return_transit_days','to':'duration_ms','scale':MS_PER_DAY,'note':'return\x20transit\x20deadline'},{'template':'group_buy/leader-sourced-community','guard_key':'return_transit_timeout','param':'return_transit_days','to':'duration_ms','scale':MS_PER_DAY,'note':'return\x20transit\x20deadline'},{'template':'education/mooc-degree','guard_key':'review_window','param':'review_window_days','to':'duration_ms','scale':MS_PER_DAY,'note':'student\x20review\x20deadline\x20window'},{'template':'education/mooc-degree','guard_key':'cert_claim_gate','param':'cert_completion_threshold_bps','to':'cert_completion_threshold_bps','no_author_literal':!![],'note':'certificate-claim\x20completion\x20floor'},{'template':'education/mooc-single-course','guard_key':'cert_claim_gate','param':'cert_completion_threshold_bps','to':'cert_completion_threshold_bps','no_author_literal':!![],'note':'certificate-claim\x20completion\x20floor'},{'template':'retail/vertical-handmade','guard_key':'arb_refund','param':'arb_indemnity_floor_bps','to':'min_indemnity_floor','no_author_literal':!![],'note':'won-rail\x20award\x20floor\x20(delivered-entry\x20ruling)'},{'template':'retail/vertical-handmade','guard_key':'arb_refund_filed','param':'arb_indemnity_floor_bps','to':'min_indemnity_floor','no_author_literal':!![],'note':'won-rail\x20award\x20floor\x20(recorded-claim\x20ruling)'},{'template':'retail/vertical-handmade','guard_key':'arb_refund_return','param':'arb_indemnity_floor_bps','to':'min_indemnity_floor','no_author_literal':!![],'note':'won-rail\x20award\x20floor\x20(return-escalation\x20ruling)'},{'template':'group_buy/platform-supplied-pickup','guard_key':'arb_refund','param':'arb_indemnity_floor_bps','to':'min_indemnity_floor','no_author_literal':!![],'note':'won-rail\x20award\x20floor\x20(recorded-claim\x20ruling)'},{'template':'group_buy/platform-supplied-pickup','guard_key':'arb_refund_return','param':'arb_indemnity_floor_bps','to':'min_indemnity_floor','no_author_literal':!![],'note':'won-rail\x20award\x20floor\x20(return-escalation\x20ruling)'},{'template':'freelance/agent-task','guard_key':'auto_release','param':'evaluation_window_days','to':'claim_window_days','note':'auto-release\x20window'},{'template':'licensing/royalty-stream-auction','guard_key':'inspection_timeout','param':'inspection_window_days','to':'claim_window_days','note':'inspection\x20deadline'},{'template':'licensing/royalty-stream-auction','guard_key':'return_window','param':'inspection_window_days','to':'claim_window_days','note':'inspection\x20doubles\x20as\x20the\x20return\x20window'},{'template':'licensing/royalty-stream-auction','guard_key':'cancel_return','param':'inspection_window_days','to':'claim_window_days','note':'inspection\x20doubles\x20as\x20the\x20cancel\x20window'},{'template':'licensing/asset-license-metered','guard_key':'delivery_timeout','param':'delivery_window_days','to':'claim_window_days','note':'delivery\x20deadline'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'review_window','param':'review_window_days','to':'claim_window_days','note':'review\x20window'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'return_window','param':'return_window_days','to':'claim_window_days','note':'return\x20window'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'claim_filed','param':'return_window_days','to':'claim_window_days','note':'dispute-filing\x20window\x20—\x20races\x20the\x20return\x20window\x20on\x20ONE\x20clock'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'settle_clock','param':'settlement_delay_days','to':'claim_window_days','note':'settle\x20delay\x20after\x20delivery'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'review_settle_clock','param':'settlement_delay_days','to':'claim_window_days','note':'settle\x20delay\x20after\x20review'},{'template':'freelance/catalog-tiers','guard_key':'instant_cancel_24h','param':'instant_cancel_hours','to':'free_cancel_hours','note':'buyer\x20instant-cancel\x20window\x20(order.time\x20anchor)'},{'template':'travel/global-ota','guard_key':'no_show_evidence','param':'no_show_floor_hours','to':'not_before_hours','note':'no-show\x20evidence\x20floor'},{'template':'travel/global-ota','guard_key':'review_claim','param':'reward_claim_closes_after_days','to':'closes_after_days','note':'bounty\x20claim\x20deadline'},{'template':'subscription/direct-fan-subscription','guard_key':'reward_claim','param':'reward_claim_closes_after_days','to':'closes_after_days','note':'bounty\x20claim\x20deadline'},{'template':'licensing/royalty-stream-auction','guard_key':'review_claim','param':'reward_claim_closes_after_days','to':'closes_after_days','note':'bounty\x20claim\x20deadline'},{'template':'licensing/asset-license-metered','guard_key':'review_claim','param':'reward_claim_closes_after_days','to':'closes_after_days','note':'bounty\x20claim\x20deadline'},{'template':'retail/restock-supply','guard_key':'settle_alloc','param':'settlement_days','to':'claim_window_days','note':'serial\x20release\x20clock\x20on\x20the\x20allocator\x20(no\x20settlement\x20forward\x20exists)'},{'template':'travel/destination-experience','guard_key':'cancel_tier_1','param':'cancel_tier_1_boundary_hours','to':'lower_hours','note':'tier-1\x20lower\x20band\x20edge\x20(7\x20days\x20by\x20default)'},{'template':'travel/destination-experience','guard_key':'cancel_tier_2','param':'cancel_tier_1_boundary_hours','to':'upper_hours','note':'tier-1/tier-2\x20seam'},{'template':'travel/destination-experience','guard_key':'cancel_tier_2','param':'cancel_tier_2_boundary_hours','to':'lower_hours','note':'tier-2\x20lower\x20band\x20edge\x20(3\x20days\x20by\x20default)'},{'template':'travel/destination-experience','guard_key':'cancel_tier_3','param':'cancel_tier_2_boundary_hours','to':'upper_hours','note':'tier-2/tier-3\x20seam'},{'template':'travel/destination-experience','guard_key':'cancel_tier_3','param':'cancel_tier_3_boundary_hours','to':'lower_hours','note':'tier-3\x20lower\x20band\x20edge\x20(1\x20day\x20by\x20default)'},{'template':'travel/destination-experience','guard_key':'cancel_tier_4','param':'cancel_tier_3_boundary_hours','to':'upper_hours','note':'tier-3/tier-4\x20seam'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'reward_claim','param':'reward_claim_closes_after_days','to':'closes_after_days','note':'bounty\x20claim\x20deadline'},{'template':'freelance/catalog-tiers','guard_key':'post_accept_refund_window','param':'post_accept_refund_days','plus':'escrow_release_days','to':'claim_window_days','note':'post-acceptance\x20refund\x20mirror\x20=\x20auto-accept\x20window\x20+\x20grace\x20(delivered\x20anchor;\x207+14=21)'},{'template':'freelance/catalog-tiers','guard_key':'post_accept_revision_window','param':'post_accept_refund_days','plus':'escrow_release_days','to':'claim_window_days','note':'post-acceptance\x20revision\x20mirror\x20—\x20SAME\x20window\x20policy\x20as\x20the\x20refund\x20twin\x20(distinct\x20edge,\x20own\x20key)'},{'template':'freelance/enterprise-talent-market','guard_key':'cancel_band_full','param':'cancel_band_1_boundary_bps','to':'ceiling_bps','note':'band\x20A/B\x20seam\x20—\x20full-refund\x20band\x27s\x20exclusive\x20ceiling'},{'template':'freelance/enterprise-talent-market','guard_key':'cancel_band_half','param':'cancel_band_1_boundary_bps','to':'floor_bps','note':'band\x20A/B\x20seam\x20—\x20half-split\x20band\x27s\x20inclusive\x20floor\x20(bit-identical\x20to\x20band\x20A\x27s\x20ceiling)'},{'template':'freelance/enterprise-talent-market','guard_key':'cancel_band_half','param':'cancel_band_2_boundary_bps','to':'ceiling_bps','note':'band\x20B/C\x20seam\x20—\x20half-split\x20band\x27s\x20exclusive\x20ceiling'},{'template':'freelance/enterprise-talent-market','guard_key':'cancel_band_post','param':'cancel_band_2_boundary_bps','to':'floor_bps','note':'band\x20B/C\x20seam\x20—\x20completion-value\x20band\x27s\x20inclusive\x20floor\x20(bit-identical\x20to\x20band\x20B\x27s\x20ceiling)'},{'template':'freelance/enterprise-talent-market','guard_key':'cancel_band_post','param':'cancel_band_top_ceiling_bps','to':'ceiling_bps','note':'closure\x20sentinel\x20—\x20exclusive\x20ceiling\x20past\x20the\x2010000\x20bps\x20axis\x20(>=\x2010001;\x20R-RATE-TIER-GAP)'}];function derivedRows(){const a=[];for(const c of TIME_GUARD_INSTANTIATIONS){const d=c['days']!==undefined?'days':c['hours']!==undefined?'hours':undefined;if(d===undefined)continue;a['push']({'template':c['template'],'guard_key':c['guard_key'],'param':c['days']??c['hours'],'to':TWIN_PARAM[d],'scale':unitScale(d),...c['plus_days']!==undefined?{'plus':c['plus_days']}:{},'no_author_literal':!![],'note':c['note']});const e=msKnobOf(c['days']??c['hours']);if(c['multimount']===!![]||e===undefined)continue;const f=c['plus_days']===undefined?[]:typeof c['plus_days']==='string'?[c['plus_days']]:[...c['plus_days']],g=[];let h=!![];for(const i of f){const j=msKnobOf(i);if(j===undefined){h=![];break;}g['push'](j);}if(!h)continue;a['push']({'template':c['template'],'guard_key':c['guard_key'],'param':e,'to':'duration_ms','scale':0x1,...g['length']>0x0?{'plus':g}:{},'no_author_literal':!![],'ms_variant':!![],'note':c['note']+'\x20—\x20the\x20*_ms\x20knob\x27s\x20ms-slot-pair\x20landing\x20(nnd4\x20F-04:\x20duration_ms\x20beside\x20a\x20day-factor\x20of\x201)'});}return a;}export const FEE_PARAM_BINDINGS=[...HAND_WRITTEN_BINDINGS,...derivedRows()];const BY_SPEC=new Map();for(const b of FEE_PARAM_BINDINGS){const k=specKey(b['template'],b['guard_key']),rows=BY_SPEC['get'](k);if(rows===undefined)BY_SPEC['set'](k,[b]);else rows['push'](b);}function specKey(a,c){return a+'\x00'+c;}export function bindingsFor(a,c){return BY_SPEC['get'](specKey(a,c))??[];}export function hasMsKnobBinding(a,c){const d=msKnobOf(c);return d!==undefined&&FEE_PARAM_BINDINGS['some'](e=>e['template']===a&&e['param']===d);}export function hoursParamFractionSafe(a,c){const d=FEE_PARAM_BINDINGS['filter'](e=>e['template']===a&&e['param']===c);return d['length']>0x0&&d['every'](e=>e['scale']!==undefined);}export function applyFeeParamBindings(a,c,d,e,f){const g=BY_SPEC['get'](specKey(c,d));if(g===undefined)return a;let h=a;for(const i of g){const j=e[i['param']],l=j??f?.[i['param']];if(l===undefined||l===null)continue;const o=typeof l==='number'?l:Number(l);if(!Number['isFinite'](o))continue;let p=o;const q=i['plus']===undefined?[]:typeof i['plus']==='string'?[i['plus']]:i['plus'];let r=!![];for(const s of q){const t=e[s]??f?.[s],u=typeof t==='number'?t:Number(t);if(t===undefined||t===null||!Number['isFinite'](u)){r=![];break;}p+=u;}if(!r)continue;h={...h??{},[i['to']]:i['scale']===undefined?p:Math['round'](p*i['scale'])};}return h;}export function feeParamBindingIssues(a,c){const d=[],e=new Map(a['map'](f=>[f['id'],f]));for(const f of FEE_PARAM_BINDINGS){if(f['ms_variant']===!![])continue;const h=e['get'](f['template']);if(h===undefined){d['push']({'binding':f,'problem':'template\x20\x27'+f['template']+'\x27\x20does\x20not\x20exist'});continue;}const i=h['fee_params'][f['param']];if(i===undefined){d['push']({'binding':f,'problem':'fee_param\x20\x27'+f['param']+'\x27\x20is\x20not\x20declared\x20by\x20'+f['template']});continue;}if(f['plus']!==undefined){const q=typeof f['plus']==='string'?[f['plus']]:f['plus'],r=q['filter'](s=>h['fee_params'][s]===undefined);if(r['length']>0x0){d['push']({'binding':f,'problem':'fee_param\x20\x27'+r['join']('\x27,\x20\x27')+'\x27\x20(plus)\x20is\x20not\x20declared\x20by\x20'+f['template']});continue;}}const j=h['guards']['find'](s=>s['key']===f['guard_key']);if(j===undefined){d['push']({'binding':f,'problem':'guard\x20key\x20\x27'+f['guard_key']+'\x27\x20is\x20not\x20declared\x20by\x20'+f['template']});continue;}const l=f['plus']===undefined?[]:typeof f['plus']==='string'?[f['plus']]:f['plus'];let m=f['scale']===undefined?Number(i):Math['round'](Number(i)*f['scale']),n=!![];for(const s of l){const u=h['fee_params'][s];if(u===undefined){n=![];break;}m+=f['scale']===undefined?Number(u):Math['round'](Number(u)*f['scale']);}if(!n)continue;if(f['no_author_literal']===!![])continue;const o=j['params']?.[f['to']];if(o!==undefined){Number(o)!==m&&d['push']({'binding':f,'problem':'literal\x20'+f['to']+'='+String(o)+'\x20!=\x20fee_param\x20'+f['param']+'='+String(i)+'\x20x\x20'+String(f['scale']??0x1)+'\x20('+m+')'});continue;}const p=c(j['template_id'],f['to']);if(p===undefined)d['push']({'binding':f,'problem':'guard\x20'+j['template_id']+'\x20declares\x20no\x20param\x20\x27'+f['to']+'\x27'});else Number(p)!==Number(i)&&d['push']({'binding':f,'problem':'guard\x20'+j['template_id']+'\x20default\x20'+f['to']+'='+p+'\x20!=\x20fee_param\x20'+f['param']+'='+String(i)+'\x20(no\x20literal\x20to\x20compare)'});}return d;}
1
+ import{MS_PER_DAY,MS_PER_HOUR,TIME_GUARD_INSTANTIATIONS,TWIN_PARAM,msKnobOf,unitScale}from'./pattern-resolutions.js';const HAND_WRITTEN_BINDINGS=[{'template':'delivery/restaurant-marketplace','guard_key':'reopen_window','param':'reopen_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'once-only\x20keeper\x20reopen\x20window\x20after\x20the\x20FIRST\x20reviewed\x20entry'},{'template':'group_buy/platform-supplied-pickup','guard_key':'reopen_window','param':'reopen_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'once-only\x20keeper\x20reopen\x20window\x20after\x20the\x20FIRST\x20reviewed\x20entry'},{'template':'delivery/restaurant-marketplace','guard_key':'review_edit','param':'review_edit_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'review\x20amendment\x20window\x20—\x20how\x20long\x20after\x20submitting\x20the\x20review\x20the\x20buyer\x20may\x20append\x20amendments\x20(stage2\x20#1\x20P-10;\x20FIRST-anchored,\x20never\x20re-arms)'},{'template':'delivery/restaurant-marketplace','guard_key':'late_compensation','param':'dispatch_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'late-delivery\x20evidence:\x20delivered-minus-picked_up\x20history\x20delta\x20must\x20meet\x20the\x20promised\x20dispatch\x20window'},{'template':'delivery/on-demand-errand','guard_key':'late_compensation','param':'promise_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'late-delivery\x20evidence:\x20delivered-minus-picked_up\x20history\x20delta\x20must\x20meet\x20the\x20promised\x20delivery\x20window\x20(stage2\x20#20\x20N-02)'},{'template':'retail/warehouse-club','guard_key':'late_delivery_breach','param':'sla_late_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'W-1\x20late-delivery\x20evidence:\x20delivered-minus-shipped\x20history\x20delta\x20must\x20meet\x20the\x20promised\x20SLA\x20window\x20(F-049\x20form)'},{'template':'delivery/restaurant-marketplace','guard_key':'deliver_confirm_timeout','param':'auto_confirm_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'buyer\x20silence\x20window'},{'template':'delivery/restaurant-marketplace','guard_key':'claim_filed','param':'claim_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'serial\x20claim\x20window\x20closes'},{'template':'delivery/restaurant-marketplace','guard_key':'settle_window_gate','param':'settle_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'settlement\x20opens'},{'template':'delivery/restaurant-marketplace','guard_key':'cancel_no_capacity','param':'dispatch_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'dispatch\x20timeout\x20—\x20penalty-free\x20platform\x20force-cancel\x20(INV-FD-2)'},{'template':'delivery/restaurant-marketplace','guard_key':'accept_timeout','param':'accept_timeout_minutes','to':'duration_ms','scale':0xea60,'note':'accept\x20timeout\x20—\x20keeper\x20force-cancel\x20into\x20the\x20full-refund\x20terminal\x20when\x20the\x20kitchen\x20never\x20accepts\x20(stage2\x20#1\x20P-01)'},{'template':'delivery/restaurant-marketplace','guard_key':'ready_timeout','param':'prep_window_minutes','to':'duration_ms','scale':0xea60,'note':'prep\x20timeout\x20—\x20keeper\x20force-cancel\x20into\x20the\x20full-refund\x20terminal\x20when\x20the\x20kitchen\x20never\x20marks\x20ready\x20(stage2\x20#1\x20P-02)'},{'template':'delivery/restaurant-marketplace','guard_key':'failed_contact','param':'failed_contact_wait_minutes','to':'duration_ms','scale':0xea60,'note':'failed-contact\x20wait\x20—\x20how\x20long\x20a\x20delivered\x20order\x20may\x20sit\x20silent\x20before\x20the\x20keeper\x20returns\x20it\x20to\x20the\x20store\x20(stage2\x20#1\x20P-05)'},{'template':'delivery/restaurant-marketplace','guard_key':'redeliver_timeout','param':'redelivery_window_minutes','to':'duration_ms','scale':0xea60,'note':'redelivery\x20window\x20—\x20how\x20long\x20a\x20promised\x20second\x20ride\x20may\x20stay\x20open\x20before\x20the\x20keeper\x20refunds\x20in\x20full\x20(stage2\x20#1\x20P-07)'},{'template':'group_buy/platform-supplied-pickup','guard_key':'unclaimed_refund','param':'pickup_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'unclaimed\x20order\x20refunds'},{'template':'group_buy/platform-supplied-pickup','guard_key':'unclaimed_settle_open','param':'pickup_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'settlement\x20opens\x20after\x20pickup\x20window'},{'template':'group_buy/platform-supplied-pickup','guard_key':'unclaimed_refund_late','param':'pickup_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'keeper\x20late\x20refund\x20after\x20the\x20pickup\x20window\x20(the\x20refund_buyer\x20DEFAULT\x20exit,\x20dmcx\x20F-23)'},{'template':'group_buy/platform-supplied-pickup','guard_key':'claim_filed','param':'claim_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'serial\x20claim\x20window\x20closes'},{'template':'group_buy/platform-supplied-pickup','guard_key':'settle_window_gate','param':'settle_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'settlement\x20opens'},{'template':'group_buy/platform-supplied-pickup','guard_key':'return_window_pickup','param':'return_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'return\x20window\x20after\x20pickup'},{'template':'group_buy/platform-supplied-pickup','guard_key':'return_window_claim','param':'return_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'return\x20window\x20from\x20the\x20serial\x20claim\x20window\x20(M-T2:\x20the\x20keeper\x20can\x20open\x20claim_window\x20before\x20pickup\x20—\x20the\x20buyer\x20keeps\x20the\x20same\x20filing\x20right\x20from\x20THAT\x20rest\x20state)'},{'template':'group_buy/leader-sourced-community','guard_key':'return_window_delivered','param':'return_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'return\x20window\x20after\x20delivery'},{'template':'group_buy/leader-sourced-community','guard_key':'return_window_claim','param':'return_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'return\x20window\x20from\x20the\x20serial\x20claim\x20window\x20(M-T2:\x20distinct\x20edge,\x20own\x20key)'},{'template':'group_buy/leader-sourced-community','guard_key':'shortfall_claim','param':'return_window_hours','to':'duration_ms','scale':MS_PER_HOUR,'note':'shortfall\x20(missing-items)\x20filing\x20window\x20—\x20the\x20SAME\x20after-sales\x20policy\x20as\x20the\x20return\x20twins\x20(the\x20author\x20literal\x20was\x20decorative\x20without\x20this\x20row)'},{'template':'freelance/catalog-tiers','guard_key':'requirements_timeout_48h','param':'requirements_timeout_hours','to':'confirm_timeout_hours','no_author_literal':!![],'note':'order.time-anchored\x20entry-abandon\x20+\x20requirements\x20lock:\x20hours\x20land\x20verbatim,\x20the\x20twin\x20multiplies\x20on-chain\x20(cstc\x20fix-up)'},{'template':'retail/vertical-handmade','guard_key':'return_window','param':'settlement_delay_days','to':'claim_window_days','note':'settle\x20delay\x20doubles\x20as\x20the\x20return\x20window\x20anchor'},{'template':'retail/vertical-handmade','guard_key':'review_window','param':'review_window_days','to':'duration_ms','scale':MS_PER_DAY,'note':'review\x20window'},{'template':'group_buy/platform-supplied-pickup','guard_key':'return_transit_timeout','param':'return_transit_days','to':'duration_ms','scale':MS_PER_DAY,'note':'return\x20transit\x20deadline'},{'template':'group_buy/leader-sourced-community','guard_key':'return_transit_timeout','param':'return_transit_days','to':'duration_ms','scale':MS_PER_DAY,'note':'return\x20transit\x20deadline'},{'template':'education/mooc-degree','guard_key':'review_window','param':'review_window_days','to':'duration_ms','scale':MS_PER_DAY,'note':'student\x20review\x20deadline\x20window'},{'template':'education/mooc-degree','guard_key':'cert_claim_gate','param':'cert_completion_threshold_bps','to':'cert_completion_threshold_bps','no_author_literal':!![],'note':'certificate-claim\x20completion\x20floor'},{'template':'education/mooc-single-course','guard_key':'cert_claim_gate','param':'cert_completion_threshold_bps','to':'cert_completion_threshold_bps','no_author_literal':!![],'note':'certificate-claim\x20completion\x20floor'},{'template':'retail/vertical-handmade','guard_key':'arb_refund','param':'arb_indemnity_floor_bps','to':'min_indemnity_floor','no_author_literal':!![],'note':'won-rail\x20award\x20floor\x20(delivered-entry\x20ruling)'},{'template':'retail/vertical-handmade','guard_key':'arb_refund_filed','param':'arb_indemnity_floor_bps','to':'min_indemnity_floor','no_author_literal':!![],'note':'won-rail\x20award\x20floor\x20(recorded-claim\x20ruling)'},{'template':'retail/vertical-handmade','guard_key':'arb_refund_return','param':'arb_indemnity_floor_bps','to':'min_indemnity_floor','no_author_literal':!![],'note':'won-rail\x20award\x20floor\x20(return-escalation\x20ruling)'},{'template':'group_buy/platform-supplied-pickup','guard_key':'arb_refund','param':'arb_indemnity_floor_bps','to':'min_indemnity_floor','no_author_literal':!![],'note':'won-rail\x20award\x20floor\x20(recorded-claim\x20ruling)'},{'template':'group_buy/platform-supplied-pickup','guard_key':'arb_refund_return','param':'arb_indemnity_floor_bps','to':'min_indemnity_floor','no_author_literal':!![],'note':'won-rail\x20award\x20floor\x20(return-escalation\x20ruling)'},{'template':'freelance/agent-task','guard_key':'auto_release','param':'evaluation_window_days','to':'claim_window_days','note':'auto-release\x20window'},{'template':'licensing/royalty-stream-auction','guard_key':'inspection_timeout','param':'inspection_window_days','to':'claim_window_days','note':'inspection\x20deadline'},{'template':'licensing/royalty-stream-auction','guard_key':'return_window','param':'inspection_window_days','to':'claim_window_days','note':'inspection\x20doubles\x20as\x20the\x20return\x20window'},{'template':'licensing/royalty-stream-auction','guard_key':'cancel_return','param':'inspection_window_days','to':'claim_window_days','note':'inspection\x20doubles\x20as\x20the\x20cancel\x20window'},{'template':'licensing/asset-license-metered','guard_key':'delivery_timeout','param':'delivery_window_days','to':'claim_window_days','note':'delivery\x20deadline'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'review_window','param':'review_window_days','to':'claim_window_days','note':'review\x20window'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'return_window','param':'return_window_days','to':'claim_window_days','note':'return\x20window'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'claim_filed','param':'return_window_days','to':'claim_window_days','note':'dispute-filing\x20window\x20—\x20races\x20the\x20return\x20window\x20on\x20ONE\x20clock'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'settle_clock','param':'settlement_delay_days','to':'claim_window_days','note':'settle\x20delay\x20after\x20delivery'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'review_settle_clock','param':'settlement_delay_days','to':'claim_window_days','note':'settle\x20delay\x20after\x20review'},{'template':'freelance/catalog-tiers','guard_key':'instant_cancel_24h','param':'instant_cancel_hours','to':'free_cancel_hours','note':'buyer\x20instant-cancel\x20window\x20(order.time\x20anchor)'},{'template':'travel/global-ota','guard_key':'no_show_evidence','param':'no_show_floor_hours','to':'not_before_hours','note':'no-show\x20evidence\x20floor'},{'template':'travel/global-ota','guard_key':'review_claim','param':'reward_claim_closes_after_days','to':'closes_after_days','note':'bounty\x20claim\x20deadline'},{'template':'subscription/direct-fan-subscription','guard_key':'reward_claim','param':'reward_claim_closes_after_days','to':'closes_after_days','note':'bounty\x20claim\x20deadline'},{'template':'licensing/royalty-stream-auction','guard_key':'review_claim','param':'reward_claim_closes_after_days','to':'closes_after_days','note':'bounty\x20claim\x20deadline'},{'template':'licensing/asset-license-metered','guard_key':'review_claim','param':'reward_claim_closes_after_days','to':'closes_after_days','note':'bounty\x20claim\x20deadline'},{'template':'travel/global-ota','guard_key':'review_claim','param':'reward_claim_opens_after_ms','to':'opens_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20opens\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13)'},{'template':'travel/global-ota','guard_key':'review_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13)'},{'template':'subscription/direct-fan-subscription','guard_key':'reward_claim','param':'reward_claim_opens_after_ms','to':'opens_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20opens\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13)'},{'template':'subscription/direct-fan-subscription','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13)'},{'template':'licensing/royalty-stream-auction','guard_key':'review_claim','param':'reward_claim_opens_after_ms','to':'opens_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20opens\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13)'},{'template':'licensing/royalty-stream-auction','guard_key':'review_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13)'},{'template':'licensing/asset-license-metered','guard_key':'review_claim','param':'reward_claim_opens_after_ms','to':'opens_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20opens\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13)'},{'template':'licensing/asset-license-metered','guard_key':'review_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13)'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'reward_claim','param':'reward_claim_opens_after_ms','to':'opens_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20opens\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13)'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13)'},{'template':'retail/scale-marketplace','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'retail/vertical-handmade','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'freelance/enterprise-talent-market','guard_key':'reward_claim','param':'reward_claim_opens_after_ms','to':'opens_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20opens\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'freelance/enterprise-talent-market','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'freelance/catalog-tiers','guard_key':'reward_claim','param':'reward_claim_opens_after_ms','to':'opens_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20opens\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'freelance/catalog-tiers','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'freelance/creator-zero-commission','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'freelance/design-contest','guard_key':'reward_claim','param':'reward_claim_opens_after_ms','to':'opens_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20opens\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'freelance/design-contest','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'rental/p2p-shortstay','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'rental/institutional-longstay','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'education/mooc-degree','guard_key':'reward_claim','param':'reward_claim_opens_after_ms','to':'opens_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20opens\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'education/mooc-degree','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'education/live-class-cohort','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'education/mooc-single-course','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'travel/destination-experience','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'subscription/creator-membership','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion)'},{'template':'delivery/on-demand-errand','guard_key':'reward_claim','param':'reward_claim_opens_after_ms','to':'opens_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20opens\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion;\x20kernel-injected\x20reward\x20guard)'},{'template':'delivery/on-demand-errand','guard_key':'reward_claim','param':'reward_claim_closes_after_ms','to':'closes_after_ms','ms_variant':!![],'note':'sub-day\x20bounty\x20close\x20twin\x20(cstc\x20A10\x20/\x20algr\x20F-13\x20completion;\x20kernel-injected\x20reward\x20guard)'},{'template':'retail/restock-supply','guard_key':'settle_alloc','param':'settlement_days','to':'claim_window_days','note':'serial\x20release\x20clock\x20on\x20the\x20allocator\x20(no\x20settlement\x20forward\x20exists)'},{'template':'travel/destination-experience','guard_key':'cancel_tier_1','param':'cancel_tier_1_boundary_hours','to':'lower_hours','note':'tier-1\x20lower\x20band\x20edge\x20(7\x20days\x20by\x20default)'},{'template':'travel/destination-experience','guard_key':'cancel_tier_2','param':'cancel_tier_1_boundary_hours','to':'upper_hours','note':'tier-1/tier-2\x20seam'},{'template':'travel/destination-experience','guard_key':'cancel_tier_2','param':'cancel_tier_2_boundary_hours','to':'lower_hours','note':'tier-2\x20lower\x20band\x20edge\x20(3\x20days\x20by\x20default)'},{'template':'travel/destination-experience','guard_key':'cancel_tier_3','param':'cancel_tier_2_boundary_hours','to':'upper_hours','note':'tier-2/tier-3\x20seam'},{'template':'travel/destination-experience','guard_key':'cancel_tier_3','param':'cancel_tier_3_boundary_hours','to':'lower_hours','note':'tier-3\x20lower\x20band\x20edge\x20(1\x20day\x20by\x20default)'},{'template':'travel/destination-experience','guard_key':'cancel_tier_4','param':'cancel_tier_3_boundary_hours','to':'upper_hours','note':'tier-3/tier-4\x20seam'},{'template':'crowdfunding/reward-campaign-fulfillment','guard_key':'reward_claim','param':'reward_claim_closes_after_days','to':'closes_after_days','note':'bounty\x20claim\x20deadline'},{'template':'freelance/catalog-tiers','guard_key':'post_accept_refund_window','param':'post_accept_refund_days','plus':'escrow_release_days','to':'claim_window_days','note':'post-acceptance\x20refund\x20mirror\x20=\x20auto-accept\x20window\x20+\x20grace\x20(delivered\x20anchor;\x207+14=21)'},{'template':'freelance/catalog-tiers','guard_key':'post_accept_revision_window','param':'post_accept_refund_days','plus':'escrow_release_days','to':'claim_window_days','note':'post-acceptance\x20revision\x20mirror\x20—\x20SAME\x20window\x20policy\x20as\x20the\x20refund\x20twin\x20(distinct\x20edge,\x20own\x20key)'},{'template':'freelance/enterprise-talent-market','guard_key':'cancel_band_full','param':'cancel_band_1_boundary_bps','to':'ceiling_bps','note':'band\x20A/B\x20seam\x20—\x20full-refund\x20band\x27s\x20exclusive\x20ceiling'},{'template':'freelance/enterprise-talent-market','guard_key':'cancel_band_half','param':'cancel_band_1_boundary_bps','to':'floor_bps','note':'band\x20A/B\x20seam\x20—\x20half-split\x20band\x27s\x20inclusive\x20floor\x20(bit-identical\x20to\x20band\x20A\x27s\x20ceiling)'},{'template':'freelance/enterprise-talent-market','guard_key':'cancel_band_half','param':'cancel_band_2_boundary_bps','to':'ceiling_bps','note':'band\x20B/C\x20seam\x20—\x20half-split\x20band\x27s\x20exclusive\x20ceiling'},{'template':'freelance/enterprise-talent-market','guard_key':'cancel_band_post','param':'cancel_band_2_boundary_bps','to':'floor_bps','note':'band\x20B/C\x20seam\x20—\x20completion-value\x20band\x27s\x20inclusive\x20floor\x20(bit-identical\x20to\x20band\x20B\x27s\x20ceiling)'},{'template':'freelance/enterprise-talent-market','guard_key':'cancel_band_post','param':'cancel_band_top_ceiling_bps','to':'ceiling_bps','note':'closure\x20sentinel\x20—\x20exclusive\x20ceiling\x20past\x20the\x2010000\x20bps\x20axis\x20(>=\x2010001;\x20R-RATE-TIER-GAP)'}];function derivedRows(){const a=[];for(const c of TIME_GUARD_INSTANTIATIONS){if(c['anchor_kind']==='order_time')continue;const d=c['days']!==undefined?'days':c['hours']!==undefined?'hours':undefined;if(d===undefined)continue;a['push']({'template':c['template'],'guard_key':c['guard_key'],'param':c['days']??c['hours'],'to':TWIN_PARAM[d],'scale':unitScale(d),...c['plus_days']!==undefined?{'plus':c['plus_days']}:{},'no_author_literal':!![],'note':c['note']});const e=msKnobOf(c['days']??c['hours']);if(e===undefined)continue;const f=c['plus_days']===undefined?[]:typeof c['plus_days']==='string'?[c['plus_days']]:[...c['plus_days']],g=[];let h=!![];for(const i of f){const j=msKnobOf(i);if(j===undefined){h=![];break;}g['push'](j);}if(!h)continue;a['push']({'template':c['template'],'guard_key':c['guard_key'],'param':e,'to':'duration_ms','scale':0x1,...g['length']>0x0?{'plus':g}:{},'no_author_literal':!![],'ms_variant':!![],'note':c['note']+'\x20—\x20the\x20*_ms\x20knob\x27s\x20ms-slot-pair\x20landing\x20(nnd4\x20F-04:\x20duration_ms\x20beside\x20a\x20day-factor\x20of\x201)'});}return a;}export const FEE_PARAM_BINDINGS=[...HAND_WRITTEN_BINDINGS,...derivedRows()];const BY_SPEC=new Map();for(const b of FEE_PARAM_BINDINGS){const k=specKey(b['template'],b['guard_key']),rows=BY_SPEC['get'](k);if(rows===undefined)BY_SPEC['set'](k,[b]);else rows['push'](b);}function specKey(a,c){return a+'\x00'+c;}export function bindingsFor(a,c){return BY_SPEC['get'](specKey(a,c))??[];}export function hasMsKnobBinding(a,c){const d=msKnobOf(c);return d!==undefined&&FEE_PARAM_BINDINGS['some'](e=>e['template']===a&&e['param']===d);}export function hoursParamFractionSafe(a,c){return timeParamFractionSafe(a,c);}const FOLDED_TIME_LANDINGS=new Set(['duration_ms','claim_window_days','opens_after_days','closes_after_days','confirm_timeout_hours','free_cancel_hours','lower_hours','upper_hours']);export function timeParamFractionSafe(a,c){const d=FEE_PARAM_BINDINGS['filter'](e=>e['template']===a&&e['param']===c);return d['every'](e=>FOLDED_TIME_LANDINGS['has'](e['to']));}export function applyFeeParamBindings(a,c,d,e,f){const g=BY_SPEC['get'](specKey(c,d));if(g===undefined)return a;let h=a;for(const i of g){const j=e[i['param']],l=j??f?.[i['param']];if(l===undefined||l===null)continue;const o=typeof l==='number'?l:Number(l);if(!Number['isFinite'](o))continue;let p=o;const q=i['plus']===undefined?[]:typeof i['plus']==='string'?[i['plus']]:i['plus'];let r=!![];for(const t of q){const u=e[t]??f?.[t],v=typeof u==='number'?u:Number(u);if(u===undefined||u===null||!Number['isFinite'](v)){r=![];break;}p+=v;}if(!r)continue;const s=i['scale']===undefined||i['scale']===0x1;h={...h??{},[i['to']]:s?p:Math['round'](p*i['scale'])};}return h;}export function feeParamBindingIssues(a,c){const d=[],e=new Map(a['map'](f=>[f['id'],f]));for(const f of FEE_PARAM_BINDINGS){if(f['ms_variant']===!![])continue;const h=e['get'](f['template']);if(h===undefined){d['push']({'binding':f,'problem':'template\x20\x27'+f['template']+'\x27\x20does\x20not\x20exist'});continue;}const i=h['fee_params'][f['param']];if(i===undefined){d['push']({'binding':f,'problem':'fee_param\x20\x27'+f['param']+'\x27\x20is\x20not\x20declared\x20by\x20'+f['template']});continue;}if(f['plus']!==undefined){const r=typeof f['plus']==='string'?[f['plus']]:f['plus'],s=r['filter'](u=>h['fee_params'][u]===undefined);if(s['length']>0x0){d['push']({'binding':f,'problem':'fee_param\x20\x27'+s['join']('\x27,\x20\x27')+'\x27\x20(plus)\x20is\x20not\x20declared\x20by\x20'+f['template']});continue;}}const j=h['guards']['find'](u=>u['key']===f['guard_key']);if(j===undefined){d['push']({'binding':f,'problem':'guard\x20key\x20\x27'+f['guard_key']+'\x27\x20is\x20not\x20declared\x20by\x20'+f['template']});continue;}const l=f['plus']===undefined?[]:typeof f['plus']==='string'?[f['plus']]:f['plus'],m=f['scale']===undefined||f['scale']===0x1;let n=m?Number(i):Math['round'](Number(i)*f['scale']),o=!![];for(const u of l){const w=h['fee_params'][u];if(w===undefined){o=![];break;}n+=m?Number(w):Math['round'](Number(w)*f['scale']);}if(!o)continue;if(f['no_author_literal']===!![])continue;const p=j['params']?.[f['to']];if(p!==undefined){Number(p)!==n&&d['push']({'binding':f,'problem':'literal\x20'+f['to']+'='+String(p)+'\x20!=\x20fee_param\x20'+f['param']+'='+String(i)+'\x20x\x20'+String(f['scale']??0x1)+'\x20('+n+')'});continue;}const q=c(j['template_id'],f['to']);if(q===undefined)d['push']({'binding':f,'problem':'guard\x20'+j['template_id']+'\x20declares\x20no\x20param\x20\x27'+f['to']+'\x27'});else Number(q)!==Number(i)&&d['push']({'binding':f,'problem':'guard\x20'+j['template_id']+'\x20default\x20'+f['to']+'='+q+'\x20!=\x20fee_param\x20'+f['param']+'='+String(i)+'\x20(no\x20literal\x20to\x20compare)'});}return d;}
@@ -1 +1 @@
1
- import*as a208a from'fs';import*as a208b from'os';import*as a208c from'path';export const SKILLS_PACKAGE='@wowok'+'/skills';export const SKILLS_INSTALL_COMMAND='npm\x20install\x20-g\x20@wowok'+'/skills';export const SKILLS_DOCTOR_COMMAND='wowok-skills\x20doctor';export const SKILLS_REPAIR_COMMAND='wowok-skills\x20init\x20--force';export const COLD_START_SECONDS=0x14;export const SKILL_ROLES=['wowok-onboard','wowok-provider','wowok-order','wowok-supplier','wowok-collaborator','wowok-machine','wowok-arbitrator','wowok-messenger','wowok-market','wowok-governance','wowok-planner','wowok-auditor','wowok-output'];export const COMMON_GOALS=[{'goal':'Onboard\x20a\x20new\x20merchant\x20and\x20publish\x20a\x20commercial\x20service\x20end-to-end','skills':['wowok-onboard','wowok-provider'],'tools':['goal_operation','onchain_operations','query_toolkit']},{'goal':'Design\x20or\x20modify\x20a\x20Machine\x20workflow\x20(nodes,\x20forwards,\x20guards)','skills':['wowok-machine','wowok-auditor'],'tools':['onchain_operations','machineNode2file','guard2file']},{'goal':'Evaluate\x20or\x20buy\x20a\x20service\x20/\x20handle\x20an\x20in-order\x20customer\x20lifecycle','skills':['wowok-order'],'tools':['query_toolkit','onchain_operations','messenger_operation']},{'goal':'Fulfill\x20a\x20sub-order\x20as\x20a\x20supplier\x20and\x20collect\x20settlement','skills':['wowok-supplier','wowok-collaborator'],'tools':['watch_operation','workflow_operation','keeper_operation']},{'goal':'Operate\x20order\x20workflows\x20/\x20advance\x20progress\x20on\x20behalf\x20of\x20a\x20merchant','skills':['wowok-collaborator'],'tools':['workflow_operation','watch_operation','keeper_operation']},{'goal':'Handle\x20a\x20dispute\x20or\x20run\x20an\x20arbitration\x20service','skills':['wowok-arbitrator','wowok-messenger'],'tools':['evaluation_operation','onchain_operations','messenger_operation']},{'goal':'Govern\x20permissions,\x20treasury\x20funds\x20and\x20the\x20on-chain\x20profile\x20after\x20setup','skills':['wowok-governance'],'tools':['permission_operation','onchain_operations','query_toolkit']},{'goal':'Obtain\x20WOW\x20gas\x20/\x20payment\x20tokens\x20before\x20the\x20first\x20transaction','skills':['wowok-onboard'],'tools':['wowok_buildin_info','bridge_operation','account_operation']}];function candidateSkillRoots(a){const b=a208b['homedir'](),c=[a208c['join'](b,'.claude','skills'),a208c['join'](b,'.agents','skills'),a208c['join'](b,'.codex','skills'),a208c['join'](b,'.cursor','skills'),a208c['join'](b,'.codebuddy','skills'),a208c['join'](b,'.kilo','skills'),a208c['join'](b,'.roo','skills'),a208c['join'](b,'.cline','skills'),a208c['join'](b,'.copilot','skills'),a208c['join'](b,'.codeium','windsurf','skills'),a208a['existsSync'](a208c['join'](b,'.trae-cn','skills'))?a208c['join'](b,'.trae-cn','skills'):a208c['join'](b,'.trae','skills')],d=['.agents/skills','.claude/skills','.cursor/skills','.trae/skills','.codebuddy/skills','.roo/skills','.cline/skills','.kilo/skills','.github/skills']['map'](e=>a208c['resolve'](a,e));return[...new Set([...c,...d])];}function rootHasWowokSkill(a){let b;try{b=a208a['readdirSync'](a,{'withFileTypes':!![]});}catch{return![];}if(b['some'](c=>c['isFile']()&&c['name']==='.wowok-skills.json'))return!![];return b['some'](c=>c['isDirectory']()&&c['name']['startsWith']('wowok-'));}export function detectInstalledSkills(a=process['cwd']()){const b=[];for(const c of candidateSkillRoots(a)){try{if(rootHasWowokSkill(c))b['push'](c);}catch{}}return{'status':b['length']>0x0?'detected':'not_detected','detected_roots':b};}export function getGettingStarted(a=process['cwd']()){return{'skills':{'what':'WoWok\x20Skills\x20are\x20role-based\x20playbooks\x20(SKILL.md\x20files\x20installed\x20into\x20AI\x20clients)\x20that\x20sit\x20on\x20top\x20of\x20this\x20MCP\x20server.\x20The\x20MCP\x20exposes\x20the\x20tools;\x20the\x20skills\x20tell\x20an\x20agent\x20WHEN\x20and\x20in\x20what\x20ORDER\x20to\x20use\x20them\x20for\x20complex\x20goals\x20(onboarding,\x20buying,\x20fulfillment,\x20arbitration,\x20governance),\x20and\x20materially\x20reduce\x20failed\x20calls.\x20This\x20server\x20works\x20without\x20them;\x20with\x20them\x20loaded,\x20agents\x20start\x20from\x20structured\x20guidance\x20instead\x20of\x20discovering\x20sub-tools\x20by\x20trial\x20and\x20error.','package':SKILLS_PACKAGE,'recommended':!![],'install_command':SKILLS_INSTALL_COMMAND,'doctor_command':SKILLS_DOCTOR_COMMAND,'repair_command':SKILLS_REPAIR_COMMAND,'detection':detectInstalledSkills(a),'detection_note':'Best-effort\x20scan\x20of\x20standard\x20client\x20skill\x20roots\x20on\x20this\x20machine.\x20`wowok-skills\x20doctor`\x20is\x20authoritative\x20and\x20also\x20reports\x20MCP\x20registration\x20state\x20per\x20client.\x20If\x20detection\x20says\x20not_detected\x20but\x20skills\x20were\x20installed\x20for\x20a\x20client\x20with\x20a\x20non-standard\x20root,\x20trust\x20doctor.','roles':[...SKILL_ROLES]},'cold_start':{'ready_seconds':COLD_START_SECONDS,'note':'The\x20first\x20call\x20after\x20the\x20server\x20boots\x20can\x20take\x20around\x2020\x20seconds\x20while\x20@wowok/agent-mcp\x20is\x20bootstrapped\x20(especially\x20via\x20npx\x20on\x20Windows).\x20A\x20transport\x20timeout\x20on\x20the\x20FIRST\x20call\x20is\x20startup\x20latency,\x20not\x20a\x20broken\x20server\x20—\x20wait\x20and\x20retry;\x20subsequent\x20calls\x20are\x20fast.\x20Never\x20interpret\x20a\x20delayed\x20first\x20response\x20as\x20a\x20failed\x20on-chain\x20transaction.'},'common_goals':COMMON_GOALS['map'](b=>({...b,'skills':[...b['skills']],'tools':[...b['tools']]})),'first_calls':['wowok_buildin_info\x20info=\x27getting\x20started\x27\x20—\x20this\x20orientation','wowok_buildin_info\x20info=\x27current\x20network\x27\x20—\x20which\x20chain\x20(mainnet/testnet)\x20the\x20SDK\x20defaults\x20to','wowok_buildin_info\x20info=\x27funding\x20guidance\x27\x20—\x20testnet\x20faucet\x20/\x20mainnet\x20bridge\x20/\x20airdrop','wowok_buildin_info\x20info=\x27upgrade_check\x27\x20—\x20whether\x20the\x20MCP\x20server\x20and\x20SDK\x20are\x20current','schema_query\x20action=\x27list\x27\x20—\x20enumerate\x20every\x20sub-tool\x20and\x20fetch\x20its\x20input\x20schema']};}
1
+ import*as a211a from'fs';import*as a211b from'os';import*as a211c from'path';export const SKILLS_PACKAGE='@wowok'+'/skills';export const SKILLS_INSTALL_COMMAND='npm\x20install\x20-g\x20@wowok'+'/skills';export const SKILLS_DOCTOR_COMMAND='wowok-skills\x20doctor';export const SKILLS_REPAIR_COMMAND='wowok-skills\x20init\x20--force';export const COLD_START_SECONDS=0x14;export const SKILL_ROLES=['wowok-onboard','wowok-provider','wowok-order','wowok-supplier','wowok-collaborator','wowok-machine','wowok-arbitrator','wowok-messenger','wowok-market','wowok-governance','wowok-planner','wowok-auditor','wowok-output'];export const COMMON_GOALS=[{'goal':'Onboard\x20a\x20new\x20merchant\x20and\x20publish\x20a\x20commercial\x20service\x20end-to-end','skills':['wowok-onboard','wowok-provider'],'tools':['goal_operation','onchain_operations','query_toolkit']},{'goal':'Design\x20or\x20modify\x20a\x20Machine\x20workflow\x20(nodes,\x20forwards,\x20guards)','skills':['wowok-machine','wowok-auditor'],'tools':['onchain_operations','machineNode2file','guard2file']},{'goal':'Evaluate\x20or\x20buy\x20a\x20service\x20/\x20handle\x20an\x20in-order\x20customer\x20lifecycle','skills':['wowok-order'],'tools':['query_toolkit','onchain_operations','messenger_operation']},{'goal':'Fulfill\x20a\x20sub-order\x20as\x20a\x20supplier\x20and\x20collect\x20settlement','skills':['wowok-supplier','wowok-collaborator'],'tools':['watch_operation','workflow_operation','keeper_operation']},{'goal':'Operate\x20order\x20workflows\x20/\x20advance\x20progress\x20on\x20behalf\x20of\x20a\x20merchant','skills':['wowok-collaborator'],'tools':['workflow_operation','watch_operation','keeper_operation']},{'goal':'Handle\x20a\x20dispute\x20or\x20run\x20an\x20arbitration\x20service','skills':['wowok-arbitrator','wowok-messenger'],'tools':['evaluation_operation','onchain_operations','messenger_operation']},{'goal':'Govern\x20permissions,\x20treasury\x20funds\x20and\x20the\x20on-chain\x20profile\x20after\x20setup','skills':['wowok-governance'],'tools':['permission_operation','onchain_operations','query_toolkit']},{'goal':'Obtain\x20WOW\x20gas\x20/\x20payment\x20tokens\x20before\x20the\x20first\x20transaction','skills':['wowok-onboard'],'tools':['wowok_buildin_info','bridge_operation','account_operation']}];function candidateSkillRoots(a){const b=a211b['homedir'](),c=[a211c['join'](b,'.claude','skills'),a211c['join'](b,'.agents','skills'),a211c['join'](b,'.codex','skills'),a211c['join'](b,'.cursor','skills'),a211c['join'](b,'.codebuddy','skills'),a211c['join'](b,'.kilo','skills'),a211c['join'](b,'.roo','skills'),a211c['join'](b,'.cline','skills'),a211c['join'](b,'.copilot','skills'),a211c['join'](b,'.codeium','windsurf','skills'),a211a['existsSync'](a211c['join'](b,'.trae-cn','skills'))?a211c['join'](b,'.trae-cn','skills'):a211c['join'](b,'.trae','skills')],d=['.agents/skills','.claude/skills','.cursor/skills','.trae/skills','.codebuddy/skills','.roo/skills','.cline/skills','.kilo/skills','.github/skills']['map'](e=>a211c['resolve'](a,e));return[...new Set([...c,...d])];}function rootHasWowokSkill(a){let b;try{b=a211a['readdirSync'](a,{'withFileTypes':!![]});}catch{return![];}if(b['some'](c=>c['isFile']()&&c['name']==='.wowok-skills.json'))return!![];return b['some'](c=>c['isDirectory']()&&c['name']['startsWith']('wowok-'));}export function detectInstalledSkills(a=process['cwd']()){const b=[];for(const c of candidateSkillRoots(a)){try{if(rootHasWowokSkill(c))b['push'](c);}catch{}}return{'status':b['length']>0x0?'detected':'not_detected','detected_roots':b};}export function getGettingStarted(a=process['cwd']()){return{'skills':{'what':'WoWok\x20Skills\x20are\x20role-based\x20playbooks\x20(SKILL.md\x20files\x20installed\x20into\x20AI\x20clients)\x20that\x20sit\x20on\x20top\x20of\x20this\x20MCP\x20server.\x20The\x20MCP\x20exposes\x20the\x20tools;\x20the\x20skills\x20tell\x20an\x20agent\x20WHEN\x20and\x20in\x20what\x20ORDER\x20to\x20use\x20them\x20for\x20complex\x20goals\x20(onboarding,\x20buying,\x20fulfillment,\x20arbitration,\x20governance),\x20and\x20materially\x20reduce\x20failed\x20calls.\x20This\x20server\x20works\x20without\x20them;\x20with\x20them\x20loaded,\x20agents\x20start\x20from\x20structured\x20guidance\x20instead\x20of\x20discovering\x20sub-tools\x20by\x20trial\x20and\x20error.','package':SKILLS_PACKAGE,'recommended':!![],'install_command':SKILLS_INSTALL_COMMAND,'doctor_command':SKILLS_DOCTOR_COMMAND,'repair_command':SKILLS_REPAIR_COMMAND,'detection':detectInstalledSkills(a),'detection_note':'Best-effort\x20scan\x20of\x20standard\x20client\x20skill\x20roots\x20on\x20this\x20machine.\x20`wowok-skills\x20doctor`\x20is\x20authoritative\x20and\x20also\x20reports\x20MCP\x20registration\x20state\x20per\x20client.\x20If\x20detection\x20says\x20not_detected\x20but\x20skills\x20were\x20installed\x20for\x20a\x20client\x20with\x20a\x20non-standard\x20root,\x20trust\x20doctor.','roles':[...SKILL_ROLES]},'cold_start':{'ready_seconds':COLD_START_SECONDS,'note':'The\x20first\x20call\x20after\x20the\x20server\x20boots\x20can\x20take\x20around\x2020\x20seconds\x20while\x20@wowok/agent-mcp\x20is\x20bootstrapped\x20(especially\x20via\x20npx\x20on\x20Windows).\x20A\x20transport\x20timeout\x20on\x20the\x20FIRST\x20call\x20is\x20startup\x20latency,\x20not\x20a\x20broken\x20server\x20—\x20wait\x20and\x20retry;\x20subsequent\x20calls\x20are\x20fast.\x20Never\x20interpret\x20a\x20delayed\x20first\x20response\x20as\x20a\x20failed\x20on-chain\x20transaction.'},'common_goals':COMMON_GOALS['map'](b=>({...b,'skills':[...b['skills']],'tools':[...b['tools']]})),'first_calls':['wowok_buildin_info\x20info=\x27getting\x20started\x27\x20—\x20this\x20orientation','wowok_buildin_info\x20info=\x27current\x20network\x27\x20—\x20which\x20chain\x20(mainnet/testnet)\x20the\x20SDK\x20defaults\x20to','wowok_buildin_info\x20info=\x27funding\x20guidance\x27\x20—\x20testnet\x20faucet\x20/\x20mainnet\x20bridge\x20/\x20airdrop','wowok_buildin_info\x20info=\x27upgrade_check\x27\x20—\x20whether\x20the\x20MCP\x20server\x20and\x20SDK\x20are\x20current','schema_query\x20action=\x27list\x27\x20—\x20enumerate\x20every\x20sub-tool\x20and\x20fetch\x20its\x20input\x20schema']};}