@monoes/monomindcli 2.8.4 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/helpers/auto-memory-hook.mjs +0 -0
- package/.claude/helpers/handlers/route-handler.cjs +12 -0
- package/.claude/helpers/handlers/session-restore-handler.cjs +28 -7
- package/.claude/helpers/hook-handler.cjs +0 -0
- package/.claude/helpers/utils/micro-agents.cjs +22 -0
- package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +11 -6
- package/.claude/skills/monodesign/scripts/live-inject.mjs +20 -7
- package/.claude/skills/monodesign/scripts/live-server.mjs +38 -2
- package/LICENSE +191 -0
- package/README.md +8 -6
- package/dist/src/browser/dashboard/server.d.ts +5 -0
- package/dist/src/browser/dashboard/server.d.ts.map +1 -1
- package/dist/src/browser/dashboard/server.js +59 -4
- package/dist/src/browser/dashboard/server.js.map +1 -1
- package/dist/src/browser/dashboard/ui.html +18 -8
- package/dist/src/browser/workflow/store.d.ts.map +1 -1
- package/dist/src/browser/workflow/store.js +3 -2
- package/dist/src/browser/workflow/store.js.map +1 -1
- package/dist/src/capabilities/cap-documents.d.ts.map +1 -1
- package/dist/src/capabilities/cap-documents.js +14 -9
- package/dist/src/capabilities/cap-documents.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +22 -18
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/download-embeddings.d.ts +8 -0
- package/dist/src/commands/download-embeddings.d.ts.map +1 -0
- package/dist/src/commands/download-embeddings.js +34 -0
- package/dist/src/commands/download-embeddings.js.map +1 -0
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +14 -0
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +4 -0
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init-wizard.js +1 -1
- package/dist/src/commands/init-wizard.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +48 -1
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/monograph.d.ts.map +1 -1
- package/dist/src/commands/monograph.js +35 -1
- package/dist/src/commands/monograph.js.map +1 -1
- package/dist/src/commands/org-observe.d.ts +10 -0
- package/dist/src/commands/org-observe.d.ts.map +1 -1
- package/dist/src/commands/org-observe.js +195 -31
- package/dist/src/commands/org-observe.js.map +1 -1
- package/dist/src/commands/org.d.ts +1 -0
- package/dist/src/commands/org.d.ts.map +1 -1
- package/dist/src/commands/org.js +139 -3
- package/dist/src/commands/org.js.map +1 -1
- package/dist/src/commands/route.d.ts +1 -9
- package/dist/src/commands/route.d.ts.map +1 -1
- package/dist/src/commands/route.js +42 -65
- package/dist/src/commands/route.js.map +1 -1
- package/dist/src/commands/security-cve.d.ts.map +1 -1
- package/dist/src/commands/security-cve.js +2 -1
- package/dist/src/commands/security-cve.js.map +1 -1
- package/dist/src/index.d.ts +0 -10
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -15
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/copy-assets.d.ts +17 -0
- package/dist/src/init/copy-assets.d.ts.map +1 -0
- package/dist/src/init/copy-assets.js +271 -0
- package/dist/src/init/copy-assets.js.map +1 -0
- package/dist/src/init/executor.d.ts +2 -30
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +56 -2493
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts.map +1 -1
- package/dist/src/init/helpers-generator.js +9 -0
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +0 -4
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/shared.d.ts +112 -0
- package/dist/src/init/shared.d.ts.map +1 -0
- package/dist/src/init/shared.js +475 -0
- package/dist/src/init/shared.js.map +1 -0
- package/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +37 -0
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +1 -1
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/upgrade.d.ts +34 -0
- package/dist/src/init/upgrade.d.ts.map +1 -0
- package/dist/src/init/upgrade.js +477 -0
- package/dist/src/init/upgrade.js.map +1 -0
- package/dist/src/init/write-antigravity.d.ts +13 -0
- package/dist/src/init/write-antigravity.d.ts.map +1 -0
- package/dist/src/init/write-antigravity.js +117 -0
- package/dist/src/init/write-antigravity.js.map +1 -0
- package/dist/src/init/write-capabilities.d.ts +9 -0
- package/dist/src/init/write-capabilities.d.ts.map +1 -0
- package/dist/src/init/write-capabilities.js +392 -0
- package/dist/src/init/write-capabilities.js.map +1 -0
- package/dist/src/init/write-claude.d.ts +25 -0
- package/dist/src/init/write-claude.d.ts.map +1 -0
- package/dist/src/init/write-claude.js +279 -0
- package/dist/src/init/write-claude.js.map +1 -0
- package/dist/src/init/write-kimicode.d.ts +19 -0
- package/dist/src/init/write-kimicode.d.ts.map +1 -0
- package/dist/src/init/write-kimicode.js +223 -0
- package/dist/src/init/write-kimicode.js.map +1 -0
- package/dist/src/init/write-opencode.d.ts +14 -0
- package/dist/src/init/write-opencode.d.ts.map +1 -0
- package/dist/src/init/write-opencode.js +130 -0
- package/dist/src/init/write-opencode.js.map +1 -0
- package/dist/src/init/write-runtime-config.d.ts +14 -0
- package/dist/src/init/write-runtime-config.d.ts.map +1 -0
- package/dist/src/init/write-runtime-config.js +214 -0
- package/dist/src/init/write-runtime-config.js.map +1 -0
- package/dist/src/init/write-sample-org.d.ts +9 -0
- package/dist/src/init/write-sample-org.d.ts.map +1 -0
- package/dist/src/init/write-sample-org.js +39 -0
- package/dist/src/init/write-sample-org.js.map +1 -0
- package/dist/src/knowledge/eval/golden-set.js +1 -1
- package/dist/src/knowledge/eval/golden-set.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.js +2 -25
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
- package/dist/src/mcp-tools/auto-install.d.ts.map +1 -1
- package/dist/src/mcp-tools/auto-install.js +2 -1
- package/dist/src/mcp-tools/auto-install.js.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.js +26 -0
- package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +2 -37
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/monograph/agent-history-tools.d.ts +5 -0
- package/dist/src/mcp-tools/monograph/agent-history-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/agent-history-tools.js +177 -0
- package/dist/src/mcp-tools/monograph/agent-history-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/build-tools.d.ts +9 -0
- package/dist/src/mcp-tools/monograph/build-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/build-tools.js +299 -0
- package/dist/src/mcp-tools/monograph/build-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/group-tools.d.ts +10 -0
- package/dist/src/mcp-tools/monograph/group-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/group-tools.js +225 -0
- package/dist/src/mcp-tools/monograph/group-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/health-tools.d.ts +6 -0
- package/dist/src/mcp-tools/monograph/health-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/health-tools.js +113 -0
- package/dist/src/mcp-tools/monograph/health-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/impact-tools.d.ts +9 -0
- package/dist/src/mcp-tools/monograph/impact-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/impact-tools.js +532 -0
- package/dist/src/mcp-tools/monograph/impact-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/index.d.ts +10 -0
- package/dist/src/mcp-tools/monograph/index.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/index.js +73 -0
- package/dist/src/mcp-tools/monograph/index.js.map +1 -0
- package/dist/src/mcp-tools/monograph/query-tools.d.ts +11 -0
- package/dist/src/mcp-tools/monograph/query-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/query-tools.js +500 -0
- package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph/shared.d.ts +64 -0
- package/dist/src/mcp-tools/monograph/shared.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/shared.js +215 -0
- package/dist/src/mcp-tools/monograph/shared.js.map +1 -0
- package/dist/src/mcp-tools/monograph/visualize-tools.d.ts +10 -0
- package/dist/src/mcp-tools/monograph/visualize-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monograph/visualize-tools.js +382 -0
- package/dist/src/mcp-tools/monograph/visualize-tools.js.map +1 -0
- package/dist/src/mcp-tools/monograph-tools.d.ts +4 -23
- package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monograph-tools.js +4 -2439
- package/dist/src/mcp-tools/monograph-tools.js.map +1 -1
- package/dist/src/mcp-tools/monomind-tools.d.ts +8 -0
- package/dist/src/mcp-tools/monomind-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monomind-tools.js +13 -1
- package/dist/src/mcp-tools/monomind-tools.js.map +1 -1
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts.map +1 -1
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js +31 -2
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +31 -1
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/types.d.ts +8 -27
- package/dist/src/mcp-tools/types.d.ts.map +1 -1
- package/dist/src/mcp-tools/types.js +9 -91
- package/dist/src/mcp-tools/types.js.map +1 -1
- package/dist/src/memory/file-permissions.d.ts +15 -0
- package/dist/src/memory/file-permissions.d.ts.map +1 -0
- package/dist/src/memory/file-permissions.js +25 -0
- package/dist/src/memory/file-permissions.js.map +1 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +94 -34
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-crud.d.ts.map +1 -1
- package/dist/src/memory/memory-crud.js +298 -275
- package/dist/src/memory/memory-crud.js.map +1 -1
- package/dist/src/memory/memory-initializer.d.ts +2 -4
- package/dist/src/memory/memory-initializer.d.ts.map +1 -1
- package/dist/src/memory/memory-initializer.js +53 -76
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/memory/memory-migrations.d.ts +1 -14
- package/dist/src/memory/memory-migrations.d.ts.map +1 -1
- package/dist/src/memory/memory-migrations.js +52 -105
- package/dist/src/memory/memory-migrations.js.map +1 -1
- package/dist/src/memory/sona-optimizer.d.ts +1 -1
- package/dist/src/memory/sona-optimizer.js +1 -1
- package/dist/src/monovector/index.d.ts +16 -19
- package/dist/src/monovector/index.d.ts.map +1 -1
- package/dist/src/monovector/index.js +50 -8
- package/dist/src/monovector/index.js.map +1 -1
- package/dist/src/orgrt/approvals.d.ts +16 -0
- package/dist/src/orgrt/approvals.d.ts.map +1 -0
- package/dist/src/orgrt/approvals.js +72 -0
- package/dist/src/orgrt/approvals.js.map +1 -0
- package/dist/src/orgrt/bus.d.ts.map +1 -1
- package/dist/src/orgrt/bus.js +21 -0
- package/dist/src/orgrt/bus.js.map +1 -1
- package/dist/src/orgrt/checkpoint-ops.d.ts +19 -0
- package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -0
- package/dist/src/orgrt/checkpoint-ops.js +219 -0
- package/dist/src/orgrt/checkpoint-ops.js.map +1 -0
- package/dist/src/orgrt/checkpoint.d.ts +33 -1
- package/dist/src/orgrt/checkpoint.d.ts.map +1 -1
- package/dist/src/orgrt/checkpoint.js +50 -6
- package/dist/src/orgrt/checkpoint.js.map +1 -1
- package/dist/src/orgrt/cross-org.d.ts +32 -0
- package/dist/src/orgrt/cross-org.d.ts.map +1 -0
- package/dist/src/orgrt/cross-org.js +256 -0
- package/dist/src/orgrt/cross-org.js.map +1 -0
- package/dist/src/orgrt/daemon.d.ts +131 -157
- package/dist/src/orgrt/daemon.d.ts.map +1 -1
- package/dist/src/orgrt/daemon.js +356 -966
- package/dist/src/orgrt/daemon.js.map +1 -1
- package/dist/src/orgrt/decisions.d.ts +33 -0
- package/dist/src/orgrt/decisions.d.ts.map +1 -0
- package/dist/src/orgrt/decisions.js +169 -0
- package/dist/src/orgrt/decisions.js.map +1 -0
- package/dist/src/orgrt/kimicode-runner.d.ts.map +1 -1
- package/dist/src/orgrt/kimicode-runner.js +5 -1
- package/dist/src/orgrt/kimicode-runner.js.map +1 -1
- package/dist/src/orgrt/opencode-runner.d.ts.map +1 -1
- package/dist/src/orgrt/opencode-runner.js +10 -2
- package/dist/src/orgrt/opencode-runner.js.map +1 -1
- package/dist/src/orgrt/org-memory.d.ts +45 -0
- package/dist/src/orgrt/org-memory.d.ts.map +1 -0
- package/dist/src/orgrt/org-memory.js +220 -0
- package/dist/src/orgrt/org-memory.js.map +1 -0
- package/dist/src/orgrt/policy.d.ts +4 -0
- package/dist/src/orgrt/policy.d.ts.map +1 -1
- package/dist/src/orgrt/policy.js +13 -1
- package/dist/src/orgrt/policy.js.map +1 -1
- package/dist/src/orgrt/prechecks.d.ts +15 -0
- package/dist/src/orgrt/prechecks.d.ts.map +1 -0
- package/dist/src/orgrt/prechecks.js +21 -0
- package/dist/src/orgrt/prechecks.js.map +1 -0
- package/dist/src/orgrt/questions.d.ts +39 -0
- package/dist/src/orgrt/questions.d.ts.map +1 -0
- package/dist/src/orgrt/questions.js +135 -0
- package/dist/src/orgrt/questions.js.map +1 -0
- package/dist/src/orgrt/remote.d.ts +25 -0
- package/dist/src/orgrt/remote.d.ts.map +1 -0
- package/dist/src/orgrt/remote.js +73 -0
- package/dist/src/orgrt/remote.js.map +1 -0
- package/dist/src/orgrt/scheduler-integration.d.ts +19 -0
- package/dist/src/orgrt/scheduler-integration.d.ts.map +1 -0
- package/dist/src/orgrt/scheduler-integration.js +90 -0
- package/dist/src/orgrt/scheduler-integration.js.map +1 -0
- package/dist/src/orgrt/server.d.ts.map +1 -1
- package/dist/src/orgrt/server.js +70 -2
- package/dist/src/orgrt/server.js.map +1 -1
- package/dist/src/orgrt/session.d.ts +30 -1
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +184 -53
- package/dist/src/orgrt/session.js.map +1 -1
- package/dist/src/orgrt/state-detector.d.ts +19 -0
- package/dist/src/orgrt/state-detector.d.ts.map +1 -0
- package/dist/src/orgrt/state-detector.js +59 -0
- package/dist/src/orgrt/state-detector.js.map +1 -0
- package/dist/src/orgrt/task-dag.d.ts +27 -0
- package/dist/src/orgrt/task-dag.d.ts.map +1 -0
- package/dist/src/orgrt/task-dag.js +100 -0
- package/dist/src/orgrt/task-dag.js.map +1 -0
- package/dist/src/orgrt/tool-fence.d.ts +7 -4
- package/dist/src/orgrt/tool-fence.d.ts.map +1 -1
- package/dist/src/orgrt/tool-fence.js +47 -6
- package/dist/src/orgrt/tool-fence.js.map +1 -1
- package/dist/src/orgrt/types.d.ts +57 -2
- package/dist/src/orgrt/types.d.ts.map +1 -1
- package/dist/src/orgrt/types.js +34 -3
- package/dist/src/orgrt/types.js.map +1 -1
- package/dist/src/routing/model-download.d.ts +49 -0
- package/dist/src/routing/model-download.d.ts.map +1 -0
- package/dist/src/routing/model-download.js +106 -0
- package/dist/src/routing/model-download.js.map +1 -0
- package/dist/src/services/crash-reporter.d.ts +5 -0
- package/dist/src/services/crash-reporter.d.ts.map +1 -1
- package/dist/src/services/crash-reporter.js +49 -0
- package/dist/src/services/crash-reporter.js.map +1 -1
- package/dist/src/transfer/anonymization/index.d.ts +18 -15
- package/dist/src/transfer/anonymization/index.d.ts.map +1 -1
- package/dist/src/transfer/anonymization/index.js +7 -119
- package/dist/src/transfer/anonymization/index.js.map +1 -1
- package/dist/src/ui/dashboard.html +606 -7
- package/dist/src/ui/orgs.html +7 -1
- package/dist/src/ui/routes-monograph.mjs +6 -0
- package/dist/src/ui/server.mjs +327 -7
- package/dist/src/update/checker.d.ts.map +1 -1
- package/dist/src/update/checker.js +2 -1
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/update/executor.d.ts.map +1 -1
- package/dist/src/update/executor.js +7 -3
- package/dist/src/update/executor.js.map +1 -1
- package/dist/src/update/index.d.ts +0 -1
- package/dist/src/update/index.d.ts.map +1 -1
- package/dist/src/update/index.js +5 -24
- package/dist/src/update/index.js.map +1 -1
- package/dist/src/utils/db-mutex.d.ts +11 -0
- package/dist/src/utils/db-mutex.d.ts.map +1 -0
- package/dist/src/utils/db-mutex.js +23 -0
- package/dist/src/utils/db-mutex.js.map +1 -0
- package/dist/src/utils/input-guards.d.ts +23 -0
- package/dist/src/utils/input-guards.d.ts.map +1 -1
- package/dist/src/utils/input-guards.js +72 -0
- package/dist/src/utils/input-guards.js.map +1 -1
- package/dist/src/utils/npm-command.d.ts +10 -0
- package/dist/src/utils/npm-command.d.ts.map +1 -0
- package/dist/src/utils/npm-command.js +12 -0
- package/dist/src/utils/npm-command.js.map +1 -0
- package/dist/src/utils/paths.d.ts +28 -0
- package/dist/src/utils/paths.d.ts.map +1 -0
- package/dist/src/utils/paths.js +108 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/scripts/download-embedding-model.mjs +97 -0
- package/scripts/publish.sh +0 -0
- package/scripts/sync-claude-assets.sh +0 -0
- package/dist/src/production/circuit-breaker.d.ts +0 -121
- package/dist/src/production/circuit-breaker.d.ts.map +0 -1
- package/dist/src/production/circuit-breaker.js +0 -262
- package/dist/src/production/circuit-breaker.js.map +0 -1
- package/dist/src/production/error-handler.d.ts +0 -119
- package/dist/src/production/error-handler.d.ts.map +0 -1
- package/dist/src/production/error-handler.js +0 -324
- package/dist/src/production/error-handler.js.map +0 -1
- package/dist/src/production/index.d.ts +0 -6
- package/dist/src/production/index.d.ts.map +0 -1
- package/dist/src/production/index.js +0 -6
- package/dist/src/production/index.js.map +0 -1
- package/dist/src/production/monitoring.d.ts +0 -181
- package/dist/src/production/monitoring.d.ts.map +0 -1
- package/dist/src/production/monitoring.js +0 -375
- package/dist/src/production/monitoring.js.map +0 -1
- package/dist/src/production/rate-limiter.d.ts +0 -125
- package/dist/src/production/rate-limiter.d.ts.map +0 -1
- package/dist/src/production/rate-limiter.js +0 -218
- package/dist/src/production/rate-limiter.js.map +0 -1
- package/dist/src/production/retry.d.ts +0 -48
- package/dist/src/production/retry.d.ts.map +0 -1
- package/dist/src/production/retry.js +0 -189
- package/dist/src/production/retry.js.map +0 -1
- package/dist/src/transfer/types.d.ts +0 -245
- package/dist/src/transfer/types.d.ts.map +0 -1
- package/dist/src/transfer/types.js +0 -6
- package/dist/src/transfer/types.js.map +0 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { randomUUID } from 'crypto';
|
|
2
|
+
import { getDbPath, text } from './shared.js';
|
|
3
|
+
// ── monograph_agent_history ─────────────────────────────────────────────────
|
|
4
|
+
export const monographAgentHistoryTool = {
|
|
5
|
+
name: 'monograph_agent_history',
|
|
6
|
+
description: 'Query past agent interactions by org, type, session, or time range. Returns rows ordered by timestamp descending.',
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
org_name: { type: 'string', description: 'Filter by org name' },
|
|
11
|
+
agent_type: { type: 'string', description: 'Filter by agent type' },
|
|
12
|
+
session_id: { type: 'string', description: 'Filter by session id' },
|
|
13
|
+
since: { type: 'number', description: 'Unix timestamp (ms) — only interactions after this time' },
|
|
14
|
+
limit: { type: 'number', description: 'Max rows to return (default 50)' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
handler: async (input) => {
|
|
18
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
19
|
+
const db = openDb(getDbPath());
|
|
20
|
+
try {
|
|
21
|
+
const conditions = [];
|
|
22
|
+
const params = {};
|
|
23
|
+
if (typeof input.org_name === 'string') {
|
|
24
|
+
conditions.push('org_name = @org_name');
|
|
25
|
+
params.org_name = input.org_name;
|
|
26
|
+
}
|
|
27
|
+
if (typeof input.agent_type === 'string') {
|
|
28
|
+
conditions.push('agent_type = @agent_type');
|
|
29
|
+
params.agent_type = input.agent_type;
|
|
30
|
+
}
|
|
31
|
+
if (typeof input.session_id === 'string') {
|
|
32
|
+
conditions.push('session_id = @session_id');
|
|
33
|
+
params.session_id = input.session_id;
|
|
34
|
+
}
|
|
35
|
+
if (typeof input.since === 'number') {
|
|
36
|
+
conditions.push('timestamp >= @since');
|
|
37
|
+
params.since = input.since;
|
|
38
|
+
}
|
|
39
|
+
const MAX_LIMIT = 1_000;
|
|
40
|
+
const rawLimit = input.limit ?? 50;
|
|
41
|
+
const limit = Number.isFinite(rawLimit) && rawLimit > 0
|
|
42
|
+
? Math.min(Math.floor(rawLimit), MAX_LIMIT)
|
|
43
|
+
: 50;
|
|
44
|
+
params.limit = limit;
|
|
45
|
+
const where = conditions.length ? `WHERE ${conditions.join(' AND ')}` : '';
|
|
46
|
+
const sql = `SELECT * FROM agent_interactions ${where} ORDER BY timestamp DESC LIMIT @limit`;
|
|
47
|
+
const rows = db.prepare(sql).all(params);
|
|
48
|
+
if (rows.length === 0)
|
|
49
|
+
return text('No agent interactions found.');
|
|
50
|
+
return text(JSON.stringify(rows, null, 2));
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
closeDb(db);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
// ── monograph_agent_patterns ────────────────────────────────────────────────
|
|
58
|
+
export const monographAgentPatternsTool = {
|
|
59
|
+
name: 'monograph_agent_patterns',
|
|
60
|
+
description: 'Aggregate agent interaction patterns: success rates, costs, and token usage grouped by agent type, org, or session.',
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
group_by: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
description: "Column to group by: 'agent_type' | 'org_name' | 'session_id'",
|
|
67
|
+
},
|
|
68
|
+
since: { type: 'number', description: 'Unix timestamp (ms) — only interactions after this time' },
|
|
69
|
+
min_count: { type: 'number', description: 'Minimum interaction count to include in results (default 2)' },
|
|
70
|
+
},
|
|
71
|
+
required: ['group_by'],
|
|
72
|
+
},
|
|
73
|
+
handler: async (input) => {
|
|
74
|
+
const groupBy = input.group_by;
|
|
75
|
+
const ALLOWED_GROUP_COLUMNS = new Set(['agent_type', 'org_name', 'session_id']);
|
|
76
|
+
if (!ALLOWED_GROUP_COLUMNS.has(groupBy)) {
|
|
77
|
+
return text(`Invalid group_by: ${groupBy}. Must be one of: agent_type, org_name, session_id`);
|
|
78
|
+
}
|
|
79
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
80
|
+
const db = openDb(getDbPath());
|
|
81
|
+
try {
|
|
82
|
+
const params = {};
|
|
83
|
+
const conditions = [];
|
|
84
|
+
if (typeof input.since === 'number') {
|
|
85
|
+
conditions.push('timestamp >= @since');
|
|
86
|
+
params.since = input.since;
|
|
87
|
+
}
|
|
88
|
+
const minCount = typeof input.min_count === 'number' && input.min_count > 0
|
|
89
|
+
? Math.floor(input.min_count)
|
|
90
|
+
: 2;
|
|
91
|
+
params.min_count = minCount;
|
|
92
|
+
const where = conditions.length ? `WHERE ${conditions.join(' AND ')}` : '';
|
|
93
|
+
const sql = `
|
|
94
|
+
SELECT
|
|
95
|
+
${groupBy} AS group_key,
|
|
96
|
+
COUNT(*) AS interaction_count,
|
|
97
|
+
AVG(success) AS success_rate,
|
|
98
|
+
SUM(tokens_in) AS total_tokens_in,
|
|
99
|
+
SUM(tokens_out) AS total_tokens_out,
|
|
100
|
+
SUM(cost_usd) AS total_cost_usd,
|
|
101
|
+
AVG(duration_ms) AS avg_duration_ms
|
|
102
|
+
FROM agent_interactions
|
|
103
|
+
${where}
|
|
104
|
+
GROUP BY ${groupBy}
|
|
105
|
+
HAVING COUNT(*) >= @min_count
|
|
106
|
+
ORDER BY interaction_count DESC
|
|
107
|
+
`;
|
|
108
|
+
const rows = db.prepare(sql).all(params);
|
|
109
|
+
if (rows.length === 0)
|
|
110
|
+
return text('No agent interaction patterns found.');
|
|
111
|
+
return text(JSON.stringify(rows, null, 2));
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
closeDb(db);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
// ── monograph_agent_record ──────────────────────────────────────────────────
|
|
119
|
+
export const monographAgentRecordTool = {
|
|
120
|
+
name: 'monograph_agent_record',
|
|
121
|
+
description: 'Record an agent interaction (called by capture hooks).',
|
|
122
|
+
inputSchema: {
|
|
123
|
+
type: 'object',
|
|
124
|
+
properties: {
|
|
125
|
+
session_id: { type: 'string', description: 'Session id' },
|
|
126
|
+
agent_type: { type: 'string', description: 'Agent type' },
|
|
127
|
+
org_name: { type: 'string', description: 'Org name' },
|
|
128
|
+
parent_agent: { type: 'string', description: 'Parent agent name/type, if spawned by another agent' },
|
|
129
|
+
prompt_summary: { type: 'string', description: 'Short summary of the prompt given to the agent' },
|
|
130
|
+
result_summary: { type: 'string', description: 'Short summary of the agent result' },
|
|
131
|
+
tokens_in: { type: 'number', description: 'Input tokens consumed (default 0)' },
|
|
132
|
+
tokens_out: { type: 'number', description: 'Output tokens produced (default 0)' },
|
|
133
|
+
cost_usd: { type: 'number', description: 'Cost in USD (default 0)' },
|
|
134
|
+
success: { type: 'boolean', description: 'Whether the interaction succeeded (default true)' },
|
|
135
|
+
duration_ms: { type: 'number', description: 'Duration in milliseconds (default 0)' },
|
|
136
|
+
},
|
|
137
|
+
required: ['session_id', 'agent_type'],
|
|
138
|
+
},
|
|
139
|
+
handler: async (input) => {
|
|
140
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
141
|
+
const db = openDb(getDbPath());
|
|
142
|
+
try {
|
|
143
|
+
const id = randomUUID();
|
|
144
|
+
const timestamp = Date.now();
|
|
145
|
+
db.prepare(`
|
|
146
|
+
INSERT INTO agent_interactions (
|
|
147
|
+
id, session_id, org_name, agent_type, parent_agent,
|
|
148
|
+
prompt_summary, result_summary, tokens_in, tokens_out,
|
|
149
|
+
cost_usd, success, duration_ms, timestamp
|
|
150
|
+
) VALUES (
|
|
151
|
+
@id, @session_id, @org_name, @agent_type, @parent_agent,
|
|
152
|
+
@prompt_summary, @result_summary, @tokens_in, @tokens_out,
|
|
153
|
+
@cost_usd, @success, @duration_ms, @timestamp
|
|
154
|
+
)
|
|
155
|
+
`).run({
|
|
156
|
+
id,
|
|
157
|
+
session_id: input.session_id,
|
|
158
|
+
org_name: input.org_name ?? null,
|
|
159
|
+
agent_type: input.agent_type,
|
|
160
|
+
parent_agent: input.parent_agent ?? null,
|
|
161
|
+
prompt_summary: input.prompt_summary ?? null,
|
|
162
|
+
result_summary: input.result_summary ?? null,
|
|
163
|
+
tokens_in: input.tokens_in ?? 0,
|
|
164
|
+
tokens_out: input.tokens_out ?? 0,
|
|
165
|
+
cost_usd: input.cost_usd ?? 0,
|
|
166
|
+
success: input.success === false ? 0 : 1,
|
|
167
|
+
duration_ms: input.duration_ms ?? 0,
|
|
168
|
+
timestamp,
|
|
169
|
+
});
|
|
170
|
+
return text(`Recorded agent interaction ${id} for ${input.agent_type} at ${timestamp}`);
|
|
171
|
+
}
|
|
172
|
+
finally {
|
|
173
|
+
closeDb(db);
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=agent-history-tools.js.map
|
|
@@ -0,0 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CAAC;;;;;;;;;;OAUV,CAAC,CAAC,GAAG,CAAC;gBACL,EAAE;gBACF,UAAU,EAAE,KAAK,CAAC,UAAoB;gBACtC,QAAQ,EAAG,KAAK,CAAC,QAA+B,IAAI,IAAI;gBACxD,UAAU,EAAE,KAAK,CAAC,UAAoB;gBACtC,YAAY,EAAG,KAAK,CAAC,YAAmC,IAAI,IAAI;gBAChE,cAAc,EAAG,KAAK,CAAC,cAAqC,IAAI,IAAI;gBACpE,cAAc,EAAG,KAAK,CAAC,cAAqC,IAAI,IAAI;gBACpE,SAAS,EAAG,KAAK,CAAC,SAAgC,IAAI,CAAC;gBACvD,UAAU,EAAG,KAAK,CAAC,UAAiC,IAAI,CAAC;gBACzD,QAAQ,EAAG,KAAK,CAAC,QAA+B,IAAI,CAAC;gBACrD,OAAO,EAAG,KAAK,CAAC,OAA+B,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjE,WAAW,EAAG,KAAK,CAAC,WAAkC,IAAI,CAAC;gBAC3D,SAAS;aACV,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,8BAA8B,EAAE,QAAQ,KAAK,CAAC,UAAoB,OAAO,SAAS,EAAE,CAAC,CAAC;QACpG,CAAC;gBAAS,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAAC,CAAC;IAC5B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MCPTool } from '../types.js';
|
|
2
|
+
export declare const monographBuildTool: MCPTool;
|
|
3
|
+
export declare const monographWatchTool: MCPTool;
|
|
4
|
+
export declare const monographWatchStopTool: MCPTool;
|
|
5
|
+
export declare const monographDetectChangesTool: MCPTool;
|
|
6
|
+
export declare const monographInjectContextTool: MCPTool;
|
|
7
|
+
export declare const monographSkillGenTool: MCPTool;
|
|
8
|
+
export declare const monographInstallSkillsTool: MCPTool;
|
|
9
|
+
//# sourceMappingURL=build-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-tools.d.ts","sourceRoot":"","sources":["../../../../src/mcp-tools/monograph/build-tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAS3C,eAAO,MAAM,kBAAkB,EAAE,OA0BhC,CAAC;AAIF,eAAO,MAAM,kBAAkB,EAAE,OAyBhC,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,OAmBpC,CAAC;AAIF,eAAO,MAAM,0BAA0B,EAAE,OAgDxC,CAAC;AAIF,eAAO,MAAM,0BAA0B,EAAE,OAsBxC,CAAC;AAIF,eAAO,MAAM,qBAAqB,EAAE,OA4BnC,CAAC;AAIF,eAAO,MAAM,0BAA0B,EAAE,OAgHxC,CAAC"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { join, resolve, sep } from 'path';
|
|
2
|
+
import { getProjectCwd } from '../types.js';
|
|
3
|
+
import { getDbPath, _isValidDb, text } from './shared.js';
|
|
4
|
+
// ── Active watcher registry ──────────────────────────────────────────────────
|
|
5
|
+
const _activeWatchers = new Map();
|
|
6
|
+
// ── monograph_build ───────────────────────────────────────────────────────────
|
|
7
|
+
export const monographBuildTool = {
|
|
8
|
+
name: 'monograph_build',
|
|
9
|
+
description: 'Build (or rebuild) the Monograph knowledge graph for a path. Parses all code via tree-sitter and indexes into SQLite.',
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
path: { type: 'string', description: 'Absolute path to the repo (defaults to project cwd)' },
|
|
14
|
+
codeOnly: { type: 'boolean', description: 'Only index code files (skip docs, config)' },
|
|
15
|
+
force: { type: 'boolean', description: 'Force full rebuild even if index is fresh' },
|
|
16
|
+
incremental: { type: 'boolean', description: 'Skip rebuild when index already matches HEAD (default false). Use when you want a no-op if the graph is fresh.' },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
handler: async (input) => {
|
|
20
|
+
const { buildAsync } = await import('@monoes/monograph');
|
|
21
|
+
const repoPath = input.path ?? getProjectCwd();
|
|
22
|
+
let progressLog = '';
|
|
23
|
+
await buildAsync(repoPath, {
|
|
24
|
+
codeOnly: input.codeOnly ?? false,
|
|
25
|
+
force: input.force ?? false,
|
|
26
|
+
incremental: input.incremental ?? false,
|
|
27
|
+
onProgress: (p) => { progressLog += `[${p.phase}] ${p.message ?? ''}\n`; },
|
|
28
|
+
});
|
|
29
|
+
const skipped = progressLog.includes('skipping rebuild');
|
|
30
|
+
const summary = skipped ? `Index was already fresh — no rebuild needed for ${repoPath}` : `Monograph build complete for ${repoPath}`;
|
|
31
|
+
return text(`${summary}\n${progressLog}`);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
// ── monograph_watch ───────────────────────────────────────────────────────────
|
|
35
|
+
export const monographWatchTool = {
|
|
36
|
+
name: 'monograph_watch',
|
|
37
|
+
description: 'Start incremental file watcher. Rebuilds index on file changes (3s debounce).',
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {
|
|
41
|
+
path: { type: 'string', description: 'Repo path (defaults to project cwd)' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
handler: async (input) => {
|
|
45
|
+
const { MonographWatcher } = await import('@monoes/monograph');
|
|
46
|
+
const repoPath = input.path ?? getProjectCwd();
|
|
47
|
+
if (_activeWatchers.has(repoPath)) {
|
|
48
|
+
return text(`Monograph watcher already running for ${repoPath}.`);
|
|
49
|
+
}
|
|
50
|
+
const watcher = new MonographWatcher(repoPath);
|
|
51
|
+
watcher.on('monograph:updated', (_paths) => {
|
|
52
|
+
import('@monoes/monograph').then(({ buildAsync }) => buildAsync(repoPath)).catch((e) => {
|
|
53
|
+
if (process.env.DEBUG || process.env.MONOMIND_DEBUG)
|
|
54
|
+
console.error('[monograph_watch] background rebuild failed:', e);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
await watcher.start();
|
|
58
|
+
_activeWatchers.set(repoPath, watcher);
|
|
59
|
+
return text(`Monograph watcher started for ${repoPath}. Watching for file changes...`);
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
// ── monograph_watch_stop ──────────────────────────────────────────────────────
|
|
63
|
+
export const monographWatchStopTool = {
|
|
64
|
+
name: 'monograph_watch_stop',
|
|
65
|
+
description: 'Stop the Monograph file watcher.',
|
|
66
|
+
inputSchema: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
properties: {
|
|
69
|
+
path: { type: 'string', description: 'Repo path whose watcher to stop (defaults to project cwd)' },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
handler: async (input) => {
|
|
73
|
+
const repoPath = input.path ?? getProjectCwd();
|
|
74
|
+
const watcher = _activeWatchers.get(repoPath);
|
|
75
|
+
if (!watcher) {
|
|
76
|
+
return text(`No active watcher found for ${repoPath}.`);
|
|
77
|
+
}
|
|
78
|
+
await watcher.stop();
|
|
79
|
+
_activeWatchers.delete(repoPath);
|
|
80
|
+
return text(`Monograph watcher stopped for ${repoPath}.`);
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
// ── monograph_detect_changes ──────────────────────────────────────────────────
|
|
84
|
+
export const monographDetectChangesTool = {
|
|
85
|
+
name: 'monograph_detect_changes',
|
|
86
|
+
description: 'Git diff → affected symbols: identifies which indexed symbols live in files changed since the base branch.',
|
|
87
|
+
inputSchema: {
|
|
88
|
+
type: 'object',
|
|
89
|
+
properties: {
|
|
90
|
+
baseBranch: { type: 'string', description: 'Base branch to diff against (default: main)' },
|
|
91
|
+
includeTests: { type: 'boolean', description: 'Include test files (default: true)' },
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
handler: async (input) => {
|
|
95
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
96
|
+
const { detectMonographChanges } = await import('@monoes/monograph');
|
|
97
|
+
const db = openDb(getDbPath());
|
|
98
|
+
try {
|
|
99
|
+
const result = detectMonographChanges(db, {
|
|
100
|
+
baseBranch: input.baseBranch,
|
|
101
|
+
includeTests: input.includeTests,
|
|
102
|
+
}, getProjectCwd());
|
|
103
|
+
// Format as structured text for direct LLM navigation instead of raw JSON
|
|
104
|
+
const r = result;
|
|
105
|
+
if (!r || (!r.changedFiles?.length && !r.affectedSymbols?.length)) {
|
|
106
|
+
return text('No changed files found relative to the base branch.');
|
|
107
|
+
}
|
|
108
|
+
const lines = [];
|
|
109
|
+
const base = r.baseBranch ?? 'main';
|
|
110
|
+
const changedFiles = r.changedFiles ?? [];
|
|
111
|
+
lines.push(`Changed files vs ${base}: ${changedFiles.length}`);
|
|
112
|
+
if (changedFiles.length > 0) {
|
|
113
|
+
for (const f of changedFiles.slice(0, 20))
|
|
114
|
+
lines.push(` ${f}`);
|
|
115
|
+
if (changedFiles.length > 20)
|
|
116
|
+
lines.push(` … ${changedFiles.length - 20} more`);
|
|
117
|
+
}
|
|
118
|
+
lines.push('');
|
|
119
|
+
const affected = r.affectedSymbols ?? r.affected ?? [];
|
|
120
|
+
if (affected.length > 0) {
|
|
121
|
+
lines.push(`Affected symbols (${affected.length}):`);
|
|
122
|
+
for (const sym of affected.slice(0, 30)) {
|
|
123
|
+
const fp = sym.filePath ?? sym.file_path ?? '';
|
|
124
|
+
const ln = sym.startLine ?? sym.start_line;
|
|
125
|
+
const loc = fp ? (ln != null ? `${fp}:${ln}` : fp) : '';
|
|
126
|
+
lines.push(` [${sym.label ?? '?'}] ${sym.name ?? sym.id} ${loc}`);
|
|
127
|
+
}
|
|
128
|
+
if (affected.length > 30)
|
|
129
|
+
lines.push(` … ${affected.length - 30} more`);
|
|
130
|
+
}
|
|
131
|
+
return text(lines.join('\n').trim());
|
|
132
|
+
}
|
|
133
|
+
finally {
|
|
134
|
+
closeDb(db);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
// ── monograph_inject_context ──────────────────────────────────────────────────
|
|
139
|
+
export const monographInjectContextTool = {
|
|
140
|
+
name: 'monograph_inject_context',
|
|
141
|
+
description: 'Inject monograph capabilities description into AGENTS.md or CLAUDE.md for AI agent discovery.',
|
|
142
|
+
inputSchema: {
|
|
143
|
+
type: 'object',
|
|
144
|
+
properties: {
|
|
145
|
+
targets: {
|
|
146
|
+
type: 'array',
|
|
147
|
+
items: { type: 'string', enum: ['claude', 'agents-md'] },
|
|
148
|
+
description: 'Which files to update (default: both)',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
handler: async (input) => {
|
|
153
|
+
const { injectAiContext } = await import('@monoes/monograph');
|
|
154
|
+
const repoPath = getProjectCwd();
|
|
155
|
+
const result = await injectAiContext({
|
|
156
|
+
repoPath,
|
|
157
|
+
targets: input.targets,
|
|
158
|
+
});
|
|
159
|
+
return text(`Injected context into: ${result.updated.join(', ') || 'none'}`);
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
// ── monograph_skill_gen ───────────────────────────────────────────────────────
|
|
163
|
+
export const monographSkillGenTool = {
|
|
164
|
+
name: 'monograph_skill_gen',
|
|
165
|
+
description: 'Generate per-community skill files summarizing code structure for AI navigation.',
|
|
166
|
+
inputSchema: {
|
|
167
|
+
type: 'object',
|
|
168
|
+
properties: {
|
|
169
|
+
outputDir: { type: 'string', description: 'Output directory for skill files (default: .monomind/skills/)' },
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
handler: async (input) => {
|
|
173
|
+
const { generateSkillFiles } = await import('@monoes/monograph');
|
|
174
|
+
const repoPath = getProjectCwd();
|
|
175
|
+
const allowedRoot = resolve(repoPath);
|
|
176
|
+
if (input.outputDir) {
|
|
177
|
+
const outDir = resolve(input.outputDir);
|
|
178
|
+
if (outDir !== allowedRoot && !outDir.startsWith(allowedRoot + sep)) {
|
|
179
|
+
return text(`Error: outputDir must be within the project directory (${allowedRoot})`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const result = await generateSkillFiles(repoPath, input.outputDir ? resolve(input.outputDir) : undefined);
|
|
183
|
+
const dir = result.filesWritten.length > 0
|
|
184
|
+
? result.filesWritten[0].replace(/\/[^/]+$/, '/')
|
|
185
|
+
: join(repoPath, '.monomind', 'skills') + '/';
|
|
186
|
+
return text(`Generated ${result.communityCount} skill files in ${dir}`);
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
// ── monograph_install_skills ──────────────────────────────────────────────────
|
|
190
|
+
export const monographInstallSkillsTool = {
|
|
191
|
+
name: 'monograph_install_skills',
|
|
192
|
+
description: 'Install monograph skill files for a specific IDE/platform (claude, cursor, vscode, zed).',
|
|
193
|
+
inputSchema: {
|
|
194
|
+
type: 'object',
|
|
195
|
+
properties: {
|
|
196
|
+
platform: {
|
|
197
|
+
type: 'string',
|
|
198
|
+
description: 'Target platform: claude, cursor, vscode, or zed',
|
|
199
|
+
},
|
|
200
|
+
repoPath: {
|
|
201
|
+
type: 'string',
|
|
202
|
+
description: 'Absolute path to the repository (defaults to cwd)',
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
required: ['platform'],
|
|
206
|
+
},
|
|
207
|
+
handler: async (input) => {
|
|
208
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
209
|
+
const { installSkillsForPlatform } = await import('@monoes/monograph');
|
|
210
|
+
const rawRepoPath = input.repoPath ?? getProjectCwd();
|
|
211
|
+
const repoPath = resolve(rawRepoPath);
|
|
212
|
+
const allowedRoot = resolve(getProjectCwd());
|
|
213
|
+
if (repoPath !== allowedRoot && !repoPath.startsWith(allowedRoot + sep)) {
|
|
214
|
+
return text(`Error: repoPath must be within the project directory (${allowedRoot})`);
|
|
215
|
+
}
|
|
216
|
+
const platform = input.platform;
|
|
217
|
+
const validPlatforms = ['claude', 'cursor', 'vscode', 'zed'];
|
|
218
|
+
if (!validPlatforms.includes(platform)) {
|
|
219
|
+
return text(`Invalid platform "${platform}". Must be one of: ${validPlatforms.join(', ')}`);
|
|
220
|
+
}
|
|
221
|
+
// Load community data from graph
|
|
222
|
+
const dbPath = getDbPath(repoPath);
|
|
223
|
+
// openDb's fileMustExist option isn't in the currently-published
|
|
224
|
+
// @monoes/monograph release this CLI depends on — check validity
|
|
225
|
+
// ourselves so a missing DB doesn't get silently auto-created empty.
|
|
226
|
+
if (!_isValidDb(dbPath)) {
|
|
227
|
+
return text('Graph not built yet. Run monograph_build first.');
|
|
228
|
+
}
|
|
229
|
+
let db;
|
|
230
|
+
try {
|
|
231
|
+
db = openDb(dbPath);
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
return text('Graph not built yet. Run monograph_build first.');
|
|
235
|
+
}
|
|
236
|
+
let communities;
|
|
237
|
+
try {
|
|
238
|
+
// Query distinct community IDs with exported symbols
|
|
239
|
+
const communityIds = db.prepare(`
|
|
240
|
+
SELECT DISTINCT community_id
|
|
241
|
+
FROM nodes
|
|
242
|
+
WHERE community_id IS NOT NULL
|
|
243
|
+
AND label NOT IN ('File', 'Folder', 'Community', 'Concept')
|
|
244
|
+
ORDER BY community_id
|
|
245
|
+
`).all();
|
|
246
|
+
if (communityIds.length === 0) {
|
|
247
|
+
closeDb(db);
|
|
248
|
+
return text('No communities found in graph. Run monograph_build first.');
|
|
249
|
+
}
|
|
250
|
+
communities = communityIds.map(({ community_id }) => {
|
|
251
|
+
// Derive a readable name from folder paths
|
|
252
|
+
const pathRows = db.prepare(`
|
|
253
|
+
SELECT file_path FROM nodes
|
|
254
|
+
WHERE community_id = ? AND file_path IS NOT NULL
|
|
255
|
+
AND label NOT IN ('File', 'Folder', 'Community', 'Concept')
|
|
256
|
+
LIMIT 20
|
|
257
|
+
`).all(community_id);
|
|
258
|
+
let name = `community-${community_id}`;
|
|
259
|
+
const folderCounts = new Map();
|
|
260
|
+
for (const row of pathRows) {
|
|
261
|
+
const parts = row.file_path.replace(/\\/g, '/').split('/').filter(Boolean);
|
|
262
|
+
if (parts.length >= 2) {
|
|
263
|
+
const folder = parts[parts.length - 2].toLowerCase();
|
|
264
|
+
if (!['src', 'lib', 'core', 'utils', 'common', 'shared', 'helpers', 'dist'].includes(folder)) {
|
|
265
|
+
folderCounts.set(folder, (folderCounts.get(folder) ?? 0) + 1);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
let bestCount = 0;
|
|
270
|
+
for (const [folder, count] of folderCounts) {
|
|
271
|
+
if (count > bestCount) {
|
|
272
|
+
bestCount = count;
|
|
273
|
+
name = folder;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
// Collect exported symbol names
|
|
277
|
+
const symbolRows = db.prepare(`
|
|
278
|
+
SELECT name FROM nodes
|
|
279
|
+
WHERE community_id = ? AND is_exported = 1
|
|
280
|
+
AND label NOT IN ('File', 'Folder', 'Community', 'Concept')
|
|
281
|
+
ORDER BY name
|
|
282
|
+
LIMIT 50
|
|
283
|
+
`).all(community_id);
|
|
284
|
+
return { name, symbols: symbolRows.map(r => r.name) };
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
catch (err) {
|
|
288
|
+
closeDb(db);
|
|
289
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
290
|
+
return text(`Failed to query graph: ${msg}`);
|
|
291
|
+
}
|
|
292
|
+
closeDb(db);
|
|
293
|
+
const result = await installSkillsForPlatform(repoPath, communities, {
|
|
294
|
+
platform: platform,
|
|
295
|
+
});
|
|
296
|
+
return text(`Installed ${result.filesWritten.length} skill files for ${result.platform} in ${result.outputDir}`);
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
//# sourceMappingURL=build-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-tools.js","sourceRoot":"","sources":["../../../../src/mcp-tools/monograph/build-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI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import type { MCPTool } from '../types.js';
|
|
2
|
+
export declare const monographCommunityTool: MCPTool;
|
|
3
|
+
export declare const monographSurprisesTool: MCPTool;
|
|
4
|
+
export declare const monographGroupListTool: MCPTool;
|
|
5
|
+
export declare const monographGroupQueryTool: MCPTool;
|
|
6
|
+
export declare const monographGroupSyncTool: MCPTool;
|
|
7
|
+
export declare const monographGroupContractsTool: MCPTool;
|
|
8
|
+
export declare const monographGroupStatusTool: MCPTool;
|
|
9
|
+
export declare const monographListReposTool: MCPTool;
|
|
10
|
+
//# sourceMappingURL=group-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-tools.d.ts","sourceRoot":"","sources":["../../../../src/mcp-tools/monograph/group-tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAM3C,eAAO,MAAM,sBAAsB,EAAE,OA8BpC,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,OAoCpC,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,OAyBpC,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,OA+BrC,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,OAoBpC,CAAC;AAIF,eAAO,MAAM,2BAA2B,EAAE,OAiBzC,CAAC;AAIF,eAAO,MAAM,wBAAwB,EAAE,OAoBtC,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,OAgBpC,CAAC"}
|