@wowok/agent-mcp 3.1.6 → 3.2.0
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/config/exposure.d.ts +10 -10
- package/dist/config/judgment.d.ts +25 -25
- package/dist/config/rule-engine.d.ts +25 -25
- package/dist/customer/user-preferences.d.ts +2 -2
- package/dist/evaluation/arbitration-game.js +1 -1
- package/dist/evaluation/capability.d.ts +1 -1
- package/dist/evaluation/extract.js +1 -1
- package/dist/evaluation/match-operation.js +1 -1
- package/dist/extensions/industry-pack.d.ts +3 -2
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/extensions/registry.js +1 -1
- package/dist/extensions/types.d.ts +1 -0
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/analyze.spec.js +1 -1
- package/dist/graph/onchain/edge-schema.js +1 -1
- package/dist/graph/onchain/extract.js +1 -1
- package/dist/graph/onchain/field-manifest.js +1 -1
- package/dist/graph/onchain/project-relationship.js +1 -1
- package/dist/graph/onchain/types.d.ts +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/keeper/KeeperScan.d.ts +2 -1
- package/dist/keeper/KeeperScan.js +1 -1
- package/dist/keeper/detectors.d.ts +9 -0
- package/dist/keeper/detectors.js +1 -1
- package/dist/keeper/keeper.spec.js +1 -1
- package/dist/keeper/types.d.ts +1 -1
- package/dist/keeper/types.js +1 -1
- package/dist/knowledge/allocation-ledger.d.ts +4 -1
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocation-puzzle.d.ts +2 -0
- package/dist/knowledge/allocation-puzzle.js +1 -1
- package/dist/knowledge/allocation-risk.d.ts +1 -1
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/arb-risk.d.ts +3 -1
- package/dist/knowledge/arb-risk.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-risk.js +1 -1
- package/dist/knowledge/arbitration-templates.d.ts +1 -0
- package/dist/knowledge/arbitration-templates.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +13 -2
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/allocation.json +50 -1
- package/dist/knowledge/baselines/rules/arb.json +20 -1
- package/dist/knowledge/baselines/rules/arbitration.json +27 -0
- package/dist/knowledge/baselines/rules/guard.json +75 -2
- package/dist/knowledge/baselines/rules/machine.json +38 -13
- package/dist/knowledge/baselines/rules/order.json +2 -2
- package/dist/knowledge/builtin-templates.d.ts +3 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-anchor-reach.d.ts +19 -0
- package/dist/knowledge/guard-anchor-reach.js +1 -0
- package/dist/knowledge/guard-bindings.js +1 -1
- package/dist/knowledge/guard-design-patterns.d.ts +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-render.d.ts +6 -0
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-submission-prompt.d.ts +6 -0
- package/dist/knowledge/guard-submission-prompt.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/index.d.ts +4 -4
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.d.ts +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-risk.js +1 -1
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/order-templates.js +1 -1
- package/dist/knowledge/permission-ledger.js +1 -1
- package/dist/knowledge/release-sentinel.d.ts +12 -0
- package/dist/knowledge/release-sentinel.js +1 -0
- package/dist/knowledge/repository-write-semantics.d.ts +27 -0
- package/dist/knowledge/repository-write-semantics.js +1 -0
- package/dist/knowledge/rule-node-analyzers.d.ts +6 -0
- package/dist/knowledge/rule-node-analyzers.js +1 -1
- package/dist/knowledge/safety-rules.d.ts +5 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +10 -1
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/service-allocation-semantics.d.ts +36 -0
- package/dist/knowledge/service-allocation-semantics.js +1 -0
- package/dist/knowledge/strategy-manuals.d.ts +3 -5
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +28 -12
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +26 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/allocation-advice.d.ts +38 -0
- package/dist/participation/allocation-advice.js +1 -0
- package/dist/participation/radar-core.d.ts +2 -0
- package/dist/persona/types.d.ts +3 -2
- package/dist/persona/types.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/intent-analyzer.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +70 -63
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/mode-actions.d.ts +5 -0
- package/dist/playbooks/service-build/mode-actions.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/semantic-graph.d.ts +1 -0
- package/dist/playbooks/service-build/semantic-graph.js +1 -1
- package/dist/playbooks/service-build/service-quote.d.ts +2 -0
- package/dist/playbooks/service-build/service-quote.js +1 -0
- package/dist/relationship/derivation.d.ts +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +30 -8
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +6 -3
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +4 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +1 -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 +8 -8
- package/dist/schema/call/machine.d.ts +56 -0
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/payment.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +84 -22
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/common/tokentype-short-probe.spec.js +1 -0
- package/dist/schema/evaluation/index.d.ts +8 -80
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +9 -42
- package/dist/schema/goal/planning.d.ts +25 -60
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +2 -20
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/interaction/index.d.ts +1 -1
- package/dist/schema/keeper/index.d.ts +3 -0
- package/dist/schema/keeper/index.js +1 -1
- package/dist/schema/local/index.d.ts +8 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/local/wip.d.ts +73 -0
- package/dist/schema/local/wip.js +1 -1
- package/dist/schema/operations.d.ts +92 -14
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +279 -384
- package/dist/schema/persona/index.js +1 -1
- package/dist/schema/query/bi.d.ts +149 -10
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +38 -19
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-query/index.d.ts +4 -4
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/watch/index.d.ts +2 -2
- package/dist/schema-query-impl/index.d.ts +1 -0
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +3 -2
- package/dist/schemas/benchmark_migration_operation.output.json +116 -2
- package/dist/schemas/benchmark_migration_operation.schema.json +2 -10
- package/dist/schemas/bridge_operation.output.json +3 -2
- package/dist/schemas/evaluation_operation.schema.json +7 -70
- package/dist/schemas/goal_operation.schema.json +6 -39
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/intent_radar.output.json +4 -20
- package/dist/schemas/keeper_operation.output.json +2 -2
- package/dist/schemas/keeper_operation.schema.json +9 -4
- package/dist/schemas/local_history_operation.output.json +3 -2
- package/dist/schemas/local_info_operation.output.json +3 -2
- package/dist/schemas/local_mark_operation.output.json +3 -2
- package/dist/schemas/messenger_operation.output.json +2 -2
- package/dist/schemas/monitor_events.output.json +2 -2
- package/dist/schemas/monitor_subscription.output.json +2 -2
- package/dist/schemas/onchain_events.output.json +2 -2
- package/dist/schemas/onchain_operations.output.json +7 -6
- package/dist/schemas/onchain_operations.schema.json +227 -54
- package/dist/schemas/onchain_operations_allocation.schema.json +11 -10
- package/dist/schemas/onchain_operations_arbitration.schema.json +13 -13
- package/dist/schemas/onchain_operations_machine.schema.json +27 -5
- package/dist/schemas/onchain_operations_order.schema.json +1 -1
- package/dist/schemas/onchain_operations_payment.schema.json +2 -2
- package/dist/schemas/onchain_operations_reward.schema.json +1 -1
- package/dist/schemas/onchain_operations_service.schema.json +171 -21
- package/dist/schemas/onchain_operations_treasury.schema.json +1 -1
- package/dist/schemas/onchain_table_data.output.json +57 -4
- package/dist/schemas/persona_operation.output.json +11 -88
- package/dist/schemas/persona_operation.schema.json +4 -32
- package/dist/schemas/query_toolkit.output.json +320 -22
- package/dist/schemas/query_toolkit.schema.json +53 -0
- package/dist/schemas/wip_file.output.json +221 -0
- package/dist/schemas/wip_file.schema.json +125 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/dispatch-expectations.spec.js +1 -1
- package/dist/tools/handlers/keeper.d.ts +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/handlers/wip-upload.d.ts +22 -0
- package/dist/tools/handlers/wip-upload.js +1 -0
- package/dist/tools/handlers/wip.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/dist/tools/registry/files.js +1 -1
- package/dist/tools/wip-deploy-assist.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
- package/dist/knowledge/alloc-audit-policy.spec.js +0 -1
- package/dist/knowledge/event-semantics.spec.d.ts +0 -1
- package/dist/knowledge/event-semantics.spec.js +0 -1
- package/dist/knowledge/facts-sync.spec.d.ts +0 -1
- package/dist/knowledge/facts-sync.spec.js +0 -1
- package/dist/knowledge/guard-design-patterns.spec.d.ts +0 -1
- package/dist/knowledge/guard-design-patterns.spec.js +0 -1
- package/dist/knowledge/guard-eval.spec.d.ts +0 -1
- package/dist/knowledge/guard-eval.spec.js +0 -1
- package/dist/knowledge/rule-node-analyzers.spec.d.ts +0 -1
- package/dist/knowledge/rule-node-analyzers.spec.js +0 -1
- package/dist/knowledge/safety-rules.extract-amount.spec.d.ts +0 -1
- package/dist/knowledge/safety-rules.extract-amount.spec.js +0 -1
- package/dist/knowledge/template-loader.spec.d.ts +0 -1
- package/dist/knowledge/template-loader.spec.js +0 -1
- package/dist/knowledge/template-scanner.spec.d.ts +0 -1
- package/dist/knowledge/template-scanner.spec.js +0 -1
- /package/dist/{knowledge/alloc-audit-policy.spec.d.ts → schema/common/tokentype-short-probe.spec.d.ts} +0 -0
|
@@ -974,6 +974,59 @@
|
|
|
974
974
|
"additionalProperties": false,
|
|
975
975
|
"description": "ONE-CALL full business-intelligence context of an on-chain Service (K3 22 / Business Service tab): base data + machine workflow graph + buy_guard/permission/allocator guards + related objects + supply chain + deterministic BusinessReport + recent orders. Every section degrades gracefully — failures are reported in `data_gaps`. Read-only."
|
|
976
976
|
},
|
|
977
|
+
{
|
|
978
|
+
"type": "object",
|
|
979
|
+
"properties": {
|
|
980
|
+
"query_type": {
|
|
981
|
+
"type": "string",
|
|
982
|
+
"const": "service_quote"
|
|
983
|
+
},
|
|
984
|
+
"service_address": {
|
|
985
|
+
"type": "string",
|
|
986
|
+
"description": "On-chain Service object address (or LocalMark name). Required when query_type='service_quote'."
|
|
987
|
+
},
|
|
988
|
+
"items": {
|
|
989
|
+
"description": "Basket to quote. Omit to quote EVERY sale with quantity 1 (the floor basket — order quantity is chosen at buy time, so per-unit prices are the authoritative input).",
|
|
990
|
+
"type": "array",
|
|
991
|
+
"items": {
|
|
992
|
+
"type": "object",
|
|
993
|
+
"properties": {
|
|
994
|
+
"name": {
|
|
995
|
+
"type": "string",
|
|
996
|
+
"description": "Sale name exactly as configured on the Service."
|
|
997
|
+
},
|
|
998
|
+
"quantity": {
|
|
999
|
+
"default": 1,
|
|
1000
|
+
"description": "Units of this item in the basket (default 1).",
|
|
1001
|
+
"type": "integer",
|
|
1002
|
+
"exclusiveMinimum": 0,
|
|
1003
|
+
"maximum": 10000
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
"required": [
|
|
1007
|
+
"name",
|
|
1008
|
+
"quantity"
|
|
1009
|
+
],
|
|
1010
|
+
"additionalProperties": false
|
|
1011
|
+
}
|
|
1012
|
+
},
|
|
1013
|
+
"context_network": {
|
|
1014
|
+
"type": "string",
|
|
1015
|
+
"enum": [
|
|
1016
|
+
"testnet",
|
|
1017
|
+
"mainnet",
|
|
1018
|
+
"localnet"
|
|
1019
|
+
],
|
|
1020
|
+
"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."
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
"required": [
|
|
1024
|
+
"query_type",
|
|
1025
|
+
"service_address"
|
|
1026
|
+
],
|
|
1027
|
+
"additionalProperties": false,
|
|
1028
|
+
"description": "READ-ONLY pre-purchase quote of a Service (finding 3.6 — order_new total_pay pre-check): per-item unit price × quantity, the basket total that order_new.buy.total_pay.balance must exactly equal (the on-chain buy aborts on any drift), and the order_allocators fee-split preview (sharing rows of the FIRST allocator — the normal payout path; guards select per-case allocators such as refund/damage, so the live split depends on which guard passes). Mirrors the on-chain price×quantity semantics WITHOUT calling quote on-chain and NEVER submits a transaction. Amounts are payment-token smallest units plus a human display when the token precision resolves."
|
|
1029
|
+
},
|
|
977
1030
|
{
|
|
978
1031
|
"type": "object",
|
|
979
1032
|
"properties": {
|
|
@@ -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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{strictParse}from'../../schema/index.js';import{BenchmarkMigrationSchema}from'../../schema/benchmark-migration/index.js';import{getTemplate,listTemplates}from'../../knowledge/template-loader.js';import{scanTemplate}from'../../knowledge/template-scanner.js';import{planMigration}from'../../playbooks/service-build/migration-planner.js';import{handleMerchantGuide}from'../../playbooks/service-build/merchant-guide.js';function templateSummary(a){return{'id':a['id'],'industry':a['industry'],'variant':a['variant'],'archetype':a['archetype'],'key_risk':a['key_risk'],'node_count':a['machine_shape']['length'],'guard_count':a['guards']['length'],'recommended_role':a['recommended_role']};}function requireTemplate(a,b){if(!a)throw new Error('\x27template_id\x27\x20is\x20required\x20for\x20action=\x27'+b+'\x27');const c=getTemplate(a);if(!c)throw new Error('Unknown\x20template\x20id:\x20'+a+'\x20(use\x20action=\x27template_list\x27\x20to\x20see\x20valid\x20ids)');return c;}function scanSummary(a){return{'risk_level':a['risk_level'],'passed':a['passed'],'red_flags':a['red_flags']};}function assertScanPassed(a,b){if(a['passed'])return;throw new Error('action=\x27'+b+'\x27\x20blocked:\x20pre-deploy\x20scan\x20of\x20template\x20\x27'+a['template_id']+'\x27\x20found\x20CRITICAL\x20risk\x20—\x20'+a['red_flags']['join'](';\x20')+'.\x20Fix\x20the\x20template\x20(frontmatter\x20or\x20body)\x20and\x20re-run\x20action=\x27template_scan\x27.');}function templateIntent(a,b){if(b&&b['trim']())return b['trim']();return'Adopt\x20the\x20'+a['id']+'\x20industry\x20archetype\x20template\x20('+a['archetype']+')\x20for\x20the\x20'+a['industry']+'\x20industry.\x20'+('Primary\x20risk\x20to\x20mitigate:\x20'+a['key_risk']+'.');}async function runGuide(a,b,c){const d=await handleMerchantGuide({'intent':templateIntent(a,b),'guide_confirm':{'industry':a['industry']}}),e=c&&Object['keys'](c)['length']>0x0?c:undefined;d['template']={'id':a['id'],'archetype':a['archetype'],'recommended_role':a['recommended_role'],'fee_params':{...a['fee_params'],...e??{}}};if(e)d['template_fee_overrides']=e;return d;}export async function handleBenchmarkMigrationOperation(a){const b=strictParse(BenchmarkMigrationSchema,a,'benchmark_migration_operation\x20input');let c;switch(b['action']){case'template_list':{const {templates:d,errors:e}=listTemplates(),f=b['industry']?d['filter'](g=>g['industry']===b['industry']):d;c={'action':'template_list','count':f['length'],'templates':f['map'](templateSummary),'load_errors':e};break;}case'template_get':{const g=requireTemplate(b['template_id'],'template_get');c={'action':'template_get','template':{...g}};break;}case'template_generate':{const h=requireTemplate(b['template_id'],'template_generate'),i=scanTemplate(h);assertScanPassed(i,'template_generate');const j=await runGuide(h,b['description'],b['fee_overrides']);c={'action':'template_generate','template_id':h['id'],'scan':scanSummary(i),'plan':j};break;}case'template_scan':{const k=requireTemplate(b['template_id'],'template_scan');c={'action':'template_scan','scan':scanTemplate(k)};break;}case'migration_import':{if(!b['description']||!b['description']['trim']())throw new Error('\x27description\x27\x20is\x20required\x20for\x20action=\x27migration_import\x27');const l=planMigration({'url':b['url'],'description':b['description'],'industry':b['industry'],'network':b['network']});if(!l)throw new Error('No\x20industry\x20template\x20matched\x20the\x20description.\x20Refine\x20the\x20description\x20or\x20pass\x20an\x20explicit\x20\x27industry\x27\x20hint.');c={'action':'migration_import','log':l};break;}case'migration_review':{if(!b['log'])throw new Error('\x27log\x27\x20is\x20required\x20for\x20action=\x27migration_review\x27');const m=b['log'],n=Array['isArray'](m['mapped'])?m['mapped']:[],o=Array['isArray'](m['unmapped'])?m['unmapped']:[],p=Array['isArray'](m['manual_review'])?m['manual_review']:[],q=m['risk_check']??{};c={'action':'migration_review','log':m,'review_summary':{'mapped_count':n['length'],'unmapped_count':o['length'],'manual_review_count':p['length'],'risk_passed':q['passed']===!![]}};break;}case'migration_apply':{const r=requireTemplate(b['template_id'],'migration_apply'),s=scanTemplate(r);assertScanPassed(s,'migration_apply');const t=b['network']??'testnet',u=await runGuide(r,b['description'],b['fee_overrides']);c={'action':'migration_apply','template_id':r['id'],'network':t,'scan':scanSummary(s),'plan':u};break;}default:throw new Error('Unknown\x20benchmark_migration_operation\x20action:\x20'+String(b['action']));}return{'content':[{'type':'text','text':JSON['stringify']({'result':c})}],'structuredContent':{'result':c}};}
|
|
1
|
+
import{strictParse}from'../../schema/index.js';import{BenchmarkMigrationSchema}from'../../schema/benchmark-migration/index.js';import{getTemplate,listTemplates}from'../../knowledge/template-loader.js';import{scanTemplate}from'../../knowledge/template-scanner.js';import{planMigration}from'../../playbooks/service-build/migration-planner.js';import{handleMerchantGuide}from'../../playbooks/service-build/merchant-guide.js';import{getIndustryModeRegistry}from'../../extensions/index.js';import{resolveIndustryName}from'../../knowledge/industry-registry.js';function templateSummary(a){return{'id':a['id'],'industry':a['industry'],'variant':a['variant'],'product_ref':a['product_ref'],'archetype':a['archetype'],'key_risk':a['key_risk'],'node_count':a['machine_shape']['length'],'guard_count':a['guards']['length'],'recommended_role':a['recommended_role']};}function requireTemplate(a,b){if(!a)throw new Error('\x27template_id\x27\x20is\x20required\x20for\x20action=\x27'+b+'\x27');const c=getTemplate(a);if(!c)throw new Error('Unknown\x20template\x20id:\x20'+a+'\x20(use\x20action=\x27template_list\x27\x20to\x20see\x20valid\x20ids)');return c;}function scanSummary(a){const b={};for(const c of a['findings'])b[c['severity']]=(b[c['severity']]??0x0)+0x1;return{'risk_level':a['risk_level'],'passed':a['passed'],'finding_count':a['findings']['length'],'findings_by_severity':b,'red_flags':a['red_flags'],'findings':a['findings']};}function assertScanPassed(a,b){if(a['passed'])return;throw new Error('action=\x27'+b+'\x27\x20blocked:\x20pre-deploy\x20scan\x20of\x20template\x20\x27'+a['template_id']+'\x27\x20found\x20CRITICAL\x20risk\x20—\x20'+a['red_flags']['join'](';\x20')+'.\x20Fix\x20the\x20template\x20(frontmatter\x20or\x20body)\x20and\x20re-run\x20action=\x27template_scan\x27.');}function templateIntent(a,b){if(b&&b['trim']())return b['trim']();return'Adopt\x20the\x20'+a['id']+'\x20industry\x20archetype\x20template\x20('+a['archetype']+')\x20for\x20the\x20'+a['industry']+'\x20industry.\x20'+('Primary\x20risk\x20to\x20mitigate:\x20'+a['key_risk']+'.');}function effectiveFeeParams(a,b){return{...a['fee_params'],...b??{}};}function validateFeeParams(a,b){const c=[];let d=0x0;for(const [e,f]of Object['entries'](a)){if(typeof f!=='number'||!Number['isFinite'](f))continue;if(e['endsWith']('_bps')){(!Number['isInteger'](f)||f<0x0||f>0x2710)&&c['push'](e+'='+f+'\x20is\x20not\x20an\x20integer\x20rate\x20in\x20[0,\x2010000]\x20bps');if(e['endsWith']('_share_bps'))d+=Math['max'](0x0,f);}else{if(e['endsWith']('_days')){if(f<=0x0||f>0xe42)c['push'](e+'='+f+'\x20is\x20outside\x20the\x20sane\x20window\x20range\x20(0,\x203650]\x20days');}else{if(e['endsWith']('_hours')){if(f<=0x0||f>0x2238)c['push'](e+'='+f+'\x20is\x20outside\x20the\x20sane\x20window\x20range\x20(0,\x208760]\x20hours');}}}}if(d>0x2710)c['push']('*_share_bps\x20sum\x20'+d+'\x20exceeds\x2010000\x20(a\x20pool\x20splits\x20into\x20at\x20most\x20100%)');if(c['length']>0x0)throw new Error('invalid\x20fee\x20parameters\x20for\x20template\x20\x27'+b+'\x27:\x20'+c['join'](';\x20')+'.\x20'+'Correct\x20the\x20template\x27s\x20fee_params\x20or\x20pass\x20valid\x20\x27fee_overrides\x27.');}function planDivergences(a,b){const c=[],d=b?.['length']??0x0;d!==a['allocator']['count']&&c['push']({'severity':'critical','item':'allocator_row_count','detail':'Template\x20declares\x20'+a['allocator']['count']+'\x20sharing\x20row(s);\x20the\x20generated\x20plan\x20carries\x20'+d+'\x20percentage\x20row(s).','action':'Build\x20the\x20Allocation\x20with\x20the\x20template\x27s\x20own\x20row\x20set\x20(order_allocators\x20is\x20L1\x20—\x20frozen\x20at\x20Service\x20publish).'});a['allocator']['mode']!=='rate'&&c['push']({'severity':'critical','item':'allocation_mode','detail':'Template\x20allocator\x20mode\x20is\x20\x27'+a['allocator']['mode']+'\x27,\x20which\x20a\x20percentage\x20pair\x20cannot\x20represent.','action':'Declare\x20the\x20mode\x20per\x20row\x20explicitly\x20(amount\x20/\x20rate\x20/\x20surplus)\x20instead\x20of\x20publishing\x20the\x20percentage\x20hint.'});const e=a['allocator']['refund_track']!==undefined||/refund/i['test'](a['allocator']['description']);a['allocator']['refund_track']&&c['push']({'severity':'critical','item':'refund_track_not_in_plan','detail':'Template\x20declares\x20a\x20\x27'+a['allocator']['refund_track']+'\x27\x20refund\x20track;\x20the\x20generated\x20plan\x20carries\x20only\x20the\x20settlement\x20split.','action':'Build\x20the\x20second\x20Allocator\x20(Rate\x2010000\x20to\x20the\x20buyer,\x20order-anchored\x20GuardIdentifier\x20recipients)\x20bound\x20to\x20the\x20refund\x20Guard\x20before\x20publish.'});if(!e)c['push']({'severity':'critical','item':'refund_track','detail':'The\x20template\x27s\x20allocator\x20declares\x20no\x20refund\x20track\x20—\x20returns/refunds\x20have\x20no\x20funded\x20path\x20in\x20the\x20money\x20plan.','action':'Add\x20the\x20second\x20Allocator\x20(Rate\x2010000\x20to\x20the\x20buyer)\x20bound\x20to\x20the\x20refund\x20Guard,\x20or\x20confirm\x20with\x20the\x20merchant\x20that\x20refunds\x20are\x20out\x20of\x20scope.'});else!a['allocator']['refund_track']&&c['push']({'severity':'warning','item':'refund_track','detail':'A\x20refund\x20track\x20is\x20declared\x20but\x20not\x20order-anchored,\x20so\x20the\x20refund\x20recipient\x20is\x20resolved\x20from\x20the\x20signer/Entity\x20rather\x20than\x20the\x20paying\x20Order.','action':'Gate\x20the\x20refund\x20track\x20with\x20AND[signer\x20==\x20order.owner,\x20progress.node\x20==\x20X]\x20or\x20move\x20it\x20to\x20an\x20order-anchored\x20GuardIdentifier(0)\x20recipient.'});const f=Object['keys'](a['fee_params'])['filter'](g=>/_(?:days|hours)$/['test'](g));return f['length']>0x0&&!a['time_anchors']&&c['push']({'severity':'warning','item':'window_anchors','detail':'fee_params\x20declares\x20business\x20windows\x20('+f['join'](',\x20')+')\x20but\x20the\x20template\x20declares\x20no\x20time_anchors.','action':'Add\x20time_anchors\x20(or\x20name\x20the\x20window\x20in\x20the\x20Guard\x20set)\x20so\x20the\x20plan\x20emits\x20the\x20release/timeout\x20build\x20steps.'}),c;}function platformShareBps(a){const b=Object['keys'](a)['find'](c=>/(?:platform|commission|service_fee)[a-z_]*_bps$/['test'](c)&&!/^attributed_/['test'](c)&&typeof a[c]==='number');return b!==undefined?a[b]:undefined;}function variantPaymentModel(a){const b=a['machine_shape']['map'](c=>c['name']+'\x20'+c['role'])['join']('\x20')['toLowerCase']();if(/\b(milestone|revision|revis|draft|deliverable)\b/['test'](b))return'milestone';if(/\b(charge|renew|subscription|cycle|billing|monthly)\b/['test'](b))return'subscription';return'escrow';}function variantRefundPolicy(a){const b=a['allocator']['description']['toLowerCase']();if(/full[ -]?refund|100% refund|refund .*100/['test'](b))return'full';if(/pro-?rata|prorated/['test'](b))return'milestone_prorated';if(/partial/['test'](b))return'partial';return undefined;}function variantDeliverables(a,b){const c=[...a['machine_shape']]['reverse']()['find'](e=>!/refund|cancel|dispute|terminat/i['test'](e['name']+'\x20'+e['role']))??a['machine_shape'][a['machine_shape']['length']-0x1],d=b?.['has_logistics']?'physical':b?.['pure_digital']?'digital':'service_session';return[{'name':a['variant']+'\x20fulfillment','type':d,'acceptanceCriteria':'Order\x20reaches\x20the\x20terminal\x20workflow\x20node\x20\x27'+c['name']+'\x27\x20('+c['role']+')','proofOfDelivery':'manual_confirm'}];}function variantModePrior(a,b){if(!b)return undefined;return{...b,'name':a['industry']+'_'+a['variant'],'display_name':a['variant']+'\x20archetype\x20('+a['industry']+')','source':'custom','machine_shape':a['machine_shape']['map'](c=>({...c})),'guards':a['guards']['map'](c=>({...c})),'allocator':{...a['allocator']},'key_risk':a['key_risk'],'build_notes':[...a['build_notes']],...a['time_anchors']?{'time_anchors':{...a['time_anchors']}}:{}};}async function runGuide(a,b,c){const d=effectiveFeeParams(a,c);validateFeeParams(d,a['id']);const e=getIndustryModeRegistry()['getMode'](a['industry']),f=platformShareBps(d),g={'model':variantPaymentModel(a)},h=[];if(f!==undefined){const m=Math['round'](f)/0x64;h['push']({'recipient':'merchant','percentage':Math['round']((0x64-m)*0x64)/0x64}),h['push']({'recipient':'platform','percentage':m}),g['allocation']=h;}const i=variantRefundPolicy(a),j={'escrow':!![]};if(i)j['refundPolicy']=i;const k=await handleMerchantGuide({'intent':templateIntent(a,b),'guide_confirm':{'industry':a['industry'],'payment':g,'trust':j,'deliverables':variantDeliverables(a,e?.['traits'])},'mode_prior_override':variantModePrior(a,e),'name_base':a['id']}),l=planDivergences(a,h);l['length']>0x0&&(k['plan_divergence']={'template_allocator':{...a['allocator']},'template_guard_refs':a['guards']['length'],'plan_allocation':h,'divergences':l,'publish_ready':![]});k['template']={'id':a['id'],'archetype':a['archetype'],'recommended_role':a['recommended_role'],'fee_params':d};if(c&&Object['keys'](c)['length']>0x0)k['template_fee_overrides']=c;return k;}export async function handleBenchmarkMigrationOperation(a){const b=strictParse(BenchmarkMigrationSchema,a,'benchmark_migration_operation\x20input'),c=b['industry']?resolveIndustryName(b['industry'])??b['industry']['toLowerCase']():undefined;let d;switch(b['action']){case'template_list':{const {templates:e,errors:f}=listTemplates(),g=c?e['filter'](h=>h['industry']===c):e;d={'action':'template_list','count':g['length'],'templates':g['map'](templateSummary),'load_errors':f};break;}case'template_get':{const h=requireTemplate(b['template_id'],'template_get');d={'action':'template_get','template':{...h}};break;}case'template_generate':{const i=requireTemplate(b['template_id'],'template_generate'),j=scanTemplate(i);assertScanPassed(j,'template_generate');const k=await runGuide(i,b['description'],b['fee_overrides']);d={'action':'template_generate','template_id':i['id'],'scan':scanSummary(j),'plan':k};break;}case'template_scan':{const l=requireTemplate(b['template_id'],'template_scan');d={'action':'template_scan','scan':scanTemplate(l)};break;}case'migration_import':{if(!b['description']||!b['description']['trim']())throw new Error('\x27description\x27\x20is\x20required\x20for\x20action=\x27migration_import\x27');const m=planMigration({'url':b['url'],'description':b['description'],'industry':c,'network':b['network']});if(!m)throw new Error('No\x20industry\x20template\x20matched\x20the\x20description.\x20Refine\x20the\x20description\x20or\x20pass\x20an\x20explicit\x20\x27industry\x27\x20hint.');d={'action':'migration_import','log':m};break;}case'migration_review':{if(!b['log'])throw new Error('\x27log\x27\x20is\x20required\x20for\x20action=\x27migration_review\x27');const n=b['log'],o=Array['isArray'](n['mapped'])?n['mapped']:[],p=Array['isArray'](n['unmapped'])?n['unmapped']:[],q=Array['isArray'](n['manual_review'])?n['manual_review']:[],r=n['risk_check']??{};d={'action':'migration_review','log':n,'review_summary':{'mapped_count':o['length'],'unmapped_count':p['length'],'manual_review_count':q['length'],'risk_passed':r['passed']===!![]}};break;}case'migration_apply':{const s=requireTemplate(b['template_id'],'migration_apply'),t=scanTemplate(s);assertScanPassed(t,'migration_apply');const u=b['network']??'testnet',v=await runGuide(s,b['description'],b['fee_overrides']);d={'action':'migration_apply','template_id':s['id'],'network':u,'scan':scanSummary(t),'plan':v};break;}default:throw new Error('Unknown\x20benchmark_migration_operation\x20action:\x20'+String(b['action']));}return{'content':[{'type':'text','text':JSON['stringify']({'result':d})}],'structuredContent':{'result':d}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{listServices,getServiceInfo,toggle as
|
|
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 +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','
|
|
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','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'}]);});});
|
|
@@ -4,7 +4,7 @@ import { type KeeperScanDeps } from "../../keeper/KeeperScan.js";
|
|
|
4
4
|
import type { ScopeSnapshot } from "../../monitor/types.js";
|
|
5
5
|
export interface KeeperOperationDeps {
|
|
6
6
|
store: KeeperStore;
|
|
7
|
-
scan: Pick<KeeperScanDeps, "payment" | "progress" | "execute" | "now" | "logger">;
|
|
7
|
+
scan: Pick<KeeperScanDeps, "payment" | "progress" | "settlement" | "execute" | "now" | "logger">;
|
|
8
8
|
loadScope(network: string): Promise<ScopeSnapshot | undefined>;
|
|
9
9
|
resolveScope(network: string): Promise<ScopeSnapshot>;
|
|
10
10
|
}
|