@wowok/agent-mcp 3.0.2 → 3.0.4

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 (322) hide show
  1. package/LICENSE +0 -3
  2. package/dist/harness/recover.js +1 -1
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.js +1 -1
  5. package/dist/knowledge/account-marks.js +1 -1
  6. package/dist/knowledge/arbitration-risk.js +1 -1
  7. package/dist/knowledge/event-semantics.js +1 -1
  8. package/dist/knowledge/flywheel-loop.d.ts +4 -52
  9. package/dist/knowledge/flywheel-loop.js +1 -1
  10. package/dist/knowledge/guard-lint.js +1 -1
  11. package/dist/knowledge/guard-puzzle.js +1 -1
  12. package/dist/knowledge/index.d.ts +2 -225
  13. package/dist/knowledge/index.js +1 -1
  14. package/dist/knowledge/industry-registry.js +1 -1
  15. package/dist/knowledge/machine-risk.js +1 -1
  16. package/dist/knowledge/machine-translation.js +1 -1
  17. package/dist/knowledge/onchain-constants.js +1 -1
  18. package/dist/knowledge/order-ledger.d.ts +2 -2
  19. package/dist/knowledge/order-ledger.js +1 -1
  20. package/dist/knowledge/order-puzzle.d.ts +4 -4
  21. package/dist/knowledge/order-puzzle.js +1 -1
  22. package/dist/knowledge/order-risk.d.ts +1 -0
  23. package/dist/knowledge/order-risk.js +1 -1
  24. package/dist/knowledge/order-templates.d.ts +1 -1
  25. package/dist/knowledge/order-templates.js +1 -1
  26. package/dist/knowledge/safety-rules.js +1 -1
  27. package/dist/knowledge/service-ledger.js +1 -1
  28. package/dist/knowledge/service-risk.js +1 -1
  29. package/dist/knowledge/template-registry.js +1 -1
  30. package/dist/knowledge/tools-reference.js +1 -1
  31. package/dist/knowledge/workspace-lists.js +1 -1
  32. package/dist/monitor/MonitorLoop.js +1 -1
  33. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  34. package/dist/playbooks/service-build/context-assembly.d.ts +3 -1
  35. package/dist/playbooks/service-build/context-assembly.js +1 -1
  36. package/dist/playbooks/service-build/machine-nodes.d.ts +2 -0
  37. package/dist/playbooks/service-build/machine-nodes.js +1 -1
  38. package/dist/playbooks/service-build/machine-panorama.d.ts +7 -0
  39. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  40. package/dist/review/machine.js +1 -1
  41. package/dist/safety/confirm-gate.js +1 -1
  42. package/dist/schema/call/allocation.d.ts +5 -0
  43. package/dist/schema/call/arbitration.d.ts +5 -0
  44. package/dist/schema/call/base.d.ts +17 -3
  45. package/dist/schema/call/base.js +1 -1
  46. package/dist/schema/call/bridge.d.ts +29 -0
  47. package/dist/schema/call/bridge.js +1 -1
  48. package/dist/schema/call/contact.d.ts +5 -0
  49. package/dist/schema/call/demand.d.ts +5 -0
  50. package/dist/schema/call/error-codes.d.ts +2 -0
  51. package/dist/schema/call/error-codes.js +1 -0
  52. package/dist/schema/call/guard.d.ts +19 -4
  53. package/dist/schema/call/machine.d.ts +10 -0
  54. package/dist/schema/call/order.d.ts +5 -0
  55. package/dist/schema/call/payment.d.ts +5 -0
  56. package/dist/schema/call/permission.d.ts +5 -0
  57. package/dist/schema/call/personal.d.ts +5 -0
  58. package/dist/schema/call/progress.d.ts +5 -0
  59. package/dist/schema/call/proof.d.ts +10 -0
  60. package/dist/schema/call/repository.d.ts +5 -0
  61. package/dist/schema/call/reward.d.ts +5 -0
  62. package/dist/schema/call/semantic.d.ts +9 -1
  63. package/dist/schema/call/semantic.js +1 -1
  64. package/dist/schema/call/service.d.ts +5 -0
  65. package/dist/schema/call/treasury.d.ts +5 -0
  66. package/dist/schema/common/index.js +1 -1
  67. package/dist/schema/goal/index.d.ts +3 -3
  68. package/dist/schema/goal/planning.d.ts +2 -2
  69. package/dist/schema/index.d.ts +1 -0
  70. package/dist/schema/index.js +1 -1
  71. package/dist/schema/industry-pack/index.d.ts +4 -4
  72. package/dist/schema/industry-pack/modes.d.ts +4 -4
  73. package/dist/schema/interaction/index.d.ts +34 -0
  74. package/dist/schema/interaction/index.js +1 -0
  75. package/dist/schema/local/index.d.ts +558 -0
  76. package/dist/schema/local/index.js +1 -1
  77. package/dist/schema/messenger/index.d.ts +31 -25
  78. package/dist/schema/messenger/index.js +1 -1
  79. package/dist/schema/operations.d.ts +91 -1
  80. package/dist/schema/operations.js +1 -1
  81. package/dist/schema/persona/index.d.ts +2 -2
  82. package/dist/schema/query/bi.d.ts +0 -4
  83. package/dist/schema/query/bi.js +1 -1
  84. package/dist/schema/query/index.js +1 -1
  85. package/dist/schema/schema-query/index.d.ts +1 -1
  86. package/dist/schema/schema-version.js +1 -1
  87. package/dist/schema/trust/index.d.ts +3 -3
  88. package/dist/schema/workspace/index.d.ts +1 -1
  89. package/dist/schema-query-impl/index.js +1 -1
  90. package/dist/schemas/account_operation.output.json +4 -0
  91. package/dist/schemas/ask_user.output.json +54 -0
  92. package/dist/schemas/ask_user.schema.json +78 -0
  93. package/dist/schemas/bridge_operation.output.json +4 -0
  94. package/dist/schemas/bridge_operation.schema.json +50 -5
  95. package/dist/schemas/guard2file.schema.json +10 -1
  96. package/dist/schemas/index.json +13 -1
  97. package/dist/schemas/local_history_operation.output.json +1458 -0
  98. package/dist/schemas/local_history_operation.schema.json +105 -0
  99. package/dist/schemas/local_info_operation.output.json +4 -0
  100. package/dist/schemas/local_mark_operation.output.json +4 -0
  101. package/dist/schemas/machineNode2file.schema.json +10 -1
  102. package/dist/schemas/messenger_operation.output.json +8 -0
  103. package/dist/schemas/messenger_operation.schema.json +8 -0
  104. package/dist/schemas/onchain_events.output.json +2 -2
  105. package/dist/schemas/onchain_operations.output.json +4 -1
  106. package/dist/schemas/onchain_operations.schema.json +210 -28
  107. package/dist/schemas/onchain_operations_allocation.schema.json +10 -1
  108. package/dist/schemas/onchain_operations_arbitration.schema.json +10 -1
  109. package/dist/schemas/onchain_operations_contact.schema.json +10 -1
  110. package/dist/schemas/onchain_operations_demand.schema.json +10 -1
  111. package/dist/schemas/onchain_operations_gen_passport.schema.json +10 -1
  112. package/dist/schemas/onchain_operations_gen_proof.schema.json +10 -1
  113. package/dist/schemas/onchain_operations_guard.schema.json +40 -11
  114. package/dist/schemas/onchain_operations_machine.schema.json +10 -1
  115. package/dist/schemas/onchain_operations_order.schema.json +10 -1
  116. package/dist/schemas/onchain_operations_payment.schema.json +10 -1
  117. package/dist/schemas/onchain_operations_permission.schema.json +10 -1
  118. package/dist/schemas/onchain_operations_personal.schema.json +10 -1
  119. package/dist/schemas/onchain_operations_progress.schema.json +10 -1
  120. package/dist/schemas/onchain_operations_proof.schema.json +10 -1
  121. package/dist/schemas/onchain_operations_repository.schema.json +10 -1
  122. package/dist/schemas/onchain_operations_reward.schema.json +10 -1
  123. package/dist/schemas/onchain_operations_service.schema.json +10 -1
  124. package/dist/schemas/onchain_operations_treasury.schema.json +10 -1
  125. package/dist/schemas/query_toolkit.output.json +17 -16
  126. package/dist/schemas/query_toolkit.schema.json +1 -1
  127. package/dist/tools/handlers/ask-user.d.ts +3 -0
  128. package/dist/tools/handlers/ask-user.js +1 -0
  129. package/dist/tools/handlers/config.js +1 -1
  130. package/dist/tools/handlers/local.d.ts +1 -0
  131. package/dist/tools/handlers/local.js +1 -1
  132. package/dist/tools/handlers/messenger.js +1 -1
  133. package/dist/tools/handlers/onchain.js +1 -1
  134. package/dist/tools/index.d.ts +2 -2
  135. package/dist/tools/index.js +1 -1
  136. package/dist/tools/registry/bridge.js +1 -1
  137. package/dist/tools/registry/business.js +1 -1
  138. package/dist/tools/registry/interaction.d.ts +2 -0
  139. package/dist/tools/registry/interaction.js +1 -0
  140. package/dist/tools/registry/local.js +1 -1
  141. package/dist/tools/registry/monitor.js +1 -1
  142. package/dist/tools/registry/onchain.js +1 -1
  143. package/dist/tools/registry/query.js +1 -1
  144. package/dist/tools/shared.js +1 -1
  145. package/dist/tools/types.d.ts +7 -1
  146. package/dist/tools/wrap.d.ts +3 -3
  147. package/dist/tools/wrap.js +1 -1
  148. package/package.json +2 -2
  149. package/dist/knowledge/allocation-confirm.d.ts +0 -115
  150. package/dist/knowledge/allocation-confirm.js +0 -1
  151. package/dist/knowledge/allocation-context.d.ts +0 -58
  152. package/dist/knowledge/allocation-context.js +0 -1
  153. package/dist/knowledge/allocation-translation.d.ts +0 -72
  154. package/dist/knowledge/allocation-translation.js +0 -1
  155. package/dist/knowledge/arb-confirm.d.ts +0 -28
  156. package/dist/knowledge/arb-confirm.js +0 -1
  157. package/dist/knowledge/arb-translation.d.ts +0 -48
  158. package/dist/knowledge/arb-translation.js +0 -1
  159. package/dist/knowledge/arbitration-confirm.d.ts +0 -135
  160. package/dist/knowledge/arbitration-confirm.js +0 -1
  161. package/dist/knowledge/arbitration-context.d.ts +0 -81
  162. package/dist/knowledge/arbitration-context.js +0 -1
  163. package/dist/knowledge/arbitration-translation.d.ts +0 -91
  164. package/dist/knowledge/arbitration-translation.js +0 -1
  165. package/dist/knowledge/bridge-confirm.d.ts +0 -26
  166. package/dist/knowledge/bridge-confirm.js +0 -1
  167. package/dist/knowledge/bridge-translation.d.ts +0 -37
  168. package/dist/knowledge/bridge-translation.js +0 -1
  169. package/dist/knowledge/contact-confirm.d.ts +0 -27
  170. package/dist/knowledge/contact-confirm.js +0 -1
  171. package/dist/knowledge/contact-translation.d.ts +0 -39
  172. package/dist/knowledge/contact-translation.js +0 -1
  173. package/dist/knowledge/demand-confirm.d.ts +0 -32
  174. package/dist/knowledge/demand-confirm.js +0 -1
  175. package/dist/knowledge/demand-context.d.ts +0 -17
  176. package/dist/knowledge/demand-context.js +0 -1
  177. package/dist/knowledge/demand-ledger.d.ts +0 -26
  178. package/dist/knowledge/demand-ledger.js +0 -1
  179. package/dist/knowledge/demand-puzzle.d.ts +0 -29
  180. package/dist/knowledge/demand-puzzle.js +0 -1
  181. package/dist/knowledge/demand-templates.d.ts +0 -12
  182. package/dist/knowledge/demand-templates.js +0 -1
  183. package/dist/knowledge/demand-translation.d.ts +0 -55
  184. package/dist/knowledge/demand-translation.js +0 -1
  185. package/dist/knowledge/examples-scanner-cli.d.ts +0 -1
  186. package/dist/knowledge/examples-scanner-cli.js +0 -1
  187. package/dist/knowledge/examples-scanner.d.ts +0 -121
  188. package/dist/knowledge/examples-scanner.js +0 -1
  189. package/dist/knowledge/glossary.d.ts +0 -18
  190. package/dist/knowledge/glossary.js +0 -1
  191. package/dist/knowledge/guard-bytecode-spec.d.ts +0 -82
  192. package/dist/knowledge/guard-bytecode-spec.js +0 -1
  193. package/dist/knowledge/guard-confirm.d.ts +0 -86
  194. package/dist/knowledge/guard-confirm.js +0 -1
  195. package/dist/knowledge/immutability.d.ts +0 -11
  196. package/dist/knowledge/immutability.js +0 -1
  197. package/dist/knowledge/machine-confirm.d.ts +0 -102
  198. package/dist/knowledge/machine-confirm.js +0 -1
  199. package/dist/knowledge/machine-context.d.ts +0 -160
  200. package/dist/knowledge/machine-context.js +0 -1
  201. package/dist/knowledge/machine-render.d.ts +0 -41
  202. package/dist/knowledge/machine-render.js +0 -1
  203. package/dist/knowledge/mcp-schema-audit-cli.d.ts +0 -1
  204. package/dist/knowledge/mcp-schema-audit-cli.js +0 -1
  205. package/dist/knowledge/mcp-schema-audit.d.ts +0 -91
  206. package/dist/knowledge/mcp-schema-audit.js +0 -1
  207. package/dist/knowledge/messenger-guard-guidance.d.ts +0 -17
  208. package/dist/knowledge/messenger-guard-guidance.js +0 -1
  209. package/dist/knowledge/order-confirm.d.ts +0 -115
  210. package/dist/knowledge/order-confirm.js +0 -1
  211. package/dist/knowledge/order-context.d.ts +0 -66
  212. package/dist/knowledge/order-context.js +0 -1
  213. package/dist/knowledge/order-translation.d.ts +0 -78
  214. package/dist/knowledge/order-translation.js +0 -1
  215. package/dist/knowledge/overrides-loader.d.ts +0 -13
  216. package/dist/knowledge/overrides-loader.js +0 -1
  217. package/dist/knowledge/passport-confirm.d.ts +0 -130
  218. package/dist/knowledge/passport-confirm.js +0 -1
  219. package/dist/knowledge/passport-context.d.ts +0 -59
  220. package/dist/knowledge/passport-context.js +0 -1
  221. package/dist/knowledge/passport-puzzle.d.ts +0 -108
  222. package/dist/knowledge/passport-puzzle.js +0 -1
  223. package/dist/knowledge/passport-risk.d.ts +0 -70
  224. package/dist/knowledge/passport-risk.js +0 -1
  225. package/dist/knowledge/passport-translation.d.ts +0 -68
  226. package/dist/knowledge/passport-translation.js +0 -1
  227. package/dist/knowledge/payment-confirm.d.ts +0 -26
  228. package/dist/knowledge/payment-confirm.js +0 -1
  229. package/dist/knowledge/payment-translation.d.ts +0 -37
  230. package/dist/knowledge/payment-translation.js +0 -1
  231. package/dist/knowledge/permission-confirm.d.ts +0 -110
  232. package/dist/knowledge/permission-confirm.js +0 -1
  233. package/dist/knowledge/permission-context.d.ts +0 -69
  234. package/dist/knowledge/permission-context.js +0 -1
  235. package/dist/knowledge/permission-translation.d.ts +0 -57
  236. package/dist/knowledge/permission-translation.js +0 -1
  237. package/dist/knowledge/personal-confirm.d.ts +0 -29
  238. package/dist/knowledge/personal-confirm.js +0 -1
  239. package/dist/knowledge/personal-translation.d.ts +0 -37
  240. package/dist/knowledge/personal-translation.js +0 -1
  241. package/dist/knowledge/process-model.d.ts +0 -14
  242. package/dist/knowledge/process-model.js +0 -1
  243. package/dist/knowledge/progress-confirm.d.ts +0 -108
  244. package/dist/knowledge/progress-confirm.js +0 -1
  245. package/dist/knowledge/progress-context.d.ts +0 -123
  246. package/dist/knowledge/progress-context.js +0 -1
  247. package/dist/knowledge/progress-translation.d.ts +0 -52
  248. package/dist/knowledge/progress-translation.js +0 -1
  249. package/dist/knowledge/proof-confirm.d.ts +0 -31
  250. package/dist/knowledge/proof-confirm.js +0 -1
  251. package/dist/knowledge/proof-context.d.ts +0 -17
  252. package/dist/knowledge/proof-context.js +0 -1
  253. package/dist/knowledge/proof-ledger.d.ts +0 -34
  254. package/dist/knowledge/proof-ledger.js +0 -1
  255. package/dist/knowledge/proof-puzzle.d.ts +0 -35
  256. package/dist/knowledge/proof-puzzle.js +0 -1
  257. package/dist/knowledge/proof-templates.d.ts +0 -22
  258. package/dist/knowledge/proof-templates.js +0 -1
  259. package/dist/knowledge/proof-translation.d.ts +0 -52
  260. package/dist/knowledge/proof-translation.js +0 -1
  261. package/dist/knowledge/registrar-confirm.d.ts +0 -26
  262. package/dist/knowledge/registrar-confirm.js +0 -1
  263. package/dist/knowledge/registrar-translation.d.ts +0 -37
  264. package/dist/knowledge/registrar-translation.js +0 -1
  265. package/dist/knowledge/repository-confirm.d.ts +0 -40
  266. package/dist/knowledge/repository-confirm.js +0 -1
  267. package/dist/knowledge/repository-context.d.ts +0 -12
  268. package/dist/knowledge/repository-context.js +0 -1
  269. package/dist/knowledge/repository-ledger.d.ts +0 -25
  270. package/dist/knowledge/repository-ledger.js +0 -1
  271. package/dist/knowledge/repository-puzzle.d.ts +0 -30
  272. package/dist/knowledge/repository-puzzle.js +0 -1
  273. package/dist/knowledge/repository-templates.d.ts +0 -14
  274. package/dist/knowledge/repository-templates.js +0 -1
  275. package/dist/knowledge/repository-translation.d.ts +0 -58
  276. package/dist/knowledge/repository-translation.js +0 -1
  277. package/dist/knowledge/resource-confirm.d.ts +0 -25
  278. package/dist/knowledge/resource-confirm.js +0 -1
  279. package/dist/knowledge/resource-translation.d.ts +0 -37
  280. package/dist/knowledge/resource-translation.js +0 -1
  281. package/dist/knowledge/reward-confirm.d.ts +0 -116
  282. package/dist/knowledge/reward-confirm.js +0 -1
  283. package/dist/knowledge/reward-context.d.ts +0 -127
  284. package/dist/knowledge/reward-context.js +0 -1
  285. package/dist/knowledge/reward-translation.d.ts +0 -58
  286. package/dist/knowledge/reward-translation.js +0 -1
  287. package/dist/knowledge/service-confirm.d.ts +0 -161
  288. package/dist/knowledge/service-confirm.js +0 -1
  289. package/dist/knowledge/service-context.d.ts +0 -66
  290. package/dist/knowledge/service-context.js +0 -1
  291. package/dist/knowledge/service-translation.d.ts +0 -103
  292. package/dist/knowledge/service-translation.js +0 -1
  293. package/dist/knowledge/treasury-confirm.d.ts +0 -133
  294. package/dist/knowledge/treasury-confirm.js +0 -1
  295. package/dist/knowledge/treasury-context.d.ts +0 -64
  296. package/dist/knowledge/treasury-context.js +0 -1
  297. package/dist/knowledge/treasury-translation.d.ts +0 -78
  298. package/dist/knowledge/treasury-translation.js +0 -1
  299. package/dist/knowledge/util-confirm.d.ts +0 -24
  300. package/dist/knowledge/util-confirm.js +0 -1
  301. package/dist/knowledge/util-translation.d.ts +0 -39
  302. package/dist/knowledge/util-translation.js +0 -1
  303. package/dist/loop-engineering/aggregate.d.ts +0 -50
  304. package/dist/loop-engineering/aggregate.js +0 -1
  305. package/dist/loop-engineering/context-collect.d.ts +0 -7
  306. package/dist/loop-engineering/context-collect.js +0 -1
  307. package/dist/loop-engineering/diagnose.d.ts +0 -22
  308. package/dist/loop-engineering/diagnose.js +0 -1
  309. package/dist/loop-engineering/improve.d.ts +0 -55
  310. package/dist/loop-engineering/improve.js +0 -1
  311. package/dist/loop-engineering/index.d.ts +0 -4
  312. package/dist/loop-engineering/index.js +0 -1
  313. package/dist/loop-engineering/pipeline.d.ts +0 -17
  314. package/dist/loop-engineering/pipeline.js +0 -1
  315. package/dist/schema/utils/object-type-utils.d.ts +0 -12
  316. package/dist/schema/utils/object-type-utils.js +0 -1
  317. package/dist/telemetry/index.d.ts +0 -19
  318. package/dist/telemetry/index.js +0 -1
  319. package/dist/telemetry/redact.d.ts +0 -2
  320. package/dist/telemetry/redact.js +0 -1
  321. package/dist/telemetry/storage.d.ts +0 -8
  322. package/dist/telemetry/storage.js +0 -1
@@ -1 +1 @@
1
- export const SERVICE_PERMISSIONS=[{'index':0x12c,'name':'SERVICE_NEW','description':'Create\x20new\x20Service','governed_operation':'service::new','post_publish_mutability':'na'},{'index':0x12d,'name':'SERVICE_DESCRIPTION','description':'Modify\x20Service\x20description','governed_operation':'service::description_set','post_publish_mutability':'mutable'},{'index':0x12f,'name':'SERVICE_LOCATION','description':'Set\x20Service\x20location/URL','governed_operation':'service::location_set','post_publish_mutability':'mutable'},{'index':0x130,'name':'SERVICE_REPOSITORY','description':'Add/remove\x20Repository\x20references','governed_operation':'service::repository_add/remove/clear','post_publish_mutability':'mutable'},{'index':0x131,'name':'SERVICE_SALES','description':'Add/set/remove/clear\x20sales\x20items','governed_operation':'service::sales_add/set/remove/clear','post_publish_mutability':'mutable'},{'index':0x132,'name':'SERVICE_MACHINE','description':'Bind/unbind\x20Machine\x20workflow\x20template','governed_operation':'service::machine_set/machine_none','post_publish_mutability':'immutable'},{'index':0x133,'name':'SERVICE_BUY_GUARD','description':'Set/clear\x20buy\x20Guard\x20(post-publish\x20mutable)','governed_operation':'service::buy_guard_set/buy_guard_none','post_publish_mutability':'mutable'},{'index':0x134,'name':'SERVICE_ARBITRATION','description':'Add/remove\x20Arbitration\x20references','governed_operation':'service::arbitration_add/remove/clear','post_publish_mutability':'immutable'},{'index':0x135,'name':'SERVICE_CUSTOMER_INFO_REQUIRED','description':'Set\x20customer\x20required\x20info\x20fields','governed_operation':'service::customer_required_set','post_publish_mutability':'mutable'},{'index':0x136,'name':'SERVICE_PAUSE','description':'Pause/resume\x20Service\x20(block\x20new\x20orders)','governed_operation':'service::pause','post_publish_mutability':'mutable'},{'index':0x137,'name':'SERVICE_PUBLISH','description':'Publish\x20Service\x20(IRREVERSIBLE)','governed_operation':'service::publish','post_publish_mutability':'one_shot'},{'index':0x138,'name':'SERVICE_DISCOUNT','description':'Issue/discount_destroy\x20discount\x20coupons','governed_operation':'service::discount','post_publish_mutability':'mutable'},{'index':0x139,'name':'SERVICE_ORDER_ALLOCATOR','description':'Set\x20order\x20allocator\x20strategy','governed_operation':'service::order_allocators_set','post_publish_mutability':'immutable'},{'index':0x13a,'name':'SERVICE_COMPENSATION_FUND_WITHDRAW','description':'Withdraw\x20compensation\x20fund\x20(time-locked)','governed_operation':'service::compensation_fund_withdraw','post_publish_mutability':'locked_by_duration'},{'index':0x13b,'name':'SERVICE_COMPENSATION_FUND_DEPOSIT','description':'Deposit\x20to\x20compensation\x20fund','governed_operation':'service::compensation_fund_add','post_publish_mutability':'mutable'},{'index':0x13c,'name':'SERVICE_COMPENSATION_FUND_RECEIVE','description':'Receive\x20compensation\x20fund\x20(arbitration\x20payout)','governed_operation':'service::compensation_fund_receive','post_publish_mutability':'mutable'},{'index':0x13d,'name':'SERVICE_COMPENSATION_LOCK_DURATION_ADD','description':'Extend\x20setting_lock_duration\x20(only-increase)','governed_operation':'service::setting_lock_duration_add','post_publish_mutability':'mutable'},{'index':0x13e,'name':'SERVICE_REWARD','description':'Add/remove\x20Reward\x20references\x20(remove/clear\x20time-locked)','governed_operation':'service::reward_add/remove/clear','post_publish_mutability':'locked_by_duration'},{'index':0x13f,'name':'SERVICE_OWNER_RECEIVE','description':'Receive\x20Payment/objects\x20to\x20owner','governed_operation':'service::owner_receive','post_publish_mutability':'mutable'},{'index':0x140,'name':'SERVICE_UM','description':'Bind/unbind\x20Contact\x20as\x20UM','governed_operation':'service::um_set/um_none','post_publish_mutability':'mutable'}];export const SERVICE_ORDER_FLOW_STAGES=[{'stage':0x1,'name':'pre_check','preconditions':['Service.bPublished\x20==\x20true\x20(else\x20E_SERVICE_NOT_PUBLISHED)','Service.bPaused\x20==\x20false\x20(else\x20E_SERVICE_PAUSED)','buy_guard\x20(if\x20set)\x20added\x20to\x20guards[]\x20list\x20for\x20verification'],'side_effects':[],'always_executed':!![]},{'stage':0x2,'name':'wip_verify','preconditions':['buy.items\x20non-empty','Each\x20item.name\x20matches\x20a\x20sale\x20in\x20Service.sales\x20(else\x20E_SALE_NOT_FOUND)','sale.suspension\x20==\x20false\x20(else\x20E_SALE_SUSPENDED)'],'side_effects':['If\x20buyer\x20passes\x20empty\x20wip_hash,\x20SDK\x20auto-fills\x20with\x20sale.wip_hash','verifiedWipUrls\x20Set\x20avoids\x20re-verifying\x20same\x20WIP\x20URL\x20across\x20items','verify_wip()\x20fetches\x20WIP\x20file\x20and\x20compares\x20hash\x20(else\x20E_WIP_HASH_NOT_MATCH)'],'always_executed':!![]},{'stage':0x3,'name':'quote','preconditions':['All\x20items\x20have\x20valid\x20sale\x20+\x20wip_hash\x20match','stock\x20>=\x20purchase\x20quantity\x20(else\x20E_STOCK_INSUFFICIENT)','discount\x20object\x20(if\x20used)\x20is\x20valid\x20and\x20unexpired'],'side_effects':['quote_imp()\x20computes\x20total\x20price\x20(with\x20discount\x20if\x20applicable)','⚠️\x20Stock\x20is\x20deducted\x20(split)\x20—\x20side\x20effect\x20is\x20NOT\x20auto-rolled-back\x20on\x20later\x20failure','service::quote\x20or\x20service::quote_with_discount\x20MoveCall'],'always_executed':!![]},{'stage':0x4,'name':'create_order','preconditions':['Quote\x20object\x20from\x20stage\x203','Registrar\x20+\x20Clock\x20objects\x20available'],'side_effects':['service::buy\x20or\x20service::buy_with_passport\x20MoveCall','Order\x20object\x20created\x20(builder=customer,\x20service=Service.id)','Order.id\x20recorded\x20for\x20stages\x205-7'],'always_executed':!![]},{'stage':0x5,'name':'create_allocation','preconditions':['Service.order_allocators\x20is\x20Some\x20(configured)','Order\x20from\x20stage\x204','CoinParam\x20for\x20total_pay\x20matches\x20Service<T>\x20type'],'side_effects':['service::order_allocation\x20MoveCall','Allocation\x20object\x20created\x20(first-match-wins\x20fund\x20distribution)','Order.allocation\x20=\x20Allocation\x20address'],'always_executed':!![]},{'stage':0x6,'name':'create_progress','preconditions':['Service.machine\x20is\x20Some\x20(machine\x20bound)','Order\x20from\x20stage\x204','Machine\x20from\x20Service.machine'],'side_effects':['service::order_progress\x20MoveCall','Progress\x20object\x20created\x20(Progress.machine\x20=\x20Service.machine,\x20Progress.task\x20=\x20Order.id)'],'always_executed':![]},{'stage':0x7,'name':'post_actions','preconditions':['Order/Allocation/Progress\x20objects\x20from\x20stages\x204-6'],'side_effects':['agent_set\x20(if\x20order_new.agents\x20provided)','order_required_info_update\x20(if\x20order_required_info\x20provided)','owner_change\x20(if\x20transfer\x20provided\x20—\x20sets\x20new\x20Order\x20owner)','namedNewOrder\x20/\x20namedNewAllocation\x20/\x20namedNewProgress\x20(local\x20naming)'],'always_executed':![]},{'stage':0x8,'name':'return_result','preconditions':['All\x20preceding\x20stages\x20succeeded'],'side_effects':['Returns\x20BuyResult\x20{\x20order,\x20allocation?,\x20progress?\x20}','Caller\x20proceeds\x20to\x20sign\x20+\x20submit\x20transaction'],'always_executed':!![]}];export const SERVICE_CROSS_OBJECT_BINDINGS=[{'object':'Machine','field':'machine','required':![],'locked_after_publish':!![],'notes':'Workflow\x20template;\x20post-publish\x20immutable\x20(F-S-20).\x20Progress.machine\x20inherits\x20this\x20value.'},{'object':'Guard','field':'buy_guard','required':![],'locked_after_publish':![],'notes':'Buyer\x20eligibility\x20guard;\x20post-publish\x20STILL\x20MUTABLE\x20(unusual\x20—\x20see\x20F-S-26)'},{'object':'Allocation','field':'order_allocators','required':!![],'locked_after_publish':!![],'notes':'Order\x20fund\x20distribution\x20strategy;\x20publish\x20prerequisite\x20(F-S-18).\x20Post-publish\x20immutable\x20(F-S-22).'},{'object':'Arbitration','field':'arbitrations','required':![],'locked_after_publish':![],'notes':'Dispute\x20handlers;\x20required\x20if\x20compensation_fund\x20>\x200\x20(F-S-19).\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish\x20(F-S-21).'},{'object':'Repository','field':'repositories','required':![],'locked_after_publish':![],'notes':'Shared\x20data\x20stores;\x20mutable\x20post-publish'},{'object':'Reward','field':'rewards','required':![],'locked_after_publish':![],'notes':'Marketing\x20incentives;\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish\x20(F-S-24)'},{'object':'Contact','field':'um','required':![],'locked_after_publish':![],'notes':'User\x20Manager\x20(Contact\x20object);\x20mutable\x20post-publish'},{'object':'Treasury','field':'(indirect\x20via\x20order_allocators.sharing.who=Entity)','required':![],'locked_after_publish':![],'notes':'Treasury\x20is\x20referenced\x20by\x20Allocation.sharing.who,\x20not\x20by\x20Service\x20directly'}];export const SERVICE_SCENES=[{'id':'service_retail','name':'Retail\x20e-commerce\x20Service','category':'retail','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set','customer_required_set'],'permission_index_operations':['service::publish\x20(311)','service::pause\x20(310)','service::sales_add/set/remove/clear\x20(305)','service::order_allocators_set\x20(313)','service::buy_guard_set\x20(307)','service::discount\x20(312)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)','If\x20compensation_fund\x20>\x200,\x20arbitrations\x20must\x20be\x20non-empty\x20(F-S-19)'],'common_patterns':['Multi-tier\x20pricing\x20via\x20sales[]\x20(Standard/Premium/Enterprise)','WIP\x20hash\x20per\x20sale\x20item\x20for\x20tamper-proof\x20product\x20info','buy_guard\x20for\x20KYC\x20whitelist\x20during\x20pre-sale,\x20then\x20null\x20for\x20public\x20sale','compensation_fund\x20deposited\x20before\x20publish\x20+\x20arbitrations\x20configured'],'recommended_templates':['T-S-01','T-S-06']},{'id':'service_rental','name':'Rental\x20Service\x20(short/long-term)','category':'rental','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set'],'permission_index_operations':['service::publish\x20(311)','service::sales_add/set\x20(305)','service::machine_set\x20(306)\x20—\x20for\x20rental\x20workflow','service::arbitration_add\x20(308)\x20—\x20for\x20deposit\x20disputes'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set','machine\x20recommended\x20(rental\x20workflow\x20with\x20deposit/return\x20stages)','arbitrations\x20recommended\x20(deposit\x20refund\x20disputes)'],'common_patterns':['Machine\x20workflow\x20with\x20\x27Deposit\x20→\x20Use\x20→\x20Return\x20→\x20Refund\x27\x20nodes','compensation_fund\x20holds\x20deposit\x20guarantees','buy_guard\x20verifies\x20renter\x20identity/KYC','stock=1\x20per\x20rental\x20item\x20(unique\x20items)'],'recommended_templates':['T-S-02','T-S-04']},{'id':'service_subscription','name':'Subscription\x20Service\x20(recurring)','category':'subscription','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set'],'permission_index_operations':['service::publish\x20(311)','service::sales_add/set\x20(305)','service::discount\x20(312)\x20—\x20promotional\x20rates','service::reward_add\x20(318)\x20—\x20loyalty\x20rewards'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Tiered\x20plans\x20(Free/Pro/Enterprise)\x20as\x20sales[]','Discount\x20coupons\x20for\x20trial\x20periods','Rewards\x20for\x20long-term\x20subscribers','Renewal\x20handled\x20by\x20repeat\x20orders\x20(no\x20native\x20recurring\x20billing)'],'recommended_templates':['T-S-03']},{'id':'service_workflow','name':'Workflow-bound\x20Service\x20(machine-bound)','category':'workflow','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set'],'permission_index_operations':['service::machine_set\x20(306)\x20—\x20bind\x20workflow','service::publish\x20(311)','service::order_allocators_set\x20(313)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set','machine\x20must\x20be\x20published\x20before\x20binding','machine\x20recommended\x20for\x20any\x20multi-stage\x20service\x20delivery'],'common_patterns':['Machine\x20defines\x20Pay\x20→\x20Confirm\x20→\x20Deliver\x20→\x20Sign-off\x20nodes','Progress\x20created\x20per\x20order\x20(stage\x206\x20of\x20buy\x20flow)','Named\x20operators\x20assigned\x20per\x20Forward\x20in\x20Machine','Service.paused\x20does\x20NOT\x20affect\x20already-created\x20Progress\x20(existing\x20orders\x20continue)'],'recommended_templates':['T-S-04']},{'id':'service_arbitration','name':'Arbitration-bound\x20Service\x20(dispute-ready)','category':'arbitration','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::arbitration_add\x20(308)','service::compensation_fund_add\x20(315)','service::setting_lock_duration_add\x20(317)','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['If\x20compensation_fund\x20>\x200,\x20arbitrations\x20must\x20be\x20non-empty\x20(F-S-19)','Arbitration\x20objects\x20must\x20be\x20created\x20before\x20binding','compensation_fund_add\x20before\x20publish\x20recommended\x20(else\x20post-publish\x20deposit\x20still\x20possible)'],'common_patterns':['2-3\x20Arbitration\x20objects\x20(different\x20arb\x20committees\x20for\x20different\x20dispute\x20types)','compensation_fund\x20deposited\x20as\x20%\x20of\x20expected\x20order\x20volume','setting_lock_duration\x20extended\x20by\x20owner\x20to\x20build\x20customer\x20trust','compensation_claim\x20triggered\x20by\x20arbitration\x20result\x20(not\x20by\x20Service\x20directly)'],'recommended_templates':['T-S-05','T-S-06']},{'id':'service_compensation_fund','name':'Compensation\x20Fund\x20Service\x20(embedded\x20balance)','category':'compensation_fund','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::compensation_fund_add\x20(315)\x20—\x20deposit','service::compensation_fund_withdraw\x20(314)\x20—\x20withdraw\x20(time-locked\x20after\x20publish)','service::compensation_fund_receive\x20(316)\x20—\x20receive\x20arbitration\x20payout\x20(always\x20mutable)','service::setting_lock_duration_add\x20(317)\x20—\x20extend\x20lock'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['compensation_fund\x20>\x200\x20→\x20arbitrations\x20non-empty\x20(F-S-19)','compensation_fund\x20coin\x20type\x20must\x20match\x20Service<T>\x20type\x20parameter'],'common_patterns':['Fund\x20inflow:\x20compensation_fund_add\x20(315)\x20—\x20always\x20mutable','Fund\x20outflow:\x20compensation_fund_withdraw\x20(314)\x20—\x20requires\x20bPaused\x20+\x20lock_duration\x20expired','Fund\x20receive:\x20compensation_fund_receive\x20(316)\x20—\x20arbitration\x20payout,\x20always\x20mutable','Fund\x20consumer:\x20arbitration::compensation_claim\x20(driven\x20by\x20arb\x20result)','Distinct\x20from\x20Treasury:\x20Service-internal,\x20arbitration-bound,\x20lock-protected'],'recommended_templates':['T-S-06']},{'id':'service_reward','name':'Reward-attached\x20Service\x20(marketing)','category':'reward','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::reward_add/remove/clear\x20(318)\x20—\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish','service::discount\x20(312)','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Rewards\x20added\x20post-publish\x20(always\x20allowed;\x20remove/clear\x20is\x20time-locked\x20after\x20publish)','Reward\x20objects\x20must\x20exist\x20before\x20binding\x20(queryObjectsWithType\x20validation)','MAX_REWARD_COUNT\x20=\x2020\x20per\x20Service','Reward\x20remove/clear\x20requires\x20Service\x20paused\x20+\x20setting_lock_duration\x20elapsed\x20(protects\x20customer\x20expectations)'],'recommended_templates':['T-S-08']},{'id':'service_arbitration_binding','name':'Arbitration\x20Binding\x20Service\x20(post-publish\x20immutable)','category':'arbitration','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::arbitration_add\x20(308)\x20—\x20pre-publish\x20only','service::arbitration_remove\x20(308)\x20—\x20pre-publish\x20only','service::arbitration_clear\x20(308)\x20—\x20pre-publish\x20only','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['MAX_ARBITRATION_COUNT\x20=\x2020\x20per\x20Service\x20(F-S-04)','Each\x20Arbitration\x20object\x20must\x20be\x20valid\x20(queryObjectsWithType\x20validation)','Arbitration\x20bound\x20=\x20locked\x20post-publish\x20(F-S-21).\x20To\x20change:\x20create\x20new\x20Service.'],'common_patterns':['Pre-publish:\x20set\x201-3\x20Arbitration\x20objects\x20for\x20different\x20dispute\x20scopes','Post-publish:\x20immutable\x20—\x20clone\x20Service\x20if\x20change\x20needed','⚠️\x20Data\x20inconsistency:\x20dynamic-pricing.ts\x20marks\x20arbitrations\x20as\x20mutable,\x20but\x20SDK\x20blocks\x20it\x20(F-S-21)'],'recommended_templates':['T-S-05']},{'id':'service_buy_guard','name':'Buy\x20Guard\x20Service\x20(post-publish\x20mutable\x20guard)','category':'buy_guard','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::buy_guard_set\x20(307)\x20—\x20bind\x20guard','service::buy_guard_none\x20(307)\x20—\x20clear\x20guard','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Pre-sale\x20phase:\x20buy_guard\x20=\x20whitelist\x20Guard\x20(KYC\x20verified\x20buyers\x20only)','Public\x20sale:\x20buy_guard\x20=\x20null\x20(anyone\x20can\x20buy)','Restricted\x20phase:\x20buy_guard\x20=\x20KYC\x20Guard\x20(compliance)','⚠️\x20buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception\x20—\x20still\x20mutable\x20post-publish','buy_guard\x20verification\x20happens\x20at\x20Stage\x201\x20of\x20buy\x20flow\x20(pre_check)'],'recommended_templates':['T-S-01']},{'id':'service_order_allocator','name':'Order\x20Allocator\x20Service\x20(fund\x20distribution\x20config)','category':'order_allocator','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::order_allocators_set\x20(313)\x20—\x20pre-publish\x20only','service::publish\x20(311)\x20—\x20requires\x20order_allocators\x20(F-S-18)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20MUST\x20be\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)','Allocators.sharing.who\x20can\x20reference\x20Treasury\x20addresses\x20(indirect\x20Treasury\x20binding)','MAX_SHARING_COUNT\x20=\x20100\x20per\x20allocator'],'common_patterns':['Multi-party\x20split:\x20merchant\x2080%\x20/\x20platform\x2010%\x20/\x20logistics\x2010%','Threshold-based:\x20different\x20allocators\x20for\x20different\x20order\x20sizes','Guard-bound\x20allocator:\x20allocation\x20execution\x20requires\x20Guard\x20verification','Post-publish\x20immutable\x20—\x20clone\x20Service\x20to\x20change\x20allocation\x20strategy'],'recommended_templates':['T-S-08']},{'id':'service_dynamic_pricing','name':'Dynamic\x20Pricing\x20Service\x20(discount-driven)','category':'dynamic_pricing','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::discount\x20(312)\x20—\x20issue\x20coupons','service::sales_add/set\x20(305)\x20—\x20adjust\x20base\x20prices','service::sales_remove\x20(305)\x20—\x20remove\x20deprecated\x20SKUs'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Discount\x20types:\x200=rates\x20(basis\x20points,\x20per\x2010000),\x201=minus\x20(direct\x20deduction)','MAX_DISCOUNT_COUNT_ONCE\x20=\x201000\x20per\x20issue\x20call','MAX_DISCOUNT_RECEIVER_ONCE\x20=\x201000\x20receivers\x20per\x20call','MAX_DISCOUNT_TOTAL_COUNT\x20=\x2020000\x20total\x20coupons','discount_destroy:\x20holder-only\x20(no\x20SERVICE_DISCOUNT\x20permission\x20needed)'],'recommended_templates':['T-S-07']},{'id':'service_multi_allocator','name':'Multi-Allocator\x20Service\x20(tiered\x20fund\x20distribution)','category':'multi_allocator','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::order_allocators_set\x20(313)\x20—\x20pre-publish\x20only','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20MUST\x20be\x20set','Each\x20allocator\x20has\x20its\x20own\x20Guard\x20+\x20sharing\x20+\x20threshold','First-match-wins:\x20first\x20allocator\x20whose\x20threshold\x20is\x20met\x20handles\x20the\x20order'],'common_patterns':['Tier\x201\x20(small\x20orders):\x20single-recipient\x20allocator\x20(low\x20fee)','Tier\x202\x20(medium\x20orders):\x20two-recipient\x20split\x20(merchant\x20+\x20platform)','Tier\x203\x20(large\x20orders):\x20three-recipient\x20split\x20(merchant\x20+\x20platform\x20+\x20logistics)','Each\x20tier\x20can\x20have\x20its\x20own\x20Guard\x20for\x20execution\x20authorization'],'recommended_templates':['T-S-08']}];export const SERVICE_LEDGER_VERSION='1.0.0';export function getScenesByCategory(a){return SERVICE_SCENES['filter'](b=>b['category']===a);}export function findSceneById(a){return SERVICE_SCENES['find'](b=>b['id']===a);}export function getServicePermissionByIndex(a){return SERVICE_PERMISSIONS['find'](b=>b['index']===a);}export function isServicePermission(a){return getServicePermissionByIndex(a)!==undefined;}export function getPermissionsByMutability(a){return SERVICE_PERMISSIONS['filter'](b=>b['post_publish_mutability']===a);}export function getImmutablePostPublishPermissions(){return SERVICE_PERMISSIONS['filter'](a=>a['post_publish_mutability']==='immutable'||a['post_publish_mutability']==='one_shot');}export function getLockedByDurationPermissions(){return SERVICE_PERMISSIONS['filter'](a=>a['post_publish_mutability']==='locked_by_duration');}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['retail','retail'],['ecommerce','retail'],['rental','rental'],['rent','rental'],['short-term\x20rental','rental'],['long-term\x20rental','rental'],['subscription','subscription'],['subscribe','subscription'],['workflow','workflow'],['machine-bound','workflow'],['arbitration','arbitration'],['dispute','arbitration'],['compensation','compensation_fund'],['compensation_fund','compensation_fund'],['reward','reward'],['marketing','reward'],['buy_guard','buy_guard'],['kyc','buy_guard'],['whitelist','buy_guard'],['allocator','order_allocator'],['discount','dynamic_pricing'],['coupon','dynamic_pricing'],['multi-allocator','multi_allocator'],['tiered','multi_allocator']];for(const [d,e]of c){if(b['includes'](d)){const f=getScenesByCategory(e);if(f['length']>0x0)return f[0x0];}}if(b['includes']('service'))return findSceneById('service_retail');return undefined;}export function getAllServiceScenes(){return[...SERVICE_SCENES];}export function getServiceScenesCount(){return SERVICE_SCENES['length'];}export function getServicePermissionsCount(){return SERVICE_PERMISSIONS['length'];}export function getOrderFlowStage(a){return SERVICE_ORDER_FLOW_STAGES['find'](b=>b['stage']===a);}export function getCrossObjectBindings(){return[...SERVICE_CROSS_OBJECT_BINDINGS];}
1
+ export const SERVICE_PERMISSIONS=[{'index':0x12c,'name':'SERVICE_NEW','description':'Create\x20new\x20Service','governed_operation':'service::new','post_publish_mutability':'na'},{'index':0x12d,'name':'SERVICE_DESCRIPTION','description':'Modify\x20Service\x20description','governed_operation':'service::description_set','post_publish_mutability':'mutable'},{'index':0x12f,'name':'SERVICE_LOCATION','description':'Set\x20Service\x20location/URL','governed_operation':'service::location_set','post_publish_mutability':'mutable'},{'index':0x130,'name':'SERVICE_REPOSITORY','description':'Add/remove\x20Repository\x20references','governed_operation':'service::repository_add/remove/clear','post_publish_mutability':'mutable'},{'index':0x131,'name':'SERVICE_SALES','description':'Add/set/remove/clear\x20sales\x20items','governed_operation':'service::sales_add/set/remove/clear','post_publish_mutability':'mutable'},{'index':0x132,'name':'SERVICE_MACHINE','description':'Bind/unbind\x20Machine\x20workflow\x20template','governed_operation':'service::machine_set/machine_none','post_publish_mutability':'immutable'},{'index':0x133,'name':'SERVICE_BUY_GUARD','description':'Set/clear\x20buy\x20Guard\x20(post-publish\x20mutable)','governed_operation':'service::buy_guard_set/buy_guard_none','post_publish_mutability':'mutable'},{'index':0x134,'name':'SERVICE_ARBITRATION','description':'Add/remove\x20Arbitration\x20references','governed_operation':'service::arbitration_add/remove/clear','post_publish_mutability':'immutable'},{'index':0x135,'name':'SERVICE_CUSTOMER_INFO_REQUIRED','description':'Set\x20customer\x20required\x20info\x20fields','governed_operation':'service::customer_required_set','post_publish_mutability':'mutable'},{'index':0x136,'name':'SERVICE_PAUSE','description':'Pause/resume\x20Service\x20(block\x20new\x20orders)','governed_operation':'service::pause','post_publish_mutability':'mutable'},{'index':0x137,'name':'SERVICE_PUBLISH','description':'Publish\x20Service\x20(IRREVERSIBLE)','governed_operation':'service::publish','post_publish_mutability':'one_shot'},{'index':0x138,'name':'SERVICE_DISCOUNT','description':'Issue/discount_destroy\x20discount\x20coupons','governed_operation':'service::discount','post_publish_mutability':'mutable'},{'index':0x139,'name':'SERVICE_ORDER_ALLOCATOR','description':'Set\x20order\x20allocator\x20strategy','governed_operation':'service::order_allocators_set','post_publish_mutability':'immutable'},{'index':0x13a,'name':'SERVICE_COMPENSATION_FUND_WITHDRAW','description':'Withdraw\x20compensation\x20fund\x20(time-locked)','governed_operation':'service::compensation_fund_withdraw','post_publish_mutability':'locked_by_duration'},{'index':0x13b,'name':'SERVICE_COMPENSATION_FUND_DEPOSIT','description':'Deposit\x20to\x20compensation\x20fund','governed_operation':'service::compensation_fund_add','post_publish_mutability':'mutable'},{'index':0x13c,'name':'SERVICE_COMPENSATION_FUND_RECEIVE','description':'Receive\x20compensation\x20fund\x20(arbitration\x20payout)','governed_operation':'service::compensation_fund_receive','post_publish_mutability':'mutable'},{'index':0x13d,'name':'SERVICE_COMPENSATION_LOCK_DURATION_ADD','description':'Extend\x20setting_lock_duration\x20(only-increase)','governed_operation':'service::setting_lock_duration_add','post_publish_mutability':'mutable'},{'index':0x13e,'name':'SERVICE_REWARD','description':'Add/remove\x20Reward\x20references\x20(remove/clear\x20time-locked)','governed_operation':'service::reward_add/remove/clear','post_publish_mutability':'locked_by_duration'},{'index':0x13f,'name':'SERVICE_OWNER_RECEIVE','description':'Receive\x20Payment/objects\x20to\x20owner','governed_operation':'service::owner_receive','post_publish_mutability':'mutable'},{'index':0x140,'name':'SERVICE_UM','description':'Bind/unbind\x20Contact\x20as\x20UM','governed_operation':'service::um_set/um_none','post_publish_mutability':'mutable'}];export const SERVICE_ORDER_FLOW_STAGES=[{'stage':0x1,'name':'pre_check','preconditions':['Service.bPublished\x20==\x20true\x20(else\x20E_NOT_PUBLISHED,\x20service:7)','Service.bPaused\x20==\x20false\x20(else\x20E_PAUSED,\x20service:19)','buy_guard\x20(if\x20set)\x20added\x20to\x20guards[]\x20list\x20for\x20verification'],'side_effects':[],'always_executed':!![]},{'stage':0x2,'name':'wip_verify','preconditions':['buy.items\x20non-empty','Each\x20item.name\x20matches\x20a\x20sale\x20in\x20Service.sales\x20(else\x20E_SALE_ITEM_NOT_FOUND,\x20service:32)','sale.suspension\x20==\x20false\x20(else\x20E_SALE_SUSPENDED)'],'side_effects':['If\x20buyer\x20passes\x20empty\x20wip_hash,\x20SDK\x20auto-fills\x20with\x20sale.wip_hash','verifiedWipUrls\x20Set\x20avoids\x20re-verifying\x20same\x20WIP\x20URL\x20across\x20items','verify_wip()\x20fetches\x20WIP\x20file\x20and\x20compares\x20hash\x20(else\x20E_WIP_HASH_NOT_MATCH)'],'always_executed':!![]},{'stage':0x3,'name':'quote','preconditions':['All\x20items\x20have\x20valid\x20sale\x20+\x20wip_hash\x20match','stock\x20>=\x20purchase\x20quantity\x20(else\x20E_STOCK_NOT_ENOUGH,\x20service:16)','discount\x20object\x20(if\x20used)\x20is\x20valid\x20and\x20within\x20its\x20[time_start,\x20time_end]\x20window\x20(else\x20E_DISCOUNT_TIME_INVALID)'],'side_effects':['quote_imp()\x20computes\x20total\x20price\x20(with\x20discount\x20if\x20applicable)','⚠️\x20Stock\x20is\x20deducted\x20(split)\x20—\x20side\x20effect\x20is\x20NOT\x20auto-rolled-back\x20on\x20later\x20failure','service::quote\x20or\x20service::quote_with_discount\x20MoveCall\x20(quote_with_discount\x20validates\x20the\x20Clock\x20time-window\x20check)'],'always_executed':!![]},{'stage':0x4,'name':'create_order','preconditions':['Quote\x20object\x20from\x20stage\x203','Registrar\x20+\x20Clock\x20objects\x20available'],'side_effects':['service::buy\x20or\x20service::buy_with_passport\x20MoveCall','Order\x20object\x20created\x20(builder=customer,\x20service=Service.id)','Order.id\x20recorded\x20for\x20stages\x205-7'],'always_executed':!![]},{'stage':0x5,'name':'create_allocation','preconditions':['Service.order_allocators\x20is\x20Some\x20(configured)','Order\x20from\x20stage\x204','CoinParam\x20for\x20total_pay\x20matches\x20Service<T>\x20type'],'side_effects':['service::order_allocation\x20MoveCall','Allocation\x20object\x20created\x20(first-match-wins\x20fund\x20distribution)','Order.allocation\x20=\x20Allocation\x20address'],'always_executed':!![]},{'stage':0x6,'name':'create_progress','preconditions':['Service.machine\x20is\x20Some\x20(machine\x20bound)','Order\x20from\x20stage\x204','Machine\x20from\x20Service.machine'],'side_effects':['service::order_progress\x20MoveCall','Progress\x20object\x20created\x20(Progress.machine\x20=\x20Service.machine,\x20Progress.task\x20=\x20Order.id)'],'always_executed':![]},{'stage':0x7,'name':'post_actions','preconditions':['Order/Allocation/Progress\x20objects\x20from\x20stages\x204-6'],'side_effects':['agent_set\x20(if\x20order_new.agents\x20provided)','order_required_info_update\x20(if\x20order_required_info\x20provided)','owner_change\x20(if\x20transfer\x20provided\x20—\x20sets\x20new\x20Order\x20owner)','namedNewOrder\x20/\x20namedNewAllocation\x20/\x20namedNewProgress\x20(local\x20naming)'],'always_executed':![]},{'stage':0x8,'name':'return_result','preconditions':['All\x20preceding\x20stages\x20succeeded'],'side_effects':['Returns\x20BuyResult\x20{\x20order,\x20allocation?,\x20progress?\x20}','Caller\x20proceeds\x20to\x20sign\x20+\x20submit\x20transaction'],'always_executed':!![]}];export const SERVICE_CROSS_OBJECT_BINDINGS=[{'object':'Machine','field':'machine','required':![],'locked_after_publish':!![],'notes':'Workflow\x20template;\x20post-publish\x20immutable\x20(F-S-20).\x20Progress.machine\x20inherits\x20this\x20value.'},{'object':'Guard','field':'buy_guard','required':![],'locked_after_publish':![],'notes':'Buyer\x20eligibility\x20guard;\x20post-publish\x20STILL\x20MUTABLE\x20(unusual\x20—\x20see\x20F-S-26)'},{'object':'Allocation','field':'order_allocators','required':!![],'locked_after_publish':!![],'notes':'Order\x20fund\x20distribution\x20strategy;\x20publish\x20prerequisite\x20(F-S-18).\x20Post-publish\x20immutable\x20(F-S-22).'},{'object':'Arbitration','field':'arbitrations','required':![],'locked_after_publish':![],'notes':'Dispute\x20handlers;\x20required\x20if\x20compensation_fund\x20>\x200\x20(F-S-19).\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish\x20(F-S-21).'},{'object':'Repository','field':'repositories','required':![],'locked_after_publish':![],'notes':'Shared\x20data\x20stores;\x20mutable\x20post-publish'},{'object':'Reward','field':'rewards','required':![],'locked_after_publish':![],'notes':'Marketing\x20incentives;\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish\x20(F-S-24)'},{'object':'Contact','field':'um','required':![],'locked_after_publish':![],'notes':'User\x20Manager\x20(Contact\x20object);\x20mutable\x20post-publish'},{'object':'Treasury','field':'(indirect\x20via\x20order_allocators.sharing.who=Entity)','required':![],'locked_after_publish':![],'notes':'Treasury\x20is\x20referenced\x20by\x20Allocation.sharing.who,\x20not\x20by\x20Service\x20directly'}];export const SERVICE_SCENES=[{'id':'service_retail','name':'Retail\x20e-commerce\x20Service','category':'retail','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set','customer_required_set'],'permission_index_operations':['service::publish\x20(311)','service::pause\x20(310)','service::sales_add/set/remove/clear\x20(305)','service::order_allocators_set\x20(313)','service::buy_guard_set\x20(307)','service::discount\x20(312)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)','If\x20compensation_fund\x20>\x200,\x20arbitrations\x20must\x20be\x20non-empty\x20(F-S-19)'],'common_patterns':['Multi-tier\x20pricing\x20via\x20sales[]\x20(Standard/Premium/Enterprise)','WIP\x20hash\x20per\x20sale\x20item\x20for\x20tamper-proof\x20product\x20info','buy_guard\x20for\x20KYC\x20whitelist\x20during\x20pre-sale,\x20then\x20null\x20for\x20public\x20sale','compensation_fund\x20deposited\x20before\x20publish\x20+\x20arbitrations\x20configured'],'recommended_templates':['T-S-01','T-S-06']},{'id':'service_rental','name':'Rental\x20Service\x20(short/long-term)','category':'rental','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set'],'permission_index_operations':['service::publish\x20(311)','service::sales_add/set\x20(305)','service::machine_set\x20(306)\x20—\x20for\x20rental\x20workflow','service::arbitration_add\x20(308)\x20—\x20for\x20deposit\x20disputes'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set','machine\x20recommended\x20(rental\x20workflow\x20with\x20deposit/return\x20stages)','arbitrations\x20recommended\x20(deposit\x20refund\x20disputes)'],'common_patterns':['Machine\x20workflow\x20with\x20\x27Deposit\x20→\x20Use\x20→\x20Return\x20→\x20Refund\x27\x20nodes','compensation_fund\x20holds\x20deposit\x20guarantees','buy_guard\x20verifies\x20renter\x20identity/KYC','stock=1\x20per\x20rental\x20item\x20(unique\x20items)'],'recommended_templates':['T-S-02','T-S-04']},{'id':'service_subscription','name':'Subscription\x20Service\x20(recurring)','category':'subscription','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set'],'permission_index_operations':['service::publish\x20(311)','service::sales_add/set\x20(305)','service::discount\x20(312)\x20—\x20promotional\x20rates','service::reward_add\x20(318)\x20—\x20loyalty\x20rewards'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Tiered\x20plans\x20(Free/Pro/Enterprise)\x20as\x20sales[]','Discount\x20coupons\x20for\x20trial\x20periods','Rewards\x20for\x20long-term\x20subscribers','Renewal\x20handled\x20by\x20repeat\x20orders\x20(no\x20native\x20recurring\x20billing)'],'recommended_templates':['T-S-03']},{'id':'service_workflow','name':'Workflow-bound\x20Service\x20(machine-bound)','category':'workflow','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set'],'permission_index_operations':['service::machine_set\x20(306)\x20—\x20bind\x20workflow','service::publish\x20(311)','service::order_allocators_set\x20(313)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set','machine\x20must\x20be\x20published\x20before\x20binding','machine\x20recommended\x20for\x20any\x20multi-stage\x20service\x20delivery'],'common_patterns':['Machine\x20defines\x20Pay\x20→\x20Confirm\x20→\x20Deliver\x20→\x20Sign-off\x20nodes','Progress\x20created\x20per\x20order\x20(stage\x206\x20of\x20buy\x20flow)','Named\x20operators\x20assigned\x20per\x20Forward\x20in\x20Machine','Service.paused\x20does\x20NOT\x20affect\x20already-created\x20Progress\x20(existing\x20orders\x20continue)'],'recommended_templates':['T-S-04']},{'id':'service_arbitration','name':'Arbitration-bound\x20Service\x20(dispute-ready)','category':'arbitration','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::arbitration_add\x20(308)','service::compensation_fund_add\x20(315)','service::setting_lock_duration_add\x20(317)','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['If\x20compensation_fund\x20>\x200,\x20arbitrations\x20must\x20be\x20non-empty\x20(F-S-19)','Arbitration\x20objects\x20must\x20be\x20created\x20before\x20binding','compensation_fund_add\x20before\x20publish\x20recommended\x20(else\x20post-publish\x20deposit\x20still\x20possible)'],'common_patterns':['2-3\x20Arbitration\x20objects\x20(different\x20arb\x20committees\x20for\x20different\x20dispute\x20types)','compensation_fund\x20deposited\x20as\x20%\x20of\x20expected\x20order\x20volume','setting_lock_duration\x20extended\x20by\x20owner\x20to\x20build\x20customer\x20trust','compensation_claim\x20triggered\x20by\x20arbitration\x20result\x20(not\x20by\x20Service\x20directly)'],'recommended_templates':['T-S-05','T-S-06']},{'id':'service_compensation_fund','name':'Compensation\x20Fund\x20Service\x20(embedded\x20balance)','category':'compensation_fund','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::compensation_fund_add\x20(315)\x20—\x20deposit','service::compensation_fund_withdraw\x20(314)\x20—\x20withdraw\x20(time-locked\x20after\x20publish)','service::compensation_fund_receive\x20(316)\x20—\x20receive\x20arbitration\x20payout\x20(always\x20mutable)','service::setting_lock_duration_add\x20(317)\x20—\x20extend\x20lock'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['compensation_fund\x20>\x200\x20→\x20arbitrations\x20non-empty\x20(F-S-19)','compensation_fund\x20coin\x20type\x20must\x20match\x20Service<T>\x20type\x20parameter'],'common_patterns':['Fund\x20inflow:\x20compensation_fund_add\x20(315)\x20—\x20always\x20mutable','Fund\x20outflow:\x20compensation_fund_withdraw\x20(314)\x20—\x20requires\x20bPaused\x20+\x20lock_duration\x20expired','Fund\x20receive:\x20compensation_fund_receive\x20(316)\x20—\x20arbitration\x20payout,\x20always\x20mutable','Fund\x20consumer:\x20arbitration::compensation_claim\x20(driven\x20by\x20arb\x20result)','Distinct\x20from\x20Treasury:\x20Service-internal,\x20arbitration-bound,\x20lock-protected'],'recommended_templates':['T-S-06']},{'id':'service_reward','name':'Reward-attached\x20Service\x20(marketing)','category':'reward','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::reward_add/remove/clear\x20(318)\x20—\x20add\x20always\x20mutable;\x20remove/clear\x20time-locked\x20after\x20publish','service::discount\x20(312)','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Rewards\x20added\x20post-publish\x20(always\x20allowed;\x20remove/clear\x20is\x20time-locked\x20after\x20publish)','Reward\x20objects\x20must\x20exist\x20before\x20binding\x20(queryObjectsWithType\x20validation)','MAX_REWARD_COUNT\x20=\x2020\x20per\x20Service','Reward\x20remove/clear\x20requires\x20Service\x20paused\x20+\x20setting_lock_duration\x20elapsed\x20(protects\x20customer\x20expectations)'],'recommended_templates':['T-S-08']},{'id':'service_arbitration_binding','name':'Arbitration\x20Binding\x20Service\x20(post-publish\x20immutable)','category':'arbitration','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::arbitration_add\x20(308)\x20—\x20pre-publish\x20only','service::arbitration_remove\x20(308)\x20—\x20pre-publish\x20only','service::arbitration_clear\x20(308)\x20—\x20pre-publish\x20only','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['MAX_ARBITRATION_COUNT\x20=\x2020\x20per\x20Service\x20(F-S-04)','Each\x20Arbitration\x20object\x20must\x20be\x20valid\x20(queryObjectsWithType\x20validation)','Arbitration\x20bound\x20=\x20locked\x20post-publish\x20(F-S-21).\x20To\x20change:\x20create\x20new\x20Service.'],'common_patterns':['Pre-publish:\x20set\x201-3\x20Arbitration\x20objects\x20for\x20different\x20dispute\x20scopes','Post-publish:\x20immutable\x20—\x20clone\x20Service\x20if\x20change\x20needed','⚠️\x20Data\x20inconsistency:\x20dynamic-pricing.ts\x20marks\x20arbitrations\x20as\x20mutable,\x20but\x20SDK\x20blocks\x20it\x20(F-S-21)'],'recommended_templates':['T-S-05']},{'id':'service_buy_guard','name':'Buy\x20Guard\x20Service\x20(post-publish\x20mutable\x20guard)','category':'buy_guard','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::buy_guard_set\x20(307)\x20—\x20bind\x20guard','service::buy_guard_none\x20(307)\x20—\x20clear\x20guard','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Pre-sale\x20phase:\x20buy_guard\x20=\x20whitelist\x20Guard\x20(KYC\x20verified\x20buyers\x20only)','Public\x20sale:\x20buy_guard\x20=\x20null\x20(anyone\x20can\x20buy)','Restricted\x20phase:\x20buy_guard\x20=\x20KYC\x20Guard\x20(compliance)','⚠️\x20buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception\x20—\x20still\x20mutable\x20post-publish','buy_guard\x20verification\x20happens\x20at\x20Stage\x201\x20of\x20buy\x20flow\x20(pre_check)'],'recommended_templates':['T-S-01']},{'id':'service_order_allocator','name':'Order\x20Allocator\x20Service\x20(fund\x20distribution\x20config)','category':'order_allocator','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::order_allocators_set\x20(313)\x20—\x20pre-publish\x20only','service::publish\x20(311)\x20—\x20requires\x20order_allocators\x20(F-S-18)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20MUST\x20be\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)','Allocators.sharing.who\x20can\x20reference\x20Treasury\x20addresses\x20(indirect\x20Treasury\x20binding)','MAX_SHARING_COUNT\x20=\x20100\x20per\x20allocator'],'common_patterns':['Multi-party\x20split:\x20merchant\x2080%\x20/\x20platform\x2010%\x20/\x20logistics\x2010%','Threshold-based:\x20different\x20allocators\x20for\x20different\x20order\x20sizes','Guard-bound\x20allocator:\x20allocation\x20execution\x20requires\x20Guard\x20verification','Post-publish\x20immutable\x20—\x20clone\x20Service\x20to\x20change\x20allocation\x20strategy'],'recommended_templates':['T-S-08']},{'id':'service_dynamic_pricing','name':'Dynamic\x20Pricing\x20Service\x20(discount-driven)','category':'dynamic_pricing','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::discount\x20(312)\x20—\x20issue\x20coupons','service::sales_add/set\x20(305)\x20—\x20adjust\x20base\x20prices','service::sales_remove\x20(305)\x20—\x20remove\x20deprecated\x20SKUs'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Discount\x20types:\x200=rates\x20(basis\x20points,\x20per\x2010000),\x201=minus\x20(direct\x20deduction)','MAX_DISCOUNT_COUNT_ONCE\x20=\x201000\x20per\x20issue\x20call','MAX_DISCOUNT_RECEIVER_ONCE\x20=\x201000\x20receivers\x20per\x20call','MAX_DISCOUNT_TOTAL_COUNT\x20=\x2020000\x20total\x20coupons','discount_destroy:\x20holder-only\x20(no\x20SERVICE_DISCOUNT\x20permission\x20needed)'],'recommended_templates':['T-S-07']},{'id':'service_multi_allocator','name':'Multi-Allocator\x20Service\x20(tiered\x20fund\x20distribution)','category':'multi_allocator','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::order_allocators_set\x20(313)\x20—\x20pre-publish\x20only','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'mutable','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20MUST\x20be\x20set','Each\x20allocator\x20has\x20its\x20own\x20Guard\x20+\x20sharing\x20+\x20threshold','First-match-wins:\x20first\x20allocator\x20whose\x20threshold\x20is\x20met\x20handles\x20the\x20order'],'common_patterns':['Tier\x201\x20(small\x20orders):\x20single-recipient\x20allocator\x20(low\x20fee)','Tier\x202\x20(medium\x20orders):\x20two-recipient\x20split\x20(merchant\x20+\x20platform)','Tier\x203\x20(large\x20orders):\x20three-recipient\x20split\x20(merchant\x20+\x20platform\x20+\x20logistics)','Each\x20tier\x20can\x20have\x20its\x20own\x20Guard\x20for\x20execution\x20authorization'],'recommended_templates':['T-S-08']}];export const SERVICE_LEDGER_VERSION='1.0.0';export function getScenesByCategory(a){return SERVICE_SCENES['filter'](b=>b['category']===a);}export function findSceneById(a){return SERVICE_SCENES['find'](b=>b['id']===a);}export function getServicePermissionByIndex(a){return SERVICE_PERMISSIONS['find'](b=>b['index']===a);}export function isServicePermission(a){return getServicePermissionByIndex(a)!==undefined;}export function getPermissionsByMutability(a){return SERVICE_PERMISSIONS['filter'](b=>b['post_publish_mutability']===a);}export function getImmutablePostPublishPermissions(){return SERVICE_PERMISSIONS['filter'](a=>a['post_publish_mutability']==='immutable'||a['post_publish_mutability']==='one_shot');}export function getLockedByDurationPermissions(){return SERVICE_PERMISSIONS['filter'](a=>a['post_publish_mutability']==='locked_by_duration');}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['retail','retail'],['ecommerce','retail'],['rental','rental'],['rent','rental'],['short-term\x20rental','rental'],['long-term\x20rental','rental'],['subscription','subscription'],['subscribe','subscription'],['workflow','workflow'],['machine-bound','workflow'],['arbitration','arbitration'],['dispute','arbitration'],['compensation','compensation_fund'],['compensation_fund','compensation_fund'],['reward','reward'],['marketing','reward'],['buy_guard','buy_guard'],['kyc','buy_guard'],['whitelist','buy_guard'],['allocator','order_allocator'],['discount','dynamic_pricing'],['coupon','dynamic_pricing'],['multi-allocator','multi_allocator'],['tiered','multi_allocator']];for(const [d,e]of c){if(b['includes'](d)){const f=getScenesByCategory(e);if(f['length']>0x0)return f[0x0];}}if(b['includes']('service'))return findSceneById('service_retail');return undefined;}export function getAllServiceScenes(){return[...SERVICE_SCENES];}export function getServiceScenesCount(){return SERVICE_SCENES['length'];}export function getServicePermissionsCount(){return SERVICE_PERMISSIONS['length'];}export function getOrderFlowStage(a){return SERVICE_ORDER_FLOW_STAGES['find'](b=>b['stage']===a);}export function getCrossObjectBindings(){return[...SERVICE_CROSS_OBJECT_BINDINGS];}
@@ -1 +1 @@
1
- import{MAX_SALE_COUNT,MAX_REPOSITORY_COUNT,MAX_ARBITRATION_COUNT,MAX_DISCOUNT_TOTAL_COUNT,MAX_WIP_LENGTH,MAX_WIP_HASH_LENGTH}from'@wowok/wowok';const R_S_1_01={'id':'R-S-1-01','category':'structural','trigger':'sales\x20count\x20exceeds\x20MAX_SALE_COUNT\x20(50)','check':a=>{const b=a['current_sales_count']??0x0;if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set')){const c=a['sales']['op']==='set'?a['sales']['sales']['length']:b+a['sales']['sales']['length'];if(c>MAX_SALE_COUNT)return{'id':'R-S-1-01','level':'HIGH','category':'structural','title':'Sales\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20sales\x20items,\x20exceeds\x20MAX_SALE_COUNT\x20'+MAX_SALE_COUNT,'affected_stakeholders':['owner','system'],'scenario':'Adding\x20too\x20many\x20product\x20SKUs','mitigation':'Split\x20into\x20multiple\x20Service\x20objects\x20or\x20remove\x20discontinued\x20items','evidence':'sales_count='+c};}return null;}},R_S_1_02={'id':'R-S-1-02','category':'structural','trigger':'repositories\x20count\x20exceeds\x20MAX_REPOSITORY_COUNT\x20(100)','check':a=>{const b=a['current_repositories_count']??0x0;if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set')){const c=a['repositories']['op']==='set'?a['repositories']['objects']['length']:b+a['repositories']['objects']['length'];if(c>MAX_REPOSITORY_COUNT)return{'id':'R-S-1-02','level':'MEDIUM','category':'structural','title':'Repositories\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20repositories,\x20exceeds\x20MAX_REPOSITORY_COUNT\x20'+MAX_REPOSITORY_COUNT,'affected_stakeholders':['owner'],'scenario':'Binding\x20too\x20many\x20data\x20repositories','mitigation':'Consolidate\x20repositories\x20or\x20remove\x20inactive\x20ones','evidence':'repositories_count='+c};}return null;}},R_S_1_03={'id':'R-S-1-03','category':'structural','trigger':'arbitrations\x20count\x20exceeds\x20MAX_ARBITRATION_COUNT\x20(20)','check':a=>{const b=a['current_arbitrations_count']??0x0;if(a['arbitrations']&&(a['arbitrations']['op']==='add'||a['arbitrations']['op']==='set')){const c=a['arbitrations']['op']==='set'?a['arbitrations']['objects']['length']:b+a['arbitrations']['objects']['length'];if(c>MAX_ARBITRATION_COUNT)return{'id':'R-S-1-03','level':'HIGH','category':'structural','title':'Arbitrations\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20arbitrations,\x20exceeds\x20MAX_ARBITRATION_COUNT\x20'+MAX_ARBITRATION_COUNT,'affected_stakeholders':['owner','arbitrator'],'scenario':'Binding\x20too\x20many\x20Arbitration\x20objects','mitigation':'Use\x201-3\x20Arbitration\x20objects\x20covering\x20different\x20dispute\x20scopes','evidence':'arbitrations_count='+c};}return null;}},R_S_1_04={'id':'R-S-1-04','category':'structural','trigger':'WIP\x20hash\x20length\x20exceeds\x20MAX_WIP_HASH_LENGTH\x20(64)\x20or\x20URL\x20exceeds\x20MAX_WIP_LENGTH\x20(1024)','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip_hash']&&b['wip_hash']['length']>MAX_WIP_HASH_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20hash\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip_hash\x20length\x20'+b['wip_hash']['length']+'\x20>\x20MAX_WIP_HASH_LENGTH\x20'+MAX_WIP_HASH_LENGTH,'affected_stakeholders':['owner','customer'],'scenario':'Malformed\x20WIP\x20hash\x20(should\x20be\x20sha256\x20hex,\x2064\x20chars)','mitigation':'Use\x20sha256\x20hex\x20hash\x20(64\x20characters,\x20no\x20prefix)','evidence':'wip_hash_length='+b['wip_hash']['length']};if(b['wip']&&b['wip']['length']>MAX_WIP_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20URL\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20URL\x20length\x20'+b['wip']['length']+'\x20>\x20MAX_WIP_LENGTH\x20'+MAX_WIP_LENGTH,'affected_stakeholders':['owner'],'scenario':'WIP\x20URL\x20too\x20long\x20(use\x20IPFS\x20or\x20short\x20HTTPS\x20URL)','mitigation':'Use\x20IPFS\x20CID\x20or\x20shorter\x20URL','evidence':'wip_url_length='+b['wip']['length']};}return null;}},R_S_1_05={'id':'R-S-1-05','category':'structural','trigger':'sale.wip\x20is\x20a\x20local\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20(not\x20network-deployable)\x20—\x20every\x20customer\x20order\x20fails','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&b['wip']!==''){let c=null;const d=b['wip'];if(/^[A-Za-z]:[\\/]/['test'](d)||d['startsWith']('/')||d['startsWith']('./')||d['startsWith']('../'))c='local\x20filesystem\x20path';else{if(/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0)([:/]|$)/i['test'](d))c='localhost/loopback\x20URL';else{if(/^https?:\/\/(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})([:/]|$)/i['test'](d))c='LAN\x20(private\x20IP)\x20URL';else!/^https?:\/\//i['test'](d)&&!d['startsWith']('ipfs://')&&!d['startsWith']('data:')&&(c='unrecognized\x20format\x20(not\x20a\x20network\x20URL)');}}if(c)return{'id':'R-S-1-05','level':'CRITICAL','category':'structural','title':'WIP\x20is\x20not\x20network-deployed\x20—\x20every\x20customer\x20order\x20will\x20fail','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20\x22'+b['wip']+'\x22\x20is\x20a\x20'+c+'.\x20It\x20passes\x20set-time\x20verification\x20'+'on\x20the\x20merchant\x27s\x20own\x20machine\x20but\x20is\x20unreachable\x20by\x20customers\x20on\x20other\x20machines\x20—\x20'+'order_new\x20aborts\x20100%\x20when\x20a\x20customer\x20tries\x20to\x20buy.','affected_stakeholders':['owner','customer'],'scenario':'Merchant\x20sets\x20wip\x20to\x20a\x20local\x20file\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20and\x20publishes\x20the\x20Service;\x20'+'the\x20on-chain\x20wip\x20points\x20at\x20the\x20merchant\x27s\x20machine;\x20customers\x20cannot\x20fetch\x20it.','mitigation':'Deploy\x20the\x20.wip\x20file\x20to\x20a\x20public\x20host\x20(GitHub\x20Pages,\x20IPFS,\x20or\x20your\x20own\x20website)\x20and\x20set\x20'+'sale.wip\x20to\x20the\x20public\x20URL.\x20Or\x20leave\x20sale.wip\x20empty\x20(\x22\x22)\x20to\x20skip\x20WIP\x20verification\x20'+'(TESTING\x20ONLY\x20—\x20not\x20recommended\x20for\x20production).','evidence':'sale='+b['name']+',\x20wip='+b['wip']};}}return null;}},R_S_2_01={'id':'R-S-2-01','category':'semantic','trigger':'WIP\x20hash\x20tampering\x20risk\x20—\x20owner\x20updates\x20WIP\x20file\x20without\x20updating\x20wip_hash','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&!b['wip_hash'])return{'id':'R-S-2-01','level':'CRITICAL','category':'semantic','title':'WIP\x20hash\x20missing\x20—\x20tampering\x20risk','description':'Sale\x20\x22'+b['name']+'\x22\x20has\x20wip\x20URL\x20but\x20no\x20wip_hash.\x20Owner\x20could\x20replace\x20the\x20WIP\x20file\x20without\x20customers\x20noticing.','affected_stakeholders':['customer','owner'],'scenario':'Owner\x20sets\x20wip\x20without\x20hash,\x20then\x20changes\x20file\x20content\x20later','mitigation':'Always\x20compute\x20sha256(wip_file_content)\x20and\x20set\x20as\x20wip_hash.\x20SDK\x20auto-derives\x20if\x20omitted,\x20but\x20explicit\x20hash\x20is\x20safer.','evidence':'sale='+b['name']};}return null;}},R_S_2_02={'id':'R-S-2-02','category':'semantic','trigger':'compensation_fund\x20confused\x20with\x20Service\x20balance\x20(internal\x20Balance<T>)','check':a=>{if(a['compensation_fund_add'])return{'id':'R-S-2-02','level':'HIGH','category':'semantic','title':'compensation_fund\x20is\x20internal\x20Balance<T>,\x20NOT\x20Service-owned\x20Treasury','description':'Depositing\x20'+a['compensation_fund_add']['balance']+'\x20to\x20compensation_fund.\x20This\x20balance\x20is\x20internal\x20to\x20Service<T>\x20and\x20is\x20consumed\x20by\x20arbitration::compensation_claim,\x20not\x20by\x20owner\x20withdrawals.\x20Owner\x20can\x20only\x20withdraw\x20via\x20compensation_fund_withdraw\x20(requires\x20bPaused=true\x20+\x20lock_duration\x20expired).','affected_stakeholders':['owner','arbitrator','customer'],'scenario':'Owner\x20confuses\x20compensation_fund\x20with\x20general\x20Treasury','mitigation':'Use\x20external\x20Treasury\x20(referenced\x20via\x20order_allocators.sharing.who=Entity)\x20for\x20general\x20funds.\x20Use\x20compensation_fund\x20only\x20for\x20arbitration\x20payouts.','evidence':'deposit='+a['compensation_fund_add']['balance']};return null;}},R_S_2_03={'id':'R-S-2-03','category':'semantic','trigger':'quote\x20side\x20effect\x20—\x20stock\x20deduction\x20not\x20rolled\x20back\x20on\x20later\x20failure','check':a=>{if(a['order_new']&&a['order_new']['buy']['items']['length']>0x0)return{'id':'R-S-2-03','level':'HIGH','category':'semantic','title':'Order\x20flow:\x20stock\x20deducted\x20at\x20quote\x20stage\x20—\x20NOT\x20rolled\x20back\x20on\x20failure','description':'Order\x20will\x20deduct\x20stock\x20at\x20Stage\x203\x20(quote).\x20If\x20Stages\x204-7\x20fail,\x20stock\x20remains\x20deducted.\x20Customer\x20must\x20manually\x20re-add\x20stock\x20or\x20accept\x20the\x20loss.','affected_stakeholders':['owner','customer'],'scenario':'Customer\x27s\x20transaction\x20fails\x20after\x20quote\x20but\x20stock\x20is\x20gone','mitigation':'1)\x20Monitor\x20failed\x20transactions\x20and\x20re-add\x20stock\x20via\x20stock_add.\x202)\x20Set\x20sales\x20suspension\x20during\x20high-failure\x20periods.\x203)\x20Use\x20small\x20batch\x20orders\x20to\x20limit\x20blast\x20radius.','evidence':'items='+a['order_new']['buy']['items']['length']};return null;}},R_S_2_04={'id':'R-S-2-04','category':'semantic','trigger':'Discount\x20issuance\x20—\x20verify\x20type\x20and\x20total\x20count\x20semantics','check':a=>{if(a['discount']){const b=a['discount']['count'];if(b>MAX_DISCOUNT_TOTAL_COUNT)return{'id':'R-S-2-04','level':'MEDIUM','category':'semantic','title':'Discount\x20count\x20exceeds\x20total\x20cap','description':'Issuing\x20'+b+'\x20discounts\x20exceeds\x20MAX_DISCOUNT_TOTAL_COUNT\x20'+MAX_DISCOUNT_TOTAL_COUNT,'affected_stakeholders':['owner'],'scenario':'Bulk\x20discount\x20issuance','mitigation':'Issue\x20in\x20batches\x20of\x20<=\x201000\x20(MAX_DISCOUNT_COUNT_ONCE)\x20and\x20keep\x20total\x20<=\x20'+MAX_DISCOUNT_TOTAL_COUNT,'evidence':'count='+b};}return null;}},R_S_2_05={'id':'R-S-2-05','category':'semantic','trigger':'Order\x20placed\x20without\x20verifying\x20WIP\x20hash\x20—\x20buyer\x20passes\x20empty\x20wip_hash','check':a=>{if(a['order_new']){const b=a['order_new']['buy']['items']['filter'](c=>c['wip_hash']==='');if(b['length']>0x0)return{'id':'R-S-2-05','level':'MEDIUM','category':'semantic','title':'Order\x20with\x20empty\x20wip_hash\x20—\x20SDK\x20auto-fills\x20from\x20sale','description':b['length']+'\x20item(s)\x20have\x20empty\x20wip_hash.\x20SDK\x20will\x20auto-fill\x20from\x20sale.wip_hash\x20at\x20order\x20time.\x20If\x20owner\x20updates\x20the\x20WIP\x20file\x20between\x20viewing\x20and\x20ordering,\x20buyer\x20receives\x20the\x20new\x20(potentially\x20different)\x20content.','affected_stakeholders':['customer'],'scenario':'Time-of-check\x20to\x20time-of-use\x20WIP\x20mismatch','mitigation':'Buyer\x20should\x20explicitly\x20pass\x20the\x20wip_hash\x20they\x20saw\x20when\x20viewing\x20the\x20product.\x20Empty\x20string\x20is\x20convenience\x20but\x20riskier.','evidence':'empty_hash_items='+b['length']};}return null;}},R_S_3_01={'id':'R-S-3-01','category':'authority','trigger':'publish\x20operation\x20—\x20requires\x20SERVICE_PUBLISH\x20(311)\x20+\x20prerequisites','check':a=>{if(!a['publish'])return null;const b=[];if(!a['current_order_allocators_set'])b['push']('order_allocators\x20not\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)');const c=a['current_compensation_fund_balance']??'0';BigInt(c)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0&&b['push']('compensation_fund\x20>\x200\x20but\x20no\x20arbitrations\x20(F-S-19,\x20E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)');if(b['length']>0x0)return{'id':'R-S-3-01','level':'CRITICAL','category':'authority','title':'Publish\x20blocked\x20—\x20prerequisites\x20not\x20met','description':'Cannot\x20publish:\x20'+b['join'](';\x20'),'affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20prerequisites','mitigation':'Configure\x20order_allocators\x20(and\x20arbitrations\x20if\x20compensation_fund\x20>\x200)\x20before\x20publish','evidence':'blockers='+b['length']};return null;}},R_S_3_02={'id':'R-S-3-02','category':'authority','trigger':'pause\x20operation\x20—\x20affects\x20new\x20orders\x20but\x20not\x20existing\x20Progress','check':a=>{if(a['pause']===undefined)return null;return{'id':'R-S-3-02','level':'MEDIUM','category':'authority','title':a['pause']?'Pausing\x20Service\x20—\x20new\x20orders\x20blocked,\x20existing\x20Progress\x20continues':'Resuming\x20Service\x20—\x20new\x20orders\x20accepted','description':a['pause']?'Service.bPaused\x20=\x20true\x20will\x20reject\x20new\x20orders\x20(E_SERVICE_PAUSED).\x20Existing\x20orders\x27\x20Progress\x20continues\x20normally.':'Service.bPaused\x20=\x20false\x20will\x20allow\x20new\x20orders\x20again.','affected_stakeholders':['owner','customer'],'scenario':a['pause']?'Owner\x20pauses\x20for\x20maintenance/stockout':'Owner\x20resumes\x20after\x20maintenance','mitigation':a['pause']?'Communicate\x20pause\x20to\x20customers.\x20Use\x20compensation_fund_withdraw\x20only\x20when\x20paused.':'Verify\x20stock\x20levels\x20before\x20resuming.','evidence':'pause='+a['pause']};}},R_S_3_03={'id':'R-S-3-03','category':'authority','trigger':'buy_guard\x20change\x20—\x20post-publish\x20mutable\x20(unusual\x20exception)','check':a=>{if(a['buy_guard']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-3-03','level':'MEDIUM','category':'authority','title':'buy_guard\x20change\x20post-publish\x20—\x20unusual\x20mutability','description':'buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception:\x20it\x20remains\x20mutable\x20post-publish.\x20Other\x20fields\x20(machine/arbitrations/order_allocators)\x20are\x20immutable.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20changes\x20buy_guard\x20strategy\x20after\x20publish\x20(e.g.\x20whitelist\x20→\x20public)','mitigation':'Document\x20buy_guard\x20changes\x20for\x20transparency.\x20Customers\x20should\x20re-verify\x20buy_guard\x20before\x20ordering.','evidence':'buy_guard='+(a['buy_guard']??'(cleared)')};return null;}},R_S_3_04={'id':'R-S-3-04','category':'authority','trigger':'Ownership\x20transfer\x20(builder\x20field)\x20—\x20irreversible','check':a=>{if(!a['builder'])return null;return{'id':'R-S-3-04','level':'HIGH','category':'authority','title':'Service\x20ownership\x20transfer\x20—\x20IRREVERSIBLE','description':'Transferring\x20Service\x20to\x20'+a['builder']+'.\x20Original\x20owner\x20loses\x20ALL\x20control.\x20New\x20owner\x20inherits\x20permission\x20+\x20compensation_fund\x20+\x20all\x20bindings.','affected_stakeholders':['owner'],'scenario':'Owner\x20transfers\x20Service\x20to\x20new\x20address','mitigation':'1)\x20Verify\x20new\x20owner\x20address\x20twice.\x202)\x20Withdraw\x20compensation_fund\x20first\x20(if\x20applicable).\x203)\x20Export\x20Service\x20JSON\x20before\x20transfer.','evidence':'new_owner='+a['builder']};}},R_S_4_01={'id':'R-S-4-01','category':'lifecycle','trigger':'publish\x20is\x20irreversible\x20—\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false','check':a=>{if(!a['publish'])return null;if(a['current_bPublished'])return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Service\x20already\x20published\x20—\x20publish\x20is\x20no-op','description':'Service.bPublished\x20is\x20already\x20true.\x20Subsequent\x20publish\x20calls\x20have\x20no\x20effect\x20(bPublished\x20is\x20one-shot,\x20cannot\x20revert).','affected_stakeholders':['owner'],'scenario':'Owner\x20calls\x20publish\x20again\x20on\x20already-published\x20Service','mitigation':'Skip\x20publish\x20if\x20already\x20published.\x20To\x20\x27reset\x27\x20a\x20Service,\x20create\x20a\x20new\x20one.','evidence':'bPublished=true'};return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Publish\x20is\x20IRREVERSIBLE\x20—\x203\x20fields\x20will\x20be\x20locked\x20forever','description':'Once\x20published:\x20machine\x20(306),\x20arbitrations\x20(308),\x20order_allocators\x20(313)\x20become\x20permanently\x20immutable.\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false.\x20Clone\x20Service\x20to\x20make\x20changes.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20publishes\x20Service\x20for\x20the\x20first\x20time','mitigation':'Verify\x20all\x20configurations\x20before\x20publish.\x20Run\x20pre-publish\x20checklist\x20(service-confirm.ts).','evidence':'bPublished=false→true'};}},R_S_4_02={'id':'R-S-4-02','category':'lifecycle','trigger':'setting_lock_duration\x20add\x20—\x20only-increase\x20mechanism','check':a=>{if(a['setting_lock_duration_add']===undefined)return null;return{'id':'R-S-4-02','level':'MEDIUM','category':'lifecycle','title':'setting_lock_duration\x20can\x20only\x20INCREASE','description':'Adding\x20'+a['setting_lock_duration_add']+'\x20ms\x20to\x20setting_lock_duration.\x20New\x20value\x20=\x20old\x20+\x20input\x20(safe_add).\x20Cannot\x20be\x20decreased\x20—\x20protects\x20customers\x20from\x20owner\x20reducing\x20lock\x20to\x20withdraw\x20compensation_fund\x20faster.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20extends\x20lock\x20period\x20to\x20build\x20trust','mitigation':'Ensure\x20extension\x20is\x20intentional.\x20Lock\x20affects\x20rewards/compensation_fund_withdraw/compensation_fund_receive.','evidence':'add_ms='+a['setting_lock_duration_add']};}},R_S_4_03={'id':'R-S-4-03','category':'lifecycle','trigger':'machine/arbitrations/order_allocators\x20modification\x20after\x20publish\x20—\x20SDK\x20blocks','check':a=>{if(!a['current_bPublished'])return null;const b=[];if(a['machine']!==undefined)b['push']('machine\x20(306)');if(a['arbitrations']!==undefined)b['push']('arbitrations\x20(308)');if(a['order_allocators']!==undefined)b['push']('order_allocators\x20(313)');if(b['length']>0x0)return{'id':'R-S-4-03','level':'HIGH','category':'lifecycle','title':'Post-publish\x20modification\x20blocked\x20by\x20SDK','description':'Service\x20is\x20published.\x20Cannot\x20modify:\x20'+b['join'](',\x20')+'.\x20SDK\x20checkNotPublished()\x20will\x20abort.\x20To\x20change\x20these\x20fields,\x20clone\x20the\x20Service.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20to\x20change\x20locked\x20field\x20post-publish','mitigation':'Create\x20a\x20new\x20Service\x20with\x20the\x20desired\x20configuration.\x20Migrate\x20active\x20orders\x20if\x20needed.','evidence':'blocked='+b['join'](',')};return null;}},R_S_4_04={'id':'R-S-4-04','category':'lifecycle','trigger':'sales\x20modification\x20—\x20stock/price\x20changes\x20affect\x20future\x20orders\x20only','check':a=>{if(!a['sales'])return null;return{'id':'R-S-4-04','level':'LOW','category':'lifecycle','title':'Sales\x20modification\x20affects\x20future\x20orders\x20only','description':'Sales\x20add/set/remove/clear\x20changes\x20do\x20NOT\x20affect\x20already-created\x20Orders.\x20Existing\x20Orders\x27\x20Progress\x20continues\x20with\x20the\x20original\x20sale\x20parameters.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20updates\x20prices\x20mid-campaign','mitigation':'Communicate\x20price/stock\x20changes\x20to\x20customers.\x20Existing\x20orders\x20are\x20unaffected.','evidence':'sales_op='+a['sales']['op']};}},R_S_4_05={'id':'R-S-4-05','category':'lifecycle','trigger':'Service\x20paused\x20(state-only\x20buyer\x20rule)\x20—\x20new\x20orders\x20are\x20suspended','check':a=>{if(!a['current_bPaused'])return null;return{'id':'R-S-4-05','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20paused\x20—\x20ordering\x20suspended','description':'Service.bPaused\x20is\x20true.\x20The\x20merchant\x20has\x20actively\x20paused\x20the\x20Service;\x20new\x20orders\x20cannot\x20be\x20placed\x20until\x20it\x20resumes.','affected_stakeholders':['customer'],'scenario':'Buyer\x20performs\x20due\x20diligence\x20on\x20a\x20paused\x20Service','mitigation':'Confirm\x20with\x20the\x20merchant\x20(via\x20Messenger)\x20when\x20the\x20Service\x20will\x20resume\x20before\x20ordering.','evidence':'bPaused=true'};}},R_S_4_06={'id':'R-S-4-06','category':'lifecycle','trigger':'Service\x20not\x20published\x20(state-only\x20buyer\x20rule)\x20—\x20cannot\x20be\x20ordered','check':a=>{if(a['current_bPublished']!==![])return null;return{'id':'R-S-4-06','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20not\x20published\x20—\x20cannot\x20be\x20ordered','description':'Service.bPublished\x20is\x20false.\x20The\x20Service\x20is\x20still\x20a\x20draft:\x20it\x20is\x20not\x20visible\x20on\x20the\x20market\x20and\x20order_new\x20will\x20fail.','affected_stakeholders':['customer'],'scenario':'Buyer\x20evaluates\x20a\x20draft\x20Service\x20shared\x20out-of-band','mitigation':'Wait\x20until\x20the\x20merchant\x20publishes\x20the\x20Service\x20(publish\x20is\x20irreversible\x20—\x20configuration\x20is\x20locked\x20at\x20that\x20point).','evidence':'bPublished=false'};}},R_S_5_01={'id':'R-S-5-01','category':'cross_object','trigger':'Machine\x20binding\x20—\x20post-publish\x20immutable,\x20Progress\x20inherits','check':a=>{if(a['machine']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-01','level':'HIGH','category':'cross_object','title':'Machine\x20binding\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20machine\x20cannot\x20be\x20changed.\x20All\x20future\x20Progress\x20objects\x20will\x20use\x20the\x20bound\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20upgrade\x20workflow\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20Machine.\x20Migrate\x20customers\x20via\x20discounts.','evidence':'machine='+(a['machine']??'(cleared)')};return{'id':'R-S-5-01','level':'MEDIUM','category':'cross_object','title':'Machine\x20binding\x20—\x20verify\x20Machine\x20is\x20published','description':'Binding\x20Machine\x20'+a['machine']+'.\x20Ensure\x20Machine\x20is\x20published\x20(machine::publish)\x20—\x20Service\x20cannot\x20bind\x20unpublished\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20binds\x20Machine\x20before\x20publishing\x20Service','mitigation':'Verify\x20Machine.bPublished\x20=\x20true\x20before\x20binding.','evidence':'machine='+a['machine']};}},R_S_5_02={'id':'R-S-5-02','category':'cross_object','trigger':'Arbitration\x20binding\x20—\x20required\x20when\x20compensation_fund\x20>\x200','check':a=>{if(!a['arbitrations'])return null;const b=a['current_compensation_fund_balance']??'0';if(BigInt(b)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-02','level':'HIGH','category':'cross_object','title':'Arbitration\x20required\x20—\x20compensation_fund\x20has\x20balance','description':'compensation_fund\x20balance\x20is\x20'+b+'.\x20Publish\x20will\x20fail\x20(E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)\x20until\x20arbitrations\x20is\x20non-empty.','affected_stakeholders':['owner'],'scenario':'Owner\x20deposits\x20compensation_fund\x20without\x20configuring\x20arbitrations','mitigation':'Add\x20at\x20least\x201\x20Arbitration\x20object\x20before\x20publish.','evidence':'compensation_fund='+b};return null;}},R_S_5_03={'id':'R-S-5-03','category':'cross_object','trigger':'order_allocators\x20binding\x20—\x20publish\x20prerequisite,\x20post-publish\x20immutable','check':a=>{if(a['order_allocators']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-03','level':'HIGH','category':'cross_object','title':'order_allocators\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20order_allocators\x20cannot\x20be\x20changed.\x20Fund\x20distribution\x20strategy\x20is\x20permanently\x20locked.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20adjust\x20fee\x20split\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20allocators.\x20Cannot\x20migrate\x20existing\x20Orders.','evidence':'order_allocators='+(a['order_allocators']?'(set)':'(cleared)')};if(a['publish']&&!a['order_allocators'])return{'id':'R-S-5-03','level':'CRITICAL','category':'cross_object','title':'Publish\x20without\x20order_allocators\x20—\x20will\x20fail','description':'Publish\x20will\x20abort\x20with\x20E_NO_ALLOCATOR.\x20order_allocators\x20is\x20a\x20mandatory\x20publish\x20prerequisite.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20allocators','mitigation':'Set\x20order_allocators\x20before\x20publish.','evidence':'order_allocators=null'};return null;}},R_S_5_04={'id':'R-S-5-04','category':'cross_object','trigger':'Repository/Reward\x20binding\x20—\x20verify\x20object\x20types\x20before\x20adding','check':a=>{if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Repository\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['repositories']['objects']['length']+'\x20repositories.\x20SDK\x20uses\x20queryObjectsWithType\x20to\x20validate\x20each\x20is\x20ObjectType.Repository\x20before\x20binding.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20non-Repository\x20object\x20by\x20mistake','mitigation':'Use\x20LocalMark\x20names\x20or\x20addresses\x20that\x20are\x20confirmed\x20Repository\x20objects.','evidence':'objects='+a['repositories']['objects']['length']};if(a['rewards']&&(a['rewards']['op']==='add'||a['rewards']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Reward\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['rewards']['objects']['length']+'\x20rewards.\x20SDK\x20validates\x20ObjectType.Reward.\x20add\x20is\x20always\x20allowed;\x20only\x20remove/clear\x20are\x20time-locked\x20after\x20publish.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20Reward\x20objects','mitigation':'Verify\x20Reward\x20objects\x20exist\x20and\x20are\x20active.\x20Remember\x20that\x20removing\x20them\x20later\x20requires\x20pause\x20+\x20setting_lock_duration\x20elapsed.','evidence':'objects='+a['rewards']['objects']['length']};return null;}},R_S_5_05={'id':'R-S-5-05','category':'cross_object','trigger':'compensation_fund\x20has\x20balance\x20but\x20no\x20Arbitration\x20bound\x20(state-only\x20buyer\x20rule)','check':a=>{const b=a['current_compensation_fund_balance'];if(b===undefined)return null;let c;try{c=BigInt(b);}catch{return null;}if(c>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-05','level':'HIGH','category':'cross_object','title':'Compensation\x20fund\x20without\x20Arbitration\x20—\x20fund\x20is\x20unclaimable','description':'compensation_fund\x20balance\x20is\x20'+b+'\x20but\x20no\x20Arbitration\x20object\x20is\x20bound.\x20Compensation\x20is\x20claimed\x20via\x20dispute\x20→\x20arbitration()\x20ruling\x20with\x20indemnity\x20→\x20arb_withdraw;\x20without\x20an\x20Arbitration\x20binding\x20there\x20is\x20no\x20dispute\x20path\x20to\x20trigger\x20a\x20payout.','affected_stakeholders':['customer','owner'],'scenario':'Buyer\x20sees\x20a\x20compensation\x20fund\x20but\x20no\x20dispute\x20path\x20to\x20claim\x20it','mitigation':'Require\x20the\x20merchant\x20to\x20bind\x20at\x20least\x20one\x20Arbitration\x20object\x20before\x20ordering.','evidence':'compensation_fund='+b+',\x20arbitrations=0'};return null;}},ALL_RULES=[R_S_1_01,R_S_1_02,R_S_1_03,R_S_1_04,R_S_1_05,R_S_2_01,R_S_2_02,R_S_2_03,R_S_2_04,R_S_2_05,R_S_3_01,R_S_3_02,R_S_3_03,R_S_3_04,R_S_4_01,R_S_4_02,R_S_4_03,R_S_4_04,R_S_4_05,R_S_4_06,R_S_5_01,R_S_5_02,R_S_5_03,R_S_5_04,R_S_5_05];export const SERVICE_RISK_VERSION='1.1.0';export function getAllServiceRiskRules(){return[...ALL_RULES];}export function getServiceRiskRulesCount(){return ALL_RULES['length'];}export function getServiceRiskRulesByCategory(a){return ALL_RULES['filter'](b=>b['category']===a);}export function assessServiceRisks(a){const b=[];for(const f of ALL_RULES){const g=f['check'](a);if(g)b['push'](g);}const c=b['length']===0x0?'LOW':b['some'](h=>h['level']==='CRITICAL')?'CRITICAL':b['some'](h=>h['level']==='HIGH')?'HIGH':b['some'](h=>h['level']==='MEDIUM')?'MEDIUM':'LOW',d={};for(const h of b){d[h['category']]=(d[h['category']]??0x0)+0x1;}const e={};for(const i of b){for(const j of i['affected_stakeholders']){if(!e[j])e[j]=[];e[j]['push'](i['id']+':\x20'+i['mitigation']);}}return{'summary':'Assessed\x20'+b['length']+'\x20risk(s)\x20across\x20'+Object['keys'](d)['length']+'\x20categories','risks':b,'overall_risk':c,'risks_by_category':d,'stakeholder_advice':e,'needs_human_review':b['some'](k=>k['level']==='CRITICAL'||k['level']==='HIGH')};}
1
+ import{MAX_SALE_COUNT,MAX_REPOSITORY_COUNT,MAX_ARBITRATION_COUNT,MAX_DISCOUNT_TOTAL_COUNT,MAX_WIP_LENGTH,MAX_WIP_HASH_LENGTH}from'@wowok/wowok';const R_S_1_01={'id':'R-S-1-01','category':'structural','trigger':'sales\x20count\x20exceeds\x20MAX_SALE_COUNT\x20(50)','check':a=>{const b=a['current_sales_count']??0x0;if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set')){const c=a['sales']['op']==='set'?a['sales']['sales']['length']:b+a['sales']['sales']['length'];if(c>MAX_SALE_COUNT)return{'id':'R-S-1-01','level':'HIGH','category':'structural','title':'Sales\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20sales\x20items,\x20exceeds\x20MAX_SALE_COUNT\x20'+MAX_SALE_COUNT,'affected_stakeholders':['owner','system'],'scenario':'Adding\x20too\x20many\x20product\x20SKUs','mitigation':'Split\x20into\x20multiple\x20Service\x20objects\x20or\x20remove\x20discontinued\x20items','evidence':'sales_count='+c};}return null;}},R_S_1_02={'id':'R-S-1-02','category':'structural','trigger':'repositories\x20count\x20exceeds\x20MAX_REPOSITORY_COUNT\x20(100)','check':a=>{const b=a['current_repositories_count']??0x0;if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set')){const c=a['repositories']['op']==='set'?a['repositories']['objects']['length']:b+a['repositories']['objects']['length'];if(c>MAX_REPOSITORY_COUNT)return{'id':'R-S-1-02','level':'MEDIUM','category':'structural','title':'Repositories\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20repositories,\x20exceeds\x20MAX_REPOSITORY_COUNT\x20'+MAX_REPOSITORY_COUNT,'affected_stakeholders':['owner'],'scenario':'Binding\x20too\x20many\x20data\x20repositories','mitigation':'Consolidate\x20repositories\x20or\x20remove\x20inactive\x20ones','evidence':'repositories_count='+c};}return null;}},R_S_1_03={'id':'R-S-1-03','category':'structural','trigger':'arbitrations\x20count\x20exceeds\x20MAX_ARBITRATION_COUNT\x20(20)','check':a=>{const b=a['current_arbitrations_count']??0x0;if(a['arbitrations']&&(a['arbitrations']['op']==='add'||a['arbitrations']['op']==='set')){const c=a['arbitrations']['op']==='set'?a['arbitrations']['objects']['length']:b+a['arbitrations']['objects']['length'];if(c>MAX_ARBITRATION_COUNT)return{'id':'R-S-1-03','level':'HIGH','category':'structural','title':'Arbitrations\x20count\x20exceeds\x20limit','description':'Service\x20would\x20have\x20'+c+'\x20arbitrations,\x20exceeds\x20MAX_ARBITRATION_COUNT\x20'+MAX_ARBITRATION_COUNT,'affected_stakeholders':['owner','arbitrator'],'scenario':'Binding\x20too\x20many\x20Arbitration\x20objects','mitigation':'Use\x201-3\x20Arbitration\x20objects\x20covering\x20different\x20dispute\x20scopes','evidence':'arbitrations_count='+c};}return null;}},R_S_1_04={'id':'R-S-1-04','category':'structural','trigger':'WIP\x20hash\x20length\x20exceeds\x20MAX_WIP_HASH_LENGTH\x20(64)\x20or\x20URL\x20exceeds\x20MAX_WIP_LENGTH\x20(1024)','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip_hash']&&b['wip_hash']['length']>MAX_WIP_HASH_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20hash\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip_hash\x20length\x20'+b['wip_hash']['length']+'\x20>\x20MAX_WIP_HASH_LENGTH\x20'+MAX_WIP_HASH_LENGTH,'affected_stakeholders':['owner','customer'],'scenario':'Malformed\x20WIP\x20hash\x20(should\x20be\x20sha256\x20hex,\x2064\x20chars)','mitigation':'Use\x20sha256\x20hex\x20hash\x20(64\x20characters,\x20no\x20prefix)','evidence':'wip_hash_length='+b['wip_hash']['length']};if(b['wip']&&b['wip']['length']>MAX_WIP_LENGTH)return{'id':'R-S-1-04','level':'HIGH','category':'structural','title':'WIP\x20URL\x20length\x20exceeds\x20limit','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20URL\x20length\x20'+b['wip']['length']+'\x20>\x20MAX_WIP_LENGTH\x20'+MAX_WIP_LENGTH,'affected_stakeholders':['owner'],'scenario':'WIP\x20URL\x20too\x20long\x20(use\x20IPFS\x20or\x20short\x20HTTPS\x20URL)','mitigation':'Use\x20IPFS\x20CID\x20or\x20shorter\x20URL','evidence':'wip_url_length='+b['wip']['length']};}return null;}},R_S_1_05={'id':'R-S-1-05','category':'structural','trigger':'sale.wip\x20is\x20a\x20local\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20(not\x20network-deployable)\x20—\x20every\x20customer\x20order\x20fails','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&b['wip']!==''){let c=null;const d=b['wip'];if(/^[A-Za-z]:[\\/]/['test'](d)||d['startsWith']('/')||d['startsWith']('./')||d['startsWith']('../'))c='local\x20filesystem\x20path';else{if(/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0)([:/]|$)/i['test'](d))c='localhost/loopback\x20URL';else{if(/^https?:\/\/(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})([:/]|$)/i['test'](d))c='LAN\x20(private\x20IP)\x20URL';else!/^https?:\/\//i['test'](d)&&!d['startsWith']('ipfs://')&&!d['startsWith']('data:')&&(c='unrecognized\x20format\x20(not\x20a\x20network\x20URL)');}}if(c)return{'id':'R-S-1-05','level':'CRITICAL','category':'structural','title':'WIP\x20is\x20not\x20network-deployed\x20—\x20every\x20customer\x20order\x20will\x20fail','description':'Sale\x20\x22'+b['name']+'\x22\x20wip\x20\x22'+b['wip']+'\x22\x20is\x20a\x20'+c+'.\x20It\x20passes\x20set-time\x20verification\x20'+'on\x20the\x20merchant\x27s\x20own\x20machine\x20but\x20is\x20unreachable\x20by\x20customers\x20on\x20other\x20machines\x20—\x20'+'order_new\x20aborts\x20100%\x20when\x20a\x20customer\x20tries\x20to\x20buy.','affected_stakeholders':['owner','customer'],'scenario':'Merchant\x20sets\x20wip\x20to\x20a\x20local\x20file\x20path\x20/\x20localhost\x20/\x20LAN\x20URL\x20and\x20publishes\x20the\x20Service;\x20'+'the\x20on-chain\x20wip\x20points\x20at\x20the\x20merchant\x27s\x20machine;\x20customers\x20cannot\x20fetch\x20it.','mitigation':'Deploy\x20the\x20.wip\x20file\x20to\x20a\x20public\x20host\x20(GitHub\x20Pages,\x20IPFS,\x20or\x20your\x20own\x20website)\x20and\x20set\x20'+'sale.wip\x20to\x20the\x20public\x20URL.\x20Or\x20leave\x20sale.wip\x20empty\x20(\x22\x22)\x20to\x20skip\x20WIP\x20verification\x20'+'(TESTING\x20ONLY\x20—\x20not\x20recommended\x20for\x20production).','evidence':'sale='+b['name']+',\x20wip='+b['wip']};}}return null;}},R_S_2_01={'id':'R-S-2-01','category':'semantic','trigger':'WIP\x20hash\x20tampering\x20risk\x20—\x20owner\x20updates\x20WIP\x20file\x20without\x20updating\x20wip_hash','check':a=>{if(a['sales']&&(a['sales']['op']==='add'||a['sales']['op']==='set'))for(const b of a['sales']['sales']){if(b['wip']&&!b['wip_hash'])return{'id':'R-S-2-01','level':'CRITICAL','category':'semantic','title':'WIP\x20hash\x20missing\x20—\x20tampering\x20risk','description':'Sale\x20\x22'+b['name']+'\x22\x20has\x20wip\x20URL\x20but\x20no\x20wip_hash.\x20Owner\x20could\x20replace\x20the\x20WIP\x20file\x20without\x20customers\x20noticing.','affected_stakeholders':['customer','owner'],'scenario':'Owner\x20sets\x20wip\x20without\x20hash,\x20then\x20changes\x20file\x20content\x20later','mitigation':'Always\x20compute\x20sha256(wip_file_content)\x20and\x20set\x20as\x20wip_hash.\x20SDK\x20auto-derives\x20if\x20omitted,\x20but\x20explicit\x20hash\x20is\x20safer.','evidence':'sale='+b['name']};}return null;}},R_S_2_02={'id':'R-S-2-02','category':'semantic','trigger':'compensation_fund\x20confused\x20with\x20Service\x20balance\x20(internal\x20Balance<T>)','check':a=>{if(a['compensation_fund_add'])return{'id':'R-S-2-02','level':'HIGH','category':'semantic','title':'compensation_fund\x20is\x20internal\x20Balance<T>,\x20NOT\x20Service-owned\x20Treasury','description':'Depositing\x20'+a['compensation_fund_add']['balance']+'\x20to\x20compensation_fund.\x20This\x20balance\x20is\x20internal\x20to\x20Service<T>\x20and\x20is\x20consumed\x20by\x20arbitration::compensation_claim,\x20not\x20by\x20owner\x20withdrawals.\x20Owner\x20can\x20only\x20withdraw\x20via\x20compensation_fund_withdraw\x20(requires\x20bPaused=true\x20+\x20lock_duration\x20expired).','affected_stakeholders':['owner','arbitrator','customer'],'scenario':'Owner\x20confuses\x20compensation_fund\x20with\x20general\x20Treasury','mitigation':'Use\x20external\x20Treasury\x20(referenced\x20via\x20order_allocators.sharing.who=Entity)\x20for\x20general\x20funds.\x20Use\x20compensation_fund\x20only\x20for\x20arbitration\x20payouts.','evidence':'deposit='+a['compensation_fund_add']['balance']};return null;}},R_S_2_03={'id':'R-S-2-03','category':'semantic','trigger':'quote\x20side\x20effect\x20—\x20stock\x20deduction\x20not\x20rolled\x20back\x20on\x20later\x20failure','check':a=>{if(a['order_new']&&a['order_new']['buy']['items']['length']>0x0)return{'id':'R-S-2-03','level':'HIGH','category':'semantic','title':'Order\x20flow:\x20stock\x20deducted\x20at\x20quote\x20stage\x20—\x20NOT\x20rolled\x20back\x20on\x20failure','description':'Order\x20will\x20deduct\x20stock\x20at\x20Stage\x203\x20(quote).\x20If\x20Stages\x204-7\x20fail,\x20stock\x20remains\x20deducted.\x20Customer\x20must\x20manually\x20re-add\x20stock\x20or\x20accept\x20the\x20loss.','affected_stakeholders':['owner','customer'],'scenario':'Customer\x27s\x20transaction\x20fails\x20after\x20quote\x20but\x20stock\x20is\x20gone','mitigation':'1)\x20Monitor\x20failed\x20transactions\x20and\x20re-add\x20stock\x20via\x20stock_add.\x202)\x20Set\x20sales\x20suspension\x20during\x20high-failure\x20periods.\x203)\x20Use\x20small\x20batch\x20orders\x20to\x20limit\x20blast\x20radius.','evidence':'items='+a['order_new']['buy']['items']['length']};return null;}},R_S_2_04={'id':'R-S-2-04','category':'semantic','trigger':'Discount\x20issuance\x20—\x20verify\x20type\x20and\x20total\x20count\x20semantics','check':a=>{if(a['discount']){const b=a['discount']['count'];if(b>MAX_DISCOUNT_TOTAL_COUNT)return{'id':'R-S-2-04','level':'MEDIUM','category':'semantic','title':'Discount\x20count\x20exceeds\x20total\x20cap','description':'Issuing\x20'+b+'\x20discounts\x20exceeds\x20MAX_DISCOUNT_TOTAL_COUNT\x20'+MAX_DISCOUNT_TOTAL_COUNT,'affected_stakeholders':['owner'],'scenario':'Bulk\x20discount\x20issuance','mitigation':'Issue\x20in\x20batches\x20of\x20<=\x201000\x20(MAX_DISCOUNT_COUNT_ONCE)\x20and\x20keep\x20total\x20<=\x20'+MAX_DISCOUNT_TOTAL_COUNT,'evidence':'count='+b};}return null;}},R_S_2_05={'id':'R-S-2-05','category':'semantic','trigger':'Order\x20placed\x20without\x20verifying\x20WIP\x20hash\x20—\x20buyer\x20passes\x20empty\x20wip_hash','check':a=>{if(a['order_new']){const b=a['order_new']['buy']['items']['filter'](c=>c['wip_hash']==='');if(b['length']>0x0)return{'id':'R-S-2-05','level':'MEDIUM','category':'semantic','title':'Order\x20with\x20empty\x20wip_hash\x20—\x20SDK\x20auto-fills\x20from\x20sale','description':b['length']+'\x20item(s)\x20have\x20empty\x20wip_hash.\x20SDK\x20will\x20auto-fill\x20from\x20sale.wip_hash\x20at\x20order\x20time.\x20If\x20owner\x20updates\x20the\x20WIP\x20file\x20between\x20viewing\x20and\x20ordering,\x20buyer\x20receives\x20the\x20new\x20(potentially\x20different)\x20content.','affected_stakeholders':['customer'],'scenario':'Time-of-check\x20to\x20time-of-use\x20WIP\x20mismatch','mitigation':'Buyer\x20should\x20explicitly\x20pass\x20the\x20wip_hash\x20they\x20saw\x20when\x20viewing\x20the\x20product.\x20Empty\x20string\x20is\x20convenience\x20but\x20riskier.','evidence':'empty_hash_items='+b['length']};}return null;}},R_S_3_01={'id':'R-S-3-01','category':'authority','trigger':'publish\x20operation\x20—\x20requires\x20SERVICE_PUBLISH\x20(311)\x20+\x20prerequisites','check':a=>{if(!a['publish'])return null;const b=[];if(!a['current_order_allocators_set'])b['push']('order_allocators\x20not\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)');const c=a['current_compensation_fund_balance']??'0';BigInt(c)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0&&b['push']('compensation_fund\x20>\x200\x20but\x20no\x20arbitrations\x20(F-S-19,\x20E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)');if(b['length']>0x0)return{'id':'R-S-3-01','level':'CRITICAL','category':'authority','title':'Publish\x20blocked\x20—\x20prerequisites\x20not\x20met','description':'Cannot\x20publish:\x20'+b['join'](';\x20'),'affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20prerequisites','mitigation':'Configure\x20order_allocators\x20(and\x20arbitrations\x20if\x20compensation_fund\x20>\x200)\x20before\x20publish','evidence':'blockers='+b['length']};return null;}},R_S_3_02={'id':'R-S-3-02','category':'authority','trigger':'pause\x20operation\x20—\x20affects\x20new\x20orders\x20but\x20not\x20existing\x20Progress','check':a=>{if(a['pause']===undefined)return null;return{'id':'R-S-3-02','level':'MEDIUM','category':'authority','title':a['pause']?'Pausing\x20Service\x20—\x20new\x20orders\x20blocked,\x20existing\x20Progress\x20continues':'Resuming\x20Service\x20—\x20new\x20orders\x20accepted','description':a['pause']?'Service.bPaused\x20=\x20true\x20will\x20reject\x20new\x20orders\x20(E_PAUSED,\x20service:19).\x20Existing\x20orders\x27\x20Progress\x20continues\x20normally.':'Service.bPaused\x20=\x20false\x20will\x20allow\x20new\x20orders\x20again.','affected_stakeholders':['owner','customer'],'scenario':a['pause']?'Owner\x20pauses\x20for\x20maintenance/stockout':'Owner\x20resumes\x20after\x20maintenance','mitigation':a['pause']?'Communicate\x20pause\x20to\x20customers.\x20Use\x20compensation_fund_withdraw\x20only\x20when\x20paused.':'Verify\x20stock\x20levels\x20before\x20resuming.','evidence':'pause='+a['pause']};}},R_S_3_03={'id':'R-S-3-03','category':'authority','trigger':'buy_guard\x20change\x20—\x20post-publish\x20mutable\x20(unusual\x20exception)','check':a=>{if(a['buy_guard']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-3-03','level':'MEDIUM','category':'authority','title':'buy_guard\x20change\x20post-publish\x20—\x20unusual\x20mutability','description':'buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception:\x20it\x20remains\x20mutable\x20post-publish.\x20Other\x20fields\x20(machine/arbitrations/order_allocators)\x20are\x20immutable.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20changes\x20buy_guard\x20strategy\x20after\x20publish\x20(e.g.\x20whitelist\x20→\x20public)','mitigation':'Document\x20buy_guard\x20changes\x20for\x20transparency.\x20Customers\x20should\x20re-verify\x20buy_guard\x20before\x20ordering.','evidence':'buy_guard='+(a['buy_guard']??'(cleared)')};return null;}},R_S_3_04={'id':'R-S-3-04','category':'authority','trigger':'Ownership\x20transfer\x20(builder\x20field)\x20—\x20irreversible','check':a=>{if(!a['builder'])return null;return{'id':'R-S-3-04','level':'HIGH','category':'authority','title':'Service\x20ownership\x20transfer\x20—\x20IRREVERSIBLE','description':'Transferring\x20Service\x20to\x20'+a['builder']+'.\x20Original\x20owner\x20loses\x20ALL\x20control.\x20New\x20owner\x20inherits\x20permission\x20+\x20compensation_fund\x20+\x20all\x20bindings.','affected_stakeholders':['owner'],'scenario':'Owner\x20transfers\x20Service\x20to\x20new\x20address','mitigation':'1)\x20Verify\x20new\x20owner\x20address\x20twice.\x202)\x20Withdraw\x20compensation_fund\x20first\x20(if\x20applicable).\x203)\x20Export\x20Service\x20JSON\x20before\x20transfer.','evidence':'new_owner='+a['builder']};}},R_S_4_01={'id':'R-S-4-01','category':'lifecycle','trigger':'publish\x20is\x20irreversible\x20—\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false','check':a=>{if(!a['publish'])return null;if(a['current_bPublished'])return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Service\x20already\x20published\x20—\x20publish\x20is\x20no-op','description':'Service.bPublished\x20is\x20already\x20true.\x20Subsequent\x20publish\x20calls\x20have\x20no\x20effect\x20(bPublished\x20is\x20one-shot,\x20cannot\x20revert).','affected_stakeholders':['owner'],'scenario':'Owner\x20calls\x20publish\x20again\x20on\x20already-published\x20Service','mitigation':'Skip\x20publish\x20if\x20already\x20published.\x20To\x20\x27reset\x27\x20a\x20Service,\x20create\x20a\x20new\x20one.','evidence':'bPublished=true'};return{'id':'R-S-4-01','level':'HIGH','category':'lifecycle','title':'Publish\x20is\x20IRREVERSIBLE\x20—\x203\x20fields\x20will\x20be\x20locked\x20forever','description':'Once\x20published:\x20machine\x20(306),\x20arbitrations\x20(308),\x20order_allocators\x20(313)\x20become\x20permanently\x20immutable.\x20bPublished\x20cannot\x20be\x20reset\x20to\x20false.\x20Clone\x20Service\x20to\x20make\x20changes.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20publishes\x20Service\x20for\x20the\x20first\x20time','mitigation':'Verify\x20all\x20configurations\x20before\x20publish.\x20Run\x20pre-publish\x20checklist\x20(confirm-gate.ts).','evidence':'bPublished=false→true'};}},R_S_4_02={'id':'R-S-4-02','category':'lifecycle','trigger':'setting_lock_duration\x20add\x20—\x20only-increase\x20mechanism','check':a=>{if(a['setting_lock_duration_add']===undefined)return null;return{'id':'R-S-4-02','level':'MEDIUM','category':'lifecycle','title':'setting_lock_duration\x20can\x20only\x20INCREASE','description':'Adding\x20'+a['setting_lock_duration_add']+'\x20ms\x20to\x20setting_lock_duration.\x20New\x20value\x20=\x20old\x20+\x20input\x20(safe_add).\x20Cannot\x20be\x20decreased\x20—\x20protects\x20customers\x20from\x20owner\x20reducing\x20lock\x20to\x20withdraw\x20compensation_fund\x20faster.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20extends\x20lock\x20period\x20to\x20build\x20trust','mitigation':'Ensure\x20extension\x20is\x20intentional.\x20Lock\x20affects\x20rewards/compensation_fund_withdraw/compensation_fund_receive.','evidence':'add_ms='+a['setting_lock_duration_add']};}},R_S_4_03={'id':'R-S-4-03','category':'lifecycle','trigger':'machine/arbitrations/order_allocators\x20modification\x20after\x20publish\x20—\x20SDK\x20blocks','check':a=>{if(!a['current_bPublished'])return null;const b=[];if(a['machine']!==undefined)b['push']('machine\x20(306)');if(a['arbitrations']!==undefined)b['push']('arbitrations\x20(308)');if(a['order_allocators']!==undefined)b['push']('order_allocators\x20(313)');if(b['length']>0x0)return{'id':'R-S-4-03','level':'HIGH','category':'lifecycle','title':'Post-publish\x20modification\x20blocked\x20by\x20SDK','description':'Service\x20is\x20published.\x20Cannot\x20modify:\x20'+b['join'](',\x20')+'.\x20SDK\x20checkNotPublished()\x20will\x20abort.\x20To\x20change\x20these\x20fields,\x20clone\x20the\x20Service.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20to\x20change\x20locked\x20field\x20post-publish','mitigation':'Create\x20a\x20new\x20Service\x20with\x20the\x20desired\x20configuration.\x20Migrate\x20active\x20orders\x20if\x20needed.','evidence':'blocked='+b['join'](',')};return null;}},R_S_4_04={'id':'R-S-4-04','category':'lifecycle','trigger':'sales\x20modification\x20—\x20stock/price\x20changes\x20affect\x20future\x20orders\x20only','check':a=>{if(!a['sales'])return null;return{'id':'R-S-4-04','level':'LOW','category':'lifecycle','title':'Sales\x20modification\x20affects\x20future\x20orders\x20only','description':'Sales\x20add/set/remove/clear\x20changes\x20do\x20NOT\x20affect\x20already-created\x20Orders.\x20Existing\x20Orders\x27\x20Progress\x20continues\x20with\x20the\x20original\x20sale\x20parameters.','affected_stakeholders':['owner','customer'],'scenario':'Owner\x20updates\x20prices\x20mid-campaign','mitigation':'Communicate\x20price/stock\x20changes\x20to\x20customers.\x20Existing\x20orders\x20are\x20unaffected.','evidence':'sales_op='+a['sales']['op']};}},R_S_4_05={'id':'R-S-4-05','category':'lifecycle','trigger':'Service\x20paused\x20(state-only\x20buyer\x20rule)\x20—\x20new\x20orders\x20are\x20suspended','check':a=>{if(!a['current_bPaused'])return null;return{'id':'R-S-4-05','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20paused\x20—\x20ordering\x20suspended','description':'Service.bPaused\x20is\x20true.\x20The\x20merchant\x20has\x20actively\x20paused\x20the\x20Service;\x20new\x20orders\x20cannot\x20be\x20placed\x20until\x20it\x20resumes.','affected_stakeholders':['customer'],'scenario':'Buyer\x20performs\x20due\x20diligence\x20on\x20a\x20paused\x20Service','mitigation':'Confirm\x20with\x20the\x20merchant\x20(via\x20Messenger)\x20when\x20the\x20Service\x20will\x20resume\x20before\x20ordering.','evidence':'bPaused=true'};}},R_S_4_06={'id':'R-S-4-06','category':'lifecycle','trigger':'Service\x20not\x20published\x20(state-only\x20buyer\x20rule)\x20—\x20cannot\x20be\x20ordered','check':a=>{if(a['current_bPublished']!==![])return null;return{'id':'R-S-4-06','level':'HIGH','category':'lifecycle','title':'Service\x20is\x20not\x20published\x20—\x20cannot\x20be\x20ordered','description':'Service.bPublished\x20is\x20false.\x20The\x20Service\x20is\x20still\x20a\x20draft:\x20it\x20is\x20not\x20visible\x20on\x20the\x20market\x20and\x20order_new\x20will\x20fail.','affected_stakeholders':['customer'],'scenario':'Buyer\x20evaluates\x20a\x20draft\x20Service\x20shared\x20out-of-band','mitigation':'Wait\x20until\x20the\x20merchant\x20publishes\x20the\x20Service\x20(publish\x20is\x20irreversible\x20—\x20configuration\x20is\x20locked\x20at\x20that\x20point).','evidence':'bPublished=false'};}},R_S_5_01={'id':'R-S-5-01','category':'cross_object','trigger':'Machine\x20binding\x20—\x20post-publish\x20immutable,\x20Progress\x20inherits','check':a=>{if(a['machine']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-01','level':'HIGH','category':'cross_object','title':'Machine\x20binding\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20machine\x20cannot\x20be\x20changed.\x20All\x20future\x20Progress\x20objects\x20will\x20use\x20the\x20bound\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20upgrade\x20workflow\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20Machine.\x20Migrate\x20customers\x20via\x20discounts.','evidence':'machine='+(a['machine']??'(cleared)')};return{'id':'R-S-5-01','level':'MEDIUM','category':'cross_object','title':'Machine\x20binding\x20—\x20verify\x20Machine\x20is\x20published','description':'Binding\x20Machine\x20'+a['machine']+'.\x20Ensure\x20Machine\x20is\x20published\x20(machine::publish)\x20—\x20Service\x20cannot\x20bind\x20unpublished\x20Machine.','affected_stakeholders':['owner'],'scenario':'Owner\x20binds\x20Machine\x20before\x20publishing\x20Service','mitigation':'Verify\x20Machine.bPublished\x20=\x20true\x20before\x20binding.','evidence':'machine='+a['machine']};}},R_S_5_02={'id':'R-S-5-02','category':'cross_object','trigger':'Arbitration\x20binding\x20—\x20required\x20when\x20compensation_fund\x20>\x200','check':a=>{if(!a['arbitrations'])return null;const b=a['current_compensation_fund_balance']??'0';if(BigInt(b)>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-02','level':'HIGH','category':'cross_object','title':'Arbitration\x20required\x20—\x20compensation_fund\x20has\x20balance','description':'compensation_fund\x20balance\x20is\x20'+b+'.\x20Publish\x20will\x20fail\x20(E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)\x20until\x20arbitrations\x20is\x20non-empty.','affected_stakeholders':['owner'],'scenario':'Owner\x20deposits\x20compensation_fund\x20without\x20configuring\x20arbitrations','mitigation':'Add\x20at\x20least\x201\x20Arbitration\x20object\x20before\x20publish.','evidence':'compensation_fund='+b};return null;}},R_S_5_03={'id':'R-S-5-03','category':'cross_object','trigger':'order_allocators\x20binding\x20—\x20publish\x20prerequisite,\x20post-publish\x20immutable','check':a=>{if(a['order_allocators']===undefined)return null;if(a['current_bPublished'])return{'id':'R-S-5-03','level':'HIGH','category':'cross_object','title':'order_allocators\x20immutable\x20post-publish','description':'Service\x20is\x20published;\x20order_allocators\x20cannot\x20be\x20changed.\x20Fund\x20distribution\x20strategy\x20is\x20permanently\x20locked.','affected_stakeholders':['owner'],'scenario':'Owner\x20wants\x20to\x20adjust\x20fee\x20split\x20post-publish','mitigation':'Create\x20new\x20Service\x20with\x20new\x20allocators.\x20Cannot\x20migrate\x20existing\x20Orders.','evidence':'order_allocators='+(a['order_allocators']?'(set)':'(cleared)')};if(a['publish']&&!a['order_allocators'])return{'id':'R-S-5-03','level':'CRITICAL','category':'cross_object','title':'Publish\x20without\x20order_allocators\x20—\x20will\x20fail','description':'Publish\x20will\x20abort\x20with\x20E_NO_ALLOCATOR.\x20order_allocators\x20is\x20a\x20mandatory\x20publish\x20prerequisite.','affected_stakeholders':['owner'],'scenario':'Owner\x20attempts\x20publish\x20without\x20configuring\x20allocators','mitigation':'Set\x20order_allocators\x20before\x20publish.','evidence':'order_allocators=null'};return null;}},R_S_5_04={'id':'R-S-5-04','category':'cross_object','trigger':'Repository/Reward\x20binding\x20—\x20verify\x20object\x20types\x20before\x20adding','check':a=>{if(a['repositories']&&(a['repositories']['op']==='add'||a['repositories']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Repository\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['repositories']['objects']['length']+'\x20repositories.\x20SDK\x20uses\x20queryObjectsWithType\x20to\x20validate\x20each\x20is\x20ObjectType.Repository\x20before\x20binding.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20non-Repository\x20object\x20by\x20mistake','mitigation':'Use\x20LocalMark\x20names\x20or\x20addresses\x20that\x20are\x20confirmed\x20Repository\x20objects.','evidence':'objects='+a['repositories']['objects']['length']};if(a['rewards']&&(a['rewards']['op']==='add'||a['rewards']['op']==='set'))return{'id':'R-S-5-04','level':'LOW','category':'cross_object','title':'Reward\x20binding\x20—\x20verify\x20object\x20types','description':'Adding\x20'+a['rewards']['objects']['length']+'\x20rewards.\x20SDK\x20validates\x20ObjectType.Reward.\x20add\x20is\x20always\x20allowed;\x20only\x20remove/clear\x20are\x20time-locked\x20after\x20publish.','affected_stakeholders':['owner'],'scenario':'Owner\x20adds\x20Reward\x20objects','mitigation':'Verify\x20Reward\x20objects\x20exist\x20and\x20are\x20active.\x20Remember\x20that\x20removing\x20them\x20later\x20requires\x20pause\x20+\x20setting_lock_duration\x20elapsed.','evidence':'objects='+a['rewards']['objects']['length']};return null;}},R_S_5_05={'id':'R-S-5-05','category':'cross_object','trigger':'compensation_fund\x20has\x20balance\x20but\x20no\x20Arbitration\x20bound\x20(state-only\x20buyer\x20rule)','check':a=>{const b=a['current_compensation_fund_balance'];if(b===undefined)return null;let c;try{c=BigInt(b);}catch{return null;}if(c>0x0n&&(a['current_arbitrations_count']??0x0)===0x0)return{'id':'R-S-5-05','level':'HIGH','category':'cross_object','title':'Compensation\x20fund\x20without\x20Arbitration\x20—\x20fund\x20is\x20unclaimable','description':'compensation_fund\x20balance\x20is\x20'+b+'\x20but\x20no\x20Arbitration\x20object\x20is\x20bound.\x20Compensation\x20is\x20claimed\x20via\x20dispute\x20→\x20arbitration()\x20ruling\x20with\x20indemnity\x20→\x20arb_withdraw;\x20without\x20an\x20Arbitration\x20binding\x20there\x20is\x20no\x20dispute\x20path\x20to\x20trigger\x20a\x20payout.','affected_stakeholders':['customer','owner'],'scenario':'Buyer\x20sees\x20a\x20compensation\x20fund\x20but\x20no\x20dispute\x20path\x20to\x20claim\x20it','mitigation':'Require\x20the\x20merchant\x20to\x20bind\x20at\x20least\x20one\x20Arbitration\x20object\x20before\x20ordering.','evidence':'compensation_fund='+b+',\x20arbitrations=0'};return null;}},ALL_RULES=[R_S_1_01,R_S_1_02,R_S_1_03,R_S_1_04,R_S_1_05,R_S_2_01,R_S_2_02,R_S_2_03,R_S_2_04,R_S_2_05,R_S_3_01,R_S_3_02,R_S_3_03,R_S_3_04,R_S_4_01,R_S_4_02,R_S_4_03,R_S_4_04,R_S_4_05,R_S_4_06,R_S_5_01,R_S_5_02,R_S_5_03,R_S_5_04,R_S_5_05];export const SERVICE_RISK_VERSION='1.1.0';export function getAllServiceRiskRules(){return[...ALL_RULES];}export function getServiceRiskRulesCount(){return ALL_RULES['length'];}export function getServiceRiskRulesByCategory(a){return ALL_RULES['filter'](b=>b['category']===a);}export function assessServiceRisks(a){const b=[];for(const f of ALL_RULES){const g=f['check'](a);if(g)b['push'](g);}const c=b['length']===0x0?'LOW':b['some'](h=>h['level']==='CRITICAL')?'CRITICAL':b['some'](h=>h['level']==='HIGH')?'HIGH':b['some'](h=>h['level']==='MEDIUM')?'MEDIUM':'LOW',d={};for(const h of b){d[h['category']]=(d[h['category']]??0x0)+0x1;}const e={};for(const i of b){for(const j of i['affected_stakeholders']){if(!e[j])e[j]=[];e[j]['push'](i['id']+':\x20'+i['mitigation']);}}return{'summary':'Assessed\x20'+b['length']+'\x20risk(s)\x20across\x20'+Object['keys'](d)['length']+'\x20categories','risks':b,'overall_risk':c,'risks_by_category':d,'stakeholder_advice':e,'needs_human_review':b['some'](k=>k['level']==='CRITICAL'||k['level']==='HIGH')};}
@@ -1 +1 @@
1
- import{GUARD_TEMPLATES,fillGuardTemplate}from'./guard-templates.js';import{MACHINE_TEMPLATES,fillTemplate as a235a}from'./machine-templates.js';import{SERVICE_TEMPLATES,fillServiceTemplate}from'./service-templates.js';import{ORDER_TEMPLATES,fillTemplate as a235b}from'./order-templates.js';import{PROGRESS_TEMPLATES,fillProgressTemplate}from'./progress-templates.js';import{ARBITRATION_TEMPLATES,fillTemplate as a235c}from'./arbitration-templates.js';import{TREASURY_TEMPLATES,fillTemplate as a235d}from'./treasury-templates.js';import{PERMISSION_TEMPLATES,fillTemplate as a235e}from'./permission-templates.js';import{PASSPORT_TEMPLATES,fillTemplate as a235f}from'./passport-templates.js';import{ALLOCATION_TEMPLATES,fillTemplate as a235g}from'./allocation-templates.js';import{CONTACT_TEMPLATES,fillTemplate as a235h}from'./contact-templates.js';import{REWARD_TEMPLATES}from'./reward-templates.js';export const TEMPLATE_REGISTRY_VERSION=0x1;export const TEMPLATE_OBJECT_TYPES=['guard','machine','service','order','progress','arbitration','treasury','permission','passport','allocation','reward','contact'];function normalizeParam(a){return{'name':a['name'],'type':a['type'],'description':a['description']??'','required':a['required'],...a['default']!==undefined?{'default':a['default']}:{},...a['constraint']!==undefined?{'constraint':a['constraint']}:{}};}function guardMeta(a){return{'id':a['id'],'object_type':'guard','name':a['name'],'description':a['description'],'scenes':[a['scene_id']],'industries':a['applicable_industries'],'instantiable':!![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}function machineMeta(a){return{'id':a['id'],'object_type':'machine','name':a['name'],'description':a['description'],'scenes':[a['scene_id']],'industries':a['applicable_industries'],'instantiable':!![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}function bodyMeta(a,b,c,d){return{'id':a['id'],'object_type':b,'name':a['name'],'description':a['description'],'scenes':c,'industries':d,'instantiable':!![],'parameters':a['params']['map'](e=>normalizeParam(e))};}function rewardMeta(a){return{'id':a['type'],'object_type':'reward','name':a['name'],'description':a['description'],'scenes':[],'industries':[],'instantiable':![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}let REGISTRY=null,ID_COLLISIONS=[];function buildRegistry(){const a=new Map(),b=[],c=d=>{if(a['has'](d['meta']['id'])){b['push'](d['meta']['id']);return;}a['set'](d['meta']['id'],d);};for(const d of GUARD_TEMPLATES){c({'meta':guardMeta(d),'raw':d,'notes':d['creation_notes']});}for(const e of MACHINE_TEMPLATES){c({'meta':machineMeta(e),'raw':e,'notes':e['creation_notes']});}for(const f of SERVICE_TEMPLATES){c({'meta':bodyMeta(f,'service',f['applicable_scenes'],f['industry_tags']),'raw':f,'notes':f['notes']});}for(const g of ORDER_TEMPLATES){c({'meta':bodyMeta(g,'order',g['applicable_scenes'],g['industry_tags']),'raw':g,'notes':g['notes']});}for(const h of PROGRESS_TEMPLATES){c({'meta':bodyMeta(h,'progress',h['applicable_scenes'],h['industry_tags']),'raw':h,'notes':h['notes']});}for(const i of ARBITRATION_TEMPLATES){c({'meta':bodyMeta(i,'arbitration',i['applicable_scenes'],i['industry_tags']),'raw':i,'notes':i['notes']});}for(const j of TREASURY_TEMPLATES){c({'meta':bodyMeta(j,'treasury',j['applicable_scenes'],j['industry_tags']),'raw':j,'notes':j['notes']});}for(const k of PERMISSION_TEMPLATES){c({'meta':bodyMeta(k,'permission',k['applicable_scenes'],k['industry_tags']),'raw':k,'notes':k['notes']});}for(const l of PASSPORT_TEMPLATES){c({'meta':bodyMeta(l,'passport',l['applicable_scenarios'],l['industry_tags']),'raw':l,'notes':l['notes']});}for(const m of ALLOCATION_TEMPLATES){c({'meta':bodyMeta(m,'allocation',m['applicable_scenes'],m['industry_tags']),'raw':m,'notes':m['notes']});}for(const n of REWARD_TEMPLATES){c({'meta':rewardMeta(n),'raw':n,'guidance':{'guardCondition':n['guardCondition'],'amountRange':n['amountRange'],'allocationStrategy':n['allocationStrategy'],'example':n['example'],'relevantGuardOps':n['relevantGuardOps']}});}for(const o of CONTACT_TEMPLATES){c({'meta':bodyMeta(o,'contact',o['applicable_scenes'],o['industry_tags']),'raw':o,'notes':o['notes']});}return ID_COLLISIONS=b,a;}function registry(){return!REGISTRY&&(REGISTRY=buildRegistry()),REGISTRY;}export function getTemplateIdCollisions(){return registry(),ID_COLLISIONS;}export function getTemplateCounts(){const a=Object['fromEntries'](TEMPLATE_OBJECT_TYPES['map'](b=>[b,0x0]));for(const b of registry()['values']()){a[b['meta']['object_type']]+=0x1;}return a;}export function listTemplates(a){const b=[...registry()['values']()]['map'](c=>c['meta']);return a?b['filter'](c=>c['object_type']===a):b;}export function getTemplateDetail(a){const b=registry()['get'](a);if(!b)return null;return{...b['meta'],'raw':b['raw'],...b['notes']?{'notes':b['notes']}:{},...b['guidance']?{'guidance':b['guidance']}:{}};}export function findTemplateObjectType(a){return registry()['get'](a)?.['meta']['object_type']??null;}export function instantiateTemplate(a,b){const c=registry()['get'](a);if(!c)return{'ok':![],'object_type':null,'template_id':a,'error':'Template\x20not\x20found:\x20'+a+'.\x20Use\x20get_templates\x20without\x20\x27template\x27\x20to\x20list\x20all\x20template\x20ids.'};const d=c['meta']['object_type'];if(!c['meta']['instantiable'])return{'ok':![],'object_type':d,'template_id':a,'error':'Reward\x20templates\x20are\x20guidance-only\x20(prose\x20guard\x20conditions)\x20and\x20cannot\x20be\x20'+'instantiated\x20into\x20executable\x20JSON.\x20Use\x20the\x20guidance\x20payload\x20to\x20design\x20the\x20'+'Reward\x20+\x20Guard\x20manually.','guidance':c['guidance']};switch(d){case'guard':{const e=fillGuardTemplate(a,b);if(!e['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':e['error'],...e['missing']?{'missing_params':e['missing']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':{'table':e['table'],'root':e['root']},...c['notes']?{'notes':c['notes']}:{}};}case'machine':{const f=a235a(a,b);if(!f['success'])return{'ok':![],'object_type':d,'template_id':a,'error':f['validation_errors']?.['join'](';\x20')??'Machine\x20template\x20fill\x20failed',...f['missing_params']?{'missing_params':f['missing_params']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':{'nodes':f['filled_nodes'],'pairs':f['filled_pairs']},...c['notes']?{'notes':c['notes']}:{}};}case'service':{const g=fillServiceTemplate(a,b);if(!g['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':g['error']??'Service\x20template\x20fill\x20failed',...g['missing_required']?{'missing_params':g['missing_required']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':g['body'],...c['notes']?{'notes':c['notes']}:{}};}case'order':case'arbitration':case'treasury':case'permission':case'passport':case'allocation':case'progress':case'contact':{const h=fillBodyTemplate(d,a,b);if(!h['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':h['error']};return{'ok':!![],'object_type':d,'template_id':a,'body':h['body'],...c['notes']?{'notes':c['notes']}:{}};}default:return{'ok':![],'object_type':d,'template_id':a,'error':'Instantiation\x20not\x20supported\x20for\x20object_type\x20\x27'+d+'\x27'};}}function fillBodyTemplate(a,b,c){switch(a){case'order':return a235b(b,c);case'arbitration':return a235c(b,c);case'treasury':return a235d(b,c);case'permission':return a235e(b,c);case'passport':return a235f(b,c);case'allocation':return a235g(b,c);case'progress':return fillProgressTemplate(b,c);case'contact':return a235h(b,c);default:return{'ok':![],'error':'No\x20body-template\x20fill\x20for\x20\x27'+a+'\x27'};}}
1
+ import{GUARD_TEMPLATES,fillGuardTemplate}from'./guard-templates.js';import{MACHINE_TEMPLATES,fillTemplate as a163a}from'./machine-templates.js';import{SERVICE_TEMPLATES,fillServiceTemplate}from'./service-templates.js';import{ORDER_TEMPLATES,fillTemplate as a163b}from'./order-templates.js';import{PROGRESS_TEMPLATES,fillProgressTemplate}from'./progress-templates.js';import{ARBITRATION_TEMPLATES,fillTemplate as a163c}from'./arbitration-templates.js';import{TREASURY_TEMPLATES,fillTemplate as a163d}from'./treasury-templates.js';import{PERMISSION_TEMPLATES,fillTemplate as a163e}from'./permission-templates.js';import{PASSPORT_TEMPLATES,fillTemplate as a163f}from'./passport-templates.js';import{ALLOCATION_TEMPLATES,fillTemplate as a163g}from'./allocation-templates.js';import{CONTACT_TEMPLATES,fillTemplate as a163h}from'./contact-templates.js';import{REWARD_TEMPLATES}from'./reward-templates.js';export const TEMPLATE_REGISTRY_VERSION=0x1;export const TEMPLATE_OBJECT_TYPES=['guard','machine','service','order','progress','arbitration','treasury','permission','passport','allocation','reward','contact'];function normalizeParam(a){return{'name':a['name'],'type':a['type'],'description':a['description']??'','required':a['required'],...a['default']!==undefined?{'default':a['default']}:{},...a['constraint']!==undefined?{'constraint':a['constraint']}:{}};}function guardMeta(a){return{'id':a['id'],'object_type':'guard','name':a['name'],'description':a['description'],'scenes':[a['scene_id']],'industries':a['applicable_industries'],'instantiable':!![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}function machineMeta(a){return{'id':a['id'],'object_type':'machine','name':a['name'],'description':a['description'],'scenes':[a['scene_id']],'industries':a['applicable_industries'],'instantiable':!![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}function bodyMeta(a,b,c,d){return{'id':a['id'],'object_type':b,'name':a['name'],'description':a['description'],'scenes':c,'industries':d,'instantiable':!![],'parameters':a['params']['map'](e=>normalizeParam(e))};}function rewardMeta(a){return{'id':a['type'],'object_type':'reward','name':a['name'],'description':a['description'],'scenes':[],'industries':[],'instantiable':![],'parameters':a['parameters']['map'](b=>normalizeParam(b))};}let REGISTRY=null,ID_COLLISIONS=[];function buildRegistry(){const a=new Map(),b=[],c=d=>{if(a['has'](d['meta']['id'])){b['push'](d['meta']['id']);return;}a['set'](d['meta']['id'],d);};for(const d of GUARD_TEMPLATES){c({'meta':guardMeta(d),'raw':d,'notes':d['creation_notes']});}for(const e of MACHINE_TEMPLATES){c({'meta':machineMeta(e),'raw':e,'notes':e['creation_notes']});}for(const f of SERVICE_TEMPLATES){c({'meta':bodyMeta(f,'service',f['applicable_scenes'],f['industry_tags']),'raw':f,'notes':f['notes']});}for(const g of ORDER_TEMPLATES){c({'meta':bodyMeta(g,'order',g['applicable_scenes'],g['industry_tags']),'raw':g,'notes':g['notes']});}for(const h of PROGRESS_TEMPLATES){c({'meta':bodyMeta(h,'progress',h['applicable_scenes'],h['industry_tags']),'raw':h,'notes':h['notes']});}for(const i of ARBITRATION_TEMPLATES){c({'meta':bodyMeta(i,'arbitration',i['applicable_scenes'],i['industry_tags']),'raw':i,'notes':i['notes']});}for(const j of TREASURY_TEMPLATES){c({'meta':bodyMeta(j,'treasury',j['applicable_scenes'],j['industry_tags']),'raw':j,'notes':j['notes']});}for(const k of PERMISSION_TEMPLATES){c({'meta':bodyMeta(k,'permission',k['applicable_scenes'],k['industry_tags']),'raw':k,'notes':k['notes']});}for(const l of PASSPORT_TEMPLATES){c({'meta':bodyMeta(l,'passport',l['applicable_scenarios'],l['industry_tags']),'raw':l,'notes':l['notes']});}for(const m of ALLOCATION_TEMPLATES){c({'meta':bodyMeta(m,'allocation',m['applicable_scenes'],m['industry_tags']),'raw':m,'notes':m['notes']});}for(const n of REWARD_TEMPLATES){c({'meta':rewardMeta(n),'raw':n,'guidance':{'guardCondition':n['guardCondition'],'amountRange':n['amountRange'],'allocationStrategy':n['allocationStrategy'],'example':n['example'],'relevantGuardOps':n['relevantGuardOps']}});}for(const o of CONTACT_TEMPLATES){c({'meta':bodyMeta(o,'contact',o['applicable_scenes'],o['industry_tags']),'raw':o,'notes':o['notes']});}return ID_COLLISIONS=b,a;}function registry(){return!REGISTRY&&(REGISTRY=buildRegistry()),REGISTRY;}export function getTemplateIdCollisions(){return registry(),ID_COLLISIONS;}export function getTemplateCounts(){const a=Object['fromEntries'](TEMPLATE_OBJECT_TYPES['map'](b=>[b,0x0]));for(const b of registry()['values']()){a[b['meta']['object_type']]+=0x1;}return a;}export function listTemplates(a){const b=[...registry()['values']()]['map'](c=>c['meta']);return a?b['filter'](c=>c['object_type']===a):b;}export function getTemplateDetail(a){const b=registry()['get'](a);if(!b)return null;return{...b['meta'],'raw':b['raw'],...b['notes']?{'notes':b['notes']}:{},...b['guidance']?{'guidance':b['guidance']}:{}};}export function findTemplateObjectType(a){return registry()['get'](a)?.['meta']['object_type']??null;}export function instantiateTemplate(a,b){const c=registry()['get'](a);if(!c)return{'ok':![],'object_type':null,'template_id':a,'error':'Template\x20not\x20found:\x20'+a+'.\x20Use\x20get_templates\x20without\x20\x27template\x27\x20to\x20list\x20all\x20template\x20ids.'};const d=c['meta']['object_type'];if(!c['meta']['instantiable'])return{'ok':![],'object_type':d,'template_id':a,'error':'Reward\x20templates\x20are\x20guidance-only\x20(prose\x20guard\x20conditions)\x20and\x20cannot\x20be\x20'+'instantiated\x20into\x20executable\x20JSON.\x20Use\x20the\x20guidance\x20payload\x20to\x20design\x20the\x20'+'Reward\x20+\x20Guard\x20manually.','guidance':c['guidance']};switch(d){case'guard':{const e=fillGuardTemplate(a,b);if(!e['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':e['error'],...e['missing']?{'missing_params':e['missing']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':{'table':e['table'],'root':e['root']},...c['notes']?{'notes':c['notes']}:{}};}case'machine':{const f=a163a(a,b);if(!f['success'])return{'ok':![],'object_type':d,'template_id':a,'error':f['validation_errors']?.['join'](';\x20')??'Machine\x20template\x20fill\x20failed',...f['missing_params']?{'missing_params':f['missing_params']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':{'nodes':f['filled_nodes'],'pairs':f['filled_pairs']},...c['notes']?{'notes':c['notes']}:{}};}case'service':{const g=fillServiceTemplate(a,b);if(!g['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':g['error']??'Service\x20template\x20fill\x20failed',...g['missing_required']?{'missing_params':g['missing_required']}:{}};return{'ok':!![],'object_type':d,'template_id':a,'body':g['body'],...c['notes']?{'notes':c['notes']}:{}};}case'order':case'arbitration':case'treasury':case'permission':case'passport':case'allocation':case'progress':case'contact':{const h=fillBodyTemplate(d,a,b);if(!h['ok'])return{'ok':![],'object_type':d,'template_id':a,'error':h['error']};return{'ok':!![],'object_type':d,'template_id':a,'body':h['body'],...c['notes']?{'notes':c['notes']}:{}};}default:return{'ok':![],'object_type':d,'template_id':a,'error':'Instantiation\x20not\x20supported\x20for\x20object_type\x20\x27'+d+'\x27'};}}function fillBodyTemplate(a,b,c){switch(a){case'order':return a163b(b,c);case'arbitration':return a163c(b,c);case'treasury':return a163d(b,c);case'permission':return a163e(b,c);case'passport':return a163f(b,c);case'allocation':return a163g(b,c);case'progress':return fillProgressTemplate(b,c);case'contact':return a163h(b,c);default:return{'ok':![],'error':'No\x20body-template\x20fill\x20for\x20\x27'+a+'\x27'};}}
@@ -1 +1 @@
1
- export const TOOLS_REFERENCE=[{'name':'onchain_operations','summary':'On-chain\x20object\x20creation,\x20modification,\x20and\x20publish\x20for\x20all\x2016\x20Wowok\x20object\x20types.','actions':['service','machine','guard','permission','reward','arb','progress','treasury','demand','repository','contact','order','allocation','personal','payment','proof','gen_passport','gen_proof'],'common_params':{'operation_type':'Object\x20type\x20to\x20create/modify\x20(string\x20enum).','data':'Operation\x20payload\x20—\x20shape\x20varies\x20by\x20operation_type.','object':'Object\x20name\x20or\x20address\x20(for\x20modify-by-id).','namedNew':'New\x20object\x20spec\x20(name,\x20description,\x20tags)\x20for\x20create.','env':'Execution\x20environment\x20(account,\x20network,\x20gas_budget).'},'prerequisites':['account_operation\x20(for\x20account\x20setup)'],'follow_ups':['query_toolkit\x20(verify\x20result)','local_mark_operation\x20(tag\x20object)'],'notes':['publish=true\x20is\x20irreversible\x20—\x20use\x20confirm_gate.','Service/Machine\x20require\x20publish\x20after\x20create\x20before\x20they\x20are\x20visible\x20on-chain.','Use\x20schema_query\x20with\x20action=\x27list_operations\x27\x20to\x20see\x20all\x20operation\x20schemas.']},{'name':'account_operation','summary':'Local\x20wallet\x20management\x20—\x20generate,\x20suspend,\x20resume,\x20faucet,\x20sign\x20data.','actions':['gen','resume','suspend','faucet','operate','sign','list','info'],'common_params':{'name':'Account\x20name\x20(local\x20identifier).','network':'mainnet\x20|\x20testnet\x20(determines\x20RPC).'},'prerequisites':[],'follow_ups':['onchain_operations\x20(use\x20account\x20for\x20signing)'],'notes':['100%\x20LOCAL\x20—\x20keys\x20never\x20leave\x20the\x20device.','faucet\x20only\x20works\x20on\x20testnet.']},{'name':'local_mark_operation','summary':'Local\x20address\x20book\x20—\x20map\x20human-readable\x20names\x20to\x20blockchain\x20addresses\x20with\x20tags.','actions':['add','remove','update','list','query'],'common_params':{'name':'Local\x20name.','address':'Blockchain\x20address.','tags':'Tag\x20array.'},'notes':['100%\x20LOCAL\x20—\x20never\x20on-chain.','Names\x20are\x20accepted\x20by\x20most\x20on-chain\x20query/panorama\x20tools\x20in\x20place\x20of\x20raw\x20addresses.']},{'name':'local_info_operation','summary':'Local\x20private\x20data\x20management\x20—\x20delivery\x20addresses,\x20phone\x20numbers,\x20contacts.','actions':['add','remove','update','list'],'notes':['100%\x20LOCAL\x20—\x20sensitive\x20data,\x20never\x20on-chain.']},{'name':'wip_file','summary':'Witness\x20Immutable\x20Promise\x20file\x20operations\x20—\x20generate,\x20verify,\x20sign,\x20convert.','actions':['generate','verify','sign','wip2html'],'notes':['WIP\x20hash\x20must\x20be\x20non-empty\x20—\x20compute\x20actual\x20hash\x20before\x20calling.']},{'name':'messenger_operation','summary':'Encrypted\x20messenger\x20—\x20watch/send\x20messages,\x20WTS,\x20friendslist,\x20blacklist,\x20guardlist.','actions':['watch_conversations','send_message','send_file','watch_messages','extract_zip','gen_wts','verify_wts','sign_wts','wts2html','proof_message','manage_blacklist','manage_friendslist','manage_guardlist','settings','mark_viewed','pull_messages'],'notes':['Requires\x20messenger-enabled\x20account.','30s\x20timeout\x20—\x20network\x20operations.']},{'name':'guard2file','summary':'Export\x20a\x20Guard\x20object\x27s\x20definition\x20to\x20local\x20JSON/Markdown\x20for\x20editing.','notes':['Read-only\x20—\x20use\x20query_toolkit\x20for\x20on-chain\x20queries.']},{'name':'machineNode2file','summary':'Export\x20a\x20Machine\x20object\x27s\x20node\x20definition\x20to\x20local\x20JSON/Markdown\x20for\x20editing.','notes':['Read-only\x20—\x20use\x20query_toolkit\x20for\x20on-chain\x20queries.']},{'name':'query_toolkit','summary':'Query\x20toolkit\x20covering\x20local\x20device\x20data,\x20on-chain\x20blockchain\x20data,\x20and\x20one-call\x20business-intelligence\x20panoramas/review\x20packs.','actions':['local_mark_list','account_list','local_info_list','token_list','account_balance','onchain_personal_profile','onchain_objects','onchain_received','onchain_transaction','onchain_object_history','onchain_address_activity','token_value_convert','onchain_last_updated','service_panorama','machine_panorama','object_panorama','review_pack','assemble_context','reverse_map','participation_radar'],'notes':['Read-only\x20—\x20safe\x20to\x20call\x20without\x20confirmation.','BI\x20query\x20types\x20(one-call\x20panoramas):\x20service_panorama\x20(full\x20Service\x20context:\x20workflow\x20graph\x20+\x20guards\x20+\x20trust\x20+\x20supply\x20chain\x20+\x20BusinessReport\x20+\x20recent\x20orders),\x20machine_panorama\x20(head\x20+\x20fields\x20+\x20workflow\x20graph\x20+\x20Progress\x20list),\x20object_panorama\x20(Progress/Demand/Order/Arb/Repository\x20detail\x20pages),\x20review_pack\x20(typed\x20ReviewPack\x20for\x20the\x20client\x27s\x20ReviewPackRenderer),\x20assemble_context\x20(semantic\x20context\x20from\x20on-chain\x20objects),\x20reverse_map\x20(deterministic\x20L4→L1\x20business\x20report\x20—\x20merchant\x20profile\x20/\x20user\x20risk\x20/\x20game\x20theory),\x20participation_radar\x20(in-flight\x20order\x20participation\x20analysis\x20for\x20ONE\x20account).']},{'name':'onchain_table_data','summary':'Dynamic\x20table\x20data\x20queries\x20—\x20paginated\x20table\x20queries\x20and\x20specific\x20table\x20item\x20lookups.','actions':['onchain_table','onchain_table_item_repository_data','onchain_table_item_permission_perm','onchain_table_item_entity_registrar','onchain_table_item_entity_linker','onchain_table_item_entity_contact','onchain_table_item_object_linker_core','onchain_table_item_object_linker_tx','onchain_table_item_reward_record','onchain_table_item_demand_presenter','onchain_table_item_treasury_history','onchain_table_item_machine_node','onchain_table_item_progress_history','onchain_table_item_address_mark','onchain_table_item_entity_order','onchain_orders_of_user','onchain_table_item_generic'],'notes':['Read-only\x20—\x20safe\x20for\x20exploration.','object_linker\x20core\x20(0xaae)\x20=\x20default\x20reverse\x20lookup\x20(bounded\x20core\x20objects);\x20object_linker\x20tx\x20(0xaaf)\x20=\x20operational\x20reverse\x20lookup\x20(orders/progress,\x20lossy\x20FIFO).','entity_order\x20(0xaa8)\x20=\x20global\x20entity->orders\x20reverse\x20index;\x20onchain_orders_of_user\x20resolves\x20each\x20order\x20to\x20its\x20full\x20on-chain\x20Order\x20object\x20with\x20role\x20attributes\x20(is_owner/is_agent).']},{'name':'onchain_events','summary':'Watch\x20on-chain\x20events\x20by\x20type\x20—\x20arbitration,\x20order,\x20progress,\x20demand,\x20entity.','notes':['Read-only\x20—\x20use\x20cursor\x20for\x20pagination.']},{'name':'wowok_buildin_info','summary':'Protocol\x20info\x20—\x20constants,\x20built-in\x20permissions,\x20common\x20mistakes,\x20guard\x20instructions,\x20network,\x20value\x20types,\x20bridge\x20tokens.','actions':['constants','built-in\x20permissions','common\x20mistakes','guard\x20instructions','current\x20network','value\x20types','mainnet\x20bridge\x20tokens'],'notes':['Read-only\x20—\x20authoritative\x20protocol\x20reference.','Use\x20\x27common\x20mistakes\x27\x20before\x20submitting\x20an\x20operation\x20to\x20learn\x20known\x20field-name/unit/workflow\x20pitfalls.']},{'name':'schema_query','summary':'Look\x20up\x20JSON\x20Schemas\x20for\x20MCP\x20tools\x20and\x20on-chain\x20operations\x20—\x20the\x20authoritative\x20reference.\x20Also\x20serves\x20sunk\x20knowledge:\x20tool\x20reference,\x20Guard\x20design\x20patterns,\x20safety\x20rules.','actions':['list','get','get_output','get_field','search','list_operations','get_guard_templates','get_tool_reference','get_guard_design_patterns','get_safety_rules'],'notes':['Always\x20check\x20schema\x20before\x20calling\x20an\x20unfamiliar\x20tool.','get_field\x20takes\x20a\x20dot-path\x20(field_path)\x20for\x20single-field\x20lookup.','get_tool_reference/get_guard_design_patterns/get_safety_rules\x20expose\x20the\x20knowledge\x20sunk\x20from\x20the\x20wowok-tools/guard/safety\x20skills\x20—\x20no\x20skills\x20installation\x20required.']},{'name':'bridge_operation','summary':'Cross-chain\x20bridge\x20between\x20WOW\x20and\x20EVM\x20(Ethereum\x20mainnet).\x20Mainnet\x20only.','actions':['cross_chain_wow_to_evm','cross_chain_evm_to_wow','withdraw','query_active_evm_account','query_supported_evm_chains','query_supported_tokens','query_transfer_list','query_transfer_status','manage_evm_rpc'],'notes':['Only\x20WOW\x20mainnet\x20provides\x20cross-chain\x20functionality.']},{'name':'config_operation','summary':'Runtime\x20service\x20toggles\x20—\x20enable/disable\x20Phase\x202\x20services\x20without\x20restart.','actions':['list','toggle','enable','disable','reset','info'],'notes':['GLM5:\x20harness\x20is\x20default\x20ON\x20with\x20tiered\x20enforcement\x20(off/lightweight/full).']},{'name':'trust_score','summary':'Service\x20trust\x20&\x20risk\x20assessment\x20—\x205\x20trust\x20dimensions\x20+\x204\x20risk\x20dimensions.','notes':['Use\x20when\x20user\x20asks\x20\x27is\x20this\x20service\x20trustworthy?\x27\x20or\x20\x27should\x20I\x20buy?\x27.']},{'name':'evaluation_operation','summary':'Pluggable\x20business\x20evaluations\x20—\x20risk\x20/\x20match\x20/\x20compose\x20/\x20game\x20(node\x20+\x20path)\x20/\x20evidence\x20review\x20/\x20discovery\x20/\x20market\x20/\x20arbitration\x20score\x20with\x20user\x20injection.','actions':['service_risk','demand_match','service_match','capability_gap','compose_service','node_game','arb_game','path_reasoning','evidence_review','discover_services','discover_demands','market_metrics','market_operations','anti_cheat','match_discover','arbitration_score','account_events'],'notes':['Read-only;\x20the\x20role\x20decides\x20and\x20acts\x20via\x20onchain_operations.','path_reasoning\x20=\x20path-level\x20game\x20(full-route\x20enumeration\x20+\x20ranking);\x20node_game\x20=\x20single-node\x20best\x20move.','evidence_review\x20=\x20deterministic\x20off-chain\x20evidence\x20closure\x20gate\x20(auto_pass/auto_reject/manual_review).','discover_services\x20=\x20active\x20supply\x20discovery\x20(GraphQL\x20transport\x20required):\x20enumerate\x20all\x20shared\x20Services,\x20location-gate\x20by\x20sensitivity\x20(strict/near/logistics),\x20ranked\x20+\x20consent-gated\x20scope\x20expansion.\x20Passive\x20side\x20=\x20post\x20a\x20Demand\x20(DemandPresenter).','match_discover\x20=\x20one-shot\x20intent→service\x20orchestration\x20(enumerate\x20+\x20location\x20gate\x20+\x206-dimension\x20scoring);\x20discover_demands\x20=\x20supplier-side\x20demand\x20enumeration;\x20market_metrics/market_operations\x20=\x20market\x20measurement\x20(GraphQL\x20required).','arbitration_score\x20=\x20dual-perspective\x20arbitration\x20trust\x20(user-trust\x20+\x20merchant-fairness,\x20combined\x200-100);\x20anti_cheat\x20=\x20fake-review/wash-order\x20detection;\x20account_events\x20=\x20account\x20attention\x20feed\x20(read-only).']},{'name':'watch_operation','summary':'Identity-centric\x20on-chain\x20console\x20—\x20resolve\x20who\x20the\x20account\x20is\x20against\x20an\x20object,\x20expand\x20its\x20relations,\x20and\x20enumerate\x20actionable\x20operations.','actions':['focus','expand','actions'],'notes':['Read-only;\x20distinct\x20from\x20query_toolkit\x20/\x20onchain_table_data\x20(pure\x20data,\x20no\x20identity).','focus\x20=\x20identity\x20resolution\x20(manifest\x20on-chain\x20role\x20⊕\x20persona)\x20+\x20base\x20data;\x20neutral\x20→\x20objective\x20narration,\x20operative\x20role\x20→\x20game\x20reasoning.','expand\x20=\x20direct\x20relations\x20+\x20Service\x20transparent\x20sub-order\x20purchasing\x20graph\x20(frozen\x20forward\x20guards\x20→\x20purchased\x20sub-services\x20+\x20proofs).','actions\x20=\x20actionable\x20operations\x20with\x20executability\x20judgment\x20(order-holder\x20/\x20permission-index\x20/\x20named-operator\x20paths).']},{'name':'persona_operation','summary':'User\x20identity\x20setting\x20(persona)\x20—\x20preferences,\x20strategy,\x20rules,\x20spec;\x20long-term\x20+\x20current\x20layers\x20+\x20strategy→lever\x20mapping\x20+\x20region\x20hint.','actions':['get','list','set','analyze','apply','sync','remove','strategy','region_hint','distill'],'notes':['Read/write\x20local\x20state;\x20account\x20persona\x20overrides\x20system;\x20current\x20overrides\x20long-term.','strategy\x20resolves\x20merchant\x20strategy\x20statements\x20into\x20deterministic\x20infrastructure\x20levers\x20(discount/reward/buy_guard/machine_design).','region_hint\x20reads\x20the\x20local\x20delivery\x20address\x20as\x20a\x20matching\x20hint;\x20`propose`\x20returns\x20a\x20consent-gated\x20save\x20proposal\x20(never\x20auto-writes).','distill\x20turns\x20one\x20goal\x27s\x20memory\x20(outcome,\x20process\x20problems/feedback,\x20objects)\x20into\x20a\x20CURRENT-layer\x20proposal\x20—\x20never\x20auto-writes;\x20persist\x20via\x20set/apply\x20after\x20user\x20confirmation.\x20Industry\x20pack.json\x20files\x20are\x20read-only\x20knowledge\x20and\x20never\x20receive\x20user\x20data.']},{'name':'employee_operation','summary':'Merchant\x20employee\x20organizational\x20profile\x20(LOCAL)\x20+\x20reaction\x20KPI\x20+\x20liability\x20resolution\x20+\x20incentive\x20suggestion.','actions':['set','get','remove','assess_kpi','resolve_liability','suggest_incentive'],'notes':['LOCAL\x20ONLY\x20—\x20on-chain\x20authorization\x20lives\x20in\x20the\x20merchant\x27s\x20Permission\x20(namedOperator/entity).','assess_kpi:\x20node\x20reaction\x20speed\x20vs\x20budget\x20(explicit\x20>\x20stored\x20profile\x20>\x2048h\x20default).\x20Timestamps\x20explicit\x20OR\x20auto-derived\x20from\x20the\x20progress\x20object\x27s\x20monitored\x20ProgressEvents\x20via\x20`progress`;\x20explicit\x20values\x20override\x20derived.','resolve_liability:\x20internal\x20cost\x20split\x20(merchant/employee,\x20hybrid\x20threshold);\x20outward\x20liability\x20toward\x20the\x20customer\x20is\x20ALWAYS\x20the\x20merchant\x27s;\x20order\x20user\x20must\x20be\x20compensated\x20before\x20the\x20workflow\x20resumes.','suggest_incentive:\x20KPIs\x20+\x20WIP\x20acceptance\x20+\x20liability\x20→\x20Reward\x20suggestion\x20(reward_grant/compensation_offset/correction_notice/none).\x20Suggestion\x20ONLY\x20—\x20merchant\x20confirms\x20and\x20executes\x20the\x20on-chain\x20ops\x20separately.']},{'name':'keeper_operation','summary':'Who-benefits-who-pushes\x20keeper:\x20scans\x20the\x20monitor\x20scope\x20for\x20actionable\x20state\x20(unclaimed\x20payments,\x20advanceable\x20workflow\x20nodes),\x20routes\x20tasks\x20to\x20beneficiaries;\x20manual\x20dismiss/execute\x20+\x20standing\x20auto-execute\x20rules.','actions':['tasks','dismiss','execute','rules','rule_set','rule_remove','config','config_set','scan','status'],'notes':['The\x20chain\x20has\x20NO\x20time-triggered\x20execution\x20—\x20the\x20keeper\x20scans\x20on\x20the\x20monitor\x20loop\x20cadence\x20and\x20surfaces\x20tasks\x20to\x20their\x20beneficiary.','execute\x20runs\x20the\x20on-chain\x20op\x20for\x20one\x20task\x20(user\x20decision);\x20rule_set\x20authorizes\x20auto-execution\x20per\x20detector\x20kind\x20(bounded\x20by\x20config\x20budget/cooldown).','Detectors\x20v1:\x20payment_unclaimed\x20(funds\x20sitting\x20claimable),\x20progress_actionable\x20(a\x20workflow\x20node\x20the\x20beneficiary\x20can\x20advance).']},{'name':'intent_radar','summary':'User\x20business\x20intent\x20×\x20chain\x20event\x20matching\x20—\x20persist\x20intents,\x20score\x20events\x20against\x20them.','actions':['save','list','remove','match'],'notes':['Read-only\x20w.r.t.\x20chain;\x20industry/keywords\x20resolved\x20once\x20at\x20save;\x20events\x20supplied\x20or\x20auto-pulled.']},{'name':'goal_operation','summary':'GoalEngine\x20(K3\x2024)\x20—\x20record\x20a\x20user\x20goal\x20and\x20drive\x20it\x20through\x20the\x20nine-station\x20lifecycle\x20(RECOGNIZE→…→COMPLETE)\x20with\x20monitor\x20auto-binding\x20and\x20plan-approval\x20confirm-gate\x20downgrade;\x20also\x20hosts\x20the\x20C1-C4\x20planning\x20pipeline\x20+\x20merchant\x20onboarding\x20wizard.','actions':['create','list','get','approve','advance','pause','complete','abandon','delete','analyze_intent','aggregate_risks','trace_substeps','merchant_guide'],'common_params':{'id':'Goal\x20id\x20(goal_…)\x20—\x20required\x20for\x20get/approve/advance/pause/complete/abandon/delete.','intent_text':'create:\x20raw\x20user\x20intent;\x20goal_type\x20auto-classified\x20(override\x20with\x20goal_type).','account':'create:\x20bind\x20a\x20local\x20account\x20(preflight;\x20goal\x20starts\x20at\x20\x27bound\x27).','stage':'advance:\x20forward-only\x20target\x20stage;\x20\x27paused\x27\x20holds\x20from\x20anywhere.','objects':'advance:\x20ACT-station\x20objects\x20[{type,\x20object}]\x20(deduped).','force':'complete:\x20skip\x20on-chain\x20completion\x20verification\x20(audited\x20as\x20outcome.forced).'},'follow_ups':['monitor_events\x20(goal\x20progress\x20surfaces\x20in\x20the\x20todo\x20stream)','onchain_operations\x20(execute\x20plan\x20steps\x20with\x20env.plan_approval)'],'notes':['Near-duplicate\x20create\x20ADOPTS\x20the\x20active\x20same-type\x20same-account\x20goal\x20(intent\x20Jaccard\x20≥\x200.6)\x20instead\x20of\x20forking.','approve\x20registers\x20a\x20plan\x20approval:\x20calls\x20carrying\x20env.plan_approval=<goal\x20id>\x20auto-pass\x20fail-open\x20ConfirmGate\x20levels\x20(standard/none);\x20fail-closed\x20levels\x20(irreversible/publish/amount)\x20always\x20still\x20ask.','Entering\x20\x27monitoring\x27\x20auto-binds\x20monitor\x20focus\x20(reason=\x27goal\x27,\x20goal_id-stamped)\x20for\x20the\x20goal\x27s\x20objects;\x20demand\x20goals\x20also\x20open\x20a\x20radar\x20intent.\x20complete/abandon\x20tear\x20down\x20ONLY\x20this\x20goal\x27s\x20bindings.','complete\x20verifies\x20the\x20goal-type\x20completion\x20conjunction\x20against\x20chain\x20state\x20(read-only);\x20force=true\x20bypasses\x20and\x20is\x20audited.','delete\x20removes\x20a\x20terminal\x20goal\x20entirely\x20(record\x20+\x20TaskProcess\x20dir);\x20force=true\x20extends\x20it\x20to\x20non-terminal\x20goals\x20(monitor\x20teardown\x20first).','C1-C4\x20planning\x20pipeline\x20(GLM5-31\x20§V3/V4):\x20analyze_intent\x20(intent\x20→\x20objects\x20+\x20puzzle\x20snapshots)\x20→\x20aggregate_risks\x20(puzzles\x20OR\x20intent\x20→\x20calibrated\x20risks\x20+\x20RISK_BLOCKED\x20status)\x20→\x20trace_substeps\x20(substep\x20records\x20→\x20DAG\x20coherence\x20+\x20D-10\x20verdict);\x20merchant_guide\x20=\x2010-step\x20onboarding\x20wizard\x20(stateless\x20guide_state,\x20never\x20executes\x20on-chain\x20—\x20materialize\x20via\x20onchain_operations).\x20All\x20four\x20are\x20pure\x20transformations.']},{'name':'monitor_events','summary':'Persistent\x20monitor\x20event\x20store\x20(shared\x20with\x20the\x20client\x20Monitor\x20page)\x20—\x20paginated\x20events\x20with\x20read\x20flags;\x20mark\x20read/unread.','actions':['query','mark_read','mark_all_read'],'notes':['Events\x20captured\x20by\x20the\x20resident\x20MonitorLoop\x20(client\x20sidecar,\x20or\x20stdio\x20MCP\x20server\x20with\x20MONITOR_LOOP=1)\x20across\x209\x20modules,\x20stored\x20APPEND-ONLY\x20in\x20SQLite\x20(survives\x20restarts)\x20with\x20per-event\x20read\x20flags.','query\x20=\x20paginated\x20newest-first\x20with\x20module/event_type/since/until\x20filters\x20+\x20module_counts/unread_by_module/total_unread;\x20relevant_only\x20(default\x20true)\x20restricts\x20to\x20scope-closure/focus/filter\x20hits\x20(de-noised\x20todo\x20stream);\x20with_reason\x20attaches\x20the\x20relevance\x20annotation\x20+\x20delivered\x20flag;\x20mark_read\x20=\x20idempotent\x20per-event\x20(\x27<eventSeq>:<txDigest>\x27);\x20mark_all_read\x20=\x20optionally\x20module-scoped.','Cross-process:\x20read\x20state\x20is\x20SHARED\x20with\x20the\x20client\x20app\x20(same\x20SQLite\x20store)\x20—\x20marking\x20read\x20here\x20clears\x20the\x20client\x20Monitor\x20unread\x20badge\x20and\x20vice\x20versa.']},{'name':'monitor_subscription','summary':'Monitor\x20subscription\x20config\x20—\x20scope-closure\x20rules,\x20focus\x20objects,\x20per-type\x20todo\x20switches,\x20conditional\x20filters;\x20scope\x20preview\x20+\x20filter\x20dry-run.','actions':['get','save','reset','scope_preview','test_filter'],'notes':['Single\x20configuration\x20entry\x20point\x20for\x20monitor\x20v4\x20(client\x20settings\x20panel\x20and\x20agents\x20share\x20it);\x20save/reset\x20merge\x20+\x20clamp\x20loop\x20params,\x20then\x20trigger\x20an\x20immediate\x20scope\x20re-resolve\x20and\x20schedule\x20a\x20backfill\x20when\x20the\x20closure\x20changed.','scope_preview\x20lists\x20the\x20resolved\x20closure\x20grouped\x20by\x20layer\x20(accounts/permissions/managed_objects/services/orders/order_children/focus)\x20with\x20pagination\x20—\x20inspect\x20before\x20tuning\x20rule\x20switches.','test_filter\x20dry-runs\x20a\x20filter\x20draft\x20over\x20the\x20most\x20recent\x20captured\x20events\x20(default\x20200,\x20max\x201000)\x20returning\x20matched/scanned\x20counts\x20+\x20up\x20to\x205\x20samples\x20—\x20preview\x20noise\x20BEFORE\x20saving.','Capture\x20is\x20unaffected\x20by\x20delivery\x20switches\x20EXCEPT\x20NewPaymentEvent\x20(captured\x20only\x20when\x20switched\x20ON).']},{'name':'industry_pack_operation','summary':'Industry\x20knowledge\x20pack\x20lifecycle\x20—\x20scaffold\x20(merged\x20v2\x20template),\x20scan/register,\x20layer\x20get,\x20diff,\x20reset-to-template,\x20plus\x20industry-dir\x20file\x20operations\x20and\x20the\x20industry\x20mode\x20registry\x20(GLM6/92\x20§E).','actions':['scaffold','list','scan','resolve','list_files','read_file','write_file','get','diff','reset','delete_file','create_file','create_dir','copy','move','rename','recommend_industry','list_modes','derive_user_mode','evolve_user_mode','register_user_mode','unregister_user_mode','register_custom_metric','register_custom_constraint','list_metrics_constraints'],'notes':['LOCAL\x20ONLY\x20—\x20filesystem\x20+\x20in-memory\x20registry;\x20never\x20mutates\x20chain\x20state.','Merged\x20v2\x20layout:\x20pack.json\x20(annotated\x20with\x20_schema/_doc\x20comment\x20fields\x20+\x20personae)\x20+\x20playbook.md;\x20legacy\x20split-file\x20layouts\x20still\x20read\x20for\x20backward\x20compatibility.','reset\x20restores\x20a\x20file\x20or\x20entire\x20pack\x20folder\x20to\x20its\x20pristine\x20annotated\x20template\x20—\x20user\x20edits\x20beyond\x20the\x20target\x20are\x20preserved.','Mode\x20registry\x20(GLM6/92\x20§E):\x20recommend_industry\x20(top-3\x20similar\x20industries\x20+\x20verified\x20reference\x20examples),\x20list_modes,\x20derive_user_mode\x20(customize\x20a\x20builtin),\x20evolve_user_mode,\x20register_user_mode\x20(fully\x20custom;\x20R-M1-11\x20enforced\x20on\x20machine_shape),\x20unregister_user_mode,\x20register_custom_metric\x20/\x20register_custom_constraint\x20(extend\x20evaluation\x20registries),\x20list_metrics_constraints.']},{'name':'workspace_operation','summary':'Local\x20workspace\x20directory\x20(`.wowok/workspace`)\x20—\x20generated\x20review\x20files\x20(machine/guard/wts/wip\x20JSON)\x20and\x20user\x20documents:\x20list/read/write\x20+\x20file\x20operations.','actions':['resolve','list','read','write','delete','create_file','create_dir','copy','move','rename'],'notes':['LOCAL\x20ONLY\x20—\x20filesystem\x20operations\x20confined\x20to\x20the\x20workspace\x20root;\x20never\x20mutates\x20chain\x20state.','read\x20is\x20the\x20supported\x20way\x20to\x20load\x20a\x20generated\x20JSON\x20as\x20AI\x20context\x20before\x20editing/submitting.']},{'name':'workflow_operation','summary':'Local-account\x20workflow\x20view\x20—\x20list\x20active\x20Progress\x20that\x20at\x20least\x20one\x20local\x20account\x20can\x20advance\x20(permission\x20+\x20guard\x20+\x20executable\x20accounts),\x20advance/hold/unhold\x20a\x20forward,\x20and\x20view\x20a\x20progress\x27s\x20on-chain\x20operation\x20history.','actions':['list','operate','history'],'notes':['list:\x20permission-aware\x20—\x20a\x20forward\x20is\x20executable\x20when\x20(a)\x20namedOperator=\x27\x27\x20and\x20account\x20is\x20order\x20holder,\x20(b)\x20namedOperator=name\x20and\x20account\x20is\x20in\x20progress.namedOperator[name],\x20or\x20(c)\x20permissionIndex\x20set\x20and\x20account\x20is\x20in\x20permission.admin/table.','operate:\x20delegates\x20to\x20the\x20on-chain\x20progress\x20operation\x20(guard-aware);\x20op\x20∈\x20next/hold/unhold/adminUnhold.','history:\x20incrementally\x20syncs\x20a\x20progress\x27s\x20ON-CHAIN\x20Progress.history\x20(append-only\x20u64\x20index)\x20into\x20the\x20local\x20SQLite\x20mirror\x20via\x20a\x20per-progress\x20cursor\x20(only\x20new\x20records\x20pulled),\x20returns\x20the\x20migration\x20timeline\x20newest-first\x20with\x20each\x20migration\x27s\x20session\x20snapshot\x20(forwards\x20/\x20operator\x20/\x20weight\x20/\x20time);\x20runs\x2090-day\x20retention\x20cleanup\x20by\x20default.']},{'name':'permission_operation','summary':'Local-account\x20Permission\x20overview\x20—\x20list\x20Permissions\x20related\x20to\x20local\x20accounts\x20(via\x20entity_permission\x20index)\x20with\x20owner/admin/entity\x20breakdown\x20+\x20related\x20objects\x20via\x20object-linker\x20indexes.','actions':['list'],'notes':['Read-only;\x20reverse-looks-up\x20local\x20accounts\x20via\x20entity_permission\x20@0xaad,\x20then\x20merges/dedups\x20permissions.','Related\x20objects\x20resolved\x20via\x20object-linker\x20reverse\x20indexes\x20(0xaae\x20core\x20/\x200xaaf\x20tx)\x20binding\x20edges,\x20grouped\x20by\x20type\x20via\x20first-byte\x20address\x20tag.','Latest\x20update\x20time\x20derived\x20from\x20the\x20Permission\x27s\x20previousTransaction.']}];export function getToolReference(a){return TOOLS_REFERENCE['find'](b=>b['name']===a);}export function searchToolReference(a){const b=a['toLowerCase']();return TOOLS_REFERENCE['filter'](c=>{if(c['name']['toLowerCase']()['includes'](b))return!![];if(c['summary']['toLowerCase']()['includes'](b))return!![];if(c['actions']?.['some'](d=>d['toLowerCase']()['includes'](b)))return!![];return![];});}export function getToolSequence(a){const b=getToolReference(a);if(!b)return undefined;return{'prerequisites':b['prerequisites']??[],'tool':b['name'],'follow_ups':b['follow_ups']??[]};}
1
+ export const TOOLS_REFERENCE=[{'name':'onchain_operations','summary':'On-chain\x20object\x20creation,\x20modification,\x20and\x20publish\x20for\x20all\x2016\x20Wowok\x20object\x20types.','actions':['service','machine','guard','permission','reward','arb','progress','treasury','demand','repository','contact','order','allocation','personal','payment','proof','gen_passport','gen_proof'],'common_params':{'operation_type':'Object\x20type\x20to\x20create/modify\x20(string\x20enum).','data':'Operation\x20payload\x20—\x20shape\x20varies\x20by\x20operation_type.','object':'Object\x20name\x20or\x20address\x20(for\x20modify-by-id).','namedNew':'New\x20object\x20spec\x20(name,\x20description,\x20tags)\x20for\x20create.','env':'Execution\x20environment\x20(account,\x20network,\x20gas_budget).'},'prerequisites':['account_operation\x20(for\x20account\x20setup)'],'follow_ups':['query_toolkit\x20(verify\x20result)','local_mark_operation\x20(tag\x20object)'],'notes':['publish=true\x20is\x20irreversible\x20—\x20use\x20confirm_gate.','Service/Machine\x20require\x20publish\x20after\x20create\x20before\x20they\x20are\x20visible\x20on-chain.','Use\x20schema_query\x20with\x20action=\x27list_operations\x27\x20to\x20see\x20all\x20operation\x20schemas.']},{'name':'account_operation','summary':'Local\x20wallet\x20management\x20—\x20generate,\x20suspend,\x20resume,\x20faucet,\x20sign\x20data.','actions':['gen','resume','suspend','faucet','operate','sign','list','info'],'common_params':{'name':'Account\x20name\x20(local\x20identifier).','network':'mainnet\x20|\x20testnet\x20(determines\x20RPC).'},'prerequisites':[],'follow_ups':['onchain_operations\x20(use\x20account\x20for\x20signing)'],'notes':['100%\x20LOCAL\x20—\x20keys\x20never\x20leave\x20the\x20device.','faucet\x20only\x20works\x20on\x20testnet.']},{'name':'local_mark_operation','summary':'Local\x20address\x20book\x20—\x20map\x20human-readable\x20names\x20to\x20blockchain\x20addresses\x20with\x20tags.','actions':['add','remove','update','list','query'],'common_params':{'name':'Local\x20name.','address':'Blockchain\x20address.','tags':'Tag\x20array.'},'notes':['100%\x20LOCAL\x20—\x20never\x20on-chain.','Names\x20are\x20accepted\x20by\x20most\x20on-chain\x20query/panorama\x20tools\x20in\x20place\x20of\x20raw\x20addresses.']},{'name':'local_info_operation','summary':'Local\x20private\x20data\x20management\x20—\x20delivery\x20addresses,\x20phone\x20numbers,\x20contacts.','actions':['add','remove','update','list'],'notes':['100%\x20LOCAL\x20—\x20sensitive\x20data,\x20never\x20on-chain.']},{'name':'local_history_operation','summary':'Local\x20Explorer\x20visit\x20history\x20—\x20recently\x20viewed\x20objects,\x20newest\x20first.','actions':['list\x20(default)','add\x20(upsert\x20by\x20key)','remove\x20(by\x20keys)','clear'],'common_params':{'add':'Record\x20visits:\x20{op:\x27add\x27,\x20data:[{key,\x20address,\x20object_type?,\x20network,\x20time}]}.','remove':'Delete\x20entries:\x20{op:\x27remove\x27,\x20keys:[...]}.','clear':'Erase\x20all\x20history:\x20{op:\x27clear\x27}.'},'notes':['100%\x20LOCAL\x20—\x20visit\x20records\x20never\x20leave\x20the\x20device;\x20display\x20names\x20are\x20never\x20stored\x20(resolved\x20live\x20at\x20render).','Omit\x20every\x20operation\x20field\x20to\x20list\x20history\x20(newest\x20first,\x20auto-pruned\x20to\x20last\x2030\x20days\x20/\x20300\x20entries).','detail\x20visits\x20keep\x20the\x20object\x20type\x20tag;\x20each\x20entry\x20stores\x20the\x20stable\x20object\x20key\x20+\x20canonical\x200x\x20address\x20+\x20network\x20+\x20timestamp.']},{'name':'wip_file','summary':'Witness\x20Immutable\x20Promise\x20file\x20operations\x20—\x20generate,\x20verify,\x20sign,\x20convert.','actions':['generate','verify','sign','wip2html'],'notes':['WIP\x20hash\x20must\x20be\x20non-empty\x20—\x20compute\x20actual\x20hash\x20before\x20calling.']},{'name':'messenger_operation','summary':'Encrypted\x20messenger\x20—\x20watch/send\x20messages,\x20WTS,\x20friendslist,\x20blacklist,\x20guardlist.','actions':['watch_conversations','send_message','send_file','watch_messages','extract_zip','gen_wts','verify_wts','sign_wts','wts2html','proof_message','manage_blacklist','manage_friendslist','manage_guardlist','settings','mark_viewed','pull_messages'],'notes':['Requires\x20messenger-enabled\x20account.','30s\x20timeout\x20—\x20network\x20operations.']},{'name':'guard2file','summary':'Export\x20a\x20Guard\x20object\x27s\x20definition\x20to\x20local\x20JSON/Markdown\x20for\x20editing.','notes':['Read-only\x20—\x20use\x20query_toolkit\x20for\x20on-chain\x20queries.']},{'name':'machineNode2file','summary':'Export\x20a\x20Machine\x20object\x27s\x20node\x20definition\x20to\x20local\x20JSON/Markdown\x20for\x20editing.','notes':['Read-only\x20—\x20use\x20query_toolkit\x20for\x20on-chain\x20queries.']},{'name':'query_toolkit','summary':'Query\x20toolkit\x20covering\x20local\x20device\x20data,\x20on-chain\x20blockchain\x20data,\x20and\x20one-call\x20business-intelligence\x20panoramas/review\x20packs.','actions':['local_mark_list','account_list','local_info_list','token_list','account_balance','onchain_personal_profile','onchain_objects','onchain_received','onchain_transaction','onchain_object_history','onchain_address_activity','token_value_convert','onchain_last_updated','service_panorama','machine_panorama','object_panorama','review_pack','assemble_context','reverse_map','participation_radar'],'notes':['Read-only\x20—\x20safe\x20to\x20call\x20without\x20confirmation.','BI\x20query\x20types\x20(one-call\x20panoramas):\x20service_panorama\x20(full\x20Service\x20context:\x20workflow\x20graph\x20+\x20guards\x20+\x20trust\x20+\x20supply\x20chain\x20+\x20BusinessReport\x20+\x20recent\x20orders),\x20machine_panorama\x20(head\x20+\x20fields\x20+\x20workflow\x20graph\x20+\x20Progress\x20list),\x20object_panorama\x20(Progress/Demand/Order/Arb/Repository\x20detail\x20pages),\x20review_pack\x20(typed\x20ReviewPack\x20for\x20the\x20client\x27s\x20ReviewPackRenderer),\x20assemble_context\x20(semantic\x20context\x20from\x20on-chain\x20objects),\x20reverse_map\x20(deterministic\x20L4→L1\x20business\x20report\x20—\x20merchant\x20profile\x20/\x20user\x20risk\x20/\x20game\x20theory),\x20participation_radar\x20(in-flight\x20order\x20participation\x20analysis\x20for\x20ONE\x20account).']},{'name':'onchain_table_data','summary':'Dynamic\x20table\x20data\x20queries\x20—\x20paginated\x20table\x20queries\x20and\x20specific\x20table\x20item\x20lookups.','actions':['onchain_table','onchain_table_item_repository_data','onchain_table_item_permission_perm','onchain_table_item_entity_registrar','onchain_table_item_entity_linker','onchain_table_item_entity_contact','onchain_table_item_object_linker_core','onchain_table_item_object_linker_tx','onchain_table_item_reward_record','onchain_table_item_demand_presenter','onchain_table_item_treasury_history','onchain_table_item_machine_node','onchain_table_item_progress_history','onchain_table_item_address_mark','onchain_table_item_entity_order','onchain_orders_of_user','onchain_table_item_generic'],'notes':['Read-only\x20—\x20safe\x20for\x20exploration.','object_linker\x20core\x20(0xaae)\x20=\x20default\x20reverse\x20lookup\x20(bounded\x20core\x20objects);\x20object_linker\x20tx\x20(0xaaf)\x20=\x20operational\x20reverse\x20lookup\x20(orders/progress,\x20lossy\x20FIFO).','entity_order\x20(0xaa8)\x20=\x20global\x20entity->orders\x20reverse\x20index;\x20onchain_orders_of_user\x20resolves\x20each\x20order\x20to\x20its\x20full\x20on-chain\x20Order\x20object\x20with\x20role\x20attributes\x20(is_owner/is_agent).']},{'name':'onchain_events','summary':'Watch\x20on-chain\x20events\x20by\x20type\x20—\x20arbitration,\x20order,\x20progress,\x20demand,\x20entity.','notes':['Read-only\x20—\x20use\x20cursor\x20for\x20pagination.']},{'name':'wowok_buildin_info','summary':'Protocol\x20info\x20—\x20constants,\x20built-in\x20permissions,\x20common\x20mistakes,\x20guard\x20instructions,\x20network,\x20value\x20types,\x20bridge\x20tokens.','actions':['constants','built-in\x20permissions','common\x20mistakes','guard\x20instructions','current\x20network','value\x20types','mainnet\x20bridge\x20tokens'],'notes':['Read-only\x20—\x20authoritative\x20protocol\x20reference.','Use\x20\x27common\x20mistakes\x27\x20before\x20submitting\x20an\x20operation\x20to\x20learn\x20known\x20field-name/unit/workflow\x20pitfalls.']},{'name':'schema_query','summary':'Look\x20up\x20JSON\x20Schemas\x20for\x20MCP\x20tools\x20and\x20on-chain\x20operations\x20—\x20the\x20authoritative\x20reference.\x20Also\x20serves\x20sunk\x20knowledge:\x20tool\x20reference,\x20Guard\x20design\x20patterns,\x20safety\x20rules.','actions':['list','get','get_output','get_field','search','list_operations','get_guard_templates','get_tool_reference','get_guard_design_patterns','get_safety_rules'],'notes':['Always\x20check\x20schema\x20before\x20calling\x20an\x20unfamiliar\x20tool.','get_field\x20takes\x20a\x20dot-path\x20(field_path)\x20for\x20single-field\x20lookup.','get_tool_reference/get_guard_design_patterns/get_safety_rules\x20expose\x20the\x20knowledge\x20sunk\x20from\x20the\x20wowok-tools/guard/safety\x20skills\x20—\x20no\x20skills\x20installation\x20required.']},{'name':'bridge_operation','summary':'Cross-chain\x20bridge\x20between\x20WOW\x20and\x20EVM\x20(Ethereum\x20mainnet).\x20Mainnet\x20only.','actions':['cross_chain_wow_to_evm','cross_chain_evm_to_wow','withdraw','query_active_evm_account','query_supported_evm_chains','query_supported_tokens','query_transfer_list','query_transfer_status','manage_evm_rpc'],'notes':['Only\x20WOW\x20mainnet\x20provides\x20cross-chain\x20functionality.']},{'name':'config_operation','summary':'Runtime\x20service\x20toggles\x20—\x20enable/disable\x20Phase\x202\x20services\x20without\x20restart.','actions':['list','toggle','enable','disable','reset','info'],'notes':['GLM5:\x20harness\x20is\x20default\x20ON\x20with\x20tiered\x20enforcement\x20(off/lightweight/full).']},{'name':'trust_score','summary':'Service\x20trust\x20&\x20risk\x20assessment\x20—\x205\x20trust\x20dimensions\x20+\x204\x20risk\x20dimensions.','notes':['Use\x20when\x20user\x20asks\x20\x27is\x20this\x20service\x20trustworthy?\x27\x20or\x20\x27should\x20I\x20buy?\x27.']},{'name':'evaluation_operation','summary':'Pluggable\x20business\x20evaluations\x20—\x20risk\x20/\x20match\x20/\x20compose\x20/\x20game\x20(node\x20+\x20path)\x20/\x20evidence\x20review\x20/\x20discovery\x20/\x20market\x20/\x20arbitration\x20score\x20with\x20user\x20injection.','actions':['service_risk','demand_match','service_match','capability_gap','compose_service','node_game','arb_game','path_reasoning','evidence_review','discover_services','discover_demands','market_metrics','market_operations','anti_cheat','match_discover','arbitration_score','account_events'],'notes':['Read-only;\x20the\x20role\x20decides\x20and\x20acts\x20via\x20onchain_operations.','path_reasoning\x20=\x20path-level\x20game\x20(full-route\x20enumeration\x20+\x20ranking);\x20node_game\x20=\x20single-node\x20best\x20move.','evidence_review\x20=\x20deterministic\x20off-chain\x20evidence\x20closure\x20gate\x20(auto_pass/auto_reject/manual_review).','discover_services\x20=\x20active\x20supply\x20discovery\x20(GraphQL\x20transport\x20required):\x20enumerate\x20all\x20shared\x20Services,\x20location-gate\x20by\x20sensitivity\x20(strict/near/logistics),\x20ranked\x20+\x20consent-gated\x20scope\x20expansion.\x20Passive\x20side\x20=\x20post\x20a\x20Demand\x20(DemandPresenter).','match_discover\x20=\x20one-shot\x20intent→service\x20orchestration\x20(enumerate\x20+\x20location\x20gate\x20+\x206-dimension\x20scoring);\x20discover_demands\x20=\x20supplier-side\x20demand\x20enumeration;\x20market_metrics/market_operations\x20=\x20market\x20measurement\x20(GraphQL\x20required).','arbitration_score\x20=\x20dual-perspective\x20arbitration\x20trust\x20(user-trust\x20+\x20merchant-fairness,\x20combined\x200-100);\x20anti_cheat\x20=\x20fake-review/wash-order\x20detection;\x20account_events\x20=\x20account\x20attention\x20feed\x20(read-only).']},{'name':'watch_operation','summary':'Identity-centric\x20on-chain\x20console\x20—\x20resolve\x20who\x20the\x20account\x20is\x20against\x20an\x20object,\x20expand\x20its\x20relations,\x20and\x20enumerate\x20actionable\x20operations.','actions':['focus','expand','actions'],'notes':['Read-only;\x20distinct\x20from\x20query_toolkit\x20/\x20onchain_table_data\x20(pure\x20data,\x20no\x20identity).','focus\x20=\x20identity\x20resolution\x20(manifest\x20on-chain\x20role\x20⊕\x20persona)\x20+\x20base\x20data;\x20neutral\x20→\x20objective\x20narration,\x20operative\x20role\x20→\x20game\x20reasoning.','expand\x20=\x20direct\x20relations\x20+\x20Service\x20transparent\x20sub-order\x20purchasing\x20graph\x20(frozen\x20forward\x20guards\x20→\x20purchased\x20sub-services\x20+\x20proofs).','actions\x20=\x20actionable\x20operations\x20with\x20executability\x20judgment\x20(order-holder\x20/\x20permission-index\x20/\x20named-operator\x20paths).']},{'name':'persona_operation','summary':'User\x20identity\x20setting\x20(persona)\x20—\x20preferences,\x20strategy,\x20rules,\x20spec;\x20long-term\x20+\x20current\x20layers\x20+\x20strategy→lever\x20mapping\x20+\x20region\x20hint.','actions':['get','list','set','analyze','apply','sync','remove','strategy','region_hint','distill'],'notes':['Read/write\x20local\x20state;\x20account\x20persona\x20overrides\x20system;\x20current\x20overrides\x20long-term.','strategy\x20resolves\x20merchant\x20strategy\x20statements\x20into\x20deterministic\x20infrastructure\x20levers\x20(discount/reward/buy_guard/machine_design).','region_hint\x20reads\x20the\x20local\x20delivery\x20address\x20as\x20a\x20matching\x20hint;\x20`propose`\x20returns\x20a\x20consent-gated\x20save\x20proposal\x20(never\x20auto-writes).','distill\x20turns\x20one\x20goal\x27s\x20memory\x20(outcome,\x20process\x20problems/feedback,\x20objects)\x20into\x20a\x20CURRENT-layer\x20proposal\x20—\x20never\x20auto-writes;\x20persist\x20via\x20set/apply\x20after\x20user\x20confirmation.\x20Industry\x20pack.json\x20files\x20are\x20read-only\x20knowledge\x20and\x20never\x20receive\x20user\x20data.']},{'name':'employee_operation','summary':'Merchant\x20employee\x20organizational\x20profile\x20(LOCAL)\x20+\x20reaction\x20KPI\x20+\x20liability\x20resolution\x20+\x20incentive\x20suggestion.','actions':['set','get','remove','assess_kpi','resolve_liability','suggest_incentive'],'notes':['LOCAL\x20ONLY\x20—\x20on-chain\x20authorization\x20lives\x20in\x20the\x20merchant\x27s\x20Permission\x20(namedOperator/entity).','assess_kpi:\x20node\x20reaction\x20speed\x20vs\x20budget\x20(explicit\x20>\x20stored\x20profile\x20>\x2048h\x20default).\x20Timestamps\x20explicit\x20OR\x20auto-derived\x20from\x20the\x20progress\x20object\x27s\x20monitored\x20ProgressEvents\x20via\x20`progress`;\x20explicit\x20values\x20override\x20derived.','resolve_liability:\x20internal\x20cost\x20split\x20(merchant/employee,\x20hybrid\x20threshold);\x20outward\x20liability\x20toward\x20the\x20customer\x20is\x20ALWAYS\x20the\x20merchant\x27s;\x20order\x20user\x20must\x20be\x20compensated\x20before\x20the\x20workflow\x20resumes.','suggest_incentive:\x20KPIs\x20+\x20WIP\x20acceptance\x20+\x20liability\x20→\x20Reward\x20suggestion\x20(reward_grant/compensation_offset/correction_notice/none).\x20Suggestion\x20ONLY\x20—\x20merchant\x20confirms\x20and\x20executes\x20the\x20on-chain\x20ops\x20separately.']},{'name':'keeper_operation','summary':'Who-benefits-who-pushes\x20keeper:\x20scans\x20the\x20monitor\x20scope\x20for\x20actionable\x20state\x20(unclaimed\x20payments,\x20advanceable\x20workflow\x20nodes),\x20routes\x20tasks\x20to\x20beneficiaries;\x20manual\x20dismiss/execute\x20+\x20standing\x20auto-execute\x20rules.','actions':['tasks','dismiss','execute','rules','rule_set','rule_remove','config','config_set','scan','status'],'notes':['The\x20chain\x20has\x20NO\x20time-triggered\x20execution\x20—\x20the\x20keeper\x20scans\x20on\x20the\x20monitor\x20loop\x20cadence\x20and\x20surfaces\x20tasks\x20to\x20their\x20beneficiary.','execute\x20runs\x20the\x20on-chain\x20op\x20for\x20one\x20task\x20(user\x20decision);\x20rule_set\x20authorizes\x20auto-execution\x20per\x20detector\x20kind\x20(bounded\x20by\x20config\x20budget/cooldown).','Detectors\x20v1:\x20payment_unclaimed\x20(funds\x20sitting\x20claimable),\x20progress_actionable\x20(a\x20workflow\x20node\x20the\x20beneficiary\x20can\x20advance).']},{'name':'intent_radar','summary':'User\x20business\x20intent\x20×\x20chain\x20event\x20matching\x20—\x20persist\x20intents,\x20score\x20events\x20against\x20them.','actions':['save','list','remove','match'],'notes':['Read-only\x20w.r.t.\x20chain;\x20industry/keywords\x20resolved\x20once\x20at\x20save;\x20events\x20supplied\x20or\x20auto-pulled.']},{'name':'goal_operation','summary':'GoalEngine\x20(K3\x2024)\x20—\x20record\x20a\x20user\x20goal\x20and\x20drive\x20it\x20through\x20the\x20nine-station\x20lifecycle\x20(RECOGNIZE→…→COMPLETE)\x20with\x20monitor\x20auto-binding\x20and\x20plan-approval\x20confirm-gate\x20downgrade;\x20also\x20hosts\x20the\x20C1-C4\x20planning\x20pipeline\x20+\x20merchant\x20onboarding\x20wizard.','actions':['create','list','get','approve','advance','pause','complete','abandon','delete','analyze_intent','aggregate_risks','trace_substeps','merchant_guide'],'common_params':{'id':'Goal\x20id\x20(goal_…)\x20—\x20required\x20for\x20get/approve/advance/pause/complete/abandon/delete.','intent_text':'create:\x20raw\x20user\x20intent;\x20goal_type\x20auto-classified\x20(override\x20with\x20goal_type).','account':'create:\x20bind\x20a\x20local\x20account\x20(preflight;\x20goal\x20starts\x20at\x20\x27bound\x27).','stage':'advance:\x20forward-only\x20target\x20stage;\x20\x27paused\x27\x20holds\x20from\x20anywhere.','objects':'advance:\x20ACT-station\x20objects\x20[{type,\x20object}]\x20(deduped).','force':'complete:\x20skip\x20on-chain\x20completion\x20verification\x20(audited\x20as\x20outcome.forced).'},'follow_ups':['monitor_events\x20(goal\x20progress\x20surfaces\x20in\x20the\x20todo\x20stream)','onchain_operations\x20(execute\x20plan\x20steps\x20with\x20env.plan_approval)'],'notes':['Near-duplicate\x20create\x20ADOPTS\x20the\x20active\x20same-type\x20same-account\x20goal\x20(intent\x20Jaccard\x20≥\x200.6)\x20instead\x20of\x20forking.','approve\x20registers\x20a\x20plan\x20approval:\x20calls\x20carrying\x20env.plan_approval=<goal\x20id>\x20auto-pass\x20fail-open\x20ConfirmGate\x20levels\x20(standard/none);\x20fail-closed\x20levels\x20(irreversible/publish/amount)\x20always\x20still\x20ask.','Entering\x20\x27monitoring\x27\x20auto-binds\x20monitor\x20focus\x20(reason=\x27goal\x27,\x20goal_id-stamped)\x20for\x20the\x20goal\x27s\x20objects;\x20demand\x20goals\x20also\x20open\x20a\x20radar\x20intent.\x20complete/abandon\x20tear\x20down\x20ONLY\x20this\x20goal\x27s\x20bindings.','complete\x20verifies\x20the\x20goal-type\x20completion\x20conjunction\x20against\x20chain\x20state\x20(read-only);\x20force=true\x20bypasses\x20and\x20is\x20audited.','delete\x20removes\x20a\x20terminal\x20goal\x20entirely\x20(record\x20+\x20TaskProcess\x20dir);\x20force=true\x20extends\x20it\x20to\x20non-terminal\x20goals\x20(monitor\x20teardown\x20first).','C1-C4\x20planning\x20pipeline\x20(GLM5-31\x20§V3/V4):\x20analyze_intent\x20(intent\x20→\x20objects\x20+\x20puzzle\x20snapshots)\x20→\x20aggregate_risks\x20(puzzles\x20OR\x20intent\x20→\x20calibrated\x20risks\x20+\x20RISK_BLOCKED\x20status)\x20→\x20trace_substeps\x20(substep\x20records\x20→\x20DAG\x20coherence\x20+\x20D-10\x20verdict);\x20merchant_guide\x20=\x2010-step\x20onboarding\x20wizard\x20(stateless\x20guide_state,\x20never\x20executes\x20on-chain\x20—\x20materialize\x20via\x20onchain_operations).\x20All\x20four\x20are\x20pure\x20transformations.']},{'name':'monitor_events','summary':'Persistent\x20monitor\x20event\x20store\x20(shared\x20with\x20the\x20client\x20Monitor\x20page)\x20—\x20paginated\x20events\x20with\x20read\x20flags;\x20mark\x20read/unread.','actions':['query','mark_read','mark_all_read'],'notes':['Events\x20captured\x20by\x20the\x20resident\x20MonitorLoop\x20(client\x20sidecar,\x20or\x20stdio\x20MCP\x20server\x20with\x20MONITOR_LOOP=1)\x20across\x209\x20modules,\x20stored\x20APPEND-ONLY\x20in\x20SQLite\x20(survives\x20restarts)\x20with\x20per-event\x20read\x20flags.','query\x20=\x20paginated\x20newest-first\x20with\x20module/event_type/since/until\x20filters\x20+\x20module_counts/unread_by_module/total_unread;\x20relevant_only\x20(default\x20true)\x20restricts\x20to\x20scope-closure/focus/filter\x20hits\x20(de-noised\x20todo\x20stream);\x20with_reason\x20attaches\x20the\x20relevance\x20annotation\x20+\x20delivered\x20flag;\x20mark_read\x20=\x20idempotent\x20per-event\x20(\x27<eventSeq>:<txDigest>\x27);\x20mark_all_read\x20=\x20optionally\x20module-scoped.','Cross-process:\x20read\x20state\x20is\x20SHARED\x20with\x20the\x20client\x20app\x20(same\x20SQLite\x20store)\x20—\x20marking\x20read\x20here\x20clears\x20the\x20client\x20Monitor\x20unread\x20badge\x20and\x20vice\x20versa.']},{'name':'monitor_subscription','summary':'Monitor\x20subscription\x20config\x20—\x20scope-closure\x20rules,\x20focus\x20objects,\x20per-type\x20todo\x20switches,\x20conditional\x20filters;\x20scope\x20preview\x20+\x20filter\x20dry-run.','actions':['get','save','reset','scope_preview','test_filter'],'notes':['Single\x20configuration\x20entry\x20point\x20for\x20monitor\x20v4\x20(client\x20settings\x20panel\x20and\x20agents\x20share\x20it);\x20save/reset\x20merge\x20+\x20clamp\x20loop\x20params,\x20then\x20trigger\x20an\x20immediate\x20scope\x20re-resolve\x20and\x20schedule\x20a\x20backfill\x20when\x20the\x20closure\x20changed.','scope_preview\x20lists\x20the\x20resolved\x20closure\x20grouped\x20by\x20layer\x20(accounts/permissions/managed_objects/services/orders/order_children/focus)\x20with\x20pagination\x20—\x20inspect\x20before\x20tuning\x20rule\x20switches.','test_filter\x20dry-runs\x20a\x20filter\x20draft\x20over\x20the\x20most\x20recent\x20captured\x20events\x20(default\x20200,\x20max\x201000)\x20returning\x20matched/scanned\x20counts\x20+\x20up\x20to\x205\x20samples\x20—\x20preview\x20noise\x20BEFORE\x20saving.','Capture\x20is\x20unaffected\x20by\x20delivery\x20switches\x20EXCEPT\x20NewPaymentEvent\x20(captured\x20only\x20when\x20switched\x20ON).']},{'name':'industry_pack_operation','summary':'Industry\x20knowledge\x20pack\x20lifecycle\x20—\x20scaffold\x20(merged\x20v2\x20template),\x20scan/register,\x20layer\x20get,\x20diff,\x20reset-to-template,\x20plus\x20industry-dir\x20file\x20operations\x20and\x20the\x20industry\x20mode\x20registry\x20(GLM6/92\x20§E).','actions':['scaffold','list','scan','resolve','list_files','read_file','write_file','get','diff','reset','delete_file','create_file','create_dir','copy','move','rename','recommend_industry','list_modes','derive_user_mode','evolve_user_mode','register_user_mode','unregister_user_mode','register_custom_metric','register_custom_constraint','list_metrics_constraints'],'notes':['LOCAL\x20ONLY\x20—\x20filesystem\x20+\x20in-memory\x20registry;\x20never\x20mutates\x20chain\x20state.','Merged\x20v2\x20layout:\x20pack.json\x20(annotated\x20with\x20_schema/_doc\x20comment\x20fields\x20+\x20personae)\x20+\x20playbook.md;\x20legacy\x20split-file\x20layouts\x20still\x20read\x20for\x20backward\x20compatibility.','reset\x20restores\x20a\x20file\x20or\x20entire\x20pack\x20folder\x20to\x20its\x20pristine\x20annotated\x20template\x20—\x20user\x20edits\x20beyond\x20the\x20target\x20are\x20preserved.','Mode\x20registry\x20(GLM6/92\x20§E):\x20recommend_industry\x20(top-3\x20similar\x20industries\x20+\x20verified\x20reference\x20examples),\x20list_modes,\x20derive_user_mode\x20(customize\x20a\x20builtin),\x20evolve_user_mode,\x20register_user_mode\x20(fully\x20custom;\x20R-M1-11\x20enforced\x20on\x20machine_shape),\x20unregister_user_mode,\x20register_custom_metric\x20/\x20register_custom_constraint\x20(extend\x20evaluation\x20registries),\x20list_metrics_constraints.']},{'name':'workspace_operation','summary':'Local\x20workspace\x20directory\x20(`.wowok/workspace`)\x20—\x20generated\x20review\x20files\x20(machine/guard/wts/wip\x20JSON)\x20and\x20user\x20documents:\x20list/read/write\x20+\x20file\x20operations.','actions':['resolve','list','read','write','delete','create_file','create_dir','copy','move','rename'],'notes':['LOCAL\x20ONLY\x20—\x20filesystem\x20operations\x20confined\x20to\x20the\x20workspace\x20root;\x20never\x20mutates\x20chain\x20state.','read\x20is\x20the\x20supported\x20way\x20to\x20load\x20a\x20generated\x20JSON\x20as\x20AI\x20context\x20before\x20editing/submitting.']},{'name':'workflow_operation','summary':'Local-account\x20workflow\x20view\x20—\x20list\x20active\x20Progress\x20that\x20at\x20least\x20one\x20local\x20account\x20can\x20advance\x20(permission\x20+\x20guard\x20+\x20executable\x20accounts),\x20advance/hold/unhold\x20a\x20forward,\x20and\x20view\x20a\x20progress\x27s\x20on-chain\x20operation\x20history.','actions':['list','operate','history'],'notes':['list:\x20permission-aware\x20—\x20a\x20forward\x20is\x20executable\x20when\x20(a)\x20namedOperator=\x27\x27\x20and\x20account\x20is\x20order\x20holder,\x20(b)\x20namedOperator=name\x20and\x20account\x20is\x20in\x20progress.namedOperator[name],\x20or\x20(c)\x20permissionIndex\x20set\x20and\x20account\x20is\x20in\x20permission.admin/table.','operate:\x20delegates\x20to\x20the\x20on-chain\x20progress\x20operation\x20(guard-aware);\x20op\x20∈\x20next/hold/unhold/adminUnhold.','history:\x20incrementally\x20syncs\x20a\x20progress\x27s\x20ON-CHAIN\x20Progress.history\x20(append-only\x20u64\x20index)\x20into\x20the\x20local\x20SQLite\x20mirror\x20via\x20a\x20per-progress\x20cursor\x20(only\x20new\x20records\x20pulled),\x20returns\x20the\x20migration\x20timeline\x20newest-first\x20with\x20each\x20migration\x27s\x20session\x20snapshot\x20(forwards\x20/\x20operator\x20/\x20weight\x20/\x20time);\x20runs\x2090-day\x20retention\x20cleanup\x20by\x20default.']},{'name':'permission_operation','summary':'Local-account\x20Permission\x20overview\x20—\x20list\x20Permissions\x20related\x20to\x20local\x20accounts\x20(via\x20entity_permission\x20index)\x20with\x20owner/admin/entity\x20breakdown\x20+\x20related\x20objects\x20via\x20object-linker\x20indexes.','actions':['list'],'notes':['Read-only;\x20reverse-looks-up\x20local\x20accounts\x20via\x20entity_permission\x20@0xaad,\x20then\x20merges/dedups\x20permissions.','Related\x20objects\x20resolved\x20via\x20object-linker\x20reverse\x20indexes\x20(0xaae\x20core\x20/\x200xaaf\x20tx)\x20binding\x20edges,\x20grouped\x20by\x20type\x20via\x20first-byte\x20address\x20tag.','Latest\x20update\x20time\x20derived\x20from\x20the\x20Permission\x27s\x20previousTransaction.']},{'name':'ask_user','summary':'Structured\x20user\x20elicitation\x20—\x20ask\x20the\x20user\x20to\x20choose\x20between\x202-8\x20concrete\x20options\x20and\x20receive\x20a\x20validated\x20structured\x20answer\x20(MCP\x202.0\x20elicitation\x20/\x20desktop\x20option\x20card).','common_params':{'question':'The\x20single\x20decision\x20needed\x20from\x20the\x20user\x20(1-1000\x20chars).','options':'2-8\x20self-contained\x20{id,label,description?}\x20choices.','recommended_id':'id\x20of\x20the\x20professionally\x20recommended\x20option\x20(optional).','multi_select':'true\x20when\x20options\x20are\x20combinable\x20(boolean\x20toggle\x20per\x20option).','allow_freeform':'true\x20to\x20permit\x20an\x20additional\x20free-text\x20answer.','context':'Optional\x20short\x20explanation\x20of\x20why\x20the\x20decision\x20is\x20needed.'},'notes':['Use\x20when\x20a\x20business\x20decision\x20belongs\x20to\x20the\x20user\x20and\x20continuing\x20requires\x20it;\x20never\x20guess\x20or\x20silently\x20default\x20an\x20unanswered\x20choice.','Desktop\x20clients\x20render\x20an\x20option\x20card;\x20MCP\x202.0\x20transports\x20fulfil\x20via\x20elicitation/create;\x20unsupported\x20clients\x20should\x20fall\x20back\x20to\x20a\x20numbered\x20prose\x20question.','action\x20decline/cancel\x20means\x20STOP\x20and\x20ask\x20how\x20to\x20proceed\x20in\x20plain\x20text\x20—\x20do\x20not\x20execute\x20a\x20default\x20path.','Not\x20a\x20safety\x20confirmation\x20—\x20irreversible/publish/amount\x20gates\x20remain\x20handled\x20by\x20confirm_gate.']}];export function getToolReference(a){return TOOLS_REFERENCE['find'](b=>b['name']===a);}export function searchToolReference(a){const b=a['toLowerCase']();return TOOLS_REFERENCE['filter'](c=>{if(c['name']['toLowerCase']()['includes'](b))return!![];if(c['summary']['toLowerCase']()['includes'](b))return!![];if(c['actions']?.['some'](d=>d['toLowerCase']()['includes'](b)))return!![];return![];});}export function getToolSequence(a){const b=getToolReference(a);if(!b)return undefined;return{'prerequisites':b['prerequisites']??[],'tool':b['name'],'follow_ups':b['follow_ups']??[]};}