@wowok/agent-mcp 3.2.4 → 3.2.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/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/communication/wts-attestation.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/blueprint-view.d.ts +64 -0
- package/dist/composition/blueprint-view.js +1 -0
- package/dist/composition/compile.d.ts +3 -2
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +17 -0
- package/dist/composition/inflight.js +1 -0
- package/dist/config/config-audit.spec.js +1 -1
- package/dist/customer/account-events.js +1 -1
- package/dist/customer/order-monitor.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/constraint-registry.d.ts +6 -1
- package/dist/extensions/constraint-registry.js +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/index.js +1 -1
- package/dist/extensions/industry-pack.d.ts +6 -0
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/mode-evaluator.d.ts +3 -2
- package/dist/extensions/mode-evaluator.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/extensions/registry.d.ts +1 -2
- package/dist/extensions/registry.js +1 -1
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/analyze.spec.js +1 -1
- package/dist/graph/onchain/anti-cheat.d.ts +32 -2
- package/dist/graph/onchain/anti-cheat.js +1 -1
- package/dist/graph/onchain/anti-cheat.spec.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/extract.js +1 -1
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/graph/onchain/graph-policy.spec.js +1 -1
- package/dist/graph/onchain/index.d.ts +2 -2
- package/dist/graph/onchain/index.js +1 -1
- package/dist/graph/onchain/project-relationship.js +1 -1
- package/dist/graph/onchain/table-ledger.spec.js +1 -1
- package/dist/graph/onchain/types.d.ts +3 -0
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/arbitration-venue-order.d.ts +25 -0
- package/dist/knowledge/arbitration-venue-order.js +1 -0
- package/dist/knowledge/audit-rules.d.ts +12 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/risk-baselines.spec.js +1 -1
- package/dist/knowledge/baselines/rules/allocation.json +5 -5
- package/dist/knowledge/baselines/rules/arb.json +1 -1
- package/dist/knowledge/baselines/rules/graph.json +81 -0
- package/dist/knowledge/baselines/rules/guard.json +9 -9
- package/dist/knowledge/baselines/rules/machine.json +5 -5
- package/dist/knowledge/baselines/rules/order.json +1 -1
- package/dist/knowledge/baselines/rules/plan.json +80 -2
- package/dist/knowledge/builtin-templates.d.ts +18 -2
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/entity-recipient-guard.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-bindings.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-field-cognition.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-lint.d.ts +1 -0
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-node-gates.d.ts +4 -0
- package/dist/knowledge/guard-node-gates.js +1 -0
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-submission-prompt.d.ts +1 -0
- package/dist/knowledge/guard-submission-prompt.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +2 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-topology.d.ts +6 -0
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/reputation-rules.d.ts +3 -9
- package/dist/knowledge/reputation-rules.js +1 -1
- package/dist/knowledge/safety-rules.d.ts +10 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +2 -4
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/settlement-semantics.d.ts +1 -0
- package/dist/knowledge/settlement-semantics.js +1 -0
- package/dist/knowledge/template-loader.d.ts +29 -2
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +14 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-validation.d.ts +2 -0
- package/dist/knowledge/template-validation.js +1 -0
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +1 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/allocation-advice.js +1 -1
- package/dist/participation/customer-interest.js +1 -1
- package/dist/participation/radar-core.d.ts +6 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/game-theory.d.ts +2 -2
- package/dist/playbooks/service-build/game-theory.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +79 -13
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.d.ts +7 -0
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/mode-actions.js +1 -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/pipeline-actions.d.ts +1 -1
- package/dist/playbooks/service-build/pipeline-actions.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.d.ts +1 -0
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.js +1 -0
- package/dist/playbooks/service-build/reverse-mapping.d.ts +24 -0
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/risk-aggregator.d.ts +1 -1
- package/dist/playbooks/service-build/risk-aggregator.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/playbooks/service-build/workflow-design-assessment.d.ts +2 -2
- package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
- package/dist/relationship/derivation.d.ts +1 -0
- package/dist/review/index.js +1 -1
- package/dist/runtime/instance-registry.d.ts +8 -0
- package/dist/runtime/instance-registry.js +1 -0
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +14 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +109 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +14 -0
- package/dist/schema/call/contact.js +1 -1
- 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 +7 -0
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +7 -0
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/payment.js +1 -1
- package/dist/schema/call/permission-handler.js +1 -1
- package/dist/schema/call/progress.d.ts +46 -0
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +22 -8
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/goal/index.d.ts +11 -0
- package/dist/schema/goal/planning.d.ts +32 -1
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +40 -0
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/keeper/index.d.ts +13 -0
- package/dist/schema/local/index.d.ts +75 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +17 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +46 -2
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.d.ts +64 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +94 -0
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.d.ts +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/utils/permission-machine-check.js +1 -1
- package/dist/schema/workspace/index.d.ts +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +45 -0
- package/dist/schemas/benchmark_migration_operation.output.json +24 -4
- package/dist/schemas/benchmark_migration_operation.schema.json +70 -0
- package/dist/schemas/bridge_operation.output.json +45 -0
- package/dist/schemas/goal_operation.schema.json +79 -1
- package/dist/schemas/guard2file.output.json +6 -1
- package/dist/schemas/guard2file.schema.json +9 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +91 -0
- package/dist/schemas/industry_pack_operation.schema.json +19 -1
- package/dist/schemas/keeper_operation.output.json +44 -0
- package/dist/schemas/local_cache_operation.output.json +45 -0
- package/dist/schemas/local_history_operation.output.json +45 -0
- package/dist/schemas/local_info_operation.output.json +45 -0
- package/dist/schemas/local_mark_operation.output.json +45 -0
- package/dist/schemas/machineNode2file.output.json +6 -1
- package/dist/schemas/machineNode2file.schema.json +9 -0
- package/dist/schemas/messenger_operation.output.json +52 -0
- package/dist/schemas/monitor_events.output.json +44 -0
- package/dist/schemas/monitor_subscription.output.json +44 -0
- package/dist/schemas/onchain_events.output.json +44 -0
- package/dist/schemas/onchain_operations.output.json +133 -0
- package/dist/schemas/onchain_operations.schema.json +110 -18
- package/dist/schemas/onchain_operations_arbitration.schema.json +2 -1
- package/dist/schemas/onchain_operations_contact.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +2 -2
- package/dist/schemas/onchain_operations_machine.schema.json +2 -2
- package/dist/schemas/onchain_operations_payment.schema.json +1 -1
- package/dist/schemas/onchain_operations_progress.schema.json +57 -0
- package/dist/schemas/onchain_operations_service.schema.json +44 -10
- package/dist/schemas/onchain_table_data.output.json +81 -13
- package/dist/schemas/onchain_table_data.schema.json +21 -21
- package/dist/schemas/query_toolkit.output.json +218 -9
- package/dist/schemas/query_toolkit.schema.json +50 -26
- package/dist/schemas/wowok_buildin_info.output.json +80 -1
- package/dist/schemas/wowok_buildin_info.schema.json +1 -1
- package/dist/tools/handlers/benchmark-migration.d.ts +3 -13
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/file-export.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/review-chain.d.ts +22 -0
- package/dist/tools/handlers/review-chain.js +1 -0
- package/dist/tools/registry/agent.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/config.js +1 -1
- package/dist/tools/registry/evaluation.js +1 -1
- package/dist/tools/registry/files.js +1 -1
- package/dist/tools/registry/identity.js +1 -1
- package/dist/tools/registry/local.js +1 -1
- package/dist/tools/registry/messenger.js +1 -1
- package/dist/tools/registry/monitor.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/rules-hook.js +1 -1
- package/dist/tools/runtime-health.d.ts +10 -0
- package/dist/tools/runtime-health.js +1 -0
- package/dist/tools/upgrade-check.d.ts +10 -1
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wip-deploy-assist.js +1 -1
- package/dist/tools/wrap.d.ts +3 -0
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
- package/dist/playbooks/service-build/semantic-graph.d.ts +0 -99
- package/dist/playbooks/service-build/semantic-graph.js +0 -1
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
"type": "string"
|
|
290
290
|
},
|
|
291
291
|
"network": {
|
|
292
|
-
"description": "Network to query: 'mainnet'
|
|
292
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
293
293
|
"type": "string",
|
|
294
294
|
"enum": [
|
|
295
295
|
"localnet",
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
"type": "boolean"
|
|
343
343
|
},
|
|
344
344
|
"network": {
|
|
345
|
-
"description": "Network to query: 'mainnet'
|
|
345
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
346
346
|
"type": "string",
|
|
347
347
|
"enum": [
|
|
348
348
|
"localnet",
|
|
@@ -377,7 +377,7 @@
|
|
|
377
377
|
"type": "boolean"
|
|
378
378
|
},
|
|
379
379
|
"network": {
|
|
380
|
-
"description": "Network to query: 'mainnet'
|
|
380
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
381
381
|
"type": "string",
|
|
382
382
|
"enum": [
|
|
383
383
|
"localnet",
|
|
@@ -465,7 +465,7 @@
|
|
|
465
465
|
"type": "boolean"
|
|
466
466
|
},
|
|
467
467
|
"network": {
|
|
468
|
-
"description": "Network to query: 'mainnet'
|
|
468
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
469
469
|
"type": "string",
|
|
470
470
|
"enum": [
|
|
471
471
|
"localnet",
|
|
@@ -497,7 +497,7 @@
|
|
|
497
497
|
"type": "boolean"
|
|
498
498
|
},
|
|
499
499
|
"network": {
|
|
500
|
-
"description": "Network to query: 'mainnet'
|
|
500
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
501
501
|
"type": "string",
|
|
502
502
|
"enum": [
|
|
503
503
|
"localnet",
|
|
@@ -525,7 +525,7 @@
|
|
|
525
525
|
"description": "Checkpoint sequence number (e.g. \"12345\") or checkpoint digest. A checkpoint (block) is the chain's unit of finalization — use it to answer 'what happened at block N', look up block time/transaction count, or place a transaction in the global order (checkpoint sequences appear in onchain_transaction/onchain_object_history results)."
|
|
526
526
|
},
|
|
527
527
|
"network": {
|
|
528
|
-
"description": "Network to query: 'mainnet'
|
|
528
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
529
529
|
"type": "string",
|
|
530
530
|
"enum": [
|
|
531
531
|
"localnet",
|
|
@@ -592,7 +592,7 @@
|
|
|
592
592
|
"type": "boolean"
|
|
593
593
|
},
|
|
594
594
|
"network": {
|
|
595
|
-
"description": "Network to query: 'mainnet'
|
|
595
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
596
596
|
"type": "string",
|
|
597
597
|
"enum": [
|
|
598
598
|
"localnet",
|
|
@@ -628,7 +628,7 @@
|
|
|
628
628
|
"type": "boolean"
|
|
629
629
|
},
|
|
630
630
|
"network": {
|
|
631
|
-
"description": "Network to query: 'mainnet'
|
|
631
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
632
632
|
"type": "string",
|
|
633
633
|
"enum": [
|
|
634
634
|
"localnet",
|
|
@@ -722,7 +722,7 @@
|
|
|
722
722
|
"type": "boolean"
|
|
723
723
|
},
|
|
724
724
|
"network": {
|
|
725
|
-
"description": "Network to query: 'mainnet'
|
|
725
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
726
726
|
"type": "string",
|
|
727
727
|
"enum": [
|
|
728
728
|
"localnet",
|
|
@@ -772,7 +772,7 @@
|
|
|
772
772
|
]
|
|
773
773
|
},
|
|
774
774
|
"network": {
|
|
775
|
-
"description": "Network to query: 'mainnet'
|
|
775
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
776
776
|
"type": "string",
|
|
777
777
|
"enum": [
|
|
778
778
|
"localnet",
|
|
@@ -823,7 +823,7 @@
|
|
|
823
823
|
"type": "boolean"
|
|
824
824
|
},
|
|
825
825
|
"network": {
|
|
826
|
-
"description": "Network to query: 'mainnet'
|
|
826
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
827
827
|
"type": "string",
|
|
828
828
|
"enum": [
|
|
829
829
|
"localnet",
|
|
@@ -880,7 +880,7 @@
|
|
|
880
880
|
"type": "boolean"
|
|
881
881
|
},
|
|
882
882
|
"network": {
|
|
883
|
-
"description": "Network to query: 'mainnet'
|
|
883
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
884
884
|
"type": "string",
|
|
885
885
|
"enum": [
|
|
886
886
|
"localnet",
|
|
@@ -931,7 +931,7 @@
|
|
|
931
931
|
"type": "boolean"
|
|
932
932
|
},
|
|
933
933
|
"network": {
|
|
934
|
-
"description": "Network to query: 'mainnet'
|
|
934
|
+
"description": "Network to query: 'localnet' | 'mainnet' | 'testnet'. If omitted, the SDK's current default network is used (check via wowok_buildin_info info='current network'); the response echoes the resolved network so results can never be misattributed.",
|
|
935
935
|
"type": "string",
|
|
936
936
|
"enum": [
|
|
937
937
|
"localnet",
|
|
@@ -965,7 +965,7 @@
|
|
|
965
965
|
"mainnet",
|
|
966
966
|
"localnet"
|
|
967
967
|
],
|
|
968
|
-
"description": "Network for the query —
|
|
968
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
969
969
|
}
|
|
970
970
|
},
|
|
971
971
|
"required": [
|
|
@@ -1028,7 +1028,7 @@
|
|
|
1028
1028
|
"mainnet",
|
|
1029
1029
|
"localnet"
|
|
1030
1030
|
],
|
|
1031
|
-
"description": "Network for the query —
|
|
1031
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1032
1032
|
}
|
|
1033
1033
|
},
|
|
1034
1034
|
"required": [
|
|
@@ -1036,7 +1036,7 @@
|
|
|
1036
1036
|
"service_address"
|
|
1037
1037
|
],
|
|
1038
1038
|
"additionalProperties": false,
|
|
1039
|
-
"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."
|
|
1039
|
+
"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). Also previews the reward terms of every Reward hung on the Service (pool balance, per-claim amount, claim window) so a buyer never budgets on an expired or unfunded reward. 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."
|
|
1040
1040
|
},
|
|
1041
1041
|
{
|
|
1042
1042
|
"type": "object",
|
|
@@ -1056,7 +1056,7 @@
|
|
|
1056
1056
|
"mainnet",
|
|
1057
1057
|
"localnet"
|
|
1058
1058
|
],
|
|
1059
|
-
"description": "Network for the query —
|
|
1059
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1060
1060
|
}
|
|
1061
1061
|
},
|
|
1062
1062
|
"required": [
|
|
@@ -1091,7 +1091,7 @@
|
|
|
1091
1091
|
"mainnet",
|
|
1092
1092
|
"localnet"
|
|
1093
1093
|
],
|
|
1094
|
-
"description": "Network for the query —
|
|
1094
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1095
1095
|
}
|
|
1096
1096
|
},
|
|
1097
1097
|
"required": [
|
|
@@ -1118,7 +1118,7 @@
|
|
|
1118
1118
|
"mainnet",
|
|
1119
1119
|
"localnet"
|
|
1120
1120
|
],
|
|
1121
|
-
"description": "Network for the query —
|
|
1121
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1122
1122
|
}
|
|
1123
1123
|
},
|
|
1124
1124
|
"required": [
|
|
@@ -1152,7 +1152,7 @@
|
|
|
1152
1152
|
"mainnet",
|
|
1153
1153
|
"localnet"
|
|
1154
1154
|
],
|
|
1155
|
-
"description": "Network for the query —
|
|
1155
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1156
1156
|
},
|
|
1157
1157
|
"context_depth": {
|
|
1158
1158
|
"description": "BFS recursion depth for dependency expansion in assemble_context (default 0 = no expansion). When >0, the assembly recursively queries objects referenced by the center objects (permission, guard, machine, service, repositories, etc.) up to the given depth, using the same address-field extraction rules as extractAddressFields. Each level issues one batched query_objects call (≤50 IDs per batch). Cycles are detected and skipped via a visited set. Discovered dependencies are returned in `dependencies` (edge metadata) and `dependency_objects` (full object states). Recommended: 1–2 for most use cases; 3+ may pull large subgraphs (use context_include to constrain).",
|
|
@@ -1195,7 +1195,7 @@
|
|
|
1195
1195
|
"mainnet",
|
|
1196
1196
|
"localnet"
|
|
1197
1197
|
],
|
|
1198
|
-
"description": "Network for the query —
|
|
1198
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1199
1199
|
},
|
|
1200
1200
|
"reverse_order_amount": {
|
|
1201
1201
|
"description": "Escrowed order amount (smallest-unit string) for reverse_map — included in the report summary as the concrete escrow mention.",
|
|
@@ -1246,6 +1246,30 @@
|
|
|
1246
1246
|
"description": "Attach order-monitor alerts (progress stall / compensation fund / review & arbitration windows) to each per-order result. Default true.",
|
|
1247
1247
|
"type": "boolean"
|
|
1248
1248
|
},
|
|
1249
|
+
"radar_review_summary": {
|
|
1250
|
+
"description": "Merchant-side review coverage summary (REVIEW-COMPONENT-PLAN batch 4): completed orders vs orders with a structured review record. Review rows live in a caller-named Repository — gather both counts via onchain_table_data (repository rows under the 'review' key, id_from=Signer → one row per buyer) and pass them in; the radar derives the merchant-side review-rate hint (high missing rate with a reward attached → reward lapsed or window too short). Omit when no review repository is bound.",
|
|
1251
|
+
"type": "object",
|
|
1252
|
+
"properties": {
|
|
1253
|
+
"orders_completed": {
|
|
1254
|
+
"type": "integer",
|
|
1255
|
+
"minimum": 0,
|
|
1256
|
+
"maximum": 9007199254740991
|
|
1257
|
+
},
|
|
1258
|
+
"reviews_written": {
|
|
1259
|
+
"type": "integer",
|
|
1260
|
+
"minimum": 0,
|
|
1261
|
+
"maximum": 9007199254740991
|
|
1262
|
+
},
|
|
1263
|
+
"reward_bound": {
|
|
1264
|
+
"type": "boolean"
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
"required": [
|
|
1268
|
+
"orders_completed",
|
|
1269
|
+
"reviews_written"
|
|
1270
|
+
],
|
|
1271
|
+
"additionalProperties": false
|
|
1272
|
+
},
|
|
1249
1273
|
"radar_monitor_thresholds": {
|
|
1250
1274
|
"description": "Optional per-call overrides for order-monitor alert thresholds (only used when radar_include_alerts is on). All fields optional; omitted fields keep defaults. Units: hours/days as marked per field.",
|
|
1251
1275
|
"type": "object",
|
|
@@ -1292,7 +1316,7 @@
|
|
|
1292
1316
|
"mainnet",
|
|
1293
1317
|
"localnet"
|
|
1294
1318
|
],
|
|
1295
|
-
"description": "Network for the query —
|
|
1319
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1296
1320
|
}
|
|
1297
1321
|
},
|
|
1298
1322
|
"required": [
|
|
@@ -1337,7 +1361,7 @@
|
|
|
1337
1361
|
"mainnet",
|
|
1338
1362
|
"localnet"
|
|
1339
1363
|
],
|
|
1340
|
-
"description": "Network for the query —
|
|
1364
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1341
1365
|
}
|
|
1342
1366
|
},
|
|
1343
1367
|
"required": [
|
|
@@ -1382,7 +1406,7 @@
|
|
|
1382
1406
|
"mainnet",
|
|
1383
1407
|
"localnet"
|
|
1384
1408
|
],
|
|
1385
|
-
"description": "Network for the query —
|
|
1409
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1386
1410
|
},
|
|
1387
1411
|
"account": {
|
|
1388
1412
|
"description": "Scope the aggregation to ONE account address (the client's current account). Omit to aggregate across ALL local accounts.",
|
|
@@ -1417,7 +1441,7 @@
|
|
|
1417
1441
|
"mainnet",
|
|
1418
1442
|
"localnet"
|
|
1419
1443
|
],
|
|
1420
|
-
"description": "Network for the query —
|
|
1444
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1421
1445
|
},
|
|
1422
1446
|
"account": {
|
|
1423
1447
|
"description": "Scope to ONE account address (the client's current account). Omit to merge across ALL local accounts.",
|
|
@@ -1493,7 +1517,7 @@
|
|
|
1493
1517
|
"mainnet",
|
|
1494
1518
|
"localnet"
|
|
1495
1519
|
],
|
|
1496
|
-
"description": "Network for the query —
|
|
1520
|
+
"description": "Network for the query — THIS field is `context_network` (the query tools accept no separate `network` key). Defaults to the user's CURRENT network (client UI selection / authority config) when omitted. 'localnet' is for internal test use against a local fullnode."
|
|
1497
1521
|
},
|
|
1498
1522
|
"intent": {
|
|
1499
1523
|
"description": "SEMANTIC exploration strategy (G3) — what this topology call is trying to establish. Deterministically shapes the edge whitelist, per-family depth caps and budget: full_map=complete structural map; order_health=order lifecycle+completion+disputes; fund_flow=payments+allocation waterfall+guard-gated splits; workflow=Machine node graphs+transitions+progress; counterparty=who is on the other side (buyer/seller/agents/operators); reputation=votes+arbitration record+contacts; permission=permission groups+bindings+entity tables; supply_chain=multi-leg allocation/sub-order settlement; arbitration=dispute cases+voters; demand_match=demand presenters+guards+rewards. When omitted, defaults come from the persona system (role default intents < account persona preference), then industry templates; every applied layer is reported in result.strategy.trace.",
|
|
@@ -1600,6 +1600,83 @@
|
|
|
1600
1600
|
"type": "boolean",
|
|
1601
1601
|
"description": "true when any component is outdated"
|
|
1602
1602
|
},
|
|
1603
|
+
"runtime_health": {
|
|
1604
|
+
"type": "object",
|
|
1605
|
+
"properties": {
|
|
1606
|
+
"dist_consistent": {
|
|
1607
|
+
"type": "boolean",
|
|
1608
|
+
"description": "Whether the SDK dist/esm chunk graph on disk is self-consistent (every relative import resolves to an existing file)"
|
|
1609
|
+
},
|
|
1610
|
+
"broken_count": {
|
|
1611
|
+
"type": "number",
|
|
1612
|
+
"description": "Number of broken relative imports found (0 when consistent)"
|
|
1613
|
+
},
|
|
1614
|
+
"broken_examples": {
|
|
1615
|
+
"type": "array",
|
|
1616
|
+
"items": {
|
|
1617
|
+
"type": "string"
|
|
1618
|
+
},
|
|
1619
|
+
"description": "Up to 5 examples of broken imports, formatted \"<file> -> <missing specifier>\""
|
|
1620
|
+
},
|
|
1621
|
+
"runtime_faults": {
|
|
1622
|
+
"type": "array",
|
|
1623
|
+
"items": {
|
|
1624
|
+
"type": "object",
|
|
1625
|
+
"properties": {
|
|
1626
|
+
"operation": {
|
|
1627
|
+
"type": "string",
|
|
1628
|
+
"description": "SDK operation that hit the fault"
|
|
1629
|
+
},
|
|
1630
|
+
"module": {
|
|
1631
|
+
"type": "string",
|
|
1632
|
+
"description": "Chunk the runtime failed to load"
|
|
1633
|
+
},
|
|
1634
|
+
"error": {
|
|
1635
|
+
"type": "string",
|
|
1636
|
+
"description": "Raw error message"
|
|
1637
|
+
},
|
|
1638
|
+
"at": {
|
|
1639
|
+
"type": "string",
|
|
1640
|
+
"description": "ISO timestamp of first occurrence in this process"
|
|
1641
|
+
},
|
|
1642
|
+
"count": {
|
|
1643
|
+
"type": "number",
|
|
1644
|
+
"description": "Recurrence count in this process"
|
|
1645
|
+
}
|
|
1646
|
+
},
|
|
1647
|
+
"required": [
|
|
1648
|
+
"operation",
|
|
1649
|
+
"module",
|
|
1650
|
+
"error",
|
|
1651
|
+
"at",
|
|
1652
|
+
"count"
|
|
1653
|
+
],
|
|
1654
|
+
"additionalProperties": false
|
|
1655
|
+
},
|
|
1656
|
+
"description": "Module-load faults actually hit by this process (stale in-memory module graph after an SDK rebuild)"
|
|
1657
|
+
},
|
|
1658
|
+
"hint": {
|
|
1659
|
+
"anyOf": [
|
|
1660
|
+
{
|
|
1661
|
+
"type": "string"
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
"type": "null"
|
|
1665
|
+
}
|
|
1666
|
+
],
|
|
1667
|
+
"description": "Actionable restart hint when unhealthy; null when healthy"
|
|
1668
|
+
}
|
|
1669
|
+
},
|
|
1670
|
+
"required": [
|
|
1671
|
+
"dist_consistent",
|
|
1672
|
+
"broken_count",
|
|
1673
|
+
"broken_examples",
|
|
1674
|
+
"runtime_faults",
|
|
1675
|
+
"hint"
|
|
1676
|
+
],
|
|
1677
|
+
"additionalProperties": false,
|
|
1678
|
+
"description": "SDK runtime module health"
|
|
1679
|
+
},
|
|
1603
1680
|
"reminder": {
|
|
1604
1681
|
"type": "object",
|
|
1605
1682
|
"properties": {
|
|
@@ -1608,9 +1685,10 @@
|
|
|
1608
1685
|
"enum": [
|
|
1609
1686
|
"upgrade",
|
|
1610
1687
|
"install_client",
|
|
1688
|
+
"restart_mcp",
|
|
1611
1689
|
"none"
|
|
1612
1690
|
],
|
|
1613
|
-
"description": "Reminder kind"
|
|
1691
|
+
"description": "Reminder kind (restart_mcp: the SDK runtime in this process is broken and affected operations fail until restart)"
|
|
1614
1692
|
},
|
|
1615
1693
|
"due": {
|
|
1616
1694
|
"type": "boolean",
|
|
@@ -1647,6 +1725,7 @@
|
|
|
1647
1725
|
"client_installed",
|
|
1648
1726
|
"client_install_hint",
|
|
1649
1727
|
"upgrade_available",
|
|
1728
|
+
"runtime_health",
|
|
1650
1729
|
"reminder",
|
|
1651
1730
|
"checked_at"
|
|
1652
1731
|
],
|
|
@@ -603,7 +603,7 @@
|
|
|
603
603
|
"info"
|
|
604
604
|
],
|
|
605
605
|
"additionalProperties": false,
|
|
606
|
-
"description": "Upgrade check - returns current vs latest npm versions of the WoWok MCP server and SDK, whether the WoWok desktop client is installed, and whether an upgrade/install reminder is due. Call at the start of a conversation to decide whether to remind the user to upgrade or
|
|
606
|
+
"description": "Upgrade check - returns current vs latest npm versions of the WoWok MCP server and SDK, whether the WoWok desktop client is installed, SDK runtime module health (detects the stale-chunk failure class that version comparison cannot see), and whether an upgrade/install/restart reminder is due. Call at the start of a conversation to decide whether to remind the user to upgrade, install the client, or restart the MCP server."
|
|
607
607
|
},
|
|
608
608
|
{
|
|
609
609
|
"type": "object",
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import { type IndustryTemplate } from "../../knowledge/template-loader.js";
|
|
1
|
+
import { validateAllocatorRows, type IndustryTemplate } from "../../knowledge/template-loader.js";
|
|
2
2
|
import type { DeliverableDefinition } from "../../playbooks/service-build/intent-analyzer.js";
|
|
3
3
|
import type { IndustryMode } from "../../extensions/index.js";
|
|
4
4
|
import type { ToolDispatchResult } from "../types.js";
|
|
5
|
-
export declare function
|
|
6
|
-
|
|
7
|
-
severity: "critical" | "warning";
|
|
8
|
-
item: string;
|
|
9
|
-
detail: string;
|
|
10
|
-
action: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function planDivergences(t: IndustryTemplate, allocation: Array<{
|
|
13
|
-
recipient: string;
|
|
14
|
-
percentage: number;
|
|
15
|
-
}> | undefined): PlanDivergence[];
|
|
5
|
+
export declare function planNextAction(plan: Record<string, unknown>, retryAction: string): string;
|
|
6
|
+
export { validateAllocatorRows };
|
|
16
7
|
export declare function variantPaymentModel(t: IndustryTemplate): "milestone" | "subscription" | "escrow";
|
|
17
8
|
export declare function variantDeliverables(t: IndustryTemplate, traits: IndustryMode["traits"] | undefined): DeliverableDefinition[];
|
|
18
9
|
export declare function handleBenchmarkMigrationOperation(args: unknown): Promise<ToolDispatchResult>;
|
|
19
|
-
export {};
|
|
@@ -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';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 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.');}export function validateAllocatorRows(a){const b=a['allocator']['rows'];if(b===undefined||b['length']===0x0)return[];const c=[],d=b['filter'](f=>f['track']==='settlement'),e=b['filter'](f=>f['track']==='refund');d['length']!==a['allocator']['count']&&c['push']('settlement\x20rows\x20'+d['length']+'\x20!=\x20allocator.count\x20'+a['allocator']['count']);e['length']>0x0&&!a['allocator']['refund_track']&&c['push']('refund\x20rows\x20declared\x20but\x20allocator.refund_track\x20is\x20missing');a['allocator']['refund_track']&&e['length']===0x0&&c['push']('refund_track\x20\x27'+a['allocator']['refund_track']+'\x27\x20declared\x20but\x20no\x20refund\x20row\x20carries\x20it');for(const [f,g]of[['settlement',d],['refund',e]]){const h=g['filter'](j=>j['mode']==='surplus')['length'];if(h>0x1)c['push'](f+'\x20track\x20has\x20'+h+'\x20Surplus\x20rows\x20(allocation.move\x20allows\x20at\x20most\x20one)');const i=g['filter'](j=>j['mode']==='rate');if(i['length']===g['length']&&i['length']>0x0&&h===0x0){const j=i['reduce']((k,l)=>k+(typeof l['value']==='number'?l['value']:Number(l['value']??NaN)),0x0);(!Number['isFinite'](j)||j!==0x2710)&&c['push'](f+'\x20track\x20is\x20all-Rate\x20but\x20sums\x20to\x20'+j+',\x20not\x2010000\x20bps');}for(const k of g){if(k['mode']==='surplus'&&k['value']!==undefined)c['push'](f+'/'+(k['recipient_key']??'?')+':\x20surplus\x20row\x20must\x20not\x20carry\x20a\x20value');k['mode']==='amount'&&k['value']===undefined&&k['value_from']===undefined&&c['push'](f+'/'+(k['recipient_key']??'?')+':\x20amount\x20row\x20needs\x20value\x20or\x20value_from'),k['value_from']!==undefined&&!(k['value_from']in a['fee_params'])&&c['push'](f+'/'+(k['recipient_key']??'?')+':\x20value_from\x20\x27'+k['value_from']+'\x27\x20is\x20not\x20a\x20fee_params\x20key'),k['recipient']==='guard_identifier'&&k['track']==='settlement'&&c['push']('settlement\x20row\x20uses\x20GuardIdentifier\x20—\x20order-anchored\x20recipients\x20belong\x20to\x20the\x20refund\x20track\x20(see\x20refund_track)');}}return c;}export function planDivergences(a,b){const c=[],d=b?.['length']??0x0,e=(a['allocator']['rows']?.['length']??0x0)>0x0;if(e){const i=validateAllocatorRows(a);i['length']>0x0&&c['push']({'severity':'critical','item':'allocator_rows_invalid','detail':'Template\x20allocator\x20rows\x20are\x20internally\x20inconsistent:\x20'+i['join'](';\x20')+'.','action':'Fix\x20the\x20template\x27s\x20allocator.rows\x20(they\x20are\x20the\x20authoritative\x20money\x20plan;\x20order_allocators\x20is\x20L1-frozen\x20at\x20publish).'});}else 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),\x20or\x20declare\x20allocator.rows\x20in\x20the\x20template.'}),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\x20—\x20no\x20percentage\x20hint\x20was\x20emitted.','action':'Declare\x20allocator.rows\x20in\x20the\x20template\x20(per-row\x20amount\x20/\x20rate\x20/\x20surplus);\x20the\x20pipeline\x20will\x20then\x20carry\x20the\x20real\x20split\x20instead\x20of\x20a\x20hint.'});const f=a['allocator']['refund_track']!==undefined||/refund/i['test'](a['allocator']['description']),g=(a['allocator']['rows']??[])['some'](j=>j['track']==='refund');a['allocator']['refund_track']&&!g&&c['push']({'severity':'critical','item':'refund_track_not_in_plan','detail':'Template\x20declares\x20a\x20\x27'+a['allocator']['refund_track']+'\x27\x20refund\x20track\x20but\x20declares\x20no\x20allocator\x20row\x20with\x20track=\x27refund\x27;\x20the\x20generated\x20plan\x20cannot\x20carry\x20the\x20promised\x20refund\x20rail.','action':'Declare\x20a\x20refund\x20row\x20in\x20allocator.rows\x20(recipient\x20guard_identifier,\x20recipient_key\x20\x270\x27,\x20mode\x20rate,\x20value\x2010000)\x20so\x20the\x20order-anchored\x20full-refund\x20rail\x20rides\x20with\x20the\x20plan.'});if(!f)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 h=Object['keys'](a['fee_params'])['filter'](j=>/_(?:days|hours)$/['test'](j));return h['length']>0x0&&!a['time_anchors']&&c['push']({'severity':'warning','item':'window_anchors','detail':'fee_params\x20declares\x20business\x20windows\x20('+h['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;}export function variantPaymentModel(a){if(a['payment_model'])return a['payment_model'];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;}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 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=[],i=(a['allocator']['rows']?.['length']??0x0)>0x0;if(f!==undefined&&f>0x0&&!i&&a['allocator']['mode']==='rate'){const n=Math['round'](f)/0x64;h['push']({'recipient':'merchant','percentage':Math['round']((0x64-n)*0x64)/0x64}),h['push']({'recipient':'platform','percentage':n}),g['allocation']=h;}const j=variantRefundPolicy(a),k={'escrow':!![]};if(j)k['refundPolicy']=j;k['arbitration']=a['arbitration_mode']??k['arbitration']??inferArbitration(templateIntent(a,b));const l=await handleMerchantGuide({'intent':templateIntent(a,b),'guide_confirm':{'industry':a['industry'],'payment':g,'trust':k,'deliverables':variantDeliverables(a,e?.['traits'])},'mode_prior_override':variantModePrior(a,e),'name_base':a['id']}),m=planDivergences(a,h);if(a['allocator']['rows']?.['length'])l['template_allocator_rows']=a['allocator']['rows']['map'](o=>({...o}));if(m['length']>0x0){l['plan_divergence']={'template_allocator':{...a['allocator']},'template_guard_refs':a['guards']['length'],'plan_allocation':h,'divergences':m,'publish_ready':![]};const o=m['filter'](q=>q['severity']==='critical'),p=a['allocator']['refund_track']!==undefined;if(o['length']>0x0&&p&&!(a['allocator']['rows']?.['length']??0x0))throw new Error('action\x20blocked:\x20template\x20\x27'+a['id']+'\x27\x20declares\x20refund_track=\x27'+a['allocator']['refund_track']+'\x27\x20but\x20'+'carries\x20no\x20allocator.rows,\x20so\x20the\x20generated\x20plan\x20would\x20ship\x20WITHOUT\x20the\x20refund\x20rail\x20it\x20'+'promises.\x20Because\x20order_allocators\x20is\x20L1\x20and\x20one-way-frozen\x20at\x20Service\x20publish,\x20escrow\x20'+'locked\x20under\x20such\x20a\x20plan\x20can\x20never\x20be\x20returned.\x20Refusing\x20to\x20emit\x20an\x20unsafe\x20build\x20plan.\x20'+'Critical\x20divergences:\x20'+o['map'](q=>'['+q['item']+']\x20'+q['detail']+'\x20→\x20'+q['action'])['join']('\x20|\x20')+'.\x20Fix\x20the\x20template\x20by\x20declaring\x20allocator.rows\x20(one\x20row\x20per\x20sharing\x20entry,\x20including\x20the\x20'+'refund\x20track).\x20If\x20the\x20template\x20is\x20already\x20correct\x20on\x20disk\x20but\x20the\x20running\x20build\x20predates\x20'+'it,\x20run\x20industry_pack_operation\x20action=\x27repair_builtin_templates\x27\x20(and\x20'+'action=\x27template_drift\x27\x20to\x20diagnose)\x20first.');}l['template']={'id':a['id'],'archetype':a['archetype'],'recommended_role':a['recommended_role'],'fee_params':d};if(c&&Object['keys'](c)['length']>0x0)l['template_fee_overrides']=c;return l;}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
|
+
import{strictParse}from'../../schema/index.js';import{BenchmarkMigrationSchema}from'../../schema/benchmark-migration/index.js';import{getTemplate,listTemplates,validateAllocatorRows,platformShareBps}from'../../knowledge/template-loader.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 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.');}export function planNextAction(a,b){const c=a['next_action'];if(typeof c==='string'&&c['startsWith']('Plan\x20ready.'))return c;const d=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'+(d>0x0?'Resolve\x20the\x20'+d+'\x20pending\x20guard\x20design(s)\x20in\x20plan.pending_guard_designs\x20via\x20guard_resolutions\x20(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20or\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id),\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??{}};}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){const e=effectiveFeeParams(a,c);validateFeeParams(e,a['id']),validateConditionalParams(a,e);const f=getIndustryModeRegistry()['getMode'](a['industry']),g=platformShareBps(e),h={'model':variantPaymentModel(a)},i=[],j=(a['allocator']['rows']?.['length']??0x0)>0x0;if(g!==undefined&&g>0x0&&!j&&a['allocator']['mode']==='rate'){const n=Math['round'](g)/0x64;i['push']({'recipient':'merchant','percentage':Math['round']((0x64-n)*0x64)/0x64}),i['push']({'recipient':'platform','percentage':n}),h['allocation']=i;}const k=variantRefundPolicy(a),l={'escrow':!![]};if(k)l['refundPolicy']=k;l['arbitration']=a['arbitration_mode']??l['arbitration']??inferArbitration(templateIntent(a,b));const m=await handleMerchantGuide({'intent':templateIntent(a,b),'guide_confirm':{'industry':a['industry'],'payment':h,'trust':l,'deliverables':variantDeliverables(a,f?.['traits']),...d&&Object['keys'](d)['length']>0x0?{'guard_resolutions':d}:{}},'template_override':{...a,'fee_params':e},'name_base':a['id']});if(a['allocator']['rows']?.['length'])m['template_allocator_rows']=a['allocator']['rows']['map'](o=>({...o}));m['template']={'id':a['id'],'archetype':a['archetype'],'recommended_role':a['recommended_role'],'fee_params':e},m['template_fee_param_landings']=buildFeeParamLandingTable(a,e);if(c&&Object['keys'](c)['length']>0x0)m['template_fee_overrides']=c;return m;}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'],b['guard_resolutions']);d={'action':'template_generate','template_id':i['id'],'scan':scanSummary(j),'plan':k,'next_action':planNextAction(k,'template_generate')};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,'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 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']??{},s=n['source']?.['matched_template']??'',t=p['length']===0x0&&q['length']===0x0&&r['passed']===!![];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']===!![]},'next_action':t?'Review\x20clean.\x20Proceed:\x20call\x20action=\x27migration_apply\x27\x20with\x20template_id=\x27'+s+'\x27\x20to\x20produce\x20the\x20creation\x20plan\x20(network\x20defaults\x20to\x20testnet;\x20mainnet\x20requires\x20explicit\x20user\x20confirmation).':'Surface\x20the\x20'+p['length']+'\x20unmapped\x20and\x20'+q['length']+'\x20manual_review\x20items'+(r['passed']===!![]?'':'\x20plus\x20the\x20risk_check\x20findings')+'\x20to\x20the\x20user\x20for\x20a\x20decision\x20before\x20action=\x27migration_apply\x27\x20(template_id=\x27'+s+'\x27).'};break;}case'migration_apply':{const u=requireTemplate(b['template_id'],'migration_apply'),v=scanTemplate(u);assertScanPassed(v,'migration_apply');const w=b['network']??'testnet',x=await runGuide(u,b['description'],b['fee_overrides'],b['guard_resolutions']);d={'action':'migration_apply','template_id':u['id'],'network':w,'scan':scanSummary(v),'plan':x,'next_action':planNextAction(x,'migration_apply')};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 a447a,setEnabled as a447b,reset as a447c}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=a447a(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.');a447b(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.');a447b(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.');a447c(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{resolve}from'path';import{strictParse,getEnvConfig,Guard2File_InputSchema,MachineNode2File_InputSchema}from'../../schema/index.js';import{guard2file,machineNode2file}from'@wowok/wowok';export async function handleGuard2File(a){const b=strictParse(Guard2File_InputSchema,a,'guard2file\x20input'),c=getEnvConfig(b['env']);try{const
|
|
1
|
+
import{resolve}from'path';import{Config}from'@wowok/wowok';import{strictParse,getEnvConfig,Guard2File_InputSchema,MachineNode2File_InputSchema}from'../../schema/index.js';import{guard2file,machineNode2file}from'@wowok/wowok';async function effectiveNetwork(a,b){return Config['Instance']()['network_get'](a??b);}export async function handleGuard2File(a){const b=strictParse(Guard2File_InputSchema,a,'guard2file\x20input'),c=getEnvConfig(b['env']),d=await effectiveNetwork(b['network'],c['network']);try{const e=await guard2file(b['guard'],b['file_path'],b['format']||'json',d),f={'result':{'status':'success','data':{'file_path':resolve(e),'format':b['format']||'json','guard':b['guard'],'network':d}}};return{'content':[{'type':'text','text':JSON['stringify'](f)}],'structuredContent':f};}catch(g){const h={'result':{'status':'error','error':g['message']}};return{'content':[{'type':'text','text':JSON['stringify'](h)}],'structuredContent':h};}}export async function handleMachineNode2File(a){const b=strictParse(MachineNode2File_InputSchema,a,'machineNode2file\x20input'),c=getEnvConfig(b['env']),d=await effectiveNetwork(b['network'],c['network']);try{const e=await machineNode2file(b['machine'],b['file_path'],b['format']||'json',d);let f=undefined;try{const h=resolve(e),i=await import('fs/promises')['then'](j=>j['readFile'](h,'utf-8'));if((b['format']||'json')==='json'){const j=JSON['parse'](i);Array['isArray'](j)&&(f=j['length']);}else{const k=i['match'](/^##\s+Node:/gm);f=k?k['length']:0x0;}}catch{f=undefined;}const g={'result':{'status':'success','data':{'file_path':resolve(e),'format':b['format']||'json','machine_object':b['machine'],'network':d}}};return f!==undefined&&(g['result']['data']['node_count']=f),{'content':[{'type':'text','text':JSON['stringify'](g)}],'structuredContent':g};}catch(l){const m={'result':{'status':'error','error':l['message']}};return{'content':[{'type':'text','text':JSON['stringify'](m)}],'structuredContent':m};}}
|