@monoes/monomindcli 1.18.15 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/core/researcher.md +29 -24
- package/.claude/agents/github/code-review-swarm.md +1 -1
- package/.claude/agents/github/github-modes.md +1 -1
- package/.claude/agents/github/issue-tracker.md +1 -3
- package/.claude/agents/github/multi-repo-swarm.md +1 -1
- package/.claude/agents/github/pr-manager.md +1 -3
- package/.claude/agents/github/project-board-sync.md +1 -1
- package/.claude/agents/github/release-manager.md +1 -1
- package/.claude/agents/github/repo-architect.md +4 -12
- package/.claude/agents/github/swarm-issue.md +1 -1
- package/.claude/agents/github/swarm-pr.md +1 -1
- package/.claude/agents/github/sync-coordinator.md +1 -1
- package/.claude/agents/github/workflow-automation.md +1 -1
- package/.claude/agents/goal/goal-planner.md +1 -2
- package/.claude/agents/specialized/specialized-workflow-architect.md +11 -14
- package/.claude/agents/testing/production-validator.md +8 -7
- package/.claude/agents/testing/testing-evidence-collector.md +3 -1
- package/.claude/commands/github/issue-tracker.md +0 -2
- package/.claude/commands/github/pr-manager.md +0 -2
- package/.claude/commands/github/repo-architect.md +3 -10
- package/.claude/commands/mastermind/code-review.md +4 -4
- package/.claude/commands/mastermind/help.md +5 -5
- package/.claude/commands/mastermind/okf-export.md +14 -0
- package/.claude/commands/mastermind/okf-import.md +15 -0
- package/.claude/commands/workflows/README.md +0 -1
- package/.claude/commands/workflows/workflow-create.md +0 -1
- package/.claude/commands/workflows/workflow-execute.md +1 -3
- package/.claude/commands/workflows/workflow-export.md +0 -2
- package/.claude/helpers/handlers/agent-start-handler.cjs +28 -36
- package/.claude/helpers/handlers/capture-handler.cjs +110 -0
- package/.claude/helpers/handlers/edit-handler.cjs +15 -0
- package/.claude/helpers/handlers/gates-handler.cjs +2 -8
- package/.claude/helpers/handlers/route-handler.cjs +314 -245
- package/.claude/helpers/handlers/session-handler.cjs +182 -163
- package/.claude/helpers/handlers/session-restore-handler.cjs +95 -53
- package/.claude/helpers/handlers/task-handler.cjs +17 -160
- package/.claude/helpers/hook-handler.cjs +153 -16
- package/.claude/helpers/intelligence.cjs +255 -15
- package/.claude/helpers/learning-service.mjs +1 -0
- package/.claude/helpers/mastermind-activate.cjs +33 -51
- package/.claude/helpers/monolean-activate.cjs +13 -3
- package/.claude/helpers/monolean-propagate.cjs +7 -3
- package/.claude/helpers/router.cjs +122 -11
- package/.claude/helpers/skill-registry.json +0 -189
- package/.claude/skills/github-toolkit/SKILL.md +60 -0
- package/.claude/skills/hive-mind-advanced/SKILL.md +0 -15
- package/.claude/skills/hooks-automation/SKILL.md +0 -1
- package/.claude/skills/mastermind-skills/_protocol.md +1 -1
- package/.claude/skills/mastermind-skills/architect.md +5 -6
- package/.claude/skills/mastermind-skills/autodev.md +8 -5
- package/.claude/skills/mastermind-skills/build.md +1 -2
- package/.claude/skills/mastermind-skills/review.md +8 -5
- package/.claude/skills/mastermind-skills/techport.md +37 -3
- package/.claude/skills/memory-toolkit/SKILL.md +75 -0
- package/.claude/skills/monodesign/document.md +9 -6
- package/.claude/skills/monodesign/extract.md +1 -1
- package/.claude/skills/monodesign/reference/document.md +1 -1
- package/.claude/skills/monodesign/reference/live.md +1 -1
- package/.claude/skills/monolean/SKILL.md +1 -1
- package/.claude/skills/specialagent/SKILL.md +2 -4
- package/.claude/skills/swarm-advanced/SKILL.md +0 -1
- package/README.md +2 -5
- package/bin/mcp-server.js +11 -1
- package/dist/src/autopilot-state.d.ts.map +1 -1
- package/dist/src/autopilot-state.js +4 -5
- package/dist/src/autopilot-state.js.map +1 -1
- package/dist/src/browser/dashboard/server.d.ts.map +1 -1
- package/dist/src/browser/dashboard/server.js +69 -1
- package/dist/src/browser/dashboard/server.js.map +1 -1
- package/dist/src/browser/dashboard/ui.html +214 -1764
- package/dist/src/capabilities/index.d.ts +0 -2
- package/dist/src/capabilities/index.d.ts.map +1 -1
- package/dist/src/capabilities/index.js +0 -1
- package/dist/src/capabilities/index.js.map +1 -1
- package/dist/src/commands/agent-lifecycle.d.ts.map +1 -1
- package/dist/src/commands/agent-lifecycle.js +2 -6
- package/dist/src/commands/agent-lifecycle.js.map +1 -1
- package/dist/src/commands/agent-ops.d.ts +1 -2
- package/dist/src/commands/agent-ops.d.ts.map +1 -1
- package/dist/src/commands/agent-ops.js +1 -59
- package/dist/src/commands/agent-ops.js.map +1 -1
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +2 -3
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze-diff.js +1 -1
- package/dist/src/commands/analyze-diff.js.map +1 -1
- package/dist/src/commands/analyze.d.ts +0 -4
- package/dist/src/commands/analyze.d.ts.map +1 -1
- package/dist/src/commands/analyze.js +1 -29
- package/dist/src/commands/analyze.js.map +1 -1
- package/dist/src/commands/browse-action.d.ts.map +1 -1
- package/dist/src/commands/browse-action.js +94 -2
- package/dist/src/commands/browse-action.js.map +1 -1
- package/dist/src/commands/completions.d.ts.map +1 -1
- package/dist/src/commands/completions.js +12 -76
- package/dist/src/commands/completions.js.map +1 -1
- package/dist/src/commands/config.d.ts.map +1 -1
- package/dist/src/commands/config.js +0 -6
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/doctor-project-checks.d.ts +13 -3
- package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.js +131 -23
- package/dist/src/commands/doctor-project-checks.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +6 -5
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/guidance.d.ts +5 -1
- package/dist/src/commands/guidance.d.ts.map +1 -1
- package/dist/src/commands/guidance.js +11 -556
- package/dist/src/commands/guidance.js.map +1 -1
- package/dist/src/commands/hive-mind-comms.d.ts.map +1 -1
- package/dist/src/commands/hive-mind-comms.js +11 -4
- package/dist/src/commands/hive-mind-comms.js.map +1 -1
- package/dist/src/commands/hive-mind-helpers.js +2 -2
- package/dist/src/commands/hive-mind-helpers.js.map +1 -1
- package/dist/src/commands/hive-mind-ops.d.ts +1 -3
- package/dist/src/commands/hive-mind-ops.d.ts.map +1 -1
- package/dist/src/commands/hive-mind-ops.js +2 -116
- package/dist/src/commands/hive-mind-ops.js.map +1 -1
- package/dist/src/commands/hive-mind.d.ts +4 -4
- package/dist/src/commands/hive-mind.d.ts.map +1 -1
- package/dist/src/commands/hive-mind.js +11 -11
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks-coverage-commands.d.ts.map +1 -1
- package/dist/src/commands/hooks-coverage-commands.js +8 -7
- package/dist/src/commands/hooks-coverage-commands.js.map +1 -1
- package/dist/src/commands/hooks-coverage-gaps.js +1 -1
- package/dist/src/commands/hooks-coverage-gaps.js.map +1 -1
- package/dist/src/commands/hooks-coverage-routing.js +2 -2
- package/dist/src/commands/hooks-coverage-routing.js.map +1 -1
- package/dist/src/commands/hooks-extended-commands.d.ts +0 -3
- package/dist/src/commands/hooks-extended-commands.d.ts.map +1 -1
- package/dist/src/commands/hooks-extended-commands.js +0 -307
- package/dist/src/commands/hooks-extended-commands.js.map +1 -1
- package/dist/src/commands/hooks-formatting.d.ts +1 -5
- package/dist/src/commands/hooks-formatting.d.ts.map +1 -1
- package/dist/src/commands/hooks-formatting.js +1 -18
- package/dist/src/commands/hooks-formatting.js.map +1 -1
- package/dist/src/commands/hooks-workers.d.ts +1 -1
- package/dist/src/commands/hooks-workers.d.ts.map +1 -1
- package/dist/src/commands/hooks-workers.js +82 -330
- package/dist/src/commands/hooks-workers.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +1 -12
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +2 -55
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +23 -216
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init-wizard.d.ts.map +1 -1
- package/dist/src/commands/init-wizard.js +3 -5
- package/dist/src/commands/init-wizard.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +4 -24
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/mcp.d.ts.map +1 -1
- package/dist/src/commands/mcp.js +32 -4
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory-admin.d.ts +1 -2
- package/dist/src/commands/memory-admin.d.ts.map +1 -1
- package/dist/src/commands/memory-admin.js +1 -118
- package/dist/src/commands/memory-admin.js.map +1 -1
- package/dist/src/commands/memory-transfer.d.ts +1 -2
- package/dist/src/commands/memory-transfer.d.ts.map +1 -1
- package/dist/src/commands/memory-transfer.js +5 -171
- package/dist/src/commands/memory-transfer.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +3 -6
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/neural-core.d.ts +3 -1
- package/dist/src/commands/neural-core.d.ts.map +1 -1
- package/dist/src/commands/neural-core.js +154 -15
- package/dist/src/commands/neural-core.js.map +1 -1
- package/dist/src/commands/neural-optimize.d.ts.map +1 -1
- package/dist/src/commands/neural-optimize.js +13 -15
- package/dist/src/commands/neural-optimize.js.map +1 -1
- package/dist/src/commands/neural-registry.d.ts +1 -1
- package/dist/src/commands/neural-registry.js +14 -14
- package/dist/src/commands/neural-registry.js.map +1 -1
- package/dist/src/commands/neural.d.ts +1 -1
- package/dist/src/commands/neural.js +6 -6
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.d.ts.map +1 -1
- package/dist/src/commands/performance.js +68 -58
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/providers.d.ts.map +1 -1
- package/dist/src/commands/providers.js +77 -117
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/search-universal.d.ts +7 -1
- package/dist/src/commands/search-universal.d.ts.map +1 -1
- package/dist/src/commands/search-universal.js +59 -5
- package/dist/src/commands/search-universal.js.map +1 -1
- package/dist/src/commands/security-cve.d.ts.map +1 -1
- package/dist/src/commands/security-cve.js +3 -5
- package/dist/src/commands/security-cve.js.map +1 -1
- package/dist/src/commands/security-misc.d.ts +0 -1
- package/dist/src/commands/security-misc.d.ts.map +1 -1
- package/dist/src/commands/security-misc.js +69 -45
- package/dist/src/commands/security-misc.js.map +1 -1
- package/dist/src/commands/security.d.ts.map +1 -1
- package/dist/src/commands/security.js +2 -4
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/session.d.ts.map +1 -1
- package/dist/src/commands/session.js +137 -281
- package/dist/src/commands/session.js.map +1 -1
- package/dist/src/commands/start.d.ts.map +1 -1
- package/dist/src/commands/start.js +2 -59
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +18 -29
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.d.ts.map +1 -1
- package/dist/src/commands/swarm.js +113 -66
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/task.d.ts.map +1 -1
- package/dist/src/commands/task.js +2 -49
- package/dist/src/commands/task.js.map +1 -1
- package/dist/src/consensus/audit-writer.d.ts.map +1 -1
- package/dist/src/consensus/audit-writer.js +43 -1
- package/dist/src/consensus/audit-writer.js.map +1 -1
- package/dist/src/consensus/tally.d.ts +19 -0
- package/dist/src/consensus/tally.d.ts.map +1 -0
- package/dist/src/consensus/tally.js +34 -0
- package/dist/src/consensus/tally.js.map +1 -0
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +13 -9
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +10 -14
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +42 -100
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts.map +1 -1
- package/dist/src/init/helpers-generator.js +2 -22
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +0 -13
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +62 -0
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +3 -9
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +0 -5
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/knowledge/document-pipeline.d.ts.map +1 -1
- package/dist/src/knowledge/document-pipeline.js +18 -8
- package/dist/src/knowledge/document-pipeline.js.map +1 -1
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +0 -8
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts.map +1 -1
- package/dist/src/mcp-server.js +14 -0
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +0 -17
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/coherence/causal-infer.d.ts +5 -5
- package/dist/src/mcp-tools/coherence/causal-infer.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/causal-infer.js +32 -46
- package/dist/src/mcp-tools/coherence/causal-infer.js.map +1 -1
- package/dist/src/mcp-tools/coherence/coherence-check.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/coherence-check.js +1 -19
- package/dist/src/mcp-tools/coherence/coherence-check.js.map +1 -1
- package/dist/src/mcp-tools/coherence/consensus-verify.d.ts +2 -3
- package/dist/src/mcp-tools/coherence/consensus-verify.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/consensus-verify.js +22 -20
- package/dist/src/mcp-tools/coherence/consensus-verify.js.map +1 -1
- package/dist/src/mcp-tools/coherence/memory-gate.d.ts +3 -2
- package/dist/src/mcp-tools/coherence/memory-gate.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/memory-gate.js +32 -19
- package/dist/src/mcp-tools/coherence/memory-gate.js.map +1 -1
- package/dist/src/mcp-tools/coherence/quantum-topology.d.ts +4 -4
- package/dist/src/mcp-tools/coherence/quantum-topology.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/quantum-topology.js +11 -17
- package/dist/src/mcp-tools/coherence/quantum-topology.js.map +1 -1
- package/dist/src/mcp-tools/coherence/spectral-analyze.d.ts +2 -3
- package/dist/src/mcp-tools/coherence/spectral-analyze.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/spectral-analyze.js +51 -32
- package/dist/src/mcp-tools/coherence/spectral-analyze.js.map +1 -1
- package/dist/src/mcp-tools/coherence/types.d.ts +8 -11
- package/dist/src/mcp-tools/coherence/types.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/types.js +3 -18
- package/dist/src/mcp-tools/coherence/types.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +1 -7
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/graphify-tools.js +2 -2
- package/dist/src/mcp-tools/graphify-tools.js.map +1 -1
- package/dist/src/mcp-tools/guidance-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/guidance-tools.js +9 -19
- package/dist/src/mcp-tools/guidance-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js +198 -40
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-advanced.d.ts +18 -0
- package/dist/src/mcp-tools/hooks-advanced.d.ts.map +1 -0
- package/dist/src/mcp-tools/hooks-advanced.js +25 -0
- package/dist/src/mcp-tools/hooks-advanced.js.map +1 -0
- package/dist/src/mcp-tools/hooks-intelligence.d.ts +4 -8
- package/dist/src/mcp-tools/hooks-intelligence.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-intelligence.js +33 -482
- package/dist/src/mcp-tools/hooks-intelligence.js.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.d.ts +1 -3
- package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.js +96 -202
- package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
- package/dist/src/mcp-tools/hooks-synthesis.d.ts +31 -0
- package/dist/src/mcp-tools/hooks-synthesis.d.ts.map +1 -0
- package/dist/src/mcp-tools/hooks-synthesis.js +196 -0
- package/dist/src/mcp-tools/hooks-synthesis.js.map +1 -0
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +10 -11
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +0 -3
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +0 -4
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +24 -9
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/monograph-tools.d.ts +6 -0
- package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monograph-tools.js +370 -95
- package/dist/src/mcp-tools/monograph-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.d.ts +8 -9
- package/dist/src/mcp-tools/neural-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/neural-tools.js +249 -539
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +5 -17
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js +2 -2
- package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js.map +1 -1
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts +4 -4
- package/dist/src/mcp-tools/quality-tools.d.ts +7 -2
- package/dist/src/mcp-tools/quality-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/quality-tools.js +7 -257
- package/dist/src/mcp-tools/quality-tools.js.map +1 -1
- package/dist/src/mcp-tools/security-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/security-tools.js +103 -0
- package/dist/src/mcp-tools/security-tools.js.map +1 -1
- package/dist/src/memory/intelligence.d.ts +9 -9
- package/dist/src/memory/intelligence.d.ts.map +1 -1
- package/dist/src/memory/intelligence.js +71 -59
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +1 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +47 -5
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-read.d.ts.map +1 -1
- package/dist/src/memory/memory-read.js +1 -19
- package/dist/src/memory/memory-read.js.map +1 -1
- package/dist/src/suggest.d.ts.map +1 -1
- package/dist/src/suggest.js +1 -12
- package/dist/src/suggest.js.map +1 -1
- package/dist/src/transfer/store/discovery.d.ts +3 -2
- package/dist/src/transfer/store/discovery.d.ts.map +1 -1
- package/dist/src/transfer/store/discovery.js +22 -70
- package/dist/src/transfer/store/discovery.js.map +1 -1
- package/dist/src/update/checker.d.ts.map +1 -1
- package/dist/src/update/checker.js +0 -1
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/utils/cosine-similarity.d.ts +22 -0
- package/dist/src/utils/cosine-similarity.d.ts.map +1 -0
- package/dist/src/utils/cosine-similarity.js +38 -0
- package/dist/src/utils/cosine-similarity.js.map +1 -0
- package/dist/src/utils/input-guards.d.ts +51 -0
- package/dist/src/utils/input-guards.d.ts.map +1 -0
- package/dist/src/utils/input-guards.js +223 -0
- package/dist/src/utils/input-guards.js.map +1 -0
- package/dist/src/utils/json-file.d.ts +33 -0
- package/dist/src/utils/json-file.d.ts.map +1 -0
- package/dist/src/utils/json-file.js +57 -0
- package/dist/src/utils/json-file.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -6
- package/scripts/sync-claude-assets.sh +16 -20
- package/.claude/agents/generated/case-analyst.md +0 -50
- package/.claude/agents/generated/channel-intelligence-director.md +0 -87
- package/.claude/agents/generated/chief-growth-officer.md +0 -88
- package/.claude/agents/generated/churn-analyst.md +0 -53
- package/.claude/agents/generated/code-reviewer.md +0 -55
- package/.claude/agents/generated/code-validator.md +0 -57
- package/.claude/agents/generated/complexity-scanner.md +0 -56
- package/.claude/agents/generated/content-seo-strategist.md +0 -90
- package/.claude/agents/generated/copy-editor.md +0 -45
- package/.claude/agents/generated/court-reporter.md +0 -50
- package/.claude/agents/generated/defender.md +0 -51
- package/.claude/agents/generated/devbot-orchestrator.md +0 -58
- package/.claude/agents/generated/devbot-planner.md +0 -63
- package/.claude/agents/generated/developer-community-strategist.md +0 -91
- package/.claude/agents/generated/editor-in-chief.md +0 -45
- package/.claude/agents/generated/fact-checker.md +0 -45
- package/.claude/agents/generated/impact-assessor.md +0 -54
- package/.claude/agents/generated/judge.md +0 -51
- package/.claude/agents/generated/outreach-partnership-strategist.md +0 -90
- package/.claude/agents/generated/prosecutor.md +0 -51
- package/.claude/agents/generated/reporter.md +0 -45
- package/.claude/agents/generated/social-media-strategist.md +0 -91
- package/.claude/agents/generated/video-visual-strategist.md +0 -90
- package/.claude/agents/reengineer-squad/boss.md +0 -113
- package/.claude/agents/reengineer-squad/critic-architect.md +0 -132
- package/.claude/agents/reengineer-squad/git-manager.md +0 -145
- package/.claude/agents/reengineer-squad/idea-generator.md +0 -95
- package/.claude/agents/reengineer-squad/implementer.md +0 -112
- package/.claude/agents/reengineer-squad/integration-planner.md +0 -112
- package/.claude/agents/reengineer-squad/source-analyst.md +0 -103
- package/.claude/agents/reengineer-squad/target-analyst.md +0 -118
- package/.claude/agents/reengineer-squad/tester.md +0 -105
- package/.claude/agents/sparc/architecture.md +0 -453
- package/.claude/agents/sparc/pseudocode.md +0 -299
- package/.claude/agents/sparc/refinement.md +0 -504
- package/.claude/agents/sparc/specification.md +0 -258
- package/.claude/agents/templates/implementer-sparc-coder.md +0 -231
- package/.claude/commands/sparc/analyzer.md +0 -35
- package/.claude/commands/sparc/architect.md +0 -36
- package/.claude/commands/sparc/ask.md +0 -56
- package/.claude/commands/sparc/batch-executor.md +0 -37
- package/.claude/commands/sparc/code.md +0 -48
- package/.claude/commands/sparc/coder.md +0 -37
- package/.claude/commands/sparc/debug.md +0 -42
- package/.claude/commands/sparc/debugger.md +0 -37
- package/.claude/commands/sparc/designer.md +0 -36
- package/.claude/commands/sparc/devops.md +0 -68
- package/.claude/commands/sparc/docs-writer.md +0 -39
- package/.claude/commands/sparc/documenter.md +0 -37
- package/.claude/commands/sparc/innovator.md +0 -37
- package/.claude/commands/sparc/integration.md +0 -42
- package/.claude/commands/sparc/mcp.md +0 -76
- package/.claude/commands/sparc/memory-manager.md +0 -57
- package/.claude/commands/sparc/optimizer.md +0 -37
- package/.claude/commands/sparc/orchestrator.md +0 -70
- package/.claude/commands/sparc/post-deployment-monitoring-mode.md +0 -42
- package/.claude/commands/sparc/refinement-optimization-mode.md +0 -42
- package/.claude/commands/sparc/researcher.md +0 -37
- package/.claude/commands/sparc/reviewer.md +0 -37
- package/.claude/commands/sparc/security-review.md +0 -39
- package/.claude/commands/sparc/sparc-modes.md +0 -120
- package/.claude/commands/sparc/sparc.md +0 -71
- package/.claude/commands/sparc/spec-pseudocode.md +0 -39
- package/.claude/commands/sparc/supabase-admin.md +0 -301
- package/.claude/commands/sparc/swarm-coordinator.md +0 -50
- package/.claude/commands/sparc/tdd.md +0 -37
- package/.claude/commands/sparc/tester.md +0 -37
- package/.claude/commands/sparc/tutorial.md +0 -38
- package/.claude/commands/sparc/workflow-manager.md +0 -37
- package/.claude/commands/sparc.md +0 -112
- package/.claude/helpers/auto-memory-hook.mjs +0 -503
- package/.claude/skills/sparc-methodology/SKILL.md +0 -950
- package/dist/src/capabilities/enrichment.d.ts +0 -44
- package/dist/src/capabilities/enrichment.d.ts.map +0 -1
- package/dist/src/capabilities/enrichment.js +0 -141
- package/dist/src/capabilities/enrichment.js.map +0 -1
- package/dist/src/commands/analyze-boundaries.d.ts +0 -14
- package/dist/src/commands/analyze-boundaries.d.ts.map +0 -1
- package/dist/src/commands/analyze-boundaries.js +0 -295
- package/dist/src/commands/analyze-boundaries.js.map +0 -1
- package/dist/src/commands/analyze-graph.d.ts +0 -14
- package/dist/src/commands/analyze-graph.d.ts.map +0 -1
- package/dist/src/commands/analyze-graph.js +0 -304
- package/dist/src/commands/analyze-graph.js.map +0 -1
- package/dist/src/commands/claims.d.ts +0 -10
- package/dist/src/commands/claims.d.ts.map +0 -1
- package/dist/src/commands/claims.js +0 -650
- package/dist/src/commands/claims.js.map +0 -1
- package/dist/src/commands/daemon.d.ts +0 -8
- package/dist/src/commands/daemon.d.ts.map +0 -1
- package/dist/src/commands/daemon.js +0 -681
- package/dist/src/commands/daemon.js.map +0 -1
- package/dist/src/commands/deployment.d.ts +0 -10
- package/dist/src/commands/deployment.d.ts.map +0 -1
- package/dist/src/commands/deployment.js +0 -706
- package/dist/src/commands/deployment.js.map +0 -1
- package/dist/src/commands/enrich.d.ts +0 -10
- package/dist/src/commands/enrich.d.ts.map +0 -1
- package/dist/src/commands/enrich.js +0 -58
- package/dist/src/commands/enrich.js.map +0 -1
- package/dist/src/commands/issues.d.ts +0 -21
- package/dist/src/commands/issues.d.ts.map +0 -1
- package/dist/src/commands/issues.js +0 -575
- package/dist/src/commands/issues.js.map +0 -1
- package/dist/src/commands/workflow.d.ts +0 -8
- package/dist/src/commands/workflow.d.ts.map +0 -1
- package/dist/src/commands/workflow.js +0 -677
- package/dist/src/commands/workflow.js.map +0 -1
- package/dist/src/mcp-tools/workflow-tools.d.ts +0 -8
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +0 -1
- package/dist/src/mcp-tools/workflow-tools.js +0 -717
- package/dist/src/mcp-tools/workflow-tools.js.map +0 -1
- package/dist/src/services/claim-service.d.ts +0 -198
- package/dist/src/services/claim-service.d.ts.map +0 -1
- package/dist/src/services/claim-service.js +0 -890
- package/dist/src/services/claim-service.js.map +0 -1
- package/dist/src/services/headless-worker-executor.d.ts +0 -311
- package/dist/src/services/headless-worker-executor.d.ts.map +0 -1
- package/dist/src/services/headless-worker-executor.js +0 -1183
- package/dist/src/services/headless-worker-executor.js.map +0 -1
- package/dist/src/services/worker-daemon.d.ts +0 -248
- package/dist/src/services/worker-daemon.d.ts.map +0 -1
- package/dist/src/services/worker-daemon.js +0 -1417
- package/dist/src/services/worker-daemon.js.map +0 -1
- package/dist/src/ui/.monomind/capture/active-run.json +0 -1
- package/dist/src/ui/.monomind/orgs/system-trial-qa/runs/real-events-1782290897.convs.jsonl +0 -3
- package/dist/src/ui/.monomind/orgs/system-trial-qa/runs/real-events-1782290897.jsonl +0 -11
- package/dist/src/ui/.monomind/orgs/system-trial-qa/runs/rigid-qa-restart-1782288201.jsonl +0 -540
- package/dist/src/ui/.monomind/orgs/system-trial-qa-threads.jsonl +0 -3
- package/dist/src/ui/.monomind/orgs/test-event-fix/runs/rigid-qa-restart-1782288201.jsonl +0 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hooks Intelligence
|
|
2
|
+
* Hooks Intelligence MCP Tools
|
|
3
3
|
* MCP tool implementations for intelligence reset, trajectories, patterns,
|
|
4
|
-
* intelligence stats/learn/attention,
|
|
5
|
-
* and model routing.
|
|
4
|
+
* intelligence stats/learn/attention, and model routing.
|
|
6
5
|
* Extracted from hooks-tools.ts.
|
|
6
|
+
* The simulated worker dispatch/status/detect/cancel tools were deleted with
|
|
7
|
+
* the worker daemon -- real workers live in @monomind/hooks (`hooks worker run`).
|
|
7
8
|
*/
|
|
8
9
|
import { existsSync, readdirSync, unlinkSync } from 'fs';
|
|
9
10
|
import { join } from 'path';
|
|
@@ -234,6 +235,35 @@ export const hooksTrajectoryEnd = {
|
|
|
234
235
|
}
|
|
235
236
|
// Remove from active trajectories
|
|
236
237
|
activeTrajectories.delete(trajectoryId);
|
|
238
|
+
// Bridge to the local intelligence ReasoningBank/SONA confidence-learning
|
|
239
|
+
// loop (src/memory/intelligence.ts). Previously this handler only wrote
|
|
240
|
+
// to the legacy JSON memory store (namespace 'trajectories') and the
|
|
241
|
+
// SONA routing optimizer's .swarm/sona-patterns.json — neither of which
|
|
242
|
+
// the ReasoningBank read from live, so trajectories recorded through
|
|
243
|
+
// this MCP tool (the path Claude Code actually calls) never fed the
|
|
244
|
+
// pattern store that `findSimilarPatterns`/`suggestAgentsFromIntelligence`
|
|
245
|
+
// read from. Recording a summary 'result' step here generates an
|
|
246
|
+
// embedding, stores a searchable pattern, and — because type 'result'
|
|
247
|
+
// triggers intelligence.ts's endTrajectory+distillLearning — applies
|
|
248
|
+
// the success/failure verdict to any semantically similar patterns.
|
|
249
|
+
try {
|
|
250
|
+
const intel = await import('../memory/intelligence.js');
|
|
251
|
+
await intel.initializeIntelligence();
|
|
252
|
+
const summary = `Task: ${trajectory.task} | Agent: ${trajectory.agent} | Steps: ${trajectory.steps.length} | Success: ${success}${feedback ? ` | Feedback: ${feedback}` : ''}`;
|
|
253
|
+
await intel.recordStep({
|
|
254
|
+
type: 'result',
|
|
255
|
+
content: summary,
|
|
256
|
+
metadata: {
|
|
257
|
+
verdict: success ? 'success' : 'failure',
|
|
258
|
+
trajectoryId,
|
|
259
|
+
agent: trajectory.agent,
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
catch {
|
|
264
|
+
// Non-fatal: intelligence bridge unavailable, trajectory is still
|
|
265
|
+
// persisted via the legacy store above.
|
|
266
|
+
}
|
|
237
267
|
}
|
|
238
268
|
// SONA Learning - process trajectory outcome for routing optimization
|
|
239
269
|
let sonaResult = {
|
|
@@ -745,448 +775,6 @@ export const hooksIntelligenceAttention = {
|
|
|
745
775
|
};
|
|
746
776
|
},
|
|
747
777
|
};
|
|
748
|
-
/**
|
|
749
|
-
* Worker trigger patterns for auto-detection
|
|
750
|
-
*/
|
|
751
|
-
const WORKER_TRIGGER_PATTERNS = {
|
|
752
|
-
ultralearn: [
|
|
753
|
-
/learn\s+about/i,
|
|
754
|
-
/understand\s+(how|what|why)/i,
|
|
755
|
-
/deep\s+dive\s+into/i,
|
|
756
|
-
/explain\s+in\s+detail/i,
|
|
757
|
-
/comprehensive\s+guide/i,
|
|
758
|
-
/master\s+this/i,
|
|
759
|
-
],
|
|
760
|
-
optimize: [
|
|
761
|
-
/optimize/i,
|
|
762
|
-
/improve\s+performance/i,
|
|
763
|
-
/make\s+(it\s+)?faster/i,
|
|
764
|
-
/speed\s+up/i,
|
|
765
|
-
/reduce\s+(memory|time)/i,
|
|
766
|
-
/performance\s+issue/i,
|
|
767
|
-
],
|
|
768
|
-
consolidate: [
|
|
769
|
-
/consolidate/i,
|
|
770
|
-
/merge\s+memories/i,
|
|
771
|
-
/clean\s+up\s+memory/i,
|
|
772
|
-
/deduplicate/i,
|
|
773
|
-
/memory\s+maintenance/i,
|
|
774
|
-
],
|
|
775
|
-
predict: [
|
|
776
|
-
/what\s+will\s+happen/i,
|
|
777
|
-
/predict/i,
|
|
778
|
-
/forecast/i,
|
|
779
|
-
/anticipate/i,
|
|
780
|
-
/preload/i,
|
|
781
|
-
/prepare\s+for/i,
|
|
782
|
-
],
|
|
783
|
-
audit: [
|
|
784
|
-
/security\s+audit/i,
|
|
785
|
-
/vulnerability/i,
|
|
786
|
-
/security\s+check/i,
|
|
787
|
-
/pentest/i,
|
|
788
|
-
/security\s+scan/i,
|
|
789
|
-
/cve/i,
|
|
790
|
-
/owasp/i,
|
|
791
|
-
],
|
|
792
|
-
map: [
|
|
793
|
-
/map\s+(the\s+)?codebase/i,
|
|
794
|
-
/architecture\s+overview/i,
|
|
795
|
-
/project\s+structure/i,
|
|
796
|
-
/dependency\s+graph/i,
|
|
797
|
-
/code\s+map/i,
|
|
798
|
-
/explore\s+codebase/i,
|
|
799
|
-
],
|
|
800
|
-
preload: [
|
|
801
|
-
/preload/i,
|
|
802
|
-
/cache\s+ahead/i,
|
|
803
|
-
/prefetch/i,
|
|
804
|
-
/warm\s+(up\s+)?cache/i,
|
|
805
|
-
],
|
|
806
|
-
deepdive: [
|
|
807
|
-
/deep\s+dive/i,
|
|
808
|
-
/analyze\s+thoroughly/i,
|
|
809
|
-
/in-depth\s+analysis/i,
|
|
810
|
-
/comprehensive\s+review/i,
|
|
811
|
-
/detailed\s+examination/i,
|
|
812
|
-
],
|
|
813
|
-
document: [
|
|
814
|
-
/document\s+(this|the)/i,
|
|
815
|
-
/generate\s+docs/i,
|
|
816
|
-
/add\s+documentation/i,
|
|
817
|
-
/write\s+readme/i,
|
|
818
|
-
/api\s+docs/i,
|
|
819
|
-
/jsdoc/i,
|
|
820
|
-
],
|
|
821
|
-
refactor: [
|
|
822
|
-
/refactor/i,
|
|
823
|
-
/clean\s+up\s+code/i,
|
|
824
|
-
/improve\s+code\s+quality/i,
|
|
825
|
-
/restructure/i,
|
|
826
|
-
/simplify/i,
|
|
827
|
-
/make\s+more\s+readable/i,
|
|
828
|
-
],
|
|
829
|
-
benchmark: [
|
|
830
|
-
/benchmark/i,
|
|
831
|
-
/performance\s+test/i,
|
|
832
|
-
/measure\s+speed/i,
|
|
833
|
-
/stress\s+test/i,
|
|
834
|
-
/load\s+test/i,
|
|
835
|
-
],
|
|
836
|
-
testgaps: [
|
|
837
|
-
/test\s+coverage/i,
|
|
838
|
-
/missing\s+tests/i,
|
|
839
|
-
/untested\s+code/i,
|
|
840
|
-
/coverage\s+report/i,
|
|
841
|
-
/test\s+gaps/i,
|
|
842
|
-
/add\s+tests/i,
|
|
843
|
-
],
|
|
844
|
-
};
|
|
845
|
-
/**
|
|
846
|
-
* Worker configurations
|
|
847
|
-
*/
|
|
848
|
-
const WORKER_CONFIGS = {
|
|
849
|
-
ultralearn: {
|
|
850
|
-
description: 'Deep knowledge acquisition and learning',
|
|
851
|
-
priority: 'normal',
|
|
852
|
-
estimatedDuration: '60s',
|
|
853
|
-
capabilities: ['research', 'analysis', 'synthesis'],
|
|
854
|
-
},
|
|
855
|
-
optimize: {
|
|
856
|
-
description: 'Performance optimization and tuning',
|
|
857
|
-
priority: 'high',
|
|
858
|
-
estimatedDuration: '30s',
|
|
859
|
-
capabilities: ['profiling', 'optimization', 'benchmarking'],
|
|
860
|
-
},
|
|
861
|
-
consolidate: {
|
|
862
|
-
description: 'Memory consolidation and cleanup',
|
|
863
|
-
priority: 'low',
|
|
864
|
-
estimatedDuration: '20s',
|
|
865
|
-
capabilities: ['memory-management', 'deduplication'],
|
|
866
|
-
},
|
|
867
|
-
predict: {
|
|
868
|
-
description: 'Predictive preloading and anticipation',
|
|
869
|
-
priority: 'normal',
|
|
870
|
-
estimatedDuration: '15s',
|
|
871
|
-
capabilities: ['prediction', 'caching', 'preloading'],
|
|
872
|
-
},
|
|
873
|
-
audit: {
|
|
874
|
-
description: 'Security analysis and vulnerability scanning',
|
|
875
|
-
priority: 'critical',
|
|
876
|
-
estimatedDuration: '45s',
|
|
877
|
-
capabilities: ['security', 'vulnerability-scanning', 'audit'],
|
|
878
|
-
},
|
|
879
|
-
map: {
|
|
880
|
-
description: 'Codebase mapping and architecture analysis',
|
|
881
|
-
priority: 'normal',
|
|
882
|
-
estimatedDuration: '30s',
|
|
883
|
-
capabilities: ['analysis', 'mapping', 'visualization'],
|
|
884
|
-
},
|
|
885
|
-
preload: {
|
|
886
|
-
description: 'Resource preloading and cache warming',
|
|
887
|
-
priority: 'low',
|
|
888
|
-
estimatedDuration: '10s',
|
|
889
|
-
capabilities: ['caching', 'preloading'],
|
|
890
|
-
},
|
|
891
|
-
deepdive: {
|
|
892
|
-
description: 'Deep code analysis and examination',
|
|
893
|
-
priority: 'normal',
|
|
894
|
-
estimatedDuration: '60s',
|
|
895
|
-
capabilities: ['analysis', 'review', 'understanding'],
|
|
896
|
-
},
|
|
897
|
-
document: {
|
|
898
|
-
description: 'Auto-documentation generation',
|
|
899
|
-
priority: 'normal',
|
|
900
|
-
estimatedDuration: '45s',
|
|
901
|
-
capabilities: ['documentation', 'writing', 'generation'],
|
|
902
|
-
},
|
|
903
|
-
refactor: {
|
|
904
|
-
description: 'Code refactoring suggestions',
|
|
905
|
-
priority: 'normal',
|
|
906
|
-
estimatedDuration: '30s',
|
|
907
|
-
capabilities: ['refactoring', 'code-quality', 'improvement'],
|
|
908
|
-
},
|
|
909
|
-
benchmark: {
|
|
910
|
-
description: 'Performance benchmarking',
|
|
911
|
-
priority: 'normal',
|
|
912
|
-
estimatedDuration: '60s',
|
|
913
|
-
capabilities: ['benchmarking', 'testing', 'measurement'],
|
|
914
|
-
},
|
|
915
|
-
testgaps: {
|
|
916
|
-
description: 'Test coverage analysis',
|
|
917
|
-
priority: 'normal',
|
|
918
|
-
estimatedDuration: '30s',
|
|
919
|
-
capabilities: ['testing', 'coverage', 'analysis'],
|
|
920
|
-
},
|
|
921
|
-
};
|
|
922
|
-
// In-memory worker tracking
|
|
923
|
-
const activeWorkers = new Map();
|
|
924
|
-
let workerIdCounter = 0;
|
|
925
|
-
/**
|
|
926
|
-
* Detect triggers from prompt text
|
|
927
|
-
*/
|
|
928
|
-
function detectWorkerTriggers(text) {
|
|
929
|
-
const detectedTriggers = [];
|
|
930
|
-
let totalMatches = 0;
|
|
931
|
-
for (const [trigger, patterns] of Object.entries(WORKER_TRIGGER_PATTERNS)) {
|
|
932
|
-
for (const pattern of patterns) {
|
|
933
|
-
if (pattern.test(text)) {
|
|
934
|
-
if (!detectedTriggers.includes(trigger)) {
|
|
935
|
-
detectedTriggers.push(trigger);
|
|
936
|
-
}
|
|
937
|
-
totalMatches++;
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
const confidence = detectedTriggers.length > 0
|
|
942
|
-
? Math.min(1, totalMatches / (detectedTriggers.length * 2))
|
|
943
|
-
: 0;
|
|
944
|
-
return {
|
|
945
|
-
detected: detectedTriggers.length > 0,
|
|
946
|
-
triggers: detectedTriggers,
|
|
947
|
-
confidence,
|
|
948
|
-
context: text.slice(0, 100),
|
|
949
|
-
};
|
|
950
|
-
}
|
|
951
|
-
// Worker list tool
|
|
952
|
-
export const hooksWorkerList = {
|
|
953
|
-
name: 'hooks_worker-list',
|
|
954
|
-
description: 'List all 12 background workers with status and capabilities',
|
|
955
|
-
inputSchema: {
|
|
956
|
-
type: 'object',
|
|
957
|
-
properties: {
|
|
958
|
-
status: { type: 'string', description: 'Filter by status (all, running, completed, pending)' },
|
|
959
|
-
includeActive: { type: 'boolean', description: 'Include active worker instances' },
|
|
960
|
-
},
|
|
961
|
-
},
|
|
962
|
-
handler: async (params) => {
|
|
963
|
-
const statusFilter = params.status || 'all';
|
|
964
|
-
const includeActive = params.includeActive !== false;
|
|
965
|
-
const workers = Object.entries(WORKER_CONFIGS).map(([trigger, config]) => ({
|
|
966
|
-
trigger,
|
|
967
|
-
...config,
|
|
968
|
-
patterns: WORKER_TRIGGER_PATTERNS[trigger].length,
|
|
969
|
-
}));
|
|
970
|
-
const activeList = includeActive
|
|
971
|
-
? Array.from(activeWorkers.values()).filter(w => statusFilter === 'all' || w.status === statusFilter)
|
|
972
|
-
: [];
|
|
973
|
-
return {
|
|
974
|
-
workers,
|
|
975
|
-
total: 12,
|
|
976
|
-
active: {
|
|
977
|
-
instances: activeList,
|
|
978
|
-
count: activeList.length,
|
|
979
|
-
byStatus: {
|
|
980
|
-
pending: activeList.filter(w => w.status === 'pending').length,
|
|
981
|
-
running: activeList.filter(w => w.status === 'running').length,
|
|
982
|
-
completed: activeList.filter(w => w.status === 'completed').length,
|
|
983
|
-
failed: activeList.filter(w => w.status === 'failed').length,
|
|
984
|
-
},
|
|
985
|
-
},
|
|
986
|
-
performanceTargets: {
|
|
987
|
-
triggerDetection: '<5ms',
|
|
988
|
-
workerSpawn: '<50ms',
|
|
989
|
-
maxConcurrent: 10,
|
|
990
|
-
},
|
|
991
|
-
};
|
|
992
|
-
},
|
|
993
|
-
};
|
|
994
|
-
// Worker dispatch tool
|
|
995
|
-
export const hooksWorkerDispatch = {
|
|
996
|
-
name: 'hooks_worker-dispatch',
|
|
997
|
-
description: 'Dispatch a background worker for analysis/optimization tasks',
|
|
998
|
-
inputSchema: {
|
|
999
|
-
type: 'object',
|
|
1000
|
-
properties: {
|
|
1001
|
-
trigger: {
|
|
1002
|
-
type: 'string',
|
|
1003
|
-
description: 'Worker trigger type',
|
|
1004
|
-
enum: ['ultralearn', 'optimize', 'consolidate', 'predict', 'audit', 'map', 'preload', 'deepdive', 'document', 'refactor', 'benchmark', 'testgaps'],
|
|
1005
|
-
},
|
|
1006
|
-
context: { type: 'string', description: 'Context for the worker (file path, topic, etc.)' },
|
|
1007
|
-
priority: { type: 'string', description: 'Priority (low, normal, high, critical)' },
|
|
1008
|
-
background: { type: 'boolean', description: 'Run in background (non-blocking)' },
|
|
1009
|
-
},
|
|
1010
|
-
required: ['trigger'],
|
|
1011
|
-
},
|
|
1012
|
-
handler: async (params) => {
|
|
1013
|
-
const trigger = params.trigger;
|
|
1014
|
-
const context = params.context || 'default';
|
|
1015
|
-
const priority = params.priority || WORKER_CONFIGS[trigger]?.priority || 'normal';
|
|
1016
|
-
const background = params.background !== false;
|
|
1017
|
-
if (!WORKER_CONFIGS[trigger]) {
|
|
1018
|
-
return {
|
|
1019
|
-
success: false,
|
|
1020
|
-
error: `Unknown worker trigger: ${trigger}`,
|
|
1021
|
-
availableTriggers: Object.keys(WORKER_CONFIGS),
|
|
1022
|
-
};
|
|
1023
|
-
}
|
|
1024
|
-
const workerId = `worker_${trigger}_${++workerIdCounter}_${Date.now().toString(36)}`;
|
|
1025
|
-
const config = WORKER_CONFIGS[trigger];
|
|
1026
|
-
const worker = {
|
|
1027
|
-
id: workerId,
|
|
1028
|
-
trigger,
|
|
1029
|
-
context,
|
|
1030
|
-
status: 'running',
|
|
1031
|
-
progress: 0,
|
|
1032
|
-
phase: 'initializing',
|
|
1033
|
-
startedAt: new Date(),
|
|
1034
|
-
};
|
|
1035
|
-
activeWorkers.set(workerId, worker);
|
|
1036
|
-
// Update worker progress in background
|
|
1037
|
-
if (background) {
|
|
1038
|
-
setTimeout(() => {
|
|
1039
|
-
const w = activeWorkers.get(workerId);
|
|
1040
|
-
if (w) {
|
|
1041
|
-
w.progress = 50;
|
|
1042
|
-
w.phase = 'processing';
|
|
1043
|
-
}
|
|
1044
|
-
}, 500);
|
|
1045
|
-
setTimeout(() => {
|
|
1046
|
-
const w = activeWorkers.get(workerId);
|
|
1047
|
-
if (w) {
|
|
1048
|
-
w.progress = 100;
|
|
1049
|
-
w.phase = 'completed';
|
|
1050
|
-
w.status = 'completed';
|
|
1051
|
-
w.completedAt = new Date();
|
|
1052
|
-
}
|
|
1053
|
-
}, 1500);
|
|
1054
|
-
}
|
|
1055
|
-
else {
|
|
1056
|
-
worker.progress = 100;
|
|
1057
|
-
worker.phase = 'completed';
|
|
1058
|
-
worker.status = 'completed';
|
|
1059
|
-
worker.completedAt = new Date();
|
|
1060
|
-
}
|
|
1061
|
-
return {
|
|
1062
|
-
success: true,
|
|
1063
|
-
workerId,
|
|
1064
|
-
trigger,
|
|
1065
|
-
context,
|
|
1066
|
-
priority,
|
|
1067
|
-
config: {
|
|
1068
|
-
description: config.description,
|
|
1069
|
-
estimatedDuration: config.estimatedDuration,
|
|
1070
|
-
capabilities: config.capabilities,
|
|
1071
|
-
},
|
|
1072
|
-
status: background ? 'dispatched' : 'completed',
|
|
1073
|
-
background,
|
|
1074
|
-
timestamp: new Date().toISOString(),
|
|
1075
|
-
};
|
|
1076
|
-
},
|
|
1077
|
-
};
|
|
1078
|
-
// Worker status tool
|
|
1079
|
-
export const hooksWorkerStatus = {
|
|
1080
|
-
name: 'hooks_worker-status',
|
|
1081
|
-
description: 'Get status of a specific worker or all active workers',
|
|
1082
|
-
inputSchema: {
|
|
1083
|
-
type: 'object',
|
|
1084
|
-
properties: {
|
|
1085
|
-
workerId: { type: 'string', description: 'Specific worker ID to check' },
|
|
1086
|
-
includeCompleted: { type: 'boolean', description: 'Include completed workers' },
|
|
1087
|
-
},
|
|
1088
|
-
},
|
|
1089
|
-
handler: async (params) => {
|
|
1090
|
-
const workerId = params.workerId;
|
|
1091
|
-
const includeCompleted = params.includeCompleted !== false;
|
|
1092
|
-
if (workerId) {
|
|
1093
|
-
const worker = activeWorkers.get(workerId);
|
|
1094
|
-
if (!worker) {
|
|
1095
|
-
return {
|
|
1096
|
-
success: false,
|
|
1097
|
-
error: `Worker not found: ${workerId}`,
|
|
1098
|
-
};
|
|
1099
|
-
}
|
|
1100
|
-
return {
|
|
1101
|
-
success: true,
|
|
1102
|
-
worker: {
|
|
1103
|
-
...worker,
|
|
1104
|
-
duration: worker.completedAt
|
|
1105
|
-
? worker.completedAt.getTime() - worker.startedAt.getTime()
|
|
1106
|
-
: Date.now() - worker.startedAt.getTime(),
|
|
1107
|
-
},
|
|
1108
|
-
};
|
|
1109
|
-
}
|
|
1110
|
-
const workers = Array.from(activeWorkers.values())
|
|
1111
|
-
.filter(w => includeCompleted || w.status !== 'completed')
|
|
1112
|
-
.map(w => ({
|
|
1113
|
-
...w,
|
|
1114
|
-
duration: w.completedAt
|
|
1115
|
-
? w.completedAt.getTime() - w.startedAt.getTime()
|
|
1116
|
-
: Date.now() - w.startedAt.getTime(),
|
|
1117
|
-
}));
|
|
1118
|
-
return {
|
|
1119
|
-
success: true,
|
|
1120
|
-
workers,
|
|
1121
|
-
summary: {
|
|
1122
|
-
total: workers.length,
|
|
1123
|
-
running: workers.filter(w => w.status === 'running').length,
|
|
1124
|
-
completed: workers.filter(w => w.status === 'completed').length,
|
|
1125
|
-
failed: workers.filter(w => w.status === 'failed').length,
|
|
1126
|
-
},
|
|
1127
|
-
};
|
|
1128
|
-
},
|
|
1129
|
-
};
|
|
1130
|
-
// Worker detect tool - detect triggers from prompt
|
|
1131
|
-
export const hooksWorkerDetect = {
|
|
1132
|
-
name: 'hooks_worker-detect',
|
|
1133
|
-
description: 'Detect worker triggers from user prompt (for UserPromptSubmit hook)',
|
|
1134
|
-
inputSchema: {
|
|
1135
|
-
type: 'object',
|
|
1136
|
-
properties: {
|
|
1137
|
-
prompt: { type: 'string', description: 'User prompt to analyze' },
|
|
1138
|
-
autoDispatch: { type: 'boolean', description: 'Automatically dispatch detected workers' },
|
|
1139
|
-
minConfidence: { type: 'number', description: 'Minimum confidence threshold (0-1)' },
|
|
1140
|
-
},
|
|
1141
|
-
required: ['prompt'],
|
|
1142
|
-
},
|
|
1143
|
-
handler: async (params) => {
|
|
1144
|
-
const prompt = params.prompt;
|
|
1145
|
-
const autoDispatch = params.autoDispatch;
|
|
1146
|
-
const minConfidence = params.minConfidence || 0.5;
|
|
1147
|
-
const detection = detectWorkerTriggers(prompt);
|
|
1148
|
-
const result = {
|
|
1149
|
-
prompt: prompt.slice(0, 200) + (prompt.length > 200 ? '...' : ''),
|
|
1150
|
-
detection,
|
|
1151
|
-
triggersFound: detection.triggers.length,
|
|
1152
|
-
};
|
|
1153
|
-
if (detection.detected && detection.confidence >= minConfidence) {
|
|
1154
|
-
result.triggerDetails = detection.triggers.map(trigger => ({
|
|
1155
|
-
trigger,
|
|
1156
|
-
...WORKER_CONFIGS[trigger],
|
|
1157
|
-
}));
|
|
1158
|
-
if (autoDispatch) {
|
|
1159
|
-
const dispatched = [];
|
|
1160
|
-
for (const trigger of detection.triggers) {
|
|
1161
|
-
const workerId = `worker_${trigger}_${++workerIdCounter}_${Date.now().toString(36)}`;
|
|
1162
|
-
activeWorkers.set(workerId, {
|
|
1163
|
-
id: workerId,
|
|
1164
|
-
trigger,
|
|
1165
|
-
context: prompt.slice(0, 100),
|
|
1166
|
-
status: 'running',
|
|
1167
|
-
progress: 0,
|
|
1168
|
-
phase: 'initializing',
|
|
1169
|
-
startedAt: new Date(),
|
|
1170
|
-
});
|
|
1171
|
-
dispatched.push(workerId);
|
|
1172
|
-
// Mark worker completion after processing
|
|
1173
|
-
setTimeout(() => {
|
|
1174
|
-
const w = activeWorkers.get(workerId);
|
|
1175
|
-
if (w) {
|
|
1176
|
-
w.progress = 100;
|
|
1177
|
-
w.phase = 'completed';
|
|
1178
|
-
w.status = 'completed';
|
|
1179
|
-
w.completedAt = new Date();
|
|
1180
|
-
}
|
|
1181
|
-
}, 1500);
|
|
1182
|
-
}
|
|
1183
|
-
result.autoDispatched = true;
|
|
1184
|
-
result.workerIds = dispatched;
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
return result;
|
|
1188
|
-
},
|
|
1189
|
-
};
|
|
1190
778
|
// Model route tool - intelligent model selection
|
|
1191
779
|
export const hooksModelRoute = {
|
|
1192
780
|
name: 'hooks_model-route',
|
|
@@ -1291,41 +879,4 @@ function analyzeComplexityFallback(task) {
|
|
|
1291
879
|
const lengthScore = Math.min(1, task.length / 200);
|
|
1292
880
|
return Math.min(1, Math.max(0, 0.3 + highCount * 0.2 - lowCount * 0.15 + lengthScore * 0.2));
|
|
1293
881
|
}
|
|
1294
|
-
// Worker cancel tool
|
|
1295
|
-
export const hooksWorkerCancel = {
|
|
1296
|
-
name: 'hooks_worker-cancel',
|
|
1297
|
-
description: 'Cancel a running worker',
|
|
1298
|
-
inputSchema: {
|
|
1299
|
-
type: 'object',
|
|
1300
|
-
properties: {
|
|
1301
|
-
workerId: { type: 'string', description: 'Worker ID to cancel' },
|
|
1302
|
-
},
|
|
1303
|
-
required: ['workerId'],
|
|
1304
|
-
},
|
|
1305
|
-
handler: async (params) => {
|
|
1306
|
-
const workerId = params.workerId;
|
|
1307
|
-
const worker = activeWorkers.get(workerId);
|
|
1308
|
-
if (!worker) {
|
|
1309
|
-
return {
|
|
1310
|
-
success: false,
|
|
1311
|
-
error: `Worker not found: ${workerId}`,
|
|
1312
|
-
};
|
|
1313
|
-
}
|
|
1314
|
-
if (worker.status === 'completed' || worker.status === 'failed') {
|
|
1315
|
-
return {
|
|
1316
|
-
success: false,
|
|
1317
|
-
error: `Worker already ${worker.status}`,
|
|
1318
|
-
};
|
|
1319
|
-
}
|
|
1320
|
-
worker.status = 'failed';
|
|
1321
|
-
worker.phase = 'cancelled';
|
|
1322
|
-
worker.completedAt = new Date();
|
|
1323
|
-
return {
|
|
1324
|
-
success: true,
|
|
1325
|
-
workerId,
|
|
1326
|
-
cancelled: true,
|
|
1327
|
-
timestamp: new Date().toISOString(),
|
|
1328
|
-
};
|
|
1329
|
-
},
|
|
1330
|
-
};
|
|
1331
882
|
//# sourceMappingURL=hooks-intelligence.js.map
|