@monoes/monomindcli 2.8.3 → 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/design-palette.d.ts +5 -0
- package/dist/src/commands/design-palette.d.ts.map +1 -1
- package/dist/src/commands/design-palette.js +8 -5
- package/dist/src/commands/design-palette.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/geminimd-generator.js +2 -2
- 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/kimi-generator.js +3 -3
- package/dist/src/init/kimi-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-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +7 -3
- package/dist/src/mcp-client.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/monodesign-tools.d.ts +19 -0
- package/dist/src/mcp-tools/monodesign-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monodesign-tools.js +233 -0
- package/dist/src/mcp-tools/monodesign-tools.js.map +1 -0
- 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,475 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities, constants, and types used across init write-* modules.
|
|
3
|
+
*/
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
import { createRequire } from 'module';
|
|
8
|
+
import { dirname } from 'path';
|
|
9
|
+
// ESM-compatible __dirname
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = dirname(__filename);
|
|
12
|
+
export const MAX_EXEC_FILE_BYTES = 10 * 1024 * 1024; // 10 MB
|
|
13
|
+
/**
|
|
14
|
+
* Probe whether an optionalDependency actually resolved in this install
|
|
15
|
+
* (npm silently skips optionalDependencies it can't satisfy — see
|
|
16
|
+
* docs/AUDIT-BACKLOG.md P1-1/P1-23). Used to caveat generated docs instead
|
|
17
|
+
* of presenting these features as unconditionally working.
|
|
18
|
+
*/
|
|
19
|
+
export function _isOptionalPackageResolvable(pkg) {
|
|
20
|
+
try {
|
|
21
|
+
const req = createRequire(import.meta.url);
|
|
22
|
+
req.resolve(pkg);
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Atomic write helper — writes to a sibling .tmp file then renames into place.
|
|
31
|
+
* SIGINT or crash during a partial write would otherwise corrupt user-critical
|
|
32
|
+
* files (.claude/settings.json, .mcp.json, helper scripts that Claude Code
|
|
33
|
+
* executes on every hook). Without atomicity a half-written settings.json or
|
|
34
|
+
* a zero-byte hook-handler.cjs disables Claude Code's protections silently.
|
|
35
|
+
*/
|
|
36
|
+
export function atomicWriteFile(target, content, encoding) {
|
|
37
|
+
const tmp = `${target}.${process.pid}.tmp`;
|
|
38
|
+
if (encoding && typeof content === 'string') {
|
|
39
|
+
fs.writeFileSync(tmp, content, encoding);
|
|
40
|
+
}
|
|
41
|
+
else if (typeof content === 'string') {
|
|
42
|
+
fs.writeFileSync(tmp, content, 'utf-8');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
fs.writeFileSync(tmp, content);
|
|
46
|
+
}
|
|
47
|
+
fs.renameSync(tmp, target);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Skills to copy based on configuration
|
|
51
|
+
*/
|
|
52
|
+
export const SKILLS_MAP = {
|
|
53
|
+
core: [
|
|
54
|
+
'swarm-orchestration',
|
|
55
|
+
'swarm-advanced',
|
|
56
|
+
'hooks-automation',
|
|
57
|
+
'pair-programming',
|
|
58
|
+
'verification-quality',
|
|
59
|
+
'skill-builder',
|
|
60
|
+
'specialagent',
|
|
61
|
+
'monodesign',
|
|
62
|
+
'monomotion',
|
|
63
|
+
'monolean',
|
|
64
|
+
'monolean-review',
|
|
65
|
+
'monolean-audit',
|
|
66
|
+
'monolean-debt',
|
|
67
|
+
'monolean-help',
|
|
68
|
+
'hive-mind-advanced',
|
|
69
|
+
// The mastermind command files installed by init invoke
|
|
70
|
+
// Skill("mastermind-<name>") at runtime — one top-level
|
|
71
|
+
// mastermind-<name>/SKILL.md directory per skill. The glob expands in
|
|
72
|
+
// copySkills against the source tree, so newly added mastermind skills
|
|
73
|
+
// ship automatically; without them those references break in user projects.
|
|
74
|
+
'mastermind-*',
|
|
75
|
+
],
|
|
76
|
+
browser: ['agent-browser-testing'],
|
|
77
|
+
// NOTE: memory-toolkit and github-toolkit are single consolidated skills
|
|
78
|
+
// (not one skill per capability) — see .claude/skills/memory-toolkit and
|
|
79
|
+
// .claude/skills/github-toolkit. The finer-grained names previously listed
|
|
80
|
+
// here (memory-advanced, github-code-review, etc.) never had matching
|
|
81
|
+
// source directories and silently copied nothing.
|
|
82
|
+
memory: ['memory-toolkit'],
|
|
83
|
+
github: ['github-toolkit'],
|
|
84
|
+
advanced: [
|
|
85
|
+
'agentic-jujutsu',
|
|
86
|
+
'performance-analysis',
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Commands to copy based on configuration
|
|
91
|
+
*/
|
|
92
|
+
export const COMMANDS_MAP = {
|
|
93
|
+
core: [
|
|
94
|
+
'mastermind.md', 'tokens.md', 'monobrowse.md', 'ts.md',
|
|
95
|
+
],
|
|
96
|
+
agents: ['agents'],
|
|
97
|
+
analysis: ['analysis'],
|
|
98
|
+
automation: ['automation'],
|
|
99
|
+
coordination: ['coordination'],
|
|
100
|
+
github: ['github'],
|
|
101
|
+
hiveMind: ['hive-mind'],
|
|
102
|
+
hooks: ['hooks'],
|
|
103
|
+
mastermind: ['mastermind'],
|
|
104
|
+
memory: ['memory'],
|
|
105
|
+
monitoring: ['monitoring'],
|
|
106
|
+
monograph: ['monograph'],
|
|
107
|
+
monomind: ['mastermind'],
|
|
108
|
+
optimization: ['optimization'],
|
|
109
|
+
pair: ['pair'],
|
|
110
|
+
streamChain: ['stream-chain'],
|
|
111
|
+
swarm: ['swarm'],
|
|
112
|
+
training: ['training'],
|
|
113
|
+
truth: ['truth'],
|
|
114
|
+
verify: ['verify'],
|
|
115
|
+
workflows: ['workflows'],
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Agents to copy based on configuration
|
|
119
|
+
*/
|
|
120
|
+
export const AGENTS_MAP = {
|
|
121
|
+
academic: ['academic'],
|
|
122
|
+
analysis: ['analysis'],
|
|
123
|
+
architecture: ['architecture'],
|
|
124
|
+
consensus: ['consensus'],
|
|
125
|
+
core: ['core'],
|
|
126
|
+
data: ['data'],
|
|
127
|
+
design: ['design'],
|
|
128
|
+
development: ['development'],
|
|
129
|
+
devops: ['devops'],
|
|
130
|
+
documentation: ['documentation'],
|
|
131
|
+
engineering: ['engineering'],
|
|
132
|
+
gameDevelopment: ['game-development'],
|
|
133
|
+
github: ['github'],
|
|
134
|
+
goal: ['goal'],
|
|
135
|
+
hiveMind: ['hive-mind'],
|
|
136
|
+
marketing: ['marketing'],
|
|
137
|
+
neural: ['neural'],
|
|
138
|
+
optimization: ['optimization'],
|
|
139
|
+
paidMedia: ['paid-media'],
|
|
140
|
+
payments: ['payments'],
|
|
141
|
+
product: ['product'],
|
|
142
|
+
projectManagement: ['project-management'],
|
|
143
|
+
reasoning: ['reasoning'],
|
|
144
|
+
sales: ['sales'],
|
|
145
|
+
schemas: ['schemas'],
|
|
146
|
+
sona: ['sona'],
|
|
147
|
+
spatialComputing: ['spatial-computing'],
|
|
148
|
+
specialists: ['specialists'],
|
|
149
|
+
specialized: ['specialized'],
|
|
150
|
+
sublinear: ['sublinear'],
|
|
151
|
+
support: ['support'],
|
|
152
|
+
swarm: ['swarm'],
|
|
153
|
+
templates: ['templates'],
|
|
154
|
+
testing: ['testing'],
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Directory structure to create
|
|
158
|
+
*/
|
|
159
|
+
export const DIRECTORIES = {
|
|
160
|
+
claude: [
|
|
161
|
+
'.claude',
|
|
162
|
+
'.claude/skills',
|
|
163
|
+
'.claude/commands',
|
|
164
|
+
'.claude/agents',
|
|
165
|
+
'.claude/helpers',
|
|
166
|
+
'.gemini',
|
|
167
|
+
'.gemini/skills',
|
|
168
|
+
'.gemini/rules',
|
|
169
|
+
'.gemini/helpers',
|
|
170
|
+
'.agents',
|
|
171
|
+
'.agents/skills',
|
|
172
|
+
],
|
|
173
|
+
runtime: [
|
|
174
|
+
'.monomind',
|
|
175
|
+
'.monomind/data',
|
|
176
|
+
'.monomind/logs',
|
|
177
|
+
'.monomind/sessions',
|
|
178
|
+
'.monomind/hooks',
|
|
179
|
+
'.monomind/agents',
|
|
180
|
+
'.monomind/workflows',
|
|
181
|
+
],
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Provenance manifest for generated .claude content.
|
|
185
|
+
*
|
|
186
|
+
* init used to "clean stale" entries by deleting every name under
|
|
187
|
+
* .claude/{skills,commands,agents} that was absent from the current version's
|
|
188
|
+
* SKILLS_MAP/COMMANDS_MAP/AGENTS_MAP. Every user-authored command and skill is
|
|
189
|
+
* absent from those maps, so that pass deleted user content on the very first
|
|
190
|
+
* run — unrecoverable data loss.
|
|
191
|
+
*
|
|
192
|
+
* The manifest records exactly which entries *this tool* wrote, so the stale
|
|
193
|
+
* sweep can be restricted to those. Anything init did not write is never
|
|
194
|
+
* removed. Projects initialised by an older version have no manifest, so their
|
|
195
|
+
* first run under the fix deletes nothing and seeds the manifest instead;
|
|
196
|
+
* stale generated content may survive one extra run, which is the correct
|
|
197
|
+
* trade (preserving stale generated content is recoverable, deleting user
|
|
198
|
+
* content is not).
|
|
199
|
+
*/
|
|
200
|
+
export const INIT_MANIFEST_REL = path.join('.monomind', 'init-manifest.json');
|
|
201
|
+
/**
|
|
202
|
+
* Read the provenance manifest. Returns null when absent or unreadable —
|
|
203
|
+
* callers must treat that as "provenance unknown", i.e. delete nothing.
|
|
204
|
+
*/
|
|
205
|
+
export function readInitManifest(targetDir) {
|
|
206
|
+
const manifestPath = path.join(targetDir, INIT_MANIFEST_REL);
|
|
207
|
+
try {
|
|
208
|
+
if (!fs.existsSync(manifestPath))
|
|
209
|
+
return null;
|
|
210
|
+
const parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
211
|
+
if (!parsed || typeof parsed !== 'object')
|
|
212
|
+
return null;
|
|
213
|
+
return {
|
|
214
|
+
version: typeof parsed.version === 'number' ? parsed.version : 1,
|
|
215
|
+
skills: Array.isArray(parsed.skills) ? parsed.skills.filter((s) => typeof s === 'string') : [],
|
|
216
|
+
commands: Array.isArray(parsed.commands) ? parsed.commands.filter((s) => typeof s === 'string') : [],
|
|
217
|
+
agents: Array.isArray(parsed.agents) ? parsed.agents.filter((s) => typeof s === 'string') : [],
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Names init previously generated in one section. Empty set when no manifest
|
|
226
|
+
* exists — which makes the stale sweep a no-op rather than a delete-everything.
|
|
227
|
+
*/
|
|
228
|
+
export function previouslyGenerated(targetDir, section) {
|
|
229
|
+
return new Set(readInitManifest(targetDir)?.[section] ?? []);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Record the entries init just wrote for one section, merging into any
|
|
233
|
+
* existing manifest so a partial run (e.g. --only-claude, or a section whose
|
|
234
|
+
* source dir was missing) never drops provenance for the other sections.
|
|
235
|
+
*/
|
|
236
|
+
export function recordGenerated(targetDir, section, entries) {
|
|
237
|
+
const manifestPath = path.join(targetDir, INIT_MANIFEST_REL);
|
|
238
|
+
const existing = readInitManifest(targetDir);
|
|
239
|
+
const manifest = existing ?? { version: 1, skills: [], commands: [], agents: [] };
|
|
240
|
+
manifest.version = 1;
|
|
241
|
+
manifest[section] = [...new Set(entries)].sort();
|
|
242
|
+
try {
|
|
243
|
+
fs.mkdirSync(path.dirname(manifestPath), { recursive: true });
|
|
244
|
+
atomicWriteFile(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
// Non-fatal: without a manifest the next run simply deletes nothing.
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Find source helpers directory.
|
|
252
|
+
* Validates that the directory contains hook-handler.cjs AND its required
|
|
253
|
+
* subdirectory files (utils/telemetry.cjs etc.) to avoid accepting a partial
|
|
254
|
+
* or corrupted source that would reproduce the missing-utils/ bug class.
|
|
255
|
+
*/
|
|
256
|
+
export function findSourceHelpersDir(sourceBaseDir) {
|
|
257
|
+
const possiblePaths = [];
|
|
258
|
+
// All sentinel files must exist — hook-handler.cjs requires these at startup
|
|
259
|
+
const SENTINEL_FILES = [
|
|
260
|
+
'hook-handler.cjs',
|
|
261
|
+
path.join('utils', 'telemetry.cjs'),
|
|
262
|
+
path.join('utils', 'monograph.cjs'),
|
|
263
|
+
path.join('utils', 'micro-agents.cjs'),
|
|
264
|
+
];
|
|
265
|
+
// If explicit source base directory is provided, check it first
|
|
266
|
+
if (sourceBaseDir) {
|
|
267
|
+
possiblePaths.push(path.join(sourceBaseDir, '.claude', 'helpers'));
|
|
268
|
+
}
|
|
269
|
+
// Strategy 1: require.resolve to find package root (most reliable for npx)
|
|
270
|
+
// Try both published package names (@monoes/monomindcli is the scoped CLI package,
|
|
271
|
+
// monomind is the umbrella — neither is @monomind/cli which is the monorepo name only)
|
|
272
|
+
for (const pkgName of ['@monoes/monomindcli/package.json', 'monomind/packages/@monomind/cli/package.json', '@monomind/cli/package.json']) {
|
|
273
|
+
try {
|
|
274
|
+
const esmRequire = createRequire(import.meta.url);
|
|
275
|
+
const pkgJsonPath = esmRequire.resolve(pkgName);
|
|
276
|
+
const pkgRoot = path.dirname(pkgJsonPath);
|
|
277
|
+
possiblePaths.push(path.join(pkgRoot, '.claude', 'helpers'));
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
// Not installed under this name — try next
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
// Strategy 2: __dirname-based (dist/src/init -> package root)
|
|
285
|
+
const packageRoot = path.resolve(__dirname, '..', '..', '..');
|
|
286
|
+
const packageHelpers = path.join(packageRoot, '.claude', 'helpers');
|
|
287
|
+
possiblePaths.push(packageHelpers);
|
|
288
|
+
// Strategy 3: Walk up from __dirname looking for package root
|
|
289
|
+
let currentDir = __dirname;
|
|
290
|
+
for (let i = 0; i < 10; i++) {
|
|
291
|
+
const parentDir = path.dirname(currentDir);
|
|
292
|
+
if (parentDir === currentDir)
|
|
293
|
+
break; // hit filesystem root
|
|
294
|
+
const helpersPath = path.join(parentDir, '.claude', 'helpers');
|
|
295
|
+
possiblePaths.push(helpersPath);
|
|
296
|
+
currentDir = parentDir;
|
|
297
|
+
}
|
|
298
|
+
// NOTE: deliberately no cwd-ancestor-search fallback here (removed — see
|
|
299
|
+
// docs/AUDIT-BACKLOG.md P3-25). Searching process.cwd() and its parents for
|
|
300
|
+
// ".claude/helpers" could pick up an unrelated project's own helper scripts
|
|
301
|
+
// (stale, customized, or untrusted) when `monomind init` is run from a
|
|
302
|
+
// nested subdirectory of some other checkout. Helper source resolution is
|
|
303
|
+
// restricted to the package's own bundled location(s) above; if none of
|
|
304
|
+
// those are found, callers should treat it as a corrupt install rather than
|
|
305
|
+
// silently falling back to scanning ancestor directories for someone else's
|
|
306
|
+
// files.
|
|
307
|
+
// Return first path that exists AND contains ALL sentinel files
|
|
308
|
+
for (const p of possiblePaths) {
|
|
309
|
+
if (fs.existsSync(p) && SENTINEL_FILES.every(f => fs.existsSync(path.join(p, f)))) {
|
|
310
|
+
return p;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Find source .claude directory for statusline files
|
|
317
|
+
*/
|
|
318
|
+
export function findSourceClaudeDir(sourceBaseDir) {
|
|
319
|
+
const possiblePaths = [];
|
|
320
|
+
// If explicit source base directory is provided, check it first
|
|
321
|
+
if (sourceBaseDir) {
|
|
322
|
+
possiblePaths.push(path.join(sourceBaseDir, '.claude'));
|
|
323
|
+
}
|
|
324
|
+
// IMPORTANT: Check the package's own .claude directory
|
|
325
|
+
// Go up 3 levels: dist/src/init -> dist/src -> dist -> root
|
|
326
|
+
const packageRoot = path.resolve(__dirname, '..', '..', '..');
|
|
327
|
+
const packageClaude = path.join(packageRoot, '.claude');
|
|
328
|
+
if (fs.existsSync(packageClaude)) {
|
|
329
|
+
possiblePaths.unshift(packageClaude); // Add to beginning (highest priority)
|
|
330
|
+
}
|
|
331
|
+
// From dist/src/init -> go up to project root
|
|
332
|
+
let currentDir = __dirname;
|
|
333
|
+
for (let i = 0; i < 10; i++) {
|
|
334
|
+
const parentDir = path.dirname(currentDir);
|
|
335
|
+
const claudePath = path.join(parentDir, '.claude');
|
|
336
|
+
if (fs.existsSync(claudePath)) {
|
|
337
|
+
possiblePaths.push(claudePath);
|
|
338
|
+
}
|
|
339
|
+
currentDir = parentDir;
|
|
340
|
+
}
|
|
341
|
+
for (const p of possiblePaths) {
|
|
342
|
+
if (fs.existsSync(p)) {
|
|
343
|
+
return p;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Find source directory for skills/commands/agents
|
|
350
|
+
*/
|
|
351
|
+
export function findSourceDir(type, sourceBaseDir) {
|
|
352
|
+
// Build list of possible paths to check
|
|
353
|
+
const possiblePaths = [];
|
|
354
|
+
// If explicit source base directory is provided, use it first
|
|
355
|
+
if (sourceBaseDir) {
|
|
356
|
+
possiblePaths.push(path.join(sourceBaseDir, '.claude', type));
|
|
357
|
+
}
|
|
358
|
+
// IMPORTANT: Check the package's own .claude directory first
|
|
359
|
+
// This is the primary path when running as an npm package
|
|
360
|
+
// __dirname is typically /path/to/node_modules/@monomind/cli/dist/src/init
|
|
361
|
+
// We need to go up 3 levels to reach the package root (dist/src/init -> dist/src -> dist -> root)
|
|
362
|
+
const packageRoot = path.resolve(__dirname, '..', '..', '..');
|
|
363
|
+
const packageDotClaude = path.join(packageRoot, '.claude', type);
|
|
364
|
+
if (fs.existsSync(packageDotClaude)) {
|
|
365
|
+
possiblePaths.unshift(packageDotClaude); // Add to beginning (highest priority)
|
|
366
|
+
}
|
|
367
|
+
// From dist/src/init -> go up to project root
|
|
368
|
+
const distPath = __dirname;
|
|
369
|
+
// Try to find the project root by looking for .claude directory
|
|
370
|
+
let currentDir = distPath;
|
|
371
|
+
for (let i = 0; i < 10; i++) {
|
|
372
|
+
const parentDir = path.dirname(currentDir);
|
|
373
|
+
const dotClaudePath = path.join(parentDir, '.claude', type);
|
|
374
|
+
if (fs.existsSync(dotClaudePath)) {
|
|
375
|
+
possiblePaths.push(dotClaudePath);
|
|
376
|
+
}
|
|
377
|
+
currentDir = parentDir;
|
|
378
|
+
}
|
|
379
|
+
// Also check relative to process.cwd() for development
|
|
380
|
+
const cwdBased = [
|
|
381
|
+
path.join(process.cwd(), '.claude', type),
|
|
382
|
+
path.join(process.cwd(), '..', '.claude', type),
|
|
383
|
+
path.join(process.cwd(), '..', '..', '.claude', type),
|
|
384
|
+
];
|
|
385
|
+
possiblePaths.push(...cwdBased);
|
|
386
|
+
// Check v2 directory for agents
|
|
387
|
+
if (type === 'agents') {
|
|
388
|
+
possiblePaths.push(path.join(process.cwd(), 'v2', '.claude', type), path.join(process.cwd(), '..', 'v2', '.claude', type));
|
|
389
|
+
}
|
|
390
|
+
// Plugin directory
|
|
391
|
+
possiblePaths.push(path.join(process.cwd(), 'plugin', type), path.join(process.cwd(), '..', 'plugin', type));
|
|
392
|
+
for (const p of possiblePaths) {
|
|
393
|
+
if (fs.existsSync(p)) {
|
|
394
|
+
return p;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Copy directory recursively
|
|
401
|
+
*/
|
|
402
|
+
export function copyDirRecursive(src, dest) {
|
|
403
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
404
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
405
|
+
for (const entry of entries) {
|
|
406
|
+
// Skip exFAT/macOS AppleDouble junk files (e.g. "._foo.js") so they don't
|
|
407
|
+
// get perpetuated into every newly-initialized project.
|
|
408
|
+
if (entry.name.startsWith('._'))
|
|
409
|
+
continue;
|
|
410
|
+
const srcPath = path.join(src, entry.name);
|
|
411
|
+
const destPath = path.join(dest, entry.name);
|
|
412
|
+
if (entry.isDirectory()) {
|
|
413
|
+
copyDirRecursive(srcPath, destPath);
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
fs.copyFileSync(srcPath, destPath);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Count files with extension in directory
|
|
422
|
+
*/
|
|
423
|
+
export function countFiles(dir, ext) {
|
|
424
|
+
let count = 0;
|
|
425
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
426
|
+
for (const entry of entries) {
|
|
427
|
+
const fullPath = path.join(dir, entry.name);
|
|
428
|
+
if (entry.isDirectory()) {
|
|
429
|
+
count += countFiles(fullPath, ext);
|
|
430
|
+
}
|
|
431
|
+
else if (entry.name.endsWith(ext)) {
|
|
432
|
+
count++;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return count;
|
|
436
|
+
}
|
|
437
|
+
/** Recursively collect .md files under dir, returned relative to dir. */
|
|
438
|
+
export function walkMdFiles(dir) {
|
|
439
|
+
const out = [];
|
|
440
|
+
const visit = (d, prefix) => {
|
|
441
|
+
let entries;
|
|
442
|
+
try {
|
|
443
|
+
entries = fs.readdirSync(d, { withFileTypes: true });
|
|
444
|
+
}
|
|
445
|
+
catch {
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
for (const e of entries) {
|
|
449
|
+
const rel = prefix ? `${prefix}${path.sep}${e.name}` : e.name;
|
|
450
|
+
if (e.isDirectory())
|
|
451
|
+
visit(path.join(d, e.name), rel);
|
|
452
|
+
else if (e.isFile() && /\.md$/i.test(e.name))
|
|
453
|
+
out.push(rel);
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
visit(dir, '');
|
|
457
|
+
return out;
|
|
458
|
+
}
|
|
459
|
+
/** Skip READMEs and other non-definition markdown. */
|
|
460
|
+
export function isLikelyUserFile(rel) {
|
|
461
|
+
const base = path.basename(rel).toLowerCase();
|
|
462
|
+
if (base === 'readme.md' || base === 'readme')
|
|
463
|
+
return false;
|
|
464
|
+
return true;
|
|
465
|
+
}
|
|
466
|
+
/** Pull the `name:` scalar from a frontmatter block (best-effort). */
|
|
467
|
+
export function extractFmName(md) {
|
|
468
|
+
const m = md.match(/^---\r?\n[\s\S]*?\r?\n---/);
|
|
469
|
+
if (!m)
|
|
470
|
+
return null;
|
|
471
|
+
const fm = m[0];
|
|
472
|
+
const nm = fm.match(/^name\s*:\s*(.+?)\s*$/m);
|
|
473
|
+
return nm ? nm[1].replace(/^["']|["']$/g, '') : null;
|
|
474
|
+
}
|
|
475
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/init/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,2BAA2B;AAC3B,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ;AAE7D;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,GAAW;IACtD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3C,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,OAAwB,EAAE,QAAyB;IACjG,MAAM,GAAG,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,MAAM,CAAC;IAC3C,IAAI,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IA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AE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"statusline-generator.d.ts","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA02CrE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA8BnE"}
|
|
@@ -1051,6 +1051,27 @@ function getGraphifyStats() {
|
|
|
1051
1051
|
return { nodes: 0, edges: 0, exists: false };
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
|
+
// V4: how many commits is the monograph behind HEAD?
|
|
1055
|
+
// Reads last_commit_hash from index_meta in the SQLite DB and runs
|
|
1056
|
+
// git rev-list --count <last>..HEAD. Returns null when the DB is
|
|
1057
|
+
// missing, the meta row is absent, or git is unavailable.
|
|
1058
|
+
function getGraphStaleness() {
|
|
1059
|
+
const dbPath = path.join(CWD, '.monomind', 'monograph.db');
|
|
1060
|
+
if (!fs.existsSync(dbPath)) return null;
|
|
1061
|
+
try {
|
|
1062
|
+
// Pull the last indexed commit out of index_meta via sqlite3 (same
|
|
1063
|
+
// shell-out convention getGraphifyStats uses for node/edge counts).
|
|
1064
|
+
const lastCommit = safeExec(\`sqlite3 "\${dbPath}" "SELECT value FROM index_meta WHERE key = 'last_commit_hash' OR key = 'lastCommit' LIMIT 1;"\`, 1000);
|
|
1065
|
+
if (!lastCommit || !/^[0-9a-f]{7,40}$/i.test(lastCommit.trim())) return null;
|
|
1066
|
+
const out = safeExec(\`git rev-list --count \${lastCommit.trim()}..HEAD\`, 1500);
|
|
1067
|
+
if (!out) return null;
|
|
1068
|
+
const n = parseInt(out.trim(), 10);
|
|
1069
|
+
return Number.isFinite(n) ? { commitsBehind: n, lastCommit: lastCommit.trim() } : null;
|
|
1070
|
+
} catch {
|
|
1071
|
+
return null;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1054
1075
|
function getSIBudget() {
|
|
1055
1076
|
const SI_LIMIT = 1500;
|
|
1056
1077
|
const siPath = path.join(CWD, '.agents', 'shared_instructions.md');
|
|
@@ -1107,6 +1128,22 @@ function generateStatusline() {
|
|
|
1107
1128
|
parts.push(\`\${x.teal}📚 \${knowledge.chunks}k\${x.reset}\`);
|
|
1108
1129
|
}
|
|
1109
1130
|
|
|
1131
|
+
// V4: graph staleness — visible warning when the monograph is behind HEAD.
|
|
1132
|
+
// Silent staleness is the most dangerous failure mode (the user trusts a
|
|
1133
|
+
// stale answer), so surface commits-behind on the statusline itself.
|
|
1134
|
+
const graph = getGraphifyStats();
|
|
1135
|
+
if (graph.exists && graph.nodes > 0) {
|
|
1136
|
+
const stale = getGraphStaleness();
|
|
1137
|
+
if (stale && stale.commitsBehind > 0) {
|
|
1138
|
+
// Color escalates with staleness: green <=3, gold <=10, coral >10.
|
|
1139
|
+
const staleCol = stale.commitsBehind <= 3 ? x.green
|
|
1140
|
+
: stale.commitsBehind <= 10 ? x.gold : x.coral;
|
|
1141
|
+
parts.push(\`\${staleCol}⊛ \${graph.nodes}n \${stale.commitsBehind}behind\${x.reset}\`);
|
|
1142
|
+
} else {
|
|
1143
|
+
parts.push(\`\${x.teal}⊛ \${graph.nodes}n\${x.reset}\`);
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1110
1147
|
// Triggers (Task 32) — show when populated
|
|
1111
1148
|
if (triggers.triggers > 0) {
|
|
1112
1149
|
parts.push(\`\${x.mint}🎯 \${triggers.triggers}t\${x.reset}\`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusline-generator.js","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],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10
10
|
settings: boolean;
|
|
11
|
-
/** Copy skills to .claude/skills/ */
|
|
11
|
+
/** Copy skills to .claude/skills/, .gemini/skills/, .agents/skills/ */
|
|
12
12
|
skills: boolean;
|
|
13
13
|
/** Copy commands to .claude/commands/ */
|
|
14
14
|
commands: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/init/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/init/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,MAAM,EAAE,OAAO,CAAC;IAChB,yCAAyC;IACzC,QAAQ,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,2BAA2B;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,+BAA+B;IAC/B,GAAG,EAAE,OAAO,CAAC;IACb,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,QAAQ,EAAE,OAAO,CAAC;IAClB;iFAC6E;IAC7E,QAAQ,EAAE,OAAO,CAAC;IAClB;0DACsD;IACtD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IACpB,+BAA+B;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,0CAA0C;IAC1C,gBAAgB,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B,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,WA8FlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,WA8DlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAgD/B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upgrade logic: executeUpgrade, executeUpgradeWithMissing, mergeSettingsForUpgrade.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Upgrade result interface
|
|
6
|
+
*/
|
|
7
|
+
export interface UpgradeResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
updated: string[];
|
|
10
|
+
created: string[];
|
|
11
|
+
preserved: string[];
|
|
12
|
+
errors: string[];
|
|
13
|
+
/** Added by --add-missing flag */
|
|
14
|
+
addedSkills?: string[];
|
|
15
|
+
addedAgents?: string[];
|
|
16
|
+
addedCommands?: string[];
|
|
17
|
+
/** Added by --settings flag */
|
|
18
|
+
settingsUpdated?: string[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Execute upgrade - updates helpers and creates missing metrics without losing data
|
|
22
|
+
* This is safe for existing users who want the latest statusline fixes
|
|
23
|
+
* @param targetDir - Target directory
|
|
24
|
+
* @param upgradeSettings - If true, merge new settings into existing settings.json
|
|
25
|
+
*/
|
|
26
|
+
export declare function executeUpgrade(targetDir: string, upgradeSettings?: boolean): Promise<UpgradeResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Execute upgrade with --add-missing flag
|
|
29
|
+
* Adds any new skills, agents, and commands that don't exist yet
|
|
30
|
+
* @param targetDir - Target directory
|
|
31
|
+
* @param upgradeSettings - If true, merge new settings into existing settings.json
|
|
32
|
+
*/
|
|
33
|
+
export declare function executeUpgradeWithMissing(targetDir: string, upgradeSettings?: boolean): Promise<UpgradeResult>;
|
|
34
|
+
//# sourceMappingURL=upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../../src/init/upgrade.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwBH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,+BAA+B;IAC/B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAoID;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,UAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CA6NvG;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,UAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAuHlH"}
|