@wowok/agent-mcp 3.3.5 → 3.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chain-semantics/eval-order.d.ts +17 -0
- package/dist/chain-semantics/eval-order.js +1 -0
- package/dist/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/guard-verbs.js +1 -1
- package/dist/chain-semantics/index.d.ts +1 -0
- package/dist/chain-semantics/index.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +2 -1
- package/dist/composition/compile.js +1 -1
- package/dist/composition/materialize.js +1 -1
- package/dist/data/api/api.spec.d.ts +1 -0
- package/dist/data/api/api.spec.js +1 -0
- package/dist/data/api/cli.d.ts +1 -0
- package/dist/data/api/cli.js +1 -0
- package/dist/data/api/head.d.ts +16 -0
- package/dist/data/api/head.js +1 -0
- package/dist/data/api/head.spec.d.ts +1 -0
- package/dist/data/api/head.spec.js +1 -0
- package/dist/data/api/index.d.ts +2 -0
- package/dist/data/api/index.js +1 -0
- package/dist/data/api/match.d.ts +69 -0
- package/dist/data/api/match.js +1 -0
- package/dist/data/api/match.spec.d.ts +1 -0
- package/dist/data/api/match.spec.js +1 -0
- package/dist/data/api/server.d.ts +12 -0
- package/dist/data/api/server.js +1 -0
- package/dist/data/projection/cli.d.ts +1 -0
- package/dist/data/projection/cli.js +1 -0
- package/dist/data/projection/edges.d.ts +8 -0
- package/dist/data/projection/edges.js +1 -0
- package/dist/data/projection/edges.spec.d.ts +1 -0
- package/dist/data/projection/edges.spec.js +1 -0
- package/dist/data/projection/facets.d.ts +18 -0
- package/dist/data/projection/facets.js +1 -0
- package/dist/data/projection/facets.spec.d.ts +1 -0
- package/dist/data/projection/facets.spec.js +1 -0
- package/dist/data/projection/facts.d.ts +40 -0
- package/dist/data/projection/facts.js +1 -0
- package/dist/data/projection/index.d.ts +6 -0
- package/dist/data/projection/index.js +1 -0
- package/dist/data/projection/project.d.ts +10 -0
- package/dist/data/projection/project.js +1 -0
- package/dist/data/projection/projection.spec.d.ts +1 -0
- package/dist/data/projection/projection.spec.js +1 -0
- package/dist/data/projection/schema.d.ts +1 -0
- package/dist/data/projection/schema.js +1 -0
- package/dist/data/projection/store.d.ts +49 -0
- package/dist/data/projection/store.js +1 -0
- package/dist/data/projection/types.d.ts +137 -0
- package/dist/data/projection/types.js +1 -0
- package/dist/data/sync/cdc.d.ts +34 -0
- package/dist/data/sync/cdc.js +1 -0
- package/dist/data/sync/cdc.spec.d.ts +1 -0
- package/dist/data/sync/cdc.spec.js +1 -0
- package/dist/data/sync/graphql-source.d.ts +16 -0
- package/dist/data/sync/graphql-source.js +1 -0
- package/dist/data/sync/index.d.ts +5 -0
- package/dist/data/sync/index.js +1 -0
- package/dist/data/sync/reconciler.d.ts +14 -0
- package/dist/data/sync/reconciler.js +1 -0
- package/dist/data/sync/reconciler.spec.d.ts +1 -0
- package/dist/data/sync/reconciler.spec.js +1 -0
- package/dist/data/sync/schema.d.ts +1 -0
- package/dist/data/sync/schema.js +1 -0
- package/dist/data/sync/store.d.ts +19 -0
- package/dist/data/sync/store.js +1 -0
- package/dist/data/sync/sync.spec.d.ts +1 -0
- package/dist/data/sync/sync.spec.js +1 -0
- package/dist/data/sync/synchronizer.d.ts +10 -0
- package/dist/data/sync/synchronizer.js +1 -0
- package/dist/data/sync/types.d.ts +162 -0
- package/dist/data/sync/types.js +1 -0
- package/dist/evaluation/builtins/demand-match.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/capability.d.ts +1 -0
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/extract.d.ts +7 -1
- package/dist/evaluation/extract.js +1 -1
- package/dist/evaluation/match-policy.d.ts +142 -0
- package/dist/evaluation/match-policy.js +1 -0
- package/dist/evaluation/match-policy.spec.d.ts +1 -0
- package/dist/evaluation/match-policy.spec.js +1 -0
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/business-modules.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/intent/types.d.ts +1 -1
- package/dist/intent/types.js +1 -1
- package/dist/keeper/detectors.d.ts +3 -0
- package/dist/keeper/detectors.js +1 -1
- package/dist/keeper/keeper.spec.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/plan.json +113 -3
- package/dist/knowledge/builtin-templates.d.ts +6 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/getting-started.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-puzzle.js +1 -1
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-generalizer.d.ts +4 -0
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.d.ts +26 -10
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/projection.d.ts +54 -0
- package/dist/knowledge/projection.js +1 -0
- package/dist/knowledge/projection.spec.d.ts +1 -0
- package/dist/knowledge/projection.spec.js +1 -0
- package/dist/knowledge/recipient-constraint.d.ts +1 -1
- package/dist/knowledge/recipient-constraint.js +1 -1
- package/dist/knowledge/semantic-ir.d.ts +113 -0
- package/dist/knowledge/semantic-ir.js +1 -0
- package/dist/knowledge/service-ledger.d.ts +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +34 -0
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-prose.d.ts +50 -0
- package/dist/knowledge/template-prose.js +1 -0
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +1 -1
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/monitor/normalize.d.ts +1 -1
- package/dist/monitor/normalize.js +1 -1
- package/dist/monitor/types.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +4 -0
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.d.ts +2 -1
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/mode-actions.d.ts +7 -0
- package/dist/playbooks/service-build/mode-actions.js +1 -1
- package/dist/playbooks/service-build/object-panorama.d.ts +22 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping.d.ts +1 -0
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/role/profiles.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +64 -10
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +8 -0
- package/dist/schema/call/bridge.d.ts +2 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/proof.js +1 -1
- package/dist/schema/call/reward.d.ts +10 -0
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/evaluation/index.d.ts +341 -0
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +2 -0
- package/dist/schema/goal/planning.d.ts +3 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +62 -0
- package/dist/schema/industry-pack/modes.d.ts +62 -0
- package/dist/schema/industry-pack/modes.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +3 -0
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/local/index.d.ts +20 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/operations.d.ts +5 -0
- package/dist/schema/query/bi.d.ts +4 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +145 -47
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +2 -0
- package/dist/schemas/benchmark_migration_operation.output.json +42 -0
- package/dist/schemas/benchmark_migration_operation.schema.json +208 -5
- package/dist/schemas/bridge_operation.output.json +2 -0
- package/dist/schemas/evaluation_operation.output.json +624 -2
- package/dist/schemas/evaluation_operation.schema.json +598 -4
- package/dist/schemas/goal_operation.schema.json +18 -10
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +86 -2
- package/dist/schemas/industry_pack_operation.schema.json +199 -0
- package/dist/schemas/intent_radar.output.json +2 -0
- package/dist/schemas/intent_radar.schema.json +1 -0
- package/dist/schemas/local_cache_operation.output.json +2 -0
- package/dist/schemas/local_history_operation.output.json +2 -0
- package/dist/schemas/local_info_operation.output.json +2 -0
- package/dist/schemas/local_mark_operation.output.json +2 -0
- package/dist/schemas/onchain_events.output.json +281 -11
- package/dist/schemas/onchain_events.schema.json +5 -1
- package/dist/schemas/onchain_operations.output.json +2 -0
- package/dist/schemas/onchain_operations.schema.json +914 -314
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1
- package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +660 -94
- package/dist/schemas/onchain_operations_reward.schema.json +35 -1
- package/dist/schemas/onchain_operations_service.schema.json +4 -4
- package/dist/schemas/query_toolkit.output.json +333 -0
- package/dist/tools/handlers/benchmark-migration.d.ts +5 -2
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/evaluation.spec.js +1 -1
- package/dist/tools/handlers/intent-radar.js +1 -1
- package/dist/tools/handlers/messenger.d.ts +1 -0
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +2 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/wip.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/agent.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/wip-verify-ledger.d.ts +14 -0
- package/dist/tools/wip-verify-ledger.js +1 -0
- package/dist/tools/wrap.d.ts +4 -0
- package/dist/tools/wrap.js +1 -1
- package/package.json +7 -2
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
]
|
|
226
226
|
},
|
|
227
227
|
"guard_add": {
|
|
228
|
-
"description": "Add Guard to Reward object. IDIOMS (F08 — these differ from Service allocation, follow THIS shape here): recipient is ONE OF {GuardIdentifier: <u8>} | {Entity: {name_or_address: 'mark'}} | {Signer: 'signer'} (string const INSIDE the key, NOT a bare string) — BUT on the REWARD claim rail the recipient MUST equal the transaction sender (chain assert, abort 14), so {Signer: 'signer'} is the canonical form and {Entity} also passes (SDK replaces it with the claimant's account at claim time); a {GuardIdentifier} recipient resolves to the submitted Order and is STRUCTURALLY UNPAYABLE (every claim aborts 14) — the tool gate rejects it (crs-mn-261015 F-12). amount is {type: 'Fixed', value: '0.1WOW'} — value accepts a display string with token symbol ('0.1WOW') or a smallest-unit integer ('100000000'), NOT the plain balance string used by allocation `sharing`. FULL EXAMPLE: [{guard: '0xabc...', recipient: {Signer: 'signer'}, amount: {type: 'Fixed', value: '0.1WOW'}}].",
|
|
228
|
+
"description": "Add Guard to Reward object. IDIOMS (F08 — these differ from Service allocation, follow THIS shape here): recipient is ONE OF {GuardIdentifier: <u8>} | {Entity: {name_or_address: 'mark'}} | {Signer: 'signer'} (string const INSIDE the key, NOT a bare string) — BUT on the REWARD claim rail the recipient MUST equal the transaction sender (chain assert, abort 14), so {Signer: 'signer'} is the canonical form and {Entity} also passes (SDK replaces it with the claimant's account at claim time); a {GuardIdentifier} recipient resolves to the submitted Order and is STRUCTURALLY UNPAYABLE (every claim aborts 14) — the tool gate rejects it (crs-mn-261015 F-12). amount is {type: 'Fixed', value: '0.1WOW'} — value accepts a display string with token symbol ('0.1WOW') or a smallest-unit integer ('100000000'), NOT the plain balance string used by allocation `sharing`. FULL EXAMPLE: [{guard: '0xabc...', recipient: {Signer: 'signer'}, amount: {type: 'Fixed', value: '0.1WOW'}}]. OPTIONAL EVIDENCE BINDING (ksk9d2-tn-261026 F-01): an entry may carry evidence {repo, key, predicate} — a claim-time attestation pin that counts ONLY repository rows tied to THIS claim's own store_from value (the submitted order), so borrowed/foreign rows never satisfy the bounty; it requires store_from_id on the same guard (a missing pin aborts 16 at build time) and a claim whose order has no matching attestation row aborts 15.",
|
|
229
229
|
"type": "array",
|
|
230
230
|
"items": {
|
|
231
231
|
"type": "object",
|
|
@@ -363,6 +363,40 @@
|
|
|
363
363
|
"type": "null"
|
|
364
364
|
}
|
|
365
365
|
]
|
|
366
|
+
},
|
|
367
|
+
"evidence": {
|
|
368
|
+
"description": "ksk9d2-tn-261026 F-01 claim-time attestation pin (reward::evidence_bind). REQUIRES store_from_id on the SAME guard — the binding reads THE pinned store_from row, so the chain aborts 16 (E_EVIDENCE_NEEDS_STORE_FROM) at build time without it. At claim the chain counts repository rows under (repo, key) matching the predicate for the claim's OWN store_from value (the submitted order) via the native evidence_count and aborts 15 (E_EVIDENCE_NOT_OWNED) when none — a borrowed foreign row can never pay.",
|
|
369
|
+
"type": "object",
|
|
370
|
+
"properties": {
|
|
371
|
+
"repo": {
|
|
372
|
+
"type": "string",
|
|
373
|
+
"description": "Repository object ID or name holding the attestation rows."
|
|
374
|
+
},
|
|
375
|
+
"key": {
|
|
376
|
+
"type": "array",
|
|
377
|
+
"items": {
|
|
378
|
+
"type": "integer",
|
|
379
|
+
"minimum": 0,
|
|
380
|
+
"maximum": 255
|
|
381
|
+
},
|
|
382
|
+
"description": "Repository data key bytes (the policy name the rows live under, e.g. UTF-8 bytes of 'rating')."
|
|
383
|
+
},
|
|
384
|
+
"predicate": {
|
|
385
|
+
"type": "array",
|
|
386
|
+
"items": {
|
|
387
|
+
"type": "integer",
|
|
388
|
+
"minimum": 0,
|
|
389
|
+
"maximum": 255
|
|
390
|
+
},
|
|
391
|
+
"description": "BCS-encoded RepositoryDataPredicateWire bytes — the same predicate blob the repository read channel uses."
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"required": [
|
|
395
|
+
"repo",
|
|
396
|
+
"key",
|
|
397
|
+
"predicate"
|
|
398
|
+
],
|
|
399
|
+
"additionalProperties": false
|
|
366
400
|
}
|
|
367
401
|
},
|
|
368
402
|
"required": [
|
|
@@ -670,7 +670,7 @@
|
|
|
670
670
|
]
|
|
671
671
|
},
|
|
672
672
|
"restock": {
|
|
673
|
-
"description": "Refund restocking (permission 305 SERVICE_SALES). op:'flag' opts ONE live product into restock-on-refund; op:'order' puts the units a REFUNDED order purchased back on shelf. The order path is all-or-nothing: every purchased line must be flagged and still live before any unit moves (otherwise the chain aborts 46/32), so half a restock is impossible. Do NOT fake a restock with stock_add when the order carries several lines — use op:'order' so quantities come from the order itself.",
|
|
673
|
+
"description": "Refund restocking (permission 305 SERVICE_SALES). op:'flag' opts ONE live product into restock-on-refund; op:'order' puts the units a REFUNDED order purchased back on shelf. The order path is all-or-nothing: every purchased line must be flagged and still live before any unit moves (otherwise the chain aborts 46/32), so half a restock is impossible. The order path is once-per-order (replay aborts 49) and bound to THIS service (foreign order aborts 26). Do NOT fake a restock with stock_add when the order carries several lines — use op:'order' so quantities come from the order itself. DISCLOSURE: restock reopens sales — if the machine (or its template) has no refund-terminal gate, orders inside their refund window may lose refund eligibility or create fund-accounting ambiguity once restocked units are resold; confirm the machine's refund rail remains reachable after restocking.",
|
|
674
674
|
"oneOf": [
|
|
675
675
|
{
|
|
676
676
|
"type": "object",
|
|
@@ -694,7 +694,7 @@
|
|
|
694
694
|
"flagged"
|
|
695
695
|
],
|
|
696
696
|
"additionalProperties": false,
|
|
697
|
-
"description": "Opt ONE live product in/out of restock-on-refund. An unknown sale_name aborts on chain (code 32); delisting the product is the kill switch. Without the flag, the order-level restock op refuses that line (code 46)."
|
|
697
|
+
"description": "Opt ONE live product in/out of restock-on-refund. An unknown sale_name aborts on chain (code 32); delisting the product is the kill switch. Without the flag, the order-level restock op refuses that line (code 46). Flagging a SKU does not itself touch stock — the order-level op below does the restoration, and it is once-per-order per order (code 49) and bound to orders of THIS service (foreign orders abort code 26)."
|
|
698
698
|
},
|
|
699
699
|
{
|
|
700
700
|
"type": "object",
|
|
@@ -706,7 +706,7 @@
|
|
|
706
706
|
"order": {
|
|
707
707
|
"type": "string",
|
|
708
708
|
"minLength": 1,
|
|
709
|
-
"description": "Address or local name of the REFUNDED order whose purchased units go back on shelf."
|
|
709
|
+
"description": "Address or local name of the REFUNDED order whose purchased units go back on shelf. Must be an order of THIS service (a foreign order aborts code 26), and each order can be restocked exactly once — a second call for the same order aborts code 49 (no retry succeeds; the restoration is already complete)."
|
|
710
710
|
}
|
|
711
711
|
},
|
|
712
712
|
"required": [
|
|
@@ -714,7 +714,7 @@
|
|
|
714
714
|
"order"
|
|
715
715
|
],
|
|
716
716
|
"additionalProperties": false,
|
|
717
|
-
"description": "Put back the units one refunded order purchased, read from the order's own purchase lines (the caller cannot add extra units). Two-pass all-or-nothing on chain: every line must be restock-flagged and still live before the first unit moves (unflagged → code 46, delisted → code 32), so a partial restock is impossible. Emits one stock-restocked event per line."
|
|
717
|
+
"description": "Put back the units one refunded order purchased, read from the order's own purchase lines (the caller cannot add extra units). Two-pass all-or-nothing on chain: every line must be restock-flagged and still live before the first unit moves (unflagged → code 46, delisted → code 32), so a partial restock is impossible. Once-per-order (code 49 on replay) and ownership-bound (a foreign order aborts code 26); the applied state is queryable via the restock_applied read. Emits one stock-restocked event per line."
|
|
718
718
|
}
|
|
719
719
|
]
|
|
720
720
|
},
|
|
@@ -5374,6 +5374,40 @@
|
|
|
5374
5374
|
"type": "null"
|
|
5375
5375
|
}
|
|
5376
5376
|
]
|
|
5377
|
+
},
|
|
5378
|
+
"evidence": {
|
|
5379
|
+
"description": "ksk9d2-tn-261026 F-01 claim-time attestation pin (reward::evidence_bind). REQUIRES store_from_id on the SAME guard — the binding reads THE pinned store_from row, so the chain aborts 16 (E_EVIDENCE_NEEDS_STORE_FROM) at build time without it. At claim the chain counts repository rows under (repo, key) matching the predicate for the claim's OWN store_from value (the submitted order) via the native evidence_count and aborts 15 (E_EVIDENCE_NOT_OWNED) when none — a borrowed foreign row can never pay.",
|
|
5380
|
+
"type": "object",
|
|
5381
|
+
"properties": {
|
|
5382
|
+
"repo": {
|
|
5383
|
+
"type": "string",
|
|
5384
|
+
"description": "Repository object ID or name holding the attestation rows."
|
|
5385
|
+
},
|
|
5386
|
+
"key": {
|
|
5387
|
+
"type": "array",
|
|
5388
|
+
"items": {
|
|
5389
|
+
"type": "integer",
|
|
5390
|
+
"minimum": 0,
|
|
5391
|
+
"maximum": 255
|
|
5392
|
+
},
|
|
5393
|
+
"description": "Repository data key bytes (the policy name the rows live under, e.g. UTF-8 bytes of 'rating')."
|
|
5394
|
+
},
|
|
5395
|
+
"predicate": {
|
|
5396
|
+
"type": "array",
|
|
5397
|
+
"items": {
|
|
5398
|
+
"type": "integer",
|
|
5399
|
+
"minimum": 0,
|
|
5400
|
+
"maximum": 255
|
|
5401
|
+
},
|
|
5402
|
+
"description": "BCS-encoded RepositoryDataPredicateWire bytes — the same predicate blob the repository read channel uses."
|
|
5403
|
+
}
|
|
5404
|
+
},
|
|
5405
|
+
"required": [
|
|
5406
|
+
"repo",
|
|
5407
|
+
"key",
|
|
5408
|
+
"predicate"
|
|
5409
|
+
],
|
|
5410
|
+
"additionalProperties": false
|
|
5377
5411
|
}
|
|
5378
5412
|
},
|
|
5379
5413
|
"required": [
|
|
@@ -16524,6 +16558,20 @@
|
|
|
16524
16558
|
}
|
|
16525
16559
|
]
|
|
16526
16560
|
},
|
|
16561
|
+
"shortfall": {
|
|
16562
|
+
"type": "string",
|
|
16563
|
+
"description": "Raw smallest units the merchant must add via service.compensation_fund_add before THIS basket can be ordered: max(0, required_for_this_basket - fund_balance). 0 when already covered."
|
|
16564
|
+
},
|
|
16565
|
+
"shortfall_display": {
|
|
16566
|
+
"anyOf": [
|
|
16567
|
+
{
|
|
16568
|
+
"type": "string"
|
|
16569
|
+
},
|
|
16570
|
+
{
|
|
16571
|
+
"type": "null"
|
|
16572
|
+
}
|
|
16573
|
+
]
|
|
16574
|
+
},
|
|
16527
16575
|
"covered": {
|
|
16528
16576
|
"type": "boolean",
|
|
16529
16577
|
"description": "True when the fund covers the per-order requirement; false means no fund (a disclosed merchant choice) or an under-funded Service."
|
|
@@ -16539,6 +16587,8 @@
|
|
|
16539
16587
|
"max_coverable_order_display",
|
|
16540
16588
|
"required_for_this_basket",
|
|
16541
16589
|
"required_display",
|
|
16590
|
+
"shortfall",
|
|
16591
|
+
"shortfall_display",
|
|
16542
16592
|
"covered",
|
|
16543
16593
|
"note"
|
|
16544
16594
|
],
|
|
@@ -25909,6 +25959,289 @@
|
|
|
25909
25959
|
"additionalProperties": false,
|
|
25910
25960
|
"description": "Returns U256. Sums the numeric payloads of candidates whose stored value matches the predicate (on-chain checked add, overflow aborts). Non-numeric or mismatching entries contribute 0. Use logic_as_u256_* to compare the sum."
|
|
25911
25961
|
},
|
|
25962
|
+
{
|
|
25963
|
+
"type": "object",
|
|
25964
|
+
"properties": {
|
|
25965
|
+
"type": {
|
|
25966
|
+
"type": "string",
|
|
25967
|
+
"const": "query_repository_data_sum_where_bound"
|
|
25968
|
+
},
|
|
25969
|
+
"object": {
|
|
25970
|
+
"type": "object",
|
|
25971
|
+
"properties": {
|
|
25972
|
+
"identifier": {
|
|
25973
|
+
"type": "integer",
|
|
25974
|
+
"minimum": 0,
|
|
25975
|
+
"maximum": 255,
|
|
25976
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds). SLOT 0 SEMANTICS: slot 0 carries the transacted Order address by convention. As a submission slot it is legal on order/allocation/machine rails (the order exists when those verify), but FORBIDDEN on a Service buy_guard — the order does not exist when the buy-time passport is verified, so the mount is refused (service abort 43)."
|
|
25977
|
+
}
|
|
25978
|
+
},
|
|
25979
|
+
"required": [
|
|
25980
|
+
"identifier"
|
|
25981
|
+
],
|
|
25982
|
+
"additionalProperties": false,
|
|
25983
|
+
"description": "Reference to the Repository object in the Guard table (must be Address type)."
|
|
25984
|
+
},
|
|
25985
|
+
"key": {
|
|
25986
|
+
"type": "object",
|
|
25987
|
+
"properties": {
|
|
25988
|
+
"identifier": {
|
|
25989
|
+
"type": "integer",
|
|
25990
|
+
"minimum": 0,
|
|
25991
|
+
"maximum": 255,
|
|
25992
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds). SLOT 0 SEMANTICS: slot 0 carries the transacted Order address by convention. As a submission slot it is legal on order/allocation/machine rails (the order exists when those verify), but FORBIDDEN on a Service buy_guard — the order does not exist when the buy-time passport is verified, so the mount is refused (service abort 43)."
|
|
25993
|
+
}
|
|
25994
|
+
},
|
|
25995
|
+
"required": [
|
|
25996
|
+
"identifier"
|
|
25997
|
+
],
|
|
25998
|
+
"additionalProperties": false,
|
|
25999
|
+
"description": "Reference to the policy key (String type table entry) whose data table is scanned."
|
|
26000
|
+
},
|
|
26001
|
+
"ids": {
|
|
26002
|
+
"type": "object",
|
|
26003
|
+
"properties": {
|
|
26004
|
+
"identifier": {
|
|
26005
|
+
"type": "integer",
|
|
26006
|
+
"minimum": 0,
|
|
26007
|
+
"maximum": 255,
|
|
26008
|
+
"description": "Identifier (0-255) for data lookup in Guard table. Slot consensus (enforced on-chain at guard table construction): 0-220 = user slots (free for business guards); 221-253 = PROTOCOL-RESERVED (rejected on-chain — reserved so future protocol features get fixed slots without colliding with published guards); 255 = ONCE replay-protection slot on Allocation (byte-keyed, the submitted bytes are the once-key — use for per-period keys like period-<N>); 254 = ONCE-FOR-OBJECT slot on Allocation (chain-derived key = bcs(the Allocation's payment_info.for_object); the submitted bytes are ignored and the submission only arms the slot — use for one-shot per-order rails such as full refunds). SLOT 0 SEMANTICS: slot 0 carries the transacted Order address by convention. As a submission slot it is legal on order/allocation/machine rails (the order exists when those verify), but FORBIDDEN on a Service buy_guard — the order does not exist when the buy-time passport is verified, so the mount is refused (service abort 43)."
|
|
26009
|
+
}
|
|
26010
|
+
},
|
|
26011
|
+
"required": [
|
|
26012
|
+
"identifier"
|
|
26013
|
+
],
|
|
26014
|
+
"additionalProperties": false,
|
|
26015
|
+
"description": "Reference to the candidate ID list (VecAddress type table entry). Each id should be an ORDER address (e.g. order-keyed contribution rows). Duplicates are deduped; max 100 candidates."
|
|
26016
|
+
},
|
|
26017
|
+
"where": {
|
|
26018
|
+
"oneOf": [
|
|
26019
|
+
{
|
|
26020
|
+
"type": "object",
|
|
26021
|
+
"properties": {
|
|
26022
|
+
"kind": {
|
|
26023
|
+
"type": "string",
|
|
26024
|
+
"const": "range"
|
|
26025
|
+
},
|
|
26026
|
+
"valueMin": {
|
|
26027
|
+
"description": "Optional lower bound (inclusive unless minInclusive=false). Plain number string (U256 semantics).",
|
|
26028
|
+
"type": "string"
|
|
26029
|
+
},
|
|
26030
|
+
"valueMax": {
|
|
26031
|
+
"description": "Optional upper bound (inclusive unless maxInclusive=false). Plain number string (U256 semantics).",
|
|
26032
|
+
"type": "string"
|
|
26033
|
+
},
|
|
26034
|
+
"minInclusive": {
|
|
26035
|
+
"description": "Default true. false makes the lower bound exclusive.",
|
|
26036
|
+
"type": "boolean"
|
|
26037
|
+
},
|
|
26038
|
+
"maxInclusive": {
|
|
26039
|
+
"description": "Default true. false makes the upper bound exclusive.",
|
|
26040
|
+
"type": "boolean"
|
|
26041
|
+
}
|
|
26042
|
+
},
|
|
26043
|
+
"required": [
|
|
26044
|
+
"kind"
|
|
26045
|
+
],
|
|
26046
|
+
"additionalProperties": false,
|
|
26047
|
+
"description": "Numeric closed/open range. min=max inclusive is an equality match. At least one bound required."
|
|
26048
|
+
},
|
|
26049
|
+
{
|
|
26050
|
+
"type": "object",
|
|
26051
|
+
"properties": {
|
|
26052
|
+
"kind": {
|
|
26053
|
+
"type": "string",
|
|
26054
|
+
"const": "numEq"
|
|
26055
|
+
},
|
|
26056
|
+
"value": {
|
|
26057
|
+
"type": "string",
|
|
26058
|
+
"description": "Exact numeric match. Plain number string (U256 semantics)."
|
|
26059
|
+
}
|
|
26060
|
+
},
|
|
26061
|
+
"required": [
|
|
26062
|
+
"kind",
|
|
26063
|
+
"value"
|
|
26064
|
+
],
|
|
26065
|
+
"additionalProperties": false
|
|
26066
|
+
},
|
|
26067
|
+
{
|
|
26068
|
+
"type": "object",
|
|
26069
|
+
"properties": {
|
|
26070
|
+
"kind": {
|
|
26071
|
+
"type": "string",
|
|
26072
|
+
"const": "gt"
|
|
26073
|
+
},
|
|
26074
|
+
"value": {
|
|
26075
|
+
"type": "string",
|
|
26076
|
+
"description": "Greater than. Plain number string (U256 semantics)."
|
|
26077
|
+
}
|
|
26078
|
+
},
|
|
26079
|
+
"required": [
|
|
26080
|
+
"kind",
|
|
26081
|
+
"value"
|
|
26082
|
+
],
|
|
26083
|
+
"additionalProperties": false
|
|
26084
|
+
},
|
|
26085
|
+
{
|
|
26086
|
+
"type": "object",
|
|
26087
|
+
"properties": {
|
|
26088
|
+
"kind": {
|
|
26089
|
+
"type": "string",
|
|
26090
|
+
"const": "gte"
|
|
26091
|
+
},
|
|
26092
|
+
"value": {
|
|
26093
|
+
"type": "string",
|
|
26094
|
+
"description": "Greater than or equal. Plain number string (U256 semantics)."
|
|
26095
|
+
}
|
|
26096
|
+
},
|
|
26097
|
+
"required": [
|
|
26098
|
+
"kind",
|
|
26099
|
+
"value"
|
|
26100
|
+
],
|
|
26101
|
+
"additionalProperties": false
|
|
26102
|
+
},
|
|
26103
|
+
{
|
|
26104
|
+
"type": "object",
|
|
26105
|
+
"properties": {
|
|
26106
|
+
"kind": {
|
|
26107
|
+
"type": "string",
|
|
26108
|
+
"const": "lt"
|
|
26109
|
+
},
|
|
26110
|
+
"value": {
|
|
26111
|
+
"type": "string",
|
|
26112
|
+
"description": "Less than. Plain number string (U256 semantics)."
|
|
26113
|
+
}
|
|
26114
|
+
},
|
|
26115
|
+
"required": [
|
|
26116
|
+
"kind",
|
|
26117
|
+
"value"
|
|
26118
|
+
],
|
|
26119
|
+
"additionalProperties": false
|
|
26120
|
+
},
|
|
26121
|
+
{
|
|
26122
|
+
"type": "object",
|
|
26123
|
+
"properties": {
|
|
26124
|
+
"kind": {
|
|
26125
|
+
"type": "string",
|
|
26126
|
+
"const": "lte"
|
|
26127
|
+
},
|
|
26128
|
+
"value": {
|
|
26129
|
+
"type": "string",
|
|
26130
|
+
"description": "Less than or equal. Plain number string (U256 semantics)."
|
|
26131
|
+
}
|
|
26132
|
+
},
|
|
26133
|
+
"required": [
|
|
26134
|
+
"kind",
|
|
26135
|
+
"value"
|
|
26136
|
+
],
|
|
26137
|
+
"additionalProperties": false
|
|
26138
|
+
},
|
|
26139
|
+
{
|
|
26140
|
+
"type": "object",
|
|
26141
|
+
"properties": {
|
|
26142
|
+
"kind": {
|
|
26143
|
+
"type": "string",
|
|
26144
|
+
"const": "addressEq"
|
|
26145
|
+
},
|
|
26146
|
+
"identifier": {
|
|
26147
|
+
"type": "integer",
|
|
26148
|
+
"minimum": 0,
|
|
26149
|
+
"maximum": 255,
|
|
26150
|
+
"description": "Identifier of the Address-type table entry to compare against."
|
|
26151
|
+
}
|
|
26152
|
+
},
|
|
26153
|
+
"required": [
|
|
26154
|
+
"kind",
|
|
26155
|
+
"identifier"
|
|
26156
|
+
],
|
|
26157
|
+
"additionalProperties": false
|
|
26158
|
+
},
|
|
26159
|
+
{
|
|
26160
|
+
"type": "object",
|
|
26161
|
+
"properties": {
|
|
26162
|
+
"kind": {
|
|
26163
|
+
"type": "string",
|
|
26164
|
+
"const": "stringEq"
|
|
26165
|
+
},
|
|
26166
|
+
"value": {
|
|
26167
|
+
"type": "string",
|
|
26168
|
+
"description": "Exact string match (byte equality, UTF-8)."
|
|
26169
|
+
}
|
|
26170
|
+
},
|
|
26171
|
+
"required": [
|
|
26172
|
+
"kind",
|
|
26173
|
+
"value"
|
|
26174
|
+
],
|
|
26175
|
+
"additionalProperties": false
|
|
26176
|
+
},
|
|
26177
|
+
{
|
|
26178
|
+
"type": "object",
|
|
26179
|
+
"properties": {
|
|
26180
|
+
"kind": {
|
|
26181
|
+
"type": "string",
|
|
26182
|
+
"const": "stringContains"
|
|
26183
|
+
},
|
|
26184
|
+
"value": {
|
|
26185
|
+
"type": "string",
|
|
26186
|
+
"description": "Substring match, case-sensitive."
|
|
26187
|
+
}
|
|
26188
|
+
},
|
|
26189
|
+
"required": [
|
|
26190
|
+
"kind",
|
|
26191
|
+
"value"
|
|
26192
|
+
],
|
|
26193
|
+
"additionalProperties": false
|
|
26194
|
+
},
|
|
26195
|
+
{
|
|
26196
|
+
"type": "object",
|
|
26197
|
+
"properties": {
|
|
26198
|
+
"kind": {
|
|
26199
|
+
"type": "string",
|
|
26200
|
+
"const": "stringNoCaseContains"
|
|
26201
|
+
},
|
|
26202
|
+
"value": {
|
|
26203
|
+
"type": "string",
|
|
26204
|
+
"description": "Substring match, case-insensitive."
|
|
26205
|
+
}
|
|
26206
|
+
},
|
|
26207
|
+
"required": [
|
|
26208
|
+
"kind",
|
|
26209
|
+
"value"
|
|
26210
|
+
],
|
|
26211
|
+
"additionalProperties": false
|
|
26212
|
+
},
|
|
26213
|
+
{
|
|
26214
|
+
"type": "object",
|
|
26215
|
+
"properties": {
|
|
26216
|
+
"kind": {
|
|
26217
|
+
"type": "string",
|
|
26218
|
+
"const": "boolEq"
|
|
26219
|
+
},
|
|
26220
|
+
"value": {
|
|
26221
|
+
"type": "boolean",
|
|
26222
|
+
"description": "Boolean equality."
|
|
26223
|
+
}
|
|
26224
|
+
},
|
|
26225
|
+
"required": [
|
|
26226
|
+
"kind",
|
|
26227
|
+
"value"
|
|
26228
|
+
],
|
|
26229
|
+
"additionalProperties": false
|
|
26230
|
+
}
|
|
26231
|
+
],
|
|
26232
|
+
"description": "Predicate filter applied to each candidate's data value."
|
|
26233
|
+
}
|
|
26234
|
+
},
|
|
26235
|
+
"required": [
|
|
26236
|
+
"type",
|
|
26237
|
+
"object",
|
|
26238
|
+
"key",
|
|
26239
|
+
"ids",
|
|
26240
|
+
"where"
|
|
26241
|
+
],
|
|
26242
|
+
"additionalProperties": false,
|
|
26243
|
+
"description": "Returns U256. ESCROW-BOUND sum (query 1179): per-row min(row_value, order.amount of the Order the row id names); a row keyed by anything that is not an Order contributes 0 (fail-closed). Unlike query_repository_data_sum_where (self-reported row values), a record cannot claim more than the Order actually escrowed — the forgery-proof aggregate for threshold gates and Formula pricing. Use logic_as_u256_* to compare the sum."
|
|
26244
|
+
},
|
|
25912
26245
|
{
|
|
25913
26246
|
"type": "object",
|
|
25914
26247
|
"properties": {
|
|
@@ -26,8 +26,9 @@ declare function driftFace(templateId: string): {
|
|
|
26
26
|
detail: string;
|
|
27
27
|
};
|
|
28
28
|
declare function scanSummary(scan: TemplateScanResult, drift?: ReturnType<typeof driftFace>): {
|
|
29
|
+
template_id: string;
|
|
29
30
|
risk_level: import("../../knowledge/template-scanner.js").TemplateRiskLevel;
|
|
30
|
-
|
|
31
|
+
preflight_scan_passed: boolean;
|
|
31
32
|
finding_count: number;
|
|
32
33
|
findings_by_severity: Record<string, number>;
|
|
33
34
|
red_flags: string[];
|
|
@@ -55,9 +56,10 @@ declare function scanSummary(scan: TemplateScanResult, drift?: ReturnType<typeof
|
|
|
55
56
|
detail: string;
|
|
56
57
|
} | undefined;
|
|
57
58
|
};
|
|
58
|
-
export declare function buildVerdict(summary: ReturnType<typeof scanSummary>, plan: Record<string, unknown
|
|
59
|
+
export declare function buildVerdict(summary: ReturnType<typeof scanSummary>, plan: Record<string, unknown>, mirrorGenerateHighGate?: boolean): {
|
|
59
60
|
buildable: boolean;
|
|
60
61
|
blockers: string[];
|
|
62
|
+
status: "READY" | "BLOCKED";
|
|
61
63
|
};
|
|
62
64
|
export declare function planNextAction(plan: Record<string, unknown>, retryAction: string, verdict?: {
|
|
63
65
|
buildable: boolean;
|
|
@@ -66,6 +68,7 @@ export declare function planNextAction(plan: Record<string, unknown>, retryActio
|
|
|
66
68
|
export interface RewardPoolPrefill {
|
|
67
69
|
fee_key: "review_reward_pool";
|
|
68
70
|
value: number;
|
|
71
|
+
claim_source?: "semantic_ir";
|
|
69
72
|
}
|
|
70
73
|
export declare function extractRewardPoolCandidate(description: string | undefined): number | undefined;
|
|
71
74
|
export { validateAllocatorRows };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{strictParse}from'../../schema/index.js';import{BenchmarkMigrationSchema}from'../../schema/benchmark-migration/index.js';import{getTemplate,listTemplates,validateAllocatorRows,platformShareBps,builtinTemplateDrift}from'../../knowledge/template-loader.js';import{BUILTIN_TEMPLATES,BUILTIN_TEMPLATES_VERSION}from'../../knowledge/builtin-templates.js';import{scanTemplate,buildFeeParamLandingTable}from'../../knowledge/template-scanner.js';import{planMigration}from'../../playbooks/service-build/migration-planner.js';import{handleMerchantGuide}from'../../playbooks/service-build/merchant-guide.js';import{inferArbitration}from'../../playbooks/service-build/intent-analyzer.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 templateGetAids(a){const b=a['machine_shape']['some'](c=>c['name']==='reviewed');return{'claim_anchor':b?'review_node+final':'final_only','claim_anchor_note':b?'machine_shape\x20mounts\x20a\x20\x27reviewed\x27\x20node\x20—\x20the\x20buyer\x27s\x20structured\x20review\x20rides\x20that\x20node\x20alongside\x20the\x20final\x20settlement.':'no\x20\x27reviewed\x27\x20node\x20—\x20sanctioned\x20variant:\x20the\x20buyer\x27s\x20voice\x20rides\x20the\x20claim/arbitration\x20rail\x20only\x20(no\x20separate\x20review\x20stop).','allocator_count_note':'allocator.count\x20=\x20'+a['allocator']['count']+'\x20counts\x20SETTLEMENT-track\x20legs\x20only;\x20refund-track\x20legs\x20(rows[]\x20with\x20track:\x22refund\x22)\x20are\x20additional\x20and\x20NOT\x20included\x20in\x20this\x20count.\x20rows[]\x20carries\x20the\x20complete\x20executable\x20split\x20plan.','onchain_field_notes':['passport.impack\x20—\x20the\x20on-chain\x20field\x20is\x20spelled\x20`impack`\x20(passport.move,\x20packed\x20business\x20objects\x20in\x20the\x20passport\x20verification\x20context).\x20It\x20is\x20the\x20contract\x27s\x20own\x20field\x20name,\x20not\x20a\x20typo;\x20echo\x20it\x20verbatim.']};}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 driftFace(a){const b=builtinTemplateDrift()['find'](c=>c['template']===a);if(!b){const c=BUILTIN_TEMPLATES['some'](d=>d['id']===a);return c?{'template':a,'state':'current','catalog_version':BUILTIN_TEMPLATES_VERSION,'blocked':![],'repairable':![],'detail':'disk\x20body\x20matches\x20the\x20shipped\x20catalog\x20(hash-verified\x20sentinel)'}:{'template':a,'state':'untracked','catalog_version':undefined,'blocked':![],'repairable':![],'detail':'user-authored\x20template\x20—\x20no\x20builtin\x20catalog\x20binding\x20to\x20compare\x20against'};}return{'template':b['template'],'state':b['state'],'catalog_version':BUILTIN_TEMPLATES_VERSION,'blocked':!![],'repairable':b['repairable'],'detail':b['detail']};}function scanSummary(a,b){const c={};for(const d of a['findings'])c[d['severity']]=(c[d['severity']]??0x0)+0x1;return{'risk_level':a['risk_level'],'passed':a['red_flags']['length']===0x0,'finding_count':a['findings']['length'],'findings_by_severity':c,'red_flags':a['red_flags'],'findings':a['findings'],'drift':b};}function assertScanPassed(a,b){const c=a['red_flags'];if(a['passed']||c['length']===0x0)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'+c['join'](';\x20')+'.\x20Fix\x20the\x20template\x20(frontmatter\x20or\x20body)\x20and\x20re-run\x20action=\x27template_scan\x27.');}const GENERATE_HIGH_TOLERATED=new Set([]);function assertGenerateScanPassed(a,b){assertScanPassed(a,b);if(b!=='template_generate')return;const c=a['findings']['filter'](d=>d['severity']==='high'&&!(d['rule_id']&&GENERATE_HIGH_TOLERATED['has'](a['template_id']+'/'+d['rule_id'])));if(c['length']===0x0)return;throw new Error('action=\x27'+b+'\x27\x20blocked:\x20pre-deploy\x20scan\x20of\x20template\x20\x27'+a['template_id']+'\x27\x20found\x20'+c['length']+'\x20HIGH\x20finding(s)\x20—\x20'+c['map'](d=>(d['rule_id']??'HIGH')+':\x20'+d['title'])['join'](';\x20')+'.\x20Fix\x20the\x20template\x20(frontmatter\x20or\x20body)\x20and\x20re-run\x20action=\x27template_scan\x27.');}export function buildVerdict(a,b){const c=[];!a['passed']&&c['push']('scan:\x20'+(a['findings_by_severity']['critical']??0x0)+'\x20CRITICAL\x20finding(s)\x20(scan.passed=false)');const d=b['graph_validation'];if(d&&d['valid']===![]){const f=Array['isArray'](d['hard_violations'])?d['hard_violations']['length']:0x0,g=Array['isArray'](d['hard_violations'])?d['hard_violations']['map'](h=>h['id'])['join'](',\x20'):'';c['push']('graph_validation:\x20'+f+'\x20hard\x20violation(s)'+(g?'\x20('+g+')':''));}const e=b['audit'];return e&&e['blocking']===!![]&&c['push']('audit:\x20guide\x20audit\x20flagged\x20blocking\x20issue(s)\x20(plan.audit)'),{'buildable':c['length']===0x0,'blockers':c};}export function planNextAction(a,b,c){const d=a['next_action'];if(typeof d==='string'&&d['startsWith']('Plan\x20ready.'))return d;if(c?.['buildable']){const f=Array['isArray'](a['pending_guard_designs'])?a['pending_guard_designs']['length']:0x0;return'Plan\x20is\x20buildable\x20(verdict.buildable=true).\x20Materialize\x20the\x20objects\x20in\x20plan.steps\x20order'+(f>0x0?',\x20resolving\x20the\x20'+f+'\x20pending\x20guard\x20design(s)\x20in\x20plan.pending_guard_designs\x20via\x20guard_resolutions\x20before\x20the\x20Machine\x20publish':'')+'.';}const e=Array['isArray'](a['pending_guard_designs'])?a['pending_guard_designs']['length']:0x0;return'Plan\x20BLOCKED\x20by\x20the\x20guide\x20audit\x20(see\x20plan.audit\x20/\x20plan.next_action).\x20Do\x20NOT\x20materialize,\x20'+'and\x20do\x20NOT\x20hand-build\x20the\x20objects\x20instead:\x20this\x20plan\x20is\x20the\x20wiring\x20authority\x20(Arbitration\x20+\x20'+'compensation-fund,\x20Contact/um,\x20allocator\x20rows)\x20and\x20hand-built\x20replicas\x20silently\x20drop\x20those\x20wirings.\x20'+(e>0x0?'Resolve\x20the\x20'+e+'\x20pending\x20guard\x20design(s)\x20in\x20plan.pending_guard_designs\x20via\x20guard_resolutions\x20(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id,\x20or\x20{kind:\x27omit\x27}\x20for\x20advisory\x20designs\x20that\x20do\x20not\x20apply\x20to\x20this\x20shop),\x20':'Adjust\x20fee_overrides,\x20pick\x20another\x20template\x20variant,\x20or\x20fix\x20the\x20template,\x20')+('then\x20re-run\x20action=\x27'+b+'\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??{}};}const REWARD_POOL_PATTERNS=[/(?:reward|review|bonus|tip|prize)[\s-]*pools?\s*(?:of|is|at|:|=)?\s*([0-9][0-9_,]*(?:\.[0-9]+)?)/i,/([0-9][0-9_,]*(?:\.[0-9]+)?)\s*(?:reward|review|bonus|tip|prize)[\s-]*pools?\b/i,/(?:奖(?:金|励)?池|打赏池|好评(?:奖励)?池)\s*(?:为|是|:|:|=)?\s*([0-9][0-9_,]*(?:\.[0-9]+)?)/,/([0-9][0-9_,]*(?:\.[0-9]+)?)\s*的?\s*(?:奖(?:金|励)?池|打赏池|好评(?:奖励)?池)/];export function extractRewardPoolCandidate(a){if(!a)return undefined;for(const b of REWARD_POOL_PATTERNS){const c=b['exec'](a);if(!c)continue;const d=Number(c[0x1]['replaceAll'](/[,_]/g,''));if(Number['isFinite'](d)&&d>=0x0)return d;}return undefined;}function rewardPoolPrefill(a,b,c){if(a['fee_params']['review_reward_pool']===undefined)return undefined;if(c?.['review_reward_pool']!==undefined)return undefined;const d=extractRewardPoolCandidate(b);return d===undefined?undefined:{'fee_key':'review_reward_pool','value':d};}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.');}export{validateAllocatorRows};export function variantPaymentModel(a){if(a['payment_model'])return a['payment_model'];const b=a['allocator']['rows']??[];if(b['some'](d=>d['track']==='refund'))return'escrow';const c=a['machine_shape']['map'](d=>d['name'])['join']('\x20')['toLowerCase']();if(/\b(milestone|revision|revis|draft|deliverable)\b/['test'](c))return'milestone';if(/\b(charge|renew|subscription|cycle|billing|monthly)\b/['test'](c))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;}export function variantDeliverables(a,b){const c=a['machine_shape']['filter'](g=>g['semantic_role']==='final'),d=c[c['length']-0x1]??[...a['machine_shape']]['reverse']()['find'](g=>!/refund|cancel|dispute|terminat/i['test'](g['name']+'\x20'+g['role']))??a['machine_shape'][a['machine_shape']['length']-0x1],e=b?.['has_logistics']?'physical':b?.['pure_digital']?'digital':'service_session',f=(a['guards']??[])['filter'](h=>/repository_data_check|required_info_evidence_gate|allocator_order_anchor/['test'](h['template_id']));return[{'name':a['variant']+'\x20fulfillment','type':e,'acceptanceCriteria':'Order\x20reaches\x20the\x20terminal\x20workflow\x20node\x20\x27'+d['name']+'\x27\x20('+d['role']+')','proofOfDelivery':f['length']>0x0?'wip_hash':'manual_confirm'}];}function validateConditionalParams(a,b){for(const d of a['conditional_guards']??[]){const e=b[d['param']];if(e===undefined)continue;if(typeof e!=='string'||!d['values']['includes'](e))throw new Error('invalid\x20\x27'+d['param']+'='+String(e)+'\x27\x20for\x20template\x20\x27'+a['id']+'\x27:\x20must\x20be\x20one\x20of\x20'+d['values']['map'](f=>'\x27'+f+'\x27')['join']('\x20|\x20')+('\x20(the\x20guard\x20variant\x20mounts\x20at\x20\x27'+d['emit_value']+'\x27)'));}}async function runGuide(a,b,c,d,e,f){const g=effectiveFeeParams(a,c),h=rewardPoolPrefill(a,b,c);if(h)g[h['fee_key']]=h['value'];validateFeeParams(g,a['id']),validateConditionalParams(a,g);const i=getIndustryModeRegistry()['getMode'](a['industry']),j=platformShareBps(g),k={'model':variantPaymentModel(a)},l=[],m=(a['allocator']['rows']?.['length']??0x0)>0x0;if(j!==undefined&&j>0x0&&!m&&a['allocator']['mode']==='rate'){const q=Math['round'](j)/0x64;l['push']({'recipient':'merchant','percentage':Math['round']((0x64-q)*0x64)/0x64}),l['push']({'recipient':'platform','percentage':q}),k['allocation']=l;}const n=variantRefundPolicy(a),o={'escrow':!![]};if(n)o['refundPolicy']=n;o['arbitration']=a['arbitration_mode']??o['arbitration']??inferArbitration(templateIntent(a,b));const p=await handleMerchantGuide({'intent':templateIntent(a,b),'guide_confirm':{'industry':a['industry'],'payment':k,'trust':o,'deliverables':variantDeliverables(a,i?.['traits']),...d&&Object['keys'](d)['length']>0x0?{'guard_resolutions':d}:{},...e?.['review_mode']?{'review_mode':e['review_mode']}:{},...e?.['reward_funding']!==undefined?{'reward_funding':e['reward_funding']}:{},...e?.['after_sales_mode']?{'after_sales_mode':e['after_sales_mode']}:{},...e?.['acceptance_mode']?{'acceptance_mode':e['acceptance_mode']}:{},...e?.['installment_mode']?{'installment_mode':e['installment_mode']}:{},...e?.['affiliate_mode']?{'affiliate_mode':e['affiliate_mode']}:{},...e?.['crowdfunding_mode']?{'crowdfunding_mode':e['crowdfunding_mode']}:{},...f?.['length']?{'sales':f}:{}},'template_override':{...a,'fee_params':g},'name_base':a['id']});if(a['allocator']['rows']?.['length'])p['template_allocator_rows']=a['allocator']['rows']['map'](s=>({...s}));p['template']={'id':a['id'],'archetype':a['archetype'],'recommended_role':a['recommended_role'],'fee_params':g},p['template_fee_param_landings']=buildFeeParamLandingTable(a,g);if(c&&Object['keys'](c)['length']>0x0)p['template_fee_overrides']=c;return h&&(p['fee_overrides_prefill']=h,p['next_action']=p['next_action']+'\x20Reward\x20pool\x20prefilled\x20from\x20your\x20request:\x20'+h['value']+'\x20—\x20adjust\x20via\x20fee_overrides.'),p;}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'](i=>i['industry']===c):e,h=new Map(builtinTemplateDrift()['map'](i=>[i['template'],i['state']]));d={'action':'template_list','count':g['length'],'templates':g['map'](i=>({...templateSummary(i),'disk_state':h['get'](i['id'])??(BUILTIN_TEMPLATES['some'](j=>j['id']===i['id'])?'current':'untracked')})),'load_errors':f};break;}case'template_get':{const i=requireTemplate(b['template_id'],'template_get');d={'action':'template_get','template':{...i,...templateGetAids(i)}};break;}case'template_generate':{const j=requireTemplate(b['template_id'],'template_generate'),k=b['review_mode']??j['review_mode']??'none';if(k==='review_reward'&&!b['reward_funding'])return{'content':[{'type':'text','text':'template_generate\x20refused\x20—\x20no\x20plan\x20was\x20built.\x20Template\x20\x27'+j['id']+'\x27\x20resolves\x20to\x20review_mode\x20\x27review_reward\x27\x20(input'+(b['review_mode']?'':'\x20via\x20template\x20declaration')+'),\x20which\x20promises\x20buyers\x20a\x20claimable\x20review\x20bounty\x20—\x20an\x20unfunded\x20pool\x20must\x20not\x20ship.\x20Pass\x20reward_funding\x20(smallest-unit\x20string),\x20or\x20drop\x20the\x20mode\x20explicitly\x20(review_mode\x20\x27review\x27\x20keeps\x20the\x20review\x20rail\x20without\x20the\x20bounty;\x20\x27none\x27\x20removes\x20the\x20rail).'}],'structuredContent':{'result':{'type':'error','error':'review_mode\x20\x27'+k+'\x27\x20without\x20reward_funding\x20(INV-4)\x20on\x20template\x20\x27'+j['id']+'\x27.','error_code':'reward_funding_required','retryable':!![],'recovery_hint':'Pass\x20reward_funding\x20=\x20expected\x20orders\x20x\x20per-order\x20reward\x20(fee_param\x20review_reward_pool\x20is\x20the\x20planning\x20benchmark),\x20or\x20re-send\x20with\x20review_mode:\x27review\x27\x20(rail\x20only)\x20/\x20\x27none\x27\x20(no\x20rail).'},'message':'Refused:\x20a\x20review_reward\x20build\x20requires\x20a\x20funded\x20reward\x20pool.\x20See\x20recovery_hint.'}};if(!Array['isArray'](b['sales'])||b['sales']['length']===0x0)return{'content':[{'type':'text','text':'template_generate\x20refused\x20—\x20no\x20plan\x20was\x20built.\x20The\x20sellable\x20catalog\x20(sales)\x20is\x20required:\x20a\x20plan\x20without\x20one\x20publishes\x20a\x20Service\x20frozen\x20with\x20sales:\x20[]\x20and\x20every\x20order_new\x20aborts\x20(PLAN-SALES-01).\x20List\x20at\x20least\x20one\x20SKU:\x20{\x20name,\x20price,\x20quantity?,\x20wip_hash?\x20}\x20—\x20price\x20in\x20smallest\x20units.'}],'structuredContent':{'result':{'type':'error','error':'template_generate\x20without\x20a\x20non-empty\x20sales\x20catalog\x20(PLAN-SALES-01\x20upgraded\x20to\x20an\x20input\x20requirement,\x20amz9\x20A-2).','error_code':'sales_required','retryable':!![],'recovery_hint':'Pass\x20sales:\x20[{\x20name,\x20price,\x20quantity?,\x20wip_hash?\x20}]\x20—\x20one\x20entry\x20per\x20sellable\x20SKU\x20(wip_hash\x20from\x20the\x20wip_file\x20tool\x20upload).\x20migration_apply\x20is\x20unaffected:\x20it\x20confirms\x20an\x20already-reviewed\x20import.'},'message':'Refused:\x20template_generate\x20requires\x20a\x20sellable\x20catalog.\x20See\x20recovery_hint.'}};const l=scanTemplate(j);assertGenerateScanPassed(l,'template_generate');const m=await runGuide(j,b['description'],b['fee_overrides'],b['guard_resolutions'],{'review_mode':b['review_mode'],'reward_funding':b['reward_funding'],'after_sales_mode':b['after_sales_mode'],'acceptance_mode':b['acceptance_mode'],'installment_mode':b['installment_mode'],'affiliate_mode':b['affiliate_mode'],'crowdfunding_mode':b['crowdfunding_mode']},b['sales']);d=((()=>{const n=scanSummary(l,driftFace(j['id'])),o=buildVerdict(n,m);return{'action':'template_generate','template_id':j['id'],'scan':n,'plan':m,'verdict':o,'next_action':planNextAction(m,'template_generate',o)};})());break;}case'template_scan':{const n=requireTemplate(b['template_id'],'template_scan');d={'action':'template_scan','scan':{...scanTemplate(n),'drift':driftFace(n['id'])}};break;}case'migration_import':{if(!b['description']||!b['description']['trim']())throw new Error('\x27description\x27\x20is\x20required\x20for\x20action=\x27migration_import\x27');const o=planMigration({'url':b['url'],'description':b['description'],'industry':c,'network':b['network']});if(!o)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':o,'next_action':'MigrationLog\x20ready.\x20Next:\x20call\x20action=\x27migration_review\x27\x20with\x20this\x20log\x20to\x20surface\x20the\x20mapped/unmapped/manual_review\x20items\x20for\x20user\x20confirmation.'};break;}case'migration_review':{if(!b['log'])throw new Error('\x27log\x27\x20is\x20required\x20for\x20action=\x27migration_review\x27');const p=b['log'],q=Array['isArray'](p['mapped'])?p['mapped']:[],r=Array['isArray'](p['unmapped'])?p['unmapped']:[],s=Array['isArray'](p['manual_review'])?p['manual_review']:[],t=p['risk_check']??{},u=p['source']?.['matched_template']??'',v=r['length']===0x0&&s['length']===0x0&&t['passed']===!![];d={'action':'migration_review','log':p,'review_summary':{'mapped_count':q['length'],'unmapped_count':r['length'],'manual_review_count':s['length'],'risk_passed':t['passed']===!![]},'next_action':v?'Review\x20clean.\x20Proceed:\x20call\x20action=\x27migration_apply\x27\x20with\x20template_id=\x27'+u+'\x27\x20to\x20produce\x20the\x20creation\x20plan\x20(network\x20defaults\x20to\x20testnet;\x20mainnet\x20requires\x20explicit\x20user\x20confirmation).':'Surface\x20the\x20'+r['length']+'\x20unmapped\x20and\x20'+s['length']+'\x20manual_review\x20items'+(t['passed']===!![]?'':'\x20plus\x20the\x20risk_check\x20findings')+'\x20to\x20the\x20user\x20for\x20a\x20decision\x20before\x20action=\x27migration_apply\x27\x20(template_id=\x27'+u+'\x27).'};break;}case'migration_apply':{const w=requireTemplate(b['template_id'],'migration_apply'),x=scanTemplate(w);assertScanPassed(x,'migration_apply');const y=b['network']??'testnet',z=await runGuide(w,b['description'],b['fee_overrides'],b['guard_resolutions'],{'review_mode':b['review_mode'],'reward_funding':b['reward_funding'],'after_sales_mode':b['after_sales_mode'],'acceptance_mode':b['acceptance_mode'],'installment_mode':b['installment_mode'],'affiliate_mode':b['affiliate_mode'],'crowdfunding_mode':b['crowdfunding_mode']},b['sales']);d=((()=>{const A=scanSummary(x,driftFace(w['id'])),B=buildVerdict(A,z);return{'action':'migration_apply','template_id':w['id'],'network':y,'scan':A,'plan':z,'verdict':B,'next_action':planNextAction(z,'migration_apply',B)};})());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
|
+
import{strictParse}from'../../schema/index.js';import{BenchmarkMigrationSchema}from'../../schema/benchmark-migration/index.js';import{getTemplate,listTemplates,validateAllocatorRows,platformShareBps,builtinTemplateDrift}from'../../knowledge/template-loader.js';import{BUILTIN_TEMPLATES,BUILTIN_TEMPLATES_VERSION}from'../../knowledge/builtin-templates.js';import{scanTemplate,buildFeeParamLandingTable}from'../../knowledge/template-scanner.js';import{planMigration}from'../../playbooks/service-build/migration-planner.js';import{handleMerchantGuide}from'../../playbooks/service-build/merchant-guide.js';import{inferArbitration}from'../../playbooks/service-build/intent-analyzer.js';import{getIndustryModeRegistry}from'../../extensions/index.js';import{resolveIndustryName}from'../../knowledge/industry-registry.js';import{claimNumber,normalizeSemanticIR}from'../../knowledge/semantic-ir.js';import{handleRecommendIndustry}from'../../playbooks/service-build/mode-actions.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 templateGetAids(a){const b=a['machine_shape']['some'](c=>c['name']==='reviewed');return{'claim_anchor':b?'review_node+final':'final_only','claim_anchor_note':b?'machine_shape\x20mounts\x20a\x20\x27reviewed\x27\x20node\x20—\x20the\x20buyer\x27s\x20structured\x20review\x20rides\x20that\x20node\x20alongside\x20the\x20final\x20settlement.':'no\x20\x27reviewed\x27\x20node\x20—\x20sanctioned\x20variant:\x20the\x20buyer\x27s\x20voice\x20rides\x20the\x20claim/arbitration\x20rail\x20only\x20(no\x20separate\x20review\x20stop).','allocator_count_note':'allocator.count\x20=\x20'+a['allocator']['count']+'\x20counts\x20SETTLEMENT-track\x20legs\x20only;\x20refund-track\x20legs\x20(rows[]\x20with\x20track:\x22refund\x22)\x20are\x20additional\x20and\x20NOT\x20included\x20in\x20this\x20count.\x20rows[]\x20carries\x20the\x20complete\x20executable\x20split\x20plan.','onchain_field_notes':['passport.impack\x20—\x20the\x20on-chain\x20field\x20is\x20spelled\x20`impack`\x20(passport.move,\x20packed\x20business\x20objects\x20in\x20the\x20passport\x20verification\x20context).\x20It\x20is\x20the\x20contract\x27s\x20own\x20field\x20name,\x20not\x20a\x20typo;\x20echo\x20it\x20verbatim.']};}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 driftFace(a){const b=builtinTemplateDrift()['find'](c=>c['template']===a);if(!b){const c=BUILTIN_TEMPLATES['some'](d=>d['id']===a);return c?{'template':a,'state':'current','catalog_version':BUILTIN_TEMPLATES_VERSION,'blocked':![],'repairable':![],'detail':'disk\x20body\x20matches\x20the\x20shipped\x20catalog\x20(hash-verified\x20sentinel)'}:{'template':a,'state':'untracked','catalog_version':undefined,'blocked':![],'repairable':![],'detail':'user-authored\x20template\x20—\x20no\x20builtin\x20catalog\x20binding\x20to\x20compare\x20against'};}return{'template':b['template'],'state':b['state'],'catalog_version':BUILTIN_TEMPLATES_VERSION,'blocked':!![],'repairable':b['repairable'],'detail':b['detail']};}function scanSummary(a,b){const c={};for(const d of a['findings'])c[d['severity']]=(c[d['severity']]??0x0)+0x1;return{'template_id':a['template_id'],'risk_level':a['risk_level'],'preflight_scan_passed':a['red_flags']['length']===0x0,'finding_count':a['findings']['length'],'findings_by_severity':c,'red_flags':a['red_flags'],'findings':a['findings'],'drift':b};}function assertScanPassed(a,b){const c=a['red_flags'];if(a['passed']||c['length']===0x0)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'+c['join'](';\x20')+'.\x20Fix\x20the\x20template\x20(frontmatter\x20or\x20body)\x20and\x20re-run\x20action=\x27template_scan\x27.');}const GENERATE_HIGH_TOLERATED=new Set([]);function assertGenerateScanPassed(a,b){assertScanPassed(a,b);if(b!=='template_generate')return;const c=generateHighBlockers(a['template_id'],a['findings']);if(c['length']===0x0)return;throw new Error('action=\x27'+b+'\x27\x20blocked:\x20pre-deploy\x20scan\x20of\x20template\x20\x27'+a['template_id']+'\x27\x20found\x20'+c['length']+'\x20HIGH\x20finding(s)\x20—\x20'+c['map'](d=>(d['rule_id']??'HIGH')+':\x20'+d['title'])['join'](';\x20')+'.\x20Fix\x20the\x20template\x20(frontmatter\x20or\x20body)\x20and\x20re-run\x20action=\x27template_scan\x27.');}function generateHighBlockers(a,b){return b['filter'](c=>c['severity']==='high'&&!(c['rule_id']&&GENERATE_HIGH_TOLERATED['has'](a+'/'+c['rule_id'])));}export function buildVerdict(a,b,c){const d=[];!a['preflight_scan_passed']&&d['push']('scan:\x20'+(a['findings_by_severity']['critical']??0x0)+'\x20CRITICAL\x20finding(s)\x20(preflight\x20scan\x20failed)');if(c){const h=generateHighBlockers(a['template_id'],a['findings']??[]);h['length']>0x0&&d['push']('scan:\x20'+h['length']+'\x20HIGH\x20finding(s)\x20—\x20template_generate\x20would\x20refuse\x20(N-21):\x20'+h['map'](i=>((i['rule_id']??'HIGH')+':\x20'+(i['title']??''))['trim']())['join'](';\x20'));}const e=b['graph_validation'];if(e&&e['valid']===![]){const i=Array['isArray'](e['hard_violations'])?e['hard_violations']['length']:0x0,j=Array['isArray'](e['hard_violations'])?e['hard_violations']['map'](k=>k['id'])['join'](',\x20'):'';d['push']('graph_validation:\x20'+i+'\x20hard\x20violation(s)'+(j?'\x20('+j+')':''));}const f=b['audit'];if(f&&f['blocking']===!![]){const k=(f['findings']??[])['filter'](l=>l['level']==='critical'||l['level']==='high');d['push'](k['length']===0x0?'audit:\x20guide\x20audit\x20flagged\x20blocking\x20issue(s)\x20(plan.audit)':'audit:\x20'+k['length']+'\x20blocking\x20finding(s)\x20—\x20'+k['slice'](0x0,0x5)['map'](l=>((l['rule_id']??'?')+':\x20'+(l['title']??''))['trim']())['join'](';\x20')+(k['length']>0x5?'\x20(+'+(k['length']-0x5)+'\x20more\x20in\x20plan.audit.findings)':''));}const g=d['length']===0x0;return{'buildable':g,'blockers':d,'status':g?'READY':'BLOCKED'};}async function templateScanDryRun(a){const b=[{'name':'scan-probe','price':'1000000000','quantity':0x1}],c=a['review_mode']==='review_reward'?{'review_mode':'review_reward','reward_funding':'20000000','reward_claim_amount':'1000000'}:undefined;try{const d=await runGuide(a,undefined,undefined,undefined,c,b),f=buildVerdict(scanSummary(scanTemplate(a)),d,!![]);return{'status':f['buildable']?'ready':'blocked','buildable':f['buildable'],'blockers':f['blockers'],'note':'Compile\x20dry-run\x20on\x20synthetic\x20probe\x20inputs\x20(single\x20probe\x20SKU,\x20benchmark\x20reward\x20funding),\x20mirrored\x20to\x20the\x20template_generate\x20gate\x20(CRITICAL\x20+\x20N-21\x20HIGH\x20+\x20graph\x20+\x20audit).\x20Structural\x20blockers\x20are\x20REAL\x20—\x20the\x20generate\x20face\x20refuses\x20for\x20the\x20same\x20reason.\x20Blockers\x20naming\x20caller\x20inputs\x20(fee_overrides\x20/\x20guard_resolutions\x20/\x20catalog)\x20may\x20clear\x20with\x20real\x20values.'};}catch(g){return{'status':'unavailable','note':'Compile\x20dry-run\x20could\x20not\x20run\x20on\x20synthetic\x20probe\x20inputs\x20('+(g instanceof Error?g['message']:String(g))+').\x20This\x20is\x20a\x20probe\x20limitation,\x20NOT\x20a\x20template\x20verdict\x20—\x20run\x20template_generate\x20for\x20the\x20authoritative\x20buildability.'};}}export function planNextAction(a,b,c){const d=a['next_action'];if(typeof d==='string'&&d['startsWith']('Plan\x20ready.'))return d;if(c?.['buildable']){const f=Array['isArray'](a['pending_guard_designs'])?a['pending_guard_designs']['length']:0x0;return'Plan\x20is\x20buildable\x20(verdict.buildable=true).\x20Materialize\x20the\x20objects\x20in\x20plan.steps\x20order'+(f>0x0?',\x20resolving\x20the\x20'+f+'\x20pending\x20guard\x20design(s)\x20in\x20plan.pending_guard_designs\x20via\x20guard_resolutions\x20before\x20the\x20Machine\x20publish':'')+'.';}const e=Array['isArray'](a['pending_guard_designs'])?a['pending_guard_designs']['length']:0x0;return'Plan\x20BLOCKED\x20by\x20the\x20guide\x20audit\x20(see\x20plan.audit\x20/\x20plan.next_action).\x20Do\x20NOT\x20materialize,\x20'+'and\x20do\x20NOT\x20hand-build\x20the\x20objects\x20instead:\x20this\x20plan\x20is\x20the\x20wiring\x20authority\x20(Arbitration\x20+\x20'+'compensation-fund,\x20Contact/um,\x20allocator\x20rows)\x20and\x20hand-built\x20replicas\x20silently\x20drop\x20those\x20wirings.\x20'+(e>0x0?'Resolve\x20the\x20'+e+'\x20pending\x20guard\x20design(s)\x20in\x20plan.pending_guard_designs\x20via\x20guard_resolutions\x20(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id,\x20or\x20{kind:\x27omit\x27}\x20for\x20advisory\x20designs\x20that\x20do\x20not\x20apply\x20to\x20this\x20shop),\x20':'Adjust\x20fee_overrides,\x20pick\x20another\x20template\x20variant,\x20or\x20fix\x20the\x20template,\x20')+('then\x20re-run\x20action=\x27'+b+'\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??{}};}const REWARD_POOL_PATTERNS=[/(?:reward|review|bonus|tip|prize)[\s-]*pools?\s*(?:of|is|at|:|=)?\s*([0-9][0-9_,]*(?:\.[0-9]+)?)/i,/([0-9][0-9_,]*(?:\.[0-9]+)?)\s*(?:reward|review|bonus|tip|prize)[\s-]*pools?\b/i];export function extractRewardPoolCandidate(a){if(!a)return undefined;for(const b of REWARD_POOL_PATTERNS){const c=b['exec'](a);if(!c)continue;const d=Number(c[0x1]['replaceAll'](/[,_]/g,''));if(Number['isFinite'](d)&&d>=0x0)return d;}return undefined;}function rewardPoolPrefill(a,b,c,d){if(a['fee_params']['review_reward_pool']===undefined)return undefined;if(c?.['review_reward_pool']!==undefined)return undefined;const e=d?claimNumber(d,'reward_pool_amount'):undefined;if(e!==undefined)return{'fee_key':'review_reward_pool','value':e,'claim_source':'semantic_ir'};const f=extractRewardPoolCandidate(b);return f===undefined?undefined:{'fee_key':'review_reward_pool','value':f};}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.');}export{validateAllocatorRows};export function variantPaymentModel(a){if(a['payment_model'])return a['payment_model'];const b=a['allocator']['rows']??[];if(b['some'](d=>d['track']==='refund'))return'escrow';const c=a['machine_shape']['map'](d=>d['name'])['join']('\x20')['toLowerCase']();if(/\b(milestone|revision|revis|draft|deliverable)\b/['test'](c))return'milestone';if(/\b(charge|renew|subscription|cycle|billing|monthly)\b/['test'](c))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;}export function variantDeliverables(a,b){const c=a['machine_shape']['filter'](g=>g['semantic_role']==='final'),d=c[c['length']-0x1]??[...a['machine_shape']]['reverse']()['find'](g=>!/refund|cancel|dispute|terminat/i['test'](g['name']+'\x20'+g['role']))??a['machine_shape'][a['machine_shape']['length']-0x1],e=b?.['has_logistics']?'physical':b?.['pure_digital']?'digital':'service_session',f=(a['guards']??[])['filter'](h=>/repository_data_check|required_info_evidence_gate|allocator_order_anchor/['test'](h['template_id']));return[{'name':a['variant']+'\x20fulfillment','type':e,'acceptanceCriteria':'Order\x20reaches\x20the\x20terminal\x20workflow\x20node\x20\x27'+d['name']+'\x27\x20('+d['role']+')','proofOfDelivery':f['length']>0x0?'wip_hash':'manual_confirm'}];}function validateConditionalParams(a,b){for(const d of a['conditional_guards']??[]){const e=b[d['param']];if(e===undefined)continue;if(typeof e!=='string'||!d['values']['includes'](e))throw new Error('invalid\x20\x27'+d['param']+'='+String(e)+'\x27\x20for\x20template\x20\x27'+a['id']+'\x27:\x20must\x20be\x20one\x20of\x20'+d['values']['map'](f=>'\x27'+f+'\x27')['join']('\x20|\x20')+('\x20(the\x20guard\x20variant\x20mounts\x20at\x20\x27'+d['emit_value']+'\x27)'));}}async function runGuide(a,b,c,d,e,f,g){const h=effectiveFeeParams(a,c),i=rewardPoolPrefill(a,b,c,g);if(i)h[i['fee_key']]=i['value'];validateFeeParams(h,a['id']),validateConditionalParams(a,h);const j=getIndustryModeRegistry()['getMode'](a['industry']),k=platformShareBps(h),l={'model':variantPaymentModel(a)},m=[],n=(a['allocator']['rows']?.['length']??0x0)>0x0;if(k!==undefined&&k>0x0&&!n&&a['allocator']['mode']==='rate'){const r=Math['round'](k)/0x64;m['push']({'recipient':'merchant','percentage':Math['round']((0x64-r)*0x64)/0x64}),m['push']({'recipient':'platform','percentage':r}),l['allocation']=m;}const o=variantRefundPolicy(a),p={'escrow':!![]};if(o)p['refundPolicy']=o;p['arbitration']=a['arbitration_mode']??p['arbitration']??inferArbitration(templateIntent(a,b));const q=await handleMerchantGuide({'intent':templateIntent(a,b),'guide_confirm':{'industry':a['industry'],'payment':l,'trust':p,'deliverables':variantDeliverables(a,j?.['traits']),...d&&Object['keys'](d)['length']>0x0?{'guard_resolutions':d}:{},...e?.['review_mode']?{'review_mode':e['review_mode']}:{},...e?.['reward_funding']!==undefined?{'reward_funding':e['reward_funding']}:{},...e?.['reward_claim_amount']!==undefined?{'reward_claim_amount':e['reward_claim_amount']}:{},...e?.['after_sales_mode']?{'after_sales_mode':e['after_sales_mode']}:{},...e?.['acceptance_mode']?{'acceptance_mode':e['acceptance_mode']}:{},...e?.['installment_mode']?{'installment_mode':e['installment_mode']}:{},...e?.['affiliate_mode']?{'affiliate_mode':e['affiliate_mode']}:{},...e?.['crowdfunding_mode']?{'crowdfunding_mode':e['crowdfunding_mode']}:{},...f?.['length']?{'sales':f}:{}},'template_override':{...a,'fee_params':h},'name_base':a['id']});if(a['allocator']['rows']?.['length'])q['template_allocator_rows']=a['allocator']['rows']['map'](s=>({...s}));q['template']={'id':a['id'],'archetype':a['archetype'],'recommended_role':a['recommended_role'],'fee_params':h},q['template_fee_param_landings']=buildFeeParamLandingTable(a,h);if(c&&Object['keys'](c)['length']>0x0)q['template_fee_overrides']=c;if(i){q['fee_overrides_prefill']=i;const s=i['claim_source']==='semantic_ir'?'\x20(from\x20the\x20semantic\x20IR\x20claim)':'';q['next_action']=q['next_action']+'\x20Reward\x20pool\x20prefilled\x20from\x20your\x20request:\x20'+i['value']+s+'\x20—\x20adjust\x20via\x20fee_overrides.';}return q;}export async function handleBenchmarkMigrationOperation(a){const b=strictParse(BenchmarkMigrationSchema,a,'benchmark_migration_operation\x20input'),c=b['industry']?resolveIndustryName(b['industry'])??b['industry']['toLowerCase']():undefined,d=b['semantic_ir']?normalizeSemanticIR(b['semantic_ir']):undefined,e=d?{'semantic_ir_digest':d['digest'],...d['issues']['length']>0x0?{'semantic_ir_issues':d['issues']}:{}}:undefined;let f;switch(b['action']){case'template_list':{const {templates:g,errors:h}=listTemplates(),i=c?g['filter'](k=>k['industry']===c):g,j=new Map(builtinTemplateDrift()['map'](k=>[k['template'],k['state']]));f={'action':'template_list','count':i['length'],'templates':i['map'](k=>({...templateSummary(k),'disk_state':j['get'](k['id'])??(BUILTIN_TEMPLATES['some'](l=>l['id']===k['id'])?'current':'untracked')})),'load_errors':h};break;}case'template_get':{const k=requireTemplate(b['template_id'],'template_get');f={'action':'template_get','template':{...k,...templateGetAids(k)}};break;}case'template_generate':{const l=requireTemplate(b['template_id'],'template_generate'),m=b['review_mode']??l['review_mode']??'none';if(m==='review_reward'&&!b['reward_funding'])return{'content':[{'type':'text','text':'template_generate\x20refused\x20—\x20no\x20plan\x20was\x20built.\x20Template\x20\x27'+l['id']+'\x27\x20resolves\x20to\x20review_mode\x20\x27review_reward\x27\x20(input'+(b['review_mode']?'':'\x20via\x20template\x20declaration')+'),\x20which\x20promises\x20buyers\x20a\x20claimable\x20review\x20bounty\x20—\x20an\x20unfunded\x20pool\x20must\x20not\x20ship.\x20Pass\x20reward_funding\x20(smallest-unit\x20string),\x20or\x20drop\x20the\x20mode\x20explicitly\x20(review_mode\x20\x27review\x27\x20keeps\x20the\x20review\x20rail\x20without\x20the\x20bounty;\x20\x27none\x27\x20removes\x20the\x20rail).'}],'structuredContent':{'result':{'type':'error','error':'review_mode\x20\x27'+m+'\x27\x20without\x20reward_funding\x20(INV-4)\x20on\x20template\x20\x27'+l['id']+'\x27.','error_code':'reward_funding_required','retryable':!![],'recovery_hint':'Pass\x20reward_funding\x20=\x20expected\x20orders\x20x\x20per-order\x20reward\x20(fee_param\x20review_reward_pool\x20is\x20the\x20planning\x20benchmark),\x20or\x20re-send\x20with\x20review_mode:\x27review\x27\x20(rail\x20only)\x20/\x20\x27none\x27\x20(no\x20rail).'},'message':'Refused:\x20a\x20review_reward\x20build\x20requires\x20a\x20funded\x20reward\x20pool.\x20See\x20recovery_hint.'}};if(!Array['isArray'](b['sales'])||b['sales']['length']===0x0)return{'content':[{'type':'text','text':'template_generate\x20refused\x20—\x20no\x20plan\x20was\x20built.\x20The\x20sellable\x20catalog\x20(sales)\x20is\x20required:\x20a\x20plan\x20without\x20one\x20publishes\x20a\x20Service\x20frozen\x20with\x20sales:\x20[]\x20and\x20every\x20order_new\x20aborts\x20(PLAN-SALES-01).\x20List\x20at\x20least\x20one\x20SKU:\x20{\x20name,\x20price,\x20quantity?,\x20wip_hash?\x20}\x20—\x20price\x20in\x20smallest\x20units.'}],'structuredContent':{'result':{'type':'error','error':'template_generate\x20without\x20a\x20non-empty\x20sales\x20catalog\x20(PLAN-SALES-01\x20upgraded\x20to\x20an\x20input\x20requirement,\x20amz9\x20A-2).','error_code':'sales_required','retryable':!![],'recovery_hint':'Pass\x20sales:\x20[{\x20name,\x20price,\x20quantity?,\x20wip_hash?\x20}]\x20—\x20one\x20entry\x20per\x20sellable\x20SKU\x20(wip_hash\x20from\x20the\x20wip_file\x20tool\x20upload).\x20migration_apply\x20is\x20unaffected:\x20it\x20confirms\x20an\x20already-reviewed\x20import.'},'message':'Refused:\x20template_generate\x20requires\x20a\x20sellable\x20catalog.\x20See\x20recovery_hint.'}};const n=scanTemplate(l);assertGenerateScanPassed(n,'template_generate');const o=await runGuide(l,b['description'],b['fee_overrides'],b['guard_resolutions'],{'review_mode':b['review_mode'],'reward_funding':b['reward_funding'],'reward_claim_amount':b['reward_claim_amount'],'after_sales_mode':b['after_sales_mode'],'acceptance_mode':b['acceptance_mode'],'installment_mode':b['installment_mode'],'affiliate_mode':b['affiliate_mode'],'crowdfunding_mode':b['crowdfunding_mode']},b['sales'],d?.['ir']);f=((()=>{const p=scanSummary(n,driftFace(l['id'])),q=buildVerdict(p,o);return{'action':'template_generate','template_id':l['id'],...e,'scan':p,'plan':o,'verdict':q,'next_action':planNextAction(o,'template_generate',q)};})());break;}case'template_scan':{const p=requireTemplate(b['template_id'],'template_scan'),q=await templateScanDryRun(p);f={'action':'template_scan','scan':{...scanTemplate(p),'drift':driftFace(p['id']),'compile_dry_run':q}};break;}case'migration_import':{if(!b['description']||!b['description']['trim']())throw new Error('\x27description\x27\x20is\x20required\x20for\x20action=\x27migration_import\x27');const r=d?handleRecommendIndustry({'intent':b['description'],'semantic_ir':b['semantic_ir']}):undefined,s=planMigration({'url':b['url'],'description':b['description'],'industry':c,'ir_industry':c?undefined:r?.['recommendations'][0x0]?.['industry'],'network':b['network']});if(!s)throw new Error('No\x20industry\x20template\x20matched\x20the\x20description.\x20Refine\x20the\x20description\x20or\x20pass\x20an\x20explicit\x20\x27industry\x27\x20hint'+(d?',\x20or\x20provide\x20semantic_ir\x20with\x20trait/domain\x20evidence.':'\x20(or\x20provide\x20semantic_ir\x20for\x20a\x20non-English\x20description).'));f={'action':'migration_import','log':s,...r?{'inference_source':r['inference_source']}:{},...e,'next_action':'MigrationLog\x20ready.\x20Next:\x20call\x20action=\x27migration_review\x27\x20with\x20this\x20log\x20to\x20surface\x20the\x20mapped/unmapped/manual_review\x20items\x20for\x20user\x20confirmation.'};break;}case'migration_review':{if(!b['log'])throw new Error('\x27log\x27\x20is\x20required\x20for\x20action=\x27migration_review\x27');const t=b['log'],u=Array['isArray'](t['mapped'])?t['mapped']:[],v=Array['isArray'](t['unmapped'])?t['unmapped']:[],w=Array['isArray'](t['manual_review'])?t['manual_review']:[],x=t['risk_check']??{},y=t['source']?.['matched_template']??'',z=v['length']===0x0&&w['length']===0x0&&x['passed']===!![];f={'action':'migration_review','log':t,'review_summary':{'mapped_count':u['length'],'unmapped_count':v['length'],'manual_review_count':w['length'],'risk_passed':x['passed']===!![]},'next_action':z?'Review\x20clean.\x20Proceed:\x20call\x20action=\x27migration_apply\x27\x20with\x20template_id=\x27'+y+'\x27\x20to\x20produce\x20the\x20creation\x20plan\x20(network\x20defaults\x20to\x20testnet;\x20mainnet\x20requires\x20explicit\x20user\x20confirmation).':'Surface\x20the\x20'+v['length']+'\x20unmapped\x20and\x20'+w['length']+'\x20manual_review\x20items'+(x['passed']===!![]?'':'\x20plus\x20the\x20risk_check\x20findings')+'\x20to\x20the\x20user\x20for\x20a\x20decision\x20before\x20action=\x27migration_apply\x27\x20(template_id=\x27'+y+'\x27).'};break;}case'migration_apply':{const A=requireTemplate(b['template_id'],'migration_apply'),B=scanTemplate(A);assertScanPassed(B,'migration_apply');const C=b['network']??'testnet',D=await runGuide(A,b['description'],b['fee_overrides'],b['guard_resolutions'],{'review_mode':b['review_mode'],'reward_funding':b['reward_funding'],'reward_claim_amount':b['reward_claim_amount'],'after_sales_mode':b['after_sales_mode'],'acceptance_mode':b['acceptance_mode'],'installment_mode':b['installment_mode'],'affiliate_mode':b['affiliate_mode'],'crowdfunding_mode':b['crowdfunding_mode']},b['sales'],d?.['ir']);f=((()=>{const E=scanSummary(B,driftFace(A['id'])),F=buildVerdict(E,D);return{'action':'migration_apply','template_id':A['id'],'network':C,...e,'scan':E,'plan':D,'verdict':F,'next_action':planNextAction(D,'migration_apply',F)};})());break;}default:throw new Error('Unknown\x20benchmark_migration_operation\x20action:\x20'+String(b['action']));}return{'content':[{'type':'text','text':JSON['stringify']({'result':f})}],'structuredContent':{'result':f}};}
|