monomind 2.7.11 → 2.7.13
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/LICENSE +0 -0
- package/README.md +0 -0
- package/bin/cli.js +55 -4
- package/package.json +4 -47
- package/bin/npx-safe-launch.js +0 -9
- package/packages/@monomind/cli/.claude/agents/architecture/system-design/arch-system-design.md +0 -54
- package/packages/@monomind/cli/.claude/agents/consensus/crdt-synchronizer.md +0 -977
- package/packages/@monomind/cli/.claude/agents/consensus/quorum-manager.md +0 -106
- package/packages/@monomind/cli/.claude/agents/consensus/security-manager.md +0 -602
- package/packages/@monomind/cli/.claude/agents/core/coder.md +0 -271
- package/packages/@monomind/cli/.claude/agents/core/coordinator.md +0 -133
- package/packages/@monomind/cli/.claude/agents/core/planner.md +0 -179
- package/packages/@monomind/cli/.claude/agents/core/researcher.md +0 -197
- package/packages/@monomind/cli/.claude/agents/core/reviewer.md +0 -336
- package/packages/@monomind/cli/.claude/agents/core/tester.md +0 -326
- package/packages/@monomind/cli/.claude/agents/design/design-monodesign.md +0 -121
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-ai-data-remediation-engineer.md +0 -212
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-ai-engineer.md +0 -165
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-autonomous-optimization-architect.md +0 -108
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-backend-architect.md +0 -254
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-code-reviewer.md +0 -95
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-data-engineer.md +0 -307
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-database-optimizer.md +0 -200
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-devops-automator.md +0 -430
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-embedded-firmware-engineer.md +0 -174
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-feishu-integration-developer.md +0 -607
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-frontend-developer.md +0 -249
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-git-workflow-master.md +0 -108
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-incident-response-commander.md +0 -482
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-mobile-app-builder.md +0 -499
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-rapid-prototyper.md +0 -463
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-security-engineer.md +0 -303
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-senior-developer.md +0 -195
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-software-architect.md +0 -100
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-solidity-smart-contract-engineer.md +0 -528
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-sre.md +0 -114
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-technical-writer.md +0 -412
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-threat-detection-engineer.md +0 -540
- package/packages/@monomind/cli/.claude/agents/engineering/engineering-wechat-mini-program-developer.md +0 -351
- package/packages/@monomind/cli/.claude/agents/github/code-review-swarm.md +0 -557
- package/packages/@monomind/cli/.claude/agents/github/github-modes.md +0 -154
- package/packages/@monomind/cli/.claude/agents/github/issue-tracker.md +0 -297
- package/packages/@monomind/cli/.claude/agents/github/multi-repo-swarm.md +0 -525
- package/packages/@monomind/cli/.claude/agents/github/pr-manager.md +0 -161
- package/packages/@monomind/cli/.claude/agents/github/project-board-sync.md +0 -478
- package/packages/@monomind/cli/.claude/agents/github/release-manager.md +0 -296
- package/packages/@monomind/cli/.claude/agents/github/repo-architect.md +0 -351
- package/packages/@monomind/cli/.claude/agents/github/swarm-issue.md +0 -548
- package/packages/@monomind/cli/.claude/agents/github/swarm-pr.md +0 -427
- package/packages/@monomind/cli/.claude/agents/github/sync-coordinator.md +0 -355
- package/packages/@monomind/cli/.claude/agents/github/workflow-automation.md +0 -640
- package/packages/@monomind/cli/.claude/agents/goal/goal-planner.md +0 -167
- package/packages/@monomind/cli/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -93
- package/packages/@monomind/cli/.claude/agents/hive-mind/scout-explorer.md +0 -241
- package/packages/@monomind/cli/.claude/agents/hive-mind/swarm-memory-manager.md +0 -192
- package/packages/@monomind/cli/.claude/agents/hive-mind/worker-specialist.md +0 -216
- package/packages/@monomind/cli/.claude/agents/marketing/marketing-competitive-content.md +0 -155
- package/packages/@monomind/cli/.claude/agents/marketing/marketing-cro-specialist.md +0 -147
- package/packages/@monomind/cli/.claude/agents/marketing/marketing-email-specialist.md +0 -90
- package/packages/@monomind/cli/.claude/agents/marketing/marketing-launch-strategist.md +0 -129
- package/packages/@monomind/cli/.claude/agents/marketing/marketing-pricing-strategist.md +0 -127
- package/packages/@monomind/cli/.claude/agents/optimization/benchmark-suite.md +0 -665
- package/packages/@monomind/cli/.claude/agents/optimization/load-balancer.md +0 -431
- package/packages/@monomind/cli/.claude/agents/optimization/performance-monitor.md +0 -672
- package/packages/@monomind/cli/.claude/agents/optimization/resource-allocator.md +0 -674
- package/packages/@monomind/cli/.claude/agents/optimization/topology-optimizer.md +0 -808
- package/packages/@monomind/cli/.claude/agents/schemas/architecture-output.json +0 -43
- package/packages/@monomind/cli/.claude/agents/schemas/code-review-output.json +0 -28
- package/packages/@monomind/cli/.claude/agents/schemas/generic-task-input.json +0 -12
- package/packages/@monomind/cli/.claude/agents/schemas/implementation-output.json +0 -18
- package/packages/@monomind/cli/.claude/agents/schemas/research-output.json +0 -31
- package/packages/@monomind/cli/.claude/agents/schemas/security-audit-output.json +0 -29
- package/packages/@monomind/cli/.claude/agents/schemas/test-report-output.json +0 -29
- package/packages/@monomind/cli/.claude/agents/specialists/integration-architect.md +0 -94
- package/packages/@monomind/cli/.claude/agents/specialized/agentic-identity-trust.md +0 -388
- package/packages/@monomind/cli/.claude/agents/specialized/agents-orchestrator.md +0 -368
- package/packages/@monomind/cli/.claude/agents/specialized/automation-governance-architect.md +0 -217
- package/packages/@monomind/cli/.claude/agents/specialized/blockchain-security-auditor.md +0 -497
- package/packages/@monomind/cli/.claude/agents/specialized/compliance-auditor.md +0 -159
- package/packages/@monomind/cli/.claude/agents/specialized/identity-graph-operator.md +0 -261
- package/packages/@monomind/cli/.claude/agents/specialized/lsp-index-engineer.md +0 -315
- package/packages/@monomind/cli/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -89
- package/packages/@monomind/cli/.claude/agents/specialized/specialized-cultural-intelligence-strategist.md +0 -89
- package/packages/@monomind/cli/.claude/agents/specialized/specialized-developer-advocate.md +0 -318
- package/packages/@monomind/cli/.claude/agents/specialized/specialized-document-generator.md +0 -56
- package/packages/@monomind/cli/.claude/agents/specialized/specialized-mcp-builder.md +0 -64
- package/packages/@monomind/cli/.claude/agents/specialized/specialized-model-qa.md +0 -489
- package/packages/@monomind/cli/.claude/agents/specialized/specialized-workflow-architect.md +0 -595
- package/packages/@monomind/cli/.claude/agents/specialized/zk-steward.md +0 -212
- package/packages/@monomind/cli/.claude/agents/swarm/mesh-coordinator.md +0 -97
- package/packages/@monomind/cli/.claude/agents/templates/automation-smart-agent.md +0 -185
- package/packages/@monomind/cli/.claude/agents/templates/coordinator-swarm-init.md +0 -83
- package/packages/@monomind/cli/.claude/agents/testing/production-validator.md +0 -375
- package/packages/@monomind/cli/.claude/agents/testing/tdd-london-swarm.md +0 -241
- package/packages/@monomind/cli/.claude/agents/testing/testing-accessibility-auditor.md +0 -322
- package/packages/@monomind/cli/.claude/agents/testing/testing-api-tester.md +0 -307
- package/packages/@monomind/cli/.claude/agents/testing/testing-evidence-collector.md +0 -213
- package/packages/@monomind/cli/.claude/agents/testing/testing-performance-benchmarker.md +0 -269
- package/packages/@monomind/cli/.claude/agents/testing/testing-test-results-analyzer.md +0 -306
- package/packages/@monomind/cli/.claude/agents/testing/testing-tool-evaluator.md +0 -395
- package/packages/@monomind/cli/.claude/agents/testing/testing-workflow-optimizer.md +0 -451
- package/packages/@monomind/cli/.claude/commands/agents/README.md +0 -14
- package/packages/@monomind/cli/.claude/commands/agents/agent-capabilities.md +0 -25
- package/packages/@monomind/cli/.claude/commands/agents/agent-coordination.md +0 -32
- package/packages/@monomind/cli/.claude/commands/agents/agent-spawning.md +0 -32
- package/packages/@monomind/cli/.claude/commands/agents/agent-types.md +0 -30
- package/packages/@monomind/cli/.claude/commands/analysis/README.md +0 -18
- package/packages/@monomind/cli/.claude/commands/analysis/bottleneck-detect.md +0 -69
- package/packages/@monomind/cli/.claude/commands/analysis/performance-bottlenecks.md +0 -59
- package/packages/@monomind/cli/.claude/commands/analysis/performance-report.md +0 -52
- package/packages/@monomind/cli/.claude/commands/analysis/token-usage.md +0 -47
- package/packages/@monomind/cli/.claude/commands/automation/README.md +0 -19
- package/packages/@monomind/cli/.claude/commands/automation/auto-agent.md +0 -86
- package/packages/@monomind/cli/.claude/commands/automation/self-healing.md +0 -108
- package/packages/@monomind/cli/.claude/commands/automation/session-memory.md +0 -89
- package/packages/@monomind/cli/.claude/commands/automation/smart-agents.md +0 -81
- package/packages/@monomind/cli/.claude/commands/automation/smart-spawn.md +0 -66
- package/packages/@monomind/cli/.claude/commands/automation/workflow-select.md +0 -60
- package/packages/@monomind/cli/.claude/commands/coordination/README.md +0 -13
- package/packages/@monomind/cli/.claude/commands/coordination/agent-spawn.md +0 -69
- package/packages/@monomind/cli/.claude/commands/coordination/swarm-init.md +0 -82
- package/packages/@monomind/cli/.claude/commands/coordination/task-orchestrate.md +0 -79
- package/packages/@monomind/cli/.claude/commands/github/README.md +0 -24
- package/packages/@monomind/cli/.claude/commands/github/github-modes.md +0 -151
- package/packages/@monomind/cli/.claude/commands/github/issue-tracker.md +0 -291
- package/packages/@monomind/cli/.claude/commands/github/pr-manager.md +0 -171
- package/packages/@monomind/cli/.claude/commands/github/release-manager.md +0 -343
- package/packages/@monomind/cli/.claude/commands/github/repo-architect.md +0 -372
- package/packages/@monomind/cli/.claude/commands/github/sync-coordinator.md +0 -297
- package/packages/@monomind/cli/.claude/commands/hive-mind/README.md +0 -42
- package/packages/@monomind/cli/.claude/commands/hive-mind/hive-mind-consensus.md +0 -72
- package/packages/@monomind/cli/.claude/commands/hive-mind/hive-mind-init.md +0 -68
- package/packages/@monomind/cli/.claude/commands/hive-mind/hive-mind-memory.md +0 -73
- package/packages/@monomind/cli/.claude/commands/hive-mind/hive-mind-spawn.md +0 -82
- package/packages/@monomind/cli/.claude/commands/hive-mind/hive-mind-status.md +0 -56
- package/packages/@monomind/cli/.claude/commands/hive-mind/hive-mind-stop.md +0 -55
- package/packages/@monomind/cli/.claude/commands/hive-mind/hive-mind.md +0 -87
- package/packages/@monomind/cli/.claude/commands/hooks/README.md +0 -66
- package/packages/@monomind/cli/.claude/commands/hooks/overview.md +0 -112
- package/packages/@monomind/cli/.claude/commands/hooks/post-edit.md +0 -78
- package/packages/@monomind/cli/.claude/commands/hooks/post-task.md +0 -62
- package/packages/@monomind/cli/.claude/commands/hooks/pre-edit.md +0 -81
- package/packages/@monomind/cli/.claude/commands/hooks/pre-task.md +0 -73
- package/packages/@monomind/cli/.claude/commands/hooks/session-end.md +0 -82
- package/packages/@monomind/cli/.claude/commands/hooks/setup.md +0 -132
- package/packages/@monomind/cli/.claude/commands/mastermind/_repeat.md +0 -492
- package/packages/@monomind/cli/.claude/commands/mastermind/_taskfile.md +0 -232
- package/packages/@monomind/cli/.claude/commands/mastermind/adr.md +0 -9
- package/packages/@monomind/cli/.claude/commands/mastermind/approvev1.md +0 -94
- package/packages/@monomind/cli/.claude/commands/mastermind/architect.md +0 -52
- package/packages/@monomind/cli/.claude/commands/mastermind/autodev.md +0 -28
- package/packages/@monomind/cli/.claude/commands/mastermind/brain.md +0 -99
- package/packages/@monomind/cli/.claude/commands/mastermind/budget.md +0 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/build.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/code-review.md +0 -314
- package/packages/@monomind/cli/.claude/commands/mastermind/content.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/createorg.md +0 -143
- package/packages/@monomind/cli/.claude/commands/mastermind/createtask.md +0 -372
- package/packages/@monomind/cli/.claude/commands/mastermind/debug.md +0 -19
- package/packages/@monomind/cli/.claude/commands/mastermind/design.md +0 -17
- package/packages/@monomind/cli/.claude/commands/mastermind/do.md +0 -525
- package/packages/@monomind/cli/.claude/commands/mastermind/execute.md +0 -17
- package/packages/@monomind/cli/.claude/commands/mastermind/finance.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/finish.md +0 -17
- package/packages/@monomind/cli/.claude/commands/mastermind/graph-status.md +0 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/help.md +0 -133
- package/packages/@monomind/cli/.claude/commands/mastermind/idea.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/ideate.md +0 -258
- package/packages/@monomind/cli/.claude/commands/mastermind/improve.md +0 -342
- package/packages/@monomind/cli/.claude/commands/mastermind/loops.md +0 -5
- package/packages/@monomind/cli/.claude/commands/mastermind/marketing.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/master.md +0 -1140
- package/packages/@monomind/cli/.claude/commands/mastermind/memory.md +0 -227
- package/packages/@monomind/cli/.claude/commands/mastermind/okf-export.md +0 -14
- package/packages/@monomind/cli/.claude/commands/mastermind/okf-import.md +0 -15
- package/packages/@monomind/cli/.claude/commands/mastermind/ops.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/orgs.md +0 -18
- package/packages/@monomind/cli/.claude/commands/mastermind/orgstatus.md +0 -56
- package/packages/@monomind/cli/.claude/commands/mastermind/plan.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/receive-review.md +0 -17
- package/packages/@monomind/cli/.claude/commands/mastermind/references/antigravity-tools.md +0 -60
- package/packages/@monomind/cli/.claude/commands/mastermind/references/claude-code-tools.md +0 -50
- package/packages/@monomind/cli/.claude/commands/mastermind/references/codex-tools.md +0 -64
- package/packages/@monomind/cli/.claude/commands/mastermind/references/copilot-tools.md +0 -49
- package/packages/@monomind/cli/.claude/commands/mastermind/references/gemini-tools.md +0 -63
- package/packages/@monomind/cli/.claude/commands/mastermind/references/pi-tools.md +0 -28
- package/packages/@monomind/cli/.claude/commands/mastermind/release.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/repeat.md +0 -254
- package/packages/@monomind/cli/.claude/commands/mastermind/research.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/review.md +0 -34
- package/packages/@monomind/cli/.claude/commands/mastermind/runorg.md +0 -71
- package/packages/@monomind/cli/.claude/commands/mastermind/runorgv1.md +0 -159
- package/packages/@monomind/cli/.claude/commands/mastermind/sales.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/skill-builder.md +0 -17
- package/packages/@monomind/cli/.claude/commands/mastermind/specialagents.md +0 -122
- package/packages/@monomind/cli/.claude/commands/mastermind/stoporg.md +0 -78
- package/packages/@monomind/cli/.claude/commands/mastermind/swarm.md +0 -158
- package/packages/@monomind/cli/.claude/commands/mastermind/taskdev.md +0 -23
- package/packages/@monomind/cli/.claude/commands/mastermind/tdd.md +0 -19
- package/packages/@monomind/cli/.claude/commands/mastermind/techport.md +0 -27
- package/packages/@monomind/cli/.claude/commands/mastermind/topology.md +0 -121
- package/packages/@monomind/cli/.claude/commands/mastermind/understand.md +0 -136
- package/packages/@monomind/cli/.claude/commands/mastermind/verify.md +0 -19
- package/packages/@monomind/cli/.claude/commands/mastermind/worktree.md +0 -17
- package/packages/@monomind/cli/.claude/commands/mastermind.md +0 -140
- package/packages/@monomind/cli/.claude/commands/memory/README.md +0 -79
- package/packages/@monomind/cli/.claude/commands/memory/memory-search.md +0 -77
- package/packages/@monomind/cli/.claude/commands/monitoring/README.md +0 -69
- package/packages/@monomind/cli/.claude/commands/monitoring/agent-metrics.md +0 -65
- package/packages/@monomind/cli/.claude/commands/monitoring/agents.md +0 -71
- package/packages/@monomind/cli/.claude/commands/monitoring/status.md +0 -108
- package/packages/@monomind/cli/.claude/commands/monobrowse.md +0 -21
- package/packages/@monomind/cli/.claude/commands/monoes/README.md +0 -30
- package/packages/@monomind/cli/.claude/commands/monoes/install.md +0 -163
- package/packages/@monomind/cli/.claude/commands/monoes/monoagent.md +0 -148
- package/packages/@monomind/cli/.claude/commands/monoes/monoclip.md +0 -64
- package/packages/@monomind/cli/.claude/commands/monoes/monotask.md +0 -137
- package/packages/@monomind/cli/.claude/commands/monograph/README.md +0 -102
- package/packages/@monomind/cli/.claude/commands/monograph/monograph-build.md +0 -79
- package/packages/@monomind/cli/.claude/commands/monograph/monograph-search.md +0 -96
- package/packages/@monomind/cli/.claude/commands/monograph/monograph-stats.md +0 -53
- package/packages/@monomind/cli/.claude/commands/monograph/monograph-watch.md +0 -63
- package/packages/@monomind/cli/.claude/commands/monograph/monograph-wiki.md +0 -91
- package/packages/@monomind/cli/.claude/commands/optimization/auto-topology.md +0 -85
- package/packages/@monomind/cli/.claude/commands/optimization/performance-optimize.md +0 -79
- package/packages/@monomind/cli/.claude/commands/pair/README.md +0 -79
- package/packages/@monomind/cli/.claude/commands/pair/examples.md +0 -156
- package/packages/@monomind/cli/.claude/commands/pair/modes.md +0 -122
- package/packages/@monomind/cli/.claude/commands/pair/session.md +0 -124
- package/packages/@monomind/cli/.claude/commands/stream-chain/pipeline.md +0 -116
- package/packages/@monomind/cli/.claude/commands/stream-chain/run.md +0 -156
- package/packages/@monomind/cli/.claude/commands/swarm/README.md +0 -40
- package/packages/@monomind/cli/.claude/commands/swarm/analysis.md +0 -73
- package/packages/@monomind/cli/.claude/commands/swarm/development.md +0 -72
- package/packages/@monomind/cli/.claude/commands/swarm/examples.md +0 -103
- package/packages/@monomind/cli/.claude/commands/swarm/maintenance.md +0 -75
- package/packages/@monomind/cli/.claude/commands/swarm/optimization.md +0 -84
- package/packages/@monomind/cli/.claude/commands/swarm/research.md +0 -76
- package/packages/@monomind/cli/.claude/commands/swarm/swarm.md +0 -79
- package/packages/@monomind/cli/.claude/commands/swarm/testing.md +0 -80
- package/packages/@monomind/cli/.claude/commands/tokens.md +0 -18
- package/packages/@monomind/cli/.claude/commands/truth/start.md +0 -121
- package/packages/@monomind/cli/.claude/commands/ts.md +0 -14
- package/packages/@monomind/cli/.claude/commands/workflows/README.md +0 -64
- package/packages/@monomind/cli/.claude/commands/workflows/development.md +0 -86
- package/packages/@monomind/cli/.claude/commands/workflows/research.md +0 -89
- package/packages/@monomind/cli/.claude/commands/workflows/workflow-create.md +0 -83
- package/packages/@monomind/cli/.claude/commands/workflows/workflow-execute.md +0 -101
- package/packages/@monomind/cli/.claude/commands/workflows/workflow-export.md +0 -88
- package/packages/@monomind/cli/.claude/helpers/build-skill-registry.cjs +0 -323
- package/packages/@monomind/cli/.claude/helpers/control-start.cjs +0 -327
- package/packages/@monomind/cli/.claude/helpers/control-stop.cjs +0 -95
- package/packages/@monomind/cli/.claude/helpers/event-logger.cjs +0 -266
- package/packages/@monomind/cli/.claude/helpers/graphify-freshen.cjs +0 -148
- package/packages/@monomind/cli/.claude/helpers/handlers/adr-draft-handler.cjs +0 -78
- package/packages/@monomind/cli/.claude/helpers/handlers/agent-start-handler.cjs +0 -132
- package/packages/@monomind/cli/.claude/helpers/handlers/budget-status-handler.cjs +0 -14
- package/packages/@monomind/cli/.claude/helpers/handlers/capture-handler.cjs +0 -736
- package/packages/@monomind/cli/.claude/helpers/handlers/compact-handler.cjs +0 -35
- package/packages/@monomind/cli/.claude/helpers/handlers/edit-handler.cjs +0 -178
- package/packages/@monomind/cli/.claude/helpers/handlers/gates-handler.cjs +0 -494
- package/packages/@monomind/cli/.claude/helpers/handlers/graph-status-handler.cjs +0 -45
- package/packages/@monomind/cli/.claude/helpers/handlers/loops-status-handler.cjs +0 -48
- package/packages/@monomind/cli/.claude/helpers/handlers/route-handler.cjs +0 -770
- package/packages/@monomind/cli/.claude/helpers/handlers/session-handler.cjs +0 -286
- package/packages/@monomind/cli/.claude/helpers/handlers/session-restore-handler.cjs +0 -573
- package/packages/@monomind/cli/.claude/helpers/handlers/stats-handler.cjs +0 -14
- package/packages/@monomind/cli/.claude/helpers/handlers/task-handler.cjs +0 -241
- package/packages/@monomind/cli/.claude/helpers/hook-handler.cjs +0 -951
- package/packages/@monomind/cli/.claude/helpers/intelligence.cjs +0 -510
- package/packages/@monomind/cli/.claude/helpers/learning-service.mjs +0 -61
- package/packages/@monomind/cli/.claude/helpers/loop-tracker.cjs +0 -119
- package/packages/@monomind/cli/.claude/helpers/mastermind-activate.cjs +0 -35
- package/packages/@monomind/cli/.claude/helpers/memory-palace.cjs +0 -461
- package/packages/@monomind/cli/.claude/helpers/memory.cjs +0 -193
- package/packages/@monomind/cli/.claude/helpers/metrics-db.mjs +0 -87
- package/packages/@monomind/cli/.claude/helpers/monolean-activate.cjs +0 -30
- package/packages/@monomind/cli/.claude/helpers/monolean-config.cjs +0 -76
- package/packages/@monomind/cli/.claude/helpers/monolean-instructions.cjs +0 -109
- package/packages/@monomind/cli/.claude/helpers/monolean-propagate.cjs +0 -13
- package/packages/@monomind/cli/.claude/helpers/monolean-tracker.cjs +0 -18
- package/packages/@monomind/cli/.claude/helpers/router.cjs +0 -571
- package/packages/@monomind/cli/.claude/helpers/session.cjs +0 -145
- package/packages/@monomind/cli/.claude/helpers/skill-registry.json +0 -4948
- package/packages/@monomind/cli/.claude/helpers/statusline.cjs +0 -1368
- package/packages/@monomind/cli/.claude/helpers/toggle-statusline.cjs +0 -73
- package/packages/@monomind/cli/.claude/helpers/token-tracker.cjs +0 -1034
- package/packages/@monomind/cli/.claude/helpers/utils/agent-registrations.cjs +0 -41
- package/packages/@monomind/cli/.claude/helpers/utils/fs-helpers.cjs +0 -183
- package/packages/@monomind/cli/.claude/helpers/utils/micro-agents.cjs +0 -358
- package/packages/@monomind/cli/.claude/helpers/utils/monograph.cjs +0 -692
- package/packages/@monomind/cli/.claude/helpers/utils/system-pressure.cjs +0 -46
- package/packages/@monomind/cli/.claude/helpers/utils/telemetry.cjs +0 -162
- package/packages/@monomind/cli/.claude/settings.json +0 -448
- package/packages/@monomind/cli/.claude/skills/agent-browser-testing/SKILL.md +0 -964
- package/packages/@monomind/cli/.claude/skills/agentic-jujutsu/SKILL.md +0 -645
- package/packages/@monomind/cli/.claude/skills/github-issue-triage/SKILL.md +0 -354
- package/packages/@monomind/cli/.claude/skills/github-repo-recap/SKILL.md +0 -207
- package/packages/@monomind/cli/.claude/skills/hive-mind-advanced/SKILL.md +0 -694
- package/packages/@monomind/cli/.claude/skills/hooks-automation/SKILL.md +0 -1192
- package/packages/@monomind/cli/.claude/skills/mastermind-access/SKILL.md +0 -236
- package/packages/@monomind/cli/.claude/skills/mastermind-activity/SKILL.md +0 -191
- package/packages/@monomind/cli/.claude/skills/mastermind-adapter-manager/SKILL.md +0 -259
- package/packages/@monomind/cli/.claude/skills/mastermind-adapters/SKILL.md +0 -204
- package/packages/@monomind/cli/.claude/skills/mastermind-agent-detail/SKILL.md +0 -242
- package/packages/@monomind/cli/.claude/skills/mastermind-agent-select/SKILL.md +0 -132
- package/packages/@monomind/cli/.claude/skills/mastermind-agents/SKILL.md +0 -182
- package/packages/@monomind/cli/.claude/skills/mastermind-approval-detail/SKILL.md +0 -259
- package/packages/@monomind/cli/.claude/skills/mastermind-approvev1/SKILL.md +0 -191
- package/packages/@monomind/cli/.claude/skills/mastermind-architect/SKILL.md +0 -862
- package/packages/@monomind/cli/.claude/skills/mastermind-autodev/SKILL.md +0 -360
- package/packages/@monomind/cli/.claude/skills/mastermind-backup/SKILL.md +0 -197
- package/packages/@monomind/cli/.claude/skills/mastermind-bootstrap/SKILL.md +0 -190
- package/packages/@monomind/cli/.claude/skills/mastermind-budgets/SKILL.md +0 -237
- package/packages/@monomind/cli/.claude/skills/mastermind-build/SKILL.md +0 -169
- package/packages/@monomind/cli/.claude/skills/mastermind-companies/SKILL.md +0 -256
- package/packages/@monomind/cli/.claude/skills/mastermind-content/SKILL.md +0 -197
- package/packages/@monomind/cli/.claude/skills/mastermind-costs/SKILL.md +0 -151
- package/packages/@monomind/cli/.claude/skills/mastermind-createorg/SKILL.md +0 -247
- package/packages/@monomind/cli/.claude/skills/mastermind-debug/SKILL.md +0 -277
- package/packages/@monomind/cli/.claude/skills/mastermind-delegation/SKILL.md +0 -83
- package/packages/@monomind/cli/.claude/skills/mastermind-design/SKILL.md +0 -190
- package/packages/@monomind/cli/.claude/skills/mastermind-diagnose/SKILL.md +0 -249
- package/packages/@monomind/cli/.claude/skills/mastermind-env/SKILL.md +0 -203
- package/packages/@monomind/cli/.claude/skills/mastermind-environments/SKILL.md +0 -250
- package/packages/@monomind/cli/.claude/skills/mastermind-execute/SKILL.md +0 -104
- package/packages/@monomind/cli/.claude/skills/mastermind-export/SKILL.md +0 -333
- package/packages/@monomind/cli/.claude/skills/mastermind-finance/SKILL.md +0 -166
- package/packages/@monomind/cli/.claude/skills/mastermind-finish/SKILL.md +0 -251
- package/packages/@monomind/cli/.claude/skills/mastermind-goal-detail/SKILL.md +0 -255
- package/packages/@monomind/cli/.claude/skills/mastermind-goals/SKILL.md +0 -149
- package/packages/@monomind/cli/.claude/skills/mastermind-heartbeatv1/SKILL.md +0 -167
- package/packages/@monomind/cli/.claude/skills/mastermind-idea/SKILL.md +0 -1142
- package/packages/@monomind/cli/.claude/skills/mastermind-import/SKILL.md +0 -281
- package/packages/@monomind/cli/.claude/skills/mastermind-inbox/SKILL.md +0 -226
- package/packages/@monomind/cli/.claude/skills/mastermind-instance/SKILL.md +0 -235
- package/packages/@monomind/cli/.claude/skills/mastermind-instance-settings/SKILL.md +0 -315
- package/packages/@monomind/cli/.claude/skills/mastermind-intake/SKILL.md +0 -83
- package/packages/@monomind/cli/.claude/skills/mastermind-invite-landing/SKILL.md +0 -227
- package/packages/@monomind/cli/.claude/skills/mastermind-invites/SKILL.md +0 -254
- package/packages/@monomind/cli/.claude/skills/mastermind-issue-detail/SKILL.md +0 -291
- package/packages/@monomind/cli/.claude/skills/mastermind-issues/SKILL.md +0 -235
- package/packages/@monomind/cli/.claude/skills/mastermind-join-queue/SKILL.md +0 -170
- package/packages/@monomind/cli/.claude/skills/mastermind-liveness/SKILL.md +0 -392
- package/packages/@monomind/cli/.claude/skills/mastermind-marketing/SKILL.md +0 -228
- package/packages/@monomind/cli/.claude/skills/mastermind-marketing/references/copywriting-frameworks.md +0 -181
- package/packages/@monomind/cli/.claude/skills/mastermind-marketing/references/persuasion-psychology.md +0 -158
- package/packages/@monomind/cli/.claude/skills/mastermind-memory/SKILL.md +0 -321
- package/packages/@monomind/cli/.claude/skills/mastermind-monitor/SKILL.md +0 -1284
- package/packages/@monomind/cli/.claude/skills/mastermind-monotask/SKILL.md +0 -350
- package/packages/@monomind/cli/.claude/skills/mastermind-my-issues/SKILL.md +0 -146
- package/packages/@monomind/cli/.claude/skills/mastermind-new-agent/SKILL.md +0 -241
- package/packages/@monomind/cli/.claude/skills/mastermind-ops/SKILL.md +0 -168
- package/packages/@monomind/cli/.claude/skills/mastermind-org-chart/SKILL.md +0 -209
- package/packages/@monomind/cli/.claude/skills/mastermind-org-settings/SKILL.md +0 -274
- package/packages/@monomind/cli/.claude/skills/mastermind-orgs/SKILL.md +0 -120
- package/packages/@monomind/cli/.claude/skills/mastermind-orgstatus/SKILL.md +0 -254
- package/packages/@monomind/cli/.claude/skills/mastermind-plan/SKILL.md +0 -217
- package/packages/@monomind/cli/.claude/skills/mastermind-plan-to-tasks/SKILL.md +0 -136
- package/packages/@monomind/cli/.claude/skills/mastermind-plugin-manager/SKILL.md +0 -241
- package/packages/@monomind/cli/.claude/skills/mastermind-plugin-settings/SKILL.md +0 -273
- package/packages/@monomind/cli/.claude/skills/mastermind-plugins/SKILL.md +0 -190
- package/packages/@monomind/cli/.claude/skills/mastermind-profile/SKILL.md +0 -187
- package/packages/@monomind/cli/.claude/skills/mastermind-project-detail/SKILL.md +0 -249
- package/packages/@monomind/cli/.claude/skills/mastermind-project-workspace/SKILL.md +0 -244
- package/packages/@monomind/cli/.claude/skills/mastermind-projects/SKILL.md +0 -167
- package/packages/@monomind/cli/.claude/skills/mastermind-protocol/SKILL.md +0 -404
- package/packages/@monomind/cli/.claude/skills/mastermind-receive-review/SKILL.md +0 -213
- package/packages/@monomind/cli/.claude/skills/mastermind-release/SKILL.md +0 -168
- package/packages/@monomind/cli/.claude/skills/mastermind-repeat/SKILL.md +0 -171
- package/packages/@monomind/cli/.claude/skills/mastermind-research/SKILL.md +0 -168
- package/packages/@monomind/cli/.claude/skills/mastermind-review/SKILL.md +0 -233
- package/packages/@monomind/cli/.claude/skills/mastermind-routine-detail/SKILL.md +0 -253
- package/packages/@monomind/cli/.claude/skills/mastermind-routines/SKILL.md +0 -203
- package/packages/@monomind/cli/.claude/skills/mastermind-runorg/SKILL.md +0 -43
- package/packages/@monomind/cli/.claude/skills/mastermind-runorgv1/SKILL.md +0 -731
- package/packages/@monomind/cli/.claude/skills/mastermind-sales/SKILL.md +0 -170
- package/packages/@monomind/cli/.claude/skills/mastermind-search/SKILL.md +0 -186
- package/packages/@monomind/cli/.claude/skills/mastermind-secrets/SKILL.md +0 -199
- package/packages/@monomind/cli/.claude/skills/mastermind-skill-builder/SKILL.md +0 -447
- package/packages/@monomind/cli/.claude/skills/mastermind-skills/SKILL.md +0 -156
- package/packages/@monomind/cli/.claude/skills/mastermind-stoporg/SKILL.md +0 -147
- package/packages/@monomind/cli/.claude/skills/mastermind-taskdev/SKILL.md +0 -377
- package/packages/@monomind/cli/.claude/skills/mastermind-taskdev/code-quality-reviewer-prompt.md +0 -60
- package/packages/@monomind/cli/.claude/skills/mastermind-taskdev/final-reviewer-prompt.md +0 -144
- package/packages/@monomind/cli/.claude/skills/mastermind-taskdev/implementer-prompt.md +0 -114
- package/packages/@monomind/cli/.claude/skills/mastermind-taskdev/spec-reviewer-prompt.md +0 -80
- package/packages/@monomind/cli/.claude/skills/mastermind-tasks/SKILL.md +0 -152
- package/packages/@monomind/cli/.claude/skills/mastermind-tdd/SKILL.md +0 -424
- package/packages/@monomind/cli/.claude/skills/mastermind-techport/SKILL.md +0 -777
- package/packages/@monomind/cli/.claude/skills/mastermind-threads/SKILL.md +0 -259
- package/packages/@monomind/cli/.claude/skills/mastermind-tree-control/SKILL.md +0 -250
- package/packages/@monomind/cli/.claude/skills/mastermind-verify/SKILL.md +0 -196
- package/packages/@monomind/cli/.claude/skills/mastermind-wiki/SKILL.md +0 -314
- package/packages/@monomind/cli/.claude/skills/mastermind-workspace-detail/SKILL.md +0 -317
- package/packages/@monomind/cli/.claude/skills/mastermind-workspaces/SKILL.md +0 -261
- package/packages/@monomind/cli/.claude/skills/mastermind-worktree/SKILL.md +0 -215
- package/packages/@monomind/cli/.claude/skills/monolean/SKILL.md +0 -118
- package/packages/@monomind/cli/.claude/skills/monolean-audit/SKILL.md +0 -41
- package/packages/@monomind/cli/.claude/skills/monolean-debt/SKILL.md +0 -46
- package/packages/@monomind/cli/.claude/skills/monolean-help/SKILL.md +0 -60
- package/packages/@monomind/cli/.claude/skills/monolean-review/SKILL.md +0 -57
- package/packages/@monomind/cli/.claude/skills/monomind/browse-agentcore.md +0 -115
- package/packages/@monomind/cli/.claude/skills/monomind/browse-electron.md +0 -188
- package/packages/@monomind/cli/.claude/skills/monomind/browse-qa.md +0 -228
- package/packages/@monomind/cli/.claude/skills/monomind/browse-references/authentication.md +0 -161
- package/packages/@monomind/cli/.claude/skills/monomind/browse-references/trust-boundaries.md +0 -40
- package/packages/@monomind/cli/.claude/skills/monomind/browse-references/video-recording.md +0 -83
- package/packages/@monomind/cli/.claude/skills/monomind/browse-slack.md +0 -188
- package/packages/@monomind/cli/.claude/skills/monomind/browse-vercel.md +0 -239
- package/packages/@monomind/cli/.claude/skills/monomind/browse.md +0 -724
- package/packages/@monomind/cli/.claude/skills/monomotion/SKILL.md +0 -145
- package/packages/@monomind/cli/.claude/skills/monomotion/rules/api-control.md +0 -139
- package/packages/@monomind/cli/.claude/skills/monomotion/rules/effects.md +0 -109
- package/packages/@monomind/cli/.claude/skills/monomotion/rules/integration.md +0 -140
- package/packages/@monomind/cli/.claude/skills/monomotion/rules/scroll.md +0 -131
- package/packages/@monomind/cli/.claude/skills/monomotion/rules/sequencing.md +0 -105
- package/packages/@monomind/cli/.claude/skills/monomotion/rules/svg.md +0 -101
- package/packages/@monomind/cli/.claude/skills/monomotion/rules/text.md +0 -119
- package/packages/@monomind/cli/.claude/skills/pair-programming/SKILL.md +0 -1202
- package/packages/@monomind/cli/.claude/skills/performance-analysis/SKILL.md +0 -560
- package/packages/@monomind/cli/.claude/skills/skill-builder/SKILL.md +0 -910
- package/packages/@monomind/cli/.claude/skills/specialagent/SKILL.md +0 -206
- package/packages/@monomind/cli/.claude/skills/stop-slop/SKILL.md +0 -67
- package/packages/@monomind/cli/.claude/skills/stop-slop/references/examples.md +0 -61
- package/packages/@monomind/cli/.claude/skills/stop-slop/references/phrases.md +0 -130
- package/packages/@monomind/cli/.claude/skills/stop-slop/references/structures.md +0 -136
- package/packages/@monomind/cli/.claude/skills/swarm-advanced/SKILL.md +0 -936
- package/packages/@monomind/cli/.claude/skills/swarm-orchestration/SKILL.md +0 -179
- package/packages/@monomind/cli/.claude/skills/verification-quality/SKILL.md +0 -674
- package/packages/@monomind/cli/README.md +0 -414
- package/packages/@monomind/cli/bin/cli.js +0 -379
- package/packages/@monomind/cli/bin/mcp-server.js +0 -208
- package/packages/@monomind/cli/bin/preinstall.cjs +0 -2
- package/packages/@monomind/cli/dist/src/agents/registry-builder.d.ts +0 -64
- package/packages/@monomind/cli/dist/src/agents/registry-builder.js +0 -228
- package/packages/@monomind/cli/dist/src/autopilot-state.d.ts +0 -77
- package/packages/@monomind/cli/dist/src/autopilot-state.js +0 -336
- package/packages/@monomind/cli/dist/src/browser/action-builder/analyzer.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/browser/action-builder/analyzer.js +0 -64
- package/packages/@monomind/cli/dist/src/browser/action-builder/types.d.ts +0 -47
- package/packages/@monomind/cli/dist/src/browser/action-builder/types.js +0 -2
- package/packages/@monomind/cli/dist/src/browser/adapters/gemini.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/browser/adapters/gemini.js +0 -16
- package/packages/@monomind/cli/dist/src/browser/adapters/index.d.ts +0 -19
- package/packages/@monomind/cli/dist/src/browser/adapters/index.js +0 -23
- package/packages/@monomind/cli/dist/src/browser/adapters/instagram.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/browser/adapters/instagram.js +0 -17
- package/packages/@monomind/cli/dist/src/browser/adapters/linkedin.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/browser/adapters/linkedin.js +0 -19
- package/packages/@monomind/cli/dist/src/browser/adapters/x.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/browser/adapters/x.js +0 -19
- package/packages/@monomind/cli/dist/src/browser/dashboard/server.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/browser/dashboard/server.js +0 -215
- package/packages/@monomind/cli/dist/src/browser/dashboard/ui.html +0 -261
- package/packages/@monomind/cli/dist/src/browser/workflow/engine.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/browser/workflow/engine.js +0 -127
- package/packages/@monomind/cli/dist/src/browser/workflow/expression.d.ts +0 -4
- package/packages/@monomind/cli/dist/src/browser/workflow/expression.js +0 -64
- package/packages/@monomind/cli/dist/src/browser/workflow/store.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/browser/workflow/store.js +0 -145
- package/packages/@monomind/cli/dist/src/browser/workflow/types.d.ts +0 -48
- package/packages/@monomind/cli/dist/src/browser/workflow/types.js +0 -2
- package/packages/@monomind/cli/dist/src/capabilities/cap-code.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/capabilities/cap-code.js +0 -20
- package/packages/@monomind/cli/dist/src/capabilities/cap-data.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/capabilities/cap-data.js +0 -165
- package/packages/@monomind/cli/dist/src/capabilities/cap-documents.d.ts +0 -5
- package/packages/@monomind/cli/dist/src/capabilities/cap-documents.js +0 -139
- package/packages/@monomind/cli/dist/src/capabilities/cap-graph.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/capabilities/cap-graph.js +0 -84
- package/packages/@monomind/cli/dist/src/capabilities/cap-media.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/capabilities/cap-media.js +0 -147
- package/packages/@monomind/cli/dist/src/capabilities/cap-timeline.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/capabilities/cap-timeline.js +0 -90
- package/packages/@monomind/cli/dist/src/capabilities/index.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/capabilities/index.js +0 -18
- package/packages/@monomind/cli/dist/src/capabilities/manager.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/capabilities/manager.js +0 -79
- package/packages/@monomind/cli/dist/src/capabilities/scanner.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/capabilities/scanner.js +0 -125
- package/packages/@monomind/cli/dist/src/capabilities/types.d.ts +0 -64
- package/packages/@monomind/cli/dist/src/capabilities/types.js +0 -2
- package/packages/@monomind/cli/dist/src/commands/agent-lifecycle.d.ts +0 -17
- package/packages/@monomind/cli/dist/src/commands/agent-lifecycle.js +0 -346
- package/packages/@monomind/cli/dist/src/commands/agent-ops.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/agent-ops.js +0 -277
- package/packages/@monomind/cli/dist/src/commands/agent.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/agent.js +0 -40
- package/packages/@monomind/cli/dist/src/commands/analyze-ast.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/commands/analyze-ast.js +0 -284
- package/packages/@monomind/cli/dist/src/commands/analyze-diff.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/analyze-diff.js +0 -395
- package/packages/@monomind/cli/dist/src/commands/analyze-imports.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/analyze-imports.js +0 -287
- package/packages/@monomind/cli/dist/src/commands/analyze-symbols.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/commands/analyze-symbols.js +0 -302
- package/packages/@monomind/cli/dist/src/commands/analyze.d.ts +0 -53
- package/packages/@monomind/cli/dist/src/commands/analyze.js +0 -217
- package/packages/@monomind/cli/dist/src/commands/autopilot.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/commands/autopilot.js +0 -370
- package/packages/@monomind/cli/dist/src/commands/browse-action.d.ts +0 -4
- package/packages/@monomind/cli/dist/src/commands/browse-action.js +0 -244
- package/packages/@monomind/cli/dist/src/commands/browse-platform.d.ts +0 -4
- package/packages/@monomind/cli/dist/src/commands/browse-platform.js +0 -117
- package/packages/@monomind/cli/dist/src/commands/browse-workflow.d.ts +0 -4
- package/packages/@monomind/cli/dist/src/commands/browse-workflow.js +0 -183
- package/packages/@monomind/cli/dist/src/commands/browse.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/commands/browse.js +0 -17
- package/packages/@monomind/cli/dist/src/commands/cleanup.d.ts +0 -45
- package/packages/@monomind/cli/dist/src/commands/cleanup.js +0 -581
- package/packages/@monomind/cli/dist/src/commands/completions.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/completions.js +0 -261
- package/packages/@monomind/cli/dist/src/commands/config.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/config.js +0 -462
- package/packages/@monomind/cli/dist/src/commands/crash-reporting.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/crash-reporting.js +0 -50
- package/packages/@monomind/cli/dist/src/commands/design-detect.d.ts +0 -27
- package/packages/@monomind/cli/dist/src/commands/design-detect.js +0 -220
- package/packages/@monomind/cli/dist/src/commands/design-palette.d.ts +0 -21
- package/packages/@monomind/cli/dist/src/commands/design-palette.js +0 -538
- package/packages/@monomind/cli/dist/src/commands/doc.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/commands/doc.js +0 -268
- package/packages/@monomind/cli/dist/src/commands/doctor-env-checks.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/commands/doctor-env-checks.js +0 -194
- package/packages/@monomind/cli/dist/src/commands/doctor-monoes-checks.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/commands/doctor-monoes-checks.js +0 -160
- package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.d.ts +0 -46
- package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.js +0 -764
- package/packages/@monomind/cli/dist/src/commands/doctor.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/doctor.js +0 -232
- package/packages/@monomind/cli/dist/src/commands/guidance.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/commands/guidance.js +0 -163
- package/packages/@monomind/cli/dist/src/commands/hooks-core-commands.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/hooks-core-commands.js +0 -377
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.js +0 -417
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.js +0 -219
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-routing.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-routing.js +0 -399
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-utils.d.ts +0 -42
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-utils.js +0 -220
- package/packages/@monomind/cli/dist/src/commands/hooks-extended-commands.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/hooks-extended-commands.js +0 -243
- package/packages/@monomind/cli/dist/src/commands/hooks-formatting.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/commands/hooks-formatting.js +0 -25
- package/packages/@monomind/cli/dist/src/commands/hooks-routing-commands.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/commands/hooks-routing-commands.js +0 -725
- package/packages/@monomind/cli/dist/src/commands/hooks-workers.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/commands/hooks-workers.js +0 -547
- package/packages/@monomind/cli/dist/src/commands/hooks.d.ts +0 -16
- package/packages/@monomind/cli/dist/src/commands/hooks.js +0 -497
- package/packages/@monomind/cli/dist/src/commands/index.d.ts +0 -65
- package/packages/@monomind/cli/dist/src/commands/index.js +0 -236
- package/packages/@monomind/cli/dist/src/commands/init-subcommands.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/init-subcommands.js +0 -156
- package/packages/@monomind/cli/dist/src/commands/init-upgrade.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/commands/init-upgrade.js +0 -203
- package/packages/@monomind/cli/dist/src/commands/init-wizard.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/commands/init-wizard.js +0 -244
- package/packages/@monomind/cli/dist/src/commands/init.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/init.js +0 -411
- package/packages/@monomind/cli/dist/src/commands/mcp.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/mcp.js +0 -747
- package/packages/@monomind/cli/dist/src/commands/memory-admin.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/commands/memory-admin.js +0 -345
- package/packages/@monomind/cli/dist/src/commands/memory-crud.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/commands/memory-crud.js +0 -389
- package/packages/@monomind/cli/dist/src/commands/memory-list.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/memory-list.js +0 -321
- package/packages/@monomind/cli/dist/src/commands/memory-transfer.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/memory-transfer.js +0 -199
- package/packages/@monomind/cli/dist/src/commands/memory.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/commands/memory.js +0 -282
- package/packages/@monomind/cli/dist/src/commands/monograph.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/monograph.js +0 -548
- package/packages/@monomind/cli/dist/src/commands/neural-core.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/neural-core.js +0 -413
- package/packages/@monomind/cli/dist/src/commands/neural-optimize.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/commands/neural-optimize.js +0 -330
- package/packages/@monomind/cli/dist/src/commands/neural-registry.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/commands/neural-registry.js +0 -290
- package/packages/@monomind/cli/dist/src/commands/org-observe.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/commands/org-observe.js +0 -353
- package/packages/@monomind/cli/dist/src/commands/org.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/commands/org.js +0 -860
- package/packages/@monomind/cli/dist/src/commands/performance.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/performance.js +0 -656
- package/packages/@monomind/cli/dist/src/commands/platforms.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/platforms.js +0 -600
- package/packages/@monomind/cli/dist/src/commands/providers.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/providers.js +0 -351
- package/packages/@monomind/cli/dist/src/commands/report-crash.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/report-crash.js +0 -66
- package/packages/@monomind/cli/dist/src/commands/route.d.ts +0 -16
- package/packages/@monomind/cli/dist/src/commands/route.js +0 -944
- package/packages/@monomind/cli/dist/src/commands/search-universal.d.ts +0 -19
- package/packages/@monomind/cli/dist/src/commands/search-universal.js +0 -151
- package/packages/@monomind/cli/dist/src/commands/security-cve.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/commands/security-cve.js +0 -308
- package/packages/@monomind/cli/dist/src/commands/security-misc.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/security-misc.js +0 -336
- package/packages/@monomind/cli/dist/src/commands/security-scan.d.ts +0 -47
- package/packages/@monomind/cli/dist/src/commands/security-scan.js +0 -447
- package/packages/@monomind/cli/dist/src/commands/security.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/security.js +0 -41
- package/packages/@monomind/cli/dist/src/commands/session.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/session.js +0 -660
- package/packages/@monomind/cli/dist/src/commands/start.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/start.js +0 -490
- package/packages/@monomind/cli/dist/src/commands/status.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/status.js +0 -642
- package/packages/@monomind/cli/dist/src/commands/swarm.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/swarm.js +0 -906
- package/packages/@monomind/cli/dist/src/commands/task.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/task.js +0 -639
- package/packages/@monomind/cli/dist/src/commands/tokens.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/tokens.js +0 -206
- package/packages/@monomind/cli/dist/src/commands/update.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/update.js +0 -288
- package/packages/@monomind/cli/dist/src/consensus/audit-writer.d.ts +0 -77
- package/packages/@monomind/cli/dist/src/consensus/audit-writer.js +0 -196
- package/packages/@monomind/cli/dist/src/consensus/tally.d.ts +0 -19
- package/packages/@monomind/cli/dist/src/consensus/tally.js +0 -34
- package/packages/@monomind/cli/dist/src/index.d.ts +0 -81
- package/packages/@monomind/cli/dist/src/index.js +0 -574
- package/packages/@monomind/cli/dist/src/init/claudemd-generator.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/init/claudemd-generator.js +0 -624
- package/packages/@monomind/cli/dist/src/init/executor.d.ts +0 -47
- package/packages/@monomind/cli/dist/src/init/executor.js +0 -2387
- package/packages/@monomind/cli/dist/src/init/helpers-generator.d.ts +0 -73
- package/packages/@monomind/cli/dist/src/init/helpers-generator.js +0 -1335
- package/packages/@monomind/cli/dist/src/init/index.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/init/index.js +0 -15
- package/packages/@monomind/cli/dist/src/init/mcp-generator.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/init/mcp-generator.js +0 -107
- package/packages/@monomind/cli/dist/src/init/settings-generator.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/init/settings-generator.js +0 -487
- package/packages/@monomind/cli/dist/src/init/shared-instructions-generator.d.ts +0 -38
- package/packages/@monomind/cli/dist/src/init/shared-instructions-generator.js +0 -602
- package/packages/@monomind/cli/dist/src/init/statusline-generator.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/init/statusline-generator.js +0 -1358
- package/packages/@monomind/cli/dist/src/init/types.d.ts +0 -308
- package/packages/@monomind/cli/dist/src/init/types.js +0 -247
- package/packages/@monomind/cli/dist/src/knowledge/document-pipeline.d.ts +0 -75
- package/packages/@monomind/cli/dist/src/knowledge/document-pipeline.js +0 -556
- package/packages/@monomind/cli/dist/src/mcp-client.d.ts +0 -64
- package/packages/@monomind/cli/dist/src/mcp-client.js +0 -338
- package/packages/@monomind/cli/dist/src/mcp-server.d.ts +0 -170
- package/packages/@monomind/cli/dist/src/mcp-server.js +0 -964
- package/packages/@monomind/cli/dist/src/mcp-tools/agent-tools.d.ts +0 -30
- package/packages/@monomind/cli/dist/src/mcp-tools/agent-tools.js +0 -603
- package/packages/@monomind/cli/dist/src/mcp-tools/analyze-tools.d.ts +0 -38
- package/packages/@monomind/cli/dist/src/mcp-tools/analyze-tools.js +0 -389
- package/packages/@monomind/cli/dist/src/mcp-tools/auto-install.d.ts +0 -75
- package/packages/@monomind/cli/dist/src/mcp-tools/auto-install.js +0 -125
- package/packages/@monomind/cli/dist/src/mcp-tools/autopilot-tools.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/mcp-tools/autopilot-tools.js +0 -237
- package/packages/@monomind/cli/dist/src/mcp-tools/browser-tools.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/mcp-tools/browser-tools.js +0 -1111
- package/packages/@monomind/cli/dist/src/mcp-tools/claims-tools.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/mcp-tools/claims-tools.js +0 -827
- package/packages/@monomind/cli/dist/src/mcp-tools/config-tools.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/mcp-tools/config-tools.js +0 -447
- package/packages/@monomind/cli/dist/src/mcp-tools/embeddings-tools.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/mcp-tools/embeddings-tools.js +0 -866
- package/packages/@monomind/cli/dist/src/mcp-tools/github-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/github-tools.js +0 -582
- package/packages/@monomind/cli/dist/src/mcp-tools/graphify-tools.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/mcp-tools/graphify-tools.js +0 -58
- package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.js +0 -634
- package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.d.ts +0 -17
- package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.js +0 -1237
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-embedding.d.ts +0 -161
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-embedding.js +0 -516
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-intelligence.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-intelligence.js +0 -888
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-routing.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-routing.js +0 -1582
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.js +0 -51
- package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +0 -31
- package/packages/@monomind/cli/dist/src/mcp-tools/index.js +0 -31
- package/packages/@monomind/cli/dist/src/mcp-tools/knowledge-tools.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/mcp-tools/knowledge-tools.js +0 -156
- package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.d.ts +0 -35
- package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.js +0 -776
- package/packages/@monomind/cli/dist/src/mcp-tools/monograph-compat.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/mcp-tools/monograph-compat.js +0 -136
- package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.d.ts +0 -27
- package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +0 -2443
- package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.js +0 -506
- package/packages/@monomind/cli/dist/src/mcp-tools/performance-tools.d.ts +0 -16
- package/packages/@monomind/cli/dist/src/mcp-tools/performance-tools.js +0 -680
- package/packages/@monomind/cli/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.d.ts +0 -261
- package/packages/@monomind/cli/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js +0 -423
- package/packages/@monomind/cli/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts +0 -137
- package/packages/@monomind/cli/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js +0 -383
- package/packages/@monomind/cli/dist/src/mcp-tools/quality-tools.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/mcp-tools/quality-tools.js +0 -58
- package/packages/@monomind/cli/dist/src/mcp-tools/request-tracker.d.ts +0 -17
- package/packages/@monomind/cli/dist/src/mcp-tools/request-tracker.js +0 -44
- package/packages/@monomind/cli/dist/src/mcp-tools/security-tools.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/mcp-tools/security-tools.js +0 -576
- package/packages/@monomind/cli/dist/src/mcp-tools/session-tools.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/mcp-tools/session-tools.js +0 -431
- package/packages/@monomind/cli/dist/src/mcp-tools/swarm-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/swarm-tools.js +0 -411
- package/packages/@monomind/cli/dist/src/mcp-tools/system-tools.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/mcp-tools/system-tools.js +0 -561
- package/packages/@monomind/cli/dist/src/mcp-tools/task-tools.d.ts +0 -28
- package/packages/@monomind/cli/dist/src/mcp-tools/task-tools.js +0 -514
- package/packages/@monomind/cli/dist/src/mcp-tools/terminal-tools.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/mcp-tools/terminal-tools.js +0 -397
- package/packages/@monomind/cli/dist/src/mcp-tools/transfer-tools.d.ts +0 -27
- package/packages/@monomind/cli/dist/src/mcp-tools/transfer-tools.js +0 -76
- package/packages/@monomind/cli/dist/src/mcp-tools/types.d.ts +0 -58
- package/packages/@monomind/cli/dist/src/mcp-tools/types.js +0 -98
- package/packages/@monomind/cli/dist/src/memory/embedding-operations.d.ts +0 -58
- package/packages/@monomind/cli/dist/src/memory/embedding-operations.js +0 -262
- package/packages/@monomind/cli/dist/src/memory/ewc-consolidation.d.ts +0 -319
- package/packages/@monomind/cli/dist/src/memory/ewc-consolidation.js +0 -698
- package/packages/@monomind/cli/dist/src/memory/hnsw-operations.d.ts +0 -142
- package/packages/@monomind/cli/dist/src/memory/hnsw-operations.js +0 -465
- package/packages/@monomind/cli/dist/src/memory/intelligence.d.ts +0 -368
- package/packages/@monomind/cli/dist/src/memory/intelligence.js +0 -1456
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.d.ts +0 -333
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +0 -1104
- package/packages/@monomind/cli/dist/src/memory/memory-crud.d.ts +0 -67
- package/packages/@monomind/cli/dist/src/memory/memory-crud.js +0 -454
- package/packages/@monomind/cli/dist/src/memory/memory-initializer.d.ts +0 -101
- package/packages/@monomind/cli/dist/src/memory/memory-initializer.js +0 -431
- package/packages/@monomind/cli/dist/src/memory/memory-kg.d.ts +0 -186
- package/packages/@monomind/cli/dist/src/memory/memory-kg.js +0 -450
- package/packages/@monomind/cli/dist/src/memory/memory-migrations.d.ts +0 -30
- package/packages/@monomind/cli/dist/src/memory/memory-migrations.js +0 -136
- package/packages/@monomind/cli/dist/src/memory/memory-read.d.ts +0 -87
- package/packages/@monomind/cli/dist/src/memory/memory-read.js +0 -333
- package/packages/@monomind/cli/dist/src/memory/memory-schema.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/memory/memory-schema.js +0 -167
- package/packages/@monomind/cli/dist/src/memory/query-router.d.ts +0 -44
- package/packages/@monomind/cli/dist/src/memory/query-router.js +0 -113
- package/packages/@monomind/cli/dist/src/memory/sona-optimizer.d.ts +0 -237
- package/packages/@monomind/cli/dist/src/memory/sona-optimizer.js +0 -647
- package/packages/@monomind/cli/dist/src/monovector/command-outcomes.d.ts +0 -37
- package/packages/@monomind/cli/dist/src/monovector/command-outcomes.js +0 -126
- package/packages/@monomind/cli/dist/src/monovector/coverage-router.d.ts +0 -103
- package/packages/@monomind/cli/dist/src/monovector/coverage-router.js +0 -341
- package/packages/@monomind/cli/dist/src/monovector/coverage-tools.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/monovector/coverage-tools.js +0 -115
- package/packages/@monomind/cli/dist/src/monovector/diff-classifier.d.ts +0 -174
- package/packages/@monomind/cli/dist/src/monovector/diff-classifier.js +0 -738
- package/packages/@monomind/cli/dist/src/monovector/index.d.ts +0 -54
- package/packages/@monomind/cli/dist/src/monovector/index.js +0 -55
- package/packages/@monomind/cli/dist/src/monovector/init-state.d.ts +0 -35
- package/packages/@monomind/cli/dist/src/monovector/init-state.js +0 -36
- package/packages/@monomind/cli/dist/src/monovector/route-outcomes.d.ts +0 -56
- package/packages/@monomind/cli/dist/src/monovector/route-outcomes.js +0 -189
- package/packages/@monomind/cli/dist/src/observability/replay-reader.d.ts +0 -40
- package/packages/@monomind/cli/dist/src/observability/replay-reader.js +0 -138
- package/packages/@monomind/cli/dist/src/orgrt/broker.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/orgrt/broker.js +0 -73
- package/packages/@monomind/cli/dist/src/orgrt/bus.d.ts +0 -27
- package/packages/@monomind/cli/dist/src/orgrt/bus.js +0 -71
- package/packages/@monomind/cli/dist/src/orgrt/daemon.d.ts +0 -175
- package/packages/@monomind/cli/dist/src/orgrt/daemon.js +0 -965
- package/packages/@monomind/cli/dist/src/orgrt/forwarder.d.ts +0 -16
- package/packages/@monomind/cli/dist/src/orgrt/forwarder.js +0 -171
- package/packages/@monomind/cli/dist/src/orgrt/inbox.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/orgrt/inbox.js +0 -91
- package/packages/@monomind/cli/dist/src/orgrt/mailbox.d.ts +0 -49
- package/packages/@monomind/cli/dist/src/orgrt/mailbox.js +0 -75
- package/packages/@monomind/cli/dist/src/orgrt/migrate.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/orgrt/migrate.js +0 -118
- package/packages/@monomind/cli/dist/src/orgrt/policy.d.ts +0 -28
- package/packages/@monomind/cli/dist/src/orgrt/policy.js +0 -146
- package/packages/@monomind/cli/dist/src/orgrt/provider.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/orgrt/provider.js +0 -55
- package/packages/@monomind/cli/dist/src/orgrt/reporting.d.ts +0 -40
- package/packages/@monomind/cli/dist/src/orgrt/reporting.js +0 -134
- package/packages/@monomind/cli/dist/src/orgrt/scheduler.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/orgrt/scheduler.js +0 -48
- package/packages/@monomind/cli/dist/src/orgrt/server.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/orgrt/server.js +0 -88
- package/packages/@monomind/cli/dist/src/orgrt/session.d.ts +0 -62
- package/packages/@monomind/cli/dist/src/orgrt/session.js +0 -157
- package/packages/@monomind/cli/dist/src/orgrt/templates.d.ts +0 -17
- package/packages/@monomind/cli/dist/src/orgrt/templates.js +0 -62
- package/packages/@monomind/cli/dist/src/orgrt/test-loop.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/orgrt/test-loop.js +0 -108
- package/packages/@monomind/cli/dist/src/orgrt/types.d.ts +0 -910
- package/packages/@monomind/cli/dist/src/orgrt/types.js +0 -57
- package/packages/@monomind/cli/dist/src/output.d.ts +0 -133
- package/packages/@monomind/cli/dist/src/output.js +0 -529
- package/packages/@monomind/cli/dist/src/parser.d.ts +0 -93
- package/packages/@monomind/cli/dist/src/parser.js +0 -651
- package/packages/@monomind/cli/dist/src/pricing/model-pricing.d.ts +0 -41
- package/packages/@monomind/cli/dist/src/pricing/model-pricing.js +0 -61
- package/packages/@monomind/cli/dist/src/production/circuit-breaker.d.ts +0 -121
- package/packages/@monomind/cli/dist/src/production/circuit-breaker.js +0 -262
- package/packages/@monomind/cli/dist/src/production/error-handler.d.ts +0 -119
- package/packages/@monomind/cli/dist/src/production/error-handler.js +0 -324
- package/packages/@monomind/cli/dist/src/production/index.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/production/index.js +0 -6
- package/packages/@monomind/cli/dist/src/production/monitoring.d.ts +0 -181
- package/packages/@monomind/cli/dist/src/production/monitoring.js +0 -375
- package/packages/@monomind/cli/dist/src/production/rate-limiter.d.ts +0 -125
- package/packages/@monomind/cli/dist/src/production/rate-limiter.js +0 -218
- package/packages/@monomind/cli/dist/src/production/retry.d.ts +0 -48
- package/packages/@monomind/cli/dist/src/production/retry.js +0 -189
- package/packages/@monomind/cli/dist/src/prompt.d.ts +0 -44
- package/packages/@monomind/cli/dist/src/prompt.js +0 -501
- package/packages/@monomind/cli/dist/src/routing/embed-worker.d.ts +0 -2
- package/packages/@monomind/cli/dist/src/routing/embed-worker.js +0 -79
- package/packages/@monomind/cli/dist/src/routing/embedder.d.ts +0 -31
- package/packages/@monomind/cli/dist/src/routing/embedder.js +0 -0
- package/packages/@monomind/cli/dist/src/routing/llm-caller.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/routing/llm-caller.js +0 -134
- package/packages/@monomind/cli/dist/src/routing/route-layer-factory.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/routing/route-layer-factory.js +0 -239
- package/packages/@monomind/cli/dist/src/services/config-file-manager.d.ts +0 -80
- package/packages/@monomind/cli/dist/src/services/config-file-manager.js +0 -401
- package/packages/@monomind/cli/dist/src/services/crash-reporter.d.ts +0 -42
- package/packages/@monomind/cli/dist/src/services/crash-reporter.js +0 -374
- package/packages/@monomind/cli/dist/src/suggest.d.ts +0 -53
- package/packages/@monomind/cli/dist/src/suggest.js +0 -197
- package/packages/@monomind/cli/dist/src/sync/checker.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/sync/checker.js +0 -26
- package/packages/@monomind/cli/dist/src/transfer/anonymization/index.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/transfer/anonymization/index.js +0 -192
- package/packages/@monomind/cli/dist/src/transfer/types.d.ts +0 -245
- package/packages/@monomind/cli/dist/src/transfer/types.js +0 -6
- package/packages/@monomind/cli/dist/src/types.d.ts +0 -190
- package/packages/@monomind/cli/dist/src/types.js +0 -20
- package/packages/@monomind/cli/dist/src/ui/collector.mjs +0 -879
- package/packages/@monomind/cli/dist/src/ui/dashboard.html +0 -13949
- package/packages/@monomind/cli/dist/src/ui/data/agent-avatars.html +0 -763
- package/packages/@monomind/cli/dist/src/ui/data/agent-avatars.json +0 -966
- package/packages/@monomind/cli/dist/src/ui/data/avatars/account-strategist.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/accounts-payable.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/adaptive-coordinator.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/adaptive-coordinator2.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/ai-citation.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/ai-engineer.svg +0 -61
- package/packages/@monomind/cli/dist/src/ui/data/avatars/analytics-reporter.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/api-tester.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/architecture.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/automation-governance.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/backend-dev.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/benchmarker.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/blockchain-auditor.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/byzantine-coord.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/case-analyst.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/cicd-engineer.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/cloud-architect.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/code-review-swarm.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/coder-v119.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/coder.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/collective-coord.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/compliance-auditor.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/consensus-coordinator.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/content-creator.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/crdt-synchronizer.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/cro-specialist.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/data-consolidator.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/data-engineer.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/database-optimizer.svg +0 -61
- package/packages/@monomind/cli/dist/src/ui/data/avatars/deal-strategist.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/defender.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/devops-automator.svg +0 -56
- package/packages/@monomind/cli/dist/src/ui/data/avatars/discovery-coach.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/email-marketing.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/embedded-firmware.svg +0 -61
- package/packages/@monomind/cli/dist/src/ui/data/avatars/evidence-collector.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/experiment-tracker.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/feedback-synthesizer.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/finance-tracker.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/frontend-developer.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/game-audio-engineer.svg +0 -59
- package/packages/@monomind/cli/dist/src/ui/data/avatars/game-designer.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/gossip-coordinator.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/hierarchical-coord.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/incident-commander.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/infrastructure.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/input-validator.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/ios-developer.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/issue-tracker.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/judge.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/launch-strategist.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/legal-compliance.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/level-designer.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/load-balancer.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/mcp-builder.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/memory-coordinator.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/mesh-coordinator.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/ml-developer.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/mobile-app-builder.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/mobile-dev.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/model-qa.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/narrative-designer.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/outbound-strategist.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/path-validator.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/payment-agent.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/perf-analyzer.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/pipeline-analyst.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/planner.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/pr-manager.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/pricing-strategist.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/product-manager.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/production-validator.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/project-shepherd.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/proposal-strategist.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/prosecutor.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/pseudocode.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/queen-coordinator.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/quorum-manager.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/raft-manager.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/reality-checker.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/recruitment.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/refinement.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/release-manager.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/repo-architect.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/researcher.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/resource-allocator.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/reviewer.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/safe-executor.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/sales-coach.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/sales-engineer.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/scout-explorer.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/security-architect.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/security-auditor.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/senior-developer.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/senior-pm.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/seo-specialist.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/social-media.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/solidity-engineer.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/sparc-coder.svg +0 -58
- package/packages/@monomind/cli/dist/src/ui/data/avatars/sparc-coord.svg +0 -56
- package/packages/@monomind/cli/dist/src/ui/data/avatars/specification.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/sprint-prioritizer.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/sre.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/studio-operations.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/studio-producer.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/support-responder.svg +0 -56
- package/packages/@monomind/cli/dist/src/ui/data/avatars/system-architect.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/task-orchestrator.svg +0 -56
- package/packages/@monomind/cli/dist/src/ui/data/avatars/technical-artist.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/technical-writer.svg +0 -59
- package/packages/@monomind/cli/dist/src/ui/data/avatars/tester.svg +0 -53
- package/packages/@monomind/cli/dist/src/ui/data/avatars/threat-detection.svg +0 -61
- package/packages/@monomind/cli/dist/src/ui/data/avatars/trend-researcher.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/trial-director.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/unity-architect.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/visionos-engineer.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/worker-specialist.svg +0 -55
- package/packages/@monomind/cli/dist/src/ui/data/avatars/workflow-architect.svg +0 -57
- package/packages/@monomind/cli/dist/src/ui/data/avatars/workflow-automation.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/data/avatars/zk-steward.svg +0 -54
- package/packages/@monomind/cli/dist/src/ui/mastermind-diagram-fallback.html +0 -1069
- package/packages/@monomind/cli/dist/src/ui/orgs-files.js +0 -192
- package/packages/@monomind/cli/dist/src/ui/orgs.html +0 -2513
- package/packages/@monomind/cli/dist/src/ui/server.mjs +0 -7256
- package/packages/@monomind/cli/dist/src/ui/sse-manager.mjs +0 -119
- package/packages/@monomind/cli/dist/src/update/checker.d.ts +0 -34
- package/packages/@monomind/cli/dist/src/update/checker.js +0 -278
- package/packages/@monomind/cli/dist/src/update/executor.d.ts +0 -32
- package/packages/@monomind/cli/dist/src/update/executor.js +0 -235
- package/packages/@monomind/cli/dist/src/update/index.d.ts +0 -43
- package/packages/@monomind/cli/dist/src/update/index.js +0 -108
- package/packages/@monomind/cli/dist/src/update/rate-limiter.d.ts +0 -37
- package/packages/@monomind/cli/dist/src/update/rate-limiter.js +0 -190
- package/packages/@monomind/cli/dist/src/update/validator.d.ts +0 -17
- package/packages/@monomind/cli/dist/src/update/validator.js +0 -166
- package/packages/@monomind/cli/dist/src/utils/cosine-similarity.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/utils/cosine-similarity.js +0 -38
- package/packages/@monomind/cli/dist/src/utils/input-guards.d.ts +0 -66
- package/packages/@monomind/cli/dist/src/utils/input-guards.js +0 -263
- package/packages/@monomind/cli/dist/src/utils/json-file.d.ts +0 -33
- package/packages/@monomind/cli/dist/src/utils/json-file.js +0 -57
- package/packages/@monomind/cli/dist/src/utils/parse-jsonl.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/utils/parse-jsonl.js +0 -22
- package/packages/@monomind/cli/dist/src/utils/resource-governor.d.ts +0 -32
- package/packages/@monomind/cli/dist/src/utils/resource-governor.js +0 -115
- package/packages/@monomind/cli/package.json +0 -127
- package/packages/@monomind/cli/scripts/deploy-ipfs-node.sh +0 -153
- package/packages/@monomind/cli/scripts/publish.sh +0 -61
- package/packages/@monomind/cli/scripts/sync-claude-assets.sh +0 -19
- package/packages/@monomind/cli/scripts/understand-analyze.mjs +0 -1078
- package/scripts/build-fs.mjs +0 -75
- package/scripts/build-monovector.sh +0 -10
- package/scripts/generate-agent-avatars.mjs +0 -492
- package/scripts/generate-channel-profile-assets.sh +0 -67
- package/scripts/growth-content-calendar.mjs +0 -260
- package/scripts/growth-profile-kit.mjs +0 -156
- package/scripts/install.sh +0 -392
- package/scripts/publish-monovector.sh +0 -20
- package/scripts/ua-enrich.mjs +0 -229
- package/scripts/ua-import.mjs +0 -288
- package/scripts/verify-appliance.sh +0 -571
|
@@ -1,1582 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hooks Routing MCP Tools
|
|
3
|
-
* MCP tool implementations for pre/post edit/command, route, explain, pretrain,
|
|
4
|
-
* build-agents, transfer, session, list, metrics, pre-task, post-task, intelligence.
|
|
5
|
-
* Extracted from hooks-tools.ts.
|
|
6
|
-
*/
|
|
7
|
-
import { mkdirSync, writeFileSync, renameSync, existsSync, readFileSync } from 'fs';
|
|
8
|
-
import { join, resolve, sep } from 'path';
|
|
9
|
-
import { getProjectCwd } from './types.js';
|
|
10
|
-
import { randomUUID } from 'node:crypto';
|
|
11
|
-
import { recordRoute, joinOutcome, joinLatestUnresolved } from '../monovector/route-outcomes.js';
|
|
12
|
-
import { recordCommand, deriveRecentSuccess } from '../monovector/command-outcomes.js';
|
|
13
|
-
import { extractKeywords, loadRoutingOutcomes, saveRoutingOutcomes, loadMemoryStore, getIntelligenceStatsFromMemory, suggestAgentsForFile, suggestAgentsForTask, suggestAgentsFromIntelligence, assessCommandRisk, activeTrajectories, getMemoryPath, getRouteOutcomesBaseDir, getRoutingOutcomesPath, getRealSearchFunction, getRealStoreFunction, getSONAOptimizer, getFileExtension, TASK_PATTERNS, MEMORY_DIR, MEMORY_FILE, } from './hooks-embedding.js';
|
|
14
|
-
// MCP Tool implementations - return raw data for direct CLI use
|
|
15
|
-
export const hooksPreEdit = {
|
|
16
|
-
name: 'hooks_pre-edit',
|
|
17
|
-
description: 'Get context and agent suggestions before editing a file',
|
|
18
|
-
inputSchema: {
|
|
19
|
-
type: 'object',
|
|
20
|
-
properties: {
|
|
21
|
-
filePath: { type: 'string', description: 'Path to the file being edited' },
|
|
22
|
-
operation: { type: 'string', description: 'Type of operation (create, update, delete, refactor)' },
|
|
23
|
-
context: { type: 'string', description: 'Additional context' },
|
|
24
|
-
},
|
|
25
|
-
required: ['filePath'],
|
|
26
|
-
},
|
|
27
|
-
handler: async (params) => {
|
|
28
|
-
// Cap filePath: passed to suggestAgentsForFile (O(n) regex) and reflected in
|
|
29
|
-
// response. Cap operation to prevent oversized strings in recommendations.
|
|
30
|
-
const MAX_PRE_EDIT_PATH_LEN = 4 * 1024;
|
|
31
|
-
const MAX_PRE_EDIT_OP_LEN = 64;
|
|
32
|
-
const rawFilePath = params.filePath;
|
|
33
|
-
const filePath = typeof rawFilePath === 'string' && rawFilePath.length > MAX_PRE_EDIT_PATH_LEN
|
|
34
|
-
? rawFilePath.slice(0, MAX_PRE_EDIT_PATH_LEN)
|
|
35
|
-
: rawFilePath;
|
|
36
|
-
const rawOperation = params.operation || 'update';
|
|
37
|
-
const operation = typeof rawOperation === 'string' && rawOperation.length > MAX_PRE_EDIT_OP_LEN
|
|
38
|
-
? rawOperation.slice(0, MAX_PRE_EDIT_OP_LEN)
|
|
39
|
-
: rawOperation;
|
|
40
|
-
const suggestedAgents = suggestAgentsForFile(filePath);
|
|
41
|
-
const ext = getFileExtension(filePath);
|
|
42
|
-
return {
|
|
43
|
-
filePath,
|
|
44
|
-
operation,
|
|
45
|
-
context: {
|
|
46
|
-
fileExists: true,
|
|
47
|
-
fileType: ext || 'unknown',
|
|
48
|
-
relatedFiles: [],
|
|
49
|
-
suggestedAgents,
|
|
50
|
-
patterns: [
|
|
51
|
-
{ pattern: `${ext} file editing`, confidence: 0.85 },
|
|
52
|
-
],
|
|
53
|
-
risks: operation === 'delete' ? ['File deletion is irreversible'] : [],
|
|
54
|
-
},
|
|
55
|
-
recommendations: [
|
|
56
|
-
`Recommended agents: ${suggestedAgents.join(', ')}`,
|
|
57
|
-
'Run tests after changes',
|
|
58
|
-
],
|
|
59
|
-
};
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
export const hooksPostEdit = {
|
|
63
|
-
name: 'hooks_post-edit',
|
|
64
|
-
description: 'Record editing outcome for learning',
|
|
65
|
-
inputSchema: {
|
|
66
|
-
type: 'object',
|
|
67
|
-
properties: {
|
|
68
|
-
filePath: { type: 'string', description: 'Path to the edited file' },
|
|
69
|
-
success: { type: 'boolean', description: 'Whether the edit was successful' },
|
|
70
|
-
agent: { type: 'string', description: 'Agent that performed the edit' },
|
|
71
|
-
},
|
|
72
|
-
required: ['filePath'],
|
|
73
|
-
},
|
|
74
|
-
handler: async (params) => {
|
|
75
|
-
// Cap filePath: interpolated into taskId and task text forwarded to
|
|
76
|
-
// bridgeRecordFeedback (which calls generateEmbedding — O(n) hash fallback).
|
|
77
|
-
// Cap agent: stored in feedback record and forwarded to bridge.
|
|
78
|
-
const MAX_POST_EDIT_PATH_LEN = 4 * 1024;
|
|
79
|
-
const MAX_POST_EDIT_AGENT_LEN = 256;
|
|
80
|
-
const rawFilePath = params.filePath;
|
|
81
|
-
const filePath = typeof rawFilePath === 'string' && rawFilePath.length > MAX_POST_EDIT_PATH_LEN
|
|
82
|
-
? rawFilePath.slice(0, MAX_POST_EDIT_PATH_LEN)
|
|
83
|
-
: rawFilePath;
|
|
84
|
-
const success = params.success !== false;
|
|
85
|
-
const rawAgent = params.agent;
|
|
86
|
-
const agent = typeof rawAgent === 'string' && rawAgent.length > MAX_POST_EDIT_AGENT_LEN
|
|
87
|
-
? rawAgent.slice(0, MAX_POST_EDIT_AGENT_LEN)
|
|
88
|
-
: rawAgent;
|
|
89
|
-
// Wire recordFeedback through bridge (issue #1209)
|
|
90
|
-
let feedbackResult = null;
|
|
91
|
-
try {
|
|
92
|
-
const bridge = await import('../memory/memory-bridge.js');
|
|
93
|
-
feedbackResult = await bridge.bridgeRecordFeedback({
|
|
94
|
-
taskType: agent ?? 'coder',
|
|
95
|
-
action: `edit ${filePath}`,
|
|
96
|
-
outcome: success ? 'success' : 'failure',
|
|
97
|
-
confidence: success ? 0.85 : 0.3,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
catch (e) {
|
|
101
|
-
// Bridge not available — continue with basic response
|
|
102
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
103
|
-
console.error('[hooks-post-edit] memory bridge feedback failed:', e);
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
recorded: true,
|
|
107
|
-
filePath,
|
|
108
|
-
success,
|
|
109
|
-
timestamp: new Date().toISOString(),
|
|
110
|
-
learningUpdate: success ? 'pattern_reinforced' : 'pattern_adjusted',
|
|
111
|
-
feedback: feedbackResult ? {
|
|
112
|
-
recorded: feedbackResult.success,
|
|
113
|
-
controller: feedbackResult.success ? 'lancedb' : 'unavailable',
|
|
114
|
-
updates: feedbackResult.success ? 1 : 0,
|
|
115
|
-
} : { recorded: false, controller: 'unavailable', updates: 0 },
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
export const hooksPreCommand = {
|
|
120
|
-
name: 'hooks_pre-command',
|
|
121
|
-
description: 'Assess risk before executing a command',
|
|
122
|
-
inputSchema: {
|
|
123
|
-
type: 'object',
|
|
124
|
-
properties: {
|
|
125
|
-
command: { type: 'string', description: 'Command to execute' },
|
|
126
|
-
},
|
|
127
|
-
required: ['command'],
|
|
128
|
-
},
|
|
129
|
-
handler: async (params) => {
|
|
130
|
-
// Cap command length: assessCommandRisk runs O(n) string searches, and the
|
|
131
|
-
// raw command is reflected verbatim in the response. Limit to 4 KB which
|
|
132
|
-
// is far beyond any realistic shell command.
|
|
133
|
-
const MAX_CMD_LEN = 4 * 1024;
|
|
134
|
-
const rawCommand = params.command;
|
|
135
|
-
const command = typeof rawCommand === 'string' && rawCommand.length > MAX_CMD_LEN
|
|
136
|
-
? rawCommand.slice(0, MAX_CMD_LEN)
|
|
137
|
-
: rawCommand;
|
|
138
|
-
const assessment = assessCommandRisk(command);
|
|
139
|
-
const riskLevel = assessment.level >= 0.8 ? 'critical'
|
|
140
|
-
: assessment.level >= 0.6 ? 'high'
|
|
141
|
-
: assessment.level >= 0.3 ? 'medium'
|
|
142
|
-
: 'low';
|
|
143
|
-
return {
|
|
144
|
-
command,
|
|
145
|
-
riskLevel,
|
|
146
|
-
risks: assessment.warnings.map((warning, i) => ({
|
|
147
|
-
type: `risk-${i + 1}`,
|
|
148
|
-
severity: assessment.level >= 0.6 ? 'high' : 'medium',
|
|
149
|
-
description: warning,
|
|
150
|
-
})),
|
|
151
|
-
recommendations: assessment.warnings.length > 0
|
|
152
|
-
? ['Review warnings before proceeding', 'Consider using safer alternative']
|
|
153
|
-
: ['Command appears safe to execute'],
|
|
154
|
-
safeAlternatives: [],
|
|
155
|
-
shouldProceed: assessment.level < 0.7,
|
|
156
|
-
};
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
export const hooksPostCommand = {
|
|
160
|
-
name: 'hooks_post-command',
|
|
161
|
-
description: 'Record command execution outcome',
|
|
162
|
-
inputSchema: {
|
|
163
|
-
type: 'object',
|
|
164
|
-
properties: {
|
|
165
|
-
command: { type: 'string', description: 'Executed command' },
|
|
166
|
-
exitCode: { type: 'number', description: 'Command exit code' },
|
|
167
|
-
},
|
|
168
|
-
required: ['command'],
|
|
169
|
-
},
|
|
170
|
-
handler: async (params) => {
|
|
171
|
-
// Cap command: it is stored in JSON memory store (line 824), forwarded to
|
|
172
|
-
// bridgeStoreEntry which calls generateEmbedding by default — O(n) hash
|
|
173
|
-
// fallback, and reflected verbatim in the response. The recordCommand path
|
|
174
|
-
// already caps to 200 chars; apply a consistent 4 KB cap here that still
|
|
175
|
-
// covers any realistic shell command.
|
|
176
|
-
const MAX_POST_CMD_LEN = 4 * 1024;
|
|
177
|
-
const rawPostCommand = params.command;
|
|
178
|
-
const command = typeof rawPostCommand === 'string' && rawPostCommand.length > MAX_POST_CMD_LEN
|
|
179
|
-
? rawPostCommand.slice(0, MAX_POST_CMD_LEN)
|
|
180
|
-
: rawPostCommand;
|
|
181
|
-
const exitCode = params.exitCode || 0;
|
|
182
|
-
const success = exitCode === 0;
|
|
183
|
-
// Record the real exit code in the time-windowed command-outcome store so
|
|
184
|
-
// post-task can derive a MEASURED success signal (grounded in actual exit
|
|
185
|
-
// codes) when the caller does not explicitly assert --success. Non-fatal.
|
|
186
|
-
await recordCommand(getRouteOutcomesBaseDir(), {
|
|
187
|
-
ts: Date.now(),
|
|
188
|
-
command: typeof command === 'string' ? command.slice(0, 200) : String(command).slice(0, 200),
|
|
189
|
-
exitCode,
|
|
190
|
-
});
|
|
191
|
-
// Persist command outcome via memory backend
|
|
192
|
-
let _storedIn = 'none';
|
|
193
|
-
try {
|
|
194
|
-
const bridge = await import('../memory/memory-bridge.js');
|
|
195
|
-
await bridge.bridgeStoreEntry({
|
|
196
|
-
key: `cmd-${Date.now()}`,
|
|
197
|
-
value: JSON.stringify({ command, exitCode, success }),
|
|
198
|
-
namespace: 'commands',
|
|
199
|
-
tags: [success ? 'success' : 'error'],
|
|
200
|
-
});
|
|
201
|
-
_storedIn = 'lancedb';
|
|
202
|
-
}
|
|
203
|
-
catch {
|
|
204
|
-
// memory backend unavailable — store in JSON
|
|
205
|
-
try {
|
|
206
|
-
const store = loadMemoryStore();
|
|
207
|
-
const key = `cmd-${Date.now()}`;
|
|
208
|
-
store.entries[key] = { key, value: JSON.stringify({ command, exitCode, success }), namespace: 'commands', createdAt: new Date().toISOString() };
|
|
209
|
-
const memDir = join(getProjectCwd(), MEMORY_DIR);
|
|
210
|
-
if (!existsSync(memDir))
|
|
211
|
-
mkdirSync(memDir, { recursive: true });
|
|
212
|
-
const _mp = getMemoryPath();
|
|
213
|
-
const _mptmp = _mp + '.tmp';
|
|
214
|
-
writeFileSync(_mptmp, JSON.stringify(store, null, 2), 'utf-8');
|
|
215
|
-
renameSync(_mptmp, _mp);
|
|
216
|
-
_storedIn = 'json-store';
|
|
217
|
-
}
|
|
218
|
-
catch { /* non-critical */ }
|
|
219
|
-
}
|
|
220
|
-
return {
|
|
221
|
-
recorded: _storedIn !== 'none',
|
|
222
|
-
command,
|
|
223
|
-
exitCode,
|
|
224
|
-
success,
|
|
225
|
-
timestamp: new Date().toISOString(),
|
|
226
|
-
_storedIn,
|
|
227
|
-
};
|
|
228
|
-
},
|
|
229
|
-
};
|
|
230
|
-
export const hooksRoute = {
|
|
231
|
-
name: 'hooks_route',
|
|
232
|
-
description: 'Route task to optimal agent using semantic similarity (native HNSW or pure JS)',
|
|
233
|
-
inputSchema: {
|
|
234
|
-
type: 'object',
|
|
235
|
-
properties: {
|
|
236
|
-
task: { type: 'string', description: 'Task description' },
|
|
237
|
-
context: { type: 'string', description: 'Additional context' },
|
|
238
|
-
useSemanticRouter: { type: 'boolean', description: 'Use semantic similarity routing (default: true)' },
|
|
239
|
-
},
|
|
240
|
-
required: ['task'],
|
|
241
|
-
},
|
|
242
|
-
handler: async (params) => {
|
|
243
|
-
// Cap task and context lengths: both are forwarded to generateEmbedding
|
|
244
|
-
// via bridgeRouteTask, and task is used in extractKeywords + stored in
|
|
245
|
-
// route-outcomes.jsonl. 16 KB matches the cap in hooksPatternSearch.
|
|
246
|
-
const MAX_ROUTE_TASK_LEN = 16 * 1024;
|
|
247
|
-
const MAX_ROUTE_CTX_LEN = 4 * 1024;
|
|
248
|
-
const rawTask = params.task;
|
|
249
|
-
const task = typeof rawTask === 'string' && rawTask.length > MAX_ROUTE_TASK_LEN
|
|
250
|
-
? rawTask.slice(0, MAX_ROUTE_TASK_LEN)
|
|
251
|
-
: rawTask;
|
|
252
|
-
const rawContext = params.context;
|
|
253
|
-
const context = typeof rawContext === 'string' && rawContext.length > MAX_ROUTE_CTX_LEN
|
|
254
|
-
? rawContext.slice(0, MAX_ROUTE_CTX_LEN)
|
|
255
|
-
: rawContext;
|
|
256
|
-
const useSemanticRouter = params.useSemanticRouter !== false;
|
|
257
|
-
// Phase 5: Try memory backend SemanticRouter / LearningSystem first
|
|
258
|
-
if (useSemanticRouter) {
|
|
259
|
-
try {
|
|
260
|
-
const bridge = await import('../memory/memory-bridge.js');
|
|
261
|
-
const memoryRoute = await bridge.bridgeRouteTask({ task });
|
|
262
|
-
if (memoryRoute && memoryRoute.routes && memoryRoute.routes.length > 0) {
|
|
263
|
-
const topRoute = memoryRoute.routes[0];
|
|
264
|
-
const routeConfidence = topRoute.confidence ?? 0;
|
|
265
|
-
if (routeConfidence > 0.5) {
|
|
266
|
-
const agents = memoryRoute.routes.map((r) => r.agentType);
|
|
267
|
-
const complexity = task.length > 200 ? 'high' : task.length < 50 ? 'low' : 'medium';
|
|
268
|
-
const memoryMethod = 'memory-lancedb';
|
|
269
|
-
const memoryConfidence = Math.round(routeConfidence * 100) / 100;
|
|
270
|
-
const matchedPattern = topRoute.pattern ?? task.slice(0, 60);
|
|
271
|
-
// Record the route recommendation so post-task can join the actual outcome
|
|
272
|
-
const routeId = randomUUID();
|
|
273
|
-
await recordRoute(getRouteOutcomesBaseDir(), {
|
|
274
|
-
routeId,
|
|
275
|
-
ts: Date.now(),
|
|
276
|
-
task,
|
|
277
|
-
recommendedAgent: agents[0],
|
|
278
|
-
routingMethod: memoryMethod,
|
|
279
|
-
confidence: memoryConfidence,
|
|
280
|
-
learningMode: 'js',
|
|
281
|
-
});
|
|
282
|
-
return {
|
|
283
|
-
routeId,
|
|
284
|
-
task,
|
|
285
|
-
routing: {
|
|
286
|
-
method: memoryMethod,
|
|
287
|
-
backend: 'lancedb',
|
|
288
|
-
latencyMs: 0,
|
|
289
|
-
throughput: 'N/A',
|
|
290
|
-
},
|
|
291
|
-
matchedPattern,
|
|
292
|
-
semanticMatches: [{ pattern: matchedPattern, score: routeConfidence }],
|
|
293
|
-
primaryAgent: {
|
|
294
|
-
type: agents[0],
|
|
295
|
-
confidence: memoryConfidence,
|
|
296
|
-
reason: `memory:lancedb: "${matchedPattern}" (${Math.round(routeConfidence * 100)}%)`,
|
|
297
|
-
},
|
|
298
|
-
alternativeAgents: agents.slice(1).map((agent, i) => ({
|
|
299
|
-
type: agent,
|
|
300
|
-
confidence: Math.round((routeConfidence - (0.1 * (i + 1))) * 100) / 100,
|
|
301
|
-
reason: 'Alternative from lancedb',
|
|
302
|
-
})),
|
|
303
|
-
estimatedMetrics: {
|
|
304
|
-
successProbability: memoryConfidence,
|
|
305
|
-
estimatedDuration: complexity === 'high' ? '2-4 hours' : complexity === 'medium' ? '30-60 min' : '10-30 min',
|
|
306
|
-
complexity,
|
|
307
|
-
},
|
|
308
|
-
swarmRecommendation: agents.length > 2 ? { topology: 'hierarchical', agents, coordination: 'queen-led' } : null,
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
catch {
|
|
314
|
-
// memory router not available — fall through to local routing
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
// Deterministic keyword routing is the baseline (and only) local path.
|
|
318
|
-
const semanticResult = [];
|
|
319
|
-
let routingMethod = 'keyword';
|
|
320
|
-
const routingLatencyMs = 0;
|
|
321
|
-
let backendInfo = '';
|
|
322
|
-
// Get agents from keyword routing
|
|
323
|
-
let agents;
|
|
324
|
-
let confidence;
|
|
325
|
-
let matchedPattern = '';
|
|
326
|
-
{
|
|
327
|
-
// Keyword fallback is the baseline
|
|
328
|
-
const keywordSuggestion = suggestAgentsForTask(task);
|
|
329
|
-
agents = keywordSuggestion.agents;
|
|
330
|
-
confidence = keywordSuggestion.confidence;
|
|
331
|
-
matchedPattern = 'keyword-fallback';
|
|
332
|
-
routingMethod = 'keyword';
|
|
333
|
-
backendInfo = 'keyword matching';
|
|
334
|
-
// V3: augment with neural ReasoningBank patterns — merge into agent list
|
|
335
|
-
// rather than replacing, so keyword precision is preserved while neural
|
|
336
|
-
// adds learned agents from past sessions.
|
|
337
|
-
const intelSuggestion = await suggestAgentsFromIntelligence(task).catch(() => null);
|
|
338
|
-
if (intelSuggestion && intelSuggestion.confidence > 0.5) {
|
|
339
|
-
// Prepend neural agents (deduped) and boost confidence
|
|
340
|
-
const existingSet = new Set(agents);
|
|
341
|
-
const neuralOnly = intelSuggestion.agents.filter(a => !existingSet.has(a));
|
|
342
|
-
agents = [...intelSuggestion.agents, ...agents.filter(a => !new Set(intelSuggestion.agents).has(a))];
|
|
343
|
-
const neuralWeight = intelSuggestion.confidence > 0.7 ? 0.65 : 0.5;
|
|
344
|
-
const keywordWeight = 1 - neuralWeight;
|
|
345
|
-
confidence = Math.min(0.95, intelSuggestion.confidence * neuralWeight +
|
|
346
|
-
confidence * keywordWeight +
|
|
347
|
-
(neuralOnly.length > 0 ? 0.03 : 0));
|
|
348
|
-
matchedPattern = 'neural+keyword';
|
|
349
|
-
routingMethod = 'neural-augmented';
|
|
350
|
-
backendInfo = 'intelligence ReasoningBank + keyword matching';
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
// Determine complexity
|
|
354
|
-
const taskLower = task.toLowerCase();
|
|
355
|
-
const complexity = taskLower.includes('complex') || taskLower.includes('architecture') || task.length > 200
|
|
356
|
-
? 'high'
|
|
357
|
-
: taskLower.includes('simple') || taskLower.includes('fix') || task.length < 50
|
|
358
|
-
? 'low'
|
|
359
|
-
: 'medium';
|
|
360
|
-
const primaryConfidence = Math.round(confidence * 100) / 100;
|
|
361
|
-
// Record the route recommendation so post-task can join the actual outcome
|
|
362
|
-
const routeId = randomUUID();
|
|
363
|
-
await recordRoute(getRouteOutcomesBaseDir(), {
|
|
364
|
-
routeId,
|
|
365
|
-
ts: Date.now(),
|
|
366
|
-
task,
|
|
367
|
-
recommendedAgent: agents[0],
|
|
368
|
-
routingMethod,
|
|
369
|
-
confidence: primaryConfidence,
|
|
370
|
-
learningMode: 'js',
|
|
371
|
-
});
|
|
372
|
-
return {
|
|
373
|
-
routeId,
|
|
374
|
-
task,
|
|
375
|
-
routing: {
|
|
376
|
-
method: routingMethod,
|
|
377
|
-
backend: backendInfo,
|
|
378
|
-
latencyMs: routingLatencyMs,
|
|
379
|
-
throughput: routingLatencyMs > 0 ? `${Math.round(1000 / routingLatencyMs)} routes/s` : 'N/A',
|
|
380
|
-
},
|
|
381
|
-
matchedPattern,
|
|
382
|
-
semanticMatches: semanticResult.slice(0, 3).map(r => ({
|
|
383
|
-
pattern: r.intent,
|
|
384
|
-
score: Math.round(r.score * 100) / 100,
|
|
385
|
-
})),
|
|
386
|
-
primaryAgent: {
|
|
387
|
-
type: agents[0],
|
|
388
|
-
confidence: Math.round(confidence * 100) / 100,
|
|
389
|
-
reason: routingMethod.startsWith('semantic')
|
|
390
|
-
? `Semantic similarity to "${matchedPattern}" pattern (${Math.round(confidence * 100)}%)`
|
|
391
|
-
: `Task contains keywords matching ${agents[0]} specialization`,
|
|
392
|
-
},
|
|
393
|
-
alternativeAgents: agents.slice(1).map((agent, i) => ({
|
|
394
|
-
type: agent,
|
|
395
|
-
confidence: Math.round((confidence - (0.1 * (i + 1))) * 100) / 100,
|
|
396
|
-
reason: `Alternative agent for ${agent} capabilities`,
|
|
397
|
-
})),
|
|
398
|
-
estimatedMetrics: {
|
|
399
|
-
successProbability: Math.round(confidence * 100) / 100,
|
|
400
|
-
estimatedDuration: complexity === 'high' ? '2-4 hours' : complexity === 'medium' ? '30-60 min' : '10-30 min',
|
|
401
|
-
complexity,
|
|
402
|
-
},
|
|
403
|
-
swarmRecommendation: agents.length > 2 ? {
|
|
404
|
-
topology: 'hierarchical',
|
|
405
|
-
agents,
|
|
406
|
-
coordination: 'queen-led',
|
|
407
|
-
} : null,
|
|
408
|
-
};
|
|
409
|
-
},
|
|
410
|
-
};
|
|
411
|
-
export const hooksRouteSemantic = {
|
|
412
|
-
name: 'hooks_route_semantic',
|
|
413
|
-
description: 'Route a task using the @monoes/routing package: keyword pre-filter, then real-embedding ' +
|
|
414
|
-
'cosine-similarity matching (isolated worker), with a headless Claude (Haiku) fallback below ' +
|
|
415
|
-
'the confidence threshold. Slower and more precise than hooks_route — use for ambiguous or ' +
|
|
416
|
-
'highly specialized tasks (e.g. Solidity, game engines, embedded, DevOps) where keyword matching ' +
|
|
417
|
-
'is likely to under-specify the agent.',
|
|
418
|
-
inputSchema: {
|
|
419
|
-
type: 'object',
|
|
420
|
-
properties: {
|
|
421
|
-
task: { type: 'string', description: 'Task description' },
|
|
422
|
-
debug: { type: 'boolean', description: 'Include all route scores in the response (default: false)' },
|
|
423
|
-
},
|
|
424
|
-
required: ['task'],
|
|
425
|
-
},
|
|
426
|
-
handler: async (params) => {
|
|
427
|
-
const MAX_ROUTE_TASK_LEN = 2000; // matches route-layer-factory's MAX_TASK_LENGTH
|
|
428
|
-
const rawTask = params.task;
|
|
429
|
-
const task = typeof rawTask === 'string' && rawTask.length > MAX_ROUTE_TASK_LEN
|
|
430
|
-
? rawTask.slice(0, MAX_ROUTE_TASK_LEN)
|
|
431
|
-
: rawTask;
|
|
432
|
-
const debug = params.debug === true;
|
|
433
|
-
if (!task || typeof task !== 'string') {
|
|
434
|
-
throw new Error('task is required');
|
|
435
|
-
}
|
|
436
|
-
const { createConfiguredRouteLayer } = await import('../routing/route-layer-factory.js');
|
|
437
|
-
const layer = await createConfiguredRouteLayer({ debug });
|
|
438
|
-
const result = await layer.route(task);
|
|
439
|
-
const routeId = randomUUID();
|
|
440
|
-
await recordRoute(getRouteOutcomesBaseDir(), {
|
|
441
|
-
routeId,
|
|
442
|
-
ts: Date.now(),
|
|
443
|
-
task,
|
|
444
|
-
recommendedAgent: result.agentSlug,
|
|
445
|
-
routingMethod: `routing-pkg:${result.method}`,
|
|
446
|
-
confidence: result.confidence,
|
|
447
|
-
learningMode: 'js',
|
|
448
|
-
}).catch(() => { });
|
|
449
|
-
return { routeId, task, ...result };
|
|
450
|
-
},
|
|
451
|
-
};
|
|
452
|
-
export const hooksMetrics = {
|
|
453
|
-
name: 'hooks_metrics',
|
|
454
|
-
description: 'View learning metrics dashboard',
|
|
455
|
-
inputSchema: {
|
|
456
|
-
type: 'object',
|
|
457
|
-
properties: {
|
|
458
|
-
period: { type: 'string', description: 'Metrics period (1h, 24h, 7d, 30d)' },
|
|
459
|
-
includeV1: { type: 'boolean', description: 'Include v1 performance metrics' },
|
|
460
|
-
},
|
|
461
|
-
},
|
|
462
|
-
handler: async (params) => {
|
|
463
|
-
const period = params.period || '24h';
|
|
464
|
-
// Try to read real counts from memory store
|
|
465
|
-
const store = loadMemoryStore();
|
|
466
|
-
const entries = Object.values(store.entries);
|
|
467
|
-
// Count patterns by looking at stored pattern entries
|
|
468
|
-
const patternEntries = entries.filter(e => e.key.includes('pattern'));
|
|
469
|
-
const routingEntries = entries.filter(e => e.key.includes('route') || e.key.includes('routing'));
|
|
470
|
-
const taskEntries = entries.filter(e => e.key.includes('task'));
|
|
471
|
-
if (entries.length === 0) {
|
|
472
|
-
return {
|
|
473
|
-
_real: true,
|
|
474
|
-
_note: 'No metrics data collected yet. Data populates from hooks_post-task, hooks_post-edit, hooks_post-command, and hooks_route calls.',
|
|
475
|
-
period,
|
|
476
|
-
patterns: { total: 0, successful: 0, failed: 0, avgConfidence: null },
|
|
477
|
-
agents: { routingAccuracy: null, totalRoutes: 0, topAgent: null },
|
|
478
|
-
commands: { totalExecuted: 0, successRate: null, avgRiskScore: null },
|
|
479
|
-
lastUpdated: new Date().toISOString(),
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
return {
|
|
483
|
-
period,
|
|
484
|
-
patterns: {
|
|
485
|
-
total: patternEntries.length,
|
|
486
|
-
_note: 'Success/failure breakdown not tracked yet — store outcomes via hooks_post-task to populate.',
|
|
487
|
-
},
|
|
488
|
-
agents: {
|
|
489
|
-
totalRoutes: routingEntries.length,
|
|
490
|
-
_note: 'Routing accuracy not tracked yet — requires route-outcome correlation data.',
|
|
491
|
-
},
|
|
492
|
-
commands: {
|
|
493
|
-
totalExecuted: taskEntries.length,
|
|
494
|
-
_note: 'Success rate not tracked yet — requires command-outcomes.jsonl data.',
|
|
495
|
-
},
|
|
496
|
-
dataSource: 'memory-store',
|
|
497
|
-
entriesFound: entries.length,
|
|
498
|
-
lastUpdated: new Date().toISOString(),
|
|
499
|
-
};
|
|
500
|
-
},
|
|
501
|
-
};
|
|
502
|
-
export const hooksList = {
|
|
503
|
-
name: 'hooks_list',
|
|
504
|
-
description: 'List all registered hooks',
|
|
505
|
-
inputSchema: {
|
|
506
|
-
type: 'object',
|
|
507
|
-
properties: {},
|
|
508
|
-
},
|
|
509
|
-
handler: async () => {
|
|
510
|
-
// Static registry — not live discovery from handler objects.
|
|
511
|
-
// Update this list when hooks are added or removed.
|
|
512
|
-
const hooks = [
|
|
513
|
-
// Core hooks
|
|
514
|
-
{ name: 'pre-edit', type: 'PreToolUse', status: 'active' },
|
|
515
|
-
{ name: 'post-edit', type: 'PostToolUse', status: 'active' },
|
|
516
|
-
{ name: 'pre-command', type: 'PreToolUse', status: 'active' },
|
|
517
|
-
{ name: 'post-command', type: 'PostToolUse', status: 'active' },
|
|
518
|
-
{ name: 'pre-task', type: 'PreToolUse', status: 'active' },
|
|
519
|
-
{ name: 'post-task', type: 'PostToolUse', status: 'active' },
|
|
520
|
-
// Routing hooks
|
|
521
|
-
{ name: 'route', type: 'intelligence', status: 'active' },
|
|
522
|
-
{ name: 'explain', type: 'intelligence', status: 'active' },
|
|
523
|
-
// Session hooks
|
|
524
|
-
{ name: 'session-start', type: 'SessionStart', status: 'active' },
|
|
525
|
-
{ name: 'session-end', type: 'SessionEnd', status: 'active' },
|
|
526
|
-
{ name: 'session-restore', type: 'SessionStart', status: 'active' },
|
|
527
|
-
// Learning hooks
|
|
528
|
-
{ name: 'pretrain', type: 'intelligence', status: 'active' },
|
|
529
|
-
{ name: 'build-agents', type: 'intelligence', status: 'active' },
|
|
530
|
-
{ name: 'transfer', type: 'intelligence', status: 'active' },
|
|
531
|
-
{ name: 'metrics', type: 'analytics', status: 'active' },
|
|
532
|
-
// System hooks
|
|
533
|
-
{ name: 'init', type: 'system', status: 'active' },
|
|
534
|
-
{ name: 'notify', type: 'coordination', status: 'active' },
|
|
535
|
-
// Intelligence subcommands
|
|
536
|
-
{ name: 'intelligence', type: 'intelligence', status: 'active' },
|
|
537
|
-
{ name: 'intelligence_trajectory-start', type: 'intelligence', status: 'active' },
|
|
538
|
-
{ name: 'intelligence_trajectory-step', type: 'intelligence', status: 'active' },
|
|
539
|
-
{ name: 'intelligence_trajectory-end', type: 'intelligence', status: 'active' },
|
|
540
|
-
{ name: 'intelligence_pattern-store', type: 'intelligence', status: 'active' },
|
|
541
|
-
{ name: 'intelligence_pattern-search', type: 'intelligence', status: 'active' },
|
|
542
|
-
{ name: 'intelligence_stats', type: 'analytics', status: 'active' },
|
|
543
|
-
{ name: 'intelligence_learn', type: 'intelligence', status: 'active' },
|
|
544
|
-
{ name: 'intelligence_attention', type: 'intelligence', status: 'active' },
|
|
545
|
-
];
|
|
546
|
-
return {
|
|
547
|
-
_note: 'Static registry — update this list when hooks are added or removed.',
|
|
548
|
-
hooks,
|
|
549
|
-
total: hooks.length,
|
|
550
|
-
};
|
|
551
|
-
},
|
|
552
|
-
};
|
|
553
|
-
export const hooksPreTask = {
|
|
554
|
-
name: 'hooks_pre-task',
|
|
555
|
-
description: 'Record task start and get agent suggestions with intelligent model routing (ADR-026)',
|
|
556
|
-
inputSchema: {
|
|
557
|
-
type: 'object',
|
|
558
|
-
properties: {
|
|
559
|
-
taskId: { type: 'string', description: 'Task identifier' },
|
|
560
|
-
description: { type: 'string', description: 'Task description' },
|
|
561
|
-
filePath: { type: 'string', description: 'Optional file path for AST analysis' },
|
|
562
|
-
},
|
|
563
|
-
required: ['taskId', 'description'],
|
|
564
|
-
},
|
|
565
|
-
handler: async (params) => {
|
|
566
|
-
// Cap taskId: it is used as a suffix in SQLite memory keys (heuristic:${taskId},
|
|
567
|
-
// routing-decision:${taskId}, textual_gradient:${taskId}) and as sourceId/targetId
|
|
568
|
-
// in causal-graph edges persisted to SQLite. An uncapped ID can inflate the DB key
|
|
569
|
-
// column and every JSON payload that includes the ID.
|
|
570
|
-
const MAX_TASK_ID_LEN = 256;
|
|
571
|
-
const rawTaskId = params.taskId;
|
|
572
|
-
const taskId = typeof rawTaskId === 'string' && rawTaskId.length > MAX_TASK_ID_LEN
|
|
573
|
-
? rawTaskId.slice(0, MAX_TASK_ID_LEN)
|
|
574
|
-
: rawTaskId;
|
|
575
|
-
// Cap description: it is forwarded to generateEmbedding twice (ERL heuristics
|
|
576
|
-
// + TextGrad gradient queries) and used in O(n) keyword extraction.
|
|
577
|
-
// 16 KB matches the cap applied in hooks_route and hooksPatternSearch.
|
|
578
|
-
const MAX_PRE_TASK_DESC_LEN = 16 * 1024;
|
|
579
|
-
const rawDescription = params.description;
|
|
580
|
-
const description = typeof rawDescription === 'string' && rawDescription.length > MAX_PRE_TASK_DESC_LEN
|
|
581
|
-
? rawDescription.slice(0, MAX_PRE_TASK_DESC_LEN)
|
|
582
|
-
: rawDescription;
|
|
583
|
-
const filePath = params.filePath;
|
|
584
|
-
const suggestion = suggestAgentsForTask(description);
|
|
585
|
-
// Determine complexity
|
|
586
|
-
const descLower = description.toLowerCase();
|
|
587
|
-
const complexity = descLower.includes('complex') || descLower.includes('architecture') || description.length > 200
|
|
588
|
-
? 'high'
|
|
589
|
-
: descLower.includes('simple') || descLower.includes('fix') || description.length < 50
|
|
590
|
-
? 'low'
|
|
591
|
-
: 'medium';
|
|
592
|
-
// Enhanced model routing module was never shipped — modelRouting stays undefined.
|
|
593
|
-
const modelRouting = undefined;
|
|
594
|
-
// ERL: Retrieve past heuristics to inject into recommendations
|
|
595
|
-
// Source: https://arxiv.org/abs/2603.24639
|
|
596
|
-
const erlHints = [];
|
|
597
|
-
try {
|
|
598
|
-
const searchFn = await getRealSearchFunction();
|
|
599
|
-
if (searchFn) {
|
|
600
|
-
const heuristicResults = await searchFn({
|
|
601
|
-
query: description,
|
|
602
|
-
namespace: 'heuristics',
|
|
603
|
-
limit: 3,
|
|
604
|
-
threshold: 0.6,
|
|
605
|
-
});
|
|
606
|
-
for (const r of (heuristicResults?.results ?? [])) {
|
|
607
|
-
try {
|
|
608
|
-
const h = JSON.parse(r.content ?? '{}');
|
|
609
|
-
if (h.action && h.confidence !== undefined && h.confidence >= 0.6) {
|
|
610
|
-
erlHints.push(`ERL hint (conf=${h.confidence.toFixed(2)}): use "${h.action}" for tasks involving "${h.condition ?? 'similar context'}"`);
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
catch { /* skip malformed */ }
|
|
614
|
-
}
|
|
615
|
-
// TextGrad: also inject relevant past failure gradients to guide away from known pitfalls
|
|
616
|
-
// Source: https://arxiv.org/abs/2406.07496
|
|
617
|
-
const gradientResults = await searchFn({
|
|
618
|
-
query: description,
|
|
619
|
-
namespace: 'gradients',
|
|
620
|
-
limit: 2,
|
|
621
|
-
threshold: 0.55,
|
|
622
|
-
});
|
|
623
|
-
for (const r of (gradientResults?.results ?? [])) {
|
|
624
|
-
const critique = r.content ?? '';
|
|
625
|
-
if (critique && critique.length > 10) {
|
|
626
|
-
erlHints.push(`TextGrad warning: ${critique.slice(0, 120)}`);
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
catch { /* non-critical */ }
|
|
632
|
-
// NOTE: a LATS planning pass used to be attempted here via
|
|
633
|
-
// `import('@monoes/hooks').buildLATSPlan` — that function never existed
|
|
634
|
-
// in the package (the planning module was removed), so the import failed
|
|
635
|
-
// silently on every call. The dead block was removed.
|
|
636
|
-
let plan;
|
|
637
|
-
return {
|
|
638
|
-
taskId,
|
|
639
|
-
description,
|
|
640
|
-
suggestedAgents: suggestion.agents.map((agent, i) => ({
|
|
641
|
-
type: agent,
|
|
642
|
-
confidence: suggestion.confidence - (0.05 * i),
|
|
643
|
-
reason: i === 0
|
|
644
|
-
? `Primary agent for ${agent} tasks based on learned patterns`
|
|
645
|
-
: `Alternative agent with ${agent} capabilities`,
|
|
646
|
-
})),
|
|
647
|
-
complexity,
|
|
648
|
-
estimatedDuration: complexity === 'high' ? '2-4 hours' : complexity === 'medium' ? '30-60 min' : '10-30 min',
|
|
649
|
-
risks: complexity === 'high' ? ['Complex task may require multiple iterations'] : [],
|
|
650
|
-
recommendations: [
|
|
651
|
-
`Use ${suggestion.agents[0]} as primary agent`,
|
|
652
|
-
suggestion.agents.length > 2 ? 'Consider using swarm coordination' : 'Single agent recommended',
|
|
653
|
-
...erlHints,
|
|
654
|
-
],
|
|
655
|
-
modelRouting,
|
|
656
|
-
plan,
|
|
657
|
-
timestamp: new Date().toISOString(),
|
|
658
|
-
};
|
|
659
|
-
},
|
|
660
|
-
};
|
|
661
|
-
export const hooksPostTask = {
|
|
662
|
-
name: 'hooks_post-task',
|
|
663
|
-
description: 'Record task completion for learning',
|
|
664
|
-
inputSchema: {
|
|
665
|
-
type: 'object',
|
|
666
|
-
properties: {
|
|
667
|
-
taskId: { type: 'string', description: 'Task identifier' },
|
|
668
|
-
success: { type: 'boolean', description: 'Whether task was successful' },
|
|
669
|
-
agent: { type: 'string', description: 'Agent that completed the task' },
|
|
670
|
-
quality: { type: 'number', description: 'Quality score (0-1)' },
|
|
671
|
-
task: { type: 'string', description: 'Task description text (used for learning keyword extraction)' },
|
|
672
|
-
storeDecisions: { type: 'boolean', description: 'Also store routing decision in memory DB' },
|
|
673
|
-
routeId: { type: 'string', description: 'Route ID from a prior hooks_route call — joins the recommendation to this outcome' },
|
|
674
|
-
},
|
|
675
|
-
required: ['taskId'],
|
|
676
|
-
},
|
|
677
|
-
handler: async (params) => {
|
|
678
|
-
// Cap taskId for the same reason as hooks_pre_task: it flows into SQLite memory keys
|
|
679
|
-
// (heuristic:${taskId}, routing-decision:${taskId}, textual_gradient:${taskId}) and
|
|
680
|
-
// into causal-graph edge IDs persisted to the DB. Without a cap an attacker can
|
|
681
|
-
// inflate every row that stores the raw ID.
|
|
682
|
-
const MAX_POST_TASK_ID_LEN = 256;
|
|
683
|
-
const rawPostTaskId = params.taskId;
|
|
684
|
-
const taskId = typeof rawPostTaskId === 'string' && rawPostTaskId.length > MAX_POST_TASK_ID_LEN
|
|
685
|
-
? rawPostTaskId.slice(0, MAX_POST_TASK_ID_LEN)
|
|
686
|
-
: rawPostTaskId;
|
|
687
|
-
// The success flag, when the caller asserts it (--success true), is taken as
|
|
688
|
-
// ground truth. But callers usually do NOT pass it. Rather than treating every
|
|
689
|
-
// unverified task as "unknown" (and thus excluding it from learning), we now
|
|
690
|
-
// derive a MEASURED success signal from the real command exit codes recorded by
|
|
691
|
-
// post-command within a recent time window. post-command appends each exit code
|
|
692
|
-
// to the command-outcome store keyed by timestamp; deriveRecentSuccess returns:
|
|
693
|
-
// true → recent commands exist and the LAST command exited 0 (final-state heuristic)
|
|
694
|
-
// false → recent commands exist and the LAST command exited non-zero
|
|
695
|
-
// null → no recent commands (genuinely no signal → stays unknown)
|
|
696
|
-
// Note: "final-state" not "all must pass" — intermediate failures (e.g. grep no-match,
|
|
697
|
-
// test-then-fix cycles) are intentionally ignored; the last exit code decides.
|
|
698
|
-
// Precedence: an explicit --success ALWAYS wins; the derived signal only fills
|
|
699
|
-
// in when no explicit flag is given; only when there is also no recent command
|
|
700
|
-
// signal does the outcome stay unknown (and excluded from SONA + route join,
|
|
701
|
-
// per the existing "unknown ≠ success" principle).
|
|
702
|
-
const explicitSuccess = typeof params.success === 'boolean';
|
|
703
|
-
let outcomeKnown = explicitSuccess;
|
|
704
|
-
let success = params.success !== false;
|
|
705
|
-
let successSource = explicitSuccess ? 'explicit' : 'unknown';
|
|
706
|
-
if (!explicitSuccess) {
|
|
707
|
-
const derived = await deriveRecentSuccess(getRouteOutcomesBaseDir());
|
|
708
|
-
if (derived !== null) {
|
|
709
|
-
outcomeKnown = true;
|
|
710
|
-
success = derived;
|
|
711
|
-
successSource = 'derived-commands';
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
// Cap agent: forwarded to bridgeRecordFeedback where it is stored in the
|
|
715
|
-
// feedback record and used as a tag string in the JSON store. An uncapped
|
|
716
|
-
// agent value inflates the on-disk store entry.
|
|
717
|
-
const MAX_POST_TASK_AGENT_LEN = 256;
|
|
718
|
-
const rawPostTaskAgent = params.agent;
|
|
719
|
-
const agent = typeof rawPostTaskAgent === 'string' && rawPostTaskAgent.length > MAX_POST_TASK_AGENT_LEN
|
|
720
|
-
? rawPostTaskAgent.slice(0, MAX_POST_TASK_AGENT_LEN)
|
|
721
|
-
: rawPostTaskAgent;
|
|
722
|
-
const quality = params.quality || (success ? 0.85 : 0.3);
|
|
723
|
-
const startTime = Date.now();
|
|
724
|
-
// Cap task description: passed to generateEmbedding via bridgeRecordFeedback
|
|
725
|
-
// and persisted to route-outcomes.jsonl. 16 KB matches hooks_route cap.
|
|
726
|
-
const MAX_POST_TASK_LEN = 16 * 1024;
|
|
727
|
-
const rawPostTask = params.task;
|
|
728
|
-
const cappedPostTask = typeof rawPostTask === 'string' && rawPostTask.length > MAX_POST_TASK_LEN
|
|
729
|
-
? rawPostTask.slice(0, MAX_POST_TASK_LEN)
|
|
730
|
-
: rawPostTask;
|
|
731
|
-
// Phase 3: Wire recordFeedback through bridge → LearningSystem + ReasoningBank
|
|
732
|
-
let feedbackResult = null;
|
|
733
|
-
try {
|
|
734
|
-
const bridge = await import('../memory/memory-bridge.js');
|
|
735
|
-
feedbackResult = await bridge.bridgeRecordFeedback({
|
|
736
|
-
taskType: agent ?? 'task',
|
|
737
|
-
action: cappedPostTask?.slice(0, 80) ?? taskId,
|
|
738
|
-
outcome: success ? 'success' : (outcomeKnown ? 'failure' : 'partial'),
|
|
739
|
-
confidence: quality,
|
|
740
|
-
metadata: { taskId, duration: params.duration || undefined, patterns: params.patterns || undefined },
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
catch (e) {
|
|
744
|
-
// Bridge not available — continue with basic response
|
|
745
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
746
|
-
console.error('[hooks-post-task] memory bridge feedback failed:', e);
|
|
747
|
-
}
|
|
748
|
-
// Phase 3: Record causal edge (task → outcome)
|
|
749
|
-
try {
|
|
750
|
-
const bridge = await import('../memory/memory-bridge.js');
|
|
751
|
-
await bridge.bridgeRecordCausalEdge({
|
|
752
|
-
sourceId: taskId,
|
|
753
|
-
targetId: `outcome-${taskId}`,
|
|
754
|
-
relation: success ? 'succeeded' : 'failed',
|
|
755
|
-
strength: quality,
|
|
756
|
-
});
|
|
757
|
-
}
|
|
758
|
-
catch (e) {
|
|
759
|
-
// Non-fatal
|
|
760
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
761
|
-
console.error('[hooks-post-task] causal edge record failed:', e);
|
|
762
|
-
}
|
|
763
|
-
// Persist routing outcome for runtime learning (file-based, always reliable).
|
|
764
|
-
// B1.3: also gate this sibling learning sink on a known outcome — an unverified
|
|
765
|
-
// task must not train the router as a success either. When the caller did not
|
|
766
|
-
// assert success, the outcome is unknown and we skip persisting a labeled sample.
|
|
767
|
-
const taskText = cappedPostTask || '';
|
|
768
|
-
const outcomeKeywords = extractKeywords(taskText);
|
|
769
|
-
let outcomePersisted = false;
|
|
770
|
-
if (outcomeKnown && taskText && agent && agent.length <= 100 && /^[a-zA-Z0-9_-]+$/.test(agent)) {
|
|
771
|
-
try {
|
|
772
|
-
const outcomes = loadRoutingOutcomes();
|
|
773
|
-
outcomes.push({
|
|
774
|
-
task: taskText,
|
|
775
|
-
agent,
|
|
776
|
-
success,
|
|
777
|
-
quality,
|
|
778
|
-
keywords: outcomeKeywords,
|
|
779
|
-
timestamp: new Date().toISOString(),
|
|
780
|
-
});
|
|
781
|
-
saveRoutingOutcomes(outcomes);
|
|
782
|
-
outcomePersisted = true;
|
|
783
|
-
}
|
|
784
|
-
catch { /* non-critical */ }
|
|
785
|
-
}
|
|
786
|
-
// Join this outcome back onto the original route recommendation. This is the
|
|
787
|
-
// recommendation→actual→success link that routing-accuracy metrics and SONA
|
|
788
|
-
// labels depend on. When the caller threads an explicit routeId we join that
|
|
789
|
-
// record; otherwise we auto-correlate to the most recent unresolved route
|
|
790
|
-
// (within a 10-min window) so the loop closes without the LLM manually
|
|
791
|
-
// threading the routeId. Only join when the outcome is actually measured —
|
|
792
|
-
// per "unknown ≠ success", an unverified task must not pollute the metric.
|
|
793
|
-
if (outcomeKnown) {
|
|
794
|
-
const outcome = {
|
|
795
|
-
agentActuallyUsed: agent,
|
|
796
|
-
measuredSuccess: success,
|
|
797
|
-
quality: typeof params.quality === 'number' ? params.quality : undefined,
|
|
798
|
-
};
|
|
799
|
-
if (params.routeId) {
|
|
800
|
-
await joinOutcome(getRouteOutcomesBaseDir(), params.routeId, outcome);
|
|
801
|
-
}
|
|
802
|
-
else {
|
|
803
|
-
await joinLatestUnresolved(getRouteOutcomesBaseDir(), outcome);
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
// ERL: Extract and persist structured heuristic for future pre-task injection
|
|
807
|
-
// Source: https://arxiv.org/abs/2603.24639
|
|
808
|
-
if (taskText && agent && success !== undefined) {
|
|
809
|
-
try {
|
|
810
|
-
const storeFn = await getRealStoreFunction();
|
|
811
|
-
if (storeFn) {
|
|
812
|
-
const heuristic = {
|
|
813
|
-
condition: outcomeKeywords.slice(0, 3).join(', ') || taskText.slice(0, 60),
|
|
814
|
-
action: agent,
|
|
815
|
-
confidence: success ? (quality ?? 0.8) : 0.2,
|
|
816
|
-
};
|
|
817
|
-
await storeFn({
|
|
818
|
-
key: `heuristic:${taskId}`,
|
|
819
|
-
value: JSON.stringify(heuristic),
|
|
820
|
-
namespace: 'heuristics',
|
|
821
|
-
tags: ['erl', agent, success ? 'success' : 'failure'],
|
|
822
|
-
});
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
catch { /* non-critical */ }
|
|
826
|
-
}
|
|
827
|
-
// Optionally store in memory DB for cross-session vector retrieval
|
|
828
|
-
if (params.storeDecisions && taskText && agent) {
|
|
829
|
-
try {
|
|
830
|
-
const storeFn = await getRealStoreFunction();
|
|
831
|
-
if (storeFn) {
|
|
832
|
-
await storeFn({
|
|
833
|
-
key: `routing-decision:${taskId}`,
|
|
834
|
-
namespace: 'patterns',
|
|
835
|
-
value: JSON.stringify({ task: taskText, agent, success, quality, keywords: outcomeKeywords }),
|
|
836
|
-
tags: ['routing-decision'],
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
catch { /* non-critical */ }
|
|
841
|
-
}
|
|
842
|
-
const duration = Date.now() - startTime;
|
|
843
|
-
// TextGrad: Store textual gradient critique for failed tasks
|
|
844
|
-
// Source: https://arxiv.org/abs/2406.07496 (TextGrad — Nature)
|
|
845
|
-
if (!success && taskText) {
|
|
846
|
-
try {
|
|
847
|
-
const storeFn = await getRealStoreFunction();
|
|
848
|
-
if (storeFn) {
|
|
849
|
-
const critique = `Task "${taskText.slice(0, 80)}" failed with agent "${agent}". ` +
|
|
850
|
-
`Quality score: ${quality ?? 'unknown'}. ` +
|
|
851
|
-
`Improvement direction: review agent selection, consider more capable agent or task decomposition.`;
|
|
852
|
-
await storeFn({
|
|
853
|
-
key: `textual_gradient:${taskId}`,
|
|
854
|
-
value: critique,
|
|
855
|
-
namespace: 'gradients',
|
|
856
|
-
tags: ['textual_gradient', agent ?? 'unknown', 'failure'],
|
|
857
|
-
});
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
catch { /* non-critical */ }
|
|
861
|
-
}
|
|
862
|
-
// MAR: Structured multi-agent reflection on failure
|
|
863
|
-
// Source: https://arxiv.org/html/2512.20845 (MAR — December 2025)
|
|
864
|
-
const marReflection = !success ? {
|
|
865
|
-
needed: true,
|
|
866
|
-
suggestedAgents: [
|
|
867
|
-
{ role: 'diagnoser', description: 'Analyze root cause of task failure' },
|
|
868
|
-
{ role: 'critic-1', description: 'Critique from correctness angle (temperature 0.3)' },
|
|
869
|
-
{ role: 'critic-2', description: 'Critique from efficiency angle (temperature 0.8)' },
|
|
870
|
-
{ role: 'aggregator', description: 'Synthesize critiques into actionable reflection heuristic' },
|
|
871
|
-
],
|
|
872
|
-
storeAs: 'heuristics',
|
|
873
|
-
note: 'Spawn agents sequentially: Diagnoser → Critics in parallel → Aggregator',
|
|
874
|
-
} : { needed: false };
|
|
875
|
-
return {
|
|
876
|
-
taskId,
|
|
877
|
-
success,
|
|
878
|
-
outcomeKnown,
|
|
879
|
-
successSource,
|
|
880
|
-
duration,
|
|
881
|
-
learningUpdates: {
|
|
882
|
-
patternsUpdated: feedbackResult?.success ? (success ? 2 : 1) : 0,
|
|
883
|
-
newPatterns: success ? 1 : 0,
|
|
884
|
-
trajectoryId: `traj-${Date.now()}`,
|
|
885
|
-
controller: feedbackResult?.success ? 'lancedb' : 'none',
|
|
886
|
-
outcomePersisted,
|
|
887
|
-
},
|
|
888
|
-
quality,
|
|
889
|
-
feedback: feedbackResult ? {
|
|
890
|
-
recorded: feedbackResult.success,
|
|
891
|
-
controller: feedbackResult.success ? 'lancedb' : 'unavailable',
|
|
892
|
-
updates: feedbackResult.success ? 1 : 0,
|
|
893
|
-
} : { recorded: false, controller: 'unavailable', updates: 0 },
|
|
894
|
-
marReflection,
|
|
895
|
-
timestamp: new Date().toISOString(),
|
|
896
|
-
};
|
|
897
|
-
},
|
|
898
|
-
};
|
|
899
|
-
// Explain hook - transparent routing explanation
|
|
900
|
-
export const hooksExplain = {
|
|
901
|
-
name: 'hooks_explain',
|
|
902
|
-
description: 'Explain routing decision with full transparency',
|
|
903
|
-
inputSchema: {
|
|
904
|
-
type: 'object',
|
|
905
|
-
properties: {
|
|
906
|
-
task: { type: 'string', description: 'Task description' },
|
|
907
|
-
agent: { type: 'string', description: 'Specific agent to explain' },
|
|
908
|
-
verbose: { type: 'boolean', description: 'Verbose explanation' },
|
|
909
|
-
},
|
|
910
|
-
required: ['task'],
|
|
911
|
-
},
|
|
912
|
-
handler: async (params) => {
|
|
913
|
-
// Cap task: forwarded to suggestAgentsForTask (O(n) keyword loop + extractKeywords),
|
|
914
|
-
// .toLowerCase() (O(n)), and reflected verbatim in the response.
|
|
915
|
-
const MAX_EXPLAIN_TASK_LEN = 16 * 1024;
|
|
916
|
-
const rawExplainTask = params.task;
|
|
917
|
-
const task = typeof rawExplainTask === 'string' && rawExplainTask.length > MAX_EXPLAIN_TASK_LEN
|
|
918
|
-
? rawExplainTask.slice(0, MAX_EXPLAIN_TASK_LEN)
|
|
919
|
-
: rawExplainTask;
|
|
920
|
-
const suggestion = suggestAgentsForTask(task);
|
|
921
|
-
const taskLower = task.toLowerCase();
|
|
922
|
-
// Determine matched patterns
|
|
923
|
-
const matchedPatterns = [];
|
|
924
|
-
for (const [pattern, _result] of Object.entries(TASK_PATTERNS)) {
|
|
925
|
-
if (taskLower.includes(pattern)) {
|
|
926
|
-
matchedPatterns.push({
|
|
927
|
-
pattern,
|
|
928
|
-
matchScore: pattern.length / Math.max(taskLower.length, 1), // real ratio: pattern length vs task length
|
|
929
|
-
examples: [`Keyword "${pattern}" matched in task description`],
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
// Calculate real historical success rate from routing outcomes file
|
|
934
|
-
let historicalSuccess = null;
|
|
935
|
-
let historicalNote = 'No historical data yet';
|
|
936
|
-
try {
|
|
937
|
-
const outcomesPath = getRoutingOutcomesPath();
|
|
938
|
-
if (existsSync(outcomesPath)) {
|
|
939
|
-
const data = JSON.parse(readFileSync(outcomesPath, 'utf-8'));
|
|
940
|
-
const outcomes = data.outcomes || [];
|
|
941
|
-
if (outcomes.length > 0) {
|
|
942
|
-
historicalSuccess = outcomes.filter(o => o.success).length / outcomes.length;
|
|
943
|
-
historicalNote = `Calculated from ${outcomes.length} recorded outcomes`;
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
catch (e) {
|
|
948
|
-
// File unreadable or corrupt; leave as null
|
|
949
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
950
|
-
console.error('[hooks-explain] routing outcomes file read/parse failed:', e);
|
|
951
|
-
}
|
|
952
|
-
return {
|
|
953
|
-
task,
|
|
954
|
-
explanation: `The routing decision was made based on keyword analysis of the task description. ` +
|
|
955
|
-
`The task contains keywords that match the "${suggestion.agents[0]}" specialization with ${(suggestion.confidence * 100).toFixed(0)}% confidence.`,
|
|
956
|
-
factors: [
|
|
957
|
-
{ factor: 'Keyword Match', weight: 0.4, value: suggestion.confidence, impact: 'Primary routing signal' },
|
|
958
|
-
{ factor: 'Historical Success', weight: 0.3, value: historicalSuccess, impact: historicalNote },
|
|
959
|
-
{ factor: 'Agent Availability', weight: 0.2, value: null, impact: 'Agent availability tracking not implemented' },
|
|
960
|
-
{ factor: 'Task Complexity', weight: 0.1, value: task.length > 100 ? 0.8 : 0.3, impact: 'Complexity assessment' },
|
|
961
|
-
],
|
|
962
|
-
patterns: matchedPatterns.length > 0 ? matchedPatterns : [
|
|
963
|
-
{ pattern: 'general-task', matchScore: 0.7, examples: ['Default pattern for unclassified tasks'] }
|
|
964
|
-
],
|
|
965
|
-
decision: {
|
|
966
|
-
agent: suggestion.agents[0],
|
|
967
|
-
confidence: suggestion.confidence,
|
|
968
|
-
reasoning: [
|
|
969
|
-
`Task analysis identified ${matchedPatterns.length || 1} relevant patterns`,
|
|
970
|
-
`"${suggestion.agents[0]}" has highest capability match for this task type`,
|
|
971
|
-
historicalSuccess !== null
|
|
972
|
-
? `Historical success rate for similar tasks: ${(historicalSuccess * 100).toFixed(0)}%`
|
|
973
|
-
: `No historical outcome data available yet`,
|
|
974
|
-
`Confidence threshold met (${(suggestion.confidence * 100).toFixed(0)}% >= 70%)`,
|
|
975
|
-
],
|
|
976
|
-
},
|
|
977
|
-
};
|
|
978
|
-
},
|
|
979
|
-
};
|
|
980
|
-
// Pretrain hook - repository analysis for intelligence bootstrap
|
|
981
|
-
export const hooksPretrain = {
|
|
982
|
-
name: 'hooks_pretrain',
|
|
983
|
-
description: 'Walk the repository counting file extensions and directory patterns to seed the keyword router. This is a filesystem scan writing JSON state — despite the name, no model is trained.',
|
|
984
|
-
inputSchema: {
|
|
985
|
-
type: 'object',
|
|
986
|
-
properties: {
|
|
987
|
-
path: { type: 'string', description: 'Repository path' },
|
|
988
|
-
depth: { type: 'string', description: 'Analysis depth (shallow, medium, deep)' },
|
|
989
|
-
skipCache: { type: 'boolean', description: 'Skip cached analysis' },
|
|
990
|
-
},
|
|
991
|
-
},
|
|
992
|
-
handler: async (params) => {
|
|
993
|
-
const repoPath = resolve(params.path || '.');
|
|
994
|
-
const projectRoot = getProjectCwd();
|
|
995
|
-
if (repoPath !== projectRoot && !repoPath.startsWith(projectRoot + sep)) {
|
|
996
|
-
return { error: 'Invalid path: must be within the project directory.' };
|
|
997
|
-
}
|
|
998
|
-
const depth = params.depth || 'medium';
|
|
999
|
-
const startTime = performance.now();
|
|
1000
|
-
// Real file scanning — count files by extension, extract patterns
|
|
1001
|
-
const { readdirSync, statSync } = await import('node:fs');
|
|
1002
|
-
const extCounts = {};
|
|
1003
|
-
let filesAnalyzed = 0;
|
|
1004
|
-
let totalLines = 0;
|
|
1005
|
-
const maxDepth = depth === 'shallow' ? 2 : depth === 'deep' ? 6 : 4;
|
|
1006
|
-
const patterns = [];
|
|
1007
|
-
const scan = (dir, currentDepth) => {
|
|
1008
|
-
if (currentDepth > maxDepth)
|
|
1009
|
-
return;
|
|
1010
|
-
try {
|
|
1011
|
-
const entries = readdirSync(dir, { withFileTypes: true });
|
|
1012
|
-
for (const entry of entries) {
|
|
1013
|
-
if (entry.name.startsWith('.') || entry.name === 'node_modules' || entry.name === 'dist')
|
|
1014
|
-
continue;
|
|
1015
|
-
const full = join(dir, entry.name);
|
|
1016
|
-
if (entry.isDirectory()) {
|
|
1017
|
-
scan(full, currentDepth + 1);
|
|
1018
|
-
}
|
|
1019
|
-
else if (entry.isFile()) {
|
|
1020
|
-
const ext = entry.name.includes('.') ? entry.name.slice(entry.name.lastIndexOf('.')) : '';
|
|
1021
|
-
if (ext)
|
|
1022
|
-
extCounts[ext] = (extCounts[ext] || 0) + 1;
|
|
1023
|
-
filesAnalyzed++;
|
|
1024
|
-
// For code files, count lines and extract imports
|
|
1025
|
-
if (['.ts', '.js', '.py', '.go', '.rs', '.java'].includes(ext)) {
|
|
1026
|
-
try {
|
|
1027
|
-
// Skip very large files (minified bundles, generated code) to prevent OOM.
|
|
1028
|
-
// 1 MB is generous for a source file; anything larger is unlikely to have
|
|
1029
|
-
// useful import patterns in the first 30 lines anyway.
|
|
1030
|
-
const MAX_CODE_FILE_BYTES = 1 * 1024 * 1024;
|
|
1031
|
-
if (statSync(full).size > MAX_CODE_FILE_BYTES)
|
|
1032
|
-
continue;
|
|
1033
|
-
const content = readFileSync(full, 'utf-8');
|
|
1034
|
-
const lines = content.split('\n');
|
|
1035
|
-
totalLines += lines.length;
|
|
1036
|
-
// Extract import patterns (first 50 files max for performance)
|
|
1037
|
-
if (filesAnalyzed <= 50) {
|
|
1038
|
-
for (const line of lines.slice(0, 30)) {
|
|
1039
|
-
if (line.startsWith('import ') || line.startsWith('from ') || line.startsWith('const ') && line.includes('require(')) {
|
|
1040
|
-
const trimmed = line.trim();
|
|
1041
|
-
if (trimmed.length < 120 && !patterns.includes(trimmed))
|
|
1042
|
-
patterns.push(trimmed);
|
|
1043
|
-
if (patterns.length >= 100)
|
|
1044
|
-
break;
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
catch { /* skip unreadable */ }
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
catch { /* skip inaccessible dirs */ }
|
|
1055
|
-
};
|
|
1056
|
-
scan(repoPath, 0);
|
|
1057
|
-
const elapsed = Math.round(performance.now() - startTime);
|
|
1058
|
-
// Store extracted patterns in memory backend
|
|
1059
|
-
let patternsStored = 0;
|
|
1060
|
-
try {
|
|
1061
|
-
const bridge = await import('../memory/memory-bridge.js');
|
|
1062
|
-
await bridge.bridgeStoreEntry({
|
|
1063
|
-
key: `pretrain-${Date.now()}`,
|
|
1064
|
-
value: JSON.stringify({ filesAnalyzed, totalLines, topExtensions: Object.entries(extCounts).sort((a, b) => b[1] - a[1]).slice(0, 10), importPatterns: patterns.slice(0, 20) }),
|
|
1065
|
-
namespace: 'pretrain',
|
|
1066
|
-
tags: ['pretrain', depth],
|
|
1067
|
-
});
|
|
1068
|
-
patternsStored = patterns.length;
|
|
1069
|
-
}
|
|
1070
|
-
catch (e) {
|
|
1071
|
-
/* memory backend unavailable */
|
|
1072
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
1073
|
-
console.error('[hooks-pretrain] pattern store failed:', e);
|
|
1074
|
-
}
|
|
1075
|
-
// Feed extracted import patterns into the neural training system so
|
|
1076
|
-
// pretrain actually trains, not just scans.
|
|
1077
|
-
let neuralPatternsLearned = 0;
|
|
1078
|
-
if (patterns.length > 0) {
|
|
1079
|
-
try {
|
|
1080
|
-
const intel = await import('../memory/intelligence.js');
|
|
1081
|
-
await intel.initializeIntelligence({ confidenceLearningRate: 0.002, maxTrajectorySize: patterns.length });
|
|
1082
|
-
// Record each extracted pattern as an action step
|
|
1083
|
-
for (const pat of patterns.slice(0, 50)) {
|
|
1084
|
-
await intel.recordStep({ type: 'action', content: pat, metadata: { source: 'pretrain', depth } });
|
|
1085
|
-
}
|
|
1086
|
-
// Record the entire scan as a completed trajectory
|
|
1087
|
-
const steps = patterns.slice(0, 50).map(p => ({ type: 'action', content: p }));
|
|
1088
|
-
await intel.recordTrajectory(steps, 'success');
|
|
1089
|
-
intel.flushPatterns();
|
|
1090
|
-
neuralPatternsLearned = steps.length;
|
|
1091
|
-
}
|
|
1092
|
-
catch (e) {
|
|
1093
|
-
/* intelligence not available */
|
|
1094
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
1095
|
-
console.error('[hooks-pretrain] intelligence training failed:', e);
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
return {
|
|
1099
|
-
success: true,
|
|
1100
|
-
_real: true,
|
|
1101
|
-
path: repoPath,
|
|
1102
|
-
depth,
|
|
1103
|
-
durationMs: elapsed,
|
|
1104
|
-
stats: {
|
|
1105
|
-
filesAnalyzed,
|
|
1106
|
-
totalLines,
|
|
1107
|
-
patternsExtracted: patterns.length,
|
|
1108
|
-
patternsStored,
|
|
1109
|
-
neuralPatternsLearned,
|
|
1110
|
-
fileTypes: Object.entries(extCounts).sort((a, b) => b[1] - a[1]).slice(0, 15).map(([ext, count]) => ({ ext, count })),
|
|
1111
|
-
},
|
|
1112
|
-
};
|
|
1113
|
-
},
|
|
1114
|
-
};
|
|
1115
|
-
// Build agents hook - generate optimized agent configs
|
|
1116
|
-
export const hooksBuildAgents = {
|
|
1117
|
-
name: 'hooks_build-agents',
|
|
1118
|
-
description: 'Generate optimized agent configurations from pretrain data',
|
|
1119
|
-
inputSchema: {
|
|
1120
|
-
type: 'object',
|
|
1121
|
-
properties: {
|
|
1122
|
-
outputDir: { type: 'string', description: 'Output directory for configs' },
|
|
1123
|
-
focus: { type: 'string', description: 'Focus area (v1-implementation, security, performance, all)' },
|
|
1124
|
-
format: { type: 'string', description: 'Config format (yaml, json)' },
|
|
1125
|
-
persist: { type: 'boolean', description: 'Write configs to disk' },
|
|
1126
|
-
},
|
|
1127
|
-
},
|
|
1128
|
-
handler: async (params) => {
|
|
1129
|
-
const rawOutputDir = resolve(params.outputDir || './agents');
|
|
1130
|
-
const outputDir = rawOutputDir;
|
|
1131
|
-
if (!outputDir.startsWith(getProjectCwd() + sep) && outputDir !== getProjectCwd()) {
|
|
1132
|
-
return { error: 'Invalid outputDir: must be within the project directory.' };
|
|
1133
|
-
}
|
|
1134
|
-
const focus = params.focus || 'all';
|
|
1135
|
-
// Strict allowlist on `format` — without this, `format = "yaml/../../../etc/cron.d/x"`
|
|
1136
|
-
// collapses through `join` and lets writes escape the validated outputDir.
|
|
1137
|
-
const ALLOWED_FORMATS = new Set(['yaml', 'json']);
|
|
1138
|
-
const formatRaw = params.format || 'yaml';
|
|
1139
|
-
if (!ALLOWED_FORMATS.has(formatRaw)) {
|
|
1140
|
-
return { error: 'Invalid format: must be yaml or json' };
|
|
1141
|
-
}
|
|
1142
|
-
const format = formatRaw;
|
|
1143
|
-
const persist = params.persist !== false; // Default to true
|
|
1144
|
-
const agents = [
|
|
1145
|
-
{ type: 'coder', configFile: join(outputDir, `coder.${format}`), capabilities: ['code-generation', 'refactoring', 'debugging'], optimizations: ['token-reduction', 'context-caching'] },
|
|
1146
|
-
{ type: 'architect', configFile: join(outputDir, `architect.${format}`), capabilities: ['system-design', 'api-design', 'documentation'], optimizations: ['context-caching', 'memory-persistence'] },
|
|
1147
|
-
{ type: 'tester', configFile: join(outputDir, `tester.${format}`), capabilities: ['unit-testing', 'integration-testing', 'coverage'], optimizations: ['parallel-execution'] },
|
|
1148
|
-
{ type: 'security-architect', configFile: join(outputDir, `security-architect.${format}`), capabilities: ['threat-modeling', 'vulnerability-analysis', 'security-review'], optimizations: ['pattern-matching'] },
|
|
1149
|
-
{ type: 'reviewer', configFile: join(outputDir, `reviewer.${format}`), capabilities: ['code-review', 'quality-analysis', 'best-practices'], optimizations: ['incremental-analysis'] },
|
|
1150
|
-
];
|
|
1151
|
-
const filteredAgents = focus === 'all' ? agents :
|
|
1152
|
-
focus === 'security' ? agents.filter(a => a.type.includes('security') || a.type === 'reviewer') :
|
|
1153
|
-
focus === 'performance' ? agents.filter(a => ['coder', 'tester'].includes(a.type)) :
|
|
1154
|
-
agents;
|
|
1155
|
-
// Persist configs to disk if requested
|
|
1156
|
-
if (persist) {
|
|
1157
|
-
// Ensure output directory exists
|
|
1158
|
-
if (!existsSync(outputDir)) {
|
|
1159
|
-
mkdirSync(outputDir, { recursive: true });
|
|
1160
|
-
}
|
|
1161
|
-
// Write each agent config
|
|
1162
|
-
for (const agent of filteredAgents) {
|
|
1163
|
-
const config = {
|
|
1164
|
-
type: agent.type,
|
|
1165
|
-
capabilities: agent.capabilities,
|
|
1166
|
-
optimizations: agent.optimizations,
|
|
1167
|
-
version: '3.0.0',
|
|
1168
|
-
createdAt: new Date().toISOString(),
|
|
1169
|
-
};
|
|
1170
|
-
const content = format === 'json'
|
|
1171
|
-
? JSON.stringify(config, null, 2)
|
|
1172
|
-
: `# ${agent.type} agent configuration\ntype: ${agent.type}\nversion: "3.0.0"\ncapabilities:\n${agent.capabilities.map(c => ` - ${c}`).join('\n')}\noptimizations:\n${agent.optimizations.map(o => ` - ${o}`).join('\n')}\ncreatedAt: "${config.createdAt}"\n`;
|
|
1173
|
-
const _cftmp = agent.configFile + '.tmp';
|
|
1174
|
-
writeFileSync(_cftmp, content, 'utf-8');
|
|
1175
|
-
renameSync(_cftmp, agent.configFile);
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
return {
|
|
1179
|
-
outputDir,
|
|
1180
|
-
focus,
|
|
1181
|
-
persisted: persist,
|
|
1182
|
-
agents: filteredAgents,
|
|
1183
|
-
stats: {
|
|
1184
|
-
configsGenerated: filteredAgents.length,
|
|
1185
|
-
patternsApplied: filteredAgents.length * 3,
|
|
1186
|
-
optimizationsIncluded: filteredAgents.reduce((acc, a) => acc + a.optimizations.length, 0),
|
|
1187
|
-
},
|
|
1188
|
-
};
|
|
1189
|
-
},
|
|
1190
|
-
};
|
|
1191
|
-
// Transfer hook - transfer patterns from another project
|
|
1192
|
-
export const hooksTransfer = {
|
|
1193
|
-
name: 'hooks_transfer',
|
|
1194
|
-
description: 'Transfer learned patterns from another project',
|
|
1195
|
-
inputSchema: {
|
|
1196
|
-
type: 'object',
|
|
1197
|
-
properties: {
|
|
1198
|
-
sourcePath: { type: 'string', description: 'Source project path' },
|
|
1199
|
-
filter: { type: 'string', description: 'Filter patterns by type' },
|
|
1200
|
-
minConfidence: { type: 'number', description: 'Minimum confidence threshold' },
|
|
1201
|
-
},
|
|
1202
|
-
required: ['sourcePath'],
|
|
1203
|
-
},
|
|
1204
|
-
handler: async (params) => {
|
|
1205
|
-
const sourcePath = params.sourcePath;
|
|
1206
|
-
const minConfidence = params.minConfidence || 0.7;
|
|
1207
|
-
const filter = params.filter;
|
|
1208
|
-
// Validate sourcePath is an existing directory before reading from it
|
|
1209
|
-
const resolvedSource = resolve(sourcePath);
|
|
1210
|
-
const { statSync } = await import('fs');
|
|
1211
|
-
const { homedir } = await import('os');
|
|
1212
|
-
const home = homedir();
|
|
1213
|
-
if (resolvedSource !== home && !resolvedSource.startsWith(home + sep)) {
|
|
1214
|
-
return { error: 'sourcePath must be within the home directory.' };
|
|
1215
|
-
}
|
|
1216
|
-
try {
|
|
1217
|
-
const st = statSync(resolvedSource);
|
|
1218
|
-
if (!st.isDirectory()) {
|
|
1219
|
-
return { error: 'sourcePath must be a directory' };
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
catch {
|
|
1223
|
-
return { error: 'sourcePath does not exist' };
|
|
1224
|
-
}
|
|
1225
|
-
// Try to load patterns from source project's memory store
|
|
1226
|
-
const sourceMemoryPath = join(resolvedSource, MEMORY_DIR, MEMORY_FILE);
|
|
1227
|
-
let sourceStore = { entries: {}, version: '3.0.0' };
|
|
1228
|
-
const MAX_SOURCE_STORE_BYTES = 50 * 1024 * 1024; // 50 MB — matches other store readers
|
|
1229
|
-
try {
|
|
1230
|
-
if (existsSync(sourceMemoryPath) && statSync(sourceMemoryPath).size <= MAX_SOURCE_STORE_BYTES) {
|
|
1231
|
-
sourceStore = JSON.parse(readFileSync(sourceMemoryPath, 'utf-8'));
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
catch (e) {
|
|
1235
|
-
// Fall back to empty store
|
|
1236
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
1237
|
-
console.error('[hooks-transfer] source memory store read/parse failed:', e);
|
|
1238
|
-
}
|
|
1239
|
-
const sourceEntries = Object.values(sourceStore.entries);
|
|
1240
|
-
// Count patterns by type from source
|
|
1241
|
-
const byType = {
|
|
1242
|
-
'file-patterns': sourceEntries.filter(e => e.key.includes('file') || e.metadata?.type === 'file-pattern').length,
|
|
1243
|
-
'task-routing': sourceEntries.filter(e => e.key.includes('routing') || e.metadata?.type === 'routing').length,
|
|
1244
|
-
'command-risk': sourceEntries.filter(e => e.key.includes('command') || e.metadata?.type === 'command-risk').length,
|
|
1245
|
-
'agent-success': sourceEntries.filter(e => e.key.includes('agent') || e.metadata?.type === 'agent-success').length,
|
|
1246
|
-
};
|
|
1247
|
-
// If source has no patterns, report honestly instead of substituting demo data
|
|
1248
|
-
if (Object.values(byType).every(v => v === 0)) {
|
|
1249
|
-
return {
|
|
1250
|
-
success: false,
|
|
1251
|
-
message: 'No patterns found in source project',
|
|
1252
|
-
sourcePath,
|
|
1253
|
-
transferred: 0,
|
|
1254
|
-
};
|
|
1255
|
-
}
|
|
1256
|
-
if (filter) {
|
|
1257
|
-
Object.keys(byType).forEach(key => {
|
|
1258
|
-
if (!key.includes(filter))
|
|
1259
|
-
delete byType[key];
|
|
1260
|
-
});
|
|
1261
|
-
}
|
|
1262
|
-
const total = Object.values(byType).reduce((a, b) => a + b, 0);
|
|
1263
|
-
return {
|
|
1264
|
-
success: true,
|
|
1265
|
-
sourcePath,
|
|
1266
|
-
transferred: {
|
|
1267
|
-
total,
|
|
1268
|
-
byType,
|
|
1269
|
-
},
|
|
1270
|
-
dataSource: 'source-project',
|
|
1271
|
-
};
|
|
1272
|
-
},
|
|
1273
|
-
};
|
|
1274
|
-
// Session start hook
|
|
1275
|
-
export const hooksSessionStart = {
|
|
1276
|
-
name: 'hooks_session-start',
|
|
1277
|
-
description: 'Initialize a new session',
|
|
1278
|
-
inputSchema: {
|
|
1279
|
-
type: 'object',
|
|
1280
|
-
properties: {
|
|
1281
|
-
sessionId: { type: 'string', description: 'Optional session ID' },
|
|
1282
|
-
restoreLatest: { type: 'boolean', description: 'Restore latest session state' },
|
|
1283
|
-
},
|
|
1284
|
-
},
|
|
1285
|
-
handler: async (params) => {
|
|
1286
|
-
const sessionId = params.sessionId || `session-${Date.now()}`;
|
|
1287
|
-
const restoreLatest = params.restoreLatest;
|
|
1288
|
-
// Phase 5: Wire ReflexionMemory session start via bridge
|
|
1289
|
-
let sessionMemory = null;
|
|
1290
|
-
try {
|
|
1291
|
-
const bridge = await import('../memory/memory-bridge.js');
|
|
1292
|
-
const result = await bridge.bridgeSessionStart({
|
|
1293
|
-
sessionId,
|
|
1294
|
-
metadata: { context: restoreLatest ? 'restore previous session patterns' : 'new session' },
|
|
1295
|
-
});
|
|
1296
|
-
if (result) {
|
|
1297
|
-
sessionMemory = {
|
|
1298
|
-
controller: result.success ? 'lancedb' : 'none',
|
|
1299
|
-
restoredPatterns: 0,
|
|
1300
|
-
};
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
catch (e) {
|
|
1304
|
-
// Bridge not available
|
|
1305
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
1306
|
-
console.error('[hooks-session-start] memory bridge failed:', e);
|
|
1307
|
-
}
|
|
1308
|
-
return {
|
|
1309
|
-
sessionId,
|
|
1310
|
-
started: new Date().toISOString(),
|
|
1311
|
-
restored: restoreLatest,
|
|
1312
|
-
config: {
|
|
1313
|
-
intelligenceEnabled: true,
|
|
1314
|
-
hooksEnabled: true,
|
|
1315
|
-
memoryPersistence: true,
|
|
1316
|
-
},
|
|
1317
|
-
sessionMemory: sessionMemory || { controller: 'none', restoredPatterns: 0 },
|
|
1318
|
-
previousSession: restoreLatest ? {
|
|
1319
|
-
id: `session-${Date.now() - 86400000}`,
|
|
1320
|
-
tasksRestored: sessionMemory?.restoredPatterns || 0,
|
|
1321
|
-
memoryRestored: sessionMemory?.restoredPatterns || 0,
|
|
1322
|
-
} : null,
|
|
1323
|
-
};
|
|
1324
|
-
},
|
|
1325
|
-
};
|
|
1326
|
-
// Session restore hook — hooks.ts's `hooks session-restore` (and its
|
|
1327
|
-
// `session-start` alias) called this tool name, but it was never registered
|
|
1328
|
-
// anywhere in the tool registry, so both always failed. This repo has no
|
|
1329
|
-
// per-session snapshot of agents/tasks to restore from, so "restore" here
|
|
1330
|
-
// means: report the currently-live (non-terminated/non-terminal) agents and
|
|
1331
|
-
// tasks as "carried forward", and reinitialize the memory-bridge session
|
|
1332
|
-
// context the same way hooks_session-start does — an honest, working
|
|
1333
|
-
// implementation rather than a fabricated one.
|
|
1334
|
-
export const hooksSessionRestore = {
|
|
1335
|
-
name: 'hooks_session-restore',
|
|
1336
|
-
description: 'Restore a previous session — reports currently-live agents/tasks and reinitializes memory-bridge session context',
|
|
1337
|
-
inputSchema: {
|
|
1338
|
-
type: 'object',
|
|
1339
|
-
properties: {
|
|
1340
|
-
sessionId: { type: 'string', description: 'Session ID to restore, or "latest"' },
|
|
1341
|
-
restoreAgents: { type: 'boolean', description: 'Include a count of currently-live agents (default true)' },
|
|
1342
|
-
restoreTasks: { type: 'boolean', description: 'Include a count of currently-live tasks (default true)' },
|
|
1343
|
-
},
|
|
1344
|
-
},
|
|
1345
|
-
handler: async (params) => {
|
|
1346
|
-
const originalSessionId = params.sessionId || 'latest';
|
|
1347
|
-
const newSessionId = `session-${Date.now()}`;
|
|
1348
|
-
const warnings = [];
|
|
1349
|
-
let agentsRestored = 0;
|
|
1350
|
-
if (params.restoreAgents !== false) {
|
|
1351
|
-
try {
|
|
1352
|
-
const { loadAgentStore } = await import('./agent-tools.js');
|
|
1353
|
-
const store = loadAgentStore();
|
|
1354
|
-
agentsRestored = Object.values(store.agents).filter((a) => a.status !== 'terminated').length;
|
|
1355
|
-
}
|
|
1356
|
-
catch (e) {
|
|
1357
|
-
warnings.push('Agent store unavailable — agent count not restored');
|
|
1358
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
1359
|
-
console.error('[hooks-session-restore] agent store read failed:', e);
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
let tasksRestored = 0;
|
|
1363
|
-
if (params.restoreTasks !== false) {
|
|
1364
|
-
try {
|
|
1365
|
-
const { loadTaskStore } = await import('./task-tools.js');
|
|
1366
|
-
const store = loadTaskStore();
|
|
1367
|
-
tasksRestored = Object.values(store.tasks).filter((t) => t.status === 'pending' || t.status === 'in_progress').length;
|
|
1368
|
-
}
|
|
1369
|
-
catch (e) {
|
|
1370
|
-
warnings.push('Task store unavailable — task count not restored');
|
|
1371
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
1372
|
-
console.error('[hooks-session-restore] task store read failed:', e);
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
// bridgeSessionStart only stores a new "session active" marker entry —
|
|
1376
|
-
// it has no pattern-restoration data to count, so there is no real
|
|
1377
|
-
// "memoryRestored" number to report. Track whether the bridge itself
|
|
1378
|
-
// came up instead of faking a count.
|
|
1379
|
-
let memoryBridgeInitialized = false;
|
|
1380
|
-
try {
|
|
1381
|
-
const bridge = await import('../memory/memory-bridge.js');
|
|
1382
|
-
const result = await bridge.bridgeSessionStart({
|
|
1383
|
-
sessionId: newSessionId,
|
|
1384
|
-
metadata: { context: 'restore previous session patterns' },
|
|
1385
|
-
});
|
|
1386
|
-
if (result) {
|
|
1387
|
-
memoryBridgeInitialized = result.success;
|
|
1388
|
-
}
|
|
1389
|
-
else {
|
|
1390
|
-
warnings.push('Memory bridge unavailable — pattern restoration skipped');
|
|
1391
|
-
}
|
|
1392
|
-
}
|
|
1393
|
-
catch (e) {
|
|
1394
|
-
warnings.push('Memory bridge failed to initialize');
|
|
1395
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
1396
|
-
console.error('[hooks-session-restore] memory bridge failed:', e);
|
|
1397
|
-
}
|
|
1398
|
-
return {
|
|
1399
|
-
sessionId: newSessionId,
|
|
1400
|
-
originalSessionId,
|
|
1401
|
-
restoredState: { tasksRestored, agentsRestored, memoryBridgeInitialized },
|
|
1402
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
1403
|
-
};
|
|
1404
|
-
},
|
|
1405
|
-
};
|
|
1406
|
-
// Session end hook - persists state
|
|
1407
|
-
export const hooksSessionEnd = {
|
|
1408
|
-
name: 'hooks_session-end',
|
|
1409
|
-
description: 'End current session and persist state',
|
|
1410
|
-
inputSchema: {
|
|
1411
|
-
type: 'object',
|
|
1412
|
-
properties: {
|
|
1413
|
-
saveState: { type: 'boolean', description: 'Save session state' },
|
|
1414
|
-
exportMetrics: { type: 'boolean', description: 'Export session metrics' },
|
|
1415
|
-
},
|
|
1416
|
-
},
|
|
1417
|
-
handler: async (params) => {
|
|
1418
|
-
const saveState = params.saveState !== false;
|
|
1419
|
-
// Use caller-supplied sessionId if provided, otherwise generate a current-time ID.
|
|
1420
|
-
// The -3600000 offset was incorrect — it prevented matching session-start IDs.
|
|
1421
|
-
const sessionId = typeof params.sessionId === 'string' && params.sessionId
|
|
1422
|
-
? params.sessionId
|
|
1423
|
-
: `session-${Date.now()}`;
|
|
1424
|
-
// Read actual counts from stores
|
|
1425
|
-
const store = loadMemoryStore();
|
|
1426
|
-
const allEntries = Object.values(store.entries);
|
|
1427
|
-
const taskCount = allEntries.filter(e => e.key.includes('task')).length;
|
|
1428
|
-
const agentCount = allEntries.filter(e => e.key.includes('agent')).length;
|
|
1429
|
-
const patternCount = allEntries.filter(e => e.key.includes('pattern')).length;
|
|
1430
|
-
const trajectoryCount = activeTrajectories.size;
|
|
1431
|
-
// Check for pending-insights.jsonl
|
|
1432
|
-
let insightCount = 0;
|
|
1433
|
-
try {
|
|
1434
|
-
const insightsPath = join(getProjectCwd(), '.monomind', 'data', 'pending-insights.jsonl');
|
|
1435
|
-
if (existsSync(insightsPath)) {
|
|
1436
|
-
const content = readFileSync(insightsPath, 'utf-8').trim();
|
|
1437
|
-
insightCount = content ? content.split('\n').length : 0;
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
catch {
|
|
1441
|
-
// File not available
|
|
1442
|
-
}
|
|
1443
|
-
// Phase 5: Wire ReflexionMemory session end + NightlyLearner consolidation via bridge
|
|
1444
|
-
let sessionPersistence = null;
|
|
1445
|
-
try {
|
|
1446
|
-
const bridge = await import('../memory/memory-bridge.js');
|
|
1447
|
-
const result = await bridge.bridgeSessionEnd({
|
|
1448
|
-
sessionId,
|
|
1449
|
-
summary: saveState ? 'Session ended with state saved' : 'Session ended',
|
|
1450
|
-
metrics: { tasksCompleted: taskCount, patternsLearned: patternCount },
|
|
1451
|
-
});
|
|
1452
|
-
if (result) {
|
|
1453
|
-
sessionPersistence = {
|
|
1454
|
-
controller: result.success ? 'lancedb' : 'none',
|
|
1455
|
-
persisted: result.success,
|
|
1456
|
-
};
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
catch (e) {
|
|
1460
|
-
// Bridge not available
|
|
1461
|
-
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
1462
|
-
console.error('[hooks-session-end] memory bridge failed:', e);
|
|
1463
|
-
}
|
|
1464
|
-
return {
|
|
1465
|
-
sessionId,
|
|
1466
|
-
statePath: saveState ? `.claude/sessions/${sessionId}.json` : undefined,
|
|
1467
|
-
sessionPersistence: sessionPersistence || { controller: 'none', persisted: false },
|
|
1468
|
-
summary: {
|
|
1469
|
-
tasksExecuted: taskCount,
|
|
1470
|
-
filesModified: 0,
|
|
1471
|
-
agentsSpawned: agentCount,
|
|
1472
|
-
pendingInsights: insightCount,
|
|
1473
|
-
memoryEntries: allEntries.length,
|
|
1474
|
-
},
|
|
1475
|
-
learningUpdates: {
|
|
1476
|
-
patternsLearned: patternCount,
|
|
1477
|
-
trajectoriesRecorded: trajectoryCount,
|
|
1478
|
-
},
|
|
1479
|
-
};
|
|
1480
|
-
},
|
|
1481
|
-
};
|
|
1482
|
-
// Intelligence hook - JS pattern/trajectory logging
|
|
1483
|
-
export const hooksIntelligence = {
|
|
1484
|
-
name: 'hooks_intelligence',
|
|
1485
|
-
description: 'Intelligence status: pattern/trajectory logging metrics from the memory store',
|
|
1486
|
-
inputSchema: {
|
|
1487
|
-
type: 'object',
|
|
1488
|
-
properties: {
|
|
1489
|
-
mode: { type: 'string', description: 'Intelligence mode' },
|
|
1490
|
-
enableSona: { type: 'boolean', description: 'Enable SONA learning' },
|
|
1491
|
-
enableMoe: { type: 'boolean', description: 'Enable MoE routing' },
|
|
1492
|
-
enableHnsw: { type: 'boolean', description: 'Enable HNSW search' },
|
|
1493
|
-
forceTraining: { type: 'boolean', description: 'Force training cycle' },
|
|
1494
|
-
showStatus: { type: 'boolean', description: 'Show status only' },
|
|
1495
|
-
},
|
|
1496
|
-
},
|
|
1497
|
-
handler: async (params) => {
|
|
1498
|
-
const mode = params.mode || 'balanced';
|
|
1499
|
-
const enableSona = params.enableSona !== false;
|
|
1500
|
-
const enableMoe = params.enableMoe !== false;
|
|
1501
|
-
const enableHnsw = params.enableHnsw !== false;
|
|
1502
|
-
// Get REAL statistics from memory store
|
|
1503
|
-
const realStats = getIntelligenceStatsFromMemory();
|
|
1504
|
-
// Check actual implementation availability
|
|
1505
|
-
const sonaAvailable = (await getSONAOptimizer()) !== null;
|
|
1506
|
-
return {
|
|
1507
|
-
mode,
|
|
1508
|
-
status: 'active',
|
|
1509
|
-
components: {
|
|
1510
|
-
sona: {
|
|
1511
|
-
enabled: enableSona,
|
|
1512
|
-
status: sonaAvailable ? 'active' : 'idle',
|
|
1513
|
-
implemented: true,
|
|
1514
|
-
trajectoriesRecorded: realStats.trajectories.total,
|
|
1515
|
-
trajectoriesSuccessful: realStats.trajectories.successful,
|
|
1516
|
-
patternsLearned: realStats.patterns.learned,
|
|
1517
|
-
note: 'Trajectory + pattern logging (no neural training in the lean build)',
|
|
1518
|
-
},
|
|
1519
|
-
moe: {
|
|
1520
|
-
enabled: false,
|
|
1521
|
-
status: 'removed',
|
|
1522
|
-
implemented: false,
|
|
1523
|
-
routingDecisions: realStats.routing.decisions,
|
|
1524
|
-
note: 'MoE removed in lean build; keyword routing is used instead (see monoes-full-loop)',
|
|
1525
|
-
},
|
|
1526
|
-
hnsw: {
|
|
1527
|
-
enabled: enableHnsw,
|
|
1528
|
-
status: enableHnsw ? 'active' : 'disabled',
|
|
1529
|
-
implemented: true,
|
|
1530
|
-
indexSize: realStats.memory.indexSize,
|
|
1531
|
-
memorySizeBytes: realStats.memory.memorySizeBytes,
|
|
1532
|
-
note: 'Pure-JS HNSW vector indexing (O(log n) vs O(n))',
|
|
1533
|
-
},
|
|
1534
|
-
flashAttention: {
|
|
1535
|
-
enabled: false,
|
|
1536
|
-
status: 'removed',
|
|
1537
|
-
implemented: false,
|
|
1538
|
-
note: 'Flash Attention removed in lean build; lives on monoes-full-loop branch',
|
|
1539
|
-
},
|
|
1540
|
-
ewc: {
|
|
1541
|
-
enabled: false,
|
|
1542
|
-
status: 'removed',
|
|
1543
|
-
implemented: false,
|
|
1544
|
-
note: 'EWC++ removed in lean build; lives on monoes-full-loop branch',
|
|
1545
|
-
},
|
|
1546
|
-
lora: {
|
|
1547
|
-
enabled: false,
|
|
1548
|
-
status: 'removed',
|
|
1549
|
-
implemented: false,
|
|
1550
|
-
note: 'LoRA removed in lean build; lives on monoes-full-loop branch',
|
|
1551
|
-
},
|
|
1552
|
-
embeddings: {
|
|
1553
|
-
provider: 'transformers',
|
|
1554
|
-
model: 'Xenova/all-MiniLM-L6-v2',
|
|
1555
|
-
dimension: 384,
|
|
1556
|
-
implemented: true,
|
|
1557
|
-
note: 'Real ONNX embeddings via Xenova/all-MiniLM-L6-v2',
|
|
1558
|
-
},
|
|
1559
|
-
},
|
|
1560
|
-
realMetrics: {
|
|
1561
|
-
trajectories: realStats.trajectories,
|
|
1562
|
-
patterns: realStats.patterns,
|
|
1563
|
-
memory: realStats.memory,
|
|
1564
|
-
routing: realStats.routing,
|
|
1565
|
-
},
|
|
1566
|
-
implementationStatus: {
|
|
1567
|
-
working: [
|
|
1568
|
-
'memory-store', 'embeddings', 'trajectory-recording', 'claims', 'swarm-coordination',
|
|
1569
|
-
'hnsw-index', 'pattern-storage', 'keyword-routing'
|
|
1570
|
-
],
|
|
1571
|
-
partial: [],
|
|
1572
|
-
notImplemented: [],
|
|
1573
|
-
removed: [
|
|
1574
|
-
'moe-routing', 'flash-attention', 'lora-adapter',
|
|
1575
|
-
'native-sona-engine', 'native-router', 'native-attention',
|
|
1576
|
-
],
|
|
1577
|
-
},
|
|
1578
|
-
version: '3.0.0-alpha.102',
|
|
1579
|
-
};
|
|
1580
|
-
},
|
|
1581
|
-
};
|
|
1582
|
-
//# sourceMappingURL=hooks-routing.js.map
|