@wowok/agent-mcp 3.0.0 → 3.0.2

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 (245) hide show
  1. package/dist/communication/evidence.d.ts +6 -0
  2. package/dist/communication/evidence.js +1 -0
  3. package/dist/evaluation/acceptance.d.ts +24 -0
  4. package/dist/evaluation/acceptance.js +1 -0
  5. package/dist/evaluation/builtins/demand-match.d.ts +3 -2
  6. package/dist/evaluation/builtins/demand-match.js +1 -1
  7. package/dist/evaluation/builtins/service-risk.d.ts +2 -1
  8. package/dist/evaluation/builtins/service-risk.js +1 -1
  9. package/dist/evaluation/index.d.ts +1 -0
  10. package/dist/evaluation/index.js +1 -1
  11. package/dist/evaluation/match-operation.d.ts +14 -0
  12. package/dist/evaluation/match-operation.js +1 -0
  13. package/dist/experience/realtime-feedback.js +1 -1
  14. package/dist/extensions/modes.js +1 -1
  15. package/dist/goal/GoalClassifier.js +1 -1
  16. package/dist/goal/GoalEngine.d.ts +8 -0
  17. package/dist/goal/GoalEngine.js +1 -1
  18. package/dist/goal/types.d.ts +1 -1
  19. package/dist/harness/auto-escalation.d.ts +0 -12
  20. package/dist/harness/auto-escalation.js +1 -1
  21. package/dist/harness/index.d.ts +1 -14
  22. package/dist/harness/index.js +1 -1
  23. package/dist/harness/types.d.ts +0 -38
  24. package/dist/intent/types.d.ts +1 -1
  25. package/dist/intent/types.js +1 -1
  26. package/dist/keeper/KeeperScan.d.ts +39 -0
  27. package/dist/keeper/KeeperScan.js +1 -0
  28. package/dist/keeper/KeeperStore.d.ts +43 -0
  29. package/dist/keeper/KeeperStore.js +1 -0
  30. package/dist/keeper/detectors.d.ts +23 -0
  31. package/dist/keeper/detectors.js +1 -0
  32. package/dist/keeper/keeper.spec.d.ts +1 -0
  33. package/dist/keeper/keeper.spec.js +1 -0
  34. package/dist/keeper/types.d.ts +65 -0
  35. package/dist/keeper/types.js +1 -0
  36. package/dist/knowledge/demand-risk.js +1 -1
  37. package/dist/knowledge/event-semantics.d.ts +3 -0
  38. package/dist/knowledge/event-semantics.js +1 -1
  39. package/dist/knowledge/event-semantics.spec.d.ts +1 -0
  40. package/dist/knowledge/event-semantics.spec.js +1 -0
  41. package/dist/knowledge/evidence-review.d.ts +23 -0
  42. package/dist/knowledge/evidence-review.js +1 -1
  43. package/dist/knowledge/examples-scanner-cli.js +1 -1
  44. package/dist/knowledge/examples-scanner.js +1 -1
  45. package/dist/knowledge/guard-bytecode-spec.d.ts +82 -0
  46. package/dist/knowledge/guard-bytecode-spec.js +1 -0
  47. package/dist/knowledge/guard-design-patterns.d.ts +1 -1
  48. package/dist/knowledge/guard-design-patterns.js +1 -1
  49. package/dist/knowledge/index.d.ts +10 -6
  50. package/dist/knowledge/index.js +1 -1
  51. package/dist/knowledge/industry-registry.js +1 -1
  52. package/dist/knowledge/mcp-schema-audit-cli.js +1 -1
  53. package/dist/knowledge/mcp-schema-audit.js +1 -1
  54. package/dist/knowledge/migration-preflight.d.ts +27 -0
  55. package/dist/knowledge/migration-preflight.js +1 -0
  56. package/dist/knowledge/scenario-modes.d.ts +1 -1
  57. package/dist/knowledge/scenario-modes.js +1 -1
  58. package/dist/knowledge/template-registry.js +1 -1
  59. package/dist/knowledge/tools-reference.js +1 -1
  60. package/dist/knowledge/workflow-guidance.d.ts +20 -0
  61. package/dist/knowledge/workflow-guidance.js +1 -1
  62. package/dist/monitor/MonitorLoop.d.ts +1 -0
  63. package/dist/monitor/MonitorLoop.js +1 -1
  64. package/dist/monitor/ScopeResolver.js +1 -1
  65. package/dist/monitor/SuggestionBridge.d.ts +1 -1
  66. package/dist/monitor/SuggestionBridge.js +1 -1
  67. package/dist/monitor/SuggestionBridge.spec.d.ts +1 -0
  68. package/dist/monitor/SuggestionBridge.spec.js +1 -0
  69. package/dist/monitor/normalize.js +1 -1
  70. package/dist/monitor/types.d.ts +0 -1
  71. package/dist/monitor/types.js +1 -1
  72. package/dist/participation/employee-kpi.d.ts +12 -0
  73. package/dist/participation/employee-kpi.js +1 -1
  74. package/dist/participation/employee-kpi.spec.d.ts +1 -0
  75. package/dist/participation/employee-kpi.spec.js +1 -0
  76. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  77. package/dist/playbooks/service-build/mode-actions.d.ts +19 -6
  78. package/dist/playbooks/service-build/mode-actions.js +1 -1
  79. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  80. package/dist/relationship/derivation.d.ts +6 -0
  81. package/dist/relationship/derivation.js +1 -1
  82. package/dist/relationship/derivation.spec.d.ts +1 -0
  83. package/dist/relationship/derivation.spec.js +1 -0
  84. package/dist/role/index.d.ts +2 -2
  85. package/dist/role/index.js +1 -1
  86. package/dist/role/model.d.ts +2 -1
  87. package/dist/role/model.js +1 -1
  88. package/dist/role/types.d.ts +5 -0
  89. package/dist/rules.d.ts +1 -1
  90. package/dist/safety/confirm-gate.js +1 -1
  91. package/dist/schema/call/semantic.js +1 -1
  92. package/dist/schema/common/index.js +1 -1
  93. package/dist/schema/employee/index.d.ts +61 -1
  94. package/dist/schema/employee/index.js +1 -1
  95. package/dist/schema/evaluation/index.d.ts +70 -5
  96. package/dist/schema/evaluation/index.js +1 -1
  97. package/dist/schema/index.d.ts +1 -0
  98. package/dist/schema/index.js +1 -1
  99. package/dist/schema/industry-pack/index.d.ts +43 -7
  100. package/dist/schema/industry-pack/modes.d.ts +42 -6
  101. package/dist/schema/industry-pack/modes.js +1 -1
  102. package/dist/schema/intent-radar/index.d.ts +3 -0
  103. package/dist/schema/intent-radar/index.js +1 -1
  104. package/dist/schema/keeper/index.d.ts +475 -0
  105. package/dist/schema/keeper/index.js +1 -0
  106. package/dist/schema/local/index.js +1 -1
  107. package/dist/schema/messenger/index.d.ts +2 -0
  108. package/dist/schema/messenger/index.js +1 -1
  109. package/dist/schema/operations.d.ts +34 -0
  110. package/dist/schema/query/bi.d.ts +188 -0
  111. package/dist/schema/query/bi.js +1 -1
  112. package/dist/schema/query/index.d.ts +48 -48
  113. package/dist/schema/query/index.js +1 -1
  114. package/dist/schema/schema-query/index.d.ts +2 -11
  115. package/dist/schema/schema-query/index.js +1 -1
  116. package/dist/schema/schema-version.js +1 -1
  117. package/dist/schema/utils/skills-recommendation.js +1 -1
  118. package/dist/schema/watch/index.d.ts +4 -0
  119. package/dist/schema/watch/index.js +1 -1
  120. package/dist/schema-query-impl/index.d.ts +33 -14
  121. package/dist/schema-query-impl/index.js +1 -1
  122. package/dist/schemas/employee_operation.output.json +100 -0
  123. package/dist/schemas/employee_operation.schema.json +148 -5
  124. package/dist/schemas/evaluation_operation.output.json +135 -9
  125. package/dist/schemas/evaluation_operation.schema.json +176 -7
  126. package/dist/schemas/index.json +7 -1
  127. package/dist/schemas/industry_pack_operation.output.json +158 -32
  128. package/dist/schemas/intent_radar.output.json +2 -0
  129. package/dist/schemas/intent_radar.schema.json +1 -0
  130. package/dist/schemas/keeper_operation.output.json +1274 -0
  131. package/dist/schemas/keeper_operation.schema.json +359 -0
  132. package/dist/schemas/messenger_operation.schema.json +8 -0
  133. package/dist/schemas/onchain_events.output.json +55 -11
  134. package/dist/schemas/onchain_events.schema.json +4 -0
  135. package/dist/schemas/onchain_table_data.output.json +59 -0
  136. package/dist/schemas/query_toolkit.output.json +428 -0
  137. package/dist/schemas/query_toolkit.schema.json +59 -0
  138. package/dist/schemas/schema_query.output.json +1 -64
  139. package/dist/schemas/schema_query.schema.json +18 -3
  140. package/dist/schemas/watch_operation.output.json +21 -1
  141. package/dist/task/playbook.js +1 -1
  142. package/dist/task/types.d.ts +1 -1
  143. package/dist/tools/handlers/bridge.js +1 -1
  144. package/dist/tools/handlers/config.js +1 -1
  145. package/dist/tools/handlers/employee.d.ts +6 -0
  146. package/dist/tools/handlers/employee.js +1 -1
  147. package/dist/tools/handlers/employee.spec.d.ts +1 -0
  148. package/dist/tools/handlers/employee.spec.js +1 -0
  149. package/dist/tools/handlers/evaluation.js +1 -1
  150. package/dist/tools/handlers/evaluation.spec.d.ts +1 -0
  151. package/dist/tools/handlers/evaluation.spec.js +1 -0
  152. package/dist/tools/handlers/intent-radar.js +1 -1
  153. package/dist/tools/handlers/keeper.d.ts +12 -0
  154. package/dist/tools/handlers/keeper.js +1 -0
  155. package/dist/tools/handlers/messenger.js +1 -1
  156. package/dist/tools/handlers/onchain.js +1 -1
  157. package/dist/tools/handlers/query.js +1 -1
  158. package/dist/tools/handlers/schema-query.js +1 -1
  159. package/dist/tools/handlers/watch.js +1 -1
  160. package/dist/tools/handlers/workflow.js +1 -1
  161. package/dist/tools/index.js +1 -1
  162. package/dist/tools/registry/agent.d.ts +2 -0
  163. package/dist/tools/registry/agent.js +1 -0
  164. package/dist/tools/registry/bridge.d.ts +2 -0
  165. package/dist/tools/registry/bridge.js +1 -0
  166. package/dist/tools/registry/business.d.ts +2 -0
  167. package/dist/tools/registry/business.js +1 -0
  168. package/dist/tools/registry/config.d.ts +2 -0
  169. package/dist/tools/registry/config.js +1 -0
  170. package/dist/tools/registry/files.d.ts +2 -0
  171. package/dist/tools/registry/files.js +1 -0
  172. package/dist/tools/registry/identity.d.ts +2 -0
  173. package/dist/tools/registry/identity.js +1 -0
  174. package/dist/tools/registry/local.d.ts +2 -0
  175. package/dist/tools/registry/local.js +1 -0
  176. package/dist/tools/registry/messenger.d.ts +2 -0
  177. package/dist/tools/registry/messenger.js +1 -0
  178. package/dist/tools/registry/monitor.d.ts +2 -0
  179. package/dist/tools/registry/monitor.js +1 -0
  180. package/dist/tools/registry/onchain.d.ts +2 -0
  181. package/dist/tools/registry/onchain.js +1 -0
  182. package/dist/tools/registry/query.d.ts +2 -0
  183. package/dist/tools/registry/query.js +1 -0
  184. package/dist/tools/registry/trust.d.ts +2 -0
  185. package/dist/tools/registry/trust.js +1 -0
  186. package/dist/tools/shared.js +1 -1
  187. package/dist/tools/wrap.js +1 -1
  188. package/package.json +2 -2
  189. package/dist/examples/arbitration-dispute-create.json +0 -41
  190. package/dist/examples/arbitration-vote-weighted.json +0 -35
  191. package/dist/examples/arbitration-voting-guard-add.json +0 -38
  192. package/dist/examples/demand-present-service.json +0 -33
  193. package/dist/examples/education-contact-create.json +0 -40
  194. package/dist/examples/freelance-contact-create.json +0 -40
  195. package/dist/examples/gen-passport-verify-guard.json +0 -48
  196. package/dist/examples/guard-template-balance-check.json +0 -59
  197. package/dist/examples/guard-template-time-lock.json +0 -60
  198. package/dist/examples/insurance-guard-claim-timelock.json +0 -75
  199. package/dist/examples/insurance-guard-withdraw-allocation.json +0 -96
  200. package/dist/examples/insurance-machine-create.json +0 -75
  201. package/dist/examples/insurance-service-allocators.json +0 -55
  202. package/dist/examples/machine-multisig-threshold.json +0 -87
  203. package/dist/examples/machine-publish.json +0 -30
  204. package/dist/examples/machine-template-7node-rental.json +0 -119
  205. package/dist/examples/payment-scenario-bound.json +0 -45
  206. package/dist/examples/rental-ziroom-machine-create.json +0 -148
  207. package/dist/examples/rental-ziroom-permission-create.json +0 -41
  208. package/dist/examples/rental-ziroom-service-create.json +0 -36
  209. package/dist/examples/retail-adv-guard-customer-win-create.json +0 -80
  210. package/dist/examples/retail-adv-guard-messenger-proof-create.json +0 -65
  211. package/dist/examples/retail-adv-guard-reward-timeout-create.json +0 -92
  212. package/dist/examples/retail-adv-reward-guard-add.json +0 -51
  213. package/dist/examples/retail-myshop-allocation-activate.json +0 -55
  214. package/dist/examples/retail-myshop-arbitration-create.json +0 -40
  215. package/dist/examples/retail-myshop-contact-create.json +0 -43
  216. package/dist/examples/retail-myshop-order-create.json +0 -56
  217. package/dist/examples/retail-myshop-progress-operate.json +0 -38
  218. package/dist/examples/retail-myshop-reward-create.json +0 -35
  219. package/dist/examples/retail-myshop-service-create.json +0 -38
  220. package/dist/examples/retail-myshop-service-customer-required.json +0 -31
  221. package/dist/examples/service-discount-issue.json +0 -46
  222. package/dist/examples/subscription-contact-create.json +0 -40
  223. package/dist/examples/threebody-guard-create.json +0 -56
  224. package/dist/examples/threebody-machine-create.json +0 -71
  225. package/dist/examples/threebody-permission-create.json +0 -38
  226. package/dist/examples/threebody-service-allocators.json +0 -48
  227. package/dist/examples/travel-guard-time-lock.json +0 -69
  228. package/dist/examples/travel-guard-weather-oracle.json +0 -70
  229. package/dist/examples/travel-machine-create.json +0 -135
  230. package/dist/examples/travel-repository-create.json +0 -47
  231. package/dist/examples/travel-service-create.json +0 -34
  232. package/dist/examples/travel-treasury-create.json +0 -34
  233. package/dist/examples/treasury-deposit.json +0 -37
  234. package/dist/examples/treasury-withdraw.json +0 -38
  235. package/dist/harness/plan.d.ts +0 -33
  236. package/dist/harness/plan.js +0 -1
  237. package/dist/knowledge/demand-matching.d.ts +0 -29
  238. package/dist/knowledge/demand-matching.js +0 -1
  239. package/dist/knowledge/guard-context.d.ts +0 -56
  240. package/dist/knowledge/guard-context.js +0 -1
  241. package/dist/knowledge/guard-migration.d.ts +0 -48
  242. package/dist/knowledge/guard-migration.js +0 -1
  243. package/dist/schemas/guard-node-schema.json +0 -1000
  244. package/dist/task/stage-gate.d.ts +0 -22
  245. package/dist/task/stage-gate.js +0 -1
@@ -1,119 +0,0 @@
1
- {
2
- "title": "Machine Template: 7-Node Rental Workflow (Simplified, R-M1-11 Compliant)",
3
- "description": "Simplified rental workflow without damage/arbitration paths. Refund flows through an Allocator triggered by the return_approved routing node — never through a Machine terminal node.",
4
- "tags": ["machine", "template", "rental", "simplified", "r-m1-11"],
5
- "industry": "rental",
6
- "operation_type": "machine",
7
- "source": "template",
8
- "verified": true,
9
- "network": "testnet",
10
- "call": {
11
- "tool": "onchain_operations",
12
- "operation_type": "machine",
13
- "data": {
14
- "object": {
15
- "name": "rental_machine_simple"
16
- },
17
- "node": {
18
- "op": "add",
19
- "bReplace": true,
20
- "nodes": [
21
- {
22
- "name": "reserved",
23
- "pairs": [
24
- {
25
- "prev_node": "",
26
- "threshold": 1,
27
- "forwards": [
28
- { "name": "Pay", "weight": 1, "namedOperator": "" }
29
- ]
30
- }
31
- ]
32
- },
33
- {
34
- "name": "paid",
35
- "pairs": [
36
- {
37
- "prev_node": "reserved",
38
- "threshold": 1,
39
- "forwards": [
40
- { "name": "Confirm Payment", "weight": 1, "permissionIndex": 1000 }
41
- ]
42
- }
43
- ]
44
- },
45
- {
46
- "name": "in_use",
47
- "pairs": [
48
- {
49
- "prev_node": "paid",
50
- "threshold": 1,
51
- "forwards": [
52
- { "name": "Deliver Item", "weight": 1, "permissionIndex": 1000 }
53
- ]
54
- }
55
- ]
56
- },
57
- {
58
- "name": "returned",
59
- "pairs": [
60
- {
61
- "prev_node": "in_use",
62
- "threshold": 1,
63
- "forwards": [
64
- { "name": "Return Item", "weight": 1, "namedOperator": "" }
65
- ]
66
- }
67
- ]
68
- },
69
- {
70
- "name": "inspected",
71
- "pairs": [
72
- {
73
- "prev_node": "returned",
74
- "threshold": 1,
75
- "forwards": [
76
- { "name": "Inspect", "weight": 1, "permissionIndex": 1001 }
77
- ]
78
- }
79
- ]
80
- },
81
- {
82
- "name": "return_approved",
83
- "pairs": [
84
- {
85
- "prev_node": "inspected",
86
- "threshold": 1,
87
- "forwards": [
88
- { "name": "Approve Return", "weight": 1, "permissionIndex": 1002 }
89
- ]
90
- }
91
- ]
92
- },
93
- {
94
- "name": "completed",
95
- "pairs": [
96
- {
97
- "prev_node": "return_approved",
98
- "threshold": 1,
99
- "forwards": [
100
- { "name": "Complete", "weight": 1, "permissionIndex": 1000 }
101
- ]
102
- }
103
- ]
104
- }
105
- ]
106
- }
107
- },
108
- "env": {
109
- "network": "testnet"
110
- }
111
- },
112
- "notes": [
113
- "R-M1-11: 'return_approved' is a ROUTING node — the actual refund MUST be executed by an Allocator (bound via Service.order_allocators) whose Guard checks progress.current == 'return_approved'. A node named 'refunded' implies the Machine itself moves funds, which Machines cannot do; funds would lock in the Order escrow.",
114
- "Forwards describe INCOMING transitions: the forward in a node's pair (prev_node='X') is the action that advances Progress FROM X INTO this node.",
115
- "The entry node (prev_node='') MUST have at least one forward — schema-enforced (FIX-002).",
116
- "namedOperator='' means OrderHolder (customer). permissionIndex references Permission table entries (1000=operator, 1001=inspector, 1002=finance).",
117
- "Simplified version — no damage or arbitration paths. Use for short-term rentals without damage risk."
118
- ]
119
- }
@@ -1,45 +0,0 @@
1
- {
2
- "title": "Create Scenario-Bound Payment (for_object + for_guard)",
3
- "description": "Create a Payment of 0.05 WOW to alice whose payment_info binds it to a Demand object and a KYC Guard, making the fund flow auditable against a business scenario.",
4
- "tags": ["payment", "scenario", "for_object", "for_guard", "audit"],
5
- "industry": "general",
6
- "operation_type": "payment",
7
- "source": "constructed under T-09 authorization; grounded in CallPayment_CreateSchema + PaymentInfoSchema — schema-validated, not chain-verified",
8
- "verified": false,
9
- "network": "testnet",
10
- "call": {
11
- "tool": "onchain_operations",
12
- "operation_type": "payment",
13
- "data": {
14
- "object": {
15
- "name": "kyc_bounty_payment_v1",
16
- "type_parameter": "0x2::wow::WOW"
17
- },
18
- "revenue": [
19
- {
20
- "recipient": { "name_or_address": "alice" },
21
- "amount": { "balance": 50000000 }
22
- }
23
- ],
24
- "info": {
25
- "for_object": "toy_repair_demand_v1",
26
- "for_guard": "kyc_level_guard",
27
- "remark": "Bounty payout for completed KYC verification demand",
28
- "index": 0
29
- }
30
- },
31
- "env": {
32
- "network": "testnet",
33
- "no_cache": true,
34
- "confirmed": true
35
- }
36
- },
37
- "notes": [
38
- "SCENARIO BINDING: info.for_object ties the Payment to a business object (here the Demand it settles); info.for_guard ties it to the Guard whose verification justified the payout (here the KYC Guard). Both are optional but together make the payment self-describing on-chain — auditors can trace WHY the money moved.",
39
- "Payment is IMMUTABLE once created: it can only be created, never modified. revenue[] is the full recipient/amount split in one shot (single recipient here; multiple entries split the total).",
40
- "amount uses CoinParam {balance: <smallest unit>} — 50000000 = 0.05 WOW (9 decimals). recipient is AccountOrMark_Address OBJECT form {name_or_address}.",
41
- "info.remark and info.index are REQUIRED (PaymentInfoSchema); index numbers the payment record for later reference by fees_transfer-style operations.",
42
- "The OTHER payment mode (not shown): {object: '<coinwrapper_id>', receive: true, type_parameter: '0x2::wow::WOW'} unwraps a CoinWrapper received from an Allocation split into spendable coins — see CallPayment_ReceiveSchema and the allocation-activate example for the full flow.",
43
- "type_parameter goes INSIDE 'object' (TypeNamedObjectSchema) and must match the coin being paid."
44
- ]
45
- }
@@ -1,148 +0,0 @@
1
- {
2
- "title": "Create 9-Node Machine for Rental Lifecycle (Ziroom, R-M1-11 Compliant)",
3
- "description": "9-node workflow: reserved → paid_deposit → in_use → returned → inspected, then three competing routing branches: return_approved (refund Allocator fires) / damage_confirmed (deduction Allocator fires) / arbiter_rule (off-Machine arbitration). completed follows return_approved.",
4
- "tags": ["machine", "rental", "workflow", "nodes", "permission_index", "r-m1-11"],
5
- "industry": "rental",
6
- "operation_type": "machine",
7
- "source": "ziroom testnet deployment 2026-07-29 (repaired to current schema + R-M1-11)",
8
- "verified": true,
9
- "network": "testnet",
10
- "call": {
11
- "tool": "onchain_operations",
12
- "operation_type": "machine",
13
- "data": {
14
- "object": {
15
- "name": "ziroom_machine_v1",
16
- "tags": ["rental", "machine"],
17
- "replaceExistName": true,
18
- "permission": "ziroom_permission_v1"
19
- },
20
- "node": {
21
- "op": "add",
22
- "bReplace": true,
23
- "nodes": [
24
- {
25
- "name": "reserved",
26
- "pairs": [
27
- {
28
- "prev_node": "",
29
- "threshold": 1,
30
- "forwards": [
31
- { "name": "Reserve", "weight": 1, "namedOperator": "" }
32
- ]
33
- }
34
- ]
35
- },
36
- {
37
- "name": "paid_deposit",
38
- "pairs": [
39
- {
40
- "prev_node": "reserved",
41
- "threshold": 1,
42
- "forwards": [
43
- { "name": "Pay Deposit", "weight": 1, "namedOperator": "" }
44
- ]
45
- }
46
- ]
47
- },
48
- {
49
- "name": "in_use",
50
- "pairs": [
51
- {
52
- "prev_node": "paid_deposit",
53
- "threshold": 1,
54
- "forwards": [
55
- { "name": "Handover", "weight": 1, "permissionIndex": 1000 }
56
- ]
57
- }
58
- ]
59
- },
60
- {
61
- "name": "returned",
62
- "pairs": [
63
- {
64
- "prev_node": "in_use",
65
- "threshold": 1,
66
- "forwards": [
67
- { "name": "Return Keys", "weight": 1, "namedOperator": "" }
68
- ]
69
- }
70
- ]
71
- },
72
- {
73
- "name": "inspected",
74
- "pairs": [
75
- {
76
- "prev_node": "returned",
77
- "threshold": 1,
78
- "forwards": [
79
- { "name": "Inspect", "weight": 1, "permissionIndex": 1001 }
80
- ]
81
- }
82
- ]
83
- },
84
- {
85
- "name": "return_approved",
86
- "pairs": [
87
- {
88
- "prev_node": "inspected",
89
- "threshold": 1,
90
- "forwards": [
91
- { "name": "Approve Refund", "weight": 1, "permissionIndex": 1002 }
92
- ]
93
- }
94
- ]
95
- },
96
- {
97
- "name": "damage_confirmed",
98
- "pairs": [
99
- {
100
- "prev_node": "inspected",
101
- "threshold": 1,
102
- "forwards": [
103
- { "name": "Confirm Damage", "weight": 1, "permissionIndex": 1001 }
104
- ]
105
- }
106
- ]
107
- },
108
- {
109
- "name": "arbiter_rule",
110
- "pairs": [
111
- {
112
- "prev_node": "inspected",
113
- "threshold": 1,
114
- "forwards": [
115
- { "name": "Escalate Arbitration", "weight": 1, "permissionIndex": 1500 }
116
- ]
117
- }
118
- ]
119
- },
120
- {
121
- "name": "completed",
122
- "pairs": [
123
- {
124
- "prev_node": "return_approved",
125
- "threshold": 1,
126
- "forwards": [
127
- { "name": "Complete", "weight": 1, "permissionIndex": 1000 }
128
- ]
129
- }
130
- ]
131
- }
132
- ]
133
- }
134
- },
135
- "env": {
136
- "network": "testnet",
137
- "no_cache": true
138
- }
139
- },
140
- "notes": [
141
- "R-M1-11: return_approved / damage_confirmed / arbiter_rule are ROUTING nodes. Fund movement (deposit refund / deduction) MUST be executed by Allocators (Service.order_allocators) whose Guards check progress.current == <routing node>. Never name nodes 'deposit_refunded'/'deposit_deducted'/'refunded' — Machines have no fund movement primitive; misnamed nodes leave funds locked in the Order escrow.",
142
- "The three branches from 'inspected' are competing pairs (each threshold=1): the first forward executed wins and the other branches are abandoned for this session.",
143
- "Forwards describe INCOMING transitions: a forward in a node's pair (prev_node='X') advances Progress FROM X INTO this node.",
144
- "permission lives INSIDE 'object' (NamedObjectWithPermissionSchema) — it references existing Permission 'ziroom_permission_v1' by LocalMark name.",
145
- "namedOperator='' means OrderHolder (customer), NOT 'anyone'. permissionIndex maps to Permission table entries (1000=operator, 1001=inspector, 1002=finance, 1500=arbiter).",
146
- "Machine nodes are immutable after publish — create a new Machine to change the workflow."
147
- ]
148
- }
@@ -1,41 +0,0 @@
1
- {
2
- "title": "Create Permission with Role-Based Indexes (Ziroom Rental)",
3
- "description": "Single Permission with indexes: 1000=operator, 1001=inspector, 1002=finance, 1500=arbiter",
4
- "tags": ["permission", "rental", "role", "index"],
5
- "industry": "rental",
6
- "operation_type": "permission",
7
- "source": "ziroom testnet deployment 2026-07-29 (repaired to current schema)",
8
- "verified": true,
9
- "network": "testnet",
10
- "call": {
11
- "tool": "onchain_operations",
12
- "operation_type": "permission",
13
- "data": {
14
- "object": {
15
- "name": "ziroom_permission_v1",
16
- "tags": ["project:ziroom", "type:permission"],
17
- "replaceExistName": true
18
- },
19
- "table": {
20
- "op": "add perm by index",
21
- "index": 1000,
22
- "entity": {
23
- "entities": [
24
- { "name_or_address": "ziroom_operator" }
25
- ],
26
- "check_all_founded": false
27
- }
28
- }
29
- },
30
- "env": {
31
- "network": "testnet",
32
- "no_cache": true
33
- }
34
- },
35
- "notes": [
36
- "Custom indexes range 1000-65535 (0-999 are protocol-reserved)",
37
- "Single Permission recommended for centralized control across all objects",
38
- "Use 'add perm by index' to grant one permission to many entities",
39
- "entity is ManyAccountOrMark_AddressSchema OBJECT form {entities: [{name_or_address}], check_all_founded?} — NOT a bare array (schema drift repair 2026-07-30: the 2026-07-29 deployment used the legacy array form; current schema requires the object wrapper). Recipient shown as the operator's local mark name; the original deployment used raw 0x addresses (desensitized)."
40
- ]
41
- }
@@ -1,36 +0,0 @@
1
- {
2
- "title": "Create Rental Service DRAFT (Ziroom)",
3
- "description": "Step 3 of the 12-step deploy plan: create the Ziroom rental Service object in DRAFT (unpublished) with only its identity — name, permission, payment token type, description, and location. Machine binding, buy_guard, sales (WIP), order_allocators, Contact (um), and publish are each separate later steps and are intentionally NOT bundled here.",
4
- "tags": ["service", "rental", "draft", "create", "12-step"],
5
- "industry": "rental",
6
- "operation_type": "service",
7
- "source": "ziroom testnet deployment 2026-07-29 — adapted to the 12-step plan (DRAFT only, schema-validated, not chain-verified)",
8
- "verified": false,
9
- "network": "testnet",
10
- "call": {
11
- "tool": "onchain_operations",
12
- "operation_type": "service",
13
- "data": {
14
- "object": {
15
- "name": "ziroom_service_v1",
16
- "tags": ["project:ziroom", "type:service"],
17
- "replaceExistName": true,
18
- "permission": "ziroom_permission_v1",
19
- "type_parameter": "0x2::wow::WOW"
20
- },
21
- "description": "Ziroom apartment rental service",
22
- "location": "Beijing"
23
- },
24
- "env": {
25
- "network": "testnet",
26
- "no_cache": true
27
- }
28
- },
29
- "notes": [
30
- "12-STEP PLAN alignment: this file is ONE step (Step 3 Service DRAFT). The full order is Account → Permission → Service DRAFT → Machine → Guard → Machine publish → Sales(WIP) → Treasury(optional) → order_allocators → Contact(um) → Arbitration → Service publish. Do NOT bundle machine/buy_guard/um/sales/order_allocators into the create call.",
31
- "object uses the OBJECT form of TypeNamedObjectWithPermissionSchema: name/permission/type_parameter go INSIDE object; description and location are top-level Service fields. No publish:true here — the Service stays unpublished until Step 12.",
32
- "Rental is a PHYSICAL-goods scenario and SHOULD declare customer_required (name/phone/shipping_address/id_number for deposit-backed rental). Per the SDK-enforced HARD LINKAGE, customer_required must be set TOGETHER with a Contact bound as um — the buyer's private info is delivered only through the Contact's end-to-end encrypted Messenger. Therefore customer_required is NOT set in this DRAFT; it is set together with um in the Contact step (create the Contact, then bind um + customer_required in one update).",
33
- "permission references the pre-created ziroom_permission_v1 (Step 2); type_parameter '0x2::wow::WOW' sets the payment token (WOW, 9 decimals).",
34
- "machine, order_allocators, and arbitrations become immutable after publish — set them in their own pre-publish steps, not here."
35
- ]
36
- }
@@ -1,80 +0,0 @@
1
- {
2
- "title": "Guard: Complete Multi-Condition Pattern (progress node + Signer==order.owner + order.service) — Customer-Win Allocator",
3
- "description": "The 'complete pattern' allocation Guard: logic_and of (1) order at a customer-win node (Lost / Return Complete) via progress.current with convert_witness OrderProgress, (2) Level-2 dynamic identity binding Signer == query(order.owner), and (3) cross-service-theft prevention query(order.service) == this Service. Used as a Service order_allocators guard whose sharing.who is {Signer:'signer'} — the Signer binding is what makes Signer-recipient allocation safe (R-C3-06).",
4
- "tags": ["guard", "allocation", "multi-condition", "logic_and", "level2-dynamic-binding", "retail"],
5
- "industry": "retail",
6
- "operation_type": "guard",
7
- "source": "docs/examples/MyShop_Advanced — schema-validated, not chain-verified",
8
- "verified": false,
9
- "network": "testnet",
10
- "call": {
11
- "tool": "onchain_operations",
12
- "operation_type": "guard",
13
- "data": {
14
- "namedNew": {
15
- "name": "service_customer_win_v2",
16
- "tags": ["order", "customer-win", "level2-dynamic-binding"],
17
- "replaceExistName": true
18
- },
19
- "description": "Verify order at customer win nodes (Lost, Return Complete) AND signer is the order owner AND order belongs to three_body_signature_service_v2. VERIFIER CONSTRAINT LEVEL 2 (dynamic identity binding): Signer bound to query('order.owner') — only the order's rightful owner can trigger the refund. Three-fold verification: (1) order at customer win node, (2) signer is order.owner (dynamic query, prevents fund theft), (3) order belongs to this service (prevents cross-service theft, R-C3-05).",
20
- "table": [
21
- { "identifier": 0, "b_submission": true, "value_type": "Address", "name": "order_id" },
22
- { "identifier": 1, "b_submission": false, "value_type": "String", "value": "Lost" },
23
- { "identifier": 2, "b_submission": false, "value_type": "String", "value": "Return Complete" },
24
- { "identifier": 3, "b_submission": false, "value_type": "Address", "name": "service_address", "value": "three_body_signature_service_v2" }
25
- ],
26
- "root": {
27
- "type": "logic_and",
28
- "nodes": [
29
- {
30
- "type": "logic_or",
31
- "nodes": [
32
- {
33
- "type": "logic_string_nocase_equal",
34
- "nodes": [
35
- { "type": "query", "query": "progress.current", "object": { "identifier": 0, "convert_witness": "OrderProgress" }, "parameters": [] },
36
- { "type": "identifier", "identifier": 1 }
37
- ]
38
- },
39
- {
40
- "type": "logic_string_nocase_equal",
41
- "nodes": [
42
- { "type": "query", "query": "progress.current", "object": { "identifier": 0, "convert_witness": "OrderProgress" }, "parameters": [] },
43
- { "type": "identifier", "identifier": 2 }
44
- ]
45
- }
46
- ]
47
- },
48
- {
49
- "type": "logic_equal",
50
- "nodes": [
51
- { "type": "query", "query": "order.owner", "object": { "identifier": 0 }, "parameters": [] },
52
- { "type": "context", "context": "Signer" }
53
- ]
54
- },
55
- {
56
- "type": "logic_equal",
57
- "nodes": [
58
- { "type": "query", "query": "order.service", "object": { "identifier": 0 }, "parameters": [] },
59
- { "type": "identifier", "identifier": 3 }
60
- ]
61
- }
62
- ]
63
- }
64
- },
65
- "env": {
66
- "network": "testnet",
67
- "no_cache": true
68
- }
69
- },
70
- "notes": [
71
- "COMPLETE PATTERN (BUG-01): root = logic_and of [node-set check via logic_or(logic_string_nocase_equal x2) on progress.current, Signer==order.owner, order.service==service]. All three conditions must pass; logic_and accepts 2-8 children (this uses 3).",
72
- "Schema-verified: CallGuard_DataSchema (guard.ts) — creation uses namedNew (NOT 'object'); table items use GuardTableItemBaseSchema (common/index.ts) which REJECTS the output-only object_type field; root validated against GuardNodeSchema (query/index.ts) and must return Bool — logic_and is in the allowed root-type list.",
73
- "Query names verified against knowledge/guard-templates.ts: progress.current (id 1253, String), order.owner (id 1562, Address), order.service (id 1563, Address). convert_witness 'OrderProgress' (id 100) is a valid WitnessTypeSchema string — the Order address submitted at runtime is converted to its Progress object before querying the current node.",
74
- "Why the Signer binding matters: the paired allocator uses sharing.who = {Signer:'signer'} (funds go to the caller). Condition 2 binds the caller to query(order.owner), so only the customer who placed the order can receive the refund — without it anyone could steal 100% of the allocation (R-C3-06).",
75
- "Shorthand variant (not used here): the logic_or of two logic_string_nocase_equal can collapse into one VecString constant + vec_contains_string_nocase — semantically equivalent per guard-examples-lint.spec.ts 'Semantic Equivalence' tests. Original form kept for clarity of the complete pattern.",
76
- "Prerequisites: the Service 'three_body_signature_service_v2' must already exist (created unpublished) so the identifier-3 name resolves at transaction build time. Guard is IMMUTABLE after creation.",
77
- "Desensitization: doc ran on mainnet with local-mark account myshop_merchant — network switched to testnet and account omitted (use your own default/local-mark account). Object names (service_customer_win_v2, three_body_signature_service_v2) are local marks, not real identities. No personal data or real 0x addresses present. replaceExistName:true kept from the doc's full-rerun convention — omit for one-off deployments.",
78
- "Runtime use: bound as Service order_allocators[].guard; the customer triggers allocation.alloc_by_guard with submission of identifier 0 = their Order address (see the doc Part 4 'Customer Wins' example)."
79
- ]
80
- }
@@ -1,65 +0,0 @@
1
- {
2
- "title": "Guard: Strict-Mode Privacy Delivery via Messenger Chain Proof (Signer==proof.signer + proof.time>order.time + order.service)",
3
- "description": "Machine forward Guard for privacy-preserving logistics: tracking numbers are exchanged via encrypted Messenger (off-chain); on-chain the verifier submits a Proof object address + the Order address. logic_and of (1) submitter accountability — context(Signer) == query(proof.signer), (2) freshness — query(proof.time) > query(order.time) via logic_as_u256_greater (prevents stale-proof replay), (3) project binding — query(order.service) == this Service (prevents cross-project bypass, R-C3-05).",
4
- "tags": ["guard", "machine-forward", "messenger", "proof", "privacy", "multi-condition", "retail"],
5
- "industry": "retail",
6
- "operation_type": "guard",
7
- "source": "docs/examples/MyShop_Advanced — schema-validated, not chain-verified",
8
- "verified": false,
9
- "network": "testnet",
10
- "call": {
11
- "tool": "onchain_operations",
12
- "operation_type": "guard",
13
- "data": {
14
- "namedNew": {
15
- "name": "machine_messenger_proof_v2",
16
- "replaceExistName": true
17
- },
18
- "description": "Strict-mode privacy delivery: verify Signer==proof.signer AND proof.time>order.time AND order.service==service (verifier submits Proof + Order object addresses)",
19
- "table": [
20
- { "identifier": 0, "b_submission": true, "value_type": "Address", "name": "proof_id" },
21
- { "identifier": 1, "b_submission": true, "value_type": "Address", "name": "order_id" },
22
- { "identifier": 2, "b_submission": false, "value_type": "Address", "name": "service_address", "value": "three_body_signature_service_v2" }
23
- ],
24
- "root": {
25
- "type": "logic_and",
26
- "nodes": [
27
- {
28
- "type": "logic_equal",
29
- "nodes": [
30
- { "type": "context", "context": "Signer" },
31
- { "type": "query", "query": "proof.signer", "object": { "identifier": 0 }, "parameters": [] }
32
- ]
33
- },
34
- {
35
- "type": "logic_as_u256_greater",
36
- "nodes": [
37
- { "type": "query", "query": "proof.time", "object": { "identifier": 0 }, "parameters": [] },
38
- { "type": "query", "query": "order.time", "object": { "identifier": 1 }, "parameters": [] }
39
- ]
40
- },
41
- {
42
- "type": "logic_equal",
43
- "nodes": [
44
- { "type": "query", "query": "order.service", "object": { "identifier": 1 }, "parameters": [] },
45
- { "type": "identifier", "identifier": 2 }
46
- ]
47
- }
48
- ]
49
- }
50
- },
51
- "env": {
52
- "network": "testnet",
53
- "no_cache": true
54
- }
55
- },
56
- "notes": [
57
- "Strict-mode alternative to the broad 'Merkle Root length == 66' Guard (machine_merkle_root_v2). Broad mode trusts submitter honesty; strict mode enforces WHO submitted (whoever benefits bears the burden of proof) without verifying message content on-chain.",
58
- "Schema-verified: CallGuard_DataSchema (guard.ts) — namedNew creation form; table items carry no object_type (output-only); root logic_and returns Bool (allowed root type). logic_as_u256_greater compares first node > all subsequent nodes, so proof.time is listed before order.time.",
59
- "Query names verified against knowledge/guard-templates.ts (tpl that uses proof.signer/proof.time/order.time): proof.signer (Proof object, Address), proof.time (U64, clock-derived, always > 0), order.time (U64), order.service (Address). context enum is exactly 'Signer' | 'Clock' | 'Guard'.",
60
- "Proof generation (provider side, off-chain SDK): messenger submitChainProof(env, peerAddress, description) — about_address = the customer, order id embedded in description; returns proofAddress which is later submitted as identifier 0.",
61
- "Runtime submission contract for the Machine forward: TWO Address identifiers — identifier 0 = Proof object address, identifier 1 = the Order object address. The same Guard can be reused across all forwards needing delivery proof (shipping, lost, returns) — choose broad vs strict mode BEFORE publishing the Machine (Forward.guard is immutable).",
62
- "Prerequisites: Service 'three_body_signature_service_v2' must exist (identifier 2 name resolves at build time). Guard is IMMUTABLE after creation.",
63
- "Desensitization: doc ran on mainnet as local-mark account myshop_merchant — network switched to testnet, account omitted. Table names shortened to proof_id/order_id for the 64-BCS-char name limit; all object references are local marks, no real addresses or personal data. replaceExistName:true kept from the doc's full-rerun convention."
64
- ]
65
- }
@@ -1,92 +0,0 @@
1
- {
2
- "title": "Guard: Reward Claim with Time Condition + Double-Claim Protection (5-condition logic_and)",
3
- "description": "Advanced reward-claim Guard for shipping-timeout compensation: logic_and of FIVE conditions — (1) order still at 'Shipping' node (progress.current via OrderProgress witness), (2) Signer == order.owner (only the customer can claim their own compensation), (3) order.service == this Service (anti cross-service theft), (4) elapsed time on current node >= 2 days via Clock - query(progress.current_time) >= 172800000, (5) logic_not(query_reward_record_exists) — the same order has not claimed before (double-claim protection keyed by store_from_id).",
4
- "tags": ["guard", "reward", "claim", "double-claim-protection", "time-lock", "multi-condition", "retail"],
5
- "industry": "retail",
6
- "operation_type": "guard",
7
- "source": "docs/examples/MyShop_Advanced — schema-validated, not chain-verified",
8
- "verified": false,
9
- "network": "testnet",
10
- "call": {
11
- "tool": "onchain_operations",
12
- "operation_type": "guard",
13
- "data": {
14
- "namedNew": {
15
- "name": "reward_shipping_timeout_v2",
16
- "replaceExistName": true
17
- },
18
- "description": "Verify order at Shipping node for timeout compensation: signer must be order owner, order belongs to this service, not claimed before, AND the order has been at the Shipping node for >= 2 days (Clock - progress.current_time >= 172800000 ms, progress submitted as Address identifier 4)",
19
- "table": [
20
- { "identifier": 0, "b_submission": true, "value_type": "Address", "name": "order_id" },
21
- { "identifier": 1, "b_submission": false, "value_type": "String", "value": "Shipping" },
22
- { "identifier": 2, "b_submission": false, "value_type": "Address", "value": "myshop_reward_v2", "name": "reward_object" },
23
- { "identifier": 3, "b_submission": false, "value_type": "Address", "value": "three_body_signature_service_v2", "name": "service_address" },
24
- { "identifier": 4, "b_submission": true, "value_type": "Address", "name": "progress_id" },
25
- { "identifier": 5, "b_submission": false, "value_type": "U64", "value": "172800000", "name": "timeout_ms" }
26
- ],
27
- "root": {
28
- "type": "logic_and",
29
- "nodes": [
30
- {
31
- "type": "logic_string_nocase_equal",
32
- "nodes": [
33
- { "type": "query", "query": "progress.current", "object": { "identifier": 0, "convert_witness": "OrderProgress" }, "parameters": [] },
34
- { "type": "identifier", "identifier": 1 }
35
- ]
36
- },
37
- {
38
- "type": "logic_equal",
39
- "nodes": [
40
- { "type": "query", "query": "order.owner", "object": { "identifier": 0 }, "parameters": [] },
41
- { "type": "context", "context": "Signer" }
42
- ]
43
- },
44
- {
45
- "type": "logic_equal",
46
- "nodes": [
47
- { "type": "query", "query": "order.service", "object": { "identifier": 0 }, "parameters": [] },
48
- { "type": "identifier", "identifier": 3 }
49
- ]
50
- },
51
- {
52
- "type": "logic_as_u256_greater_or_equal",
53
- "nodes": [
54
- {
55
- "type": "calc_number_subtract",
56
- "nodes": [
57
- { "type": "context", "context": "Clock" },
58
- { "type": "query", "query": "progress.current_time", "object": { "identifier": 4 }, "parameters": [] }
59
- ]
60
- },
61
- { "type": "identifier", "identifier": 5 }
62
- ]
63
- },
64
- {
65
- "type": "logic_not",
66
- "node": {
67
- "type": "query_reward_record_exists",
68
- "object": { "identifier": 2 },
69
- "where": {
70
- "storeFromId": { "identifier": 0 }
71
- }
72
- }
73
- }
74
- ]
75
- }
76
- },
77
- "env": {
78
- "network": "testnet",
79
- "no_cache": true
80
- }
81
- },
82
- "notes": [
83
- "Most complex Guard in the MyShop_Advanced doc: 5-condition logic_and (schema allows 2-8 children) combining node check + Level-2 dynamic Signer binding + service binding + secure time-lock + one-claim-per-order record check.",
84
- "Schema-verified: CallGuard_DataSchema (guard.ts) + GuardNodeSchema (query/index.ts). query_reward_record_exists node shape: {object:{identifier}, recipient?, where:{storeFromId:{identifier}}} — recipient omitted, so the transaction signer is matched; where.storeFromId points at identifier 0 (the order address) so one claim per ORDER, not per user.",
85
- "SECURE TIME-LOCK PATTERN: the start time is NEVER a caller-submitted U64 (a submitter could pass 0 and bypass the lock). The Progress object is submitted at runtime (identifier 4, Address) and its current-node entry timestamp is read on-chain via query progress.current_time (id 1272); only the threshold (identifier 5, 172800000 ms = 2 days) is a creation-time constant.",
86
- "Query names verified against knowledge/guard-templates.ts and guard-design-patterns.ts: progress.current (1253), order.owner (1562), order.service (1563), progress.current_time (1272). context enum: 'Clock' returns the on-chain timestamp (U64 ms).",
87
- "Claim submission contract: claiming via reward.claim requires TWO submissions — identifier 0 = Order address AND identifier 4 = the order's Progress object address. The SDK auto-appends an internal VecU8 table entry (next free identifier) for the reward-record query parameters — only business identifiers 0-5 are defined here.",
88
- "Prerequisites: Reward 'myshop_reward_v2' must exist EMPTY first (identifier 2 references it by name — circular-reference pattern: create Reward -> create this Guard -> reward.guard_add binds it with store_from_id: 0). Service must exist for identifier 3. Guard is IMMUTABLE after creation.",
89
- "Desensitization: doc ran on mainnet as myshop_merchant — network switched to testnet, account omitted; all references are local marks; no personal data or real 0x addresses. replaceExistName:true kept from the doc's full-rerun convention.",
90
- "Pair with: reward guard_add entry {guard: 'reward_shipping_timeout_v2', recipient: {Signer:'signer'}, amount: {type:'Fixed', value:'20000'}, store_from_id: 0} (see retail-adv-reward-guard-add example). Amount is a symbolic smallest-unit value (20000 = 0.00002 WOW at 9 decimals)."
91
- ]
92
- }