@wowok/agent-mcp 2.6.0 → 2.6.3
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.
- package/README.md +5 -3
- package/dist/customer/info-puzzle.d.ts +1 -1
- package/dist/customer/info-puzzle.js +4 -2
- package/dist/customer/risk-assessment.js +26 -4
- package/dist/customer/types.d.ts +2 -0
- package/dist/examples/guard-template-balance-check.json +38 -0
- package/dist/examples/guard-template-time-lock.json +39 -0
- package/dist/examples/machine-template-7node-rental.json +114 -0
- package/dist/examples/rental-ziroom-machine-create.json +137 -0
- package/dist/examples/rental-ziroom-permission-create.json +35 -0
- package/dist/examples/rental-ziroom-service-create.json +80 -0
- package/dist/examples/retail-myshop-service-create.json +88 -0
- package/dist/extensions/capability-manifest.d.ts +125 -0
- package/dist/extensions/capability-manifest.js +594 -0
- package/dist/extensions/constraint-registry.d.ts +24 -0
- package/dist/extensions/constraint-registry.js +196 -0
- package/dist/extensions/index.d.ts +12 -0
- package/dist/extensions/index.js +6 -0
- package/dist/extensions/metric-registry.d.ts +26 -0
- package/dist/extensions/metric-registry.js +257 -0
- package/dist/extensions/mode-evaluator.d.ts +15 -0
- package/dist/extensions/mode-evaluator.js +170 -0
- package/dist/extensions/modes.d.ts +2 -0
- package/dist/extensions/modes.js +493 -0
- package/dist/extensions/registry.d.ts +50 -0
- package/dist/extensions/registry.js +662 -0
- package/dist/extensions/types.d.ts +219 -0
- package/dist/extensions/types.js +1 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.d.ts +3 -0
- package/dist/knowledge/deployment-scanner.js +64 -3
- package/dist/knowledge/fund-layer.d.ts +72 -0
- package/dist/knowledge/fund-layer.js +420 -0
- package/dist/knowledge/guard-render.d.ts +57 -0
- package/dist/knowledge/guard-render.js +700 -0
- package/dist/knowledge/guard-risk.d.ts +13 -0
- package/dist/knowledge/guard-risk.js +57 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
- package/dist/knowledge/guard-submission-prompt.js +171 -0
- package/dist/knowledge/guard-templates.js +278 -0
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-render.d.ts +41 -0
- package/dist/knowledge/machine-render.js +565 -0
- package/dist/knowledge/machine-templates.js +24 -5
- package/dist/knowledge/reward-confirm.js +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.js +9 -9
- package/dist/knowledge/reward-templates.js +2 -2
- package/dist/knowledge/service-confirm.d.ts +15 -6
- package/dist/knowledge/service-confirm.js +119 -11
- package/dist/knowledge/service-context.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-risk.d.ts +1 -1
- package/dist/knowledge/service-risk.js +3 -3
- package/dist/knowledge/service-templates.js +2 -2
- package/dist/knowledge/service-translation.d.ts +1 -1
- package/dist/knowledge/service-translation.js +7 -7
- package/dist/knowledge/tool-constraints.js +6 -2
- package/dist/project/deployment-bridge.d.ts +1 -1
- package/dist/project/deployment-bridge.js +31 -7
- package/dist/project/deployment-doc.d.ts +3 -0
- package/dist/project/deployment-doc.js +76 -14
- package/dist/project/edit-planner.d.ts +123 -0
- package/dist/project/edit-planner.js +1371 -0
- package/dist/project/evaluation.d.ts +2 -0
- package/dist/project/evaluation.js +873 -88
- package/dist/project/graph-builder.d.ts +4 -1
- package/dist/project/graph-builder.js +132 -62
- package/dist/project/graph.d.ts +1 -0
- package/dist/project/handlers.d.ts +317 -6
- package/dist/project/handlers.js +1171 -19
- package/dist/project/stage-gate.d.ts +4 -0
- package/dist/project/stage-gate.js +64 -5
- package/dist/project/task-tracker.d.ts +26 -0
- package/dist/project/task-tracker.js +78 -0
- package/dist/safety/preview.js +16 -0
- package/dist/schema/call/allocation.d.ts +16 -16
- package/dist/schema/call/allocation.js +2 -2
- package/dist/schema/call/arbitration.js +19 -6
- package/dist/schema/call/base.d.ts +21 -13
- package/dist/schema/call/base.js +27 -6
- package/dist/schema/call/bridge.d.ts +5 -5
- package/dist/schema/call/bridge.js +3 -1
- package/dist/schema/call/contact.js +2 -2
- package/dist/schema/call/demand.d.ts +23 -31
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.js +2 -2
- package/dist/schema/call/machine.d.ts +1976 -752
- package/dist/schema/call/machine.js +50 -4
- package/dist/schema/call/order.d.ts +149 -228
- package/dist/schema/call/order.js +4 -3
- package/dist/schema/call/payment.d.ts +183 -3
- package/dist/schema/call/payment.js +21 -3
- package/dist/schema/call/permission.js +2 -2
- package/dist/schema/call/personal.d.ts +241 -52
- package/dist/schema/call/progress.d.ts +53 -61
- package/dist/schema/call/progress.js +18 -4
- package/dist/schema/call/repository.d.ts +23 -31
- package/dist/schema/call/repository.js +2 -2
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.d.ts +1 -1
- package/dist/schema/call/semantic.js +37 -2
- package/dist/schema/call/service.d.ts +275 -127
- package/dist/schema/call/service.js +89 -13
- package/dist/schema/call/treasury.js +3 -3
- package/dist/schema/common/index.d.ts +13 -2
- package/dist/schema/common/index.js +80 -15
- package/dist/schema/local/index.d.ts +32 -35
- package/dist/schema/local/index.js +28 -6
- package/dist/schema/messenger/index.d.ts +274 -46
- package/dist/schema/operations.d.ts +1264 -544
- package/dist/schema/operations.js +65 -7
- package/dist/schema/project/index.d.ts +2846 -167
- package/dist/schema/project/index.js +570 -16
- package/dist/schema/query/index.d.ts +922 -349
- package/dist/schema/query/index.js +205 -42
- package/dist/schema/schema-query/index.d.ts +65 -3
- package/dist/schema/schema-query/index.js +38 -5
- package/dist/schema/utils/node-parser.js +20 -4
- package/dist/schema/utils/object-type-utils.d.ts +12 -0
- package/dist/schema/utils/object-type-utils.js +35 -0
- package/dist/schema/utils/permission-machine-check.d.ts +49 -0
- package/dist/schema/utils/permission-machine-check.js +121 -0
- package/dist/schema/utils/skills-recommendation.d.ts +2 -0
- package/dist/schema/utils/skills-recommendation.js +76 -0
- package/dist/schema-query/index.d.ts +20 -1
- package/dist/schema-query/index.js +306 -4
- package/dist/schemas/account_operation.output.json +7 -1
- package/dist/schemas/account_operation.schema.json +3 -3
- package/dist/schemas/bridge_operation.output.json +6 -0
- package/dist/schemas/bridge_operation.schema.json +1 -1
- package/dist/schemas/guard-templates.json +379 -0
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/local_info_operation.output.json +6 -0
- package/dist/schemas/local_mark_operation.output.json +7 -1
- package/dist/schemas/local_mark_operation.schema.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.schema.json +4 -4
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +2820 -0
- package/dist/schemas/onchain_operations.schema.json +444 -330
- package/dist/schemas/onchain_operations_allocation.schema.json +37 -28
- package/dist/schemas/onchain_operations_arbitration.schema.json +16 -14
- package/dist/schemas/onchain_operations_contact.schema.json +10 -10
- package/dist/schemas/onchain_operations_demand.schema.json +10 -10
- package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -16
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +2 -2
- package/dist/schemas/onchain_operations_machine.schema.json +43 -35
- package/dist/schemas/onchain_operations_order.schema.json +72 -78
- package/dist/schemas/onchain_operations_payment.schema.json +141 -111
- package/dist/schemas/onchain_operations_permission.schema.json +3 -3
- package/dist/schemas/onchain_operations_personal.schema.json +7 -7
- package/dist/schemas/onchain_operations_progress.schema.json +9 -9
- package/dist/schemas/onchain_operations_proof.schema.json +8 -8
- package/dist/schemas/onchain_operations_repository.schema.json +10 -10
- package/dist/schemas/onchain_operations_reward.schema.json +14 -14
- package/dist/schemas/onchain_operations_service.schema.json +119 -48
- package/dist/schemas/onchain_operations_treasury.schema.json +11 -11
- package/dist/schemas/onchain_table_data.output.json +33 -25
- package/dist/schemas/onchain_table_data.schema.json +22 -21
- package/dist/schemas/project_operation.output.json +2194 -23
- package/dist/schemas/project_operation.schema.json +84 -6
- package/dist/schemas/query_toolkit.output.json +108 -80
- package/dist/schemas/query_toolkit.schema.json +12 -12
- package/dist/schemas/schema_query.output.json +70 -3
- package/dist/schemas/schema_query.schema.json +18 -3
- package/dist/schemas/wowok_buildin_info.output.json +81 -8
- package/dist/schemas/wowok_buildin_info.schema.json +46 -2
- package/dist/tools/handlers/local.js +20 -5
- package/dist/tools/handlers/onchain.js +594 -6
- package/dist/tools/handlers/project.js +76 -4
- package/dist/tools/handlers/query.js +27 -0
- package/dist/tools/handlers/schema-query.js +43 -1
- package/dist/tools/handlers/task-status.d.ts +170 -0
- package/dist/tools/handlers/task-status.js +55 -0
- package/dist/tools/handlers/wip.js +47 -1
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +387 -12
- package/dist/tools/retry.d.ts +8 -0
- package/dist/tools/retry.js +85 -0
- package/dist/tools/wip-deploy-assist.d.ts +28 -0
- package/dist/tools/wip-deploy-assist.js +278 -0
- package/package.json +2 -2
- package/dist/schemas/guard-node-examples.md +0 -199
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://wowok.net/schemas/guard-templates.json",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Guard creation templates for common validation patterns. Each template is a complete CallGuard_Data object that can be used as-is or customized. Use schema_query action='get_guard_templates' to retrieve these templates.",
|
|
5
|
+
"templates": [
|
|
6
|
+
{
|
|
7
|
+
"name": "signer_verification",
|
|
8
|
+
"title": "Signer Verification Guard",
|
|
9
|
+
"description": "Verifies that the transaction signer matches a specific address stored in the Guard table. Simplest possible Guard — use as a starting point.",
|
|
10
|
+
"use_case": "Only a specific account (e.g., the merchant) can perform an action. Common for Service buy_guard, Machine forward guard, Reward claim guard.",
|
|
11
|
+
"binding_hint": {
|
|
12
|
+
"action": "buy",
|
|
13
|
+
"host_object": "Service",
|
|
14
|
+
"binding_field": "buy_guard",
|
|
15
|
+
"rule_sentence": "Only the specified address can perform this action.",
|
|
16
|
+
"failure_conditions": ["Signer does not match the stored address."],
|
|
17
|
+
"circular_reference": false
|
|
18
|
+
},
|
|
19
|
+
"template": {
|
|
20
|
+
"namedNew": {
|
|
21
|
+
"name": "guard_signer_verification",
|
|
22
|
+
"replaceExistName": false
|
|
23
|
+
},
|
|
24
|
+
"description": "Verify signer matches the address stored at identifier 0 in the table.",
|
|
25
|
+
"table": [
|
|
26
|
+
{
|
|
27
|
+
"identifier": 0,
|
|
28
|
+
"b_submission": false,
|
|
29
|
+
"name": "allowed_address",
|
|
30
|
+
"value": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
31
|
+
"value_type": "Address"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"root": {
|
|
35
|
+
"type": "logic_equal",
|
|
36
|
+
"nodes": [
|
|
37
|
+
{ "type": "context", "context": "Signer" },
|
|
38
|
+
{ "type": "identifier", "identifier": 0 }
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"customization": {
|
|
43
|
+
"table[0].value": "Replace with the allowed address (0x + 64 hex chars).",
|
|
44
|
+
"namedNew.name": "Set a unique Guard name.",
|
|
45
|
+
"namedNew.replaceExistName": "Set true to overwrite an existing Guard with the same name."
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "progress_node_check",
|
|
50
|
+
"title": "Progress Node Check Guard",
|
|
51
|
+
"description": "Verifies that an Order's Progress is at a specific node. Uses convert_witness=100 (TypeOrderProgress) to access the submitted Order's Progress data.",
|
|
52
|
+
"use_case": "Allow an action only when the order is at a specific workflow node (e.g., 'Completed' for refunds, 'Delivered' for reward claims). Common for Allocation guard, Reward claim guard.",
|
|
53
|
+
"binding_hint": {
|
|
54
|
+
"action": "allocate",
|
|
55
|
+
"host_object": "Service",
|
|
56
|
+
"binding_field": "order_allocators",
|
|
57
|
+
"rule_sentence": "The order must be at the specified progress node.",
|
|
58
|
+
"failure_conditions": ["Order is not at the expected progress node."],
|
|
59
|
+
"circular_reference": false
|
|
60
|
+
},
|
|
61
|
+
"template": {
|
|
62
|
+
"namedNew": {
|
|
63
|
+
"name": "guard_progress_node_check",
|
|
64
|
+
"replaceExistName": false
|
|
65
|
+
},
|
|
66
|
+
"description": "Verify order progress is at the node name stored at identifier 1.",
|
|
67
|
+
"table": [
|
|
68
|
+
{
|
|
69
|
+
"identifier": 0,
|
|
70
|
+
"b_submission": true,
|
|
71
|
+
"name": "submitted_order",
|
|
72
|
+
"value_type": "Address"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"identifier": 1,
|
|
76
|
+
"b_submission": false,
|
|
77
|
+
"name": "expected_node_name",
|
|
78
|
+
"value": "Completed",
|
|
79
|
+
"value_type": "String"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"root": {
|
|
83
|
+
"type": "logic_equal",
|
|
84
|
+
"nodes": [
|
|
85
|
+
{
|
|
86
|
+
"type": "query",
|
|
87
|
+
"query": 1253,
|
|
88
|
+
"object": { "identifier": 0, "convert_witness": 100 },
|
|
89
|
+
"parameters": []
|
|
90
|
+
},
|
|
91
|
+
{ "type": "identifier", "identifier": 1 }
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"customization": {
|
|
96
|
+
"table[1].value": "Replace 'Completed' with the expected node name.",
|
|
97
|
+
"table[0].value_type": "Address — the submitted order address (b_submission=true).",
|
|
98
|
+
"namedNew.name": "Set a unique Guard name."
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "order_owner_verification",
|
|
103
|
+
"title": "Order Owner Verification Guard",
|
|
104
|
+
"description": "Verifies that the transaction signer is the owner of the submitted Order. Uses query=1562 (order.owner) to dynamically fetch the owner.",
|
|
105
|
+
"use_case": "Only the order owner can trigger a refund or claim. Prevents fund theft — even if someone else knows the order ID, they cannot claim funds.",
|
|
106
|
+
"binding_hint": {
|
|
107
|
+
"action": "allocate",
|
|
108
|
+
"host_object": "Service",
|
|
109
|
+
"binding_field": "order_allocators",
|
|
110
|
+
"rule_sentence": "Only the order owner can trigger this allocation.",
|
|
111
|
+
"failure_conditions": ["Signer is not the order owner."],
|
|
112
|
+
"circular_reference": false
|
|
113
|
+
},
|
|
114
|
+
"template": {
|
|
115
|
+
"namedNew": {
|
|
116
|
+
"name": "guard_order_owner_verification",
|
|
117
|
+
"replaceExistName": false
|
|
118
|
+
},
|
|
119
|
+
"description": "Verify signer is the owner of the submitted order (identifier 0).",
|
|
120
|
+
"table": [
|
|
121
|
+
{
|
|
122
|
+
"identifier": 0,
|
|
123
|
+
"b_submission": true,
|
|
124
|
+
"name": "submitted_order",
|
|
125
|
+
"value_type": "Address"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"root": {
|
|
129
|
+
"type": "logic_equal",
|
|
130
|
+
"nodes": [
|
|
131
|
+
{ "type": "context", "context": "Signer" },
|
|
132
|
+
{
|
|
133
|
+
"type": "query",
|
|
134
|
+
"query": 1562,
|
|
135
|
+
"object": { "identifier": 0 },
|
|
136
|
+
"parameters": []
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"customization": {
|
|
142
|
+
"namedNew.name": "Set a unique Guard name."
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "service_belonging_check",
|
|
147
|
+
"title": "Service Belonging Guard",
|
|
148
|
+
"description": "Verifies that the submitted Order belongs to a specific Service. Uses query=1563 (order.service) to dynamically fetch the service address.",
|
|
149
|
+
"use_case": "Prevents cross-service theft — even if an attacker has a valid order from a different service, they cannot claim funds from THIS service's allocation. Combine with order_owner_verification for full security.",
|
|
150
|
+
"binding_hint": {
|
|
151
|
+
"action": "allocate",
|
|
152
|
+
"host_object": "Service",
|
|
153
|
+
"binding_field": "order_allocators",
|
|
154
|
+
"rule_sentence": "The order must belong to this specific service.",
|
|
155
|
+
"failure_conditions": ["Order belongs to a different service."],
|
|
156
|
+
"circular_reference": false
|
|
157
|
+
},
|
|
158
|
+
"template": {
|
|
159
|
+
"namedNew": {
|
|
160
|
+
"name": "guard_service_belonging_check",
|
|
161
|
+
"replaceExistName": false
|
|
162
|
+
},
|
|
163
|
+
"description": "Verify the submitted order's service matches the address stored at identifier 1.",
|
|
164
|
+
"table": [
|
|
165
|
+
{
|
|
166
|
+
"identifier": 0,
|
|
167
|
+
"b_submission": true,
|
|
168
|
+
"name": "submitted_order",
|
|
169
|
+
"value_type": "Address"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"identifier": 1,
|
|
173
|
+
"b_submission": false,
|
|
174
|
+
"name": "this_service_address",
|
|
175
|
+
"value": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
176
|
+
"value_type": "Address"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"root": {
|
|
180
|
+
"type": "logic_equal",
|
|
181
|
+
"nodes": [
|
|
182
|
+
{
|
|
183
|
+
"type": "query",
|
|
184
|
+
"query": 1563,
|
|
185
|
+
"object": { "identifier": 0 },
|
|
186
|
+
"parameters": []
|
|
187
|
+
},
|
|
188
|
+
{ "type": "identifier", "identifier": 1 }
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"customization": {
|
|
193
|
+
"table[1].value": "Replace with THIS Service's address (0x + 64 hex chars).",
|
|
194
|
+
"namedNew.name": "Set a unique Guard name."
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "reward_not_claimed",
|
|
199
|
+
"title": "Reward Not Claimed Guard",
|
|
200
|
+
"description": "Verifies that a reward has NOT been claimed yet by the recipient. Uses query_reward_record_exists + logic_not to invert the result.",
|
|
201
|
+
"use_case": "Prevents double-claiming of rewards. Combined with progress_node_check and order_owner_verification for a complete reward guard.",
|
|
202
|
+
"binding_hint": {
|
|
203
|
+
"action": "claim_reward",
|
|
204
|
+
"host_object": "Reward",
|
|
205
|
+
"binding_field": "guard",
|
|
206
|
+
"rule_sentence": "The reward must not have been claimed yet by the recipient.",
|
|
207
|
+
"failure_conditions": ["Reward already claimed by this recipient."],
|
|
208
|
+
"circular_reference": false
|
|
209
|
+
},
|
|
210
|
+
"template": {
|
|
211
|
+
"namedNew": {
|
|
212
|
+
"name": "guard_reward_not_claimed",
|
|
213
|
+
"replaceExistName": false
|
|
214
|
+
},
|
|
215
|
+
"description": "Verify no reward record exists for the submitted recipient (identifier 1) on the submitted reward object (identifier 0).",
|
|
216
|
+
"table": [
|
|
217
|
+
{
|
|
218
|
+
"identifier": 0,
|
|
219
|
+
"b_submission": true,
|
|
220
|
+
"name": "submitted_reward_object",
|
|
221
|
+
"value_type": "Address"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"identifier": 1,
|
|
225
|
+
"b_submission": true,
|
|
226
|
+
"name": "submitted_recipient",
|
|
227
|
+
"value_type": "Address"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"root": {
|
|
231
|
+
"type": "logic_not",
|
|
232
|
+
"node": {
|
|
233
|
+
"type": "query_reward_record_exists",
|
|
234
|
+
"object": { "identifier": 0 },
|
|
235
|
+
"recipient": { "identifier": 1 },
|
|
236
|
+
"where": {}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"customization": {
|
|
241
|
+
"namedNew.name": "Set a unique Guard name."
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"name": "combined_reward_guard",
|
|
246
|
+
"title": "Combined Reward Guard (3 conditions)",
|
|
247
|
+
"description": "Complete Reward Guard combining: (1) order at expected progress node, (2) signer is order owner, (3) reward not claimed. Use logic_and to require ALL conditions.",
|
|
248
|
+
"use_case": "Production-ready Reward claim guard. Prevents fund theft, ensures workflow completion, prevents double-claiming.",
|
|
249
|
+
"binding_hint": {
|
|
250
|
+
"action": "claim_reward",
|
|
251
|
+
"host_object": "Reward",
|
|
252
|
+
"binding_field": "guard",
|
|
253
|
+
"rule_sentence": "Order must be at expected node, signer must be order owner, and reward must not be claimed.",
|
|
254
|
+
"failure_conditions": [
|
|
255
|
+
"Order is not at the expected progress node.",
|
|
256
|
+
"Signer is not the order owner.",
|
|
257
|
+
"Reward already claimed by this recipient."
|
|
258
|
+
],
|
|
259
|
+
"circular_reference": false
|
|
260
|
+
},
|
|
261
|
+
"template": {
|
|
262
|
+
"namedNew": {
|
|
263
|
+
"name": "guard_combined_reward",
|
|
264
|
+
"replaceExistName": false
|
|
265
|
+
},
|
|
266
|
+
"description": "Combined Reward Guard: progress node check + order owner verification + reward not claimed.",
|
|
267
|
+
"table": [
|
|
268
|
+
{
|
|
269
|
+
"identifier": 0,
|
|
270
|
+
"b_submission": true,
|
|
271
|
+
"name": "submitted_order",
|
|
272
|
+
"value_type": "Address"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"identifier": 1,
|
|
276
|
+
"b_submission": false,
|
|
277
|
+
"name": "expected_node_name",
|
|
278
|
+
"value": "Completed",
|
|
279
|
+
"value_type": "String"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"identifier": 2,
|
|
283
|
+
"b_submission": true,
|
|
284
|
+
"name": "submitted_reward_object",
|
|
285
|
+
"value_type": "Address"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"identifier": 3,
|
|
289
|
+
"b_submission": true,
|
|
290
|
+
"name": "submitted_recipient",
|
|
291
|
+
"value_type": "Address"
|
|
292
|
+
}
|
|
293
|
+
],
|
|
294
|
+
"root": {
|
|
295
|
+
"type": "logic_and",
|
|
296
|
+
"nodes": [
|
|
297
|
+
{
|
|
298
|
+
"type": "logic_equal",
|
|
299
|
+
"nodes": [
|
|
300
|
+
{
|
|
301
|
+
"type": "query",
|
|
302
|
+
"query": 1253,
|
|
303
|
+
"object": { "identifier": 0, "convert_witness": 100 },
|
|
304
|
+
"parameters": []
|
|
305
|
+
},
|
|
306
|
+
{ "type": "identifier", "identifier": 1 }
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"type": "logic_equal",
|
|
311
|
+
"nodes": [
|
|
312
|
+
{ "type": "context", "context": "Signer" },
|
|
313
|
+
{
|
|
314
|
+
"type": "query",
|
|
315
|
+
"query": 1562,
|
|
316
|
+
"object": { "identifier": 0 },
|
|
317
|
+
"parameters": []
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"type": "logic_not",
|
|
323
|
+
"node": {
|
|
324
|
+
"type": "query_reward_record_exists",
|
|
325
|
+
"object": { "identifier": 2 },
|
|
326
|
+
"recipient": { "identifier": 3 },
|
|
327
|
+
"where": {}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
"customization": {
|
|
334
|
+
"table[1].value": "Replace 'Completed' with the expected node name for your workflow.",
|
|
335
|
+
"namedNew.name": "Set a unique Guard name."
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
],
|
|
339
|
+
"query_reference": {
|
|
340
|
+
"description": "Common Guard query IDs. Use wowok_buildin_info with info='guard instructions' for the complete list.",
|
|
341
|
+
"queries": [
|
|
342
|
+
{ "id": 1253, "name": "order.progress.node", "returns": "String", "description": "Get current progress node name of an order", "witness": "TypeOrderProgress (100)" },
|
|
343
|
+
{ "id": 1562, "name": "order.owner", "returns": "Address", "description": "Get order owner address" },
|
|
344
|
+
{ "id": 1563, "name": "order.service", "returns": "Address", "description": "Get order service address" },
|
|
345
|
+
{ "id": 1564, "name": "order.payer", "returns": "Address", "description": "Get order payer address" }
|
|
346
|
+
],
|
|
347
|
+
"witness_types": [
|
|
348
|
+
{ "id": 100, "name": "TypeOrderProgress", "description": "Access order progress data" },
|
|
349
|
+
{ "id": 200, "name": "TypeOrder", "description": "Access order data" }
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
"node_return_types": {
|
|
353
|
+
"logic_bool": ["logic_and", "logic_or", "logic_not", "logic_equal", "logic_as_u256_equal", "logic_as_u256_greater", "logic_as_u256_lesser", "logic_as_u256_greater_or_equal", "logic_as_u256_lesser_or_equal", "logic_string_contains", "logic_string_nocase_contains", "logic_string_nocase_equal", "calc_string_contains", "calc_string_nocase_contains", "calc_string_nocase_equal", "vec_contains_bool", "vec_contains_address", "vec_contains_string", "vec_contains_string_nocase", "vec_contains_number", "query_reward_record_exists"],
|
|
354
|
+
"calc_numeric": ["calc_number_add", "calc_number_subtract", "calc_number_multiply", "calc_number_divide", "calc_number_mod"],
|
|
355
|
+
"calc_string": ["calc_string_length", "calc_string_indexof", "calc_string_nocase_indexof"],
|
|
356
|
+
"conversion": ["convert_number_address", "convert_address_number", "convert_number_string", "convert_string_number", "convert_safe_u8", "convert_safe_u16", "convert_safe_u32", "convert_safe_u64", "convert_safe_u128", "convert_safe_u256"],
|
|
357
|
+
"query": ["query (depends on query instruction)", "query_reward_record_find", "query_reward_record_count", "query_reward_record_exists", "query_progress_history_find", "query_progress_history_session_find", "query_progress_history_session_forward_find", "query_progress_history_session_count", "query_progress_history_session_forward_count", "query_progress_history_session_forward_retained_submission_count"],
|
|
358
|
+
"vector": ["vec_length", "vec_contains_bool", "vec_contains_address", "vec_contains_string", "vec_contains_string_nocase", "vec_contains_number"],
|
|
359
|
+
"context": ["Signer (Address)", "Clock (U64)", "Guard (Address)"]
|
|
360
|
+
},
|
|
361
|
+
"best_practices": [
|
|
362
|
+
"Root node MUST return Bool — always use a logic node (logic_and, logic_or, logic_not, logic_equal) as the root.",
|
|
363
|
+
"Use logic_and for multiple conditions — most common pattern for combining validations.",
|
|
364
|
+
"Check node return types: logic nodes expect Bool children; calculation nodes expect numeric children; comparison nodes expect matching types.",
|
|
365
|
+
"Use identifier references: store constants (addresses, strings, numbers) in the Guard table and reference them by identifier index.",
|
|
366
|
+
"Use convert_witness when querying object data: set convert_witness to the appropriate witness type (e.g., 100 for TypeOrderProgress) to access the data you need.",
|
|
367
|
+
"Handle optional fields in where clauses: only include fields you want to filter by; omitting a field means 'don't filter by this field'.",
|
|
368
|
+
"Guard is IMMUTABLE after creation — test your logic carefully before deploying. Use replaceExistName=true to replace with a corrected version.",
|
|
369
|
+
"COGNITIVE PRINCIPLE: Guard validation occurs BEFORE the operation. A Guard querying the SAME Progress object it operates on sees the PRE-transition value (source node), not the target node. For post-transition verification, bind the Guard to the Allocator instead."
|
|
370
|
+
],
|
|
371
|
+
"common_errors": [
|
|
372
|
+
"Type mismatch: comparing incompatible types (e.g., Address with String). Use conversion nodes to align types.",
|
|
373
|
+
"Missing identifier: referencing an identifier index that doesn't exist in the Guard table.",
|
|
374
|
+
"Wrong return type: using a non-Bool node as the root or as a child of a logic node.",
|
|
375
|
+
"Invalid query ID: using a query instruction ID that doesn't exist. Use wowok_buildin_info with info='guard instructions' for the complete list.",
|
|
376
|
+
"Missing convert_witness: querying object data without setting the appropriate witness type — the query returns empty/null.",
|
|
377
|
+
"Circular reference: Guard queries the state of the SAME object it validates, seeing pre-transition values instead of post-transition values."
|
|
378
|
+
]
|
|
379
|
+
}
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"testnet",
|
|
51
51
|
"mainnet"
|
|
52
52
|
],
|
|
53
|
-
"description": "Network entrypoint: Specifies which network the operation occurs on"
|
|
53
|
+
"description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
|
|
54
54
|
},
|
|
55
55
|
"referrer": {
|
|
56
56
|
"$ref": "#/definitions/guard2file/properties/env/properties/account",
|
package/dist/schemas/index.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "WoWok MCP Schema Index",
|
|
4
4
|
"description": "Index of all available JSON schemas for WoWok MCP tools",
|
|
5
|
-
"generatedAt": "2026-07-
|
|
5
|
+
"generatedAt": "2026-07-29T00:14:19.691Z",
|
|
6
6
|
"tools": [
|
|
7
7
|
{
|
|
8
8
|
"name": "onchain_operations",
|
|
@@ -60,6 +60,12 @@
|
|
|
60
60
|
"permission_denied",
|
|
61
61
|
"immutable_violation",
|
|
62
62
|
"network_error",
|
|
63
|
+
"rate_limit",
|
|
64
|
+
"gas_exceeded",
|
|
65
|
+
"bcs_error",
|
|
66
|
+
"signature_error",
|
|
67
|
+
"config_error",
|
|
68
|
+
"wip_verification_failed",
|
|
63
69
|
"unknown"
|
|
64
70
|
],
|
|
65
71
|
"description": "Error classification for programmatic recovery"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"address"
|
|
61
61
|
],
|
|
62
62
|
"additionalProperties": false,
|
|
63
|
-
"description": "LOCAL PRIVATE: Local mark data structure for storing address names and tags privately on your device. This data is NEVER published to the blockchain."
|
|
63
|
+
"description": "LOCAL PRIVATE: Local mark data structure for storing address names and tags privately on your device. This data is NEVER published to the blockchain. CROSS-NETWORK ISOLATION (DOC-02): LocalMark names are scoped per network — the same name 'my-service' can map to different addresses on testnet vs mainnet. When switching networks (e.g., testnet→mainnet deployment), re-create marks with the same names pointing to the new mainnet addresses. This enables name-based object references that work identically across networks without code changes."
|
|
64
64
|
},
|
|
65
65
|
"description": "List of added mark data"
|
|
66
66
|
},
|
|
@@ -104,6 +104,12 @@
|
|
|
104
104
|
"permission_denied",
|
|
105
105
|
"immutable_violation",
|
|
106
106
|
"network_error",
|
|
107
|
+
"rate_limit",
|
|
108
|
+
"gas_exceeded",
|
|
109
|
+
"bcs_error",
|
|
110
|
+
"signature_error",
|
|
111
|
+
"config_error",
|
|
112
|
+
"wip_verification_failed",
|
|
107
113
|
"unknown"
|
|
108
114
|
],
|
|
109
115
|
"description": "Error classification for programmatic recovery"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"address"
|
|
60
60
|
],
|
|
61
61
|
"additionalProperties": false,
|
|
62
|
-
"description": "LOCAL ONLY: Parameters for creating or updating a LOCAL mark. This data is stored privately on your device and will NEVER be published to the blockchain. For public on-chain marks, use the 'personal' tool instead. IMPORTANT: 'name' field is an OBJECT {value, replaceExistName?}, not a string."
|
|
62
|
+
"description": "LOCAL ONLY: Parameters for creating or updating a LOCAL mark. This data is stored privately on your device and will NEVER be published to the blockchain. For public on-chain marks, use the 'personal' tool instead. IMPORTANT: 'name' field is an OBJECT {value, replaceExistName?}, not a string. FIX-011 cross-network consistency: LocalMark names are scoped per network. When creating marks for the same logical object on different networks (e.g. testnet and mainnet), use the SAME name value to keep name-based references portable. Before creating a mark on mainnet, check if a mark with the same name already exists on testnet (via query_local with network='testnet') and replicate the same name on mainnet for consistency."
|
|
63
63
|
},
|
|
64
64
|
"minItems": 1,
|
|
65
65
|
"description": "Array of mark data to add (at least 1 item)"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"testnet",
|
|
51
51
|
"mainnet"
|
|
52
52
|
],
|
|
53
|
-
"description": "Network entrypoint: Specifies which network the operation occurs on"
|
|
53
|
+
"description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
|
|
54
54
|
},
|
|
55
55
|
"referrer": {
|
|
56
56
|
"$ref": "#/definitions/machineNode2file/properties/env/properties/account",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"to": {
|
|
83
83
|
"anyOf": [
|
|
84
84
|
{
|
|
85
|
-
"
|
|
86
|
-
"description": "Account name, address (0x...), or mark name. When using string format, local marks are searched first. EXAMPLE: 'alice' - searches local marks first, then global; EXAMPLE: '
|
|
85
|
+
"$ref": "#/definitions/messenger_operation/anyOf/1/properties/from",
|
|
86
|
+
"description": "Account name, address (0x...), or mark name. When using string format, local marks are searched first. EXAMPLE: 'alice' - searches local marks first, then global; EXAMPLE: '0x2...' (64 hex chars) - uses address directly; EXAMPLE: '' - uses the default local account"
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
"type": "object",
|
|
@@ -943,9 +943,9 @@
|
|
|
943
943
|
{
|
|
944
944
|
"type": "array",
|
|
945
945
|
"items": {
|
|
946
|
-
"
|
|
946
|
+
"$ref": "#/definitions/messenger_operation/anyOf/1/properties/from"
|
|
947
947
|
},
|
|
948
|
-
"description": "Array of account names, addresses, or mark names. Local marks are searched first for each entry"
|
|
948
|
+
"description": "Array of account names, addresses, or mark names. Local marks are searched first for each entry. EXAMPLE: ['alice', '0x2...', 'bob']"
|
|
949
949
|
},
|
|
950
950
|
{
|
|
951
951
|
"type": "object",
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
"number",
|
|
220
220
|
"string"
|
|
221
221
|
],
|
|
222
|
-
"description": "
|
|
222
|
+
"description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05SUI\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
225
|
"required": [
|