@wowok/agent-mcp 3.1.3 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/config-audit.spec.d.ts +1 -0
- package/dist/config/config-audit.spec.js +1 -0
- package/dist/config/exposure.d.ts +108 -0
- package/dist/config/exposure.js +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +1 -1
- package/dist/config/judgment.d.ts +1228 -0
- package/dist/config/judgment.js +1 -0
- package/dist/config/judgment.spec.d.ts +1 -0
- package/dist/config/judgment.spec.js +1 -0
- package/dist/config/rule-engine.d.ts +299 -0
- package/dist/config/rule-engine.js +1 -0
- package/dist/config/rule-engine.spec.d.ts +1 -0
- package/dist/config/rule-engine.spec.js +1 -0
- package/dist/config/severity.d.ts +7 -0
- package/dist/config/severity.js +1 -0
- package/dist/customer/order-monitor.d.ts +3 -1
- package/dist/customer/order-monitor.js +1 -1
- package/dist/evaluation/acceptance.d.ts +1 -0
- package/dist/evaluation/acceptance.js +1 -1
- package/dist/evaluation/arbitration-game.js +1 -1
- package/dist/evaluation/builtins/demand-match.js +1 -1
- package/dist/evaluation/builtins/graph-service.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/game-strategy.d.ts +2 -2
- package/dist/evaluation/game-strategy.js +1 -1
- package/dist/evaluation/match-operation.d.ts +2 -2
- package/dist/evaluation/match-operation.js +1 -1
- package/dist/evaluation/standards.d.ts +3 -25
- package/dist/evaluation/standards.js +1 -1
- package/dist/evaluation/types.d.ts +2 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/business-modules.js +1 -1
- package/dist/extensions/custom-registry-file.js +1 -1
- package/dist/extensions/industry-audit.spec.d.ts +1 -0
- package/dist/extensions/industry-audit.spec.js +1 -0
- package/dist/extensions/industry-layers.d.ts +8 -0
- package/dist/extensions/industry-layers.js +1 -1
- package/dist/extensions/industry-pack.d.ts +2 -0
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/mode-evaluator.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/graph/onchain/analyze.d.ts +3 -1
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/analyze.spec.js +1 -1
- package/dist/graph/onchain/edge-schema.d.ts +1 -0
- package/dist/graph/onchain/edge-schema.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exploration.d.ts +28 -0
- package/dist/graph/onchain/exploration.js +1 -0
- package/dist/graph/onchain/exploration.spec.d.ts +1 -0
- package/dist/graph/onchain/exploration.spec.js +1 -0
- package/dist/graph/onchain/exposure.d.ts +18 -0
- package/dist/graph/onchain/exposure.js +1 -0
- package/dist/graph/onchain/exposure.spec.d.ts +1 -0
- package/dist/graph/onchain/exposure.spec.js +1 -0
- package/dist/graph/onchain/graph-policy.spec.d.ts +1 -0
- package/dist/graph/onchain/graph-policy.spec.js +1 -0
- package/dist/graph/onchain/index.d.ts +6 -0
- package/dist/graph/onchain/index.js +1 -1
- package/dist/graph/onchain/interest.js +1 -1
- package/dist/graph/onchain/interest.spec.js +1 -1
- package/dist/graph/onchain/names.js +1 -1
- package/dist/graph/onchain/names.spec.js +1 -1
- package/dist/graph/onchain/policy.d.ts +8 -0
- package/dist/graph/onchain/policy.js +1 -0
- package/dist/graph/onchain/proposal-graph.js +1 -1
- package/dist/graph/onchain/proposal-graph.spec.js +1 -1
- package/dist/graph/onchain/synthesis.d.ts +20 -0
- package/dist/graph/onchain/synthesis.js +1 -0
- package/dist/graph/onchain/synthesis.spec.d.ts +1 -0
- package/dist/graph/onchain/synthesis.spec.js +1 -0
- package/dist/graph/onchain/types.d.ts +11 -1
- package/dist/keeper/keeper.spec.js +1 -1
- package/dist/knowledge/alloc-audit-policy.spec.d.ts +1 -0
- package/dist/knowledge/alloc-audit-policy.spec.js +1 -0
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocation-puzzle.d.ts +1 -1
- package/dist/knowledge/allocation-puzzle.js +1 -1
- package/dist/knowledge/allocation-risk.d.ts +4 -1
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/allocation-templates.js +1 -1
- package/dist/knowledge/arb-risk.d.ts +6 -5
- package/dist/knowledge/arb-risk.js +1 -1
- package/dist/knowledge/arbitration-ledger.d.ts +4 -4
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-puzzle.d.ts +1 -1
- package/dist/knowledge/arbitration-puzzle.js +1 -1
- package/dist/knowledge/arbitration-risk.d.ts +4 -1
- package/dist/knowledge/arbitration-risk.js +1 -1
- package/dist/knowledge/arbitration-templates.js +1 -1
- package/dist/knowledge/baselines/judgment-baselines.json +289 -0
- package/dist/knowledge/baselines/risk-baselines.spec.js +1 -1
- package/dist/knowledge/baselines/rules/alloc_audit.json +290 -0
- package/dist/knowledge/baselines/rules/allocation.json +492 -0
- package/dist/knowledge/baselines/rules/arb.json +155 -0
- package/dist/knowledge/baselines/rules/arbitration.json +366 -0
- package/dist/knowledge/baselines/rules/bridge.json +197 -0
- package/dist/knowledge/baselines/rules/contact.json +152 -0
- package/dist/knowledge/baselines/rules/demand.json +158 -0
- package/dist/knowledge/baselines/rules/graph.json +453 -0
- package/dist/knowledge/baselines/rules/guard.json +981 -0
- package/dist/knowledge/baselines/rules/machine.json +706 -0
- package/dist/knowledge/baselines/rules/order.json +549 -0
- package/dist/knowledge/baselines/rules/payment.json +205 -0
- package/dist/knowledge/baselines/rules/permission.json +330 -0
- package/dist/knowledge/baselines/rules/personal.json +139 -0
- package/dist/knowledge/baselines/rules/progress.json +346 -0
- package/dist/knowledge/baselines/rules/proof.json +158 -0
- package/dist/knowledge/baselines/rules/registrar.json +159 -0
- package/dist/knowledge/baselines/rules/repository.json +244 -0
- package/dist/knowledge/baselines/rules/resource.json +117 -0
- package/dist/knowledge/baselines/rules/reward.json +471 -0
- package/dist/knowledge/baselines/rules/service.json +595 -0
- package/dist/knowledge/baselines/rules/treasury.json +440 -0
- package/dist/knowledge/baselines/rules/util.json +101 -0
- package/dist/knowledge/bridge-risk.d.ts +6 -5
- package/dist/knowledge/bridge-risk.js +1 -1
- package/dist/knowledge/builtin-templates.d.ts +26 -0
- package/dist/knowledge/builtin-templates.js +1 -0
- package/dist/knowledge/contact-risk.d.ts +6 -5
- package/dist/knowledge/contact-risk.js +1 -1
- package/dist/knowledge/demand-risk.d.ts +6 -5
- package/dist/knowledge/demand-risk.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/facts-sync.spec.d.ts +1 -0
- package/dist/knowledge/facts-sync.spec.js +1 -0
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-field-cognition.d.ts +1 -1
- package/dist/knowledge/guard-field-cognition.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-risk.d.ts +4 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +10 -2
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-risk.d.ts +4 -1
- package/dist/knowledge/machine-risk.js +1 -1
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/machine-translation.js +1 -1
- package/dist/knowledge/migration-preflight.js +1 -1
- package/dist/knowledge/operation-dictionary.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/order-puzzle.d.ts +3 -3
- package/dist/knowledge/order-puzzle.js +1 -1
- package/dist/knowledge/order-risk.d.ts +6 -3
- package/dist/knowledge/order-risk.js +1 -1
- package/dist/knowledge/order-templates.js +1 -1
- package/dist/knowledge/passport-ledger.js +1 -1
- package/dist/knowledge/passport-templates.js +1 -1
- package/dist/knowledge/payment-risk.d.ts +8 -6
- package/dist/knowledge/payment-risk.js +1 -1
- package/dist/knowledge/payment-tracker.js +1 -1
- package/dist/knowledge/permission-ledger.js +1 -1
- package/dist/knowledge/permission-puzzle.d.ts +12 -12
- package/dist/knowledge/permission-puzzle.js +1 -1
- package/dist/knowledge/permission-risk.d.ts +4 -7
- package/dist/knowledge/permission-risk.js +1 -1
- package/dist/knowledge/permission-templates.js +1 -1
- package/dist/knowledge/personal-risk.d.ts +6 -5
- package/dist/knowledge/personal-risk.js +1 -1
- package/dist/knowledge/progress-ledger.js +1 -1
- package/dist/knowledge/progress-puzzle.d.ts +2 -2
- package/dist/knowledge/progress-puzzle.js +1 -1
- package/dist/knowledge/progress-risk.d.ts +4 -1
- package/dist/knowledge/progress-risk.js +1 -1
- package/dist/knowledge/progress-templates.js +1 -1
- package/dist/knowledge/proof-risk.d.ts +6 -5
- package/dist/knowledge/proof-risk.js +1 -1
- package/dist/knowledge/puzzle-projections.js +1 -1
- package/dist/knowledge/recipient-constraint.d.ts +20 -1
- package/dist/knowledge/recipient-constraint.js +1 -1
- package/dist/knowledge/registrar-risk.d.ts +6 -5
- package/dist/knowledge/registrar-risk.js +1 -1
- package/dist/knowledge/repository-risk.d.ts +7 -6
- package/dist/knowledge/repository-risk.js +1 -1
- package/dist/knowledge/resource-risk.d.ts +6 -5
- package/dist/knowledge/resource-risk.js +1 -1
- package/dist/knowledge/reward-ledger.d.ts +1 -1
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/reward-puzzle.d.ts +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.d.ts +4 -1
- package/dist/knowledge/reward-risk.js +1 -1
- package/dist/knowledge/rule-node-analyzers.spec.js +1 -1
- package/dist/knowledge/rule-outcome.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +2 -2
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/scenario-topology.js +1 -1
- package/dist/knowledge/service-allocator-audit-node.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-puzzle.d.ts +2 -2
- package/dist/knowledge/service-puzzle.js +1 -1
- package/dist/knowledge/service-risk-node.js +1 -1
- package/dist/knowledge/service-risk.d.ts +4 -1
- package/dist/knowledge/service-risk.js +1 -1
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/strategy-manuals.d.ts +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +84 -0
- package/dist/knowledge/template-loader.js +1 -0
- package/dist/knowledge/template-loader.spec.d.ts +1 -0
- package/dist/knowledge/template-loader.spec.js +1 -0
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +17 -0
- package/dist/knowledge/template-scanner.js +1 -0
- package/dist/knowledge/template-scanner.spec.d.ts +1 -0
- package/dist/knowledge/template-scanner.spec.js +1 -0
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/treasury-ledger.d.ts +1 -1
- package/dist/knowledge/treasury-ledger.js +1 -1
- package/dist/knowledge/treasury-puzzle.d.ts +3 -3
- package/dist/knowledge/treasury-puzzle.js +1 -1
- package/dist/knowledge/treasury-risk.d.ts +4 -1
- package/dist/knowledge/treasury-risk.js +1 -1
- package/dist/knowledge/treasury-templates.js +1 -1
- package/dist/knowledge/util-risk.d.ts +6 -5
- package/dist/knowledge/util-risk.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +4 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/knowledge/workspace-lists.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/arbitrator-interest.js +1 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/persona/analyzer.js +1 -1
- package/dist/persona/index.js +1 -1
- package/dist/persona/model.js +1 -1
- package/dist/persona/persona-audit.spec.d.ts +1 -0
- package/dist/persona/persona-audit.spec.js +1 -0
- package/dist/persona/types.d.ts +2 -0
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/facet-money.d.ts +11 -0
- package/dist/playbooks/service-build/facet-money.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.d.ts +17 -0
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +2 -2
- package/dist/playbooks/service-build/migration-planner.d.ts +43 -0
- package/dist/playbooks/service-build/migration-planner.js +1 -0
- package/dist/playbooks/service-build/object-panorama.d.ts +42 -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/reverse-mapping.d.ts +1 -0
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/risk-aggregator.d.ts +2 -1
- package/dist/playbooks/service-build/risk-aggregator.js +1 -1
- package/dist/playbooks/service-build/semantic-graph.js +1 -1
- package/dist/playbooks/service-build/service-panorama.d.ts +53 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/topology-evaluation.spec.js +1 -1
- package/dist/playbooks/service-build/topology-query.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/registry.js +1 -1
- package/dist/review/machine.js +1 -1
- package/dist/review/order.js +1 -1
- package/dist/review/service.js +1 -1
- package/dist/review/types.d.ts +7 -0
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +207 -0
- package/dist/schema/benchmark-migration/index.js +1 -0
- package/dist/schema/call/allocation.d.ts +1 -1
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.d.ts +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +5 -5
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/contact.d.ts +1 -1
- package/dist/schema/call/demand.d.ts +1 -1
- package/dist/schema/call/guard.d.ts +3 -3
- package/dist/schema/call/machine.d.ts +5 -5
- package/dist/schema/call/order.d.ts +3 -3
- package/dist/schema/call/payment.js +1 -1
- package/dist/schema/call/permission-handler.d.ts +1 -1
- package/dist/schema/call/permission-handler.js +1 -1
- package/dist/schema/call/permission.d.ts +16 -16
- package/dist/schema/call/permission.js +1 -1
- package/dist/schema/call/personal.d.ts +8 -8
- package/dist/schema/call/personal.js +1 -1
- package/dist/schema/call/progress.d.ts +3 -3
- package/dist/schema/call/repository.d.ts +11 -11
- package/dist/schema/call/repository.js +1 -1
- package/dist/schema/call/reward.d.ts +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +7 -7
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +1 -1
- package/dist/schema/common/index.d.ts +6 -6
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/config/index.d.ts +50 -1
- package/dist/schema/config/index.js +1 -1
- package/dist/schema/evaluation/index.d.ts +27 -11
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +5 -5
- package/dist/schema/goal/planning.d.ts +15 -15
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -1
- package/dist/schema/interaction/index.d.ts +1 -1
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +26 -26
- package/dist/schema/operations.d.ts +33 -33
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +4708 -0
- package/dist/schema/persona/index.js +1 -1
- package/dist/schema/query/bi.d.ts +232 -25
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +35 -35
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workflow/index.d.ts +1 -1
- package/dist/schema/workspace/index.d.ts +53 -0
- package/dist/schema/workspace/index.js +1 -1
- package/dist/schema-query-impl/index.d.ts +9 -0
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/benchmark_migration_operation.output.json +793 -0
- package/dist/schemas/benchmark_migration_operation.schema.json +83 -0
- package/dist/schemas/bridge_operation.schema.json +5 -5
- package/dist/schemas/config_operation.output.json +252 -0
- package/dist/schemas/config_operation.schema.json +21 -1
- package/dist/schemas/evaluation_operation.output.json +22 -10
- package/dist/schemas/goal_operation.schema.json +8 -8
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +7 -1
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.schema.json +24 -12
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +4 -2
- package/dist/schemas/onchain_operations.schema.json +189 -139
- package/dist/schemas/onchain_operations_allocation.schema.json +13 -11
- package/dist/schemas/onchain_operations_arbitration.schema.json +10 -8
- package/dist/schemas/onchain_operations_contact.schema.json +7 -5
- package/dist/schemas/onchain_operations_demand.schema.json +7 -5
- package/dist/schemas/onchain_operations_gen_passport.schema.json +5 -3
- package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +5 -3
- package/dist/schemas/onchain_operations_machine.schema.json +22 -18
- package/dist/schemas/onchain_operations_order.schema.json +11 -7
- package/dist/schemas/onchain_operations_payment.schema.json +3 -3
- package/dist/schemas/onchain_operations_permission.schema.json +19 -11
- package/dist/schemas/onchain_operations_personal.schema.json +16 -10
- package/dist/schemas/onchain_operations_progress.schema.json +11 -7
- package/dist/schemas/onchain_operations_proof.schema.json +5 -3
- package/dist/schemas/onchain_operations_repository.schema.json +12 -8
- package/dist/schemas/onchain_operations_reward.schema.json +11 -9
- package/dist/schemas/onchain_operations_service.schema.json +28 -22
- package/dist/schemas/onchain_operations_treasury.schema.json +11 -9
- package/dist/schemas/onchain_table_data.output.json +27 -17
- package/dist/schemas/persona_operation.output.json +15875 -1
- package/dist/schemas/persona_operation.schema.json +3056 -478
- package/dist/schemas/query_toolkit.output.json +343 -63
- package/dist/schemas/query_toolkit.schema.json +1 -1
- package/dist/schemas/workflow_operation.schema.json +4 -2
- package/dist/schemas/workspace_operation.output.json +181 -1
- package/dist/schemas/workspace_operation.schema.json +61 -2
- package/dist/strategy/scorecard.js +1 -1
- package/dist/tools/handlers/benchmark-migration.d.ts +2 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -0
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/handlers/workspace.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/move-fn-index.gen.d.ts +3 -0
- package/dist/tools/move-fn-index.gen.js +1 -0
- 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/onchain.js +1 -1
- package/dist/tools/sanitize-output.d.ts +3 -0
- package/dist/tools/sanitize-output.js +1 -0
- package/dist/tools/sanitize-output.spec.d.ts +1 -0
- package/dist/tools/sanitize-output.spec.js +1 -0
- package/package.json +9 -4
- package/dist/knowledge/baselines/evaluation-baselines.json +0 -79
|
@@ -1364,7 +1364,7 @@
|
|
|
1364
1364
|
"query_type"
|
|
1365
1365
|
],
|
|
1366
1366
|
"additionalProperties": false,
|
|
1367
|
-
"description": "Like / Favor list for ONE account (client Quick Access 'Like / Favor' tab) — every address (object OR plain user) the account has EVER liked / disliked / favored, deduplicated, with the CURRENT active vote kinds per target. Deterministic source: the voter's own Resource mark table
|
|
1367
|
+
"description": "Like / Favor list for ONE account (client Quick Access 'Like / Favor' tab) — every address (object OR plain user) the account has EVER liked / disliked / favored, deduplicated, with the CURRENT active vote kinds per target. Deterministic source: the voter's own Resource mark table, cross-read with the target's EntityLinker votes for the 'marked at' clock. Fully-toggled-off targets are dropped. Each row: address + tags (like/dislike/favor) + time + object_type (null = plain user) + local name / description / tags. Aggregation result is TTL-cached (120s, keyed by network + account). Read-only."
|
|
1368
1368
|
},
|
|
1369
1369
|
{
|
|
1370
1370
|
"type": "object",
|
|
@@ -503,12 +503,14 @@
|
|
|
503
503
|
}
|
|
504
504
|
},
|
|
505
505
|
"check_all_founded": {
|
|
506
|
-
"
|
|
506
|
+
"default": true,
|
|
507
|
+
"description": "Whether to check all entities are found. Defaults to true: abort and throw if ANY entity cannot be resolved. Set false only when partial resolution is explicitly intended (only found IDs are returned)",
|
|
507
508
|
"type": "boolean"
|
|
508
509
|
}
|
|
509
510
|
},
|
|
510
511
|
"required": [
|
|
511
|
-
"entities"
|
|
512
|
+
"entities",
|
|
513
|
+
"check_all_founded"
|
|
512
514
|
],
|
|
513
515
|
"additionalProperties": false,
|
|
514
516
|
"description": "Used to batch find account or object IDs by name"
|
|
@@ -88,7 +88,35 @@
|
|
|
88
88
|
},
|
|
89
89
|
"content": {
|
|
90
90
|
"type": "string",
|
|
91
|
-
"description": "File content (text)."
|
|
91
|
+
"description": "File content (text, possibly sliced by offset/limit; base64 when encoding='base64')."
|
|
92
|
+
},
|
|
93
|
+
"encoding": {
|
|
94
|
+
"description": "'base64' when raw bytes are returned; absent/undefined for text.",
|
|
95
|
+
"type": "string",
|
|
96
|
+
"enum": [
|
|
97
|
+
"text",
|
|
98
|
+
"base64"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"size": {
|
|
102
|
+
"description": "File size in bytes (base64 reads only).",
|
|
103
|
+
"type": "number"
|
|
104
|
+
},
|
|
105
|
+
"total_lines": {
|
|
106
|
+
"description": "Total line count of the file (text reads only).",
|
|
107
|
+
"type": "number"
|
|
108
|
+
},
|
|
109
|
+
"offset": {
|
|
110
|
+
"description": "1-based start line of the returned slice (text reads only).",
|
|
111
|
+
"type": "number"
|
|
112
|
+
},
|
|
113
|
+
"limit": {
|
|
114
|
+
"description": "Max lines in the returned slice (text reads only).",
|
|
115
|
+
"type": "number"
|
|
116
|
+
},
|
|
117
|
+
"truncated": {
|
|
118
|
+
"description": "True when lines were cut off by offset/limit (text reads only).",
|
|
119
|
+
"type": "boolean"
|
|
92
120
|
}
|
|
93
121
|
},
|
|
94
122
|
"required": [
|
|
@@ -266,6 +294,158 @@
|
|
|
266
294
|
"ok"
|
|
267
295
|
],
|
|
268
296
|
"additionalProperties": false
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"type": "object",
|
|
300
|
+
"properties": {
|
|
301
|
+
"action": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"const": "search"
|
|
304
|
+
},
|
|
305
|
+
"pattern": {
|
|
306
|
+
"type": "string",
|
|
307
|
+
"description": "The regex pattern that was searched."
|
|
308
|
+
},
|
|
309
|
+
"matches": {
|
|
310
|
+
"type": "array",
|
|
311
|
+
"items": {
|
|
312
|
+
"type": "object",
|
|
313
|
+
"properties": {
|
|
314
|
+
"path": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"description": "Workspace-relative file path."
|
|
317
|
+
},
|
|
318
|
+
"line": {
|
|
319
|
+
"type": "number",
|
|
320
|
+
"description": "1-based line number of the match."
|
|
321
|
+
},
|
|
322
|
+
"text": {
|
|
323
|
+
"type": "string",
|
|
324
|
+
"description": "The matched line."
|
|
325
|
+
},
|
|
326
|
+
"before": {
|
|
327
|
+
"description": "Context lines before the match.",
|
|
328
|
+
"type": "array",
|
|
329
|
+
"items": {
|
|
330
|
+
"type": "string"
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
"after": {
|
|
334
|
+
"description": "Context lines after the match.",
|
|
335
|
+
"type": "array",
|
|
336
|
+
"items": {
|
|
337
|
+
"type": "string"
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"required": [
|
|
342
|
+
"path",
|
|
343
|
+
"line",
|
|
344
|
+
"text"
|
|
345
|
+
],
|
|
346
|
+
"additionalProperties": false
|
|
347
|
+
},
|
|
348
|
+
"description": "Matches (at most max_results)."
|
|
349
|
+
},
|
|
350
|
+
"total_matches": {
|
|
351
|
+
"type": "number",
|
|
352
|
+
"description": "Total number of matches found across all scanned files."
|
|
353
|
+
},
|
|
354
|
+
"truncated": {
|
|
355
|
+
"type": "boolean",
|
|
356
|
+
"description": "True when matches were cut off by max_results."
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"required": [
|
|
360
|
+
"action",
|
|
361
|
+
"pattern",
|
|
362
|
+
"matches",
|
|
363
|
+
"total_matches",
|
|
364
|
+
"truncated"
|
|
365
|
+
],
|
|
366
|
+
"additionalProperties": false
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"type": "object",
|
|
370
|
+
"properties": {
|
|
371
|
+
"action": {
|
|
372
|
+
"type": "string",
|
|
373
|
+
"const": "glob"
|
|
374
|
+
},
|
|
375
|
+
"pattern": {
|
|
376
|
+
"type": "string",
|
|
377
|
+
"description": "The wildcard pattern that was matched."
|
|
378
|
+
},
|
|
379
|
+
"files": {
|
|
380
|
+
"type": "array",
|
|
381
|
+
"items": {
|
|
382
|
+
"type": "object",
|
|
383
|
+
"properties": {
|
|
384
|
+
"path": {
|
|
385
|
+
"type": "string",
|
|
386
|
+
"description": "Path relative to the workspace root."
|
|
387
|
+
},
|
|
388
|
+
"is_dir": {
|
|
389
|
+
"type": "boolean"
|
|
390
|
+
},
|
|
391
|
+
"size": {
|
|
392
|
+
"type": "number",
|
|
393
|
+
"description": "File size in bytes (0 for directories)."
|
|
394
|
+
},
|
|
395
|
+
"mtime": {
|
|
396
|
+
"type": "number",
|
|
397
|
+
"description": "Last-modified time (epoch ms)."
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
"required": [
|
|
401
|
+
"path",
|
|
402
|
+
"is_dir",
|
|
403
|
+
"size",
|
|
404
|
+
"mtime"
|
|
405
|
+
],
|
|
406
|
+
"additionalProperties": false
|
|
407
|
+
},
|
|
408
|
+
"description": "Files whose workspace-relative path matches the pattern."
|
|
409
|
+
},
|
|
410
|
+
"count": {
|
|
411
|
+
"type": "number",
|
|
412
|
+
"description": "Number of matching files."
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
"required": [
|
|
416
|
+
"action",
|
|
417
|
+
"pattern",
|
|
418
|
+
"files",
|
|
419
|
+
"count"
|
|
420
|
+
],
|
|
421
|
+
"additionalProperties": false
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"type": "object",
|
|
425
|
+
"properties": {
|
|
426
|
+
"action": {
|
|
427
|
+
"type": "string",
|
|
428
|
+
"const": "edit"
|
|
429
|
+
},
|
|
430
|
+
"path": {
|
|
431
|
+
"type": "string",
|
|
432
|
+
"description": "Absolute path of the edited file."
|
|
433
|
+
},
|
|
434
|
+
"replacements": {
|
|
435
|
+
"type": "number",
|
|
436
|
+
"description": "Number of replacements performed."
|
|
437
|
+
},
|
|
438
|
+
"ok": {
|
|
439
|
+
"type": "boolean"
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
"required": [
|
|
443
|
+
"action",
|
|
444
|
+
"path",
|
|
445
|
+
"replacements",
|
|
446
|
+
"ok"
|
|
447
|
+
],
|
|
448
|
+
"additionalProperties": false
|
|
269
449
|
}
|
|
270
450
|
]
|
|
271
451
|
}
|
|
@@ -17,9 +17,12 @@
|
|
|
17
17
|
"create_dir",
|
|
18
18
|
"copy",
|
|
19
19
|
"move",
|
|
20
|
-
"rename"
|
|
20
|
+
"rename",
|
|
21
|
+
"search",
|
|
22
|
+
"glob",
|
|
23
|
+
"edit"
|
|
21
24
|
],
|
|
22
|
-
"description": "Action: 'resolve' = return the workspace root directory; 'list' = list files; 'read' = read a file (path required); 'write' = write/overwrite a file (path + content required); 'delete' = delete a file or directory (path required). 'create_file' = create an empty file (path required; content optional). 'create_dir' = create a directory recursively (path required). 'copy' = copy a file or directory (from + to required). 'move' / 'rename' = move or rename a file or directory (from + to required)."
|
|
25
|
+
"description": "Action: 'resolve' = return the workspace root directory; 'list' = list files; 'read' = read a file (path required); 'write' = write/overwrite a file (path + content required); 'delete' = delete a file or directory (path required). 'create_file' = create an empty file (path required; content optional). 'create_dir' = create a directory recursively (path required). 'copy' = copy a file or directory (from + to required). 'move' / 'rename' = move or rename a file or directory (from + to required). 'search' = regex content search across workspace files (pattern required). 'glob' = list files whose workspace-relative path matches a wildcard pattern (pattern required). 'edit' = exact string replacement inside a file (path + old_string + new_string required)."
|
|
23
26
|
},
|
|
24
27
|
"path": {
|
|
25
28
|
"description": "Path relative to the workspace root (required for read/write/delete/create_file/create_dir).",
|
|
@@ -36,6 +39,62 @@
|
|
|
36
39
|
"to": {
|
|
37
40
|
"description": "Destination path relative to root (required for copy/move/rename).",
|
|
38
41
|
"type": "string"
|
|
42
|
+
},
|
|
43
|
+
"pattern": {
|
|
44
|
+
"description": "search: regular expression matched against every file line (required for search). glob: wildcard pattern matched against workspace-relative paths — '**' spans directory segments, '*' stays within one segment, '?' is a single char (e.g. '**/*.json', '*.md'; required for glob).",
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"glob": {
|
|
48
|
+
"description": "search only: optional filename wildcard filter matched on the file basename (e.g. '*.md', '*.{ts,tsx}').",
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"ignore_case": {
|
|
52
|
+
"description": "search only: case-insensitive pattern matching (default false).",
|
|
53
|
+
"type": "boolean"
|
|
54
|
+
},
|
|
55
|
+
"max_results": {
|
|
56
|
+
"description": "search only: maximum matches returned (default 50, hard cap 200); total_matches still counts every match.",
|
|
57
|
+
"type": "integer",
|
|
58
|
+
"minimum": 1,
|
|
59
|
+
"maximum": 200
|
|
60
|
+
},
|
|
61
|
+
"context_lines": {
|
|
62
|
+
"description": "search only: context lines included before/after each match (default 2).",
|
|
63
|
+
"type": "integer",
|
|
64
|
+
"minimum": 0,
|
|
65
|
+
"maximum": 5
|
|
66
|
+
},
|
|
67
|
+
"old_string": {
|
|
68
|
+
"description": "edit only: exact text to replace (non-empty; required for edit).",
|
|
69
|
+
"type": "string"
|
|
70
|
+
},
|
|
71
|
+
"new_string": {
|
|
72
|
+
"description": "edit only: replacement text (required for edit; may be empty to delete).",
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"replace_all": {
|
|
76
|
+
"description": "edit only: replace every occurrence of old_string (default false — errors when old_string is not unique).",
|
|
77
|
+
"type": "boolean"
|
|
78
|
+
},
|
|
79
|
+
"offset": {
|
|
80
|
+
"description": "read only: 1-based line number to start from (default 1).",
|
|
81
|
+
"type": "integer",
|
|
82
|
+
"minimum": 1,
|
|
83
|
+
"maximum": 9007199254740991
|
|
84
|
+
},
|
|
85
|
+
"limit": {
|
|
86
|
+
"description": "read only: maximum lines to return (default and hard cap 2000; only applied when offset or limit is given).",
|
|
87
|
+
"type": "integer",
|
|
88
|
+
"minimum": 1,
|
|
89
|
+
"maximum": 2000
|
|
90
|
+
},
|
|
91
|
+
"encoding": {
|
|
92
|
+
"description": "read: 'text' (default, utf-8) or 'base64' (raw bytes, files up to 10MB). write/create_file: 'text' (default, utf-8) or 'base64' (content is base64-encoded raw bytes, e.g. binary files).",
|
|
93
|
+
"type": "string",
|
|
94
|
+
"enum": [
|
|
95
|
+
"text",
|
|
96
|
+
"base64"
|
|
97
|
+
]
|
|
39
98
|
}
|
|
40
99
|
},
|
|
41
100
|
"required": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getMetricDef}from'./metrics.js';
|
|
1
|
+
import{getJudgmentDoc}from'../config/judgment.js';import{getMetricDef}from'./metrics.js';function scorecardParams(){return getJudgmentDoc()['scorecard'];}function tune(a){return scorecardParams()['metrics'][a];}function liveWeight(a,b){return tune(a)?.['weight']?.[b]??getMetricDef(a)?.['weight'][b]??0x0;}function liveThreshold(a,b){return tune(a)?.[b]??getMetricDef(a)?.[b];}function clamp01(a){return Math['max'](0x0,Math['min'](0x1,a));}export function scoreMetricValue(a,b){const c=liveThreshold(a,'good_threshold'),d=liveThreshold(a,'bad_threshold');if(c===undefined||d===undefined)return null;if(c===d)return b>=c?0x64:0x0;const e=clamp01((b-d)/(c-d));return Math['round'](e*0x64);}function valueMap(a){return new Map(a['metrics']['map'](b=>[b['id'],b]));}export function computeMetricDeltas(a,b){const c=new Map();if(!b)return c;const d=valueMap(b);for(const e of a['metrics']){const f=d['get'](e['id']);if(e['status']!=='ok'||typeof e['value']!=='number'||!f||f['status']!=='ok'||typeof f['value']!=='number')continue;const g=e['value']-f['value'],h=g>0x0?'up':g<0x0?'down':'flat',i=getMetricDef(e['id']),j=i&&h!=='flat'?i['direction']==='higher_better'&&g>0x0||i['direction']==='lower_better'&&g<0x0:null;c['set'](e['id'],{'id':e['id'],'from':f['value'],'to':e['value'],'change':g,'direction':h,'improved':j});}return c;}export function scoreScorecard(a,b,c){const d=computeMetricDeltas(a,c),e=a['metrics']['map'](k=>{const l=getMetricDef(k['id']),n=k['status']==='ok'&&typeof k['value']==='number'?k['value']:null,o=n===null?null:scoreMetricValue(k['id'],n);return{'id':k['id'],'label':l?.['label']??k['id'],'status':k['status'],'value':n,'weight':liveWeight(k['id'],b),'score':o,'delta':d['get'](k['id'])??null};}),f=e['filter'](k=>k['score']!==null&&k['weight']>0x0),g=f['reduce']((k,l)=>k+l['weight'],0x0),h=scorecardParams()['shop_evidence_metrics'],i=f['some'](k=>h['includes'](k['id'])),j=g>0x0&&i?Math['round'](f['reduce']((k,l)=>k+l['score']*l['weight'],0x0)/g):null;return{'posture':b,'overall':j,'scored_metric_count':f['length'],'metric_scores':e,'unavailable':a['unavailable']};}export function describeDelta(a){const b=a['from']!==0x0?'\x20('+(a['change']>0x0?'+':'')+Math['round'](a['change']/Math['abs'](a['from'])*0x64)+'%)':'',c=a['change']>0x0?'+':'',d=a['improved']===null?'':a['improved']?'\x20✓\x20improving':'\x20⚠\x20worsening';return''+c+roundMetric(a['change'])+b+d;}function roundMetric(a){return Math['abs'](a)>=0x64?Math['round'](a):Math['round'](a*0x64)/0x64;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{strictParse}from'../../schema/index.js';import{BenchmarkMigrationSchema}from'../../schema/benchmark-migration/index.js';import{getTemplate,listTemplates}from'../../knowledge/template-loader.js';import{scanTemplate}from'../../knowledge/template-scanner.js';import{planMigration}from'../../playbooks/service-build/migration-planner.js';import{handleMerchantGuide}from'../../playbooks/service-build/merchant-guide.js';function templateSummary(a){return{'id':a['id'],'industry':a['industry'],'variant':a['variant'],'archetype':a['archetype'],'key_risk':a['key_risk'],'node_count':a['machine_shape']['length'],'guard_count':a['guards']['length'],'recommended_role':a['recommended_role']};}function requireTemplate(a,b){if(!a)throw new Error('\x27template_id\x27\x20is\x20required\x20for\x20action=\x27'+b+'\x27');const c=getTemplate(a);if(!c)throw new Error('Unknown\x20template\x20id:\x20'+a+'\x20(use\x20action=\x27template_list\x27\x20to\x20see\x20valid\x20ids)');return c;}function scanSummary(a){return{'risk_level':a['risk_level'],'passed':a['passed'],'red_flags':a['red_flags']};}function assertScanPassed(a,b){if(a['passed'])return;throw new Error('action=\x27'+b+'\x27\x20blocked:\x20pre-deploy\x20scan\x20of\x20template\x20\x27'+a['template_id']+'\x27\x20found\x20CRITICAL\x20risk\x20—\x20'+a['red_flags']['join'](';\x20')+'.\x20Fix\x20the\x20template\x20(frontmatter\x20or\x20body)\x20and\x20re-run\x20action=\x27template_scan\x27.');}function templateIntent(a,b){if(b&&b['trim']())return b['trim']();return'Adopt\x20the\x20'+a['id']+'\x20industry\x20archetype\x20template\x20('+a['archetype']+')\x20for\x20the\x20'+a['industry']+'\x20industry.\x20'+('Primary\x20risk\x20to\x20mitigate:\x20'+a['key_risk']+'.');}async function runGuide(a,b,c){const d=await handleMerchantGuide({'intent':templateIntent(a,b),'guide_confirm':{'industry':a['industry']}}),e=c&&Object['keys'](c)['length']>0x0?c:undefined;d['template']={'id':a['id'],'archetype':a['archetype'],'recommended_role':a['recommended_role'],'fee_params':{...a['fee_params'],...e??{}}};if(e)d['template_fee_overrides']=e;return d;}export async function handleBenchmarkMigrationOperation(a){const b=strictParse(BenchmarkMigrationSchema,a,'benchmark_migration_operation\x20input');let c;switch(b['action']){case'template_list':{const {templates:d,errors:e}=listTemplates(),f=b['industry']?d['filter'](g=>g['industry']===b['industry']):d;c={'action':'template_list','count':f['length'],'templates':f['map'](templateSummary),'load_errors':e};break;}case'template_get':{const g=requireTemplate(b['template_id'],'template_get');c={'action':'template_get','template':{...g}};break;}case'template_generate':{const h=requireTemplate(b['template_id'],'template_generate'),i=scanTemplate(h);assertScanPassed(i,'template_generate');const j=await runGuide(h,b['description'],b['fee_overrides']);c={'action':'template_generate','template_id':h['id'],'scan':scanSummary(i),'plan':j};break;}case'template_scan':{const k=requireTemplate(b['template_id'],'template_scan');c={'action':'template_scan','scan':scanTemplate(k)};break;}case'migration_import':{if(!b['description']||!b['description']['trim']())throw new Error('\x27description\x27\x20is\x20required\x20for\x20action=\x27migration_import\x27');const l=planMigration({'url':b['url'],'description':b['description'],'industry':b['industry'],'network':b['network']});if(!l)throw new Error('No\x20industry\x20template\x20matched\x20the\x20description.\x20Refine\x20the\x20description\x20or\x20pass\x20an\x20explicit\x20\x27industry\x27\x20hint.');c={'action':'migration_import','log':l};break;}case'migration_review':{if(!b['log'])throw new Error('\x27log\x27\x20is\x20required\x20for\x20action=\x27migration_review\x27');const m=b['log'],n=Array['isArray'](m['mapped'])?m['mapped']:[],o=Array['isArray'](m['unmapped'])?m['unmapped']:[],p=Array['isArray'](m['manual_review'])?m['manual_review']:[],q=m['risk_check']??{};c={'action':'migration_review','log':m,'review_summary':{'mapped_count':n['length'],'unmapped_count':o['length'],'manual_review_count':p['length'],'risk_passed':q['passed']===!![]}};break;}case'migration_apply':{const r=requireTemplate(b['template_id'],'migration_apply'),s=scanTemplate(r);assertScanPassed(s,'migration_apply');const t=b['network']??'testnet',u=await runGuide(r,b['description'],b['fee_overrides']);c={'action':'migration_apply','template_id':r['id'],'network':t,'scan':scanSummary(s),'plan':u};break;}default:throw new Error('Unknown\x20benchmark_migration_operation\x20action:\x20'+String(b['action']));}return{'content':[{'type':'text','text':JSON['stringify']({'result':c})}],'structuredContent':{'result':c}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{listServices,getServiceInfo,toggle as
|
|
1
|
+
import{listServices,getServiceInfo,toggle as a420a,setEnabled as a420b,reset as a420c}from'../../config/index.js';import{judgmentStatus,setJudgmentOverride,clearJudgmentOverride,clearJudgmentOverrides,patchUserJudgmentDoc,readUserJudgmentDocView}from'../../config/judgment.js';import{strictParse}from'../../schema/index.js';import{ConfigOperationInputSchema}from'../../schema/config/index.js';export async function handleConfigOperation(a){const b=strictParse(ConfigOperationInputSchema,a,'config_operation\x20input'),{action:c,service:d,path:e,value:f}=b;let g;switch(c){case'list':g={'action':'list','services':listServices()};break;case'toggle':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20toggle');const h=d,i=getServiceInfo(h);if(!i)throw new Error('Unknown\x20service:\x20'+h+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');if(h==='confirm_gate'&&i['enabled'])throw new Error('confirm_gate\x20cannot\x20be\x20disabled\x20at\x20runtime.\x20'+'Set\x20WOWOK_CONFIRM_GATE=0\x20in\x20the\x20server\x20environment\x20and\x20restart\x20if\x20you\x20really\x20want\x20it\x20off.');const j=a420a(h);g={'action':'toggle','service':h,'enabled':j,'reminder':i['reminder']};break;}case'disable':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20disable');const k=d,l=getServiceInfo(k);if(!l)throw new Error('Unknown\x20service:\x20'+k+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');if(k==='confirm_gate')throw new Error('confirm_gate\x20cannot\x20be\x20disabled\x20at\x20runtime.\x20'+'Set\x20WOWOK_CONFIRM_GATE=0\x20in\x20the\x20server\x20environment\x20and\x20restart\x20if\x20you\x20really\x20want\x20it\x20off.');a420b(k,![]),g={'action':'disable','service':k,'enabled':![],'reminder':l['reminder']};break;}case'enable':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20enable');const m=d,n=getServiceInfo(m);if(!n)throw new Error('Unknown\x20service:\x20'+m+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a420b(m,!![]),g={'action':'enable','service':m,'enabled':!![],'reminder':n['reminder']};break;}case'reset':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20reset');const o=d,p=getServiceInfo(o);if(!p)throw new Error('Unknown\x20service:\x20'+o+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a420c(o),g={'action':'reset','service':o,'enabled':getServiceInfo(o)?.['enabled'],'reminder':p['reminder'],'reset':!![]};break;}case'info':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20info');const q=d,r=getServiceInfo(q);if(!r)throw new Error('Unknown\x20service:\x20'+q+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');g={'action':'info',...r};break;}case'judgment_list':g={'action':'judgment_list',...judgmentStatus()};break;case'judgment_set':{if(!e)throw new Error('\x27path\x27\x20param\x20is\x20required\x20for\x20judgment_set\x20(dotted,\x20e.g.\x20\x27evaluation.weights.trust_reviews\x27)');if(!('value'in b))throw new Error('\x27value\x27\x20param\x20is\x20required\x20for\x20judgment_set');const s=setJudgmentOverride(e,f);if(!s['ok'])throw new Error(s['error']);g={'action':'judgment_set','path':e,'value':f,'applied':!![]};break;}case'judgment_reset':{const t=e?clearJudgmentOverride(e)?0x1:0x0:clearJudgmentOverrides();g={'action':'judgment_reset',...e?{'path':e}:{},'cleared':t};break;}case'judgment_doc_read':{g={'action':'judgment_doc_read',...readUserJudgmentDocView()};break;}case'judgment_doc_patch':{if(!b['patch']||typeof b['patch']!=='object'||Array['isArray'](b['patch']))throw new Error('\x27patch\x27\x20param\x20is\x20required\x20for\x20judgment_doc_patch\x20(a\x20partial\x20judgment\x20document\x20object,\x20e.g.\x20{\x22evaluation\x22:\x20{\x22weights\x22:\x20{…}}})');g={'action':'judgment_doc_patch',...patchUserJudgmentDoc(b['patch'])};break;}default:throw new Error('Unknown\x20config_operation\x20action:\x20'+String(c));}return{'content':[{'type':'text','text':JSON['stringify']({'result':g})}],'structuredContent':{'result':g}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readdirSync,readFileSync,writeFileSync,existsSync,mkdirSync,statSync,cpSync,renameSync,rmSync}from'node:fs';import{join,relative,resolve,sep,dirname,basename}from'node:path';import{strictParse}from'../../schema/index.js';import{IndustryPackOperationInputSchema}from'../../schema/industry-pack/index.js';import{scaffoldIndustryPack,listRegisteredPacks,scanDefaultIndustryPacks,seedBuiltinIndustryTemplates,seedBuiltinStrategyManuals,ensureIndustryReadme,resolveIndustryPackDir,rescanPack,resolveDisputeRules,resolveComplianceRules,resolveSupplyRules,resolveIndustryRules,resolveIndustryPlaybook,diffIndustryPack,resetIndustryPath}from'../../extensions/index.js';import{getIndustryModeRegistry}from'../../extensions/registry.js';import{handleRecommendIndustry,handleListModes,handleDeriveUserMode,handleEvolveUserMode,handleRegisterUserMode,handleUnregisterUserMode,handleRegisterCustomMetric,handleUnregisterCustomMetric,handleRegisterCustomConstraint,handleUnregisterCustomConstraint,handleListMetricsConstraints}from'../../playbooks/service-build/mode-actions.js';const INDUSTRY_ROOT=resolveIndustryPackDir();function resolveIndustryPath(a){const b=resolve(INDUSTRY_ROOT,a);if(b!==INDUSTRY_ROOT&&!b['startsWith'](INDUSTRY_ROOT+sep))throw new Error('path\x20\x27'+a+'\x27\x20escapes\x20the\x20industry\x20root');return b;}function rescanAffectedPack(a){const b=a['split'](/[\\/]+/)['find'](c=>c['length']>0x0);if(!b)return;rescanPack(b);}function listRecursive(a,b,c,d=0x0){if(d>0x8)return;let f;try{f=readdirSync(a,{'withFileTypes':!![]});}catch{return;}for(const g of f){const h=join(a,g['name']),i=relative(b,h)['split'](sep)['join']('/');let j=0x0,k=0x0;try{const l=statSync(h);k=l['size'],j=l['mtimeMs'];}catch{}g['isDirectory']()?(c['push']({'path':i,'is_dir':!![],'size':0x0,'mtime':j}),listRecursive(h,b,c,d+0x1)):c['push']({'path':i,'is_dir':![],'size':k,'mtime':j});}}export async function handleIndustryPackOperation(a){const b=strictParse(IndustryPackOperationInputSchema,a,'industry_pack_operation\x20input');mkdirSync(INDUSTRY_ROOT,{'recursive':!![]}),seedBuiltinIndustryTemplates(),seedBuiltinStrategyManuals(),ensureIndustryReadme();let c;switch(b['action']){case'scaffold':{if(!b['name'])throw new Error('\x27name\x27\x20is\x20required\x20for\x20action=\x27scaffold\x27');const d=scaffoldIndustryPack(b['name']);c={'action':'scaffold','ok':d['ok'],'dir':d['dir'],'files':d['files'],'errors':d['errors']};if(d['ok'])rescanPack(b['name']);break;}case'list':{c={'action':'list','packs':listRegisteredPacks()};break;}case'scan':{c={'action':'scan','results':scanDefaultIndustryPacks()};break;}case'resolve':{c={'action':'resolve','dir':INDUSTRY_ROOT};break;}case'list_files':{const e=[];listRecursive(INDUSTRY_ROOT,INDUSTRY_ROOT,e),c={'action':'list_files','dir':INDUSTRY_ROOT,'files':e};break;}case'read_file':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27read_file\x27');const f=resolveIndustryPath(b['path']);if(!existsSync(f))throw new Error('file\x20not\x20found:\x20'+b['path']);c={'action':'read_file','path':f,'content':readFileSync(f,'utf-8')};break;}case'write_file':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27write_file\x27');if(b['content']===undefined)throw new Error('\x27content\x27\x20is\x20required\x20for\x20action=\x27write_file\x27');const g=resolveIndustryPath(b['path']);mkdirSync(dirname(g),{'recursive':!![]}),writeFileSync(g,b['content'],'utf-8'),c={'action':'write_file','path':g,'ok':!![]},rescanAffectedPack(b['path']);break;}case'get':{if(!b['name'])throw new Error('\x27name\x27\x20is\x20required\x20for\x20action=\x27get\x27');const h=b['name'],i=getIndustryModeRegistry()['getMode'](h),j=i?{'name':i['name'],'display_name':i['display_name'],'key_risk':i['key_risk'],'needs':i['needs']['map'](k=>k['description']),...i['analyze']?.['key_questions']?.['length']?{'analyze_questions':i['analyze']['key_questions']['slice'](0x0,0x2)}:{}}:undefined;c={'action':'get','category':h,...j?{'mode':j}:{},...resolveDisputeRules(h)?{'dispute':resolveDisputeRules(h)}:{},...resolveComplianceRules(h)?{'compliance':resolveComplianceRules(h)}:{},...resolveSupplyRules(h)?{'supply':resolveSupplyRules(h)}:{},...resolveIndustryRules(h)?{'rules':resolveIndustryRules(h)}:{},...resolveIndustryPlaybook(h)?{'playbook':resolveIndustryPlaybook(h)}:{}};break;}case'diff':{if(!b['name'])throw new Error('\x27name\x27\x20is\x20required\x20for\x20action=\x27diff\x27');c={'action':'diff',...diffIndustryPack(b['name'])};break;}case'reset':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27reset\x27');const k=resetIndustryPath(b['path']);c={'action':'reset','ok':k['ok'],'layout':k['layout'],'target':k['target'],'restored_files':k['restored_files'],'errors':k['errors']},rescanAffectedPack(b['path']);break;}case'delete_file':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27delete_file\x27');const l=resolveIndustryPath(b['path']);if(!existsSync(l))throw new Error('file\x20not\x20found:\x20'+b['path']);rmSync(l,{'recursive':!![],'force':!![]}),c={'action':'delete_file','path':l,'ok':!![]},rescanAffectedPack(b['path']);break;}case'create_file':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27create_file\x27');const m=resolveIndustryPath(b['path']);if(existsSync(m))throw new Error('file\x20already\x20exists:\x20'+b['path']);mkdirSync(dirname(m),{'recursive':!![]}),writeFileSync(m,b['content']??'','utf-8'),c={'action':'create_file','path':m,'ok':!![]},rescanAffectedPack(b['path']);break;}case'create_dir':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27create_dir\x27');const n=resolveIndustryPath(b['path']);mkdirSync(n,{'recursive':!![]}),c={'action':'create_dir','path':n,'ok':!![]},rescanAffectedPack(b['path']);break;}case'copy':{if(!b['from'])throw new Error('\x27from\x27\x20is\x20required\x20for\x20action=\x27copy\x27');if(!b['to'])throw new Error('\x27to\x27\x20is\x20required\x20for\x20action=\x27copy\x27');const o=resolveIndustryPath(b['from']);let p=resolveIndustryPath(b['to']);if(!existsSync(o))throw new Error('source\x20not\x20found:\x20'+b['from']);try{existsSync(p)&&statSync(p)['isDirectory']()&&(p=join(p,basename(o)));}catch{}if(p===o)throw new Error('\x27copy\x27\x20cannot\x20copy\x20a\x20file\x20onto\x20itself');mkdirSync(dirname(p),{'recursive':!![]}),cpSync(o,p,{'recursive':!![],'force':!![]}),c={'action':'copy','from':o,'to':p,'ok':!![]},rescanAffectedPack(b['to']);break;}case'move':case'rename':{if(!b['from'])throw new Error('\x27from\x27\x20is\x20required\x20for\x20action=\x27'+b['action']+'\x27');if(!b['to'])throw new Error('\x27to\x27\x20is\x20required\x20for\x20action=\x27'+b['action']+'\x27');const q=resolveIndustryPath(b['from']);let t=resolveIndustryPath(b['to']);if(!existsSync(q))throw new Error('source\x20not\x20found:\x20'+b['from']);try{existsSync(t)&&statSync(t)['isDirectory']()&&(t=join(t,basename(q)));}catch{}if(t===q)throw new Error('\x27'+b['action']+'\x27\x20cannot\x20move\x20onto\x20itself');mkdirSync(dirname(t),{'recursive':!![]}),renameSync(q,t),c={'action':b['action'],'from':q,'to':t,'ok':!![]},rescanAffectedPack(b['from']),rescanAffectedPack(b['to']);break;}case'recommend_industry':c=await handleRecommendIndustry(b);break;case'list_modes':c=await handleListModes();break;case'derive_user_mode':c=await handleDeriveUserMode(b);break;case'evolve_user_mode':c=await handleEvolveUserMode(b);break;case'register_user_mode':c=await handleRegisterUserMode(b);break;case'unregister_user_mode':c=await handleUnregisterUserMode(b);break;case'register_custom_metric':c=await handleRegisterCustomMetric(b);break;case'unregister_custom_metric':c=await handleUnregisterCustomMetric(b);break;case'register_custom_constraint':c=await handleRegisterCustomConstraint(b);break;case'unregister_custom_constraint':c=await handleUnregisterCustomConstraint(b);break;case'list_metrics_constraints':c=await handleListMetricsConstraints(b);break;default:throw new Error('Unknown\x20industry_pack_operation\x20action:\x20'+String(b['action']));}return{'content':[{'type':'text','text':JSON['stringify']({'result':c})}],'structuredContent':{'result':c}};}
|
|
1
|
+
import{readdirSync,readFileSync,writeFileSync,existsSync,mkdirSync,statSync,cpSync,renameSync,rmSync}from'node:fs';import{join,relative,resolve,sep,dirname,basename}from'node:path';import{strictParse}from'../../schema/index.js';import{IndustryPackOperationInputSchema}from'../../schema/industry-pack/index.js';import{validateJudgmentFragment}from'../../config/judgment.js';import{scaffoldIndustryPack,listRegisteredPacks,scanDefaultIndustryPacks,seedBuiltinIndustryTemplates,seedBuiltinStrategyManuals,ensureIndustryReadme,resolveIndustryPackDir,rescanPack,resolveDisputeRules,resolveComplianceRules,resolveSupplyRules,resolveIndustryRules,resolveIndustryPlaybook,diffIndustryPack,resetIndustryPath}from'../../extensions/index.js';import{getIndustryModeRegistry}from'../../extensions/registry.js';import{handleRecommendIndustry,handleListModes,handleDeriveUserMode,handleEvolveUserMode,handleRegisterUserMode,handleUnregisterUserMode,handleRegisterCustomMetric,handleUnregisterCustomMetric,handleRegisterCustomConstraint,handleUnregisterCustomConstraint,handleListMetricsConstraints}from'../../playbooks/service-build/mode-actions.js';const INDUSTRY_ROOT=resolveIndustryPackDir();function resolveIndustryPath(a){const b=resolve(INDUSTRY_ROOT,a);if(b!==INDUSTRY_ROOT&&!b['startsWith'](INDUSTRY_ROOT+sep))throw new Error('path\x20\x27'+a+'\x27\x20escapes\x20the\x20industry\x20root');return b;}function rescanAffectedPack(a){const b=a['split'](/[\\/]+/)['find'](c=>c['length']>0x0);if(!b)return;rescanPack(b);}const BASELINES_FILENAME='baselines.json',PACK_FILENAME='pack.json';function assertBaselinesContentValid(a,b){const c=a['split'](/[\\/]+/)['pop']()??'';if(c!==BASELINES_FILENAME&&c!==PACK_FILENAME)return;let d;try{d=JSON['parse'](b);}catch{return;}if(!d||typeof d!=='object'||Array['isArray'](d))return;const e=d,f=c===BASELINES_FILENAME?d:e['baselines'];if(f===undefined||f===null)return;const g=validateJudgmentFragment(f,a+'\x20baselines');if(g)throw new Error('write\x20rejected\x20—\x20the\x20baselines\x20fragment\x20in\x20\x27'+a+'\x27\x20is\x20not\x20a\x20valid\x20judgment\x20fragment:\x20'+g);}function listRecursive(a,b,c,d=0x0){if(d>0x8)return;let f;try{f=readdirSync(a,{'withFileTypes':!![]});}catch{return;}for(const g of f){const h=join(a,g['name']),i=relative(b,h)['split'](sep)['join']('/');let j=0x0,k=0x0;try{const l=statSync(h);k=l['size'],j=l['mtimeMs'];}catch{}g['isDirectory']()?(c['push']({'path':i,'is_dir':!![],'size':0x0,'mtime':j}),listRecursive(h,b,c,d+0x1)):c['push']({'path':i,'is_dir':![],'size':k,'mtime':j});}}export async function handleIndustryPackOperation(a){const b=strictParse(IndustryPackOperationInputSchema,a,'industry_pack_operation\x20input');mkdirSync(INDUSTRY_ROOT,{'recursive':!![]}),seedBuiltinIndustryTemplates(),seedBuiltinStrategyManuals(),ensureIndustryReadme();let c;switch(b['action']){case'scaffold':{if(!b['name'])throw new Error('\x27name\x27\x20is\x20required\x20for\x20action=\x27scaffold\x27');const d=scaffoldIndustryPack(b['name']);c={'action':'scaffold','ok':d['ok'],'dir':d['dir'],'files':d['files'],'errors':d['errors']};if(d['ok'])rescanPack(b['name']);break;}case'list':{c={'action':'list','packs':listRegisteredPacks()};break;}case'scan':{c={'action':'scan','results':scanDefaultIndustryPacks()};break;}case'resolve':{c={'action':'resolve','dir':INDUSTRY_ROOT};break;}case'list_files':{const e=[];listRecursive(INDUSTRY_ROOT,INDUSTRY_ROOT,e),c={'action':'list_files','dir':INDUSTRY_ROOT,'files':e};break;}case'read_file':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27read_file\x27');const f=resolveIndustryPath(b['path']);if(!existsSync(f))throw new Error('file\x20not\x20found:\x20'+b['path']);c={'action':'read_file','path':f,'content':readFileSync(f,'utf-8')};break;}case'write_file':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27write_file\x27');if(b['content']===undefined)throw new Error('\x27content\x27\x20is\x20required\x20for\x20action=\x27write_file\x27');const g=resolveIndustryPath(b['path']);assertBaselinesContentValid(b['path'],b['content']),mkdirSync(dirname(g),{'recursive':!![]}),writeFileSync(g,b['content'],'utf-8'),c={'action':'write_file','path':g,'ok':!![]},rescanAffectedPack(b['path']);break;}case'get':{if(!b['name'])throw new Error('\x27name\x27\x20is\x20required\x20for\x20action=\x27get\x27');const h=b['name'],i=getIndustryModeRegistry()['getMode'](h),j=i?{'name':i['name'],'display_name':i['display_name'],'key_risk':i['key_risk'],'needs':i['needs']['map'](k=>k['description']),...i['analyze']?.['key_questions']?.['length']?{'analyze_questions':i['analyze']['key_questions']['slice'](0x0,0x2)}:{}}:undefined;c={'action':'get','category':h,...j?{'mode':j}:{},...resolveDisputeRules(h)?{'dispute':resolveDisputeRules(h)}:{},...resolveComplianceRules(h)?{'compliance':resolveComplianceRules(h)}:{},...resolveSupplyRules(h)?{'supply':resolveSupplyRules(h)}:{},...resolveIndustryRules(h)?{'rules':resolveIndustryRules(h)}:{},...resolveIndustryPlaybook(h)?{'playbook':resolveIndustryPlaybook(h)}:{}};break;}case'diff':{if(!b['name'])throw new Error('\x27name\x27\x20is\x20required\x20for\x20action=\x27diff\x27');c={'action':'diff',...diffIndustryPack(b['name'])};break;}case'reset':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27reset\x27');const k=resetIndustryPath(b['path']);c={'action':'reset','ok':k['ok'],'layout':k['layout'],'target':k['target'],'restored_files':k['restored_files'],'errors':k['errors']},rescanAffectedPack(b['path']);break;}case'delete_file':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27delete_file\x27');const l=resolveIndustryPath(b['path']);if(!existsSync(l))throw new Error('file\x20not\x20found:\x20'+b['path']);rmSync(l,{'recursive':!![],'force':!![]}),c={'action':'delete_file','path':l,'ok':!![]},rescanAffectedPack(b['path']);break;}case'create_file':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27create_file\x27');const m=resolveIndustryPath(b['path']);if(existsSync(m))throw new Error('file\x20already\x20exists:\x20'+b['path']);if(b['content']!==undefined)assertBaselinesContentValid(b['path'],b['content']);mkdirSync(dirname(m),{'recursive':!![]}),writeFileSync(m,b['content']??'','utf-8'),c={'action':'create_file','path':m,'ok':!![]},rescanAffectedPack(b['path']);break;}case'create_dir':{if(!b['path'])throw new Error('\x27path\x27\x20is\x20required\x20for\x20action=\x27create_dir\x27');const n=resolveIndustryPath(b['path']);mkdirSync(n,{'recursive':!![]}),c={'action':'create_dir','path':n,'ok':!![]},rescanAffectedPack(b['path']);break;}case'copy':{if(!b['from'])throw new Error('\x27from\x27\x20is\x20required\x20for\x20action=\x27copy\x27');if(!b['to'])throw new Error('\x27to\x27\x20is\x20required\x20for\x20action=\x27copy\x27');const o=resolveIndustryPath(b['from']);let p=resolveIndustryPath(b['to']);if(!existsSync(o))throw new Error('source\x20not\x20found:\x20'+b['from']);try{existsSync(p)&&statSync(p)['isDirectory']()&&(p=join(p,basename(o)));}catch{}if(p===o)throw new Error('\x27copy\x27\x20cannot\x20copy\x20a\x20file\x20onto\x20itself');mkdirSync(dirname(p),{'recursive':!![]}),cpSync(o,p,{'recursive':!![],'force':!![]}),c={'action':'copy','from':o,'to':p,'ok':!![]},rescanAffectedPack(b['to']);break;}case'move':case'rename':{if(!b['from'])throw new Error('\x27from\x27\x20is\x20required\x20for\x20action=\x27'+b['action']+'\x27');if(!b['to'])throw new Error('\x27to\x27\x20is\x20required\x20for\x20action=\x27'+b['action']+'\x27');const q=resolveIndustryPath(b['from']);let t=resolveIndustryPath(b['to']);if(!existsSync(q))throw new Error('source\x20not\x20found:\x20'+b['from']);try{existsSync(t)&&statSync(t)['isDirectory']()&&(t=join(t,basename(q)));}catch{}if(t===q)throw new Error('\x27'+b['action']+'\x27\x20cannot\x20move\x20onto\x20itself');mkdirSync(dirname(t),{'recursive':!![]}),renameSync(q,t),c={'action':b['action'],'from':q,'to':t,'ok':!![]},rescanAffectedPack(b['from']),rescanAffectedPack(b['to']);break;}case'recommend_industry':c=await handleRecommendIndustry(b);break;case'list_modes':c=await handleListModes();break;case'derive_user_mode':c=await handleDeriveUserMode(b);break;case'evolve_user_mode':c=await handleEvolveUserMode(b);break;case'register_user_mode':c=await handleRegisterUserMode(b);break;case'unregister_user_mode':c=await handleUnregisterUserMode(b);break;case'register_custom_metric':c=await handleRegisterCustomMetric(b);break;case'unregister_custom_metric':c=await handleUnregisterCustomMetric(b);break;case'register_custom_constraint':c=await handleRegisterCustomConstraint(b);break;case'unregister_custom_constraint':c=await handleUnregisterCustomConstraint(b);break;case'list_metrics_constraints':c=await handleListMetricsConstraints(b);break;default:throw new Error('Unknown\x20industry_pack_operation\x20action:\x20'+String(b['action']));}return{'content':[{'type':'text','text':JSON['stringify']({'result':c})}],'structuredContent':{'result':c}};}
|