@wowok/agent-mcp 3.3.8 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/dist/chain-semantics/field-capability.js +1 -1
  2. package/dist/chain-semantics/freeze-map.js +1 -1
  3. package/dist/chain-semantics/fund-flow.js +1 -1
  4. package/dist/chain-semantics/guard-verbs.js +1 -1
  5. package/dist/chain-semantics/object-graph.js +1 -1
  6. package/dist/composition/audit.js +1 -1
  7. package/dist/composition/compile.d.ts +3 -2
  8. package/dist/composition/compile.js +1 -1
  9. package/dist/composition/inflight.d.ts +6 -0
  10. package/dist/composition/inflight.js +1 -1
  11. package/dist/composition/materialize.d.ts +4 -0
  12. package/dist/composition/materialize.js +1 -1
  13. package/dist/composition/param-disclosure.d.ts +61 -0
  14. package/dist/composition/param-disclosure.js +1 -0
  15. package/dist/composition/plan.d.ts +11 -1
  16. package/dist/composition/plan.js +1 -1
  17. package/dist/customer/account-events.js +1 -1
  18. package/dist/data/api/api.spec.js +1 -1
  19. package/dist/data/api/cli.js +1 -1
  20. package/dist/data/api/server.d.ts +1 -0
  21. package/dist/data/api/server.js +1 -1
  22. package/dist/data/projection/store.d.ts +2 -1
  23. package/dist/data/projection/store.js +1 -1
  24. package/dist/data/projection/types.d.ts +10 -0
  25. package/dist/data/sync/cdc.js +1 -1
  26. package/dist/data/sync/cdc.spec.js +1 -1
  27. package/dist/data/sync/store.d.ts +5 -0
  28. package/dist/data/sync/store.js +1 -1
  29. package/dist/data/sync/types.d.ts +2 -0
  30. package/dist/evaluation/builtins/graph-service.spec.js +1 -1
  31. package/dist/evaluation/engine.js +1 -1
  32. package/dist/evaluation/guard-scan.js +1 -1
  33. package/dist/experience/realtime-feedback.js +1 -1
  34. package/dist/extensions/business-modules.js +1 -1
  35. package/dist/extensions/industry-pack.js +1 -1
  36. package/dist/extensions/modes.js +1 -1
  37. package/dist/graph/onchain/expand.js +1 -1
  38. package/dist/graph/onchain/exposure.js +1 -1
  39. package/dist/harness/recover.js +1 -1
  40. package/dist/index.js +1 -1
  41. package/dist/knowledge/allocation-risk.js +1 -1
  42. package/dist/knowledge/allocation-templates.js +1 -1
  43. package/dist/knowledge/allocator-rail-verifier.js +1 -1
  44. package/dist/knowledge/arb-fund-facts.d.ts +1 -0
  45. package/dist/knowledge/arb-fund-facts.js +1 -1
  46. package/dist/knowledge/arbitration-ledger.js +1 -1
  47. package/dist/knowledge/arbitration-risk.d.ts +1 -0
  48. package/dist/knowledge/arbitration-risk.js +1 -1
  49. package/dist/knowledge/audit-rules.js +1 -1
  50. package/dist/knowledge/baselines/rules/allocation.json +6 -6
  51. package/dist/knowledge/baselines/rules/arb.json +2 -2
  52. package/dist/knowledge/baselines/rules/guard.json +11 -11
  53. package/dist/knowledge/baselines/rules/order.json +1 -1
  54. package/dist/knowledge/baselines/rules/plan.json +1 -1
  55. package/dist/knowledge/baselines/semantic-facts.js +1 -1
  56. package/dist/knowledge/builtin-templates.d.ts +14 -1
  57. package/dist/knowledge/builtin-templates.js +1 -1
  58. package/dist/knowledge/catalog-facts.d.ts +4 -0
  59. package/dist/knowledge/catalog-facts.js +1 -0
  60. package/dist/knowledge/commission-landing.js +1 -1
  61. package/dist/knowledge/component-schema.d.ts +64 -0
  62. package/dist/knowledge/component-schema.js +1 -0
  63. package/dist/knowledge/entity-recipient-guard.js +1 -1
  64. package/dist/knowledge/event-semantics.js +1 -1
  65. package/dist/knowledge/fee-param-bindings.d.ts +26 -0
  66. package/dist/knowledge/fee-param-bindings.js +1 -0
  67. package/dist/knowledge/fund-layer.js +1 -1
  68. package/dist/knowledge/getting-started.d.ts +2 -2
  69. package/dist/knowledge/getting-started.js +1 -1
  70. package/dist/knowledge/guard-anchor-reach.js +1 -1
  71. package/dist/knowledge/guard-design-patterns.js +1 -1
  72. package/dist/knowledge/guard-ledger.js +1 -1
  73. package/dist/knowledge/guard-lint.d.ts +1 -0
  74. package/dist/knowledge/guard-lint.js +1 -1
  75. package/dist/knowledge/guard-puzzle.js +1 -1
  76. package/dist/knowledge/guard-risk.js +1 -1
  77. package/dist/knowledge/guard-templates.d.ts +1 -1
  78. package/dist/knowledge/guard-templates.js +1 -1
  79. package/dist/knowledge/guard-translation.js +1 -1
  80. package/dist/knowledge/index.js +1 -1
  81. package/dist/knowledge/industry-registry.js +1 -1
  82. package/dist/knowledge/industry-strategy.js +1 -1
  83. package/dist/knowledge/jsonrpc-enum.d.ts +14 -3
  84. package/dist/knowledge/jsonrpc-enum.js +1 -1
  85. package/dist/knowledge/knob-docs.d.ts +5 -0
  86. package/dist/knowledge/knob-docs.js +1 -0
  87. package/dist/knowledge/machine-templates.js +1 -1
  88. package/dist/knowledge/machine-topology.js +1 -1
  89. package/dist/knowledge/machine-translation.js +1 -1
  90. package/dist/knowledge/onchain-constants.d.ts +2 -0
  91. package/dist/knowledge/onchain-constants.js +1 -1
  92. package/dist/knowledge/order-ledger.js +1 -1
  93. package/dist/knowledge/param-schema.d.ts +70 -0
  94. package/dist/knowledge/param-schema.js +1 -0
  95. package/dist/knowledge/param-tiers.d.ts +25 -0
  96. package/dist/knowledge/param-tiers.js +1 -0
  97. package/dist/knowledge/passport-ledger.d.ts +1 -1
  98. package/dist/knowledge/passport-ledger.js +1 -1
  99. package/dist/knowledge/pattern-resolutions.d.ts +106 -0
  100. package/dist/knowledge/pattern-resolutions.js +1 -0
  101. package/dist/knowledge/projection.spec.js +1 -1
  102. package/dist/knowledge/safety-rules.js +1 -1
  103. package/dist/knowledge/scenario-modes.d.ts +1 -0
  104. package/dist/knowledge/scenario-modes.js +1 -1
  105. package/dist/knowledge/scenario-topology.js +1 -1
  106. package/dist/knowledge/service-allocation-semantics.js +1 -1
  107. package/dist/knowledge/service-ledger.js +1 -1
  108. package/dist/knowledge/service-templates.js +1 -1
  109. package/dist/knowledge/strategy-manuals.d.ts +1 -1
  110. package/dist/knowledge/strategy-manuals.js +1 -1
  111. package/dist/knowledge/template-loader.d.ts +101 -1
  112. package/dist/knowledge/template-loader.js +1 -1
  113. package/dist/knowledge/template-nav.d.ts +7 -0
  114. package/dist/knowledge/template-nav.js +1 -0
  115. package/dist/knowledge/template-registry.js +1 -1
  116. package/dist/knowledge/template-scanner.d.ts +33 -0
  117. package/dist/knowledge/template-scanner.js +1 -1
  118. package/dist/knowledge/template-test-profiles.d.ts +17 -0
  119. package/dist/knowledge/template-test-profiles.js +1 -0
  120. package/dist/knowledge/template-validation.d.ts +1 -0
  121. package/dist/knowledge/template-validation.js +1 -1
  122. package/dist/knowledge/tools-reference.js +1 -1
  123. package/dist/knowledge/treasury-templates.js +1 -1
  124. package/dist/knowledge/workflow-guidance.js +1 -1
  125. package/dist/monitor/MonitorLoop.js +1 -1
  126. package/dist/participation/time-window.d.ts +37 -0
  127. package/dist/participation/time-window.js +1 -0
  128. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  129. package/dist/playbooks/service-build/machine-panorama.d.ts +1 -0
  130. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  131. package/dist/playbooks/service-build/merchant-guide.d.ts +4 -1
  132. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  133. package/dist/playbooks/service-build/migration-planner.js +1 -1
  134. package/dist/playbooks/service-build/object-panorama.js +1 -1
  135. package/dist/playbooks/service-build/participation-radar.d.ts +1 -0
  136. package/dist/playbooks/service-build/participation-radar.js +1 -1
  137. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  138. package/dist/playbooks/service-build/service-panorama.d.ts +1 -0
  139. package/dist/playbooks/service-build/service-panorama.js +1 -1
  140. package/dist/playbooks/service-build/service-quote.js +1 -1
  141. package/dist/playbooks/service-build/service-quote.spec.js +1 -1
  142. package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
  143. package/dist/relationship/registry.js +1 -1
  144. package/dist/review/index.js +1 -1
  145. package/dist/runtime/instance-registry.d.ts +7 -1
  146. package/dist/runtime/instance-registry.js +1 -1
  147. package/dist/safety/confirm-gate.js +1 -1
  148. package/dist/schema/benchmark-migration/index.d.ts +2 -0
  149. package/dist/schema/benchmark-migration/index.js +1 -1
  150. package/dist/schema/call/allocation.js +1 -1
  151. package/dist/schema/call/arbitration.js +1 -1
  152. package/dist/schema/call/base.d.ts +8 -0
  153. package/dist/schema/call/base.js +1 -1
  154. package/dist/schema/call/bridge.d.ts +2 -0
  155. package/dist/schema/call/error-codes.d.ts +1 -1
  156. package/dist/schema/call/error-codes.js +1 -1
  157. package/dist/schema/call/guard.js +1 -1
  158. package/dist/schema/call/handler.js +1 -1
  159. package/dist/schema/call/machine.js +1 -1
  160. package/dist/schema/call/semantic.js +1 -1
  161. package/dist/schema/call/service.d.ts +3 -3
  162. package/dist/schema/call/service.js +1 -1
  163. package/dist/schema/common/index.js +1 -1
  164. package/dist/schema/evaluation/index.d.ts +8 -0
  165. package/dist/schema/evaluation/index.js +1 -1
  166. package/dist/schema/goal/planning.d.ts +1 -0
  167. package/dist/schema/goal/planning.js +1 -1
  168. package/dist/schema/industry-pack/index.d.ts +29 -0
  169. package/dist/schema/industry-pack/index.js +1 -1
  170. package/dist/schema/local/index.d.ts +20 -0
  171. package/dist/schema/local/index.js +1 -1
  172. package/dist/schema/messenger/index.d.ts +2 -0
  173. package/dist/schema/messenger/index.js +1 -1
  174. package/dist/schema/operations.d.ts +1 -1
  175. package/dist/schema/operations.js +1 -1
  176. package/dist/schema/query/bi.d.ts +106 -0
  177. package/dist/schema/query/bi.js +1 -1
  178. package/dist/schema/query/index.d.ts +5 -5
  179. package/dist/schema/query/index.js +1 -1
  180. package/dist/schema/schema-version.js +1 -1
  181. package/dist/schema/watch/index.js +1 -1
  182. package/dist/schema-query-impl/index.js +1 -1
  183. package/dist/schemas/account_operation.output.json +4 -2
  184. package/dist/schemas/benchmark_migration_operation.output.json +3 -3
  185. package/dist/schemas/benchmark_migration_operation.schema.json +16 -2
  186. package/dist/schemas/bridge_operation.output.json +4 -2
  187. package/dist/schemas/bridge_operation.schema.json +5 -5
  188. package/dist/schemas/evaluation_operation.output.json +16 -0
  189. package/dist/schemas/guard2file.schema.json +1 -1
  190. package/dist/schemas/index.json +1 -1
  191. package/dist/schemas/industry_pack_operation.output.json +150 -1
  192. package/dist/schemas/industry_pack_operation.schema.json +9 -3
  193. package/dist/schemas/keeper_operation.output.json +2 -2
  194. package/dist/schemas/local_cache_operation.output.json +4 -2
  195. package/dist/schemas/local_history_operation.output.json +4 -2
  196. package/dist/schemas/local_info_operation.output.json +4 -2
  197. package/dist/schemas/local_mark_operation.output.json +4 -2
  198. package/dist/schemas/machineNode2file.schema.json +1 -1
  199. package/dist/schemas/messenger_operation.output.json +13 -2
  200. package/dist/schemas/messenger_operation.schema.json +41 -34
  201. package/dist/schemas/monitor_events.output.json +2 -2
  202. package/dist/schemas/monitor_subscription.output.json +2 -2
  203. package/dist/schemas/onchain_events.output.json +14 -14
  204. package/dist/schemas/onchain_operations.output.json +13 -10
  205. package/dist/schemas/onchain_operations.schema.json +124 -99
  206. package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
  207. package/dist/schemas/onchain_operations_arbitration.schema.json +7 -6
  208. package/dist/schemas/onchain_operations_contact.schema.json +4 -3
  209. package/dist/schemas/onchain_operations_demand.schema.json +4 -3
  210. package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -3
  211. package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
  212. package/dist/schemas/onchain_operations_guard.schema.json +7 -6
  213. package/dist/schemas/onchain_operations_machine.schema.json +9 -7
  214. package/dist/schemas/onchain_operations_order.schema.json +6 -4
  215. package/dist/schemas/onchain_operations_payment.schema.json +2 -2
  216. package/dist/schemas/onchain_operations_permission.schema.json +19 -15
  217. package/dist/schemas/onchain_operations_personal.schema.json +17 -14
  218. package/dist/schemas/onchain_operations_progress.schema.json +6 -4
  219. package/dist/schemas/onchain_operations_proof.schema.json +4 -3
  220. package/dist/schemas/onchain_operations_repository.schema.json +9 -7
  221. package/dist/schemas/onchain_operations_reward.schema.json +5 -4
  222. package/dist/schemas/onchain_operations_service.schema.json +15 -12
  223. package/dist/schemas/onchain_operations_treasury.schema.json +4 -3
  224. package/dist/schemas/onchain_table_data.output.json +18 -13
  225. package/dist/schemas/onchain_table_data.schema.json +13 -13
  226. package/dist/schemas/query_toolkit.output.json +301 -33
  227. package/dist/schemas/query_toolkit.schema.json +6 -6
  228. package/dist/schemas/watch_operation.output.json +3 -3
  229. package/dist/schemas/workflow_operation.schema.json +3 -2
  230. package/dist/schemas/wowok_buildin_info.schema.json +1 -1
  231. package/dist/task/playbook.js +1 -1
  232. package/dist/tools/handlers/benchmark-migration.d.ts +1 -0
  233. package/dist/tools/handlers/benchmark-migration.js +1 -1
  234. package/dist/tools/handlers/config.js +1 -1
  235. package/dist/tools/handlers/evaluation.js +1 -1
  236. package/dist/tools/handlers/evaluation.spec.js +1 -1
  237. package/dist/tools/handlers/industry-pack.js +1 -1
  238. package/dist/tools/handlers/messenger.js +1 -1
  239. package/dist/tools/handlers/onchain.d.ts +4 -0
  240. package/dist/tools/handlers/onchain.js +1 -1
  241. package/dist/tools/index.js +1 -1
  242. package/dist/tools/registry/business.js +1 -1
  243. package/dist/tools/registry/onchain.js +1 -1
  244. package/dist/tools/registry/query.js +1 -1
  245. package/dist/tools/sanitize-output.js +1 -1
  246. package/dist/tools/sanitize-output.spec.js +1 -1
  247. package/dist/tools/types.d.ts +1 -0
  248. package/dist/tools/upgrade-check.d.ts +22 -0
  249. package/dist/tools/upgrade-check.js +1 -1
  250. package/dist/tools/wrap.d.ts +1 -1
  251. package/dist/tools/wrap.js +1 -1
  252. package/package.json +7 -6
@@ -1 +1 @@
1
- export const SEMANTIC_TO_MACHINE_RULES=[{'id':'P-M-SEQ','pattern_name':'Sequential\x20Execution','category':'execution','semantic_intent':'Single\x20actor\x20advances\x20workflow\x20one\x20step\x20at\x20a\x20time.\x20Each\x20Pair\x20has\x20threshold=1\x20with\x20a\x20single\x20Forward\x20weight=1.','match_keywords':['sequential','linear','one\x20step\x20at\x20a\x20time'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':'dynamic','structure':'Each\x20Pair:\x20{\x20threshold:\x201,\x20forwards:\x20[{\x20name,\x20weight:\x201,\x20namedOperator\x20|\x20permissionIndex\x20}]\x20}'},'constraints':['Each\x20Forward\x20must\x20have\x20at\x20least\x20one\x20of\x20namedOperator\x20or\x20permissionIndex','weight\x20>\x200\x20(typically\x201)','Every\x20node\x20reachable\x20from\x20the\x20entry\x20must\x20be\x20able\x20to\x20reach\x20a\x20terminal\x20(a\x20loop\x20must\x20keep\x20a\x20cycle-breaking\x20exit)'],'example':{'pair':{'prev_node':'NodeA','next_node':'NodeB','threshold':0x1,'forwards':[{'name':'Advance','weight':0x1,'named_operator':''}]}}},{'id':'P-M-AND','pattern_name':'Parallel\x20AND\x20(Dual-Signature\x20Consensus)','category':'execution','semantic_intent':'Multiple\x20parties\x20must\x20ALL\x20contribute\x20to\x20advance.\x20Pair\x20threshold=N\x20with\x20N\x20DISTINCT\x20Forwards\x20(weight=1\x20each)\x20—\x20one\x20forward\x20per\x20contributing\x20operator.\x20'+'A\x20single\x20forward\x20CANNOT\x20be\x20executed\x20by\x20two\x20different\x20people:\x20each\x20forward\x20is\x20single-operator-locked\x20by\x20the\x20first\x20account\x20that\x20accomplishes\x20it\x20'+'(once\x20accomplished,\x20a\x20forward\x20is\x20locked\x20to\x20that\x20operator;\x20a\x20second\x20operator\x20re-executing\x20the\x20same\x20accomplished\x20forward\x20aborts\x20E_NOT_THE_HOLDER,\x20and\x20the\x20weight\x20is\x20counted\x20only\x20once).\x20'+'So\x20N\x20operators\x20cooperating\x20on\x20a\x20threshold-N\x20transition\x20MUST\x20each\x20have\x20their\x20own\x20forward\x20in\x20the\x20Pair.','match_keywords':['and','all','dual-sig','both\x20confirm','both\x20must'],'schema_elements':{'threshold':0x2,'forward_count':0x2,'permission_model':'mixed','pair_count':0x1,'structure':'Pair:\x20{\x20threshold:\x20N,\x20forwards:\x20[{\x20weight:\x201,\x20namedOperator:\x20\x27\x27\x20},\x20{\x20weight:\x201,\x20permissionIndex:\x202\x20}]\x20}'},'constraints':['threshold\x20must\x20equal\x20the\x20number\x20of\x20required\x20Forwards','Each\x20contributing\x20operator\x20needs\x20a\x20DISTINCT\x20Forward\x20—\x20never\x20reuse\x20one\x20forward\x20for\x20two\x20people','Each\x20Forward\x20must\x20have\x20a\x20distinct\x20permission\x20model\x20(no\x20two\x20identical)','A\x20forward\x20is\x20locked\x20by\x20its\x20first\x20operator:\x20once\x20accomplished\x20it\x20contributes\x20its\x20weight\x20once\x20and\x20re-execution\x20by\x20others\x20aborts\x20E_NOT_THE_HOLDER','If\x20either\x20party\x20fails\x20to\x20sign,\x20workflow\x20stalls\x20—\x20consider\x20adding\x20timeout\x20Guard'],'example':{'pair':{'prev_node':'Initiated','next_node':'Approved','threshold':0x2,'forwards':[{'name':'CustomerApprove','weight':0x1,'named_operator':''},{'name':'MerchantApprove','weight':0x1,'permission_index':0x2}]}}},{'id':'P-M-OR','pattern_name':'Parallel\x20OR\x20(Any-One\x20Execution)','category':'execution','semantic_intent':'Any\x20one\x20of\x20multiple\x20paths\x20can\x20advance\x20the\x20workflow.\x20Multiple\x20Pairs,\x20each\x20threshold=1.','match_keywords':['or','any','either'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':'dynamic','structure':'Multiple\x20Pairs\x20from\x20same\x20prev_node,\x20each\x20with\x20threshold=1'},'constraints':['Distinct\x20next_node\x20for\x20each\x20Pair\x20(or\x20distinct\x20Forward)','If\x20targets\x20are\x20different\x20nodes,\x20this\x20becomes\x20COMPETING\x20topology','If\x20targets\x20are\x20same\x20node,\x20alternative\x20paths\x20converge\x20(FORKMERGE)'],'example':{'pairs':[{'prev_node':'Choice','next_node':'PathA','threshold':0x1,'forwards':[{'name':'ChooseA','weight':0x1,'named_operator':''}]},{'prev_node':'Choice','next_node':'PathB','threshold':0x1,'forwards':[{'name':'ChooseB','weight':0x1,'named_operator':''}]}]}},{'id':'P-M-VOTE','pattern_name':'Weighted\x20Voting','category':'execution','semantic_intent':'Multiple\x20parties\x20vote\x20with\x20unequal\x20weights.\x20threshold=100,\x20varied\x20weights\x20(e.g.\x2060+40).\x20'+'Guard\x20extracts\x20weight\x20dynamically\x20from\x20Arbitration\x20object.','match_keywords':['vote','weight','stakeholder'],'schema_elements':{'threshold':0x64,'forward_count':'dynamic','permission_model':'mixed','pair_count':0x1,'structure':'Pair:\x20{\x20threshold:\x20100,\x20forwards:\x20[{\x20weight:\x2060,\x20permissionIndex:\x202,\x20guard:\x20arb_voting_guard\x20},\x20{\x20weight:\x208,\x20namedOperator:\x20\x27member\x27,\x20guard:\x20arb_voting_guard\x20}]\x20}'},'constraints':['Guard\x20MUST\x20check\x20arb.voted\x20has\x20[Signer]\x20to\x20prevent\x20double-voting\x20(R-X1-14\x20CRITICAL)','Weight\x20is\x20query-derived\x20from\x20Arbitration\x20object\x20(not\x20hardcoded\x20in\x20Forward)','Competing\x20Pair\x20often\x20added:\x20Approved\x20vs\x20Rejected\x20(timeout)\x20—\x20first-wins','Forward\x20weight\x20field\x20is\x20just\x20session\x20counter;\x20actual\x20weight\x20from\x20Guard'],'example':{'pair':{'prev_node':'Voting','next_node':'Approved','threshold':0x64,'forwards':[{'name':'ChiefVote','weight':0x3c,'permission_index':0x2,'guard':'arb_voting_guard'},{'name':'MemberVote','weight':0x8,'named_operator':'member','guard':'arb_voting_guard'}]}}},{'id':'P-M-HYBRID','pattern_name':'Hybrid\x20Mode\x20(Key\x20Party\x20Required\x20+\x20Others\x20Optional)','category':'execution','semantic_intent':'One\x20key\x20party\x20must\x20contribute,\x20others\x20are\x20optional.\x20threshold=5\x20with\x20mixed\x20weights\x20(3+1+1).','match_keywords':['hybrid','mixed','key\x20party'],'schema_elements':{'threshold':0x5,'forward_count':0x3,'permission_model':'mixed','pair_count':0x1,'structure':'Pair:\x20{\x20threshold:\x205,\x20forwards:\x20[{\x20weight:\x203,\x20permissionIndex:\x202\x20(key)\x20},\x20{\x20weight:\x201,\x20namedOperator:\x20\x27role1\x27\x20},\x20{\x20weight:\x201,\x20namedOperator:\x20\x27role2\x27\x20}]\x20}'},'constraints':['Key\x20party\x27s\x20weight\x20must\x20alone\x20be\x20insufficient\x20(otherwise\x20optional\x20parties\x20are\x20meaningless)','Total\x20weight\x20of\x20all\x20Forwards\x20must\x20be\x20>=\x20threshold','Each\x20Forward\x20must\x20have\x20distinct\x20permission\x20model'],'example':{'pair':{'prev_node':'Review','next_node':'Approved','threshold':0x5,'forwards':[{'name':'ManagerApprove','weight':0x3,'permission_index':0x2},{'name':'EngineerApprove','weight':0x1,'named_operator':'engineer'},{'name':'QAApprove','weight':0x1,'named_operator':'qa'}]}}},{'id':'P-M-LINEAR','pattern_name':'Linear\x20Flow\x20(No\x20Branches)','category':'topology','semantic_intent':'Workflow\x20progresses\x20in\x20a\x20straight\x20line\x20with\x20no\x20branches.','match_keywords':['linear','straight','no\x20branches'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':'dynamic','structure':'Chain\x20of\x20Pairs:\x20A->B->C->D->...->Terminal'},'constraints':['Exactly\x20one\x20entry\x20Pair\x20(prev_node=\x27\x27)','Exactly\x20one\x20terminal\x20node\x20(no\x20outgoing\x20Pairs)','Each\x20non-terminal\x20node\x20has\x20exactly\x20one\x20outgoing\x20Pair'],'example':{'topology':'Entry\x20->\x20A\x20->\x20B\x20->\x20C\x20->\x20Terminal'}},{'id':'P-M-FORKMERGE','pattern_name':'Fork-Merge\x20(Parallel\x20Branches\x20Converging)','category':'topology','semantic_intent':'Main\x20flow\x20forks\x20into\x20multiple\x20parallel\x20branches,\x20then\x20merges\x20back\x20to\x20main\x20flow.','match_keywords':['fork','merge','parallel'],'schema_elements':{'threshold':0x1,'forward_count':'dynamic','permission_model':'mixed','pair_count':'dynamic','structure':'ForkNode\x20->\x20{BranchA,\x20BranchB}\x20->\x20MergeNode'},'constraints':['Multiple\x20Pairs\x20from\x20ForkNode\x20(one\x20per\x20branch)','All\x20branches\x20must\x20eventually\x20reach\x20MergeNode','MergeNode\x20has\x20multiple\x20incoming\x20Pairs\x20(merge\x20point)','Threshold\x20at\x20MergeNode\x20determines\x20if\x20all\x20branches\x20must\x20complete\x20or\x20just\x20some'],'example':{'topology':'ForkNode\x20->\x20BranchA\x20->\x20MergeNode;\x20ForkNode\x20->\x20BranchB\x20->\x20MergeNode'}},{'id':'P-M-COMPETING','pattern_name':'Competing\x20Pairs\x20(Mutually\x20Exclusive\x20Branches)','category':'topology','semantic_intent':'Multiple\x20Pairs\x20from\x20same\x20node\x20compete;\x20first\x20Pair\x20to\x20meet\x20threshold\x20wins,\x20others\x20abandoned.','match_keywords':['competing','exclusive','race'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':'dynamic','structure':'Same\x20prev_node\x20->\x20multiple\x20next_nodes\x20(each\x20Pair\x20independent)'},'constraints':['Mutually\x20exclusive\x20—\x20only\x20one\x20Pair\x20can\x20complete\x20per\x20session','First\x20Pair\x20to\x20reach\x20threshold\x20wins','Other\x20incomplete\x20Pairs\x20are\x20abandoned','Verify\x20no\x20dead\x20branches\x20(a\x20Pair\x20that\x20always\x20loses\x20to\x20another)'],'example':{'topology':'Shipped\x20->\x20Received;\x20Shipped\x20->\x20Lost;\x20Shipped\x20->\x20Return\x20(first\x20wins)'}},{'id':'P-M-PERM-SINGLE','pattern_name':'Single\x20Permission','category':'permission','semantic_intent':'Forward\x20uses\x20only\x20one\x20permission\x20type:\x20namedOperator\x20OR\x20permissionIndex.','match_keywords':['single\x20permission'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':0x1,'structure':'Forward:\x20{\x20name,\x20weight:\x201,\x20namedOperator:\x20\x27<role>\x27\x20|\x20permissionIndex:\x20<index>\x20}\x20(only\x20one\x20set)'},'constraints':['Either\x20namedOperator\x20or\x20permissionIndex\x20is\x20set\x20(not\x20both)','Empty\x20namedOperator=\x27\x27\x20grants\x20OrderHolder\x20(order\x20owner\x20+\x20agents)'],'example':{'forward':{'name':'Ship','weight':0x1,'permission_index':0x2}}},{'id':'P-M-PERM-MIXED','pattern_name':'Mixed\x20Permission\x20(Either-Or)','category':'permission','semantic_intent':'Forward\x20allows\x20EITHER\x20permission\x20to\x20execute\x20(internal\x20staff\x20OR\x20external\x20roles).','match_keywords':['mixed\x20permission','either'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'mixed','pair_count':0x1,'structure':'Forward:\x20{\x20name,\x20weight:\x201,\x20namedOperator:\x20\x27<role>\x27,\x20permissionIndex:\x20<index>\x20}\x20(both\x20set)'},'constraints':['Both\x20namedOperator\x20and\x20permissionIndex\x20are\x20set','Executor\x20needs\x20EITHER\x20permission\x20—\x20passing\x20either\x20check\x20is\x20sufficient','Use\x20case:\x20allow\x20internal\x20staff\x20OR\x20external\x20role\x20to\x20execute\x20the\x20same\x20Forward'],'example':{'forward':{'name':'Confirm','weight':0x1,'named_operator':'auditor','permission_index':0x2}}},{'id':'P-M-CROSS-MACHINE','pattern_name':'Cross-Machine\x20Dependency','category':'integration','semantic_intent':'Machine\x20B\x27s\x20Forward\x20Guard\x20queries\x20Machine\x20A\x27s\x20Progress\x20to\x20verify\x20upstream\x20completion.','match_keywords':['cross-machine','supply\x20chain','upstream'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':0x1,'structure':'Forward:\x20{\x20guard:\x20\x27upstream_progress_guard\x27,\x20retained_submission:\x20\x27upstream_progress_id\x27\x20}'},'constraints':['Machine\x20A\x20MUST\x20be\x20published\x20before\x20Machine\x20B\x20(dependency\x20order)','Guard\x20uses\x20convert_witness=100\x20to\x20convert\x20submitted\x20Order/Progress\x20ID\x20into\x20queryable\x20Progress','Cross-Machine\x20dependency\x20is\x20one-way\x20(no\x20cycles)','Dependency\x20verification:\x20enforced\x20when\x20the\x20Progress\x20object\x20is\x20created\x20(creation\x20checks\x20the\x20bound\x20Machine\x20is\x20published\x20—\x20see\x2006\x20§14.6)','retained_submission\x20stores\x20upstream\x20Progress\x20ID\x20for\x20audit'],'example':{'forward':{'name':'VerifyUpstream','weight':0x1,'permission_index':0x2,'guard':'upstream_progress_guard','retained_submission':'upstream_progress_id'}}},{'id':'P-M-ALLOCATION-INTEGRATED','pattern_name':'Allocation-Integrated\x20Terminal','category':'integration','semantic_intent':'Terminal\x20node\x20triggers\x20Allocator\x20to\x20distribute\x20funds.\x20Allocation\x20independent\x20of\x20Machine\x20flow.','match_keywords':['allocation','fund\x20distribution','terminal'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':0x1,'structure':'Terminal\x20node\x20->\x20Allocator\x20entry\x20(configured\x20on\x20Service\x20order_allocators)'},'constraints':['Terminal\x20node\x20must\x20be\x20referenced\x20in\x20Service\x20order_allocators','Allocator\x20Guard\x20verifies\x20progress.current\x20==\x20terminal_node_name','sharing.who\x20determines\x20fund\x20recipient\x20(Entity\x20/\x20OrderHolder\x20/\x20etc.)','Multiple\x20Allocators\x20can\x20fire\x20on\x20different\x20terminal\x20nodes'],'example':{'terminal_node':'Complete','allocator':{'trigger_node':'Complete','sharing_who':'Entity','recipient':'merchant_treasury'}}}];export const NODE_FIELD_EXPLANATIONS=[{'field':'name','type':'string','required':!![],'semantic':'Node\x20name\x20(unique\x20identifier)','constraint':'<=64\x20BCS\x20bytes,\x20globally\x20unique'},{'field':'description','type':'string','required':![],'semantic':'Human-readable\x20description','constraint':'<=MAX_DESCRIPTION_LENGTH'},{'field':'b_pause','type':'boolean','required':![],'semantic':'Whether\x20node\x20is\x20paused\x20(blocks\x20execution)','constraint':'Default\x20false'},{'field':'b_submission','type':'boolean','required':![],'semantic':'Whether\x20submission\x20is\x20allowed\x20at\x20this\x20node','constraint':'Used\x20for\x20retained_submission\x20storage'}];export const PAIR_FIELD_EXPLANATIONS=[{'field':'prev_node','type':'string','required':!![],'semantic':'Source\x20node\x20(empty\x20\x27\x27\x20=\x20entry\x20point)','constraint':'Must\x20reference\x20existing\x20node\x20or\x20\x27\x27'},{'field':'next_node','type':'string','required':!![],'semantic':'Target\x20node','constraint':'Must\x20reference\x20existing\x20node'},{'field':'threshold','type':'number','required':!![],'semantic':'Required\x20total\x20forward\x20weight\x20to\x20advance','constraint':'>=0,\x20typically\x201-100'},{'field':'forwards','type':'array<Forward>','required':!![],'semantic':'List\x20of\x20Forwards\x20in\x20this\x20Pair','constraint':'1-20\x20Forwards\x20per\x20Pair'}];export const FORWARD_FIELD_EXPLANATIONS=[{'field':'name','type':'string','required':!![],'semantic':'Forward\x20name\x20(unique\x20within\x20Pair)','constraint':'<=64\x20BCS\x20bytes,\x20unique\x20within\x20Pair'},{'field':'weight','type':'number','required':!![],'semantic':'Weight\x20contribution\x20to\x20threshold','constraint':'>0,\x20typically\x201-100'},{'field':'namedOperator','type':'string\x20(optional)','required':![],'semantic':'Named\x20operator\x20role\x20(\x27\x27\x20=\x20OrderHolder)','constraint':'Optional,\x20but\x20Forward\x20needs\x20at\x20least\x20one\x20permission'},{'field':'permissionIndex','type':'number\x20(optional)','required':![],'semantic':'Permission\x20index\x20(custom\x20or\x20builtin)','constraint':'<\x20Permission.indices.length'},{'field':'guard','type':'address\x20(optional)','required':![],'semantic':'Guard\x20object\x20address\x20for\x20validation','constraint':'Must\x20be\x20CREATE-only\x20Guard,\x20already\x20created'},{'field':'retained_submission','type':'string\x20(optional)','required':![],'semantic':'Key\x20for\x20storing\x20submitted\x20values\x20in\x20history','constraint':'Uniquely\x20located\x20by\x20(current_node,\x20next_node,\x20forward_name)'}];export function identifyExecutionMode(a){const {threshold:b,forwards:c}=a,d=c['length'];if(b===0x1&&d===0x1)return'P-M-SEQ\x20(Sequential)';if(b===d&&d>=0x2){const e=c['some'](g=>g['permission_index']!==undefined)&&c['some'](g=>g['named_operator']!==undefined);return e?'P-M-AND\x20(Parallel\x20AND\x20/\x20Dual-Signature)':'P-M-AND\x20(Parallel\x20AND)';}if(b===0x64&&c['some'](g=>g['weight']<0x32&&g['weight']>0x0))return'P-M-VOTE\x20(Weighted\x20Voting)';if(b<d&&b>0x1)return'P-M-HYBRID\x20(Hybrid\x20Mode)';if(b===0x1&&d>=0x1)return'P-M-OR\x20(Parallel\x20OR)\x20or\x20P-M-SEQ\x20(if\x20single\x20Forward)';return'Unknown\x20(manual\x20review\x20needed)';}export function identifyTopology(a){const b=new Map(),c=new Map();for(const d of a){if(!b['has'](d['prev_node']))b['set'](d['prev_node'],[]);b['get'](d['prev_node'])['push'](d['next_node']);if(!c['has'](d['next_node']))c['set'](d['next_node'],[]);c['get'](d['next_node'])['push'](d['prev_node']);}for(const [e,f]of b){if(f['length']>0x1&&e!=='')return'P-M-COMPETING\x20(Competing\x20Pairs)';}for(const [g,h]of c){if(h['length']>0x1)return'P-M-FORKMERGE\x20(Fork-Merge)';}return'P-M-LINEAR\x20(Linear\x20Flow)';}export function matchSemanticPattern(a){const b=a['toLowerCase']();return SEMANTIC_TO_MACHINE_RULES['find'](c=>c['match_keywords']['some'](d=>b['includes'](d['toLowerCase']())));}export function explainForwardPermission(a){const b=a['named_operator']!==undefined&&a['named_operator']!==null,c=a['permission_index']!==undefined&&a['permission_index']!==null;if(b&&c){const d=a['named_operator']===''?'OrderHolder':'role\x20\x22'+a['named_operator']+'\x22';return'Mixed\x20permission:\x20'+d+'\x20OR\x20Permission\x20index\x20'+a['permission_index']+'\x20(either\x20sufficient)';}if(b){if(a['named_operator']==='')return'OrderHolder\x20(order\x20owner\x20+\x20agents)';return'NamedOperator\x20role\x20\x22'+a['named_operator']+'\x22';}if(c)return'Permission\x20index\x20'+a['permission_index'];return'❌\x20INVALID:\x20no\x20permission\x20set\x20(Forward\x20must\x20have\x20at\x20least\x20one\x20of\x20namedOperator\x20or\x20permissionIndex)';}export const MACHINE_CONSTRAINT_RULES=[{'id':'MC-C-01','name':'Node\x20count\x20<=\x20'+MAX_NODE_COUNT,'description':'MAX_NODE_COUNT','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-02','name':'Pair\x20count\x20per\x20node\x20<=\x20'+MAX_NODE_PAIR_COUNT,'description':'MAX_NODE_PAIR_COUNT','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-03','name':'Forward\x20count\x20per\x20Pair\x20<=\x20'+MAX_FORWARD_COUNT,'description':'MAX_FORWARD_COUNT','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-04','name':'Node\x20name\x20unique','description':'name\x20globally\x20unique','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-05','name':'Forward\x20name\x20unique\x20within\x20Pair','description':'name\x20unique\x20within\x20Pair','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-06','name':'Node\x20name\x20<=\x2064\x20BCS\x20bytes','description':'MAX_NAME_LENGTH','category':'creation','verification_location':'common.ts','on_chain_enforced':!![]},{'id':'MC-C-07','name':'Forward\x20has\x20at\x20least\x20one\x20permission','description':'namedOperator\x20or\x20permissionIndex','category':'creation','verification_location':'wowok-machine\x20SKILL','on_chain_enforced':![]},{'id':'MC-C-08','name':'permissionIndex\x20valid','description':'<\x20Permission.indices.length','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-09','name':'Guard\x20already\x20created','description':'guard\x20field\x20references\x20existing\x20Guard','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-10','name':'Guard\x20immutable','description':'Guard.b_immutable\x20==\x20true','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-11','name':'retained_submission\x20index\x20valid','description':'Corresponds\x20to\x20Guard\x20table\x20b_submission=true','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-12','name':'prev_node\x20references\x20valid','description':'Points\x20to\x20existing\x20node\x20or\x20\x27\x27','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-13','name':'threshold\x20>=\x200','description':'Non-negative','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-14','name':'weight\x20>\x200','description':'Positive','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-15','name':'description\x20length','description':'<=\x20MAX_DESCRIPTION_LENGTH','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-16','name':'bReplace\x20scope','description':'Acts\x20on\x20existing\x20node\x27s\x20pairs\x20list,\x20not\x20whole\x20Machine','category':'node_operation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-17','name':'bReplace=false\x20merge\x20semantics','description':'Incremental\x20merge\x20by\x20prev_node\x20into\x20existing\x20pairs','category':'node_operation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-18','name':'Non-existing\x20node\x20append','description':'Appends\x20the\x20new\x20node\x20(no\x20clear\x20triggered)','category':'node_operation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-19','name':'Full\x20node\x20replacement\x20via\x20file\x20entry','description':'NodeJsonOrMarkdownFileSchema\x20(not\x20bReplace=true)','category':'node_operation','verification_location':'machine.ts:93-112','on_chain_enforced':![]},{'id':'MC-S-01','name':'At\x20least\x20one\x20entry\x20point','description':'Pair\x20with\x20prev_node=\x27\x27','category':'structure','verification_location':'machine-topology.ts','on_chain_enforced':![]},{'id':'MC-S-02','name':'At\x20least\x20one\x20terminal','description':'Node\x20with\x20no\x20outgoing\x20Pairs','category':'structure','verification_location':'machine-topology.ts','on_chain_enforced':![]},{'id':'MC-S-03','name':'No\x20orphaned\x20nodes','description':'All\x20non-entry\x20nodes\x20have\x20incoming\x20Pair','category':'structure','verification_location':'machine-topology.ts','on_chain_enforced':![]},{'id':'MC-S-04','name':'No\x20dead\x20branches','description':'All\x20thresholds\x20achievable','category':'structure','verification_location':'machine-topology.ts','on_chain_enforced':![]},{'id':'MC-S-05','name':'Exit\x20reachability\x20(trap-free)','description':'Every\x20entry-reachable\x20node\x20can\x20reach\x20a\x20terminal;\x20loops\x20are\x20allowed\x20on-chain\x20but\x20must\x20keep\x20a\x20cycle-breaking\x20exit','category':'structure','verification_location':'machine-topology.ts','on_chain_enforced':![]},{'id':'MC-P-01','name':'All\x20Guards\x20tested','description':'gen_passport\x20passed','category':'publish','verification_location':'confirm-gate.ts','on_chain_enforced':![]},{'id':'MC-P-02','name':'Backup\x20exported','description':'machineNode2file\x20executed','category':'publish','verification_location':'confirm-gate.ts','on_chain_enforced':![]},{'id':'MC-P-03','name':'Testnet\x20verified','description':'(recommended)\x20testnet\x20passed','category':'publish','verification_location':'confirm-gate.ts','on_chain_enforced':![]},{'id':'MC-P-04','name':'User\x20100%\x20confirmed','description':'ConfirmGate\x20passed','category':'publish','verification_location':'confirm-gate.ts','on_chain_enforced':![]},{'id':'MC-P-05','name':'Service\x20created\x20(if\x20bound)','description':'Service\x20exists','category':'publish','verification_location':'workflow-guidance.ts','on_chain_enforced':![]},{'id':'MC-R-01','name':'Node\x20ops\x20fail\x20after\x20publish','description':'E_ALREADY_PUBLISHED','category':'runtime','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-R-02','name':'Session\x20accumulation\x20correct','description':'weight\x20accumulation\x20logic','category':'runtime','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-R-03','name':'Competing\x20Pair\x20first-wins','description':'First\x20Pair\x20to\x20reach\x20threshold\x20wins','category':'runtime','verification_location':'on-chain','on_chain_enforced':!![]}];export function getConstraintsByCategory(a){return MACHINE_CONSTRAINT_RULES['filter'](b=>b['category']===a);}export function getConstraintById(a){return MACHINE_CONSTRAINT_RULES['find'](b=>b['id']===a);}export function getOnChainConstraints(){return MACHINE_CONSTRAINT_RULES['filter'](a=>a['on_chain_enforced']);}export function getOffChainConstraints(){return MACHINE_CONSTRAINT_RULES['filter'](a=>!a['on_chain_enforced']);}export const MACHINE_TRANSLATION_VERSION='1.0.0';export const MACHINE_PATTERNS_COUNT=SEMANTIC_TO_MACHINE_RULES['length'];export const MACHINE_CONSTRAINTS_COUNT=MACHINE_CONSTRAINT_RULES['length'];import{MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT}from'./onchain-constants.js';export function identifyNodeRole(a){const b=a['all_pairs']??[],c=(a['pairs']??b)['filter'](i=>i['prev_node']===a['name']),d=b['filter'](i=>i['next_node']===a['name']),e=b['some'](i=>i['prev_node']===''&&i['next_node']===a['name']),f=c['length']===0x0;if(e)return'entry';if(f)return'terminal';const g=new Set(c['map'](i=>i['next_node']));if(g['size']>0x1)return'branch';const h=new Set(d['map'](i=>i['prev_node'])['filter'](i=>i!==''));if(h['size']>0x1)return'merge';return'normal';}function explainGuardBinding(a){return{'address':a,'immutable_required':!![],'note':'Guard\x20'+a+'\x20validates\x20this\x20Forward\x27s\x20execution;\x20'+'must\x20be\x20immutable\x20(b_immutable=true)\x20and\x20pre-created\x20on-chain.'};}export function explainNode(a){const b=a['pairs']??[];return{'name':a['name'],'role':identifyNodeRole(a),'pairs':b['map'](c=>explainPair(c)),'description':a['description']};}export function explainPair(a){return{'prev_node':a['prev_node'],'next_node':a['next_node'],'threshold':a['threshold'],'execution_pattern':identifyExecutionMode(a),'forwards':a['forwards']['map'](b=>explainForward(b))};}export function explainForward(a){return{'name':a['name'],'permission':explainForwardPermission(a),'weight':a['weight'],'guard':a['guard']?explainGuardBinding(a['guard']):null,'retained_submission':a['retained_submission']??null};}
1
+ export const SEMANTIC_TO_MACHINE_RULES=[{'id':'P-M-SEQ','pattern_name':'Sequential\x20Execution','category':'execution','semantic_intent':'Single\x20actor\x20advances\x20workflow\x20one\x20step\x20at\x20a\x20time.\x20Each\x20Pair\x20has\x20threshold=1\x20with\x20a\x20single\x20Forward\x20weight=1.','match_keywords':['sequential','linear','one\x20step\x20at\x20a\x20time'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':'dynamic','structure':'Each\x20Pair:\x20{\x20threshold:\x201,\x20forwards:\x20[{\x20name,\x20weight:\x201,\x20namedOperator\x20|\x20permissionIndex\x20}]\x20}'},'constraints':['Each\x20Forward\x20must\x20have\x20at\x20least\x20one\x20of\x20namedOperator\x20or\x20permissionIndex','weight\x20>\x200\x20(typically\x201)','Every\x20node\x20reachable\x20from\x20the\x20entry\x20must\x20be\x20able\x20to\x20reach\x20a\x20terminal\x20(a\x20loop\x20must\x20keep\x20a\x20cycle-breaking\x20exit)'],'example':{'pair':{'prev_node':'NodeA','next_node':'NodeB','threshold':0x1,'forwards':[{'name':'Advance','weight':0x1,'named_operator':''}]}}},{'id':'P-M-AND','pattern_name':'Parallel\x20AND\x20(Dual-Signature\x20Consensus)','category':'execution','semantic_intent':'Multiple\x20parties\x20must\x20ALL\x20contribute\x20to\x20advance.\x20Pair\x20threshold=N\x20with\x20N\x20DISTINCT\x20Forwards\x20(weight=1\x20each)\x20—\x20one\x20forward\x20per\x20contributing\x20operator.\x20'+'A\x20single\x20forward\x20CANNOT\x20be\x20executed\x20by\x20two\x20different\x20people:\x20each\x20forward\x20is\x20single-operator-locked\x20by\x20the\x20first\x20account\x20that\x20accomplishes\x20it\x20'+'(once\x20accomplished,\x20a\x20forward\x20is\x20locked\x20to\x20that\x20operator;\x20a\x20second\x20operator\x20re-executing\x20the\x20same\x20accomplished\x20forward\x20aborts\x20E_NOT_THE_HOLDER,\x20and\x20the\x20weight\x20is\x20counted\x20only\x20once).\x20'+'So\x20N\x20operators\x20cooperating\x20on\x20a\x20threshold-N\x20transition\x20MUST\x20each\x20have\x20their\x20own\x20forward\x20in\x20the\x20Pair.','match_keywords':['and','all','dual-sig','both\x20confirm','both\x20must'],'schema_elements':{'threshold':0x2,'forward_count':0x2,'permission_model':'mixed','pair_count':0x1,'structure':'Pair:\x20{\x20threshold:\x20N,\x20forwards:\x20[{\x20weight:\x201,\x20namedOperator:\x20\x27\x27\x20},\x20{\x20weight:\x201,\x20permissionIndex:\x202\x20}]\x20}'},'constraints':['threshold\x20must\x20equal\x20the\x20number\x20of\x20required\x20Forwards','Each\x20contributing\x20operator\x20needs\x20a\x20DISTINCT\x20Forward\x20—\x20never\x20reuse\x20one\x20forward\x20for\x20two\x20people','Each\x20Forward\x20must\x20have\x20a\x20distinct\x20permission\x20model\x20(no\x20two\x20identical)','A\x20forward\x20is\x20locked\x20by\x20its\x20first\x20operator:\x20once\x20accomplished\x20it\x20contributes\x20its\x20weight\x20once\x20and\x20re-execution\x20by\x20others\x20aborts\x20E_NOT_THE_HOLDER','If\x20either\x20party\x20fails\x20to\x20sign,\x20workflow\x20stalls\x20—\x20consider\x20adding\x20timeout\x20Guard'],'example':{'pair':{'prev_node':'Initiated','next_node':'Approved','threshold':0x2,'forwards':[{'name':'CustomerApprove','weight':0x1,'named_operator':''},{'name':'MerchantApprove','weight':0x1,'permission_index':0x2}]}}},{'id':'P-M-OR','pattern_name':'Parallel\x20OR\x20(Any-One\x20Execution)','category':'execution','semantic_intent':'Any\x20one\x20of\x20multiple\x20paths\x20can\x20advance\x20the\x20workflow.\x20Multiple\x20Pairs,\x20each\x20threshold=1.','match_keywords':['or','any','either'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':'dynamic','structure':'Multiple\x20Pairs\x20from\x20same\x20prev_node,\x20each\x20with\x20threshold=1'},'constraints':['Distinct\x20next_node\x20for\x20each\x20Pair\x20(or\x20distinct\x20Forward)','If\x20targets\x20are\x20different\x20nodes,\x20this\x20becomes\x20COMPETING\x20topology','If\x20targets\x20are\x20same\x20node,\x20alternative\x20paths\x20converge\x20(FORKMERGE)'],'example':{'pairs':[{'prev_node':'Choice','next_node':'PathA','threshold':0x1,'forwards':[{'name':'ChooseA','weight':0x1,'named_operator':''}]},{'prev_node':'Choice','next_node':'PathB','threshold':0x1,'forwards':[{'name':'ChooseB','weight':0x1,'named_operator':''}]}]}},{'id':'P-M-VOTE','pattern_name':'Weighted\x20Voting','category':'execution','semantic_intent':'Multiple\x20parties\x20vote\x20with\x20unequal\x20weights.\x20threshold=100,\x20varied\x20weights\x20(e.g.\x2060+40).\x20'+'Guard\x20extracts\x20weight\x20dynamically\x20from\x20Arbitration\x20object.','match_keywords':['vote','weight','stakeholder'],'schema_elements':{'threshold':0x64,'forward_count':'dynamic','permission_model':'mixed','pair_count':0x1,'structure':'Pair:\x20{\x20threshold:\x20100,\x20forwards:\x20[{\x20weight:\x2060,\x20permissionIndex:\x202,\x20guard:\x20arb_voting_guard\x20},\x20{\x20weight:\x208,\x20namedOperator:\x20\x27member\x27,\x20guard:\x20arb_voting_guard\x20}]\x20}'},'constraints':['Guard\x20MUST\x20check\x20arb.voted\x20has\x20[Signer]\x20to\x20prevent\x20double-voting\x20(R-X1-14\x20CRITICAL)','Weight\x20is\x20query-derived\x20from\x20Arbitration\x20object\x20(not\x20hardcoded\x20in\x20Forward)','Competing\x20Pair\x20often\x20added:\x20Approved\x20vs\x20Rejected\x20(timeout)\x20—\x20first-wins','Forward\x20weight\x20field\x20is\x20just\x20session\x20counter;\x20actual\x20weight\x20from\x20Guard'],'example':{'pair':{'prev_node':'Voting','next_node':'Approved','threshold':0x64,'forwards':[{'name':'ChiefVote','weight':0x3c,'permission_index':0x2,'guard':'arb_voting_guard'},{'name':'MemberVote','weight':0x8,'named_operator':'member','guard':'arb_voting_guard'}]}}},{'id':'P-M-HYBRID','pattern_name':'Hybrid\x20Mode\x20(Key\x20Party\x20Required\x20+\x20Others\x20Optional)','category':'execution','semantic_intent':'One\x20key\x20party\x20must\x20contribute,\x20others\x20are\x20optional.\x20threshold=5\x20with\x20mixed\x20weights\x20(3+1+1).','match_keywords':['hybrid','mixed','key\x20party'],'schema_elements':{'threshold':0x5,'forward_count':0x3,'permission_model':'mixed','pair_count':0x1,'structure':'Pair:\x20{\x20threshold:\x205,\x20forwards:\x20[{\x20weight:\x203,\x20permissionIndex:\x202\x20(key)\x20},\x20{\x20weight:\x201,\x20namedOperator:\x20\x27role1\x27\x20},\x20{\x20weight:\x201,\x20namedOperator:\x20\x27role2\x27\x20}]\x20}'},'constraints':['Key\x20party\x27s\x20weight\x20must\x20alone\x20be\x20insufficient\x20(otherwise\x20optional\x20parties\x20are\x20meaningless)','Total\x20weight\x20of\x20all\x20Forwards\x20must\x20be\x20>=\x20threshold','Each\x20Forward\x20must\x20have\x20distinct\x20permission\x20model'],'example':{'pair':{'prev_node':'Review','next_node':'Approved','threshold':0x5,'forwards':[{'name':'ManagerApprove','weight':0x3,'permission_index':0x2},{'name':'EngineerApprove','weight':0x1,'named_operator':'engineer'},{'name':'QAApprove','weight':0x1,'named_operator':'qa'}]}}},{'id':'P-M-LINEAR','pattern_name':'Linear\x20Flow\x20(No\x20Branches)','category':'topology','semantic_intent':'Workflow\x20progresses\x20in\x20a\x20straight\x20line\x20with\x20no\x20branches.','match_keywords':['linear','straight','no\x20branches'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':'dynamic','structure':'Chain\x20of\x20Pairs:\x20A->B->C->D->...->Terminal'},'constraints':['Exactly\x20one\x20entry\x20Pair\x20(prev_node=\x27\x27)','Exactly\x20one\x20terminal\x20node\x20(no\x20outgoing\x20Pairs)','Each\x20non-terminal\x20node\x20has\x20exactly\x20one\x20outgoing\x20Pair'],'example':{'topology':'Entry\x20->\x20A\x20->\x20B\x20->\x20C\x20->\x20Terminal'}},{'id':'P-M-FORKMERGE','pattern_name':'Fork-Merge\x20(Parallel\x20Branches\x20Converging)','category':'topology','semantic_intent':'Main\x20flow\x20forks\x20into\x20multiple\x20parallel\x20branches,\x20then\x20merges\x20back\x20to\x20main\x20flow.','match_keywords':['fork','merge','parallel'],'schema_elements':{'threshold':0x1,'forward_count':'dynamic','permission_model':'mixed','pair_count':'dynamic','structure':'ForkNode\x20->\x20{BranchA,\x20BranchB}\x20->\x20MergeNode'},'constraints':['Multiple\x20Pairs\x20from\x20ForkNode\x20(one\x20per\x20branch)','All\x20branches\x20must\x20eventually\x20reach\x20MergeNode','MergeNode\x20has\x20multiple\x20incoming\x20Pairs\x20(merge\x20point)','Threshold\x20at\x20MergeNode\x20determines\x20if\x20all\x20branches\x20must\x20complete\x20or\x20just\x20some'],'example':{'topology':'ForkNode\x20->\x20BranchA\x20->\x20MergeNode;\x20ForkNode\x20->\x20BranchB\x20->\x20MergeNode'}},{'id':'P-M-COMPETING','pattern_name':'Competing\x20Pairs\x20(Mutually\x20Exclusive\x20Branches)','category':'topology','semantic_intent':'Multiple\x20Pairs\x20from\x20same\x20node\x20compete;\x20first\x20Pair\x20to\x20meet\x20threshold\x20wins,\x20others\x20abandoned.','match_keywords':['competing','exclusive','race'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':'dynamic','structure':'Same\x20prev_node\x20->\x20multiple\x20next_nodes\x20(each\x20Pair\x20independent)'},'constraints':['Mutually\x20exclusive\x20—\x20only\x20one\x20Pair\x20can\x20complete\x20per\x20session','First\x20Pair\x20to\x20reach\x20threshold\x20wins','Other\x20incomplete\x20Pairs\x20are\x20abandoned','Verify\x20no\x20dead\x20branches\x20(a\x20Pair\x20that\x20always\x20loses\x20to\x20another)'],'example':{'topology':'Shipped\x20->\x20Received;\x20Shipped\x20->\x20Lost;\x20Shipped\x20->\x20Return\x20(first\x20wins)'}},{'id':'P-M-PERM-SINGLE','pattern_name':'Single\x20Permission','category':'permission','semantic_intent':'Forward\x20uses\x20only\x20one\x20permission\x20type:\x20namedOperator\x20OR\x20permissionIndex.','match_keywords':['single\x20permission'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':0x1,'structure':'Forward:\x20{\x20name,\x20weight:\x201,\x20namedOperator:\x20\x27<role>\x27\x20|\x20permissionIndex:\x20<index>\x20}\x20(only\x20one\x20set)'},'constraints':['Either\x20namedOperator\x20or\x20permissionIndex\x20is\x20set\x20(not\x20both)','Empty\x20namedOperator=\x27\x27\x20grants\x20OrderHolder\x20(order\x20owner\x20+\x20agents)'],'example':{'forward':{'name':'Ship','weight':0x1,'permission_index':0x2}}},{'id':'P-M-PERM-MIXED','pattern_name':'Mixed\x20Permission\x20(Either-Or)','category':'permission','semantic_intent':'Forward\x20allows\x20EITHER\x20permission\x20to\x20execute\x20(internal\x20staff\x20OR\x20external\x20roles).','match_keywords':['mixed\x20permission','either'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'mixed','pair_count':0x1,'structure':'Forward:\x20{\x20name,\x20weight:\x201,\x20namedOperator:\x20\x27<role>\x27,\x20permissionIndex:\x20<index>\x20}\x20(both\x20set)'},'constraints':['Both\x20namedOperator\x20and\x20permissionIndex\x20are\x20set','Executor\x20needs\x20EITHER\x20permission\x20—\x20passing\x20either\x20check\x20is\x20sufficient','Use\x20case:\x20allow\x20internal\x20staff\x20OR\x20external\x20role\x20to\x20execute\x20the\x20same\x20Forward'],'example':{'forward':{'name':'Confirm','weight':0x1,'named_operator':'auditor','permission_index':0x2}}},{'id':'P-M-CROSS-MACHINE','pattern_name':'Cross-Machine\x20Dependency','category':'integration','semantic_intent':'Machine\x20B\x27s\x20Forward\x20Guard\x20queries\x20Machine\x20A\x27s\x20Progress\x20to\x20verify\x20upstream\x20completion.','match_keywords':['cross-machine','supply\x20chain','upstream'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':0x1,'structure':'Forward:\x20{\x20guard:\x20\x27upstream_progress_guard\x27,\x20retained_submission:\x20\x27upstream_progress_id\x27\x20}'},'constraints':['Machine\x20A\x20MUST\x20be\x20published\x20before\x20Machine\x20B\x20(dependency\x20order)','Guard\x20uses\x20convert_witness=100\x20to\x20convert\x20submitted\x20Order/Progress\x20ID\x20into\x20queryable\x20Progress','Cross-Machine\x20dependency\x20is\x20one-way\x20(no\x20cycles)','Dependency\x20verification:\x20enforced\x20when\x20the\x20Progress\x20object\x20is\x20created\x20(creation\x20checks\x20the\x20bound\x20Machine\x20is\x20published\x20—\x20see\x2006\x20§14.6)','retained_submission\x20stores\x20upstream\x20Progress\x20ID\x20for\x20audit'],'example':{'forward':{'name':'VerifyUpstream','weight':0x1,'permission_index':0x2,'guard':'upstream_progress_guard','retained_submission':'upstream_progress_id'}}},{'id':'P-M-ALLOCATION-INTEGRATED','pattern_name':'Allocation-Integrated\x20Terminal','category':'integration','semantic_intent':'Terminal\x20node\x20triggers\x20Allocator\x20to\x20distribute\x20funds.\x20Allocation\x20independent\x20of\x20Machine\x20flow.','match_keywords':['allocation','fund\x20distribution','terminal'],'schema_elements':{'threshold':0x1,'forward_count':0x1,'permission_model':'single','pair_count':0x1,'structure':'Terminal\x20node\x20->\x20Allocator\x20entry\x20(configured\x20on\x20Service\x20order_allocators)'},'constraints':['Terminal\x20node\x20must\x20be\x20referenced\x20in\x20Service\x20order_allocators','Allocator\x20Guard\x20verifies\x20progress.current\x20==\x20terminal_node_name','sharing.who\x20determines\x20fund\x20recipient\x20(Entity\x20/\x20OrderHolder\x20/\x20etc.)','Multiple\x20Allocators\x20can\x20fire\x20on\x20different\x20terminal\x20nodes'],'example':{'terminal_node':'Complete','allocator':{'trigger_node':'Complete','sharing_who':'Entity','recipient':'merchant_treasury'}}}];export const NODE_FIELD_EXPLANATIONS=[{'field':'name','type':'string','required':!![],'semantic':'Node\x20name\x20(unique\x20identifier)','constraint':'<=64\x20BCS\x20bytes,\x20globally\x20unique'},{'field':'description','type':'string','required':![],'semantic':'Human-readable\x20description','constraint':'<=MAX_DESCRIPTION_LENGTH'},{'field':'b_pause','type':'boolean','required':![],'semantic':'Whether\x20node\x20is\x20paused\x20(blocks\x20execution)','constraint':'Default\x20false'},{'field':'b_submission','type':'boolean','required':![],'semantic':'Whether\x20submission\x20is\x20allowed\x20at\x20this\x20node','constraint':'Used\x20for\x20retained_submission\x20storage'}];export const PAIR_FIELD_EXPLANATIONS=[{'field':'prev_node','type':'string','required':!![],'semantic':'Source\x20node\x20(empty\x20\x27\x27\x20=\x20entry\x20point)','constraint':'Must\x20reference\x20existing\x20node\x20or\x20\x27\x27'},{'field':'next_node','type':'string','required':!![],'semantic':'Target\x20node','constraint':'Must\x20reference\x20existing\x20node'},{'field':'threshold','type':'number','required':!![],'semantic':'Required\x20total\x20forward\x20weight\x20to\x20advance','constraint':'>=0,\x20typically\x201-100'},{'field':'forwards','type':'array<Forward>','required':!![],'semantic':'List\x20of\x20Forwards\x20in\x20this\x20Pair','constraint':'1-20\x20Forwards\x20per\x20Pair'}];export const FORWARD_FIELD_EXPLANATIONS=[{'field':'name','type':'string','required':!![],'semantic':'Forward\x20name\x20(unique\x20within\x20Pair)','constraint':'<=64\x20BCS\x20bytes,\x20unique\x20within\x20Pair'},{'field':'weight','type':'number','required':!![],'semantic':'Weight\x20contribution\x20to\x20threshold','constraint':'>0,\x20typically\x201-100'},{'field':'namedOperator','type':'string\x20(optional)','required':![],'semantic':'Named\x20operator\x20role\x20(\x27\x27\x20=\x20OrderHolder)','constraint':'Optional,\x20but\x20Forward\x20needs\x20at\x20least\x20one\x20permission'},{'field':'permissionIndex','type':'number\x20(optional)','required':![],'semantic':'Permission\x20index\x20(custom\x20or\x20builtin)','constraint':'<\x20Permission.indices.length'},{'field':'guard','type':'address\x20(optional)','required':![],'semantic':'Guard\x20object\x20address\x20for\x20validation','constraint':'Must\x20be\x20CREATE-only\x20Guard,\x20already\x20created'},{'field':'retained_submission','type':'string\x20(optional)','required':![],'semantic':'Key\x20for\x20storing\x20submitted\x20values\x20in\x20history','constraint':'Uniquely\x20located\x20by\x20(current_node,\x20next_node,\x20forward_name)'}];export function identifyExecutionMode(a){const {threshold:b,forwards:c}=a,d=c['length'];if(b===0x1&&d===0x1)return'P-M-SEQ\x20(Sequential)';if(b===d&&d>=0x2){const e=c['some'](g=>g['permission_index']!==undefined)&&c['some'](g=>g['named_operator']!==undefined);return e?'P-M-AND\x20(Parallel\x20AND\x20/\x20Dual-Signature)':'P-M-AND\x20(Parallel\x20AND)';}if(b===0x64&&c['some'](g=>g['weight']<0x32&&g['weight']>0x0))return'P-M-VOTE\x20(Weighted\x20Voting)';if(b<d&&b>0x1)return'P-M-HYBRID\x20(Hybrid\x20Mode)';if(b===0x1&&d>=0x1)return'P-M-OR\x20(Parallel\x20OR)\x20or\x20P-M-SEQ\x20(if\x20single\x20Forward)';return'Unknown\x20(manual\x20review\x20needed)';}export function identifyTopology(a){const b=new Map(),c=new Map();for(const d of a){if(!b['has'](d['prev_node']))b['set'](d['prev_node'],[]);b['get'](d['prev_node'])['push'](d['next_node']);if(!c['has'](d['next_node']))c['set'](d['next_node'],[]);c['get'](d['next_node'])['push'](d['prev_node']);}for(const [e,f]of b){if(f['length']>0x1&&e!=='')return'P-M-COMPETING\x20(Competing\x20Pairs)';}for(const [g,h]of c){if(h['length']>0x1)return'P-M-FORKMERGE\x20(Fork-Merge)';}return'P-M-LINEAR\x20(Linear\x20Flow)';}export function matchSemanticPattern(a){const b=a['toLowerCase']();return SEMANTIC_TO_MACHINE_RULES['find'](c=>c['match_keywords']['some'](d=>b['includes'](d['toLowerCase']())));}export function explainForwardPermission(a){const b=a['named_operator']!==undefined&&a['named_operator']!==null,c=a['permission_index']!==undefined&&a['permission_index']!==null;if(b&&c){const d=a['named_operator']===''?'OrderHolder':'role\x20\x22'+a['named_operator']+'\x22';return'Mixed\x20permission:\x20'+d+'\x20OR\x20Permission\x20index\x20'+a['permission_index']+'\x20(either\x20sufficient)';}if(b){if(a['named_operator']==='')return'OrderHolder\x20(order\x20owner\x20+\x20agents)';return'NamedOperator\x20role\x20\x22'+a['named_operator']+'\x22';}if(c)return'Permission\x20index\x20'+a['permission_index'];return'❌\x20INVALID:\x20no\x20permission\x20set\x20(Forward\x20must\x20have\x20at\x20least\x20one\x20of\x20namedOperator\x20or\x20permissionIndex)';}export const MACHINE_CONSTRAINT_RULES=[{'id':'MC-C-01','name':'Node\x20count\x20<=\x20'+MAX_NODE_COUNT,'description':'MAX_NODE_COUNT','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-02','name':'Pair\x20count\x20per\x20node\x20<=\x20'+MAX_NODE_PAIR_COUNT,'description':'MAX_NODE_PAIR_COUNT','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-03','name':'Forward\x20count\x20per\x20Pair\x20<=\x20'+MAX_FORWARD_COUNT,'description':'MAX_FORWARD_COUNT','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-04','name':'Node\x20name\x20unique','description':'name\x20globally\x20unique','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-05','name':'Forward\x20name\x20unique\x20within\x20Pair','description':'name\x20unique\x20within\x20Pair','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-06','name':'Node\x20name\x20<=\x2064\x20BCS\x20bytes','description':'MAX_NAME_LENGTH','category':'creation','verification_location':'shared\x20name-length\x20rule','on_chain_enforced':!![]},{'id':'MC-C-07','name':'Forward\x20has\x20at\x20least\x20one\x20permission','description':'namedOperator\x20or\x20permissionIndex','category':'creation','verification_location':'wowok-machine\x20SKILL','on_chain_enforced':![]},{'id':'MC-C-08','name':'permissionIndex\x20valid','description':'<\x20Permission.indices.length','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-09','name':'Guard\x20already\x20created','description':'guard\x20field\x20references\x20existing\x20Guard','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-10','name':'Guard\x20immutable','description':'Guard.b_immutable\x20==\x20true','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-11','name':'retained_submission\x20index\x20valid','description':'Corresponds\x20to\x20Guard\x20table\x20b_submission=true','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-12','name':'prev_node\x20references\x20valid','description':'Points\x20to\x20existing\x20node\x20or\x20\x27\x27','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-13','name':'threshold\x20>=\x200','description':'Non-negative','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-14','name':'weight\x20>\x200','description':'Positive','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-15','name':'description\x20length','description':'<=\x20MAX_DESCRIPTION_LENGTH','category':'creation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-16','name':'bReplace\x20scope','description':'Acts\x20on\x20existing\x20node\x27s\x20pairs\x20list,\x20not\x20whole\x20Machine','category':'node_operation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-17','name':'bReplace=false\x20merge\x20semantics','description':'Incremental\x20merge\x20by\x20prev_node\x20into\x20existing\x20pairs','category':'node_operation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-18','name':'Non-existing\x20node\x20append','description':'Appends\x20the\x20new\x20node\x20(no\x20clear\x20triggered)','category':'node_operation','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-C-19','name':'Full\x20node\x20replacement\x20via\x20file\x20entry','description':'NodeJsonOrMarkdownFileSchema\x20(not\x20bReplace=true)','category':'node_operation','verification_location':'node\x20file\x20entry\x20handling','on_chain_enforced':![]},{'id':'MC-S-01','name':'At\x20least\x20one\x20entry\x20point','description':'Pair\x20with\x20prev_node=\x27\x27','category':'structure','verification_location':'machine\x20topology\x20check','on_chain_enforced':![]},{'id':'MC-S-02','name':'At\x20least\x20one\x20terminal','description':'Node\x20with\x20no\x20outgoing\x20Pairs','category':'structure','verification_location':'machine\x20topology\x20check','on_chain_enforced':![]},{'id':'MC-S-03','name':'No\x20orphaned\x20nodes','description':'All\x20non-entry\x20nodes\x20have\x20incoming\x20Pair','category':'structure','verification_location':'machine\x20topology\x20check','on_chain_enforced':![]},{'id':'MC-S-04','name':'No\x20dead\x20branches','description':'All\x20thresholds\x20achievable','category':'structure','verification_location':'machine\x20topology\x20check','on_chain_enforced':![]},{'id':'MC-S-05','name':'Exit\x20reachability\x20(trap-free)','description':'Every\x20entry-reachable\x20node\x20can\x20reach\x20a\x20terminal;\x20loops\x20are\x20allowed\x20on-chain\x20but\x20must\x20keep\x20a\x20cycle-breaking\x20exit','category':'structure','verification_location':'machine\x20topology\x20check','on_chain_enforced':![]},{'id':'MC-P-01','name':'All\x20Guards\x20tested','description':'gen_passport\x20passed','category':'publish','verification_location':'publish\x20confirmation\x20gate','on_chain_enforced':![]},{'id':'MC-P-02','name':'Backup\x20exported','description':'machineNode2file\x20executed','category':'publish','verification_location':'publish\x20confirmation\x20gate','on_chain_enforced':![]},{'id':'MC-P-03','name':'Testnet\x20verified','description':'(recommended)\x20testnet\x20passed','category':'publish','verification_location':'publish\x20confirmation\x20gate','on_chain_enforced':![]},{'id':'MC-P-04','name':'User\x20100%\x20confirmed','description':'ConfirmGate\x20passed','category':'publish','verification_location':'publish\x20confirmation\x20gate','on_chain_enforced':![]},{'id':'MC-P-05','name':'Service\x20created\x20(if\x20bound)','description':'Service\x20exists','category':'publish','verification_location':'workflow\x20guidance\x20step','on_chain_enforced':![]},{'id':'MC-R-01','name':'Node\x20ops\x20fail\x20after\x20publish','description':'E_ALREADY_PUBLISHED','category':'runtime','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-R-02','name':'Session\x20accumulation\x20correct','description':'weight\x20accumulation\x20logic','category':'runtime','verification_location':'on-chain','on_chain_enforced':!![]},{'id':'MC-R-03','name':'Competing\x20Pair\x20first-wins','description':'First\x20Pair\x20to\x20reach\x20threshold\x20wins','category':'runtime','verification_location':'on-chain','on_chain_enforced':!![]}];export function getConstraintsByCategory(a){return MACHINE_CONSTRAINT_RULES['filter'](b=>b['category']===a);}export function getConstraintById(a){return MACHINE_CONSTRAINT_RULES['find'](b=>b['id']===a);}export function getOnChainConstraints(){return MACHINE_CONSTRAINT_RULES['filter'](a=>a['on_chain_enforced']);}export function getOffChainConstraints(){return MACHINE_CONSTRAINT_RULES['filter'](a=>!a['on_chain_enforced']);}export const MACHINE_TRANSLATION_VERSION='1.0.0';export const MACHINE_PATTERNS_COUNT=SEMANTIC_TO_MACHINE_RULES['length'];export const MACHINE_CONSTRAINTS_COUNT=MACHINE_CONSTRAINT_RULES['length'];import{MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT}from'./onchain-constants.js';export function identifyNodeRole(a){const b=a['all_pairs']??[],c=(a['pairs']??b)['filter'](i=>i['prev_node']===a['name']),d=b['filter'](i=>i['next_node']===a['name']),e=b['some'](i=>i['prev_node']===''&&i['next_node']===a['name']),f=c['length']===0x0;if(e)return'entry';if(f)return'terminal';const g=new Set(c['map'](i=>i['next_node']));if(g['size']>0x1)return'branch';const h=new Set(d['map'](i=>i['prev_node'])['filter'](i=>i!==''));if(h['size']>0x1)return'merge';return'normal';}function explainGuardBinding(a){return{'address':a,'immutable_required':!![],'note':'Guard\x20'+a+'\x20validates\x20this\x20Forward\x27s\x20execution;\x20'+'must\x20be\x20immutable\x20(b_immutable=true)\x20and\x20pre-created\x20on-chain.'};}export function explainNode(a){const b=a['pairs']??[];return{'name':a['name'],'role':identifyNodeRole(a),'pairs':b['map'](c=>explainPair(c)),'description':a['description']};}export function explainPair(a){return{'prev_node':a['prev_node'],'next_node':a['next_node'],'threshold':a['threshold'],'execution_pattern':identifyExecutionMode(a),'forwards':a['forwards']['map'](b=>explainForward(b))};}export function explainForward(a){return{'name':a['name'],'permission':explainForwardPermission(a),'weight':a['weight'],'guard':a['guard']?explainGuardBinding(a['guard']):null,'retained_submission':a['retained_submission']??null};}
@@ -1,5 +1,7 @@
1
1
  import { ONCHAIN_CONSTANTS, MAX_NODE_COUNT, MAX_NODE_COUNT_ONCHAIN, MAX_FORWARD_COUNT, MAX_FORWARD_ORDER_COUNT, MAX_NODE_PAIR_COUNT, MAX_CONSENSUS_REPOSITORIES_COUNT, USER_DEFINED_PERM_INDEX_START, MAX_PERM_FOR_ENTITY, MAX_ADMIN_COUNT, MAX_ITEM_COUNT, ROLE_OWNER, ROLE_ADMIN, ROLE_ENTITY, MAX_AGENT_COUNT, MAX_DISPUTE_COUNT, MAX_SHARING_COUNT, MAX_VOTING_GUARD_COUNT, MAX_POLICY_COUNT, MAX_ID_COUNT_ONCE, MAX_REWARD_COUNT, MAX_GUARD_COUNT_REWARD, MAX_RECORD_COUNT_REWARD, MAX_CONTEXT_REPOSITORY_COUNT, MAX_NAMED_OPERATOR_COUNT, MAX_NAMED_OPERATOR_ADDRESS_COUNT, MAX_IM_COUNT, MAX_TAGS_COUNT, MAX_RECIPIENT_COUNT, MAX_PROPOSITION_COUNT, MAX_VOTOR_COUNT, MAX_OBJECTION_ROUNDS, WITHDRAW_DURATION_TIME, MAX_ADDRESS_COUNT, MAX_RECORD_LENGTH, BRIDGE_MESSAGE_VERSION, BRIDGE_EVM_ADDRESS_LENGTH, BRIDGE_CURRENT_VERSION, BRIDGE_TRANSFER_STATUS_PENDING, BRIDGE_TRANSFER_STATUS_APPROVED, BRIDGE_TRANSFER_STATUS_CLAIMED, BRIDGE_TRANSFER_STATUS_NOT_FOUND, MAX_INDEMNITY_MULTIPLE, MAX_PRESENTER_COUNT, MAX_INPUT_SIZE, MAX_TABLE_SIZE, MAX_DEPENDED_COUNT, MAX_DISCOUNT_TOTAL_COUNT, MAX_USER_IDENTIFIER, type OnchainConstantName, type MaxNodeCountSdkLiteral } from "@wowok/wowok";
2
+ import { REGISTRAR_ADDRESS, ENTITY_OBJECT_ADDRESS } from "@wowok/wowok";
2
3
  export { ONCHAIN_CONSTANTS, MAX_NODE_COUNT, MAX_NODE_COUNT_ONCHAIN, MAX_FORWARD_COUNT, MAX_FORWARD_ORDER_COUNT, MAX_NODE_PAIR_COUNT, MAX_CONSENSUS_REPOSITORIES_COUNT, USER_DEFINED_PERM_INDEX_START, MAX_PERM_FOR_ENTITY, MAX_ADMIN_COUNT, MAX_ITEM_COUNT, ROLE_OWNER, ROLE_ADMIN, ROLE_ENTITY, MAX_AGENT_COUNT, MAX_DISPUTE_COUNT, MAX_SHARING_COUNT, MAX_VOTING_GUARD_COUNT, MAX_POLICY_COUNT, MAX_ID_COUNT_ONCE, MAX_REWARD_COUNT, MAX_GUARD_COUNT_REWARD, MAX_RECORD_COUNT_REWARD, MAX_CONTEXT_REPOSITORY_COUNT, MAX_NAMED_OPERATOR_COUNT, MAX_NAMED_OPERATOR_ADDRESS_COUNT, MAX_IM_COUNT, MAX_TAGS_COUNT, MAX_RECIPIENT_COUNT, MAX_PROPOSITION_COUNT, MAX_VOTOR_COUNT, WITHDRAW_DURATION_TIME, MAX_INDEMNITY_MULTIPLE, MAX_PRESENTER_COUNT, MAX_INPUT_SIZE, MAX_TABLE_SIZE, MAX_DEPENDED_COUNT, MAX_DISCOUNT_TOTAL_COUNT, MAX_USER_IDENTIFIER, MAX_ADDRESS_COUNT, MAX_RECORD_LENGTH, MAX_OBJECTION_ROUNDS, BRIDGE_MESSAGE_VERSION, BRIDGE_EVM_ADDRESS_LENGTH, BRIDGE_CURRENT_VERSION, BRIDGE_TRANSFER_STATUS_PENDING, BRIDGE_TRANSFER_STATUS_APPROVED, BRIDGE_TRANSFER_STATUS_CLAIMED, BRIDGE_TRANSFER_STATUS_NOT_FOUND, type OnchainConstantName, type MaxNodeCountSdkLiteral, };
4
+ export { REGISTRAR_ADDRESS, ENTITY_OBJECT_ADDRESS, };
3
5
  export declare const TASK_BINDING_SLOT = 254;
4
6
  export declare const ONCE_SLOT_BYTES = 255;
5
7
  export declare const ONCHAIN_CONSTANT_MCP_CONSUMERS: Record<string, string[]>;
@@ -1 +1 @@
1
- import{ONCHAIN_CONSTANTS,MAX_NODE_COUNT,MAX_NODE_COUNT_ONCHAIN,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT,MAX_NODE_PAIR_COUNT,MAX_CONSENSUS_REPOSITORIES_COUNT,USER_DEFINED_PERM_INDEX_START,MAX_PERM_FOR_ENTITY,MAX_ADMIN_COUNT,MAX_ITEM_COUNT,ROLE_OWNER,ROLE_ADMIN,ROLE_ENTITY,MAX_AGENT_COUNT,MAX_DISPUTE_COUNT,MAX_SHARING_COUNT,MAX_VOTING_GUARD_COUNT,MAX_POLICY_COUNT,MAX_ID_COUNT_ONCE,MAX_REWARD_COUNT,MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD,MAX_CONTEXT_REPOSITORY_COUNT,MAX_NAMED_OPERATOR_COUNT,MAX_NAMED_OPERATOR_ADDRESS_COUNT,MAX_IM_COUNT,MAX_TAGS_COUNT,MAX_RECIPIENT_COUNT,MAX_PROPOSITION_COUNT,MAX_VOTOR_COUNT,MAX_OBJECTION_ROUNDS,WITHDRAW_DURATION_TIME,MAX_ADDRESS_COUNT,MAX_RECORD_LENGTH,BRIDGE_MESSAGE_VERSION,BRIDGE_EVM_ADDRESS_LENGTH,BRIDGE_CURRENT_VERSION,BRIDGE_TRANSFER_STATUS_PENDING,BRIDGE_TRANSFER_STATUS_APPROVED,BRIDGE_TRANSFER_STATUS_CLAIMED,BRIDGE_TRANSFER_STATUS_NOT_FOUND,MAX_INDEMNITY_MULTIPLE,MAX_PRESENTER_COUNT,MAX_INPUT_SIZE,MAX_TABLE_SIZE,MAX_DEPENDED_COUNT,MAX_DISCOUNT_TOTAL_COUNT,MAX_USER_IDENTIFIER}from'@wowok/wowok';export{ONCHAIN_CONSTANTS,MAX_NODE_COUNT,MAX_NODE_COUNT_ONCHAIN,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT,MAX_NODE_PAIR_COUNT,MAX_CONSENSUS_REPOSITORIES_COUNT,USER_DEFINED_PERM_INDEX_START,MAX_PERM_FOR_ENTITY,MAX_ADMIN_COUNT,MAX_ITEM_COUNT,ROLE_OWNER,ROLE_ADMIN,ROLE_ENTITY,MAX_AGENT_COUNT,MAX_DISPUTE_COUNT,MAX_SHARING_COUNT,MAX_VOTING_GUARD_COUNT,MAX_POLICY_COUNT,MAX_ID_COUNT_ONCE,MAX_REWARD_COUNT,MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD,MAX_CONTEXT_REPOSITORY_COUNT,MAX_NAMED_OPERATOR_COUNT,MAX_NAMED_OPERATOR_ADDRESS_COUNT,MAX_IM_COUNT,MAX_TAGS_COUNT,MAX_RECIPIENT_COUNT,MAX_PROPOSITION_COUNT,MAX_VOTOR_COUNT,WITHDRAW_DURATION_TIME,MAX_INDEMNITY_MULTIPLE,MAX_PRESENTER_COUNT,MAX_INPUT_SIZE,MAX_TABLE_SIZE,MAX_DEPENDED_COUNT,MAX_DISCOUNT_TOTAL_COUNT,MAX_USER_IDENTIFIER,MAX_ADDRESS_COUNT,MAX_RECORD_LENGTH,MAX_OBJECTION_ROUNDS,BRIDGE_MESSAGE_VERSION,BRIDGE_EVM_ADDRESS_LENGTH,BRIDGE_CURRENT_VERSION,BRIDGE_TRANSFER_STATUS_PENDING,BRIDGE_TRANSFER_STATUS_APPROVED,BRIDGE_TRANSFER_STATUS_CLAIMED,BRIDGE_TRANSFER_STATUS_NOT_FOUND};export const TASK_BINDING_SLOT=0xfe;export const ONCE_SLOT_BYTES=0xff;export const ONCHAIN_CONSTANT_MCP_CONSUMERS={'MAX_NODE_COUNT':['machine-topology.ts\x20(within_limits\x20check)','machine-risk.ts\x20R-M1-07','machine-translation.ts\x20MC-C-01','knowledge/index.ts\x20(max_node_count\x20field)'],'MAX_FORWARD_ORDER_COUNT':[],'MAX_NODE_PAIR_COUNT':['machine-topology.ts\x20(within_limits\x20check)'],'USER_DEFINED_PERM_INDEX_START':['machine-risk.ts\x20R-M3-08','guard-risk.ts\x20(forward\x20permissionIndex\x20guidance)'],'MAX_VOTING_GUARD_COUNT':['evaluation/builtins/arbitration-score.ts\x20(fairness_governance\x20reason)'],'MAX_ITEM_COUNT':['permission-context.ts\x20(entity_permission\x20reverse\x20index)'],'ROLE_OWNER':['permission-context.ts\x20(entity_permission\x20role\x20flags)'],'ROLE_ADMIN':['permission-context.ts\x20(entity_permission\x20role\x20flags)'],'ROLE_ENTITY':['permission-context.ts\x20(entity_permission\x20role\x20flags)']};export function getOnchainConstant(a){const b=ONCHAIN_CONSTANTS[a];if(b===undefined)throw new Error('Unknown\x20on-chain\x20constant:\x20'+String(a));return b;}
1
+ import{ONCHAIN_CONSTANTS,MAX_NODE_COUNT,MAX_NODE_COUNT_ONCHAIN,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT,MAX_NODE_PAIR_COUNT,MAX_CONSENSUS_REPOSITORIES_COUNT,USER_DEFINED_PERM_INDEX_START,MAX_PERM_FOR_ENTITY,MAX_ADMIN_COUNT,MAX_ITEM_COUNT,ROLE_OWNER,ROLE_ADMIN,ROLE_ENTITY,MAX_AGENT_COUNT,MAX_DISPUTE_COUNT,MAX_SHARING_COUNT,MAX_VOTING_GUARD_COUNT,MAX_POLICY_COUNT,MAX_ID_COUNT_ONCE,MAX_REWARD_COUNT,MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD,MAX_CONTEXT_REPOSITORY_COUNT,MAX_NAMED_OPERATOR_COUNT,MAX_NAMED_OPERATOR_ADDRESS_COUNT,MAX_IM_COUNT,MAX_TAGS_COUNT,MAX_RECIPIENT_COUNT,MAX_PROPOSITION_COUNT,MAX_VOTOR_COUNT,MAX_OBJECTION_ROUNDS,WITHDRAW_DURATION_TIME,MAX_ADDRESS_COUNT,MAX_RECORD_LENGTH,BRIDGE_MESSAGE_VERSION,BRIDGE_EVM_ADDRESS_LENGTH,BRIDGE_CURRENT_VERSION,BRIDGE_TRANSFER_STATUS_PENDING,BRIDGE_TRANSFER_STATUS_APPROVED,BRIDGE_TRANSFER_STATUS_CLAIMED,BRIDGE_TRANSFER_STATUS_NOT_FOUND,MAX_INDEMNITY_MULTIPLE,MAX_PRESENTER_COUNT,MAX_INPUT_SIZE,MAX_TABLE_SIZE,MAX_DEPENDED_COUNT,MAX_DISCOUNT_TOTAL_COUNT,MAX_USER_IDENTIFIER}from'@wowok/wowok';import{REGISTRAR_ADDRESS,ENTITY_OBJECT_ADDRESS}from'@wowok/wowok';export{ONCHAIN_CONSTANTS,MAX_NODE_COUNT,MAX_NODE_COUNT_ONCHAIN,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT,MAX_NODE_PAIR_COUNT,MAX_CONSENSUS_REPOSITORIES_COUNT,USER_DEFINED_PERM_INDEX_START,MAX_PERM_FOR_ENTITY,MAX_ADMIN_COUNT,MAX_ITEM_COUNT,ROLE_OWNER,ROLE_ADMIN,ROLE_ENTITY,MAX_AGENT_COUNT,MAX_DISPUTE_COUNT,MAX_SHARING_COUNT,MAX_VOTING_GUARD_COUNT,MAX_POLICY_COUNT,MAX_ID_COUNT_ONCE,MAX_REWARD_COUNT,MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD,MAX_CONTEXT_REPOSITORY_COUNT,MAX_NAMED_OPERATOR_COUNT,MAX_NAMED_OPERATOR_ADDRESS_COUNT,MAX_IM_COUNT,MAX_TAGS_COUNT,MAX_RECIPIENT_COUNT,MAX_PROPOSITION_COUNT,MAX_VOTOR_COUNT,WITHDRAW_DURATION_TIME,MAX_INDEMNITY_MULTIPLE,MAX_PRESENTER_COUNT,MAX_INPUT_SIZE,MAX_TABLE_SIZE,MAX_DEPENDED_COUNT,MAX_DISCOUNT_TOTAL_COUNT,MAX_USER_IDENTIFIER,MAX_ADDRESS_COUNT,MAX_RECORD_LENGTH,MAX_OBJECTION_ROUNDS,BRIDGE_MESSAGE_VERSION,BRIDGE_EVM_ADDRESS_LENGTH,BRIDGE_CURRENT_VERSION,BRIDGE_TRANSFER_STATUS_PENDING,BRIDGE_TRANSFER_STATUS_APPROVED,BRIDGE_TRANSFER_STATUS_CLAIMED,BRIDGE_TRANSFER_STATUS_NOT_FOUND};export{REGISTRAR_ADDRESS,ENTITY_OBJECT_ADDRESS};export const TASK_BINDING_SLOT=0xfe;export const ONCE_SLOT_BYTES=0xff;export const ONCHAIN_CONSTANT_MCP_CONSUMERS={'MAX_NODE_COUNT':['machine\x20topology\x20limits\x20check','machine\x20design\x20review\x20R-M1-07','machine\x20translation\x20review\x20MC-C-01','knowledge\x20index\x20(max_node_count\x20field)'],'MAX_FORWARD_ORDER_COUNT':[],'MAX_NODE_PAIR_COUNT':['machine\x20topology\x20limits\x20check'],'USER_DEFINED_PERM_INDEX_START':['machine\x20design\x20review\x20R-M3-08','guard\x20risk\x20review\x20(forward\x20permissionIndex\x20guidance)'],'MAX_VOTING_GUARD_COUNT':['arbitration\x20score\x20evaluation\x20(fairness_governance\x20reason)'],'MAX_ITEM_COUNT':['permission\x20context\x20builder\x20(entity_permission\x20reverse\x20index)'],'ROLE_OWNER':['permission\x20context\x20builder\x20(entity_permission\x20role\x20flags)'],'ROLE_ADMIN':['permission\x20context\x20builder\x20(entity_permission\x20role\x20flags)'],'ROLE_ENTITY':['permission\x20context\x20builder\x20(entity_permission\x20role\x20flags)']};export function getOnchainConstant(a){const b=ONCHAIN_CONSTANTS[a];if(b===undefined)throw new Error('Unknown\x20on-chain\x20constant:\x20'+String(a));return b;}
@@ -1 +1 @@
1
- export const ORDER_FIELDS=[{'move_name':'id','sdk_name':'id','move_type':'UID','mutability_layer':0x1,'description':'Order\x20unique\x20ID'},{'move_name':'items','sdk_name':'items','move_type':'vector<SaleItem>','mutability_layer':0x1,'description':'Purchased\x20items\x20(created-immutable)'},{'move_name':'discount','sdk_name':'discount','move_type':'Option<address>','mutability_layer':0x1,'description':'Discount\x20object\x20address\x20(created-immutable)'},{'move_name':'progress','sdk_name':'progress','move_type':'Option<address>','mutability_layer':0x2,'description':'Progress\x20object\x20address\x20(one-time-set\x20when\x20the\x20Progress\x20binds)'},{'move_name':'machine','sdk_name':'machine','move_type':'Option<address>','mutability_layer':0x1,'description':'Machine\x20snapshot\x20copied\x20from\x20service.machine\x20at\x20buy\x20time'},{'move_name':'amount','sdk_name':'amount','move_type':'u64','mutability_layer':0x1,'description':'Order\x20amount\x20in\x20MIST\x20(created-immutable)'},{'move_name':'owner','sdk_name':'builder','move_type':'address','mutability_layer':0x4,'description':'Order\x20owner\x20/\x20buyer.\x20Mutable\x20at\x20ANY\x20time\x20via\x20an\x20ownership\x20transfer\x20(L1,\x20E_NOT_THE_OWNER).\x20⚠️\x20SDK\x20field\x20name\x20is\x20\x27builder\x27\x20(only\x20naming\x20deviation\x20in\x2022\x20objects)'},{'move_name':'service','sdk_name':'service','move_type':'address','mutability_layer':0x1,'description':'Service\x20object\x20address\x20(created-immutable,\x20reference\x20only)'},{'move_name':'dispute','sdk_name':'dispute','move_type':'vector<address>','mutability_layer':0x4,'description':'Arb\x20object\x20addresses\x20(append-only,\x20max\x2010,\x20frozen\x20when\x20claimed_by\x20set)'},{'move_name':'agent','sdk_name':'agent','move_type':'vector<address>','mutability_layer':0x4,'description':'Agent\x20addresses\x20(max\x2010\x20distinct\x20per\x20call\x20—\x20input\x20deduped\x20on-chain;\x20setting\x20the\x20list\x20REPLACES\x20it\x20at\x20any\x20time,\x20no\x20progress\x20freeze)'},{'move_name':'allocation','sdk_name':'allocation','move_type':'Option<address>','mutability_layer':0x2,'description':'Allocation\x20object\x20address\x20(one-time-set\x20when\x20the\x20Allocation\x20binds)'},{'move_name':'claimed_by','sdk_name':'claimed_by','move_type':'Option<address>','mutability_layer':0x2,'description':'Claimed\x20Arb\x20object\x20address\x20(one-time,\x20irreversible;\x20blocks\x20new\x20disputes)'},{'move_name':'required_info','sdk_name':'required_info','move_type':'Option<address>','mutability_layer':0x4,'description':'Contact\x20(recipient)\x20or\x20WTS\x20Proof\x20(delivery\x20proof);\x20owner-only.\x20The\x20controlled\x20bind\x20entry\x20additionally\x20chain-verifies\x20the\x20Proof\x20is\x20about\x20THIS\x20order\x20and\x20owner-created\x20(E_REQUIRED_INFO_PROOF_NOT_BOUND\x20otherwise).'},{'move_name':'time','sdk_name':'time','move_type':'u64','mutability_layer':0x1,'description':'Creation\x20timestamp\x20(clock::timestamp_ms)'}];export const ORDER_STATES=['CREATED','IN_PROGRESS','DISPUTED','CLAIMED','COMPLETED','CANCELLED'];export const ORDER_STATE_TRANSITIONS=[{'from':'CREATED','to':'IN_PROGRESS','trigger':'buy\x20(with\x20machine)\x20→\x20the\x20Progress\x20object\x20is\x20set\x20at\x20creation'},{'from':'CREATED','to':'DISPUTED','trigger':'arb_confirm\x20→\x20dispute()\x20appends\x20Arb\x20address'},{'from':'CREATED','to':'COMPLETED','trigger':'Progress\x20reaches\x20terminal\x20(no\x20machine\x20path)\x20or\x20manual'},{'from':'IN_PROGRESS','to':'DISPUTED','trigger':'arb_confirm\x20→\x20dispute()\x20appends\x20Arb\x20address'},{'from':'IN_PROGRESS','to':'COMPLETED','trigger':'Progress\x20reaches\x20terminal\x20node'},{'from':'IN_PROGRESS','to':'CANCELLED','trigger':'Progress\x20reaches\x20cancel\x20node'},{'from':'DISPUTED','to':'CLAIMED','trigger':'arb_claim_compensation\x20→\x20compensate()\x20sets\x20claimed_by\x20(buyer-favored\x20award)'},{'from':'DISPUTED','to':'CLAIMED','trigger':'arb_case_conclude\x20→\x20the\x20dismissal\x20conclusion\x20sets\x20claimed_by\x20=\x20case\x20address\x20(defendant-favored)'},{'from':'DISPUTED','to':'COMPLETED','trigger':'Arb\x20resolution\x20+\x20Progress\x20terminal'},{'from':'DISPUTED','to':'CANCELLED','trigger':'Arb\x20resolution\x20=\x20cancel'}];export const ORDER_LIFECYCLE_EVENTS=[{'name':'NewOrderEvent','trigger':'buy\x20flow\x20phase\x205\x20(the\x20order\x20record\x20is\x20created)','emit_source':'order\x20creation\x20inside\x20the\x20buy\x20transaction','actually_emitted':!![],'fields':['object','service','progress','discount','allocation','amount']},{'name':'OrderCompletedEvent','trigger':'Progress\x20reaches\x20terminal','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','completion_time']},{'name':'OrderCancelledEvent','trigger':'Progress\x20reaches\x20cancel','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','cancel_reason']},{'name':'OrderAdvancedEvent','trigger':'order.progress\x20forward','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','from_node','to_node']},{'name':'OrderDisputeAppendedEvent','trigger':'arb_confirm\x20→\x20dispute()','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','arb']},{'name':'OrderClaimedEvent','trigger':'arb_claim_compensation\x20→\x20compensate()','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','arb','claimed_by']},{'name':'OwnerChangedEvent','trigger':'ownership\x20transfer\x20/\x20transfer_to','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','old_owner','new_owner']},{'name':'AgentSetEvent','trigger':'setting\x20the\x20agent\x20list','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','agent_list']},{'name':'RequiredInfoUpdatedEvent','trigger':'updating\x20required_info','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','required_info']},{'name':'AllocationBoundEvent','trigger':'allocation\x20binding','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','allocation']},{'name':'ProgressBoundEvent','trigger':'progress\x20binding','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','progress']}];export const ORDER_PERMISSION_MATRIX=[{'operation':'owner_receive\x20/\x20receive','move_function':'receive\x20CoinWrapper\x20/\x20receive\x20Receiving\x20object','layer':'L4_object_gated','aborts_with':'EPAYMENT_NOT_MATCH','notes':'Gated\x20by\x20Receiving\x20existence,\x20NOT\x20by\x20an\x20owner\x20assert:\x20the\x20allocation\x20payout\x20must\x20have\x20run\x20and\x20created\x20a\x20Receiving\x20at\x20the\x20caller\x27s\x20address.\x20No\x20owner\x20assert\x20—\x20funds\x20ALWAYS\x20go\x20to\x20order.owner\x20regardless\x20of\x20caller.\x20Receiving\x20must\x20match\x20the\x20Payment\x20object\x20(EPAYMENT_NOT_MATCH).'},{'operation':'transfer_to\x20(ownership\x20transfer)','move_function':'transfer\x20the\x20order\x20to\x20a\x20new\x20owner','layer':'L1_owner_only','aborts_with':'E_NOT_THE_OWNER','notes':'Irreversible.\x20New\x20owner\x20takes\x20over\x20ALL\x20permissions.\x20NOT\x20frozen\x20after\x20progress\x20binding.'},{'operation':'agent\x20(set\x20agent\x20list)','move_function':'set\x20the\x20agent\x20list\x20(replaces\x20all)','layer':'L1_owner_only','aborts_with':'E_NOT_THE_OWNER,\x20E_MAX_AGENT_COUNT','notes':'REPLACES\x20the\x20whole\x20agent\x20list\x20(not\x20append).\x20Max\x2010\x20distinct\x20agents\x20(assert\x20length\x20<\x20MAX_AGENT_COUNT\x20before\x20each\x20push).\x20NOT\x20frozen\x20after\x20progress\x20binding.'},{'operation':'update\x20required_info','move_function':'set\x20or\x20clear\x20required_info\x20(Contact\x20/\x20WTS\x20Proof)','layer':'L1_owner_only','aborts_with':'E_NOT_THE_OWNER','notes':'Owner-only.\x20Agent\x20CANNOT\x20update\x20required_info.'},{'operation':'bind\x20required_info\x20(controlled)','move_function':'bind\x20a\x20WTS\x20Proof\x20to\x20the\x20order\x20(write\x20only\x20when\x20Proof-about==order\x20&&\x20Proof-creator==owner)','layer':'L1_owner_only','aborts_with':'E_NOT_THE_OWNER,\x20E_REQUIRED_INFO_PROOF_NOT_BOUND\x20(11)','notes':'MOV-PROTOCOL-1212\x20(11):\x20chain-enforced\x20per-order\x20binding.\x20On\x20mismatch\x20NOTHING\x20is\x20written.\x20Coexists\x20with\x20the\x20plain\x20update\x20above\x20—\x20the\x20reuse\x20model\x20(one\x20contact\x20Proof\x20across\x20orders)\x20stays\x20the\x20privacy-preserving\x20default;\x20bind\x20is\x20for\x20listings\x20that\x20promise\x20a\x20per-order\x20credential.'},{'operation':'progress\x20(advance)','move_function':'(progress::operate)','layer':'L2_owner_or_agent','aborts_with':'E_NOT_OP_PERMISSION','notes':'Both\x20owner\x20and\x20agent\x20can\x20advance\x20Progress.'},{'operation':'arb_confirm','move_function':'(file\x20for\x20arbitration)','layer':'L2_owner_or_agent','aborts_with':'E_NOT_OP_PERMISSION,\x20E_STATUS_NOT_MATCH,\x20E_ARB_ORDER_NOT_MATCH,\x20E_ORDER_ALREADY_CLAIMED','notes':'Both\x20can\x20file\x20arbitration.\x20confirmed=true\x20additionally\x20asserts\x20claimed_by\x20is\x20none.\x20Irreversible.'},{'operation':'arb_objection','move_function':'the\x20clock-carrying\x20objection\x20entry\x20(always\x20on\x20since\x20protocol\x20135)','layer':'L2_owner_or_agent','aborts_with':'E_NOT_OP_PERMISSION,\x20E_ORDER_ALREADY_CLAIMED,\x20E_STATUS_NOT_MATCH,\x20E_ARB_ORDER_NOT_MATCH,\x20E_OBJECTION_WINDOW_PASSED\x20(13),\x20E_OBJECTION_ROUNDS_EXCEEDED\x20(14)','notes':'Both\x20can\x20object\x20to\x20Arb\x20ruling.\x20Requires\x20Arb\x20status\x20==\x20Arbitrated.\x20The\x20entry\x20enforces\x20the\x20challenge\x20window\x20(ruling\x20time\x20+\x20WITHDRAW_DURATION_TIME\x20—\x20\x27silence\x20=\x20acceptance\x27\x20has\x20already\x20released\x20the\x20fee\x20after\x20that)\x20and\x20a\x20per-case\x20round\x20cap\x20of\x20MAX_OBJECTION_ROUNDS\x20=\x203\x20objections\x20EVER\x20(counter\x20stored\x20on\x20the\x20Arb\x20object).\x20Irreversible.'},{'operation':'arb_case_conclude\x20(dismissal\x20conclusion)','move_function':'the\x20dismissal\x20conclusion\x20(the\x20defendant-favored\x20mirror\x20of\x20the\x20compensation\x20claim)','layer':'L4_object_gated','aborts_with':'E_ORDER_SERVICE_NOT_MATCH,\x20E_ARBITRATION_NOT_ALLOWED,\x20E_ARBITRATION_PERMISSION_CONFLICT,\x20E_CASE_NOT_DISMISSAL_CONCLUSION\x20(48),\x20E_ORDER_ALREADY_CLAIMED','notes':'F-BS-54/56,\x20always\x20on\x20since\x20protocol\x20135.\x20No\x20op-permission\x20assert\x20—\x20permissionless\x20keeper\x20surface\x20gated\x20by\x20Arb\x20state:\x20the\x20case\x20must\x20be\x20CONCLUDED\x20(Arbitrated\x20or\x20Withdrawn)\x20AND\x20DEFENDANT-FAVORED\x20(indemnity\x20none\x20or\x200).\x20Stamps\x20claimed_by\x20=\x20case\x20address,\x20closing\x20every\x20`claimed_by\x20none`\x20refund\x20rail\x20for\x20a\x20buyer\x20who\x20LOST\x20the\x20case\x20(before\x20154\x20a\x20dismissal\x20ruling\x20left\x20those\x20rails\x20open\x20forever).\x20Writes\x20a\x20flag,\x20moves\x20no\x20funds.\x20One-time,\x20irreversible.'},{'operation':'arb_claim_compensation','move_function':'(claim\x20the\x20compensation)','layer':'L4_object_gated','aborts_with':'E_ORDER_SERVICE_NOT_MATCH,\x20E_ARBITRATION_ARB_NOT_MATCH,\x20E_STATUS_NOT_MATCH,\x20E_ARB_ORDER_NOT_MATCH,\x20E_COMPENSATION_NOT_MATCH,\x20E_ORDER_ALREADY_CLAIMED','notes':'No\x20op-permission\x20assert\x20—\x20gated\x20by\x20Arb\x20status\x20(must\x20be\x20Arbirated,\x20ruling\x20final).\x20Compensation\x20is\x20paid\x20to\x20the\x20order\x20owner\x20(permissionless\x20keeper\x20—\x20the\x20sender\x20never\x20receives).\x20Sets\x20claimed_by\x20—\x20one-time,\x20irreversible.\x20The\x20claim\x20does\x20NOT\x20seal\x20the\x20order:\x20the\x20owner\x20receive\x20entries\x20are\x20deliberately\x20ungated\x20(order.move:213-234),\x20so\x20any\x20escrow\x20balance\x20left\x20on\x20the\x20order\x20stays\x20claimable\x20unless\x20the\x20refund\x20allocator\x27s\x20guard\x20is\x20gated\x20on\x20order.claimed_by\x20some==false;\x20the\x20provider\x20release\x20track\x20(direct\x20transfer)\x20stays\x20usable.'},{'operation':'progress\x20binding\x20(package-only)','move_function':'bind\x20the\x20Progress\x20object\x20(package\x20write-back)','layer':'L3_package_only','aborts_with':'E_PROGRESS_ALREADY_SPECIFIED','notes':'Progress\x20module\x20writes\x20back.\x20No\x20external\x20access.'},{'operation':'allocation\x20binding\x20(package-only)','move_function':'bind\x20the\x20Allocation\x20object\x20(package\x20write-back)','layer':'L3_package_only','aborts_with':'E_ALLOCATION_ALREADY_SPECIFIED','notes':'Allocation\x20module\x20writes\x20back.\x20No\x20external\x20access.'},{'operation':'dispute\x20(package-only)','move_function':'dispute','layer':'L3_package_only','aborts_with':'E_ORDER_ALREADY_CLAIMED,\x20E_MAX_DISPUTE_COUNT','notes':'Arbitration\x20module\x20appends\x20Arb\x20address.'},{'operation':'compensate\x20(package-only)','move_function':'compensate','layer':'L3_package_only','aborts_with':'E_ORDER_ALREADY_CLAIMED','notes':'Arbitration\x20module\x20sets\x20claimed_by.\x20Irreversible.'}];export const ORDER_SCENES=[{'id':'order_create','name':'Create\x20order\x20via\x20a\x20service\x20purchase\x20(composite\x20creation)','operation_field':'object','move_entry':'buy\x20flow:\x20order\x20record\x20created\x20inside\x20the\x20service\x20purchase\x20transaction','permission_layer':'L3_package_only','reversibility':'irreversible','governed_operations':['buy\x20(items,\x20discount,\x20machine_forward?,\x20named_order?)','order\x20record\x20creation\x20(package-only)','allocation\x20creation\x20+\x20binding\x20(if\x20order_allocators\x20configured)','progress\x20creation\x20+\x20binding\x20(if\x20machine\x20configured)','order\x20record\x20created\x20+\x20NewOrderEvent\x20emitted'],'common_patterns':['Composite\x20creation:\x20Order\x20+\x20Allocation\x20+\x20Progress\x20in\x20one\x20transaction','Service.machine\x20is\x20SNAPSHOTTED\x20to\x20order.machine\x20(not\x20a\x20reference)','owner\x20=\x20tx_context::sender\x20(buyer);\x20agent\x20=\x20[]\x20initially','Allotment\x206\x20phases\x20are\x20atomic\x20—\x20any\x20failure\x20rolls\x20back\x20fully'],'related_risks':['R-O-1-05','R-O-2-01','R-O-4-01','R-O-5-01'],'recommended_templates':['T-O-01','T-O-02','T-O-03']},{'id':'order_advance','name':'Advance\x20Progress\x20(forward/hold)','operation_field':'progress','move_entry':'progress::operate\x20(via\x20order.progress\x20delegation)','permission_layer':'L2_owner_or_agent','reversibility':'irreversible','governed_operations':['progress.operation.next_node_name\x20+\x20forward','progress.op\x20(next/hold/unhold/adminUnhold)','progress.message\x20(optional)'],'common_patterns':['Both\x20owner\x20and\x20agent\x20can\x20advance\x20—\x20agent\x20enables\x20third-party\x20logistics','Node\x20transition\x20is\x20irreversible\x20(no\x20backward\x20movement)','Forward.guard\x20may\x20require\x20Guard\x20submission'],'related_risks':['R-O-3-02','R-O-4-03','R-O-5-03'],'recommended_templates':['T-O-02']},{'id':'order_set_agent','name':'Set\x20agent\x20list\x20(owner-only,\x20replaces\x20entire\x20list)','operation_field':'agent','move_entry':'set\x20the\x20agent\x20list\x20(owner-only)','permission_layer':'L1_owner_only','reversibility':'reversible','governed_operations':['set\x20the\x20agent\x20list\x20(overwrites\x20entire\x20agent\x20list)'],'common_patterns':['Setting\x20the\x20agent\x20list\x20REPLACES\x20the\x20whole\x20list\x20—\x20agents\x20omitted\x20from\x20the\x20new\x20list\x20silently\x20lose\x20access\x20(old\x20agent\x20role\x20records\x20are\x20removed\x20from\x20EntityOrders)','Max\x2010\x20distinct\x20agents\x20per\x20call\x20(E_MAX_AGENT_COUNT,\x20assert\x20length\x20<\x20MAX_AGENT_COUNT\x20before\x20each\x20push)','Can\x20be\x20called\x20at\x20ANY\x20time\x20—\x20NOT\x20frozen\x20after\x20Progress\x20binding','Agents\x20can\x20operate\x20the\x20order\x20(L2\x20ops)\x20but\x20CANNOT\x20change\x20owner\x20or\x20required_info\x20(L1\x20ops)'],'related_risks':['R-O-1-04','R-O-3-01','R-O-4-02'],'recommended_templates':['T-O-03']},{'id':'order_required_info','name':'Update\x20required_info\x20(Contact\x20or\x20WTS\x20Proof)','operation_field':'required_info','move_entry':'update\x20required_info\x20(owner-only)','permission_layer':'L1_owner_only','reversibility':'reversible','governed_operations':['update\x20required_info\x20(set\x20Contact\x20or\x20WTS\x20Proof\x20address)','required_info\x20=\x20null\x20(clear)'],'common_patterns':['Contact\x20object\x20=\x20recipient\x20info\x20(shipping\x20address)','WTS\x20Proof\x20object\x20=\x20delivery\x20proof\x20(via\x20Wowok\x20Messenger)','Owner-only\x20—\x20agent\x20CANNOT\x20update\x20required_info'],'related_risks':['R-O-3-02'],'recommended_templates':['T-O-01']},{'id':'order_arb_confirm','name':'Apply\x20for\x20arbitration\x20compensation','operation_field':'arb_confirm','move_entry':'arb_confirm\x20flow\x20(confirm\x20/\x20description\x20/\x20proposition)','permission_layer':'L2_owner_or_agent','reversibility':'irreversible','governed_operations':['arb_confirm.confirm\x20(true=confirm\x20materials,\x20false=deny)','arb_confirm.description\x20(compensation\x20application\x20description)','arb_confirm.proposition\x20(compensation\x20claims\x20list)'],'common_patterns':['Triggers\x20Arb\x20→\x20dispute()\x20appends\x20Arb\x20to\x20order.dispute','Both\x20owner\x20and\x20agent\x20can\x20file\x20—\x20agent\x20useful\x20for\x20representative\x20cases','Once\x20filed,\x20the\x20Arb\x20process\x20is\x20irreversible'],'related_risks':['R-O-3-03','R-O-4-04','R-O-5-04'],'recommended_templates':['T-O-04']},{'id':'order_arb_objection','name':'Object\x20to\x20arbitration\x20result','operation_field':'arb_objection','move_entry':'the\x20clock-carrying\x20objection\x20entry\x20(always\x20on\x20since\x20protocol\x20135)','permission_layer':'L2_owner_or_agent','reversibility':'irreversible','governed_operations':['arb_objection.objection\x20(reason\x20for\x20re-arbitration)'],'common_patterns':['Requires\x20Arb\x20status\x20=\x20Arbitrated\x20(after\x20ruling)','Triggers\x20re-arbitration\x20flow','Both\x20owner\x20and\x20agent\x20can\x20object','The\x20objection\x20entry\x20enforces\x20the\x20challenge\x20window\x20—\x20an\x20objection\x20AFTER\x20ruling\x20time\x20+\x20WITHDRAW_DURATION_TIME\x20(30d,\x20the\x20same\x20clock\x20that\x20releases\x20the\x20case\x20fee\x20under\x20\x27silence\x20=\x20acceptance\x27)\x20aborts\x20E_OBJECTION_WINDOW_PASSED\x20(13)','Round\x20cap:\x20at\x20most\x20MAX_OBJECTION_ROUNDS\x20=\x203\x20objections\x20per\x20case\x20EVER\x20(counter\x20stored\x20on\x20the\x20Arb\x20object)\x20—\x20the\x20fourth\x20aborts\x20E_OBJECTION_ROUNDS_EXCEEDED\x20(14);\x20without\x20the\x20cap\x20a\x20losing\x20side\x20could\x20erase\x20any\x20ruling\x20forever'],'related_risks':['R-O-3-03','R-O-4-04'],'recommended_templates':['T-O-04']},{'id':'order_arb_case_conclude','name':'Conclude\x20a\x20dismissed\x20case\x20onto\x20the\x20order\x20(defendant-favored,\x20irreversible)','operation_field':'arb_case_conclude','move_entry':'the\x20dismissal\x20conclusion\x20(defendant-favored\x20mirror\x20of\x20the\x20compensation\x20claim)','permission_layer':'L4_object_gated','reversibility':'irreversible','governed_operations':['arb_case_conclude.arb\x20(the\x20ruled\x20Arb\x20object)','conclude()\x20sets\x20order.claimed_by\x20=\x20case\x20address\x20(no\x20funds\x20move)'],'common_patterns':['⚠️\x20ONE-TIME,\x20IRREVERSIBLE\x20—\x20claimed_by\x20cannot\x20be\x20reset','Closes\x20the\x20hole\x20where\x20a\x20buyer\x20who\x20LOST\x20the\x20case\x20kept\x20every\x20`claimed_by\x20none`\x20refund\x20rail\x20open\x20forever\x20(a\x20dismissal\x20pays\x20nothing,\x20so\x20the\x20zero-indemnity\x20claim\x20gate\x20refuses\x20the\x20claim\x20path\x20and\x20nothing\x20ever\x20stamped\x20claimed_by)','Gated\x20by\x20Arb\x20state,\x20NOT\x20by\x20a\x20permission\x20assert\x20(permissionless\x20keeper\x20surface):\x20the\x20case\x20must\x20be\x20CONCLUDED\x20(Arbitrated\x20or\x20Withdrawn)\x20AND\x20DEFENDANT-FAVORED\x20(indemnity\x20none\x20or\x200)\x20—\x20anything\x20else\x20aborts\x20E_CASE_NOT_DISMISSAL_CONCLUSION\x20(48);\x20the\x20SDK\x20mirrors\x20both\x20predicates\x20locally\x20before\x20building','Merchant-side\x20checks\x20mirror\x20the\x20compensation\x20claim:\x20order\x20belongs\x20to\x20the\x20service,\x20the\x20case\x20sits\x20on\x20the\x20merchant\x27s\x20arbitration\x20allowlist,\x20the\x20Service\x20never\x20judges\x20its\x20own\x20disputes\x20(E_ARBITRATION_PERMISSION_CONFLICT)','Writes\x20a\x20flag\x20and\x20moves\x20NO\x20funds\x20—\x20safe\x20for\x20any\x20keeper\x20to\x20drive\x20at\x20ruling\x20time'],'related_risks':['R-O-3-03','R-O-4-04'],'recommended_templates':['T-O-06']},{'id':'order_arb_claim_compensation','name':'Claim\x20compensation\x20(sets\x20claimed_by,\x20irreversible)','operation_field':'arb_claim_compensation','move_entry':'claim\x20compensation\x20→\x20the\x20order\x20is\x20claimed\x20and\x20compensation\x20paid','permission_layer':'L4_object_gated','reversibility':'irreversible','governed_operations':['arb_claim_compensation.arb\x20(the\x20ruled\x20Arb\x20object)','compensate()\x20sets\x20order.claimed_by\x20=\x20arb'],'common_patterns':['⚠️\x20ONE-TIME,\x20IRREVERSIBLE\x20—\x20claimed_by\x20cannot\x20be\x20reset','After\x20claim,\x20NO\x20new\x20disputes\x20can\x20be\x20filed\x20and\x20the\x20order\x20rejects\x20all\x20further\x20payout\x20claims\x20(owner\x20receive\x20aborts\x20E_ORDER_ALREADY_CLAIMED)','Requires\x20Arb\x20status\x20=\x20Arbitrated\x20(ruling\x20final\x20—\x20no\x20op-permission\x20assert)','Compensation\x20is\x20paid\x20to\x20the\x20order\x20owner\x20(permissionless\x20keeper\x20—\x20the\x20sender\x20never\x20receives)'],'related_risks':['R-O-3-03','R-O-4-04','R-O-5-04'],'recommended_templates':['T-O-06']},{'id':'order_receive','name':'Receive\x20payment\x20(Receiving-gated,\x20funds\x20to\x20owner)','operation_field':'receive','move_entry':'receive\x20payment\x20(coin\x20or\x20Receiving\x20object)','permission_layer':'L4_object_gated','reversibility':'reversible','governed_operations':['receive\x20CoinWrapper\x20(unwrap\x20and\x20forward\x20to\x20owner)','receive\x20arbitrary\x20Receiving<K>\x20object'],'common_patterns':['⚠️\x20Gated\x20by\x20Receiving\x20existence:\x20the\x20allocation\x20payout\x20must\x20have\x20run\x20and\x20created\x20a\x20Receiving\x20at\x20the\x20caller\x27s\x20address\x20—\x20without\x20it\x20the\x20call\x20cannot\x20even\x20be\x20constructed','Receiving\x20must\x20match\x20the\x20Payment\x20object\x20(EPAYMENT_NOT_MATCH\x20on\x20mismatch)','No\x20owner\x20assert\x20—\x20funds\x20are\x20ALWAYS\x20forwarded\x20to\x20order.owner\x20regardless\x20of\x20caller','Can\x20be\x20called\x20multiple\x20times\x20(e.g.\x20partial\x20refunds)','Receives\x20are\x20unwrapped\x20(CoinWrapper\x20→\x20Coin)\x20and\x20transferred\x20to\x20owner\x20address'],'related_risks':['R-O-3-01','R-O-4-05'],'recommended_templates':['T-O-05']},{'id':'order_transfer','name':'Transfer\x20order\x20ownership\x20(irreversible)','operation_field':'transfer_to','move_entry':'transfer\x20the\x20order\x20to\x20a\x20new\x20owner\x20(owner-only)','permission_layer':'L1_owner_only','reversibility':'irreversible','governed_operations':['transfer_to\x20(new\x20owner\x20address)'],'common_patterns':['⚠️\x20IRREVERSIBLE\x20—\x20new\x20owner\x20takes\x20over\x20ALL\x20permissions','Only\x20owner\x20can\x20transfer','Can\x20be\x20called\x20even\x20after\x20Progress\x20binding\x20(unlike\x20setting\x20the\x20agent\x20list)','New\x20owner\x20becomes\x20the\x20sole\x20receiver\x20of\x20future\x20payments'],'related_risks':['R-O-3-01','R-O-4-06'],'recommended_templates':['T-O-05']},{'id':'order_dispute_append','name':'Append\x20Arb\x20to\x20dispute\x20list\x20(package-only)','operation_field':'lifecycle','move_entry':'append\x20Arb\x20to\x20the\x20dispute\x20list\x20(package-only)','permission_layer':'L3_package_only','reversibility':'append_only','governed_operations':['dispute(arb)\x20—\x20append\x20Arb\x20address\x20to\x20order.dispute'],'common_patterns':['Called\x20by\x20the\x20Arbitration\x20module\x20when\x20a\x20dispute\x20is\x20filed,\x20NOT\x20by\x20external\x20users','Max\x2010\x20Arb\x20addresses\x20(MAX_DISPUTE_COUNT)','Frozen\x20when\x20claimed_by\x20is\x20set\x20(E_ORDER_ALREADY_CLAIMED)','Duplicate\x20Arb\x20addresses\x20are\x20silently\x20skipped'],'related_risks':['R-O-1-03','R-O-3-03','R-O-5-04'],'recommended_templates':['T-O-04']}];export const ORDER_AUDIT_FORMULAS={'status_inference':'if\x20claimed_by\x20!=\x20null:\x20CLAIMED;\x20'+'elif\x20progress\x20!=\x20null:\x20query\x20Progress\x20→\x20terminal?\x20COMPLETED\x20:\x20cancel?\x20CANCELLED\x20:\x20IN_PROGRESS;\x20'+'elif\x20dispute.length\x20>\x200:\x20DISPUTED;\x20'+'else:\x20CREATED','amount_check':'order.amount\x20=\x20sum(items[].price\x20*\x20items[].quantity)\x20-\x20discount_value','fund_balance':'order.amount\x20=\x20allocation_distributed\x20+\x20compensation_paid\x20+\x20refund_amount','dispute_constraint':'dispute.length\x20<=\x20MAX_DISPUTE_COUNT\x20(10);\x20frozen\x20when\x20claimed_by.is_some()','agent_constraint':'agent.length\x20<=\x20MAX_AGENT_COUNT\x20(doc=10,\x20⚠️\x20actual=11\x20due\x20to\x20<=\x20bug\x20in\x20the\x20agent-set\x20implementation)'};export const ORDER_LEDGER_VERSION='1.0.0';export function getScenesByOperationField(a){return ORDER_SCENES['filter'](b=>b['operation_field']===a);}export function findSceneById(a){return ORDER_SCENES['find'](b=>b['id']===a);}export function findSceneByMoveEntry(a){return ORDER_SCENES['find'](b=>b['move_entry']['includes'](a));}export function getScenesByPermissionLayer(a){return ORDER_SCENES['filter'](b=>b['permission_layer']===a);}export function getScenesByReversibility(a){return ORDER_SCENES['filter'](b=>b['reversibility']===a);}export function getFieldDef(a){return ORDER_FIELDS['find'](b=>b['move_name']===a);}export function getMutableFields(){return ORDER_FIELDS['filter'](a=>a['mutability_layer']===0x4);}export function getImmutableFields(){return ORDER_FIELDS['filter'](a=>a['mutability_layer']===0x1);}export function getFrozenAfterProgressFields(){return ORDER_FIELDS['filter'](a=>a['mutability_layer']===0x3);}export function getOneTimeSetFields(){return ORDER_FIELDS['filter'](a=>a['mutability_layer']===0x2);}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['buy','order_create'],['purchase','order_create'],['advance','order_advance'],['forward','order_advance'],['progress','order_advance'],['set\x20agent','order_set_agent'],['agent','order_set_agent'],['required_info','order_required_info'],['recipient','order_required_info'],['arb\x20confirm','order_arb_confirm'],['apply\x20arbitration','order_arb_confirm'],['apply\x20compensation','order_arb_confirm'],['objection','order_arb_objection'],['object','order_arb_objection'],['claim\x20compensation','order_arb_claim_compensation'],['claim','order_arb_claim_compensation'],['receive','order_receive'],['collect','order_receive'],['withdraw','order_receive'],['transfer','order_transfer'],['transfer\x20ownership','order_transfer'],['handover','order_transfer']];for(const [d,e]of c){if(b['includes'](d['toLowerCase']()))return findSceneById(e);}return undefined;}export function getEmittedEvents(){return ORDER_LIFECYCLE_EVENTS['filter'](a=>a['actually_emitted']);}export function getInferredEvents(){return ORDER_LIFECYCLE_EVENTS['filter'](a=>!a['actually_emitted']);}export function getOrderScenesCount(){return ORDER_SCENES['length'];}export function sdkToMoveField(a){const b=ORDER_FIELDS['find'](c=>c['sdk_name']===a);return b?.['move_name'];}export function moveToSdkField(a){const b=ORDER_FIELDS['find'](c=>c['move_name']===a);return b?.['sdk_name'];}
1
+ export const ORDER_FIELDS=[{'move_name':'id','sdk_name':'id','move_type':'UID','mutability_layer':0x1,'description':'Order\x20unique\x20ID'},{'move_name':'items','sdk_name':'items','move_type':'vector<SaleItem>','mutability_layer':0x1,'description':'Purchased\x20items\x20(created-immutable)'},{'move_name':'discount','sdk_name':'discount','move_type':'Option<address>','mutability_layer':0x1,'description':'Discount\x20object\x20address\x20(created-immutable)'},{'move_name':'progress','sdk_name':'progress','move_type':'Option<address>','mutability_layer':0x2,'description':'Progress\x20object\x20address\x20(one-time-set\x20when\x20the\x20Progress\x20binds)'},{'move_name':'machine','sdk_name':'machine','move_type':'Option<address>','mutability_layer':0x1,'description':'Machine\x20snapshot\x20copied\x20from\x20service.machine\x20at\x20buy\x20time'},{'move_name':'amount','sdk_name':'amount','move_type':'u64','mutability_layer':0x1,'description':'Order\x20amount\x20in\x20MIST\x20(created-immutable)'},{'move_name':'owner','sdk_name':'builder','move_type':'address','mutability_layer':0x4,'description':'Order\x20owner\x20/\x20buyer.\x20Mutable\x20at\x20ANY\x20time\x20via\x20an\x20ownership\x20transfer\x20(L1,\x20E_NOT_THE_OWNER).\x20⚠️\x20SDK\x20field\x20name\x20is\x20\x27builder\x27\x20(only\x20naming\x20deviation\x20in\x2022\x20objects)'},{'move_name':'service','sdk_name':'service','move_type':'address','mutability_layer':0x1,'description':'Service\x20object\x20address\x20(created-immutable,\x20reference\x20only)'},{'move_name':'dispute','sdk_name':'dispute','move_type':'vector<address>','mutability_layer':0x4,'description':'Arb\x20object\x20addresses\x20(append-only,\x20max\x2010,\x20frozen\x20when\x20claimed_by\x20set)'},{'move_name':'agent','sdk_name':'agent','move_type':'vector<address>','mutability_layer':0x4,'description':'Agent\x20addresses\x20(max\x2010\x20distinct\x20per\x20call\x20—\x20input\x20deduped\x20on-chain;\x20setting\x20the\x20list\x20REPLACES\x20it\x20at\x20any\x20time,\x20no\x20progress\x20freeze)'},{'move_name':'allocation','sdk_name':'allocation','move_type':'Option<address>','mutability_layer':0x2,'description':'Allocation\x20object\x20address\x20(one-time-set\x20when\x20the\x20Allocation\x20binds)'},{'move_name':'claimed_by','sdk_name':'claimed_by','move_type':'Option<address>','mutability_layer':0x2,'description':'Claimed\x20Arb\x20object\x20address\x20(one-time,\x20irreversible;\x20blocks\x20new\x20disputes)'},{'move_name':'required_info','sdk_name':'required_info','move_type':'Option<address>','mutability_layer':0x4,'description':'Contact\x20(recipient)\x20or\x20WTS\x20Proof\x20(delivery\x20proof);\x20owner-only.\x20The\x20controlled\x20bind\x20entry\x20additionally\x20chain-verifies\x20the\x20Proof\x20is\x20about\x20THIS\x20order\x20and\x20owner-created\x20(E_REQUIRED_INFO_PROOF_NOT_BOUND\x20otherwise).'},{'move_name':'time','sdk_name':'time','move_type':'u64','mutability_layer':0x1,'description':'Creation\x20timestamp\x20(clock::timestamp_ms)'}];export const ORDER_STATES=['CREATED','IN_PROGRESS','DISPUTED','CLAIMED','COMPLETED','CANCELLED'];export const ORDER_STATE_TRANSITIONS=[{'from':'CREATED','to':'IN_PROGRESS','trigger':'buy\x20(with\x20machine)\x20→\x20the\x20Progress\x20object\x20is\x20set\x20at\x20creation'},{'from':'CREATED','to':'DISPUTED','trigger':'arb_confirm\x20→\x20dispute()\x20appends\x20Arb\x20address'},{'from':'CREATED','to':'COMPLETED','trigger':'Progress\x20reaches\x20terminal\x20(no\x20machine\x20path)\x20or\x20manual'},{'from':'IN_PROGRESS','to':'DISPUTED','trigger':'arb_confirm\x20→\x20dispute()\x20appends\x20Arb\x20address'},{'from':'IN_PROGRESS','to':'COMPLETED','trigger':'Progress\x20reaches\x20terminal\x20node'},{'from':'IN_PROGRESS','to':'CANCELLED','trigger':'Progress\x20reaches\x20cancel\x20node'},{'from':'DISPUTED','to':'CLAIMED','trigger':'arb_claim_compensation\x20→\x20compensate()\x20sets\x20claimed_by\x20(buyer-favored\x20award)'},{'from':'DISPUTED','to':'CLAIMED','trigger':'arb_case_conclude\x20→\x20the\x20dismissal\x20conclusion\x20sets\x20claimed_by\x20=\x20case\x20address\x20(defendant-favored)'},{'from':'DISPUTED','to':'COMPLETED','trigger':'Arb\x20resolution\x20+\x20Progress\x20terminal'},{'from':'DISPUTED','to':'CANCELLED','trigger':'Arb\x20resolution\x20=\x20cancel'}];export const ORDER_LIFECYCLE_EVENTS=[{'name':'NewOrderEvent','trigger':'buy\x20flow\x20phase\x205\x20(the\x20order\x20record\x20is\x20created)','emit_source':'order\x20creation\x20inside\x20the\x20buy\x20transaction','actually_emitted':!![],'fields':['object','service','progress','discount','allocation','amount']},{'name':'OrderCompletedEvent','trigger':'Progress\x20reaches\x20terminal','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','completion_time']},{'name':'OrderCancelledEvent','trigger':'Progress\x20reaches\x20cancel','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','cancel_reason']},{'name':'OrderAdvancedEvent','trigger':'order.progress\x20forward','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','from_node','to_node']},{'name':'OrderDisputeAppendedEvent','trigger':'arb_confirm\x20→\x20dispute()','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','arb']},{'name':'OrderClaimedEvent','trigger':'arb_claim_compensation\x20→\x20compensate()','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','arb','claimed_by']},{'name':'OwnerChangedEvent','trigger':'ownership\x20transfer\x20/\x20transfer_to','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','old_owner','new_owner']},{'name':'AgentSetEvent','trigger':'setting\x20the\x20agent\x20list','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','agent_list']},{'name':'RequiredInfoUpdatedEvent','trigger':'updating\x20required_info','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','required_info']},{'name':'AllocationBoundEvent','trigger':'allocation\x20binding','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','allocation']},{'name':'ProgressBoundEvent','trigger':'progress\x20binding','emit_source':'(not\x20implemented)','actually_emitted':![],'fields':['order','progress']}];export const ORDER_PERMISSION_MATRIX=[{'operation':'owner_receive\x20/\x20receive','move_function':'receive\x20CoinWrapper\x20/\x20receive\x20Receiving\x20object','layer':'L4_object_gated','aborts_with':'EPAYMENT_NOT_MATCH','notes':'Gated\x20by\x20Receiving\x20existence,\x20NOT\x20by\x20an\x20owner\x20assert:\x20the\x20allocation\x20payout\x20must\x20have\x20run\x20and\x20created\x20a\x20Receiving\x20at\x20the\x20caller\x27s\x20address.\x20No\x20owner\x20assert\x20—\x20funds\x20ALWAYS\x20go\x20to\x20order.owner\x20regardless\x20of\x20caller.\x20Receiving\x20must\x20match\x20the\x20Payment\x20object\x20(EPAYMENT_NOT_MATCH).'},{'operation':'transfer_to\x20(ownership\x20transfer)','move_function':'transfer\x20the\x20order\x20to\x20a\x20new\x20owner','layer':'L1_owner_only','aborts_with':'E_NOT_THE_OWNER','notes':'Irreversible.\x20New\x20owner\x20takes\x20over\x20ALL\x20permissions.\x20NOT\x20frozen\x20after\x20progress\x20binding.'},{'operation':'agent\x20(set\x20agent\x20list)','move_function':'set\x20the\x20agent\x20list\x20(replaces\x20all)','layer':'L1_owner_only','aborts_with':'E_NOT_THE_OWNER,\x20E_MAX_AGENT_COUNT','notes':'REPLACES\x20the\x20whole\x20agent\x20list\x20(not\x20append).\x20Max\x2010\x20distinct\x20agents\x20(assert\x20length\x20<\x20MAX_AGENT_COUNT\x20before\x20each\x20push).\x20NOT\x20frozen\x20after\x20progress\x20binding.'},{'operation':'update\x20required_info','move_function':'set\x20or\x20clear\x20required_info\x20(Contact\x20/\x20WTS\x20Proof)','layer':'L1_owner_only','aborts_with':'E_NOT_THE_OWNER','notes':'Owner-only.\x20Agent\x20CANNOT\x20update\x20required_info.'},{'operation':'bind\x20required_info\x20(controlled)','move_function':'bind\x20a\x20WTS\x20Proof\x20to\x20the\x20order\x20(write\x20only\x20when\x20Proof-about==order\x20&&\x20Proof-creator==owner)','layer':'L1_owner_only','aborts_with':'E_NOT_THE_OWNER,\x20E_REQUIRED_INFO_PROOF_NOT_BOUND\x20(11)','notes':'MOV-PROTOCOL-1212\x20(11):\x20chain-enforced\x20per-order\x20binding.\x20On\x20mismatch\x20NOTHING\x20is\x20written.\x20Coexists\x20with\x20the\x20plain\x20update\x20above\x20—\x20the\x20reuse\x20model\x20(one\x20contact\x20Proof\x20across\x20orders)\x20stays\x20the\x20privacy-preserving\x20default;\x20bind\x20is\x20for\x20listings\x20that\x20promise\x20a\x20per-order\x20credential.'},{'operation':'progress\x20(advance)','move_function':'(progress::operate)','layer':'L2_owner_or_agent','aborts_with':'E_NOT_OP_PERMISSION','notes':'Both\x20owner\x20and\x20agent\x20can\x20advance\x20Progress.'},{'operation':'arb_confirm','move_function':'(file\x20for\x20arbitration)','layer':'L2_owner_or_agent','aborts_with':'E_NOT_OP_PERMISSION,\x20E_STATUS_NOT_MATCH,\x20E_ARB_ORDER_NOT_MATCH,\x20E_ORDER_ALREADY_CLAIMED','notes':'Both\x20can\x20file\x20arbitration.\x20confirmed=true\x20additionally\x20asserts\x20claimed_by\x20is\x20none.\x20Irreversible.'},{'operation':'arb_objection','move_function':'the\x20clock-carrying\x20objection\x20entry\x20(always\x20on\x20since\x20protocol\x20135)','layer':'L2_owner_or_agent','aborts_with':'E_NOT_OP_PERMISSION,\x20E_ORDER_ALREADY_CLAIMED,\x20E_STATUS_NOT_MATCH,\x20E_ARB_ORDER_NOT_MATCH,\x20E_OBJECTION_WINDOW_PASSED\x20(13),\x20E_OBJECTION_ROUNDS_EXCEEDED\x20(14)','notes':'Both\x20can\x20object\x20to\x20Arb\x20ruling.\x20Requires\x20Arb\x20status\x20==\x20Arbitrated.\x20The\x20entry\x20enforces\x20the\x20challenge\x20window\x20(ruling\x20time\x20+\x20WITHDRAW_DURATION_TIME\x20—\x20\x27silence\x20=\x20acceptance\x27\x20has\x20already\x20released\x20the\x20fee\x20after\x20that)\x20and\x20a\x20per-case\x20round\x20cap\x20of\x20MAX_OBJECTION_ROUNDS\x20=\x203\x20objections\x20EVER\x20(counter\x20stored\x20on\x20the\x20Arb\x20object).\x20Irreversible.'},{'operation':'arb_case_conclude\x20(dismissal\x20conclusion)','move_function':'the\x20dismissal\x20conclusion\x20(the\x20defendant-favored\x20mirror\x20of\x20the\x20compensation\x20claim)','layer':'L4_object_gated','aborts_with':'E_ORDER_SERVICE_NOT_MATCH,\x20E_ARBITRATION_NOT_ALLOWED,\x20E_ARBITRATION_PERMISSION_CONFLICT,\x20E_CASE_NOT_DISMISSAL_CONCLUSION\x20(48),\x20E_ORDER_ALREADY_CLAIMED','notes':'F-BS-54/56,\x20always\x20on\x20since\x20protocol\x20135.\x20No\x20op-permission\x20assert\x20—\x20permissionless\x20keeper\x20surface\x20gated\x20by\x20Arb\x20state:\x20the\x20case\x20must\x20be\x20CONCLUDED\x20(Arbitrated\x20or\x20Withdrawn)\x20AND\x20DEFENDANT-FAVORED\x20(indemnity\x20none\x20or\x200).\x20Stamps\x20claimed_by\x20=\x20case\x20address,\x20closing\x20every\x20`claimed_by\x20none`\x20refund\x20rail\x20for\x20a\x20buyer\x20who\x20LOST\x20the\x20case\x20(before\x20154\x20a\x20dismissal\x20ruling\x20left\x20those\x20rails\x20open\x20forever).\x20Writes\x20a\x20flag,\x20moves\x20no\x20funds.\x20One-time,\x20irreversible.'},{'operation':'arb_claim_compensation','move_function':'(claim\x20the\x20compensation)','layer':'L4_object_gated','aborts_with':'E_ORDER_SERVICE_NOT_MATCH,\x20E_ARBITRATION_ARB_NOT_MATCH,\x20E_STATUS_NOT_MATCH,\x20E_ARB_ORDER_NOT_MATCH,\x20E_COMPENSATION_NOT_MATCH,\x20E_ORDER_ALREADY_CLAIMED','notes':'No\x20op-permission\x20assert\x20—\x20gated\x20by\x20Arb\x20status\x20(must\x20be\x20Arbirated,\x20ruling\x20final).\x20Compensation\x20is\x20paid\x20to\x20the\x20order\x20owner\x20(permissionless\x20keeper\x20—\x20the\x20sender\x20never\x20receives).\x20Sets\x20claimed_by\x20—\x20one-time,\x20irreversible.\x20The\x20claim\x20does\x20NOT\x20seal\x20the\x20order:\x20the\x20owner\x20receive\x20entries\x20are\x20deliberately\x20ungated\x20(on-chain),\x20so\x20any\x20escrow\x20balance\x20left\x20on\x20the\x20order\x20stays\x20claimable\x20unless\x20the\x20refund\x20allocator\x27s\x20guard\x20is\x20gated\x20on\x20order.claimed_by\x20some==false;\x20the\x20provider\x20release\x20track\x20(direct\x20transfer)\x20stays\x20usable.'},{'operation':'progress\x20binding\x20(package-only)','move_function':'bind\x20the\x20Progress\x20object\x20(package\x20write-back)','layer':'L3_package_only','aborts_with':'E_PROGRESS_ALREADY_SPECIFIED','notes':'Progress\x20module\x20writes\x20back.\x20No\x20external\x20access.'},{'operation':'allocation\x20binding\x20(package-only)','move_function':'bind\x20the\x20Allocation\x20object\x20(package\x20write-back)','layer':'L3_package_only','aborts_with':'E_ALLOCATION_ALREADY_SPECIFIED','notes':'Allocation\x20module\x20writes\x20back.\x20No\x20external\x20access.'},{'operation':'dispute\x20(package-only)','move_function':'dispute','layer':'L3_package_only','aborts_with':'E_ORDER_ALREADY_CLAIMED,\x20E_MAX_DISPUTE_COUNT','notes':'Arbitration\x20module\x20appends\x20Arb\x20address.'},{'operation':'compensate\x20(package-only)','move_function':'compensate','layer':'L3_package_only','aborts_with':'E_ORDER_ALREADY_CLAIMED','notes':'Arbitration\x20module\x20sets\x20claimed_by.\x20Irreversible.'}];export const ORDER_SCENES=[{'id':'order_create','name':'Create\x20order\x20via\x20a\x20service\x20purchase\x20(composite\x20creation)','operation_field':'object','move_entry':'buy\x20flow:\x20order\x20record\x20created\x20inside\x20the\x20service\x20purchase\x20transaction','permission_layer':'L3_package_only','reversibility':'irreversible','governed_operations':['buy\x20(items,\x20discount,\x20machine_forward?,\x20named_order?)','order\x20record\x20creation\x20(package-only)','allocation\x20creation\x20+\x20binding\x20(if\x20order_allocators\x20configured)','progress\x20creation\x20+\x20binding\x20(if\x20machine\x20configured)','order\x20record\x20created\x20+\x20NewOrderEvent\x20emitted'],'common_patterns':['Composite\x20creation:\x20Order\x20+\x20Allocation\x20+\x20Progress\x20in\x20one\x20transaction','Service.machine\x20is\x20SNAPSHOTTED\x20to\x20order.machine\x20(not\x20a\x20reference)','owner\x20=\x20tx_context::sender\x20(buyer);\x20agent\x20=\x20[]\x20initially','Allotment\x206\x20phases\x20are\x20atomic\x20—\x20any\x20failure\x20rolls\x20back\x20fully'],'related_risks':['R-O-1-05','R-O-2-01','R-O-4-01','R-O-5-01'],'recommended_templates':['T-O-01','T-O-02','T-O-03']},{'id':'order_advance','name':'Advance\x20Progress\x20(forward/hold)','operation_field':'progress','move_entry':'progress::operate\x20(via\x20order.progress\x20delegation)','permission_layer':'L2_owner_or_agent','reversibility':'irreversible','governed_operations':['progress.operation.next_node_name\x20+\x20forward','progress.op\x20(next/hold/unhold/adminUnhold)','progress.message\x20(optional)'],'common_patterns':['Both\x20owner\x20and\x20agent\x20can\x20advance\x20—\x20agent\x20enables\x20third-party\x20logistics','Node\x20transition\x20is\x20irreversible\x20(no\x20backward\x20movement)','Forward.guard\x20may\x20require\x20Guard\x20submission'],'related_risks':['R-O-3-02','R-O-4-03','R-O-5-03'],'recommended_templates':['T-O-02']},{'id':'order_set_agent','name':'Set\x20agent\x20list\x20(owner-only,\x20replaces\x20entire\x20list)','operation_field':'agent','move_entry':'set\x20the\x20agent\x20list\x20(owner-only)','permission_layer':'L1_owner_only','reversibility':'reversible','governed_operations':['set\x20the\x20agent\x20list\x20(overwrites\x20entire\x20agent\x20list)'],'common_patterns':['Setting\x20the\x20agent\x20list\x20REPLACES\x20the\x20whole\x20list\x20—\x20agents\x20omitted\x20from\x20the\x20new\x20list\x20silently\x20lose\x20access\x20(old\x20agent\x20role\x20records\x20are\x20removed\x20from\x20EntityOrders)','Max\x2010\x20distinct\x20agents\x20per\x20call\x20(E_MAX_AGENT_COUNT,\x20assert\x20length\x20<\x20MAX_AGENT_COUNT\x20before\x20each\x20push)','Can\x20be\x20called\x20at\x20ANY\x20time\x20—\x20NOT\x20frozen\x20after\x20Progress\x20binding','Agents\x20can\x20operate\x20the\x20order\x20(L2\x20ops)\x20but\x20CANNOT\x20change\x20owner\x20or\x20required_info\x20(L1\x20ops)'],'related_risks':['R-O-1-04','R-O-3-01','R-O-4-02'],'recommended_templates':['T-O-03']},{'id':'order_required_info','name':'Update\x20required_info\x20(Contact\x20or\x20WTS\x20Proof)','operation_field':'required_info','move_entry':'update\x20required_info\x20(owner-only)','permission_layer':'L1_owner_only','reversibility':'reversible','governed_operations':['update\x20required_info\x20(set\x20Contact\x20or\x20WTS\x20Proof\x20address)','required_info\x20=\x20null\x20(clear)'],'common_patterns':['Contact\x20object\x20=\x20recipient\x20info\x20(shipping\x20address)','WTS\x20Proof\x20object\x20=\x20delivery\x20proof\x20(via\x20Wowok\x20Messenger)','Owner-only\x20—\x20agent\x20CANNOT\x20update\x20required_info'],'related_risks':['R-O-3-02'],'recommended_templates':['T-O-01']},{'id':'order_arb_confirm','name':'Apply\x20for\x20arbitration\x20compensation','operation_field':'arb_confirm','move_entry':'arb_confirm\x20flow\x20(confirm\x20/\x20description\x20/\x20proposition)','permission_layer':'L2_owner_or_agent','reversibility':'irreversible','governed_operations':['arb_confirm.confirm\x20(true=confirm\x20materials,\x20false=deny)','arb_confirm.description\x20(compensation\x20application\x20description)','arb_confirm.proposition\x20(compensation\x20claims\x20list)'],'common_patterns':['Triggers\x20Arb\x20→\x20dispute()\x20appends\x20Arb\x20to\x20order.dispute','Both\x20owner\x20and\x20agent\x20can\x20file\x20—\x20agent\x20useful\x20for\x20representative\x20cases','Once\x20filed,\x20the\x20Arb\x20process\x20is\x20irreversible'],'related_risks':['R-O-3-03','R-O-4-04','R-O-5-04'],'recommended_templates':['T-O-04']},{'id':'order_arb_objection','name':'Object\x20to\x20arbitration\x20result','operation_field':'arb_objection','move_entry':'the\x20clock-carrying\x20objection\x20entry\x20(always\x20on\x20since\x20protocol\x20135)','permission_layer':'L2_owner_or_agent','reversibility':'irreversible','governed_operations':['arb_objection.objection\x20(reason\x20for\x20re-arbitration)'],'common_patterns':['Requires\x20Arb\x20status\x20=\x20Arbitrated\x20(after\x20ruling)','Triggers\x20re-arbitration\x20flow','Both\x20owner\x20and\x20agent\x20can\x20object','The\x20objection\x20entry\x20enforces\x20the\x20challenge\x20window\x20—\x20an\x20objection\x20AFTER\x20ruling\x20time\x20+\x20WITHDRAW_DURATION_TIME\x20(30d,\x20the\x20same\x20clock\x20that\x20releases\x20the\x20case\x20fee\x20under\x20\x27silence\x20=\x20acceptance\x27)\x20aborts\x20E_OBJECTION_WINDOW_PASSED\x20(13)','Round\x20cap:\x20at\x20most\x20MAX_OBJECTION_ROUNDS\x20=\x203\x20objections\x20per\x20case\x20EVER\x20(counter\x20stored\x20on\x20the\x20Arb\x20object)\x20—\x20the\x20fourth\x20aborts\x20E_OBJECTION_ROUNDS_EXCEEDED\x20(14);\x20without\x20the\x20cap\x20a\x20losing\x20side\x20could\x20erase\x20any\x20ruling\x20forever'],'related_risks':['R-O-3-03','R-O-4-04'],'recommended_templates':['T-O-04']},{'id':'order_arb_case_conclude','name':'Conclude\x20a\x20dismissed\x20case\x20onto\x20the\x20order\x20(defendant-favored,\x20irreversible)','operation_field':'arb_case_conclude','move_entry':'the\x20dismissal\x20conclusion\x20(defendant-favored\x20mirror\x20of\x20the\x20compensation\x20claim)','permission_layer':'L4_object_gated','reversibility':'irreversible','governed_operations':['arb_case_conclude.arb\x20(the\x20ruled\x20Arb\x20object)','conclude()\x20sets\x20order.claimed_by\x20=\x20case\x20address\x20(no\x20funds\x20move)'],'common_patterns':['⚠️\x20ONE-TIME,\x20IRREVERSIBLE\x20—\x20claimed_by\x20cannot\x20be\x20reset','Closes\x20the\x20hole\x20where\x20a\x20buyer\x20who\x20LOST\x20the\x20case\x20kept\x20every\x20`claimed_by\x20none`\x20refund\x20rail\x20open\x20forever\x20(a\x20dismissal\x20pays\x20nothing,\x20so\x20the\x20zero-indemnity\x20claim\x20gate\x20refuses\x20the\x20claim\x20path\x20and\x20nothing\x20ever\x20stamped\x20claimed_by)','Gated\x20by\x20Arb\x20state,\x20NOT\x20by\x20a\x20permission\x20assert\x20(permissionless\x20keeper\x20surface):\x20the\x20case\x20must\x20be\x20CONCLUDED\x20(Arbitrated\x20or\x20Withdrawn)\x20AND\x20DEFENDANT-FAVORED\x20(indemnity\x20none\x20or\x200)\x20—\x20anything\x20else\x20aborts\x20E_CASE_NOT_DISMISSAL_CONCLUSION\x20(48);\x20the\x20SDK\x20mirrors\x20both\x20predicates\x20locally\x20before\x20building','Merchant-side\x20checks\x20mirror\x20the\x20compensation\x20claim:\x20order\x20belongs\x20to\x20the\x20service,\x20the\x20case\x20sits\x20on\x20the\x20merchant\x27s\x20arbitration\x20allowlist,\x20the\x20Service\x20never\x20judges\x20its\x20own\x20disputes\x20(E_ARBITRATION_PERMISSION_CONFLICT)','Writes\x20a\x20flag\x20and\x20moves\x20NO\x20funds\x20—\x20safe\x20for\x20any\x20keeper\x20to\x20drive\x20at\x20ruling\x20time'],'related_risks':['R-O-3-03','R-O-4-04'],'recommended_templates':['T-O-06']},{'id':'order_arb_claim_compensation','name':'Claim\x20compensation\x20(sets\x20claimed_by,\x20irreversible)','operation_field':'arb_claim_compensation','move_entry':'claim\x20compensation\x20→\x20the\x20order\x20is\x20claimed\x20and\x20compensation\x20paid','permission_layer':'L4_object_gated','reversibility':'irreversible','governed_operations':['arb_claim_compensation.arb\x20(the\x20ruled\x20Arb\x20object)','compensate()\x20sets\x20order.claimed_by\x20=\x20arb'],'common_patterns':['⚠️\x20ONE-TIME,\x20IRREVERSIBLE\x20—\x20claimed_by\x20cannot\x20be\x20reset','After\x20claim,\x20NO\x20new\x20disputes\x20can\x20be\x20filed\x20and\x20the\x20order\x20rejects\x20all\x20further\x20payout\x20claims\x20(owner\x20receive\x20aborts\x20E_ORDER_ALREADY_CLAIMED)','Requires\x20Arb\x20status\x20=\x20Arbitrated\x20(ruling\x20final\x20—\x20no\x20op-permission\x20assert)','Compensation\x20is\x20paid\x20to\x20the\x20order\x20owner\x20(permissionless\x20keeper\x20—\x20the\x20sender\x20never\x20receives)'],'related_risks':['R-O-3-03','R-O-4-04','R-O-5-04'],'recommended_templates':['T-O-06']},{'id':'order_receive','name':'Receive\x20payment\x20(Receiving-gated,\x20funds\x20to\x20owner)','operation_field':'receive','move_entry':'receive\x20payment\x20(coin\x20or\x20Receiving\x20object)','permission_layer':'L4_object_gated','reversibility':'reversible','governed_operations':['receive\x20CoinWrapper\x20(unwrap\x20and\x20forward\x20to\x20owner)','receive\x20arbitrary\x20Receiving<K>\x20object'],'common_patterns':['⚠️\x20Gated\x20by\x20Receiving\x20existence:\x20the\x20allocation\x20payout\x20must\x20have\x20run\x20and\x20created\x20a\x20Receiving\x20at\x20the\x20caller\x27s\x20address\x20—\x20without\x20it\x20the\x20call\x20cannot\x20even\x20be\x20constructed','Receiving\x20must\x20match\x20the\x20Payment\x20object\x20(EPAYMENT_NOT_MATCH\x20on\x20mismatch)','No\x20owner\x20assert\x20—\x20funds\x20are\x20ALWAYS\x20forwarded\x20to\x20order.owner\x20regardless\x20of\x20caller','Can\x20be\x20called\x20multiple\x20times\x20(e.g.\x20partial\x20refunds)','Receives\x20are\x20unwrapped\x20(CoinWrapper\x20→\x20Coin)\x20and\x20transferred\x20to\x20owner\x20address'],'related_risks':['R-O-3-01','R-O-4-05'],'recommended_templates':['T-O-05']},{'id':'order_transfer','name':'Transfer\x20order\x20ownership\x20(irreversible)','operation_field':'transfer_to','move_entry':'transfer\x20the\x20order\x20to\x20a\x20new\x20owner\x20(owner-only)','permission_layer':'L1_owner_only','reversibility':'irreversible','governed_operations':['transfer_to\x20(new\x20owner\x20address)'],'common_patterns':['⚠️\x20IRREVERSIBLE\x20—\x20new\x20owner\x20takes\x20over\x20ALL\x20permissions','Only\x20owner\x20can\x20transfer','Can\x20be\x20called\x20even\x20after\x20Progress\x20binding\x20(unlike\x20setting\x20the\x20agent\x20list)','New\x20owner\x20becomes\x20the\x20sole\x20receiver\x20of\x20future\x20payments'],'related_risks':['R-O-3-01','R-O-4-06'],'recommended_templates':['T-O-05']},{'id':'order_dispute_append','name':'Append\x20Arb\x20to\x20dispute\x20list\x20(package-only)','operation_field':'lifecycle','move_entry':'append\x20Arb\x20to\x20the\x20dispute\x20list\x20(package-only)','permission_layer':'L3_package_only','reversibility':'append_only','governed_operations':['dispute(arb)\x20—\x20append\x20Arb\x20address\x20to\x20order.dispute'],'common_patterns':['Called\x20by\x20the\x20Arbitration\x20module\x20when\x20a\x20dispute\x20is\x20filed,\x20NOT\x20by\x20external\x20users','Max\x2010\x20Arb\x20addresses\x20(MAX_DISPUTE_COUNT)','Frozen\x20when\x20claimed_by\x20is\x20set\x20(E_ORDER_ALREADY_CLAIMED)','Duplicate\x20Arb\x20addresses\x20are\x20silently\x20skipped'],'related_risks':['R-O-1-03','R-O-3-03','R-O-5-04'],'recommended_templates':['T-O-04']}];export const ORDER_AUDIT_FORMULAS={'status_inference':'if\x20claimed_by\x20!=\x20null:\x20CLAIMED;\x20'+'elif\x20progress\x20!=\x20null:\x20query\x20Progress\x20→\x20terminal?\x20COMPLETED\x20:\x20cancel?\x20CANCELLED\x20:\x20IN_PROGRESS;\x20'+'elif\x20dispute.length\x20>\x200:\x20DISPUTED;\x20'+'else:\x20CREATED','amount_check':'order.amount\x20=\x20sum(items[].price\x20*\x20items[].quantity)\x20-\x20discount_value','fund_balance':'order.amount\x20=\x20allocation_distributed\x20+\x20compensation_paid\x20+\x20refund_amount','dispute_constraint':'dispute.length\x20<=\x20MAX_DISPUTE_COUNT\x20(10);\x20frozen\x20when\x20claimed_by.is_some()','agent_constraint':'agent.length\x20<=\x20MAX_AGENT_COUNT\x20(doc=10,\x20⚠️\x20actual=11\x20due\x20to\x20<=\x20bug\x20in\x20the\x20agent-set\x20implementation)'};export const ORDER_LEDGER_VERSION='1.0.0';export function getScenesByOperationField(a){return ORDER_SCENES['filter'](b=>b['operation_field']===a);}export function findSceneById(a){return ORDER_SCENES['find'](b=>b['id']===a);}export function findSceneByMoveEntry(a){return ORDER_SCENES['find'](b=>b['move_entry']['includes'](a));}export function getScenesByPermissionLayer(a){return ORDER_SCENES['filter'](b=>b['permission_layer']===a);}export function getScenesByReversibility(a){return ORDER_SCENES['filter'](b=>b['reversibility']===a);}export function getFieldDef(a){return ORDER_FIELDS['find'](b=>b['move_name']===a);}export function getMutableFields(){return ORDER_FIELDS['filter'](a=>a['mutability_layer']===0x4);}export function getImmutableFields(){return ORDER_FIELDS['filter'](a=>a['mutability_layer']===0x1);}export function getFrozenAfterProgressFields(){return ORDER_FIELDS['filter'](a=>a['mutability_layer']===0x3);}export function getOneTimeSetFields(){return ORDER_FIELDS['filter'](a=>a['mutability_layer']===0x2);}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['buy','order_create'],['purchase','order_create'],['advance','order_advance'],['forward','order_advance'],['progress','order_advance'],['set\x20agent','order_set_agent'],['agent','order_set_agent'],['required_info','order_required_info'],['recipient','order_required_info'],['arb\x20confirm','order_arb_confirm'],['apply\x20arbitration','order_arb_confirm'],['apply\x20compensation','order_arb_confirm'],['objection','order_arb_objection'],['object','order_arb_objection'],['claim\x20compensation','order_arb_claim_compensation'],['claim','order_arb_claim_compensation'],['receive','order_receive'],['collect','order_receive'],['withdraw','order_receive'],['transfer','order_transfer'],['transfer\x20ownership','order_transfer'],['handover','order_transfer']];for(const [d,e]of c){if(b['includes'](d['toLowerCase']()))return findSceneById(e);}return undefined;}export function getEmittedEvents(){return ORDER_LIFECYCLE_EVENTS['filter'](a=>a['actually_emitted']);}export function getInferredEvents(){return ORDER_LIFECYCLE_EVENTS['filter'](a=>!a['actually_emitted']);}export function getOrderScenesCount(){return ORDER_SCENES['length'];}export function sdkToMoveField(a){const b=ORDER_FIELDS['find'](c=>c['sdk_name']===a);return b?.['move_name'];}export function moveToSdkField(a){const b=ORDER_FIELDS['find'](c=>c['move_name']===a);return b?.['sdk_name'];}
@@ -0,0 +1,70 @@
1
+ import { type ParamRow } from "./param-tiers.js";
2
+ export type ParamKind = "money" | "ratio" | "duration" | "count" | "enum" | "flag" | "text" | "list";
3
+ export declare const PARAM_TAGS: readonly ["pricing", "deposit", "payout", "settlement", "window", "cancel", "return", "review", "dispute", "logistics", "membership", "capacity", "flow", "staff", "risk", "growth", "compliance"];
4
+ export type ParamTag = (typeof PARAM_TAGS)[number];
5
+ export declare function tagsFor(key: string): ParamTag[];
6
+ export declare function unitFor(key: string): string;
7
+ export declare function unitHint(unit: string): string;
8
+ export declare const CURATED_MEANING_COUNT: number;
9
+ export declare function paramMeaning(key: string, kind: ParamKind, unit: string, tags: readonly ParamTag[]): string;
10
+ export declare const PARAM_ALIASES: readonly (readonly [string, readonly string[]])[];
11
+ export interface ParamBounds {
12
+ min: number;
13
+ max?: number;
14
+ hint: string;
15
+ }
16
+ export declare function boundsFor(kind: ParamKind, unit: string, key?: string): ParamBounds | undefined;
17
+ export declare function kindFor(key: string, value: number | string, selector: boolean, tags: readonly ParamTag[]): ParamKind;
18
+ export type ParamLandingKind = "chain" | "allocator" | "kernel" | "off-chain" | "copy";
19
+ export interface ParamSchemaRow {
20
+ key: string;
21
+ tier: number;
22
+ tier_name: string;
23
+ group: string;
24
+ tags: ParamTag[];
25
+ kind: ParamKind;
26
+ unit: string;
27
+ unit_hint: string;
28
+ meaning: string;
29
+ type: "number" | "string";
30
+ default: number | string;
31
+ bounds?: ParamBounds;
32
+ allowed: string[];
33
+ disclosure: string;
34
+ selector: boolean;
35
+ settable_by: "merchant";
36
+ }
37
+ export interface ParamSchemaSource {
38
+ fee_params: Record<string, number | string>;
39
+ conditional_guards?: {
40
+ param: string;
41
+ guard_key?: string;
42
+ values?: string[];
43
+ }[];
44
+ }
45
+ export declare function paramSchema(t: ParamSchemaSource): ParamSchemaRow[];
46
+ export type SchemaCompatibleRow = ParamSchemaRow | ParamRow;
47
+ export interface ParamMatch<T> {
48
+ row: T;
49
+ score: number;
50
+ reasons: string[];
51
+ }
52
+ export declare function matchParams<T extends {
53
+ key: string;
54
+ tags: readonly string[];
55
+ tier: number;
56
+ disclosure: string;
57
+ meaning?: string;
58
+ }>(query: string, rows: readonly T[], limit?: number): ParamMatch<T>[];
59
+ export interface TemplateParamHit {
60
+ template: string;
61
+ key: string;
62
+ tier: number;
63
+ disclosure: string;
64
+ score: number;
65
+ }
66
+ export declare function searchTemplates(query: string, templates: readonly {
67
+ id: string;
68
+ }[], schemaOf: (t: {
69
+ id: string;
70
+ }) => ParamSchemaRow[], limit?: number): TemplateParamHit[];
@@ -0,0 +1 @@
1
+ import{classifyFeeParam}from'./param-tiers.js';export const PARAM_TAGS=['pricing','deposit','payout','settlement','window','cancel','return','review','dispute','logistics','membership','capacity','flow','staff','risk','growth','compliance'];const TAG_SET=new Set(PARAM_TAGS),TAG_RULES=[['pricing',/(_bps$|_price$|_usd$|_amount$|^min_|_fee$|_fee_|_cost$|^commission|^attributed_|^offsite_|^base_commission)/],['deposit',/(deposit|_floor_|escrow|prepay|balance_)/],['payout',/(payout|release|settle|settlement|remit)/],['settlement',/(settle|settlement|_release_|monthly_rent|threshold|commission|service_fee|_share_bps|retain_bps|_tip_bps)/],['window',/(_hours$|_days$|_ms$|_window$|_timeout|_deadline|_period|_grace|_term_|_nights$|_lead_)/],['cancel',/(cancel|withdraw|expire|no_show|no_fault)/],['return',/(return|refund|restock|replenish)/],['review',/(review|rating|reward|revision)/],['dispute',/(dispute|arbit|appeal|claim|triage|objection|defect_report)/],['logistics',/(ship|deliver|transit|pickup|dropoff|courier|dispatch|fulfil|handover|meet|auto_confirm|processing_time|production_lead)/],['membership',/(member|subscription|period_days|renewal|tier|quota)/],['capacity',/(_count$|_sessions$|_months$|_nights$|_allocators$|_rounds|_segment|_term_|_quota)/],['flow',/(_mode$|_line$|_type$|_policy$|_tier|_variant$|^storefront|^deposit_exit|^logistics|^crowdfunding|^installment|^acceptance|^after_sales)/],['staff',/(staff|operator|agent|role|permission|collaborator|roster)/],['risk',/(cap|_pool$|indemnity|penalty|forfeit|bond|guarantee|insurance)/],['growth',/(affiliate|referral|bounty|reward|promo|voucher|coupon|attributed_|offsite_)/],['compliance',/(privacy|consent|disclosure|age|kyc|passport|license|required_info)/]];export function tagsFor(a){const b=[];for(const [c,d]of TAG_RULES)if(d['test'](a))b['push'](c);return b;}const UNIT_BY_SUFFIX=[['_bps','bps'],['_usd','usd'],['_ms','ms'],['_hours','hours'],['_days','days'],['_months','months'],['_nights','nights'],['_count','count'],['_rounds','count'],['_sessions','count'],['_allocators','count']];export function unitFor(a){for(const [b,c]of UNIT_BY_SUFFIX)if(a['endsWith'](b))return c;return'unitless';}const UNIT_HINTS={'bps':'basis\x20points\x20(100\x20bps\x20=\x201%)','usd':'US\x20dollars','ms':'milliseconds','hours':'hours','days':'days','months':'months','nights':'nights','count':'a\x20whole\x20number','unitless':'a\x20plain\x20number','mist':'raw\x20amount\x20in\x20MIST\x20(1\x20WOW\x20=\x2010^9\x20MIST)'};export function unitHint(a){return UNIT_HINTS[a]??UNIT_HINTS['unitless'];}const PARAM_MEANINGS={'acceptance_timeout_hours':'Hours\x20the\x20supplier\x20has\x20to\x20accept\x20an\x20order\x20before\x20it\x20lapses.','allocator_threshold':'Formula\x20the\x20settlement\x20threshold\x20must\x20satisfy\x20(prose\x20directive,\x20not\x20a\x20setting).','annual_plan_usd':'Annual\x20membership\x20price\x20in\x20USD.','appeal_window_days':'Days\x20after\x20a\x20ruling\x20during\x20which\x20it\x20can\x20still\x20be\x20appealed.','arb_indemnity_floor_bps':'Floor,\x20in\x20basis\x20points\x20of\x20the\x20escrow,\x20reserved\x20for\x20arbitrator\x20compensation.','arb_payout_pairing':'How\x20a\x20buyer-won\x20ruling\x20combines\x20the\x20principal\x20refund\x20with\x20the\x20compensation:\x20\x27either\x27\x20pays\x20one\x20and\x20closes\x20the\x20other\x20rail,\x20\x27stacked\x27\x20pays\x20both\x20(the\x20stacked\x20money\x20rail\x20is\x20declared\x20only,\x20so\x20the\x20escrow\x20still\x20settles\x20under\x20\x27either\x27).','arbitration_fee_usd':'Flat\x20USD\x20fee\x20charged\x20to\x20open\x20an\x20arbitration\x20case.','attributed_commission_rate_bps':'Take\x20rate\x20charged\x20on\x20sales\x20traced\x20to\x20an\x20attributed\x20channel.','auto_confirm_days':'Days\x20of\x20buyer\x20silence\x20after\x20delivery\x20before\x20the\x20order\x20auto-completes\x20and\x20settlement\x20opens.','auto_confirm_hours':'Hours\x20of\x20buyer\x20silence\x20after\x20delivery\x20before\x20the\x20order\x20auto-completes.','balance_amount':'Remaining\x20amount\x20collected\x20in\x20the\x20balance\x20stage\x20(deposit\x20plus\x20balance\x20pricing).','balance_window_days':'Days\x20the\x20buyer\x20has\x20to\x20pay\x20the\x20remaining\x20balance\x20after\x20the\x20deposit.','base_commission_rate_bps':'Base\x20take\x20rate\x20before\x20channel-attribution\x20adjustments.','bounty_high_hunter_bps':'Hunter\x27s\x20share\x20of\x20the\x20high-severity\x20bounty\x20pool,\x20in\x20basis\x20points;\x20the\x20sponsoring\x20company\x20receives\x20the\x20complement\x20(10000\x20minus\x20this).','bounty_medium_hunter_bps':'Hunter\x27s\x20share\x20of\x20the\x20medium-severity\x20bounty\x20pool,\x20in\x20basis\x20points;\x20the\x20sponsoring\x20company\x20receives\x20the\x20complement\x20(10000\x20minus\x20this).','bounty_low_hunter_bps':'Hunter\x27s\x20share\x20of\x20the\x20low-severity\x20bounty\x20pool,\x20in\x20basis\x20points;\x20the\x20sponsoring\x20company\x20receives\x20the\x20complement\x20(10000\x20minus\x20this).','campaign_deadline_ms':'Unix\x20epoch\x20milliseconds\x20at\x20which\x20the\x20campaign\x20closes.\x20Generation\x20DERIVES\x20it\x20from\x20campaign_duration_days\x20when\x20the\x20operator\x20answered\x20the\x20length\x20(build\x20instant\x20+\x20N\x20days,\x20recorded\x20on\x20the\x20plan);\x20pass\x20it\x20directly\x20only\x20when\x20the\x20close\x20date\x20is\x20fixed.','campaign_duration_days':'Running\x20days\x20from\x20launch\x20to\x20campaign\x20close.\x20The\x20unit\x20the\x20operator\x20answers\x20in;\x20generation\x20converts\x20it\x20into\x20the\x20absolute\x20campaign_deadline_ms\x20every\x20chain\x20deadline\x20gate\x20reads.','cancel_tier_1_boundary_hours':'Notice\x20before\x20the\x20service\x20start\x20at\x20which\x20tier\x201\x20begins,\x20in\x20hours\x20(cancelling\x20further\x20out\x20pays\x20the\x20tier-1\x20charge).','cancel_tier_2_boundary_hours':'Notice\x20before\x20the\x20service\x20start\x20at\x20which\x20tier\x202\x20begins,\x20in\x20hours.','cancel_tier_3_boundary_hours':'Notice\x20before\x20the\x20service\x20start\x20at\x20which\x20tier\x203\x20(the\x20no-show\x20band)\x20begins,\x20in\x20hours.','cancel_tier_1_charge_bps':'Cancellation\x20charge\x20for\x20the\x20earliest\x20band\x20(most\x20notice),\x20in\x20basis\x20points\x20of\x20the\x20order\x20amount;\x20the\x20buyer\x20is\x20refunded\x20the\x20complement.','cancel_tier_2_charge_bps':'Cancellation\x20charge\x20for\x20the\x20middle-early\x20band,\x20in\x20basis\x20points\x20of\x20the\x20order\x20amount;\x20the\x20buyer\x20is\x20refunded\x20the\x20complement.','cancel_tier_3_charge_bps':'Cancellation\x20charge\x20for\x20the\x20middle-late\x20band,\x20in\x20basis\x20points\x20of\x20the\x20order\x20amount;\x20the\x20buyer\x20is\x20refunded\x20the\x20complement.','cancel_tier_4_charge_bps':'Cancellation\x20charge\x20for\x20the\x20last-minute\x20(no-show)\x20band,\x20in\x20basis\x20points\x20of\x20the\x20order\x20amount;\x20the\x20buyer\x20is\x20refunded\x20the\x20complement.','service_start_ms':'Unix\x20epoch\x20milliseconds\x20of\x20the\x20service/departure\x20start,\x20shared\x20by\x20every\x20order\x20of\x20that\x20service;\x20the\x20cancellation\x20bands\x20measure\x20notice\x20against\x20it.','cancellation_policy':'Prose\x20cancellation\x20policy;\x20the\x20enforceable\x20values\x20are\x20the\x20cancel-window\x20keys.','claim_window_days':'Days\x20after\x20delivery\x20in\x20which\x20the\x20buyer\x20can\x20file\x20a\x20dispute\x20before\x20settlement\x20opens.','claim_window_hours':'Hours\x20of\x20the\x20dispute-filing\x20window\x20after\x20delivery.','co_holder_bps':'Share,\x20in\x20basis\x20points,\x20held\x20by\x20a\x20co-holder\x20of\x20the\x20asset\x20or\x20right.','commission_rate_bps':'Platform\x20take\x20rate\x20per\x20settled\x20order,\x20in\x20basis\x20points\x20(0\x20keeps\x20the\x20merchant\x20the\x20full\x20amount).','confirm_timeout_hours':'Hours\x20the\x20merchant\x20has\x20to\x20confirm\x20an\x20order\x20before\x20it\x20auto-cancels.','confirm_window_hours':'Window,\x20in\x20hours,\x20for\x20confirming\x20the\x20order\x20or\x20handover.','contract_fee_large_usd':'Flat\x20contract\x20fee\x20for\x20large\x20engagements.','contract_fee_small_usd':'Flat\x20contract\x20fee\x20for\x20small\x20engagements.','contract_fee_tier_boundary_usd':'Contract\x20value,\x20in\x20USD,\x20separating\x20the\x20small\x20from\x20the\x20large\x20fee\x20tier.','courier_fee':'Courier\x20delivery\x20fee.','courier_tip_bps':'Rider\x20tip\x20or\x20incentive,\x20in\x20basis\x20points\x20of\x20the\x20order\x20value.','course_price_usd':'Price\x20of\x20one\x20course\x20seat\x20in\x20USD.','creator_settlement_retain_bps':'Share\x20of\x20each\x20settlement\x20the\x20creator\x20keeps\x20(the\x20rest\x20funds\x20platform\x20and\x20fee\x20legs).','damage_max_amount':'Maximum\x20damage\x20compensation\x20payable\x20out\x20of\x20the\x20escrow.','defect_report_window_hours':'Hours\x20after\x20delivery\x20in\x20which\x20a\x20defect\x20or\x20damage\x20must\x20be\x20reported.','delivery_window_days':'Promised\x20delivery\x20window\x20in\x20days.','deposit_amount':'Up-front\x20deposit\x20collected\x20at\x20order\x20time\x20(the\x20rest\x20is\x20collected\x20later).','deposit_exit_policy':'Prose\x20policy\x20for\x20exiting\x20or\x20refunding\x20the\x20deposit.','deposit_refund_days':'Days\x20after\x20checkout\x20within\x20which\x20the\x20deposit\x20is\x20refunded.','digital_product_fee_bps':'Fee\x20rate\x20charged\x20on\x20digital\x20product\x20sales.','digital_product_fee_max_usd':'Cap\x20on\x20the\x20digital\x20product\x20fee,\x20in\x20USD.','digital_product_fee_min_usd':'Floor\x20on\x20the\x20digital\x20product\x20fee,\x20in\x20USD.','dispute_timeout_days':'Days\x20after\x20a\x20dispute\x20is\x20filed\x20before\x20it\x20escalates\x20or\x20defaults.','dispute_window_days':'Days\x20after\x20delivery\x20to\x20escalate\x20a\x20complaint\x20to\x20arbitration.','early_exit_penalty_amount':'Flat\x20penalty\x20charged\x20on\x20early\x20termination.','early_exit_penalty_months':'Months\x20of\x20rent\x20charged\x20as\x20the\x20early-exit\x20penalty.','errand_line':'Errand\x20service\x20line;\x20this\x20selector\x20changes\x20which\x20rails\x20the\x20machine\x20installs.','escrow_release_days':'Days\x20the\x20escrow\x20holds\x20before\x20the\x20funds\x20release\x20to\x20the\x20merchant.','evaluation_window_days':'Days\x20allowed\x20to\x20evaluate\x20a\x20submitted\x20deliverable.','evidence_window_hours':'Hours\x20to\x20submit\x20evidence\x20once\x20a\x20dispute\x20is\x20open.','free_cancel_hours':'Hours\x20after\x20purchase\x20during\x20which\x20cancellation\x20is\x20free\x20(full\x20refund).','full_price':'List\x20price\x20before\x20discounts\x20or\x20the\x20deposit\x20split.','funding_threshold':'Amount\x20that\x20must\x20be\x20raised\x20for\x20the\x20campaign\x20to\x20succeed.','grace_days':'Grace\x20period\x20in\x20days\x20before\x20a\x20late\x20payment\x20counts\x20as\x20a\x20breach.','host_rate_bps':'Host\x20payout\x20share\x20of\x20the\x20booking\x20value,\x20in\x20basis\x20points.','incumbent_take_bps':'Take\x20rate\x20of\x20the\x20incumbent\x20platform\x20(comparison\x20only).','inspection_deadline_hours':'Hours\x20to\x20complete\x20the\x20inspection\x20after\x20handover.','inspection_window_days':'Days\x20of\x20inspection\x20window\x20after\x20delivery.','instant_cancel_hours':'Hours\x20within\x20which\x20cancellation\x20takes\x20effect\x20immediately.','institution_share_bps':'Share\x20of\x20course\x20revenue\x20paid\x20to\x20the\x20institution.','kill_fee_bps':'Fee\x20kept\x20from\x20the\x20escrow\x20when\x20the\x20buyer\x20cancels\x20after\x20acceptance.','kill_fee_buyer_bps':'Late-cancellation\x20fee\x20charged\x20to\x20the\x20buyer.','layer2_segment_amounts':'Segment\x20amounts\x20of\x20the\x20second\x20allocation\x20layer\x20(directive\x20formula).','leader_commission_bps':'Commission\x20paid\x20to\x20the\x20group\x20leader\x20on\x20each\x20member\x20order.','lease_months':'Lease\x20length\x20in\x20months.','max_months':'Longest\x20subscription\x20or\x20lease\x20term,\x20in\x20months.','max_sessions':'Maximum\x20sessions\x20included\x20in\x20the\x20plan.','membership_price':'Membership\x20price\x20per\x20period.','merchant_service_fee_bps':'Incumbent\x20marketplace\x27s\x20merchant-side\x20service\x20fee\x20(benchmark,\x20comparison\x20only).\x20WoWok\x20is\x20DIRECT\x20SALES\x20here:\x20this\x20store\x20pays\x20no\x20platform\x20commission,\x20so\x20the\x20shipped\x20value\x20is\x200\x20and\x20no\x20money\x20rail\x20reads\x20it\x20—\x20set\x20it\x20only\x20if\x20YOU\x20are\x20the\x20aggregator\x20charging\x20your\x20own\x20sellers.','min_balance':'Minimum\x20balance\x20that\x20must\x20remain\x20(directive\x20floor).','min_booking_amount':'Minimum\x20bookable\x20amount\x20(directive\x20floor).','min_contract_usd':'Minimum\x20contract\x20value\x20in\x20USD\x20(directive\x20floor).','min_course_price_usd':'Minimum\x20course\x20price\x20in\x20USD\x20(directive\x20floor).','min_monthly_rent_usd':'Minimum\x20monthly\x20rent\x20in\x20USD\x20(directive\x20floor).','min_order_price':'Minimum\x20order\x20price\x20(directive\x20floor).','min_sku_price':'Minimum\x20SKU\x20price\x20(directive\x20floor).','min_term_price':'Minimum\x20price\x20per\x20term:\x20the\x20numeric\x20floor\x20the\x20settlement\x20fixed\x20legs\x20must\x20fit\x20under\x20(per-session\x20releases\x20count\x20the\x20whole\x20term).','min_term_price_usd':'Minimum\x20price\x20per\x20term\x20in\x20USD\x20(directive\x20floor).','max_discount_bps':'Ceiling\x20on\x20any\x20coupon\x20the\x20merchant\x20may\x20issue\x20against\x20this\x20shape,\x20in\x20basis\x20points\x20—\x20derived\x20from\x20how\x20much\x20the\x20fixed\x20legs\x20leave\x20above\x20the\x20price\x20floor.','month_release_day':'Day\x20of\x20the\x20month\x20on\x20which\x20the\x20monthly\x20release\x20runs.','monthly_allocators':'Monthly\x20allocators\x20to\x20open,\x20one\x20per\x20release\x20period.','monthly_rent_amount':'Monthly\x20rent\x20amount.','no_fault_exit_days':'Days\x20of\x20notice\x20required\x20for\x20a\x20no-fault\x20exit.','no_show_floor_hours':'Hours\x20after\x20which\x20a\x20no-show\x20releases\x20the\x20slot\x20with\x20a\x20floor\x20charge.','objection_window_hours':'Hours\x20to\x20object\x20after\x20a\x20proposal\x20or\x20claim.','offsite_ads_rate_bps':'Take\x20rate\x20on\x20off-site\x20advertising-attributed\x20sales.','partner_share_bps':'Share\x20of\x20revenue\x20paid\x20to\x20the\x20partner.','payment_fee_bps':'Payment\x20processing\x20fee\x20in\x20basis\x20points.','per_session_release':'Amount\x20released\x20per\x20completed\x20session.','period_days':'Length\x20of\x20one\x20billing\x20period\x20in\x20days.','pickup_window_hours':'Hours\x20within\x20which\x20pickup\x20must\x20be\x20completed.','platform_commission_bps':'Platform\x20take\x20rate\x20per\x20settled\x20order,\x20in\x20basis\x20points\x20(0\x20keeps\x20the\x20merchant\x20the\x20full\x20amount).','platform_commission_rate_bps':'Platform\x20take\x20rate\x20per\x20settled\x20order,\x20in\x20basis\x20points.','platform_fee_rate_bps':'Platform\x20fee\x20rate\x20applied\x20to\x20the\x20order\x20value,\x20in\x20basis\x20points.','platform_rate_bps':'Platform\x20rate\x20applied\x20to\x20the\x20order\x20value,\x20in\x20basis\x20points.','platform_rate_cap_bps':'Upper\x20bound\x20on\x20the\x20platform\x20take\x20rate.','platform_share_bps':'Share\x20of\x20the\x20order\x20kept\x20by\x20the\x20platform.','platform_take_bps':'Platform\x20take\x20per\x20settled\x20order,\x20in\x20basis\x20points.','platform_tool_fee_bps':'Fee\x20for\x20using\x20the\x20platform\x20tooling,\x20in\x20basis\x20points.','point_type':'Point\x20or\x20credit\x20type\x20used\x20by\x20the\x20loyalty\x20ledger.','preferred_property_rate_bps':'Commission\x20rate\x20applied\x20to\x20preferred\x20properties.','prepay_cap':'Cap\x20on\x20the\x20amount\x20that\x20may\x20be\x20prepaid.','primary_holder_bps':'Share\x20held\x20by\x20the\x20primary\x20rights\x20holder.','processing_time_days':'Days\x20the\x20supplier\x20takes\x20to\x20process\x20the\x20request.','producer_bps':'Share\x20paid\x20to\x20the\x20producer.','production_lead_days':'Days\x20needed\x20to\x20produce\x20the\x20item\x20before\x20it\x20ships.','property_rate_bps':'Commission\x20rate\x20on\x20property\x20bookings.','protection_cap_usd':'Maximum\x20buyer-protection\x20payout\x20in\x20USD.','publisher_bps':'Share\x20paid\x20to\x20the\x20publisher.','refund_window_days':'Days\x20after\x20delivery\x20in\x20which\x20a\x20refund\x20may\x20be\x20requested.','renewal_reminder_days':'Days\x20before\x20renewal\x20to\x20send\x20the\x20reminder.','required_info_enforcement':'Whether\x20missing\x20required\x20buyer\x20info\x20blocks\x20the\x20order\x20(on/off).','requirements_timeout_hours':'Hours\x20the\x20buyer\x20has\x20to\x20supply\x20missing\x20requirements\x20before\x20the\x20order\x20lapses.','response_timeout_hours':'Hours\x20a\x20seller\x20has\x20to\x20grant\x20or\x20decline\x20a\x20cancel\x20request\x20before\x20a\x20keeper\x20auto-cancels\x20it\x20in\x20the\x20buyer\x27s\x20favour\x20(full\x20refund).','reserve_days':'Days\x20a\x20reserve\x20is\x20held\x20back\x20from\x20the\x20payout.','restock_confirm_days':'Days\x20to\x20confirm\x20restocking\x20after\x20a\x20return\x20arrives.','restock_on_refund':'Restock\x20rule\x20applied\x20when\x20a\x20refund\x20completes\x20(directive).','return_notice_days':'Days\x20of\x20notice\x20required\x20before\x20returning\x20the\x20item.','return_transit_days':'Days\x20allowed\x20for\x20the\x20returned\x20item\x20to\x20travel\x20back.','return_window_days':'Days\x20after\x20delivery\x20in\x20which\x20the\x20buyer\x20may\x20return\x20the\x20item.','return_window_hours':'Hours\x20after\x20delivery\x20in\x20which\x20the\x20buyer\x20may\x20return\x20the\x20item.','review_reward_per_claim':'Bounty\x20paid\x20for\x20one\x20accepted\x20review\x20claim.','review_reward_pool':'Total\x20pool\x20that\x20funds\x20review\x20rewards.','review_window_days':'Days\x20after\x20completion\x20in\x20which\x20a\x20review\x20may\x20be\x20submitted.','revision_rounds_max':'Maximum\x20revision\x20rounds\x20included\x20in\x20the\x20price.','reward_claim_closes_after_days':'Days\x20after\x20completion\x20when\x20the\x20review-reward\x20claim\x20closes.','reward_claim_opens_after_days':'Days\x20after\x20the\x20after-sales\x20window\x20before\x20the\x20review-reward\x20bounty\x20becomes\x20claimable.','segment_count':'Number\x20of\x20allocation\x20segments.','service_fee_rate_bps':'Service\x20fee\x20rate\x20charged\x20on\x20the\x20order.','session_count':'Number\x20of\x20sessions\x20included\x20in\x20the\x20plan.','settle_hours':'Hours\x20after\x20the\x20settlement\x20window\x20opens\x20before\x20funds\x20reach\x20the\x20merchant.','settlement_days':'Days\x20between\x20order\x20completion\x20and\x20settlement\x20to\x20the\x20merchant.','settlement_delay_days':'Delay\x20in\x20days\x20applied\x20to\x20the\x20payout.','setting_lock_days':'Days\x20during\x20which\x20a\x20setting\x20is\x20locked\x20after\x20the\x20order\x20is\x20placed.','stay_nights':'Nights\x20per\x20stay.','storefront_mode':'Storefront\x20shape;\x20this\x20selector\x20changes\x20the\x20generated\x20storefront\x20topology.','submission_window_days':'Days\x20to\x20submit\x20the\x20deliverable.','subscription_monthly_usd':'Monthly\x20subscription\x20price\x20in\x20USD.','term_count':'Number\x20of\x20terms\x20or\x20invoices\x20in\x20the\x20contract.','term_price':'Price\x20charged\x20per\x20term.','term_price_usd':'Price\x20charged\x20per\x20term\x20in\x20USD.','threshold':'Escrow\x20amount\x20that\x20triggers\x20the\x20next\x20stage.','tier5_guest_bps':'Cancellation\x20tier\x205:\x20share\x20charged\x20to\x20the\x20guest.','tier5_host_bps':'Cancellation\x20tier\x205:\x20share\x20paid\x20to\x20the\x20host.','tier6_guest_bps':'Cancellation\x20tier\x206:\x20share\x20charged\x20to\x20the\x20guest.','tier6_host_bps':'Cancellation\x20tier\x206:\x20share\x20paid\x20to\x20the\x20host.','triage_window_days':'Days\x20to\x20triage\x20a\x20report\x20before\x20it\x20escalates.','tuition_usd':'Tuition\x20per\x20enrollment\x20in\x20USD.','unclaimed_exit':'What\x20happens\x20to\x20an\x20order\x20the\x20buyer\x20never\x20collects:\x20refund_buyer\x20(default)\x20returns\x20the\x20principal\x20in\x20full\x20after\x20the\x20pickup\x20window,\x20settle_merchant\x20opens\x20the\x20serial\x20claim\x20window\x20and\x20settles\x20to\x20the\x20supplier\x20with\x20the\x20buyer\x20keeping\x20a\x20late-appeal\x20refund\x20route.','withdrawal_window_days':'Days\x20during\x20which\x20withdrawal\x20is\x20allowed.'};export const CURATED_MEANING_COUNT=Object['keys'](PARAM_MEANINGS)['length'];const KIND_WORD={'money':'amount','ratio':'rate','duration':'duration','count':'count','enum':'option','flag':'on/off\x20switch','text':'text','list':'list\x20of\x20values'};export function paramMeaning(a,b,c,d){const e=PARAM_MEANINGS[a];if(e!==undefined)return e;const f=d['length']>0x0?'\x20on\x20the\x20'+d['join']('/')+'\x20facet':'';return'Not\x20yet\x20described\x20—\x20a\x20'+KIND_WORD[b]+(c!=='unitless'?'\x20in\x20'+c:'')+f+'.';}export const PARAM_ALIASES=[['take\x20rate',['platform_commission_bps','platform_commission_rate_bps','platform_take_bps','platform_fee_rate_bps','platform_rate_bps','commission_rate_bps','merchant_service_fee_bps','incumbent_take_bps']],['commission',['platform_commission_bps','commission_rate_bps','leader_commission_bps','attributed_commission_rate_bps']],['get\x20paid',['settle_hours','settlement_days','settlement_delay_days','escrow_release_days','month_release_day']],['payout',['settle_hours','settlement_days','settlement_delay_days','escrow_release_days','reserve_days']],['refund',['return_window_days','refund_window_days','deposit_refund_days','free_cancel_hours']],['cancel',['free_cancel_hours','instant_cancel_hours','kill_fee_bps','cancel_tier_1_charge_bps','cancel_tier_2_charge_bps','cancel_tier_3_charge_bps','cancel_tier_4_charge_bps']],['dispute',['claim_window_days','dispute_window_days','dispute_timeout_days','arbitration_fee_usd']],['deposit',['deposit_amount','balance_amount','prepay_cap']],['tip',['courier_tip_bps','courier_fee']],['reward',['review_reward_pool','review_reward_per_claim','reward_claim_opens_after_days','reward_claim_closes_after_days']],['bounty',['bounty_high_hunter_bps','bounty_medium_hunter_bps','bounty_low_hunter_bps']],['hunter\x20share',['bounty_high_hunter_bps','bounty_medium_hunter_bps','bounty_low_hunter_bps']],['review',['review_window_days','review_reward_per_claim','review_reward_pool']],['rent',['monthly_rent_amount','lease_months','early_exit_penalty_months']],['delivery',['delivery_window_days','courier_fee','pickup_window_hours']],['membership',['membership_price','subscription_monthly_usd','annual_plan_usd','period_days']],['commission\x20cap',['platform_rate_cap_bps','protection_cap_usd']],['fee',['arbitration_fee_usd','payment_fee_bps','courier_fee','platform_tool_fee_bps']],['how\x20much\x20do\x20i\x20keep',['platform_commission_bps','platform_take_bps','platform_share_bps','commission_rate_bps']],['late\x20fee',['kill_fee_bps','early_exit_penalty_months','cancel_tier_4_charge_bps']],['no\x20show',['no_show_floor_hours']],['holdback',['reserve_days','creator_settlement_retain_bps','setting_lock_days']],['minimum\x20order',['min_order_price','min_contract_usd','min_course_price_usd','min_booking_amount','min_sku_price']],['campaign\x20length',['campaign_duration_days']],['arbitration\x20fee',['arbitration_fee_usd']],['dispute\x20window',['dispute_window_days','dispute_timeout_days','claim_window_days']],['late\x20delivery',['delivery_window_days','auto_confirm_days','auto_confirm_hours']],['plan\x20price',['subscription_monthly_usd','annual_plan_usd','membership_price']],['renewal\x20reminder',['renewal_reminder_days']],['shipping\x20deadline',['processing_time_days','delivery_window_days']],['down\x20payment',['deposit_amount','balance_amount','deposit_refund_days']],['balance\x20due',['balance_amount','balance_window_days']],['notice\x20period',['return_notice_days','no_fault_exit_days','early_exit_penalty_months']],['guest\x20count',['tier5_guest_bps','tier6_guest_bps']],['tiered\x20pricing',['tier5_guest_bps','tier6_guest_bps']],['cancellation\x20charge',['cancel_tier_1_charge_bps','cancel_tier_2_charge_bps','cancel_tier_3_charge_bps','cancel_tier_4_charge_bps']],['money\x20released',['settle_hours','settlement_days','settlement_delay_days','escrow_release_days','month_release_day','reserve_days']],['release\x20the\x20money',['settle_hours','settlement_days','settlement_delay_days','escrow_release_days','month_release_day','reserve_days']]];const MAX_BY_UNIT={'hours':{'max':0x2238,'hint':'0..8760\x20(one\x20year;\x200\x20=\x20unset)'},'days':{'max':0x16d,'hint':'0..365\x20(one\x20year;\x200\x20=\x20unset)'},'months':{'max':0x3c,'hint':'0..60\x20(five\x20years)'},'nights':{'max':0x16d,'hint':'0..365\x20nights'},'ms':{'max':0x3bb2cc3d800,'hint':'milliseconds;\x20absolute\x20deadlines\x20may\x20be\x20epoch\x20ms\x20(up\x20to\x20year\x202100)'},'count':{'max':0x186a0,'hint':'0\x20or\x20more,\x20whole\x20numbers'}},PARAM_RANGE_OVERRIDES={'stay_nights':{'min':0x1,'max':0x16d,'hint':'1..365\x20nights'},'period_days':{'min':0x1,'max':0x16e,'hint':'1..366\x20days\x20(a\x20monthly\x20period\x20is\x2030,\x20a\x20leap\x20year\x20366)'},'lease_months':{'min':0x1,'max':0x78,'hint':'1..120\x20months'},'max_months':{'min':0x1,'max':0x78,'hint':'1..120\x20months'},'month_release_day':{'min':0x1,'max':0x1f,'hint':'1..31\x20(a\x20day\x20of\x20the\x20month)'},'revision_rounds_max':{'min':0x0,'max':0x64,'hint':'0..100\x20rounds'}};export function boundsFor(a,b,c){if(a==='enum'||a==='flag'||a==='text'||a==='list')return undefined;if(b==='bps')return{'min':0x0,'max':0x2710,'hint':'0..10000\x20(100\x20bps\x20=\x201%)'};if(c!==undefined&&PARAM_RANGE_OVERRIDES[c]!==undefined)return PARAM_RANGE_OVERRIDES[c];if(a==='money')return{'min':0x0,'hint':'0\x20or\x20more'};const d=MAX_BY_UNIT[b];if(a==='count')return{'min':0x0,'max':MAX_BY_UNIT['count']['max'],'hint':MAX_BY_UNIT['count']['hint']};if(a==='duration'){if(d!==undefined)return{'min':0x0,'max':d['max'],'hint':d['hint']};return{'min':0x0,'hint':'0\x20or\x20more\x20in\x20the\x20row\x27s\x20unit\x20(0\x20=\x20unset)'};}return undefined;}export function kindFor(a,b,c,d){if(c)return'enum';if(typeof b==='string'){if(/^(on|off|true|false)$/i['test'](b))return'flag';if(/^\s*-?\d+(?:\.\d+)?(?:\s*\/\s*-?\d+(?:\.\d+)?)+\s*$/['test'](b))return'list';return'enum';}const e=unitFor(a);if(e==='usd')return'money';if(e==='bps')return'ratio';if(e==='hours'||e==='days'||e==='ms'||e==='months'||e==='nights')return'duration';if(e==='count')return'count';if(d['includes']('pricing')||/amount|price|pool|cap|threshold|fee|cost|rent|reward|_per_claim|_release$|_retain|_tip$|tuition|balance|prepay|_share/['test'](a))return'money';return'count';}export function paramSchema(a){const b=new Set((a['conditional_guards']??[])['map'](e=>e['param'])),d=new Map();for(const e of a['conditional_guards']??[]){if(e['values']===undefined)continue;const f=d['get'](e['param'])??[];for(const g of e['values'])if(!f['includes'](g))f['push'](g);d['set'](e['param'],f);}return Object['entries'](a['fee_params'])['map'](([h,i])=>{const j=b['has'](h),k=classifyFeeParam(h,i,j),l=tagsFor(h),m=kindFor(h,i,j,l),n=unitFor(h),o=m==='money'&&n==='unitless'?'mist':n;return{'key':h,'tier':k['tier'],'tier_name':k['tier_name'],'group':k['group'],'tags':l,'kind':m,'unit':o,'unit_hint':unitHint(o),'meaning':paramMeaning(h,m,o,l),'type':typeof i==='number'?'number':'string','default':i,'bounds':boundsFor(m,o,h),'allowed':d['get'](h)??[],'disclosure':k['disclosure'],'selector':j,'settable_by':'merchant'};})['sort']((h,i)=>h['tier']-i['tier']||h['key']['localeCompare'](i['key']));}const STOPWORDS=new Set(['the','a','an','of','for','to','how','what','is','my','can','i','set','and','in','on','do','per','each']),WORD_SYNONYMS={'shipping':'ship','shipment':'ship','shipped':'ship','delivery':'deliver','deliveries':'deliver','restocking':'restock','restocked':'restock','renewals':'renewal'};function singular(a){if(a['length']<=0x3)return a;if(a['endsWith']('ies'))return a['slice'](0x0,-0x3)+'y';if(/(?:ses|xes|zes|ches|shes)$/['test'](a))return a['slice'](0x0,-0x2);if(a['endsWith']('s')&&!a['endsWith']('ss'))return a['slice'](0x0,-0x1);return a;}function canon(a){return WORD_SYNONYMS[a]??WORD_SYNONYMS[singular(a)]??singular(a);}function tokens(a){return a['toLowerCase']()['split'](/[^a-z0-9]+/)['filter'](b=>b['length']>0x1&&!STOPWORDS['has'](b))['map'](canon);}function keyWords(a){return a['toLowerCase']()['split'](/[^a-z0-9]+/)['filter'](b=>b['length']>0x1)['map'](canon);}const MIN_SCORE=0x4;export function matchParams(a,b,c=0x5){const d=tokens(a);if(d['length']===0x0)return[];const e=d['every'](m=>TAG_SET['has'](m))&&!b['some'](m=>keyWords(m['key'])['some'](n=>d['includes'](n))),f=a['toLowerCase']()['replace'](/[^a-z0-9]+/g,'_'),g='\x20'+a['toLowerCase']()['replace'](/[^a-z0-9]+/g,'\x20')['trim']()+'\x20',h=g['trim']()['split']('\x20')[0x0]??'',i=new Set(),j=[];for(const [m,n]of PARAM_ALIASES){if(!g['includes']('\x20'+m+'\x20')&&!g['includes']('\x20'+m+'s\x20'))continue;if(!m['includes']('\x20')&&m!==h)continue;j['push'](m);for(const o of n)i['add'](o);}const l=[];for(const p of b){if(p['disclosure']==='hidden')continue;let r=0x0;const s=[],u=new Set(),v=keyWords(p['key']);(p['key']===f||f['includes'](p['key']))&&(r+=0xa,s['push']('key:'+p['key']));for(const w of d){(v['includes'](w)||p['key']['includes']('_'+w))&&(r+=0x3,u['add'](w),s['push']('key-word:'+w)),p['tags']['includes'](w)&&(r+=0x2,u['add'](w),s['push']('tag:'+w));}i['has'](p['key'])&&(r+=0x6,s['push'](...j['map'](x=>'alias:'+x)));e&&d['every'](x=>p['tags']['includes'](x))&&(r+=0x4,s['push']('facet:'+d['join']('+')));if(p['meaning']!==undefined){const x=p['meaning']['toLowerCase']();let y=0x0;for(const z of d){if(y>=0x2)break;if(u['has'](z))continue;x['includes'](z)&&(r+=0x1,y++,s['push']('meaning:'+z));}}if(r<MIN_SCORE)continue;l['push']({'row':p,'score':r+0x1,'reasons':[...new Set(s)]});}return e?l['sort']((A,B)=>A['row']['tier']-B['row']['tier']||B['score']-A['score']||A['row']['key']['localeCompare'](B['row']['key'])):l['sort']((A,B)=>B['score']-A['score']||A['row']['key']['localeCompare'](B['row']['key'])),l['slice'](0x0,c);}export function searchTemplates(a,b,c,d=0x8){const e=[];for(const f of b){for(const g of matchParams(a,c(f),0x2)){e['push']({'template':f['id'],'key':g['row']['key'],'tier':g['row']['tier'],'disclosure':g['row']['disclosure'],'score':g['score']});}}return e['sort']((h,i)=>i['score']-h['score']||h['template']['localeCompare'](i['template'])),e['slice'](0x0,d);}
@@ -0,0 +1,25 @@
1
+ export type ParamTier = 1 | 2 | 3 | 4 | 5;
2
+ export type ParamDisclosure = "knob" | "card" | "hidden";
3
+ export type ParamGroup = "sales" | "flow" | "funds" | "staff" | "supplier";
4
+ export interface ParamClass {
5
+ tier: ParamTier;
6
+ tier_name: string;
7
+ group: ParamGroup;
8
+ disclosure: ParamDisclosure;
9
+ }
10
+ export declare const TIER_NAMES: Record<ParamTier, string>;
11
+ export declare function classifyFeeParam(key: string, value: number | string, selector?: boolean): ParamClass;
12
+ export interface ParamRow extends ParamClass {
13
+ key: string;
14
+ value: number | string;
15
+ type: "number" | "string";
16
+ selector: boolean;
17
+ }
18
+ export interface ParamSource {
19
+ fee_params: Record<string, number | string>;
20
+ conditional_guards?: {
21
+ param: string;
22
+ values?: string[];
23
+ }[];
24
+ }
25
+ export declare function describeFeeParams(t: ParamSource): ParamRow[];
@@ -0,0 +1 @@
1
+ export const TIER_NAMES={0x1:'money\x20&\x20admission',0x2:'time\x20&\x20payout',0x3:'flow\x20switch',0x4:'role\x20&\x20permission',0x5:'disclosure\x20&\x20copy'};const BENCHMARK_KEYS=new Set(['incumbent_take_bps','merchant_service_fee_bps','platform_rate_cap_bps']),DIRECTIVE_KEYS=new Set(['allocator_threshold','min_sku_price','min_balance','min_term_price_usd','min_term_price','min_monthly_rent_usd','min_booking_amount','min_course_price_usd','layer2_segment_amounts','restock_on_refund']),MONEY_RE=/(_bps$|_usd$|_amount$|_threshold$|^threshold$|^deposit|_cap$|_cap_usd$|_fee$|_fee_|_price$|_pool$|_per_claim$|_cost$|_rent$|_rate$|_share$|_release$)/,TIME_RE=/(_hours$|_days$|_ms$|_timeout$|_window$|_deadline$|^period_|_months$|_nights$|_rounds_max$|_count$|_sessions$|_allocators$|_day$)/;function moneyOrTime(a){if(TIME_RE['test'](a))return 0x2;if(MONEY_RE['test'](a))return 0x1;return 0x5;}export function classifyFeeParam(a,b,c=![]){const d=g=>TIER_NAMES[g];if(c)return{'tier':0x3,'tier_name':d(0x3),'group':'flow','disclosure':'knob'};if(DIRECTIVE_KEYS['has'](a)||typeof b==='string')return{'tier':0x5,'tier_name':d(0x5),'group':'flow','disclosure':'hidden'};const e=moneyOrTime(a);if(BENCHMARK_KEYS['has'](a))return{'tier':e,'tier_name':d(e),'group':'sales','disclosure':'card'};const f=e===0x1?/_price$|_usd$|_fee|_bps$|_cost$/['test'](a)?'sales':'funds':e===0x2?'funds':'flow';return{'tier':e,'tier_name':d(e),'group':f,'disclosure':'knob'};}export function describeFeeParams(a){const b=new Set((a['conditional_guards']??[])['map'](d=>d['param']));return Object['entries'](a['fee_params'])['map'](([c,d])=>{const e=b['has'](c);return{...classifyFeeParam(c,d,e),'key':c,'value':d,'type':typeof d==='number'?'number':'string','selector':e};})['sort']((c,d)=>c['tier']-d['tier']||c['key']['localeCompare'](d['key']));}
@@ -34,7 +34,7 @@ export declare const PASSPORT_ERROR_CODES: {
34
34
  };
35
35
  export declare const PASSPORT_VERIFY_MODES: {
36
36
  readonly verify: {
37
- readonly sdk_entry: "verify (passport.ts)";
37
+ readonly sdk_entry: "verify (passport verification entry)";
38
38
  readonly on_false: "returns false — no abort; the evidence card is still minted and the result recorded";
39
39
  readonly use_when: "the false branch is handled downstream (guard rails read the recorded result)";
40
40
  };