@wowok/agent-mcp 3.1.5 → 3.1.7

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 (156) hide show
  1. package/dist/evaluation/arbitration-game.js +1 -1
  2. package/dist/evaluation/builtins/graph-service.js +1 -1
  3. package/dist/graph/onchain/analyze.js +1 -1
  4. package/dist/graph/onchain/analyze.spec.js +1 -1
  5. package/dist/graph/onchain/extract.js +1 -1
  6. package/dist/graph/onchain/facts.d.ts +1 -0
  7. package/dist/graph/onchain/facts.js +1 -1
  8. package/dist/graph/onchain/fixtures.js +1 -1
  9. package/dist/graph/onchain/onchain.spec.js +1 -1
  10. package/dist/graph/onchain/strategy.js +1 -1
  11. package/dist/graph/onchain/strategy.spec.js +1 -1
  12. package/dist/harness/recover.js +1 -1
  13. package/dist/knowledge/alloc-audit-policy.spec.js +1 -1
  14. package/dist/knowledge/allocation-risk.js +1 -1
  15. package/dist/knowledge/arbitration-ledger.js +1 -1
  16. package/dist/knowledge/audit-rules.d.ts +1 -0
  17. package/dist/knowledge/audit-rules.js +1 -1
  18. package/dist/knowledge/baselines/rules/alloc_audit.json +20 -0
  19. package/dist/knowledge/baselines/rules/allocation.json +1 -19
  20. package/dist/knowledge/baselines/rules/arb.json +1 -1
  21. package/dist/knowledge/baselines/rules/guard.json +8 -8
  22. package/dist/knowledge/fund-layer.js +1 -1
  23. package/dist/knowledge/guard-design-patterns.d.ts +2 -1
  24. package/dist/knowledge/guard-design-patterns.js +1 -1
  25. package/dist/knowledge/guard-design-patterns.spec.d.ts +1 -0
  26. package/dist/knowledge/guard-design-patterns.spec.js +1 -0
  27. package/dist/knowledge/guard-lint.d.ts +1 -1
  28. package/dist/knowledge/guard-lint.js +1 -1
  29. package/dist/knowledge/guard-puzzle.js +1 -1
  30. package/dist/knowledge/guard-render.js +1 -1
  31. package/dist/knowledge/guard-risk.js +1 -1
  32. package/dist/knowledge/guard-translation.js +1 -1
  33. package/dist/knowledge/index.js +1 -1
  34. package/dist/knowledge/industry-registry.js +1 -1
  35. package/dist/knowledge/jsonrpc-enum.js +1 -1
  36. package/dist/knowledge/permission-ledger.js +1 -1
  37. package/dist/knowledge/recipient-constraint.js +1 -1
  38. package/dist/knowledge/safety-rules.extract-amount.spec.d.ts +1 -0
  39. package/dist/knowledge/safety-rules.extract-amount.spec.js +1 -0
  40. package/dist/knowledge/safety-rules.js +1 -1
  41. package/dist/knowledge/service-ledger.js +1 -1
  42. package/dist/knowledge/template-registry.js +1 -1
  43. package/dist/knowledge/template-scanner.js +1 -1
  44. package/dist/knowledge/tool-constraints.js +1 -1
  45. package/dist/knowledge/tools-reference.js +1 -1
  46. package/dist/knowledge/workflow-guidance.js +1 -1
  47. package/dist/monitor/MonitorLoop.js +1 -1
  48. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  49. package/dist/playbooks/service-build/pipeline-actions.d.ts +1 -1
  50. package/dist/playbooks/service-build/pipeline-actions.js +1 -1
  51. package/dist/playbooks/service-build/risk-aggregator.js +1 -1
  52. package/dist/role/derivation.d.ts +1 -1
  53. package/dist/role/derivation.js +1 -1
  54. package/dist/safety/confirm-gate.js +1 -1
  55. package/dist/schema/call/allocation.d.ts +7 -0
  56. package/dist/schema/call/allocation.js +1 -1
  57. package/dist/schema/call/arbitration.d.ts +4 -0
  58. package/dist/schema/call/arbitration.js +1 -1
  59. package/dist/schema/call/base.d.ts +52 -0
  60. package/dist/schema/call/base.js +1 -1
  61. package/dist/schema/call/bridge.d.ts +27 -0
  62. package/dist/schema/call/contact.d.ts +4 -0
  63. package/dist/schema/call/demand.d.ts +4 -0
  64. package/dist/schema/call/error-codes.d.ts +1 -1
  65. package/dist/schema/call/error-codes.js +1 -1
  66. package/dist/schema/call/guard.d.ts +12 -0
  67. package/dist/schema/call/handler.js +1 -1
  68. package/dist/schema/call/machine.d.ts +8 -0
  69. package/dist/schema/call/order.d.ts +4 -0
  70. package/dist/schema/call/order.js +1 -1
  71. package/dist/schema/call/payment.d.ts +4 -0
  72. package/dist/schema/call/permission.d.ts +4 -0
  73. package/dist/schema/call/personal.d.ts +4 -0
  74. package/dist/schema/call/progress.d.ts +4 -0
  75. package/dist/schema/call/proof.d.ts +8 -0
  76. package/dist/schema/call/repository.d.ts +4 -0
  77. package/dist/schema/call/repository.js +1 -1
  78. package/dist/schema/call/reward.d.ts +4 -0
  79. package/dist/schema/call/semantic-customer-advice.spec.js +1 -1
  80. package/dist/schema/call/semantic.d.ts +11 -0
  81. package/dist/schema/call/semantic.js +1 -1
  82. package/dist/schema/call/service.d.ts +14 -0
  83. package/dist/schema/call/service.js +1 -1
  84. package/dist/schema/call/treasury.d.ts +4 -0
  85. package/dist/schema/common/index.js +1 -1
  86. package/dist/schema/keeper/index.d.ts +5 -0
  87. package/dist/schema/local/index.d.ts +36 -0
  88. package/dist/schema/local/index.js +1 -1
  89. package/dist/schema/local/wip.d.ts +73 -0
  90. package/dist/schema/local/wip.js +1 -1
  91. package/dist/schema/messenger/index.d.ts +5 -0
  92. package/dist/schema/messenger/index.js +1 -1
  93. package/dist/schema/operations.d.ts +101 -0
  94. package/dist/schema/operations.js +1 -1
  95. package/dist/schema/query/bi.js +1 -1
  96. package/dist/schema/query/index.d.ts +19 -3
  97. package/dist/schema/query/index.js +1 -1
  98. package/dist/schema/schema-version.js +1 -1
  99. package/dist/schema/workflow/index.d.ts +2 -0
  100. package/dist/schema/workflow/index.js +1 -1
  101. package/dist/schema-query-impl/index.js +1 -1
  102. package/dist/schemas/account_operation.output.json +26 -1
  103. package/dist/schemas/bridge_operation.output.json +26 -1
  104. package/dist/schemas/bridge_operation.schema.json +40 -0
  105. package/dist/schemas/guard2file.schema.json +8 -0
  106. package/dist/schemas/index.json +1 -1
  107. package/dist/schemas/keeper_operation.output.json +24 -1
  108. package/dist/schemas/local_history_operation.output.json +26 -1
  109. package/dist/schemas/local_info_operation.output.json +26 -1
  110. package/dist/schemas/local_mark_operation.output.json +26 -1
  111. package/dist/schemas/machineNode2file.schema.json +8 -0
  112. package/dist/schemas/messenger_operation.output.json +24 -1
  113. package/dist/schemas/messenger_operation.schema.json +2 -2
  114. package/dist/schemas/monitor_events.output.json +24 -1
  115. package/dist/schemas/monitor_subscription.output.json +24 -1
  116. package/dist/schemas/onchain_events.output.json +24 -1
  117. package/dist/schemas/onchain_operations.output.json +74 -3
  118. package/dist/schemas/onchain_operations.schema.json +3286 -821
  119. package/dist/schemas/onchain_operations_allocation.schema.json +12 -0
  120. package/dist/schemas/onchain_operations_arbitration.schema.json +18 -10
  121. package/dist/schemas/onchain_operations_contact.schema.json +8 -0
  122. package/dist/schemas/onchain_operations_demand.schema.json +8 -0
  123. package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
  124. package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
  125. package/dist/schemas/onchain_operations_guard.schema.json +2896 -596
  126. package/dist/schemas/onchain_operations_machine.schema.json +8 -0
  127. package/dist/schemas/onchain_operations_order.schema.json +10 -2
  128. package/dist/schemas/onchain_operations_payment.schema.json +8 -0
  129. package/dist/schemas/onchain_operations_permission.schema.json +8 -0
  130. package/dist/schemas/onchain_operations_personal.schema.json +8 -0
  131. package/dist/schemas/onchain_operations_progress.schema.json +8 -0
  132. package/dist/schemas/onchain_operations_proof.schema.json +8 -0
  133. package/dist/schemas/onchain_operations_repository.schema.json +14 -6
  134. package/dist/schemas/onchain_operations_reward.schema.json +8 -0
  135. package/dist/schemas/onchain_operations_service.schema.json +43 -10
  136. package/dist/schemas/onchain_operations_treasury.schema.json +8 -0
  137. package/dist/schemas/onchain_table_data.output.json +35 -12
  138. package/dist/schemas/query_toolkit.output.json +1179 -10
  139. package/dist/schemas/query_toolkit.schema.json +11 -11
  140. package/dist/schemas/wip_file.output.json +221 -0
  141. package/dist/schemas/wip_file.schema.json +125 -0
  142. package/dist/schemas/workflow_operation.schema.json +8 -0
  143. package/dist/tools/handlers/config.js +1 -1
  144. package/dist/tools/handlers/dispatch-expectations.js +1 -1
  145. package/dist/tools/handlers/dispatch-expectations.spec.d.ts +1 -0
  146. package/dist/tools/handlers/dispatch-expectations.spec.js +1 -0
  147. package/dist/tools/handlers/onchain.js +1 -1
  148. package/dist/tools/handlers/wip-upload.d.ts +22 -0
  149. package/dist/tools/handlers/wip-upload.js +1 -0
  150. package/dist/tools/handlers/wip.js +1 -1
  151. package/dist/tools/handlers/workflow.js +1 -1
  152. package/dist/tools/index.js +1 -1
  153. package/dist/tools/move-fn-index.gen.js +1 -1
  154. package/dist/tools/registry/files.js +1 -1
  155. package/dist/tools/wip-deploy-assist.js +1 -1
  156. package/package.json +2 -2
@@ -965,7 +965,7 @@
965
965
  "mainnet",
966
966
  "localnet"
967
967
  ],
968
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
968
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
969
969
  }
970
970
  },
971
971
  "required": [
@@ -992,7 +992,7 @@
992
992
  "mainnet",
993
993
  "localnet"
994
994
  ],
995
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
995
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
996
996
  }
997
997
  },
998
998
  "required": [
@@ -1023,7 +1023,7 @@
1023
1023
  "mainnet",
1024
1024
  "localnet"
1025
1025
  ],
1026
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1026
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1027
1027
  }
1028
1028
  },
1029
1029
  "required": [
@@ -1050,7 +1050,7 @@
1050
1050
  "mainnet",
1051
1051
  "localnet"
1052
1052
  ],
1053
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1053
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1054
1054
  }
1055
1055
  },
1056
1056
  "required": [
@@ -1084,7 +1084,7 @@
1084
1084
  "mainnet",
1085
1085
  "localnet"
1086
1086
  ],
1087
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1087
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1088
1088
  },
1089
1089
  "context_depth": {
1090
1090
  "description": "BFS recursion depth for dependency expansion in assemble_context (default 0 = no expansion). When >0, the assembly recursively queries objects referenced by the center objects (permission, guard, machine, service, repositories, etc.) up to the given depth, using the same address-field extraction rules as extractAddressFields. Each level issues one batched query_objects call (≤50 IDs per batch). Cycles are detected and skipped via a visited set. Discovered dependencies are returned in `dependencies` (edge metadata) and `dependency_objects` (full object states). Recommended: 1–2 for most use cases; 3+ may pull large subgraphs (use context_include to constrain).",
@@ -1127,7 +1127,7 @@
1127
1127
  "mainnet",
1128
1128
  "localnet"
1129
1129
  ],
1130
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1130
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1131
1131
  },
1132
1132
  "reverse_order_amount": {
1133
1133
  "description": "Escrowed order amount (smallest-unit string) for reverse_map — included in the report summary as the concrete escrow mention.",
@@ -1224,7 +1224,7 @@
1224
1224
  "mainnet",
1225
1225
  "localnet"
1226
1226
  ],
1227
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1227
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1228
1228
  }
1229
1229
  },
1230
1230
  "required": [
@@ -1269,7 +1269,7 @@
1269
1269
  "mainnet",
1270
1270
  "localnet"
1271
1271
  ],
1272
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1272
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1273
1273
  }
1274
1274
  },
1275
1275
  "required": [
@@ -1314,7 +1314,7 @@
1314
1314
  "mainnet",
1315
1315
  "localnet"
1316
1316
  ],
1317
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1317
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1318
1318
  },
1319
1319
  "account": {
1320
1320
  "description": "Scope the aggregation to ONE account address (the client's current account). Omit to aggregate across ALL local accounts.",
@@ -1349,7 +1349,7 @@
1349
1349
  "mainnet",
1350
1350
  "localnet"
1351
1351
  ],
1352
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1352
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1353
1353
  },
1354
1354
  "account": {
1355
1355
  "description": "Scope to ONE account address (the client's current account). Omit to merge across ALL local accounts.",
@@ -1425,7 +1425,7 @@
1425
1425
  "mainnet",
1426
1426
  "localnet"
1427
1427
  ],
1428
- "description": "Network for the query. Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1428
+ "description": "Network for the query — equivalent to the `network` parameter (prefer `network`). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
1429
1429
  },
1430
1430
  "intent": {
1431
1431
  "description": "SEMANTIC exploration strategy (G3) — what this topology call is trying to establish. Deterministically shapes the edge whitelist, per-family depth caps and budget: full_map=complete structural map; order_health=order lifecycle+completion+disputes; fund_flow=payments+allocation waterfall+guard-gated splits; workflow=Machine node graphs+transitions+progress; counterparty=who is on the other side (buyer/seller/agents/operators); reputation=votes+arbitration record+contacts; permission=permission groups+bindings+entity tables; supply_chain=multi-leg allocation/sub-order settlement; arbitration=dispute cases+voters; demand_match=demand presenters+guards+rewards. When omitted, defaults come from the persona system (role default intents < account persona preference), then industry templates; every applied layer is reported in result.strategy.trace.",
@@ -119,6 +119,227 @@
119
119
  "type"
120
120
  ],
121
121
  "additionalProperties": false
122
+ },
123
+ {
124
+ "type": "object",
125
+ "properties": {
126
+ "type": {
127
+ "type": "string",
128
+ "const": "upload"
129
+ },
130
+ "storage": {
131
+ "type": "string"
132
+ },
133
+ "base_url": {
134
+ "type": "string",
135
+ "description": "Storage service base URL"
136
+ },
137
+ "address": {
138
+ "description": "Signing account address",
139
+ "type": "string"
140
+ },
141
+ "hash": {
142
+ "description": "Stored file hash (meta.hash)",
143
+ "type": "string"
144
+ },
145
+ "url": {
146
+ "description": "Public download URL",
147
+ "type": "string"
148
+ },
149
+ "size": {
150
+ "type": "number"
151
+ },
152
+ "name": {
153
+ "type": "string"
154
+ },
155
+ "signed": {
156
+ "description": "Whether the WIP file carries embedded signatures",
157
+ "type": "boolean"
158
+ },
159
+ "deduplicated": {
160
+ "description": "True when the same account had already stored this hash",
161
+ "type": "boolean"
162
+ },
163
+ "error": {
164
+ "description": "Error code (e.g. QUOTA_EXCEEDED when the store account file limit is reached)",
165
+ "type": "string"
166
+ },
167
+ "message": {
168
+ "type": "string"
169
+ },
170
+ "count": {
171
+ "description": "Files currently stored by the account",
172
+ "type": "number"
173
+ },
174
+ "limit": {
175
+ "description": "Per-account file limit on the storage service",
176
+ "type": "number"
177
+ },
178
+ "files": {
179
+ "description": "Current stored files (provided on QUOTA_EXCEEDED for deletion)",
180
+ "type": "array",
181
+ "items": {
182
+ "type": "object",
183
+ "properties": {
184
+ "hash": {
185
+ "type": "string",
186
+ "description": "WIP file hash (meta.hash)"
187
+ },
188
+ "name": {
189
+ "description": "Optional display name",
190
+ "type": "string"
191
+ },
192
+ "size": {
193
+ "description": "File size in bytes",
194
+ "type": "number"
195
+ },
196
+ "created_at": {
197
+ "description": "Upload time (ms epoch)",
198
+ "type": "number"
199
+ },
200
+ "url": {
201
+ "description": "Public download URL",
202
+ "type": "string"
203
+ }
204
+ },
205
+ "required": [
206
+ "hash"
207
+ ],
208
+ "additionalProperties": false,
209
+ "description": "A WIP file stored on a wip storage service"
210
+ }
211
+ },
212
+ "guidance": {
213
+ "description": "Actionable guidance (delete files or switch to self-hosted storage)",
214
+ "type": "string"
215
+ },
216
+ "network_advisory": {
217
+ "description": "Generic advisory for large, network-sensitive WIP files (size reduction, retry, reachability check)",
218
+ "type": "string"
219
+ },
220
+ "retention_notice": {
221
+ "description": "Free-store terms (storage='store' only): 6-month retention, best-effort/force-majeure disclaimer, no automatic deletion",
222
+ "type": "string"
223
+ }
224
+ },
225
+ "required": [
226
+ "type",
227
+ "storage",
228
+ "base_url"
229
+ ],
230
+ "additionalProperties": false
231
+ },
232
+ {
233
+ "type": "object",
234
+ "properties": {
235
+ "type": {
236
+ "type": "string",
237
+ "const": "storage_list"
238
+ },
239
+ "storage": {
240
+ "type": "string"
241
+ },
242
+ "base_url": {
243
+ "type": "string"
244
+ },
245
+ "address": {
246
+ "type": "string"
247
+ },
248
+ "count": {
249
+ "type": "number"
250
+ },
251
+ "limit": {
252
+ "type": "number"
253
+ },
254
+ "files": {
255
+ "type": "array",
256
+ "items": {
257
+ "type": "object",
258
+ "properties": {
259
+ "hash": {
260
+ "type": "string",
261
+ "description": "WIP file hash (meta.hash)"
262
+ },
263
+ "name": {
264
+ "description": "Optional display name",
265
+ "type": "string"
266
+ },
267
+ "size": {
268
+ "description": "File size in bytes",
269
+ "type": "number"
270
+ },
271
+ "created_at": {
272
+ "description": "Upload time (ms epoch)",
273
+ "type": "number"
274
+ },
275
+ "url": {
276
+ "description": "Public download URL",
277
+ "type": "string"
278
+ }
279
+ },
280
+ "required": [
281
+ "hash"
282
+ ],
283
+ "additionalProperties": false,
284
+ "description": "A WIP file stored on a wip storage service"
285
+ },
286
+ "description": "Stored WIP file list"
287
+ },
288
+ "error": {
289
+ "type": "string"
290
+ },
291
+ "message": {
292
+ "type": "string"
293
+ },
294
+ "retention_notice": {
295
+ "description": "Free-store terms (storage='store' only): 6-month retention, best-effort/force-majeure disclaimer, no automatic deletion",
296
+ "type": "string"
297
+ }
298
+ },
299
+ "required": [
300
+ "type",
301
+ "storage",
302
+ "base_url"
303
+ ],
304
+ "additionalProperties": false
305
+ },
306
+ {
307
+ "type": "object",
308
+ "properties": {
309
+ "type": {
310
+ "type": "string",
311
+ "const": "storage_delete"
312
+ },
313
+ "storage": {
314
+ "type": "string"
315
+ },
316
+ "base_url": {
317
+ "type": "string"
318
+ },
319
+ "address": {
320
+ "type": "string"
321
+ },
322
+ "deleted": {
323
+ "description": "Hash of the deleted file",
324
+ "type": "string"
325
+ },
326
+ "remaining": {
327
+ "description": "Files remaining for the account after deletion",
328
+ "type": "number"
329
+ },
330
+ "error": {
331
+ "type": "string"
332
+ },
333
+ "message": {
334
+ "type": "string"
335
+ }
336
+ },
337
+ "required": [
338
+ "type",
339
+ "storage",
340
+ "base_url"
341
+ ],
342
+ "additionalProperties": false
122
343
  }
123
344
  ],
124
345
  "description": "WIP operation output schema with discriminator"
@@ -169,6 +169,131 @@
169
169
  ],
170
170
  "additionalProperties": false,
171
171
  "description": "Convert WIP file to HTML format"
172
+ },
173
+ {
174
+ "type": "object",
175
+ "properties": {
176
+ "type": {
177
+ "type": "string",
178
+ "const": "upload"
179
+ },
180
+ "wipFilePath": {
181
+ "type": "string",
182
+ "description": "WIP file to upload. Supports: 1) Local file path, 2) Network URL, 3) Data URL"
183
+ },
184
+ "account": {
185
+ "description": "Account used to sign the upload (name or address). If omitted, uses the default account",
186
+ "type": "string"
187
+ },
188
+ "storage": {
189
+ "description": "Storage backend: 'store' = official free wip.store.wowok.net (zero setup, max 10 files per account, files retained 6 months — free best-effort service, force majeure excepted, expired files are purged only by manual admin action, never automatically); 'custom' = your own or a third-party wip storage service via customBaseUrl (recommended: no store quota, full control). Default: 'store'",
190
+ "anyOf": [
191
+ {
192
+ "type": "string",
193
+ "const": "store",
194
+ "description": "Official free wip.store.wowok.net storage (zero setup, max 10 files per account, files retained 6 months). Declaration: free best-effort service — availability and data survival are not guaranteed (force majeure excepted); expired files are deleted ONLY by a manual administrator purge, never automatically"
195
+ },
196
+ {
197
+ "type": "string",
198
+ "const": "custom",
199
+ "description": "Your own or a third-party wip storage service (recommended: no store quota, full control, permanent self-managed hosting)"
200
+ }
201
+ ]
202
+ },
203
+ "customBaseUrl": {
204
+ "description": "Base URL of your own or a third-party wip storage deployment (required when storage='custom'), e.g. 'https://wip.example.com'",
205
+ "type": "string"
206
+ },
207
+ "name": {
208
+ "description": "Optional display name recorded with the stored file",
209
+ "type": "string"
210
+ }
211
+ },
212
+ "required": [
213
+ "type",
214
+ "wipFilePath"
215
+ ],
216
+ "additionalProperties": false,
217
+ "description": "Upload a signed WIP file to a wip storage service. The upload request is signed with the account's Falcon512 key; the file is validated (format, size limits, content hash, signatures) and stored under its content hash with a public download URL. When the per-account file limit is reached, the error carries the account's stored file list for deletion. Large, image-heavy WIP files are network-sensitive: keep them small (compress images before generate) and retry on transient network failures. WIP files are off-chain and network-independent: the returned public URL works on both testnet and mainnet"
218
+ },
219
+ {
220
+ "type": "object",
221
+ "properties": {
222
+ "type": {
223
+ "type": "string",
224
+ "const": "storage_list"
225
+ },
226
+ "account": {
227
+ "description": "Account used to sign the request (name or address). If omitted, uses the default account",
228
+ "type": "string"
229
+ },
230
+ "storage": {
231
+ "description": "Storage backend (default 'store')",
232
+ "anyOf": [
233
+ {
234
+ "type": "string",
235
+ "const": "store",
236
+ "description": "Official free wip.store.wowok.net storage (zero setup, max 10 files per account, files retained 6 months). Declaration: free best-effort service — availability and data survival are not guaranteed (force majeure excepted); expired files are deleted ONLY by a manual administrator purge, never automatically"
237
+ },
238
+ {
239
+ "type": "string",
240
+ "const": "custom",
241
+ "description": "Your own or a third-party wip storage service (recommended: no store quota, full control, permanent self-managed hosting)"
242
+ }
243
+ ]
244
+ },
245
+ "customBaseUrl": {
246
+ "description": "Base URL of your own or a third-party wip storage deployment (required when storage='custom')",
247
+ "type": "string"
248
+ }
249
+ },
250
+ "required": [
251
+ "type"
252
+ ],
253
+ "additionalProperties": false,
254
+ "description": "List the WIP files an account currently stores on a wip storage service (signed request). Off-chain and network-independent: the account's stored files are identical on testnet and mainnet — no chain call is involved"
255
+ },
256
+ {
257
+ "type": "object",
258
+ "properties": {
259
+ "type": {
260
+ "type": "string",
261
+ "const": "storage_delete"
262
+ },
263
+ "hash": {
264
+ "type": "string",
265
+ "description": "Hash (meta.hash) of the WIP file to delete"
266
+ },
267
+ "account": {
268
+ "description": "Account used to sign the request (name or address). If omitted, uses the default account",
269
+ "type": "string"
270
+ },
271
+ "storage": {
272
+ "description": "Storage backend (default 'store')",
273
+ "anyOf": [
274
+ {
275
+ "type": "string",
276
+ "const": "store",
277
+ "description": "Official free wip.store.wowok.net storage (zero setup, max 10 files per account, files retained 6 months). Declaration: free best-effort service — availability and data survival are not guaranteed (force majeure excepted); expired files are deleted ONLY by a manual administrator purge, never automatically"
278
+ },
279
+ {
280
+ "type": "string",
281
+ "const": "custom",
282
+ "description": "Your own or a third-party wip storage service (recommended: no store quota, full control, permanent self-managed hosting)"
283
+ }
284
+ ]
285
+ },
286
+ "customBaseUrl": {
287
+ "description": "Base URL of your own or a third-party wip storage deployment (required when storage='custom')",
288
+ "type": "string"
289
+ }
290
+ },
291
+ "required": [
292
+ "type",
293
+ "hash"
294
+ ],
295
+ "additionalProperties": false,
296
+ "description": "Delete a stored WIP file from a wip storage service. Only files owned by the signing account can be deleted (signed request; off-chain, works identically on testnet and mainnet)"
172
297
  }
173
298
  ]
174
299
  }
@@ -619,6 +619,14 @@
619
619
  ],
620
620
  "additionalProperties": false
621
621
  },
622
+ "confirmed": {
623
+ "description": "Phase 2 ConfirmGate: set to true to proceed after a 'pending_confirmation' result (required when submitting guard submission data). The operation is NOT executed until you re-call with confirmed=true after user consent.",
624
+ "type": "boolean"
625
+ },
626
+ "dry_run": {
627
+ "description": "Phase 1 dry_run: when true, SIMULATE the transaction without signing or submitting. Returns effects + events showing what WOULD happen — no on-chain state is modified, no gas is charged. Use this to verify that a forward (especially a guarded one) will succeed before committing.",
628
+ "type": "boolean"
629
+ },
622
630
  "network": {
623
631
  "type": "string",
624
632
  "enum": [
@@ -1 +1 @@
1
- import{listServices,getServiceInfo,toggle as a420a,setEnabled as a420b,reset as a420c}from'../../config/index.js';import{judgmentStatus,setJudgmentOverride,clearJudgmentOverride,clearJudgmentOverrides,patchUserJudgmentDoc,readUserJudgmentDocView}from'../../config/judgment.js';import{strictParse}from'../../schema/index.js';import{ConfigOperationInputSchema}from'../../schema/config/index.js';export async function handleConfigOperation(a){const b=strictParse(ConfigOperationInputSchema,a,'config_operation\x20input'),{action:c,service:d,path:e,value:f}=b;let g;switch(c){case'list':g={'action':'list','services':listServices()};break;case'toggle':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20toggle');const h=d,i=getServiceInfo(h);if(!i)throw new Error('Unknown\x20service:\x20'+h+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');if(h==='confirm_gate'&&i['enabled'])throw new Error('confirm_gate\x20cannot\x20be\x20disabled\x20at\x20runtime.\x20'+'Set\x20WOWOK_CONFIRM_GATE=0\x20in\x20the\x20server\x20environment\x20and\x20restart\x20if\x20you\x20really\x20want\x20it\x20off.');const j=a420a(h);g={'action':'toggle','service':h,'enabled':j,'reminder':i['reminder']};break;}case'disable':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20disable');const k=d,l=getServiceInfo(k);if(!l)throw new Error('Unknown\x20service:\x20'+k+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');if(k==='confirm_gate')throw new Error('confirm_gate\x20cannot\x20be\x20disabled\x20at\x20runtime.\x20'+'Set\x20WOWOK_CONFIRM_GATE=0\x20in\x20the\x20server\x20environment\x20and\x20restart\x20if\x20you\x20really\x20want\x20it\x20off.');a420b(k,![]),g={'action':'disable','service':k,'enabled':![],'reminder':l['reminder']};break;}case'enable':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20enable');const m=d,n=getServiceInfo(m);if(!n)throw new Error('Unknown\x20service:\x20'+m+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a420b(m,!![]),g={'action':'enable','service':m,'enabled':!![],'reminder':n['reminder']};break;}case'reset':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20reset');const o=d,p=getServiceInfo(o);if(!p)throw new Error('Unknown\x20service:\x20'+o+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a420c(o),g={'action':'reset','service':o,'enabled':getServiceInfo(o)?.['enabled'],'reminder':p['reminder'],'reset':!![]};break;}case'info':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20info');const q=d,r=getServiceInfo(q);if(!r)throw new Error('Unknown\x20service:\x20'+q+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');g={'action':'info',...r};break;}case'judgment_list':g={'action':'judgment_list',...judgmentStatus()};break;case'judgment_set':{if(!e)throw new Error('\x27path\x27\x20param\x20is\x20required\x20for\x20judgment_set\x20(dotted,\x20e.g.\x20\x27evaluation.weights.trust_reviews\x27)');if(!('value'in b))throw new Error('\x27value\x27\x20param\x20is\x20required\x20for\x20judgment_set');const s=setJudgmentOverride(e,f);if(!s['ok'])throw new Error(s['error']);g={'action':'judgment_set','path':e,'value':f,'applied':!![]};break;}case'judgment_reset':{const t=e?clearJudgmentOverride(e)?0x1:0x0:clearJudgmentOverrides();g={'action':'judgment_reset',...e?{'path':e}:{},'cleared':t};break;}case'judgment_doc_read':{g={'action':'judgment_doc_read',...readUserJudgmentDocView()};break;}case'judgment_doc_patch':{if(!b['patch']||typeof b['patch']!=='object'||Array['isArray'](b['patch']))throw new Error('\x27patch\x27\x20param\x20is\x20required\x20for\x20judgment_doc_patch\x20(a\x20partial\x20judgment\x20document\x20object,\x20e.g.\x20{\x22evaluation\x22:\x20{\x22weights\x22:\x20{…}}})');g={'action':'judgment_doc_patch',...patchUserJudgmentDoc(b['patch'])};break;}default:throw new Error('Unknown\x20config_operation\x20action:\x20'+String(c));}return{'content':[{'type':'text','text':JSON['stringify']({'result':g})}],'structuredContent':{'result':g}};}
1
+ import{listServices,getServiceInfo,toggle as a422a,setEnabled as a422b,reset as a422c}from'../../config/index.js';import{judgmentStatus,setJudgmentOverride,clearJudgmentOverride,clearJudgmentOverrides,patchUserJudgmentDoc,readUserJudgmentDocView}from'../../config/judgment.js';import{strictParse}from'../../schema/index.js';import{ConfigOperationInputSchema}from'../../schema/config/index.js';export async function handleConfigOperation(a){const b=strictParse(ConfigOperationInputSchema,a,'config_operation\x20input'),{action:c,service:d,path:e,value:f}=b;let g;switch(c){case'list':g={'action':'list','services':listServices()};break;case'toggle':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20toggle');const h=d,i=getServiceInfo(h);if(!i)throw new Error('Unknown\x20service:\x20'+h+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');if(h==='confirm_gate'&&i['enabled'])throw new Error('confirm_gate\x20cannot\x20be\x20disabled\x20at\x20runtime.\x20'+'Set\x20WOWOK_CONFIRM_GATE=0\x20in\x20the\x20server\x20environment\x20and\x20restart\x20if\x20you\x20really\x20want\x20it\x20off.');const j=a422a(h);g={'action':'toggle','service':h,'enabled':j,'reminder':i['reminder']};break;}case'disable':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20disable');const k=d,l=getServiceInfo(k);if(!l)throw new Error('Unknown\x20service:\x20'+k+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');if(k==='confirm_gate')throw new Error('confirm_gate\x20cannot\x20be\x20disabled\x20at\x20runtime.\x20'+'Set\x20WOWOK_CONFIRM_GATE=0\x20in\x20the\x20server\x20environment\x20and\x20restart\x20if\x20you\x20really\x20want\x20it\x20off.');a422b(k,![]),g={'action':'disable','service':k,'enabled':![],'reminder':l['reminder']};break;}case'enable':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20enable');const m=d,n=getServiceInfo(m);if(!n)throw new Error('Unknown\x20service:\x20'+m+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a422b(m,!![]),g={'action':'enable','service':m,'enabled':!![],'reminder':n['reminder']};break;}case'reset':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20reset');const o=d,p=getServiceInfo(o);if(!p)throw new Error('Unknown\x20service:\x20'+o+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a422c(o),g={'action':'reset','service':o,'enabled':getServiceInfo(o)?.['enabled'],'reminder':p['reminder'],'reset':!![]};break;}case'info':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20info');const q=d,r=getServiceInfo(q);if(!r)throw new Error('Unknown\x20service:\x20'+q+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');g={'action':'info',...r};break;}case'judgment_list':g={'action':'judgment_list',...judgmentStatus()};break;case'judgment_set':{if(!e)throw new Error('\x27path\x27\x20param\x20is\x20required\x20for\x20judgment_set\x20(dotted,\x20e.g.\x20\x27evaluation.weights.trust_reviews\x27)');if(!('value'in b))throw new Error('\x27value\x27\x20param\x20is\x20required\x20for\x20judgment_set');const s=setJudgmentOverride(e,f);if(!s['ok'])throw new Error(s['error']);g={'action':'judgment_set','path':e,'value':f,'applied':!![]};break;}case'judgment_reset':{const t=e?clearJudgmentOverride(e)?0x1:0x0:clearJudgmentOverrides();g={'action':'judgment_reset',...e?{'path':e}:{},'cleared':t};break;}case'judgment_doc_read':{g={'action':'judgment_doc_read',...readUserJudgmentDocView()};break;}case'judgment_doc_patch':{if(!b['patch']||typeof b['patch']!=='object'||Array['isArray'](b['patch']))throw new Error('\x27patch\x27\x20param\x20is\x20required\x20for\x20judgment_doc_patch\x20(a\x20partial\x20judgment\x20document\x20object,\x20e.g.\x20{\x22evaluation\x22:\x20{\x22weights\x22:\x20{…}}})');g={'action':'judgment_doc_patch',...patchUserJudgmentDoc(b['patch'])};break;}default:throw new Error('Unknown\x20config_operation\x20action:\x20'+String(c));}return{'content':[{'type':'text','text':JSON['stringify']({'result':g})}],'structuredContent':{'result':g}};}
@@ -1 +1 @@
1
- import{referencesExistingObject}from'../../schema/call/semantic.js';export function declareDispatchExpectation(a,b){const c={'result_type':'transaction'};let d=a,e=![];switch(a){case'service':if(b?.['publish']===!![]||b?.['bPublished']===!![])c['semantic_modified']=[{'role':'Service','expect_fields':{'bPublished':!![]}}],c['state_transition']={'from':'unpublished','to':'published'},c['events']=[{'type':'ServiceEvent','expect_count':'>=1'}],d='publish\x20service',e=!![];else referencesExistingObject(b)?(c['semantic_modified']=[{'role':'Service'}],d='modify\x20service',e=!![]):(c['semantic_created']=[{'role':'Service'}],d='create\x20service',e=!![]);break;case'machine':referencesExistingObject(b)?(c['semantic_modified']=[{'role':'Machine'}],d='modify\x20machine'):(c['semantic_created']=[{'role':'Machine'}],d='create\x20machine');e=!![];break;case'guard':c['semantic_created']=[{'role':'Guard'}],d='create\x20guard',e=!![];break;case'permission':referencesExistingObject(b)?(c['semantic_modified']=[{'role':'Permission'}],d='modify\x20permission'):(c['semantic_created']=[{'role':'Permission'}],d='create\x20permission');e=!![];break;case'order':b?.['arb']!==undefined?(c['state_transition']={'from':'ordered','to':'arbitration'},c['events']=[{'type':'ArbEvent','expect_count':'>=1'}],d='open\x20arbitration',e=!![]):(c['semantic_created']=[{'role':'Order'}],c['semantic_released']=[{'role':'payment'}],c['events']=[{'type':'NewOrderEvent','expect_count':'>=1'}],d='create\x20order',e=!![]);break;case'payment':c['semantic_released']=[{'role':'payment'}],c['events']=[{'type':'NewPaymentEvent','expect_count':'>=1'}],d='pay\x20order',e=!![];break;case'treasury':b?.['deposit']!==undefined?c['semantic_released']=[{'role':'deposit'}]:c['semantic_released']=[{'role':'release'}];c['events']=[{'type':'TreasuryEvent','expect_count':'>=1'},{'type':'NewPaymentEvent','expect_count':'>=1'}],d='treasury\x20fund\x20movement',e=!![];break;case'reward':if(b?.['claim']!==undefined||b?.['withdraw']!==undefined)c['semantic_released']=[{'role':'reward'}],c['events']=[{'type':'RewardClaimEvent','expect_count':'>=1'}],d='claim\x20reward',e=!![];else b?.['coin']!==undefined||b?.['add']!==undefined?(c['events']=[{'type':'RewardFundEvent','expect_count':'>=1'}],d='fund\x20reward',e=!![]):(c['semantic_created']=[{'role':'Reward'}],d='create\x20reward',e=!![]);break;case'allocation':c['semantic_released']=[{'role':'release'}],c['events']=[{'type':'AllocationEvent','expect_count':'>=1'},{'type':'NewPaymentEvent','expect_count':'>=1'}],d='run\x20allocation',e=!![];break;case'demand':if(b?.['submit']!==undefined||b?.['present']!==undefined)c['semantic_modified']=[{'role':'Demand'}],c['events']=[{'type':'DemandPresentEvent','expect_count':'>=1'}],d='present\x20demand',e=!![];else b?.['reward']!==undefined||b?.['rewards']!==undefined?(c['events']=[{'type':'DemandChangedEvent','expect_count':'>=1'}],d='bind\x20demand\x20reward',e=!![]):(c['semantic_created']=[{'role':'Demand'}],d='create\x20demand',e=!![]);break;case'progress':c['events']=[{'type':'ProgressEvent','expect_count':'>=1'}],d='progress\x20order',e=!![];break;default:return undefined;}if(!e)return undefined;return{'operation':a,'intent':d,'pre_conditions':[],'expected':c};}export function stableOperationId(a,b){return a+':'+fnv1a(canonicalJson(b??null))['toString'](0x10);}function fnv1a(a){let b=0x811c9dc5;for(let c=0x0;c<a['length'];c++){b^=a['charCodeAt'](c),b=Math['imul'](b,0x1000193)>>>0x0;}return b>>>0x0;}function canonicalJson(a){if(a===null||typeof a!=='object')return JSON['stringify'](a)??'null';if(Array['isArray'](a))return'['+a['map'](canonicalJson)['join'](',')+']';const b=Object['keys'](a)['sort']()['map'](c=>JSON['stringify'](c)+':'+canonicalJson(a[c]));return'{'+b['join'](',')+'}';}
1
+ import{referencesExistingObject}from'../../schema/call/semantic.js';export function declareDispatchExpectation(a,b){const c={'result_type':'transaction'};let d=a,e=![];switch(a){case'service':if(b?.['order_new']!==undefined)c['semantic_created']=[{'role':'Order'}],c['semantic_released']=[{'role':'payment'}],c['events']=[{'type':'NewOrderEvent','expect_count':'>=1'}],d='buy\x20service',e=!![];else{if(b?.['publish']===!![]||b?.['bPublished']===!![])c['semantic_modified']=[{'role':'Service','expect_fields':{'bPublished':!![]}}],c['state_transition']={'from':'unpublished','to':'published'},c['events']=[{'type':'ServiceEvent','expect_count':'>=1'}],d='publish\x20service',e=!![];else referencesExistingObject(b)?(c['semantic_modified']=[{'role':'Service'}],d='modify\x20service',e=!![]):(c['semantic_created']=[{'role':'Service'}],d='create\x20service',e=!![]);}break;case'machine':referencesExistingObject(b)?(c['semantic_modified']=[{'role':'Machine'}],d='modify\x20machine'):(c['semantic_created']=[{'role':'Machine'}],d='create\x20machine');e=!![];break;case'guard':c['semantic_created']=[{'role':'Guard'}],d='create\x20guard',e=!![];break;case'permission':referencesExistingObject(b)?(c['semantic_modified']=[{'role':'Permission'}],d='modify\x20permission'):(c['semantic_created']=[{'role':'Permission'}],d='create\x20permission');e=!![];break;case'order':if(b?.['progress']!==undefined)c['semantic_modified']=[{'role':'Order'}],c['events']=[{'type':'ProgressEvent','expect_count':'>=1'}],d='advance\x20order';else{if(b?.['arb_confirm']!==undefined)c['state_transition']={'from':'ordered','to':'arbitration'},c['events']=[{'type':'ArbEvent','expect_count':'>=1'}],d='open\x20arbitration';else b?.['arb_objection']!==undefined||b?.['arb_claim_compensation']!==undefined?(c['semantic_modified']=[{'role':'Order'}],d=b?.['arb_objection']!==undefined?'object\x20arbitration\x20result':'claim\x20arbitration\x20compensation'):(c['semantic_modified']=[{'role':'Order'}],d='manage\x20order');}e=!![];break;case'payment':c['semantic_released']=[{'role':'payment'}],c['events']=[{'type':'NewPaymentEvent','expect_count':'>=1'}],d='pay\x20order',e=!![];break;case'treasury':{const f=referencesExistingObject(b);if(b?.['deposit']!==undefined)c['semantic_released']=[{'role':'deposit'}],d=f?'deposit\x20to\x20treasury':'create\x20treasury\x20with\x20deposit';else{if(b?.['withdraw']!==undefined)c['semantic_released']=[{'role':'release'}],d='withdraw\x20from\x20treasury';else f?(c['semantic_modified']=[{'role':'Treasury'}],d='modify\x20treasury'):(c['semantic_created']=[{'role':'Treasury'}],d='create\x20treasury');}c['events']=[{'type':'TreasuryEvent','expect_count':'>=1'},{'type':'NewPaymentEvent','expect_count':'>=1'}],e=!![];break;}case'reward':if(b?.['claim']!==undefined)c['semantic_released']=[{'role':'reward'}],c['events']=[{'type':'RewardClaimEvent','expect_count':'>=1'}],d='claim\x20reward';else{if(b?.['coin_add']!==undefined)c['events']=[{'type':'RewardFundEvent','expect_count':'>=1'}],d='fund\x20reward';else referencesExistingObject(b)?(c['semantic_modified']=[{'role':'Reward'}],d='modify\x20reward'):(c['semantic_created']=[{'role':'Reward'}],d='create\x20reward');}e=!![];break;case'allocation':c['semantic_released']=[{'role':'release'}],c['events']=[{'type':'AllocationEvent','expect_count':'>=1'},{'type':'NewPaymentEvent','expect_count':'>=1'}],d='run\x20allocation',e=!![];break;case'demand':if(b?.['present']!==undefined)c['semantic_modified']=[{'role':'Demand'}],c['events']=[{'type':'DemandPresentEvent','expect_count':'>=1'}],d='present\x20demand';else{if(b?.['rewards']!==undefined)c['events']=[{'type':'DemandChangedEvent','expect_count':'>=1'}],d='bind\x20demand\x20reward';else referencesExistingObject(b)?(c['semantic_modified']=[{'role':'Demand'}],d='modify\x20demand'):(c['semantic_created']=[{'role':'Demand'}],d='create\x20demand');}e=!![];break;case'progress':c['events']=[{'type':'ProgressEvent','expect_count':'>=1'}],d='progress\x20order',e=!![];break;default:return undefined;}if(!e)return undefined;return{'operation':a,'intent':d,'pre_conditions':[],'expected':c};}export function stableOperationId(a,b){return a+':'+fnv1a(canonicalJson(b??null))['toString'](0x10);}function fnv1a(a){let b=0x811c9dc5;for(let c=0x0;c<a['length'];c++){b^=a['charCodeAt'](c),b=Math['imul'](b,0x1000193)>>>0x0;}return b>>>0x0;}function canonicalJson(a){if(a===null||typeof a!=='object')return JSON['stringify'](a)??'null';if(Array['isArray'](a))return'['+a['map'](canonicalJson)['join'](',')+']';const b=Object['keys'](a)['sort']()['map'](c=>JSON['stringify'](c)+':'+canonicalJson(a[c]));return'{'+b['join'](',')+'}';}
@@ -0,0 +1 @@
1
+ import{describe,expect,it}from'vitest';import{declareDispatchExpectation}from'./dispatch-expectations.js';import{verify}from'../../harness/verify.js';function expectFor(a,b){const c=declareDispatchExpectation(a,b);return expect(c)['toBeDefined'](),c['expected'];}const FAILED_ACTUAL={'result_type':'transaction','semantic':{'intent':'x','status':'failed'},'error':'Move\x20abort:\x20guard\x20rejected'};describe('declareDispatchExpectation\x20—\x20order\x20(docs#26\x20residual\x20#2)',()=>{it('progress\x20forward\x20on\x20an\x20existing\x20order\x20expects\x20a\x20mutation,\x20never\x20a\x20creation',()=>{const a=expectFor('order',{'object':'0xorder','progress':{'operation':{'next_node_name':'cancelled_late_build','forward':'cancel_late'}}});expect(a['semantic_created'])['toBeUndefined'](),expect(a['semantic_modified'])['toEqual']([{'role':'Order'}]),expect(a['events'])['toEqual']([{'type':'ProgressEvent','expect_count':'>=1'}]);const b=verify({'expected':{'operation':'order','intent':'advance\x20order','pre_conditions':[],'expected':a},'actual':FAILED_ACTUAL});for(const c of b['mismatches']){expect(c['detail'])['not']['toContain']('Expected\x20to\x20create\x20object\x20with\x20role\x20\x27Order\x27');}expect(b['mismatches']['some'](d=>d['dimension']==='modified'))['toBe'](!![]);}),it('arb_confirm\x20routes\x20to\x20the\x20arbitration\x20branch\x20(old\x20data?.arb\x20matched\x20nothing)',()=>{const a=expectFor('order',{'object':'0xorder','arb_confirm':{'arb':'0xarb','confirm':!![]}});expect(a['semantic_created'])['toBeUndefined'](),expect(a['state_transition'])['toEqual']({'from':'ordered','to':'arbitration'}),expect(a['events'])['toEqual']([{'type':'ArbEvent','expect_count':'>=1'}]);}),it('arb_objection\x20/\x20arb_claim_compensation\x20expect\x20an\x20Order\x20mutation',()=>{const a=expectFor('order',{'object':'0xorder','arb_objection':{'arb':'0xarb','objection':'appeal'}});expect(a['semantic_created'])['toBeUndefined'](),expect(a['semantic_modified'])['toEqual']([{'role':'Order'}]);const b=expectFor('order',{'object':'0xorder','arb_claim_compensation':{'arb':'0xarb'}});expect(b['semantic_created'])['toBeUndefined'](),expect(b['semantic_modified'])['toEqual']([{'role':'Order'}]);}),it('metadata\x20sub-ops\x20(agent/transfer_to)\x20never\x20expect\x20an\x20Order\x20creation',()=>{const a=expectFor('order',{'object':'0xorder','agent':'0xagent'});expect(a['semantic_created'])['toBeUndefined'](),expect(a['semantic_modified'])['toEqual']([{'role':'Order'}]);});}),describe('declareDispatchExpectation\x20—\x20service\x20purchase\x20(order_new)',()=>{it('order_new\x20is\x20a\x20purchase:\x20created\x20Order\x20+\x20payment\x20release,\x20not\x20\x27modify\x20service\x27',()=>{const a=expectFor('service',{'object':'0xservice','order_new':{'buy':{'name':'svc','stock':0x1,'items':[],'total_pay':{'fixed':'100'}}}});expect(a['semantic_created'])['toEqual']([{'role':'Order'}]),expect(a['semantic_released'])['toEqual']([{'role':'payment'}]),expect(a['events'])['toEqual']([{'type':'NewOrderEvent','expect_count':'>=1'}]);}),it('plain\x20service\x20modification\x20keeps\x20the\x20modified\x20expectation',()=>{const a=expectFor('service',{'object':'0xservice','description':'updated'});expect(a['semantic_created'])['toBeUndefined'](),expect(a['semantic_modified'])['toEqual']([{'role':'Service'}]);});}),describe('declareDispatchExpectation\x20—\x20reward\x20(dead\x20coin/add\x20predicates)',()=>{it('coin_add\x20funds\x20an\x20existing\x20reward\x20instead\x20of\x20expecting\x20a\x20creation',()=>{const a=expectFor('reward',{'object':'0xreward','coin_add':{'coin':'0x2::wow::WOW','pay':{'fixed':'500'}}});expect(a['semantic_created'])['toBeUndefined'](),expect(a['events'])['toEqual']([{'type':'RewardFundEvent','expect_count':'>=1'}]);}),it('configuration\x20on\x20an\x20existing\x20reward\x20(string\x20object)\x20expects\x20a\x20mutation',()=>{const a=expectFor('reward',{'object':'0xreward','description':'d'});expect(a['semantic_created'])['toBeUndefined'](),expect(a['semantic_modified'])['toEqual']([{'role':'Reward'}]);}),it('inline\x20object\x20definition\x20still\x20expects\x20a\x20creation',()=>{const a=expectFor('reward',{'object':{'name':'my-reward'},'claim':'0xguard'}),b=expectFor('reward',{'object':{'name':'my-reward'}});expect(b['semantic_created'])['toEqual']([{'role':'Reward'}]),expect(a['semantic_released'])['toEqual']([{'role':'reward'}]);});}),describe('declareDispatchExpectation\x20—\x20demand\x20(dual-mode\x20object)',()=>{it('description\x20update\x20on\x20an\x20existing\x20demand\x20expects\x20a\x20mutation,\x20not\x20a\x20creation',()=>{const a=expectFor('demand',{'object':'0xdemand','description':'d'});expect(a['semantic_created'])['toBeUndefined'](),expect(a['semantic_modified'])['toEqual']([{'role':'Demand'}]);}),it('present\x20keeps\x20the\x20DemandPresentEvent\x20expectation',()=>{const a=expectFor('demand',{'object':'0xdemand','present':{'recommend':'try\x20this','service':'0xsvc'}});expect(a['semantic_modified'])['toEqual']([{'role':'Demand'}]),expect(a['events'])['toEqual']([{'type':'DemandPresentEvent','expect_count':'>=1'}]);}),it('inline\x20object\x20definition\x20still\x20expects\x20a\x20creation',()=>{const a=expectFor('demand',{'object':{'name':'my-demand'}});expect(a['semantic_created'])['toEqual']([{'role':'Demand'}]);});}),describe('declareDispatchExpectation\x20—\x20treasury\x20(unconditional\x20release\x20fall-through)',()=>{it('external_deposit_guard\x20on\x20an\x20existing\x20treasury\x20is\x20a\x20mutation,\x20no\x20fund\x20release',()=>{const a=expectFor('treasury',{'object':'0xtreasury','external_deposit_guard':'0xguard'});expect(a['semantic_released'])['toBeUndefined'](),expect(a['semantic_modified'])['toEqual']([{'role':'Treasury'}]);}),it('deposit\x20/\x20withdraw\x20keep\x20their\x20fund-movement\x20expectations',()=>{const a=expectFor('treasury',{'object':'0xtreasury','deposit':{'coin':'0x2::wow::WOW','pay':{'fixed':'1'}}});expect(a['semantic_released'])['toEqual']([{'role':'deposit'}]);const b=expectFor('treasury',{'object':'0xtreasury','withdraw':{'amount':{'fixed':'1'},'recipient':'0xa'}});expect(b['semantic_released'])['toEqual']([{'role':'release'}]);}),it('inline\x20object\x20definition\x20still\x20expects\x20a\x20creation',()=>{const a=expectFor('treasury',{'object':{'name':'my-treasury'}});expect(a['semantic_created'])['toEqual']([{'role':'Treasury'}]);});});