@wowok/agent-mcp 3.1.4 → 3.1.6
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/dist/evaluation/arbitration-game.js +1 -1
- package/dist/evaluation/builtins/graph-service.js +1 -1
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/analyze.spec.js +1 -1
- package/dist/graph/onchain/extract.js +1 -1
- package/dist/graph/onchain/facts.d.ts +1 -0
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/graph/onchain/fixtures.js +1 -1
- package/dist/graph/onchain/onchain.spec.js +1 -1
- package/dist/graph/onchain/strategy.js +1 -1
- package/dist/graph/onchain/strategy.spec.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/knowledge/alloc-audit-policy.spec.js +1 -1
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +1 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/alloc_audit.json +20 -0
- package/dist/knowledge/baselines/rules/allocation.json +1 -19
- package/dist/knowledge/baselines/rules/arb.json +1 -1
- package/dist/knowledge/baselines/rules/guard.json +8 -8
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/guard-design-patterns.d.ts +2 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-design-patterns.spec.d.ts +1 -0
- package/dist/knowledge/guard-design-patterns.spec.js +1 -0
- package/dist/knowledge/guard-lint.d.ts +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/permission-ledger.js +1 -1
- package/dist/knowledge/recipient-constraint.js +1 -1
- package/dist/knowledge/safety-rules.extract-amount.spec.d.ts +1 -0
- package/dist/knowledge/safety-rules.extract-amount.spec.js +1 -0
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tool-constraints.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/pipeline-actions.d.ts +1 -1
- package/dist/playbooks/service-build/pipeline-actions.js +1 -1
- package/dist/playbooks/service-build/risk-aggregator.js +1 -1
- package/dist/role/derivation.d.ts +1 -1
- package/dist/role/derivation.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/call/allocation.d.ts +7 -0
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.d.ts +4 -0
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +48 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +26 -0
- package/dist/schema/call/contact.d.ts +4 -0
- package/dist/schema/call/demand.d.ts +4 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/guard.d.ts +12 -0
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +8 -0
- package/dist/schema/call/order.d.ts +4 -0
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/payment.d.ts +4 -0
- package/dist/schema/call/permission.d.ts +4 -0
- package/dist/schema/call/personal.d.ts +4 -0
- package/dist/schema/call/progress.d.ts +4 -0
- package/dist/schema/call/proof.d.ts +8 -0
- package/dist/schema/call/repository.d.ts +4 -0
- package/dist/schema/call/repository.js +1 -1
- package/dist/schema/call/reward.d.ts +4 -0
- package/dist/schema/call/semantic-customer-advice.spec.js +1 -1
- package/dist/schema/call/semantic.d.ts +11 -0
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +14 -0
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +4 -0
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/keeper/index.d.ts +5 -0
- package/dist/schema/local/index.d.ts +28 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +5 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +83 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +16 -0
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workflow/index.d.ts +2 -0
- package/dist/schema/workflow/index.js +1 -1
- package/dist/schema/workspace/index.d.ts +53 -0
- package/dist/schema/workspace/index.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +25 -1
- package/dist/schemas/bridge_operation.output.json +25 -1
- package/dist/schemas/bridge_operation.schema.json +40 -0
- package/dist/schemas/guard2file.schema.json +8 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/keeper_operation.output.json +24 -1
- package/dist/schemas/local_history_operation.output.json +25 -1
- package/dist/schemas/local_info_operation.output.json +25 -1
- package/dist/schemas/local_mark_operation.output.json +25 -1
- package/dist/schemas/machineNode2file.schema.json +8 -0
- package/dist/schemas/messenger_operation.output.json +24 -1
- package/dist/schemas/messenger_operation.schema.json +2 -2
- package/dist/schemas/monitor_events.output.json +24 -1
- package/dist/schemas/monitor_subscription.output.json +24 -1
- package/dist/schemas/onchain_events.output.json +24 -1
- package/dist/schemas/onchain_operations.output.json +73 -3
- package/dist/schemas/onchain_operations.schema.json +3286 -821
- package/dist/schemas/onchain_operations_allocation.schema.json +12 -0
- package/dist/schemas/onchain_operations_arbitration.schema.json +18 -10
- package/dist/schemas/onchain_operations_contact.schema.json +8 -0
- package/dist/schemas/onchain_operations_demand.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
- package/dist/schemas/onchain_operations_guard.schema.json +2896 -596
- package/dist/schemas/onchain_operations_machine.schema.json +8 -0
- package/dist/schemas/onchain_operations_order.schema.json +10 -2
- package/dist/schemas/onchain_operations_payment.schema.json +8 -0
- package/dist/schemas/onchain_operations_permission.schema.json +8 -0
- package/dist/schemas/onchain_operations_personal.schema.json +8 -0
- package/dist/schemas/onchain_operations_progress.schema.json +8 -0
- package/dist/schemas/onchain_operations_proof.schema.json +8 -0
- package/dist/schemas/onchain_operations_repository.schema.json +14 -6
- package/dist/schemas/onchain_operations_reward.schema.json +8 -0
- package/dist/schemas/onchain_operations_service.schema.json +43 -10
- package/dist/schemas/onchain_operations_treasury.schema.json +8 -0
- package/dist/schemas/onchain_table_data.output.json +35 -12
- package/dist/schemas/query_toolkit.output.json +1179 -10
- package/dist/schemas/query_toolkit.schema.json +11 -11
- package/dist/schemas/workflow_operation.schema.json +8 -0
- package/dist/schemas/workspace_operation.output.json +181 -1
- package/dist/schemas/workspace_operation.schema.json +61 -2
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/dispatch-expectations.js +1 -1
- package/dist/tools/handlers/dispatch-expectations.spec.d.ts +1 -0
- package/dist/tools/handlers/dispatch-expectations.spec.js +1 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/workflow.js +1 -1
- package/dist/tools/handlers/workspace.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/move-fn-index.gen.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- 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.",
|
|
@@ -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": [
|
|
@@ -88,7 +88,35 @@
|
|
|
88
88
|
},
|
|
89
89
|
"content": {
|
|
90
90
|
"type": "string",
|
|
91
|
-
"description": "File content (text)."
|
|
91
|
+
"description": "File content (text, possibly sliced by offset/limit; base64 when encoding='base64')."
|
|
92
|
+
},
|
|
93
|
+
"encoding": {
|
|
94
|
+
"description": "'base64' when raw bytes are returned; absent/undefined for text.",
|
|
95
|
+
"type": "string",
|
|
96
|
+
"enum": [
|
|
97
|
+
"text",
|
|
98
|
+
"base64"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"size": {
|
|
102
|
+
"description": "File size in bytes (base64 reads only).",
|
|
103
|
+
"type": "number"
|
|
104
|
+
},
|
|
105
|
+
"total_lines": {
|
|
106
|
+
"description": "Total line count of the file (text reads only).",
|
|
107
|
+
"type": "number"
|
|
108
|
+
},
|
|
109
|
+
"offset": {
|
|
110
|
+
"description": "1-based start line of the returned slice (text reads only).",
|
|
111
|
+
"type": "number"
|
|
112
|
+
},
|
|
113
|
+
"limit": {
|
|
114
|
+
"description": "Max lines in the returned slice (text reads only).",
|
|
115
|
+
"type": "number"
|
|
116
|
+
},
|
|
117
|
+
"truncated": {
|
|
118
|
+
"description": "True when lines were cut off by offset/limit (text reads only).",
|
|
119
|
+
"type": "boolean"
|
|
92
120
|
}
|
|
93
121
|
},
|
|
94
122
|
"required": [
|
|
@@ -266,6 +294,158 @@
|
|
|
266
294
|
"ok"
|
|
267
295
|
],
|
|
268
296
|
"additionalProperties": false
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"type": "object",
|
|
300
|
+
"properties": {
|
|
301
|
+
"action": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"const": "search"
|
|
304
|
+
},
|
|
305
|
+
"pattern": {
|
|
306
|
+
"type": "string",
|
|
307
|
+
"description": "The regex pattern that was searched."
|
|
308
|
+
},
|
|
309
|
+
"matches": {
|
|
310
|
+
"type": "array",
|
|
311
|
+
"items": {
|
|
312
|
+
"type": "object",
|
|
313
|
+
"properties": {
|
|
314
|
+
"path": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"description": "Workspace-relative file path."
|
|
317
|
+
},
|
|
318
|
+
"line": {
|
|
319
|
+
"type": "number",
|
|
320
|
+
"description": "1-based line number of the match."
|
|
321
|
+
},
|
|
322
|
+
"text": {
|
|
323
|
+
"type": "string",
|
|
324
|
+
"description": "The matched line."
|
|
325
|
+
},
|
|
326
|
+
"before": {
|
|
327
|
+
"description": "Context lines before the match.",
|
|
328
|
+
"type": "array",
|
|
329
|
+
"items": {
|
|
330
|
+
"type": "string"
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
"after": {
|
|
334
|
+
"description": "Context lines after the match.",
|
|
335
|
+
"type": "array",
|
|
336
|
+
"items": {
|
|
337
|
+
"type": "string"
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"required": [
|
|
342
|
+
"path",
|
|
343
|
+
"line",
|
|
344
|
+
"text"
|
|
345
|
+
],
|
|
346
|
+
"additionalProperties": false
|
|
347
|
+
},
|
|
348
|
+
"description": "Matches (at most max_results)."
|
|
349
|
+
},
|
|
350
|
+
"total_matches": {
|
|
351
|
+
"type": "number",
|
|
352
|
+
"description": "Total number of matches found across all scanned files."
|
|
353
|
+
},
|
|
354
|
+
"truncated": {
|
|
355
|
+
"type": "boolean",
|
|
356
|
+
"description": "True when matches were cut off by max_results."
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"required": [
|
|
360
|
+
"action",
|
|
361
|
+
"pattern",
|
|
362
|
+
"matches",
|
|
363
|
+
"total_matches",
|
|
364
|
+
"truncated"
|
|
365
|
+
],
|
|
366
|
+
"additionalProperties": false
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"type": "object",
|
|
370
|
+
"properties": {
|
|
371
|
+
"action": {
|
|
372
|
+
"type": "string",
|
|
373
|
+
"const": "glob"
|
|
374
|
+
},
|
|
375
|
+
"pattern": {
|
|
376
|
+
"type": "string",
|
|
377
|
+
"description": "The wildcard pattern that was matched."
|
|
378
|
+
},
|
|
379
|
+
"files": {
|
|
380
|
+
"type": "array",
|
|
381
|
+
"items": {
|
|
382
|
+
"type": "object",
|
|
383
|
+
"properties": {
|
|
384
|
+
"path": {
|
|
385
|
+
"type": "string",
|
|
386
|
+
"description": "Path relative to the workspace root."
|
|
387
|
+
},
|
|
388
|
+
"is_dir": {
|
|
389
|
+
"type": "boolean"
|
|
390
|
+
},
|
|
391
|
+
"size": {
|
|
392
|
+
"type": "number",
|
|
393
|
+
"description": "File size in bytes (0 for directories)."
|
|
394
|
+
},
|
|
395
|
+
"mtime": {
|
|
396
|
+
"type": "number",
|
|
397
|
+
"description": "Last-modified time (epoch ms)."
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
"required": [
|
|
401
|
+
"path",
|
|
402
|
+
"is_dir",
|
|
403
|
+
"size",
|
|
404
|
+
"mtime"
|
|
405
|
+
],
|
|
406
|
+
"additionalProperties": false
|
|
407
|
+
},
|
|
408
|
+
"description": "Files whose workspace-relative path matches the pattern."
|
|
409
|
+
},
|
|
410
|
+
"count": {
|
|
411
|
+
"type": "number",
|
|
412
|
+
"description": "Number of matching files."
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"required": [
|
|
416
|
+
"action",
|
|
417
|
+
"pattern",
|
|
418
|
+
"files",
|
|
419
|
+
"count"
|
|
420
|
+
],
|
|
421
|
+
"additionalProperties": false
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"type": "object",
|
|
425
|
+
"properties": {
|
|
426
|
+
"action": {
|
|
427
|
+
"type": "string",
|
|
428
|
+
"const": "edit"
|
|
429
|
+
},
|
|
430
|
+
"path": {
|
|
431
|
+
"type": "string",
|
|
432
|
+
"description": "Absolute path of the edited file."
|
|
433
|
+
},
|
|
434
|
+
"replacements": {
|
|
435
|
+
"type": "number",
|
|
436
|
+
"description": "Number of replacements performed."
|
|
437
|
+
},
|
|
438
|
+
"ok": {
|
|
439
|
+
"type": "boolean"
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
"required": [
|
|
443
|
+
"action",
|
|
444
|
+
"path",
|
|
445
|
+
"replacements",
|
|
446
|
+
"ok"
|
|
447
|
+
],
|
|
448
|
+
"additionalProperties": false
|
|
269
449
|
}
|
|
270
450
|
]
|
|
271
451
|
}
|
|
@@ -17,9 +17,12 @@
|
|
|
17
17
|
"create_dir",
|
|
18
18
|
"copy",
|
|
19
19
|
"move",
|
|
20
|
-
"rename"
|
|
20
|
+
"rename",
|
|
21
|
+
"search",
|
|
22
|
+
"glob",
|
|
23
|
+
"edit"
|
|
21
24
|
],
|
|
22
|
-
"description": "Action: 'resolve' = return the workspace root directory; 'list' = list files; 'read' = read a file (path required); 'write' = write/overwrite a file (path + content required); 'delete' = delete a file or directory (path required). 'create_file' = create an empty file (path required; content optional). 'create_dir' = create a directory recursively (path required). 'copy' = copy a file or directory (from + to required). 'move' / 'rename' = move or rename a file or directory (from + to required)."
|
|
25
|
+
"description": "Action: 'resolve' = return the workspace root directory; 'list' = list files; 'read' = read a file (path required); 'write' = write/overwrite a file (path + content required); 'delete' = delete a file or directory (path required). 'create_file' = create an empty file (path required; content optional). 'create_dir' = create a directory recursively (path required). 'copy' = copy a file or directory (from + to required). 'move' / 'rename' = move or rename a file or directory (from + to required). 'search' = regex content search across workspace files (pattern required). 'glob' = list files whose workspace-relative path matches a wildcard pattern (pattern required). 'edit' = exact string replacement inside a file (path + old_string + new_string required)."
|
|
23
26
|
},
|
|
24
27
|
"path": {
|
|
25
28
|
"description": "Path relative to the workspace root (required for read/write/delete/create_file/create_dir).",
|
|
@@ -36,6 +39,62 @@
|
|
|
36
39
|
"to": {
|
|
37
40
|
"description": "Destination path relative to root (required for copy/move/rename).",
|
|
38
41
|
"type": "string"
|
|
42
|
+
},
|
|
43
|
+
"pattern": {
|
|
44
|
+
"description": "search: regular expression matched against every file line (required for search). glob: wildcard pattern matched against workspace-relative paths — '**' spans directory segments, '*' stays within one segment, '?' is a single char (e.g. '**/*.json', '*.md'; required for glob).",
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"glob": {
|
|
48
|
+
"description": "search only: optional filename wildcard filter matched on the file basename (e.g. '*.md', '*.{ts,tsx}').",
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"ignore_case": {
|
|
52
|
+
"description": "search only: case-insensitive pattern matching (default false).",
|
|
53
|
+
"type": "boolean"
|
|
54
|
+
},
|
|
55
|
+
"max_results": {
|
|
56
|
+
"description": "search only: maximum matches returned (default 50, hard cap 200); total_matches still counts every match.",
|
|
57
|
+
"type": "integer",
|
|
58
|
+
"minimum": 1,
|
|
59
|
+
"maximum": 200
|
|
60
|
+
},
|
|
61
|
+
"context_lines": {
|
|
62
|
+
"description": "search only: context lines included before/after each match (default 2).",
|
|
63
|
+
"type": "integer",
|
|
64
|
+
"minimum": 0,
|
|
65
|
+
"maximum": 5
|
|
66
|
+
},
|
|
67
|
+
"old_string": {
|
|
68
|
+
"description": "edit only: exact text to replace (non-empty; required for edit).",
|
|
69
|
+
"type": "string"
|
|
70
|
+
},
|
|
71
|
+
"new_string": {
|
|
72
|
+
"description": "edit only: replacement text (required for edit; may be empty to delete).",
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"replace_all": {
|
|
76
|
+
"description": "edit only: replace every occurrence of old_string (default false — errors when old_string is not unique).",
|
|
77
|
+
"type": "boolean"
|
|
78
|
+
},
|
|
79
|
+
"offset": {
|
|
80
|
+
"description": "read only: 1-based line number to start from (default 1).",
|
|
81
|
+
"type": "integer",
|
|
82
|
+
"minimum": 1,
|
|
83
|
+
"maximum": 9007199254740991
|
|
84
|
+
},
|
|
85
|
+
"limit": {
|
|
86
|
+
"description": "read only: maximum lines to return (default and hard cap 2000; only applied when offset or limit is given).",
|
|
87
|
+
"type": "integer",
|
|
88
|
+
"minimum": 1,
|
|
89
|
+
"maximum": 2000
|
|
90
|
+
},
|
|
91
|
+
"encoding": {
|
|
92
|
+
"description": "read: 'text' (default, utf-8) or 'base64' (raw bytes, files up to 10MB). write/create_file: 'text' (default, utf-8) or 'base64' (content is base64-encoded raw bytes, e.g. binary files).",
|
|
93
|
+
"type": "string",
|
|
94
|
+
"enum": [
|
|
95
|
+
"text",
|
|
96
|
+
"base64"
|
|
97
|
+
]
|
|
39
98
|
}
|
|
40
99
|
},
|
|
41
100
|
"required": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{listServices,getServiceInfo,toggle as
|
|
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?.['
|
|
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
|
+
export {};
|
|
@@ -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'}]);});});
|