specmem-hardwicksoftware 3.5.99
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/CHANGELOG.md +299 -0
- package/LICENSE.md +6406 -0
- package/README.md +539 -0
- package/bin/AegisTheme.cjs +1022 -0
- package/bin/AnsiRenderer.cjs +1055 -0
- package/bin/BoxRenderer.cjs +605 -0
- package/bin/ClaudeLiveScreen.cjs +1299 -0
- package/bin/DashboardModules.cjs +733 -0
- package/bin/LiveScreenCapture.cjs +1012 -0
- package/bin/MemoryBrowserScreen.cjs +1595 -0
- package/bin/TabManager.cjs +1414 -0
- package/bin/checkAgentStatus-fix.patch +30 -0
- package/bin/mcp-socket-client.cjs +462 -0
- package/bin/screen-utils.cjs +106 -0
- package/bin/specmem-autoclaude.cjs +663 -0
- package/bin/specmem-cleanup.cjs +421 -0
- package/bin/specmem-cli.cjs +794 -0
- package/bin/specmem-console-teamcomms-class.cjs +428 -0
- package/bin/specmem-console.cjs +8104 -0
- package/bin/specmem-statusbar.cjs +530 -0
- package/bootstrap.cjs +5065 -0
- package/claude-hooks/agent-chooser-hook.js +179 -0
- package/claude-hooks/agent-chooser-inject.js +121 -0
- package/claude-hooks/agent-loading-hook.js +990 -0
- package/claude-hooks/agent-output-fader.cjs +542 -0
- package/claude-hooks/agent-output-interceptor.js +193 -0
- package/claude-hooks/agent-type-matcher.js +419 -0
- package/claude-hooks/auto-bypass.py +74 -0
- package/claude-hooks/background-completion-silencer.js +134 -0
- package/claude-hooks/bash-auto-background.js +182 -0
- package/claude-hooks/build-cedict-dictionary.mjs +167 -0
- package/claude-hooks/bullshit-radar.cjs +323 -0
- package/claude-hooks/cedict-codes.json +270 -0
- package/claude-hooks/cedict-extracted.json +22632 -0
- package/claude-hooks/claude-watchdog.sh +401 -0
- package/claude-hooks/context-dedup.cjs +144 -0
- package/claude-hooks/context-yeeter.cjs +244 -0
- package/claude-hooks/debug-suffix.cjs +15 -0
- package/claude-hooks/debug2.cjs +7 -0
- package/claude-hooks/drilldown-enforcer.js +242 -0
- package/claude-hooks/english-morphology-standalone.cjs +149 -0
- package/claude-hooks/english-morphology.cjs +152 -0
- package/claude-hooks/extract-translations.mjs +193 -0
- package/claude-hooks/file-claim-enforcer.cjs +293 -0
- package/claude-hooks/file-claim-enforcer.js +293 -0
- package/claude-hooks/find-collisions.cjs +39 -0
- package/claude-hooks/fix-abbreviations.cjs +60 -0
- package/claude-hooks/fix-collisions.cjs +60 -0
- package/claude-hooks/fix-decompressor.cjs +79 -0
- package/claude-hooks/fix-suffixes.cjs +66 -0
- package/claude-hooks/grammar-engine.cjs +159 -0
- package/claude-hooks/input-aware-improver.js +231 -0
- package/claude-hooks/is-agent.cjs +64 -0
- package/claude-hooks/mega-test.cjs +213 -0
- package/claude-hooks/merge-dictionaries.mjs +207 -0
- package/claude-hooks/merged-codes.cjs +22675 -0
- package/claude-hooks/merged-codes.json +22676 -0
- package/claude-hooks/output-cleaner.cjs +388 -0
- package/claude-hooks/post-write-memory-hook.cjs +430 -0
- package/claude-hooks/quick-test.cjs +24 -0
- package/claude-hooks/quick-test2.cjs +24 -0
- package/claude-hooks/remove-bad-codes.cjs +23 -0
- package/claude-hooks/search-reminder-hook.js +90 -0
- package/claude-hooks/semantic-test.cjs +93 -0
- package/claude-hooks/settings.json +445 -0
- package/claude-hooks/smart-context-hook.cjs +547 -0
- package/claude-hooks/smart-context-hook.js +539 -0
- package/claude-hooks/smart-search-interceptor.js +364 -0
- package/claude-hooks/socket-connect-helper.cjs +235 -0
- package/claude-hooks/specmem/sockets/session-start.lock +1 -0
- package/claude-hooks/specmem-context-hook.cjs +357 -0
- package/claude-hooks/specmem-context-hook.js +357 -0
- package/claude-hooks/specmem-drilldown-hook.cjs +480 -0
- package/claude-hooks/specmem-drilldown-hook.js +480 -0
- package/claude-hooks/specmem-drilldown-setter.js +210 -0
- package/claude-hooks/specmem-paths.cjs +213 -0
- package/claude-hooks/specmem-precompact.js +183 -0
- package/claude-hooks/specmem-session-init.sh +33 -0
- package/claude-hooks/specmem-session-start.cjs +498 -0
- package/claude-hooks/specmem-stop-hook.cjs +73 -0
- package/claude-hooks/specmem-stop-hook.js +5 -0
- package/claude-hooks/specmem-team-comms.cjs +434 -0
- package/claude-hooks/specmem-team-member-inject.js +271 -0
- package/claude-hooks/specmem-unified-hook.py +670 -0
- package/claude-hooks/subagent-loading-hook.js +194 -0
- package/claude-hooks/sysprompt-squisher.cjs +167 -0
- package/claude-hooks/task-progress-hook.js +204 -0
- package/claude-hooks/team-comms-enforcer.cjs +585 -0
- package/claude-hooks/test-accuracy.cjs +27 -0
- package/claude-hooks/test-big.cjs +28 -0
- package/claude-hooks/test-inflectors.cjs +39 -0
- package/claude-hooks/test-pluralize.cjs +37 -0
- package/claude-hooks/test-quick.cjs +8 -0
- package/claude-hooks/test-wink.cjs +20 -0
- package/claude-hooks/token-compressor.cjs +940 -0
- package/claude-hooks/use-code-pointers.cjs +279 -0
- package/commands/COMMAND_TOOL_MAP.md +299 -0
- package/commands/specmem-agents.md +412 -0
- package/commands/specmem-autoclaude.md +295 -0
- package/commands/specmem-changes.md +247 -0
- package/commands/specmem-code.md +103 -0
- package/commands/specmem-configteammembercomms.md +322 -0
- package/commands/specmem-drilldown.md +208 -0
- package/commands/specmem-find.md +195 -0
- package/commands/specmem-getdashboard.md +243 -0
- package/commands/specmem-hooks.md +219 -0
- package/commands/specmem-pointers.md +149 -0
- package/commands/specmem-progress.md +287 -0
- package/commands/specmem-remember.md +123 -0
- package/commands/specmem-service.md +349 -0
- package/commands/specmem-stats.md +189 -0
- package/commands/specmem-team-member.md +409 -0
- package/commands/specmem-webdev.md +583 -0
- package/commands/specmem.md +363 -0
- package/dist/autoStart/index.d.ts +214 -0
- package/dist/autoStart/index.d.ts.map +1 -0
- package/dist/autoStart/index.js +883 -0
- package/dist/autoStart/index.js.map +1 -0
- package/dist/claude-sessions/contextRestorationParser.d.ts +74 -0
- package/dist/claude-sessions/contextRestorationParser.d.ts.map +1 -0
- package/dist/claude-sessions/contextRestorationParser.js +570 -0
- package/dist/claude-sessions/contextRestorationParser.js.map +1 -0
- package/dist/claude-sessions/index.d.ts +13 -0
- package/dist/claude-sessions/index.d.ts.map +1 -0
- package/dist/claude-sessions/index.js +11 -0
- package/dist/claude-sessions/index.js.map +1 -0
- package/dist/claude-sessions/sessionIntegration.d.ts +48 -0
- package/dist/claude-sessions/sessionIntegration.d.ts.map +1 -0
- package/dist/claude-sessions/sessionIntegration.js +146 -0
- package/dist/claude-sessions/sessionIntegration.js.map +1 -0
- package/dist/claude-sessions/sessionParser.d.ts +293 -0
- package/dist/claude-sessions/sessionParser.d.ts.map +1 -0
- package/dist/claude-sessions/sessionParser.js +1028 -0
- package/dist/claude-sessions/sessionParser.js.map +1 -0
- package/dist/claude-sessions/sessionWatcher.d.ts +139 -0
- package/dist/claude-sessions/sessionWatcher.d.ts.map +1 -0
- package/dist/claude-sessions/sessionWatcher.js +722 -0
- package/dist/claude-sessions/sessionWatcher.js.map +1 -0
- package/dist/cli/deploy-to-claude.d.ts +56 -0
- package/dist/cli/deploy-to-claude.d.ts.map +1 -0
- package/dist/cli/deploy-to-claude.js +576 -0
- package/dist/cli/deploy-to-claude.js.map +1 -0
- package/dist/code-explanations/explainCode.d.ts +86 -0
- package/dist/code-explanations/explainCode.d.ts.map +1 -0
- package/dist/code-explanations/explainCode.js +286 -0
- package/dist/code-explanations/explainCode.js.map +1 -0
- package/dist/code-explanations/feedback.d.ts +87 -0
- package/dist/code-explanations/feedback.d.ts.map +1 -0
- package/dist/code-explanations/feedback.js +212 -0
- package/dist/code-explanations/feedback.js.map +1 -0
- package/dist/code-explanations/getRelatedCode.d.ts +80 -0
- package/dist/code-explanations/getRelatedCode.d.ts.map +1 -0
- package/dist/code-explanations/getRelatedCode.js +262 -0
- package/dist/code-explanations/getRelatedCode.js.map +1 -0
- package/dist/code-explanations/index.d.ts +284 -0
- package/dist/code-explanations/index.d.ts.map +1 -0
- package/dist/code-explanations/index.js +249 -0
- package/dist/code-explanations/index.js.map +1 -0
- package/dist/code-explanations/linkCodeToPrompt.d.ts +79 -0
- package/dist/code-explanations/linkCodeToPrompt.d.ts.map +1 -0
- package/dist/code-explanations/linkCodeToPrompt.js +213 -0
- package/dist/code-explanations/linkCodeToPrompt.js.map +1 -0
- package/dist/code-explanations/recallExplanation.d.ts +88 -0
- package/dist/code-explanations/recallExplanation.d.ts.map +1 -0
- package/dist/code-explanations/recallExplanation.js +218 -0
- package/dist/code-explanations/recallExplanation.js.map +1 -0
- package/dist/code-explanations/schema.d.ts +32 -0
- package/dist/code-explanations/schema.d.ts.map +1 -0
- package/dist/code-explanations/schema.js +221 -0
- package/dist/code-explanations/schema.js.map +1 -0
- package/dist/code-explanations/semanticSearch.d.ts +75 -0
- package/dist/code-explanations/semanticSearch.d.ts.map +1 -0
- package/dist/code-explanations/semanticSearch.js +203 -0
- package/dist/code-explanations/semanticSearch.js.map +1 -0
- package/dist/code-explanations/types.d.ts +328 -0
- package/dist/code-explanations/types.d.ts.map +1 -0
- package/dist/code-explanations/types.js +122 -0
- package/dist/code-explanations/types.js.map +1 -0
- package/dist/codebase/codeAnalyzer.d.ts +272 -0
- package/dist/codebase/codeAnalyzer.d.ts.map +1 -0
- package/dist/codebase/codeAnalyzer.js +1353 -0
- package/dist/codebase/codeAnalyzer.js.map +1 -0
- package/dist/codebase/codebaseIndexer.d.ts +360 -0
- package/dist/codebase/codebaseIndexer.d.ts.map +1 -0
- package/dist/codebase/codebaseIndexer.js +1735 -0
- package/dist/codebase/codebaseIndexer.js.map +1 -0
- package/dist/codebase/codebaseTools.d.ts +853 -0
- package/dist/codebase/codebaseTools.d.ts.map +1 -0
- package/dist/codebase/codebaseTools.js +1279 -0
- package/dist/codebase/codebaseTools.js.map +1 -0
- package/dist/codebase/exclusions.d.ts +111 -0
- package/dist/codebase/exclusions.d.ts.map +1 -0
- package/dist/codebase/exclusions.js +771 -0
- package/dist/codebase/exclusions.js.map +1 -0
- package/dist/codebase/fileWatcher.d.ts +135 -0
- package/dist/codebase/fileWatcher.d.ts.map +1 -0
- package/dist/codebase/fileWatcher.js +309 -0
- package/dist/codebase/fileWatcher.js.map +1 -0
- package/dist/codebase/index.d.ts +33 -0
- package/dist/codebase/index.d.ts.map +1 -0
- package/dist/codebase/index.js +77 -0
- package/dist/codebase/index.js.map +1 -0
- package/dist/codebase/ingestion.d.ts +177 -0
- package/dist/codebase/ingestion.d.ts.map +1 -0
- package/dist/codebase/ingestion.js +690 -0
- package/dist/codebase/ingestion.js.map +1 -0
- package/dist/codebase/languageDetection.d.ts +75 -0
- package/dist/codebase/languageDetection.d.ts.map +1 -0
- package/dist/codebase/languageDetection.js +768 -0
- package/dist/codebase/languageDetection.js.map +1 -0
- package/dist/commands/codebaseCommands.d.ts +101 -0
- package/dist/commands/codebaseCommands.d.ts.map +1 -0
- package/dist/commands/codebaseCommands.js +911 -0
- package/dist/commands/codebaseCommands.js.map +1 -0
- package/dist/commands/commandHandler.d.ts +126 -0
- package/dist/commands/commandHandler.d.ts.map +1 -0
- package/dist/commands/commandHandler.js +296 -0
- package/dist/commands/commandHandler.js.map +1 -0
- package/dist/commands/commandLoader.d.ts +103 -0
- package/dist/commands/commandLoader.d.ts.map +1 -0
- package/dist/commands/commandLoader.js +223 -0
- package/dist/commands/commandLoader.js.map +1 -0
- package/dist/commands/contextCommands.d.ts +83 -0
- package/dist/commands/contextCommands.d.ts.map +1 -0
- package/dist/commands/contextCommands.js +512 -0
- package/dist/commands/contextCommands.js.map +1 -0
- package/dist/commands/index.d.ts +24 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +28 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/mcpResources.d.ts +50 -0
- package/dist/commands/mcpResources.d.ts.map +1 -0
- package/dist/commands/mcpResources.js +372 -0
- package/dist/commands/mcpResources.js.map +1 -0
- package/dist/commands/memoryCommands.d.ts +74 -0
- package/dist/commands/memoryCommands.d.ts.map +1 -0
- package/dist/commands/memoryCommands.js +609 -0
- package/dist/commands/memoryCommands.js.map +1 -0
- package/dist/commands/promptCommands.d.ts +91 -0
- package/dist/commands/promptCommands.d.ts.map +1 -0
- package/dist/commands/promptCommands.js +801 -0
- package/dist/commands/promptCommands.js.map +1 -0
- package/dist/commands/teamMemberCommands.d.ts +21 -0
- package/dist/commands/teamMemberCommands.d.ts.map +1 -0
- package/dist/commands/teamMemberCommands.js +137 -0
- package/dist/commands/teamMemberCommands.js.map +1 -0
- package/dist/comms/fileCommsTransport.d.ts +91 -0
- package/dist/comms/fileCommsTransport.d.ts.map +1 -0
- package/dist/comms/fileCommsTransport.js +244 -0
- package/dist/comms/fileCommsTransport.js.map +1 -0
- package/dist/comms/index.d.ts +7 -0
- package/dist/comms/index.d.ts.map +1 -0
- package/dist/comms/index.js +7 -0
- package/dist/comms/index.js.map +1 -0
- package/dist/config/apiKeyDetection.d.ts +41 -0
- package/dist/config/apiKeyDetection.d.ts.map +1 -0
- package/dist/config/apiKeyDetection.js +211 -0
- package/dist/config/apiKeyDetection.js.map +1 -0
- package/dist/config/autoConfig.d.ts +188 -0
- package/dist/config/autoConfig.d.ts.map +1 -0
- package/dist/config/autoConfig.js +850 -0
- package/dist/config/autoConfig.js.map +1 -0
- package/dist/config/configSync.d.ts +119 -0
- package/dist/config/configSync.d.ts.map +1 -0
- package/dist/config/configSync.js +878 -0
- package/dist/config/configSync.js.map +1 -0
- package/dist/config/embeddingTimeouts.d.ts +145 -0
- package/dist/config/embeddingTimeouts.d.ts.map +1 -0
- package/dist/config/embeddingTimeouts.js +255 -0
- package/dist/config/embeddingTimeouts.js.map +1 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/languageConfig.d.ts +68 -0
- package/dist/config/languageConfig.d.ts.map +1 -0
- package/dist/config/languageConfig.js +473 -0
- package/dist/config/languageConfig.js.map +1 -0
- package/dist/config/password.d.ts +145 -0
- package/dist/config/password.d.ts.map +1 -0
- package/dist/config/password.js +428 -0
- package/dist/config/password.js.map +1 -0
- package/dist/config.d.ts +338 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1177 -0
- package/dist/config.js.map +1 -0
- package/dist/consolidation.d.ts +44 -0
- package/dist/consolidation.d.ts.map +1 -0
- package/dist/consolidation.js +447 -0
- package/dist/consolidation.js.map +1 -0
- package/dist/constants.d.ts +371 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +552 -0
- package/dist/constants.js.map +1 -0
- package/dist/coordination/TeamMemberRegistry.d.ts +192 -0
- package/dist/coordination/TeamMemberRegistry.d.ts.map +1 -0
- package/dist/coordination/TeamMemberRegistry.js +415 -0
- package/dist/coordination/TeamMemberRegistry.js.map +1 -0
- package/dist/coordination/events.d.ts +369 -0
- package/dist/coordination/events.d.ts.map +1 -0
- package/dist/coordination/events.js +232 -0
- package/dist/coordination/events.js.map +1 -0
- package/dist/coordination/handlers.d.ts +116 -0
- package/dist/coordination/handlers.d.ts.map +1 -0
- package/dist/coordination/handlers.js +400 -0
- package/dist/coordination/handlers.js.map +1 -0
- package/dist/coordination/index.d.ts +14 -0
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +31 -0
- package/dist/coordination/index.js.map +1 -0
- package/dist/coordination/integration.d.ts +260 -0
- package/dist/coordination/integration.d.ts.map +1 -0
- package/dist/coordination/integration.js +472 -0
- package/dist/coordination/integration.js.map +1 -0
- package/dist/coordination/server.d.ts +266 -0
- package/dist/coordination/server.d.ts.map +1 -0
- package/dist/coordination/server.js +995 -0
- package/dist/coordination/server.js.map +1 -0
- package/dist/coordination/serviceProvider.d.ts +70 -0
- package/dist/coordination/serviceProvider.d.ts.map +1 -0
- package/dist/coordination/serviceProvider.js +273 -0
- package/dist/coordination/serviceProvider.js.map +1 -0
- package/dist/dashboard/api/claudeControl.d.ts +44 -0
- package/dist/dashboard/api/claudeControl.d.ts.map +1 -0
- package/dist/dashboard/api/claudeControl.js +650 -0
- package/dist/dashboard/api/claudeControl.js.map +1 -0
- package/dist/dashboard/api/claudeHistory.d.ts +4 -0
- package/dist/dashboard/api/claudeHistory.d.ts.map +1 -0
- package/dist/dashboard/api/claudeHistory.js +319 -0
- package/dist/dashboard/api/claudeHistory.js.map +1 -0
- package/dist/dashboard/api/dataExport.d.ts +23 -0
- package/dist/dashboard/api/dataExport.d.ts.map +1 -0
- package/dist/dashboard/api/dataExport.js +509 -0
- package/dist/dashboard/api/dataExport.js.map +1 -0
- package/dist/dashboard/api/fileManager.d.ts +39 -0
- package/dist/dashboard/api/fileManager.d.ts.map +1 -0
- package/dist/dashboard/api/fileManager.js +814 -0
- package/dist/dashboard/api/fileManager.js.map +1 -0
- package/dist/dashboard/api/hooks.d.ts +16 -0
- package/dist/dashboard/api/hooks.d.ts.map +1 -0
- package/dist/dashboard/api/hooks.js +342 -0
- package/dist/dashboard/api/hooks.js.map +1 -0
- package/dist/dashboard/api/hotReload.d.ts +14 -0
- package/dist/dashboard/api/hotReload.d.ts.map +1 -0
- package/dist/dashboard/api/hotReload.js +219 -0
- package/dist/dashboard/api/hotReload.js.map +1 -0
- package/dist/dashboard/api/liveSessionStream.d.ts +19 -0
- package/dist/dashboard/api/liveSessionStream.d.ts.map +1 -0
- package/dist/dashboard/api/liveSessionStream.js +430 -0
- package/dist/dashboard/api/liveSessionStream.js.map +1 -0
- package/dist/dashboard/api/memoryRecall.d.ts +20 -0
- package/dist/dashboard/api/memoryRecall.d.ts.map +1 -0
- package/dist/dashboard/api/memoryRecall.js +524 -0
- package/dist/dashboard/api/memoryRecall.js.map +1 -0
- package/dist/dashboard/api/promptSend.d.ts +33 -0
- package/dist/dashboard/api/promptSend.d.ts.map +1 -0
- package/dist/dashboard/api/promptSend.js +544 -0
- package/dist/dashboard/api/promptSend.js.map +1 -0
- package/dist/dashboard/api/settings.d.ts +10 -0
- package/dist/dashboard/api/settings.d.ts.map +1 -0
- package/dist/dashboard/api/settings.js +656 -0
- package/dist/dashboard/api/settings.js.map +1 -0
- package/dist/dashboard/api/setup.d.ts +21 -0
- package/dist/dashboard/api/setup.d.ts.map +1 -0
- package/dist/dashboard/api/setup.js +663 -0
- package/dist/dashboard/api/setup.js.map +1 -0
- package/dist/dashboard/api/specmemTools.d.ts +14 -0
- package/dist/dashboard/api/specmemTools.d.ts.map +1 -0
- package/dist/dashboard/api/specmemTools.js +1059 -0
- package/dist/dashboard/api/specmemTools.js.map +1 -0
- package/dist/dashboard/api/taskTeamMembers.d.ts +8 -0
- package/dist/dashboard/api/taskTeamMembers.d.ts.map +1 -0
- package/dist/dashboard/api/taskTeamMembers.js +136 -0
- package/dist/dashboard/api/taskTeamMembers.js.map +1 -0
- package/dist/dashboard/api/teamMemberDeploy.d.ts +15 -0
- package/dist/dashboard/api/teamMemberDeploy.d.ts.map +1 -0
- package/dist/dashboard/api/teamMemberDeploy.js +421 -0
- package/dist/dashboard/api/teamMemberDeploy.js.map +1 -0
- package/dist/dashboard/api/teamMemberHistory.d.ts +38 -0
- package/dist/dashboard/api/teamMemberHistory.d.ts.map +1 -0
- package/dist/dashboard/api/teamMemberHistory.js +583 -0
- package/dist/dashboard/api/teamMemberHistory.js.map +1 -0
- package/dist/dashboard/api/terminal.d.ts +12 -0
- package/dist/dashboard/api/terminal.d.ts.map +1 -0
- package/dist/dashboard/api/terminal.js +344 -0
- package/dist/dashboard/api/terminal.js.map +1 -0
- package/dist/dashboard/api/terminalInject.d.ts +17 -0
- package/dist/dashboard/api/terminalInject.d.ts.map +1 -0
- package/dist/dashboard/api/terminalInject.js +322 -0
- package/dist/dashboard/api/terminalInject.js.map +1 -0
- package/dist/dashboard/api/terminalStream.d.ts +12 -0
- package/dist/dashboard/api/terminalStream.d.ts.map +1 -0
- package/dist/dashboard/api/terminalStream.js +482 -0
- package/dist/dashboard/api/terminalStream.js.map +1 -0
- package/dist/dashboard/index.d.ts +7 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +7 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/dashboard/ptyStreamer.d.ts +173 -0
- package/dist/dashboard/ptyStreamer.d.ts.map +1 -0
- package/dist/dashboard/ptyStreamer.js +661 -0
- package/dist/dashboard/ptyStreamer.js.map +1 -0
- package/dist/dashboard/public/DASHBOARD-README.md +378 -0
- package/dist/dashboard/public/INTEGRATION-GUIDE.md +395 -0
- package/dist/dashboard/public/codebase-config.html +1247 -0
- package/dist/dashboard/public/dashboard-v2.html +1942 -0
- package/dist/dashboard/public/data-export.html +819 -0
- package/dist/dashboard/public/example-page.html +164 -0
- package/dist/dashboard/public/file-explorer.html +1023 -0
- package/dist/dashboard/public/hooks.html +1103 -0
- package/dist/dashboard/public/index-improvements.css +499 -0
- package/dist/dashboard/public/index.html +5534 -0
- package/dist/dashboard/public/memory-controls.html +1959 -0
- package/dist/dashboard/public/memory-recall.html +1495 -0
- package/dist/dashboard/public/previews/skeleton-memory-graph.html +361 -0
- package/dist/dashboard/public/previews/skeleton-memory-list.html +366 -0
- package/dist/dashboard/public/previews/skeleton-search-results.html +609 -0
- package/dist/dashboard/public/previews/skeleton-stats-dashboard.html +556 -0
- package/dist/dashboard/public/prompt-console.html +2763 -0
- package/dist/dashboard/public/react-dist/assets/index-CkjobT5B.js +871 -0
- package/dist/dashboard/public/react-dist/assets/index-iRclxMst.css +1 -0
- package/dist/dashboard/public/react-dist/index.html +16 -0
- package/dist/dashboard/public/shared-header.js +325 -0
- package/dist/dashboard/public/shared-language-selector.js +626 -0
- package/dist/dashboard/public/shared-logger.js +66 -0
- package/dist/dashboard/public/shared-nav.js +325 -0
- package/dist/dashboard/public/shared-theme-blue.css +331 -0
- package/dist/dashboard/public/shared-theme.css +813 -0
- package/dist/dashboard/public/shared-toast.js +415 -0
- package/dist/dashboard/public/team-member-history.html +1291 -0
- package/dist/dashboard/public/team-member-spy.html +1199 -0
- package/dist/dashboard/public/team-members.html +3756 -0
- package/dist/dashboard/public/terminal-output.html +1013 -0
- package/dist/dashboard/public/terminal.html +372 -0
- package/dist/dashboard/sessionStore.d.ts +86 -0
- package/dist/dashboard/sessionStore.d.ts.map +1 -0
- package/dist/dashboard/sessionStore.js +262 -0
- package/dist/dashboard/sessionStore.js.map +1 -0
- package/dist/dashboard/standalone.d.ts +27 -0
- package/dist/dashboard/standalone.d.ts.map +1 -0
- package/dist/dashboard/standalone.js +380 -0
- package/dist/dashboard/standalone.js.map +1 -0
- package/dist/dashboard/webServer.d.ts +390 -0
- package/dist/dashboard/webServer.d.ts.map +1 -0
- package/dist/dashboard/webServer.js +4297 -0
- package/dist/dashboard/webServer.js.map +1 -0
- package/dist/dashboard/websocket/teamMemberStream.d.ts +87 -0
- package/dist/dashboard/websocket/teamMemberStream.d.ts.map +1 -0
- package/dist/dashboard/websocket/teamMemberStream.js +366 -0
- package/dist/dashboard/websocket/teamMemberStream.js.map +1 -0
- package/dist/dashboard/websocket/terminalStream.d.ts +130 -0
- package/dist/dashboard/websocket/terminalStream.d.ts.map +1 -0
- package/dist/dashboard/websocket/terminalStream.js +456 -0
- package/dist/dashboard/websocket/terminalStream.js.map +1 -0
- package/dist/database/embeddedPostgres.d.ts +187 -0
- package/dist/database/embeddedPostgres.d.ts.map +1 -0
- package/dist/database/embeddedPostgres.js +763 -0
- package/dist/database/embeddedPostgres.js.map +1 -0
- package/dist/database/index.d.ts +12 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +20 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/initEmbeddedPostgres.d.ts +124 -0
- package/dist/database/initEmbeddedPostgres.d.ts.map +1 -0
- package/dist/database/initEmbeddedPostgres.js +855 -0
- package/dist/database/initEmbeddedPostgres.js.map +1 -0
- package/dist/database.d.ts +256 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +1209 -0
- package/dist/database.js.map +1 -0
- package/dist/db/apiDataManager.d.ts +334 -0
- package/dist/db/apiDataManager.d.ts.map +1 -0
- package/dist/db/apiDataManager.js +631 -0
- package/dist/db/apiDataManager.js.map +1 -0
- package/dist/db/batchOperations.d.ts +154 -0
- package/dist/db/batchOperations.d.ts.map +1 -0
- package/dist/db/batchOperations.js +564 -0
- package/dist/db/batchOperations.js.map +1 -0
- package/dist/db/bigBrainMigrations.d.ts +48 -0
- package/dist/db/bigBrainMigrations.d.ts.map +1 -0
- package/dist/db/bigBrainMigrations.js +4266 -0
- package/dist/db/bigBrainMigrations.js.map +1 -0
- package/dist/db/connectionPoolGoBrrr.d.ts +94 -0
- package/dist/db/connectionPoolGoBrrr.d.ts.map +1 -0
- package/dist/db/connectionPoolGoBrrr.js +548 -0
- package/dist/db/connectionPoolGoBrrr.js.map +1 -0
- package/dist/db/dashboardQueries.d.ts +182 -0
- package/dist/db/dashboardQueries.d.ts.map +1 -0
- package/dist/db/dashboardQueries.js +821 -0
- package/dist/db/dashboardQueries.js.map +1 -0
- package/dist/db/deploymentBootstrap.d.ts +43 -0
- package/dist/db/deploymentBootstrap.d.ts.map +1 -0
- package/dist/db/deploymentBootstrap.js +329 -0
- package/dist/db/deploymentBootstrap.js.map +1 -0
- package/dist/db/dimensionService.d.ts +140 -0
- package/dist/db/dimensionService.d.ts.map +1 -0
- package/dist/db/dimensionService.js +261 -0
- package/dist/db/dimensionService.js.map +1 -0
- package/dist/db/embeddingOverflow.d.ts +69 -0
- package/dist/db/embeddingOverflow.d.ts.map +1 -0
- package/dist/db/embeddingOverflow.js +332 -0
- package/dist/db/embeddingOverflow.js.map +1 -0
- package/dist/db/embeddingOverflow.sql +221 -0
- package/dist/db/findThatShit.d.ts +145 -0
- package/dist/db/findThatShit.d.ts.map +1 -0
- package/dist/db/findThatShit.js +782 -0
- package/dist/db/findThatShit.js.map +1 -0
- package/dist/db/hotPathManager.d.ts +187 -0
- package/dist/db/hotPathManager.d.ts.map +1 -0
- package/dist/db/hotPathManager.js +504 -0
- package/dist/db/hotPathManager.js.map +1 -0
- package/dist/db/index.d.ts +85 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +219 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/memoryDrilldown.sql +99 -0
- package/dist/db/migrate.d.ts +3 -0
- package/dist/db/migrate.d.ts.map +1 -0
- package/dist/db/migrate.js +97 -0
- package/dist/db/migrate.js.map +1 -0
- package/dist/db/migrateJsonToPostgres.d.ts +43 -0
- package/dist/db/migrateJsonToPostgres.d.ts.map +1 -0
- package/dist/db/migrateJsonToPostgres.js +465 -0
- package/dist/db/migrateJsonToPostgres.js.map +1 -0
- package/dist/db/nukeFromOrbit.d.ts +63 -0
- package/dist/db/nukeFromOrbit.d.ts.map +1 -0
- package/dist/db/nukeFromOrbit.js +499 -0
- package/dist/db/nukeFromOrbit.js.map +1 -0
- package/dist/db/processedTraining.sql +60 -0
- package/dist/db/projectNamespacing.d.ts +258 -0
- package/dist/db/projectNamespacing.d.ts.map +1 -0
- package/dist/db/projectNamespacing.js +920 -0
- package/dist/db/projectNamespacing.js.map +1 -0
- package/dist/db/projectNamespacing.sql +374 -0
- package/dist/db/projectSchemaInit.sql +271 -0
- package/dist/db/spatialMemory.d.ts +296 -0
- package/dist/db/spatialMemory.d.ts.map +1 -0
- package/dist/db/spatialMemory.js +818 -0
- package/dist/db/spatialMemory.js.map +1 -0
- package/dist/db/streamingQuery.d.ts +143 -0
- package/dist/db/streamingQuery.d.ts.map +1 -0
- package/dist/db/streamingQuery.js +350 -0
- package/dist/db/streamingQuery.js.map +1 -0
- package/dist/db/teamComms.sql +224 -0
- package/dist/db/yeetStuffInDb.d.ts +72 -0
- package/dist/db/yeetStuffInDb.d.ts.map +1 -0
- package/dist/db/yeetStuffInDb.js +473 -0
- package/dist/db/yeetStuffInDb.js.map +1 -0
- package/dist/embedding-providers/index.d.ts +10 -0
- package/dist/embedding-providers/index.d.ts.map +1 -0
- package/dist/embedding-providers/index.js +12 -0
- package/dist/embedding-providers/index.js.map +1 -0
- package/dist/embeddings/projectionLayer.d.ts +114 -0
- package/dist/embeddings/projectionLayer.d.ts.map +1 -0
- package/dist/embeddings/projectionLayer.js +345 -0
- package/dist/embeddings/projectionLayer.js.map +1 -0
- package/dist/events/Publisher.d.ts +193 -0
- package/dist/events/Publisher.d.ts.map +1 -0
- package/dist/events/Publisher.js +439 -0
- package/dist/events/Publisher.js.map +1 -0
- package/dist/events/config.d.ts +139 -0
- package/dist/events/config.d.ts.map +1 -0
- package/dist/events/config.js +266 -0
- package/dist/events/config.js.map +1 -0
- package/dist/events/index.d.ts +19 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +31 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/integration.d.ts +206 -0
- package/dist/events/integration.d.ts.map +1 -0
- package/dist/events/integration.js +348 -0
- package/dist/events/integration.js.map +1 -0
- package/dist/events/metrics.d.ts +147 -0
- package/dist/events/metrics.d.ts.map +1 -0
- package/dist/events/metrics.js +343 -0
- package/dist/events/metrics.js.map +1 -0
- package/dist/hooks/cli.d.ts +28 -0
- package/dist/hooks/cli.d.ts.map +1 -0
- package/dist/hooks/cli.js +118 -0
- package/dist/hooks/cli.js.map +1 -0
- package/dist/hooks/contextInjectionHook.d.ts +60 -0
- package/dist/hooks/contextInjectionHook.d.ts.map +1 -0
- package/dist/hooks/contextInjectionHook.js +294 -0
- package/dist/hooks/contextInjectionHook.js.map +1 -0
- package/dist/hooks/drilldownHook.d.ts +125 -0
- package/dist/hooks/drilldownHook.d.ts.map +1 -0
- package/dist/hooks/drilldownHook.js +181 -0
- package/dist/hooks/drilldownHook.js.map +1 -0
- package/dist/hooks/hookManager.d.ts +180 -0
- package/dist/hooks/hookManager.d.ts.map +1 -0
- package/dist/hooks/hookManager.js +782 -0
- package/dist/hooks/hookManager.js.map +1 -0
- package/dist/hooks/index.d.ts +62 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +66 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/lowContextHook.d.ts +71 -0
- package/dist/hooks/lowContextHook.d.ts.map +1 -0
- package/dist/hooks/lowContextHook.js +258 -0
- package/dist/hooks/lowContextHook.js.map +1 -0
- package/dist/hooks/simpleContextHook.d.ts +65 -0
- package/dist/hooks/simpleContextHook.d.ts.map +1 -0
- package/dist/hooks/simpleContextHook.js +194 -0
- package/dist/hooks/simpleContextHook.js.map +1 -0
- package/dist/hooks/teamFramingCli.d.ts +56 -0
- package/dist/hooks/teamFramingCli.d.ts.map +1 -0
- package/dist/hooks/teamFramingCli.js +264 -0
- package/dist/hooks/teamFramingCli.js.map +1 -0
- package/dist/hooks/teamMemberPrepromptHook.d.ts +150 -0
- package/dist/hooks/teamMemberPrepromptHook.d.ts.map +1 -0
- package/dist/hooks/teamMemberPrepromptHook.js +308 -0
- package/dist/hooks/teamMemberPrepromptHook.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4433 -0
- package/dist/index.js.map +1 -0
- package/dist/init/claudeConfigInjector.d.ts +116 -0
- package/dist/init/claudeConfigInjector.d.ts.map +1 -0
- package/dist/init/claudeConfigInjector.js +1154 -0
- package/dist/init/claudeConfigInjector.js.map +1 -0
- package/dist/installer/autoInstall.d.ts +72 -0
- package/dist/installer/autoInstall.d.ts.map +1 -0
- package/dist/installer/autoInstall.js +617 -0
- package/dist/installer/autoInstall.js.map +1 -0
- package/dist/installer/dbSetup.d.ts +84 -0
- package/dist/installer/dbSetup.d.ts.map +1 -0
- package/dist/installer/dbSetup.js +350 -0
- package/dist/installer/dbSetup.js.map +1 -0
- package/dist/installer/firstRun.d.ts +49 -0
- package/dist/installer/firstRun.d.ts.map +1 -0
- package/dist/installer/firstRun.js +207 -0
- package/dist/installer/firstRun.js.map +1 -0
- package/dist/installer/index.d.ts +10 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +10 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/silentAutoInstall.d.ts +99 -0
- package/dist/installer/silentAutoInstall.d.ts.map +1 -0
- package/dist/installer/silentAutoInstall.js +491 -0
- package/dist/installer/silentAutoInstall.js.map +1 -0
- package/dist/installer/systemDeps.d.ts +54 -0
- package/dist/installer/systemDeps.d.ts.map +1 -0
- package/dist/installer/systemDeps.js +322 -0
- package/dist/installer/systemDeps.js.map +1 -0
- package/dist/mcp/cliNotifications.d.ts +133 -0
- package/dist/mcp/cliNotifications.d.ts.map +1 -0
- package/dist/mcp/cliNotifications.js +289 -0
- package/dist/mcp/cliNotifications.js.map +1 -0
- package/dist/mcp/embeddingServerManager.d.ts +307 -0
- package/dist/mcp/embeddingServerManager.d.ts.map +1 -0
- package/dist/mcp/embeddingServerManager.js +2081 -0
- package/dist/mcp/embeddingServerManager.js.map +1 -0
- package/dist/mcp/healthMonitor.d.ts +196 -0
- package/dist/mcp/healthMonitor.d.ts.map +1 -0
- package/dist/mcp/healthMonitor.js +685 -0
- package/dist/mcp/healthMonitor.js.map +1 -0
- package/dist/mcp/hotReloadManager.d.ts +101 -0
- package/dist/mcp/hotReloadManager.d.ts.map +1 -0
- package/dist/mcp/hotReloadManager.js +251 -0
- package/dist/mcp/hotReloadManager.js.map +1 -0
- package/dist/mcp/index.d.ts +16 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +22 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/mcpProtocolHandler.d.ts +64 -0
- package/dist/mcp/mcpProtocolHandler.d.ts.map +1 -0
- package/dist/mcp/mcpProtocolHandler.js +253 -0
- package/dist/mcp/mcpProtocolHandler.js.map +1 -0
- package/dist/mcp/miniCOTServerManager.d.ts +336 -0
- package/dist/mcp/miniCOTServerManager.d.ts.map +1 -0
- package/dist/mcp/miniCOTServerManager.js +1384 -0
- package/dist/mcp/miniCOTServerManager.js.map +1 -0
- package/dist/mcp/promptExecutor.d.ts +188 -0
- package/dist/mcp/promptExecutor.d.ts.map +1 -0
- package/dist/mcp/promptExecutor.js +469 -0
- package/dist/mcp/promptExecutor.js.map +1 -0
- package/dist/mcp/reloadBroadcast.d.ts +127 -0
- package/dist/mcp/reloadBroadcast.d.ts.map +1 -0
- package/dist/mcp/reloadBroadcast.js +275 -0
- package/dist/mcp/reloadBroadcast.js.map +1 -0
- package/dist/mcp/resilientTransport.d.ts +249 -0
- package/dist/mcp/resilientTransport.d.ts.map +1 -0
- package/dist/mcp/resilientTransport.js +931 -0
- package/dist/mcp/resilientTransport.js.map +1 -0
- package/dist/mcp/samplingHandler.d.ts +129 -0
- package/dist/mcp/samplingHandler.d.ts.map +1 -0
- package/dist/mcp/samplingHandler.js +276 -0
- package/dist/mcp/samplingHandler.js.map +1 -0
- package/dist/mcp/specMemServer.d.ts +305 -0
- package/dist/mcp/specMemServer.d.ts.map +1 -0
- package/dist/mcp/specMemServer.js +2048 -0
- package/dist/mcp/specMemServer.js.map +1 -0
- package/dist/mcp/toolRegistry.d.ts +122 -0
- package/dist/mcp/toolRegistry.d.ts.map +1 -0
- package/dist/mcp/toolRegistry.js +609 -0
- package/dist/mcp/toolRegistry.js.map +1 -0
- package/dist/mcp/tools/embeddingControl.d.ts +114 -0
- package/dist/mcp/tools/embeddingControl.d.ts.map +1 -0
- package/dist/mcp/tools/embeddingControl.js +222 -0
- package/dist/mcp/tools/embeddingControl.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +10 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +17 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/teamComms.d.ts +444 -0
- package/dist/mcp/tools/teamComms.d.ts.map +1 -0
- package/dist/mcp/tools/teamComms.js +1953 -0
- package/dist/mcp/tools/teamComms.js.map +1 -0
- package/dist/mcp/triggerSystem.d.ts +129 -0
- package/dist/mcp/triggerSystem.d.ts.map +1 -0
- package/dist/mcp/triggerSystem.js +363 -0
- package/dist/mcp/triggerSystem.js.map +1 -0
- package/dist/mcp/watcherIntegration.d.ts +77 -0
- package/dist/mcp/watcherIntegration.d.ts.map +1 -0
- package/dist/mcp/watcherIntegration.js +428 -0
- package/dist/mcp/watcherIntegration.js.map +1 -0
- package/dist/mcp/watcherToolWrappers.d.ts +89 -0
- package/dist/mcp/watcherToolWrappers.d.ts.map +1 -0
- package/dist/mcp/watcherToolWrappers.js +91 -0
- package/dist/mcp/watcherToolWrappers.js.map +1 -0
- package/dist/memorization/claudeCodeMigration.d.ts +34 -0
- package/dist/memorization/claudeCodeMigration.d.ts.map +1 -0
- package/dist/memorization/claudeCodeMigration.js +210 -0
- package/dist/memorization/claudeCodeMigration.js.map +1 -0
- package/dist/memorization/claudeCodeTracker.d.ts +147 -0
- package/dist/memorization/claudeCodeTracker.d.ts.map +1 -0
- package/dist/memorization/claudeCodeTracker.js +424 -0
- package/dist/memorization/claudeCodeTracker.js.map +1 -0
- package/dist/memorization/codeMemorizer.d.ts +158 -0
- package/dist/memorization/codeMemorizer.d.ts.map +1 -0
- package/dist/memorization/codeMemorizer.js +357 -0
- package/dist/memorization/codeMemorizer.js.map +1 -0
- package/dist/memorization/codeRecall.d.ts +156 -0
- package/dist/memorization/codeRecall.d.ts.map +1 -0
- package/dist/memorization/codeRecall.js +499 -0
- package/dist/memorization/codeRecall.js.map +1 -0
- package/dist/memorization/index.d.ts +55 -0
- package/dist/memorization/index.d.ts.map +1 -0
- package/dist/memorization/index.js +64 -0
- package/dist/memorization/index.js.map +1 -0
- package/dist/memorization/memorizationTools.d.ts +413 -0
- package/dist/memorization/memorizationTools.d.ts.map +1 -0
- package/dist/memorization/memorizationTools.js +513 -0
- package/dist/memorization/memorizationTools.js.map +1 -0
- package/dist/memorization/watcherIntegration.d.ts +100 -0
- package/dist/memorization/watcherIntegration.d.ts.map +1 -0
- package/dist/memorization/watcherIntegration.js +196 -0
- package/dist/memorization/watcherIntegration.js.map +1 -0
- package/dist/memory/humanLikeMemory.d.ts +206 -0
- package/dist/memory/humanLikeMemory.d.ts.map +1 -0
- package/dist/memory/humanLikeMemory.js +603 -0
- package/dist/memory/humanLikeMemory.js.map +1 -0
- package/dist/memory/index.d.ts +22 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +24 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/memoryEvolutionMigration.d.ts +36 -0
- package/dist/memory/memoryEvolutionMigration.d.ts.map +1 -0
- package/dist/memory/memoryEvolutionMigration.js +371 -0
- package/dist/memory/memoryEvolutionMigration.js.map +1 -0
- package/dist/memory/quadrantSearch.d.ts +221 -0
- package/dist/memory/quadrantSearch.d.ts.map +1 -0
- package/dist/memory/quadrantSearch.js +897 -0
- package/dist/memory/quadrantSearch.js.map +1 -0
- package/dist/middleware/apiVersioning.d.ts +83 -0
- package/dist/middleware/apiVersioning.d.ts.map +1 -0
- package/dist/middleware/apiVersioning.js +152 -0
- package/dist/middleware/apiVersioning.js.map +1 -0
- package/dist/middleware/compression.d.ts +48 -0
- package/dist/middleware/compression.d.ts.map +1 -0
- package/dist/middleware/compression.js +240 -0
- package/dist/middleware/compression.js.map +1 -0
- package/dist/middleware/csrf.d.ts +118 -0
- package/dist/middleware/csrf.d.ts.map +1 -0
- package/dist/middleware/csrf.js +300 -0
- package/dist/middleware/csrf.js.map +1 -0
- package/dist/middleware/index.d.ts +13 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +17 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/middleware/wsRateLimiter.d.ts +129 -0
- package/dist/middleware/wsRateLimiter.d.ts.map +1 -0
- package/dist/middleware/wsRateLimiter.js +279 -0
- package/dist/middleware/wsRateLimiter.js.map +1 -0
- package/dist/migrations/run.d.ts +2 -0
- package/dist/migrations/run.d.ts.map +1 -0
- package/dist/migrations/run.js +25 -0
- package/dist/migrations/run.js.map +1 -0
- package/dist/migrations/syncDimensions.d.ts +24 -0
- package/dist/migrations/syncDimensions.d.ts.map +1 -0
- package/dist/migrations/syncDimensions.js +140 -0
- package/dist/migrations/syncDimensions.js.map +1 -0
- package/dist/migrations/teamComms.d.ts +16 -0
- package/dist/migrations/teamComms.d.ts.map +1 -0
- package/dist/migrations/teamComms.js +210 -0
- package/dist/migrations/teamComms.js.map +1 -0
- package/dist/openapi/index.d.ts +10 -0
- package/dist/openapi/index.d.ts.map +1 -0
- package/dist/openapi/index.js +10 -0
- package/dist/openapi/index.js.map +1 -0
- package/dist/openapi/spec.d.ts +902 -0
- package/dist/openapi/spec.d.ts.map +1 -0
- package/dist/openapi/spec.js +733 -0
- package/dist/openapi/spec.js.map +1 -0
- package/dist/packages/dependencyHistory.d.ts +113 -0
- package/dist/packages/dependencyHistory.d.ts.map +1 -0
- package/dist/packages/dependencyHistory.js +360 -0
- package/dist/packages/dependencyHistory.js.map +1 -0
- package/dist/packages/index.d.ts +30 -0
- package/dist/packages/index.d.ts.map +1 -0
- package/dist/packages/index.js +65 -0
- package/dist/packages/index.js.map +1 -0
- package/dist/packages/packageTools.d.ts +255 -0
- package/dist/packages/packageTools.d.ts.map +1 -0
- package/dist/packages/packageTools.js +242 -0
- package/dist/packages/packageTools.js.map +1 -0
- package/dist/packages/packageTracker.d.ts +98 -0
- package/dist/packages/packageTracker.d.ts.map +1 -0
- package/dist/packages/packageTracker.js +268 -0
- package/dist/packages/packageTracker.js.map +1 -0
- package/dist/packages/packageWatcher.d.ts +62 -0
- package/dist/packages/packageWatcher.d.ts.map +1 -0
- package/dist/packages/packageWatcher.js +146 -0
- package/dist/packages/packageWatcher.js.map +1 -0
- package/dist/providers/MiniCOTProvider.d.ts +48 -0
- package/dist/providers/MiniCOTProvider.d.ts.map +1 -0
- package/dist/providers/MiniCOTProvider.js +98 -0
- package/dist/providers/MiniCOTProvider.js.map +1 -0
- package/dist/reminders/index.d.ts +5 -0
- package/dist/reminders/index.d.ts.map +1 -0
- package/dist/reminders/index.js +5 -0
- package/dist/reminders/index.js.map +1 -0
- package/dist/reminders/skillReminder.d.ts +131 -0
- package/dist/reminders/skillReminder.d.ts.map +1 -0
- package/dist/reminders/skillReminder.js +386 -0
- package/dist/reminders/skillReminder.js.map +1 -0
- package/dist/search.d.ts +35 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +574 -0
- package/dist/search.js.map +1 -0
- package/dist/security/localhostOnly.d.ts +36 -0
- package/dist/security/localhostOnly.d.ts.map +1 -0
- package/dist/security/localhostOnly.js +101 -0
- package/dist/security/localhostOnly.js.map +1 -0
- package/dist/services/CameraZoomSearch.d.ts +206 -0
- package/dist/services/CameraZoomSearch.d.ts.map +1 -0
- package/dist/services/CameraZoomSearch.js +669 -0
- package/dist/services/CameraZoomSearch.js.map +1 -0
- package/dist/services/DataFlowPipeline.d.ts +111 -0
- package/dist/services/DataFlowPipeline.d.ts.map +1 -0
- package/dist/services/DataFlowPipeline.js +379 -0
- package/dist/services/DataFlowPipeline.js.map +1 -0
- package/dist/services/DimensionAdapter.d.ts +194 -0
- package/dist/services/DimensionAdapter.d.ts.map +1 -0
- package/dist/services/DimensionAdapter.js +566 -0
- package/dist/services/DimensionAdapter.js.map +1 -0
- package/dist/services/DimensionService.d.ts +252 -0
- package/dist/services/DimensionService.d.ts.map +1 -0
- package/dist/services/DimensionService.js +564 -0
- package/dist/services/DimensionService.js.map +1 -0
- package/dist/services/EmbeddingQueue.d.ts +71 -0
- package/dist/services/EmbeddingQueue.d.ts.map +1 -0
- package/dist/services/EmbeddingQueue.js +258 -0
- package/dist/services/EmbeddingQueue.js.map +1 -0
- package/dist/services/MemoryDrilldown.d.ts +226 -0
- package/dist/services/MemoryDrilldown.d.ts.map +1 -0
- package/dist/services/MemoryDrilldown.js +479 -0
- package/dist/services/MemoryDrilldown.js.map +1 -0
- package/dist/services/MiniCOTScorer.d.ts +140 -0
- package/dist/services/MiniCOTScorer.d.ts.map +1 -0
- package/dist/services/MiniCOTScorer.js +292 -0
- package/dist/services/MiniCOTScorer.js.map +1 -0
- package/dist/services/ProjectContext.d.ts +342 -0
- package/dist/services/ProjectContext.d.ts.map +1 -0
- package/dist/services/ProjectContext.js +667 -0
- package/dist/services/ProjectContext.js.map +1 -0
- package/dist/services/ResponseCompactor.d.ts +135 -0
- package/dist/services/ResponseCompactor.d.ts.map +1 -0
- package/dist/services/ResponseCompactor.js +501 -0
- package/dist/services/ResponseCompactor.js.map +1 -0
- package/dist/services/TeamCommsDbService.d.ts +202 -0
- package/dist/services/TeamCommsDbService.d.ts.map +1 -0
- package/dist/services/TeamCommsDbService.js +526 -0
- package/dist/services/TeamCommsDbService.js.map +1 -0
- package/dist/services/UnifiedPasswordService.d.ts +166 -0
- package/dist/services/UnifiedPasswordService.d.ts.map +1 -0
- package/dist/services/UnifiedPasswordService.js +587 -0
- package/dist/services/UnifiedPasswordService.js.map +1 -0
- package/dist/services/adaptiveSearchConfig.d.ts +64 -0
- package/dist/services/adaptiveSearchConfig.d.ts.map +1 -0
- package/dist/services/adaptiveSearchConfig.js +187 -0
- package/dist/services/adaptiveSearchConfig.js.map +1 -0
- package/dist/skills/index.d.ts +8 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +8 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/skillScanner.d.ts +203 -0
- package/dist/skills/skillScanner.d.ts.map +1 -0
- package/dist/skills/skillScanner.js +559 -0
- package/dist/skills/skillScanner.js.map +1 -0
- package/dist/skills/skillsResource.d.ts +69 -0
- package/dist/skills/skillsResource.d.ts.map +1 -0
- package/dist/skills/skillsResource.js +257 -0
- package/dist/skills/skillsResource.js.map +1 -0
- package/dist/startup/index.d.ts +9 -0
- package/dist/startup/index.d.ts.map +1 -0
- package/dist/startup/index.js +12 -0
- package/dist/startup/index.js.map +1 -0
- package/dist/startup/startupIndexing.d.ts +80 -0
- package/dist/startup/startupIndexing.d.ts.map +1 -0
- package/dist/startup/startupIndexing.js +463 -0
- package/dist/startup/startupIndexing.js.map +1 -0
- package/dist/startup/validation.d.ts +89 -0
- package/dist/startup/validation.d.ts.map +1 -0
- package/dist/startup/validation.js +590 -0
- package/dist/startup/validation.js.map +1 -0
- package/dist/storage/index.d.ts +4 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +4 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/overflowManager.d.ts +80 -0
- package/dist/storage/overflowManager.d.ts.map +1 -0
- package/dist/storage/overflowManager.js +317 -0
- package/dist/storage/overflowManager.js.map +1 -0
- package/dist/storage/overflowStorage.d.ts +69 -0
- package/dist/storage/overflowStorage.d.ts.map +1 -0
- package/dist/storage/overflowStorage.js +379 -0
- package/dist/storage/overflowStorage.js.map +1 -0
- package/dist/storage/toonFormat.d.ts +50 -0
- package/dist/storage/toonFormat.d.ts.map +1 -0
- package/dist/storage/toonFormat.js +224 -0
- package/dist/storage/toonFormat.js.map +1 -0
- package/dist/team-members/communication.d.ts +237 -0
- package/dist/team-members/communication.d.ts.map +1 -0
- package/dist/team-members/communication.js +650 -0
- package/dist/team-members/communication.js.map +1 -0
- package/dist/team-members/index.d.ts +14 -0
- package/dist/team-members/index.d.ts.map +1 -0
- package/dist/team-members/index.js +22 -0
- package/dist/team-members/index.js.map +1 -0
- package/dist/team-members/taskOrchestrator.d.ts +224 -0
- package/dist/team-members/taskOrchestrator.d.ts.map +1 -0
- package/dist/team-members/taskOrchestrator.js +574 -0
- package/dist/team-members/taskOrchestrator.js.map +1 -0
- package/dist/team-members/taskTeamMemberLogger.d.ts +157 -0
- package/dist/team-members/taskTeamMemberLogger.d.ts.map +1 -0
- package/dist/team-members/taskTeamMemberLogger.js +478 -0
- package/dist/team-members/taskTeamMemberLogger.js.map +1 -0
- package/dist/team-members/teamCommsService.d.ts +221 -0
- package/dist/team-members/teamCommsService.d.ts.map +1 -0
- package/dist/team-members/teamCommsService.js +628 -0
- package/dist/team-members/teamCommsService.js.map +1 -0
- package/dist/team-members/teamMemberChannels.d.ts +217 -0
- package/dist/team-members/teamMemberChannels.d.ts.map +1 -0
- package/dist/team-members/teamMemberChannels.js +687 -0
- package/dist/team-members/teamMemberChannels.js.map +1 -0
- package/dist/team-members/teamMemberDashboard.d.ts +222 -0
- package/dist/team-members/teamMemberDashboard.d.ts.map +1 -0
- package/dist/team-members/teamMemberDashboard.js +610 -0
- package/dist/team-members/teamMemberDashboard.js.map +1 -0
- package/dist/team-members/teamMemberDeployment.d.ts +60 -0
- package/dist/team-members/teamMemberDeployment.d.ts.map +1 -0
- package/dist/team-members/teamMemberDeployment.js +429 -0
- package/dist/team-members/teamMemberDeployment.js.map +1 -0
- package/dist/team-members/teamMemberDiscovery.d.ts +178 -0
- package/dist/team-members/teamMemberDiscovery.d.ts.map +1 -0
- package/dist/team-members/teamMemberDiscovery.js +446 -0
- package/dist/team-members/teamMemberDiscovery.js.map +1 -0
- package/dist/team-members/teamMemberHistory.d.ts +80 -0
- package/dist/team-members/teamMemberHistory.d.ts.map +1 -0
- package/dist/team-members/teamMemberHistory.js +426 -0
- package/dist/team-members/teamMemberHistory.js.map +1 -0
- package/dist/team-members/teamMemberLimits.d.ts +66 -0
- package/dist/team-members/teamMemberLimits.d.ts.map +1 -0
- package/dist/team-members/teamMemberLimits.js +259 -0
- package/dist/team-members/teamMemberLimits.js.map +1 -0
- package/dist/team-members/teamMemberRegistry.d.ts +199 -0
- package/dist/team-members/teamMemberRegistry.d.ts.map +1 -0
- package/dist/team-members/teamMemberRegistry.js +572 -0
- package/dist/team-members/teamMemberRegistry.js.map +1 -0
- package/dist/team-members/teamMemberTracker.d.ts +148 -0
- package/dist/team-members/teamMemberTracker.d.ts.map +1 -0
- package/dist/team-members/teamMemberTracker.js +828 -0
- package/dist/team-members/teamMemberTracker.js.map +1 -0
- package/dist/team-members/workers/aiWorker.d.ts +53 -0
- package/dist/team-members/workers/aiWorker.d.ts.map +1 -0
- package/dist/team-members/workers/aiWorker.js +322 -0
- package/dist/team-members/workers/aiWorker.js.map +1 -0
- package/dist/team-members/workers/baseWorker.d.ts +101 -0
- package/dist/team-members/workers/baseWorker.d.ts.map +1 -0
- package/dist/team-members/workers/baseWorker.js +179 -0
- package/dist/team-members/workers/baseWorker.js.map +1 -0
- package/dist/team-members/workers/codeReviewWorker.d.ts +3 -0
- package/dist/team-members/workers/codeReviewWorker.d.ts.map +1 -0
- package/dist/team-members/workers/codeReviewWorker.js +144 -0
- package/dist/team-members/workers/codeReviewWorker.js.map +1 -0
- package/dist/team-members/workers/index.d.ts +7 -0
- package/dist/team-members/workers/index.d.ts.map +1 -0
- package/dist/team-members/workers/index.js +7 -0
- package/dist/team-members/workers/index.js.map +1 -0
- package/dist/team-members/workers/repairWorker.d.ts +9 -0
- package/dist/team-members/workers/repairWorker.d.ts.map +1 -0
- package/dist/team-members/workers/repairWorker.js +102 -0
- package/dist/team-members/workers/repairWorker.js.map +1 -0
- package/dist/team-members/workers/sendToTeamMemberB.d.ts +9 -0
- package/dist/team-members/workers/sendToTeamMemberB.d.ts.map +1 -0
- package/dist/team-members/workers/sendToTeamMemberB.js +105 -0
- package/dist/team-members/workers/sendToTeamMemberB.js.map +1 -0
- package/dist/team-members/workers/specmemClient.d.ts +179 -0
- package/dist/team-members/workers/specmemClient.d.ts.map +1 -0
- package/dist/team-members/workers/specmemClient.js +421 -0
- package/dist/team-members/workers/specmemClient.js.map +1 -0
- package/dist/team-members/workers/testCommunication.d.ts +8 -0
- package/dist/team-members/workers/testCommunication.d.ts.map +1 -0
- package/dist/team-members/workers/testCommunication.js +136 -0
- package/dist/team-members/workers/testCommunication.js.map +1 -0
- package/dist/team-members/workers/testCommunicationSuite.d.ts +26 -0
- package/dist/team-members/workers/testCommunicationSuite.d.ts.map +1 -0
- package/dist/team-members/workers/testCommunicationSuite.js +415 -0
- package/dist/team-members/workers/testCommunicationSuite.js.map +1 -0
- package/dist/team-members/workers/testWorker.d.ts +9 -0
- package/dist/team-members/workers/testWorker.d.ts.map +1 -0
- package/dist/team-members/workers/testWorker.js +107 -0
- package/dist/team-members/workers/testWorker.js.map +1 -0
- package/dist/tools/agentDefinitions.d.ts +30 -0
- package/dist/tools/agentDefinitions.d.ts.map +1 -0
- package/dist/tools/agentDefinitions.js +166 -0
- package/dist/tools/agentDefinitions.js.map +1 -0
- package/dist/tools/goofy/checkSyncStatus.d.ts +68 -0
- package/dist/tools/goofy/checkSyncStatus.d.ts.map +1 -0
- package/dist/tools/goofy/checkSyncStatus.js +112 -0
- package/dist/tools/goofy/checkSyncStatus.js.map +1 -0
- package/dist/tools/goofy/codeMemoryLink.d.ts +82 -0
- package/dist/tools/goofy/codeMemoryLink.d.ts.map +1 -0
- package/dist/tools/goofy/codeMemoryLink.js +212 -0
- package/dist/tools/goofy/codeMemoryLink.js.map +1 -0
- package/dist/tools/goofy/compareInstanceMemory.d.ts +97 -0
- package/dist/tools/goofy/compareInstanceMemory.d.ts.map +1 -0
- package/dist/tools/goofy/compareInstanceMemory.js +218 -0
- package/dist/tools/goofy/compareInstanceMemory.js.map +1 -0
- package/dist/tools/goofy/createReasoningChain.d.ts +135 -0
- package/dist/tools/goofy/createReasoningChain.d.ts.map +1 -0
- package/dist/tools/goofy/createReasoningChain.js +257 -0
- package/dist/tools/goofy/createReasoningChain.js.map +1 -0
- package/dist/tools/goofy/deployTeamMember.d.ts +63 -0
- package/dist/tools/goofy/deployTeamMember.d.ts.map +1 -0
- package/dist/tools/goofy/deployTeamMember.js +103 -0
- package/dist/tools/goofy/deployTeamMember.js.map +1 -0
- package/dist/tools/goofy/drillDown.d.ts +143 -0
- package/dist/tools/goofy/drillDown.d.ts.map +1 -0
- package/dist/tools/goofy/drillDown.js +288 -0
- package/dist/tools/goofy/drillDown.js.map +1 -0
- package/dist/tools/goofy/extractClaudeSessions.d.ts +90 -0
- package/dist/tools/goofy/extractClaudeSessions.d.ts.map +1 -0
- package/dist/tools/goofy/extractClaudeSessions.js +277 -0
- package/dist/tools/goofy/extractClaudeSessions.js.map +1 -0
- package/dist/tools/goofy/extractContextRestorations.d.ts +70 -0
- package/dist/tools/goofy/extractContextRestorations.d.ts.map +1 -0
- package/dist/tools/goofy/extractContextRestorations.js +100 -0
- package/dist/tools/goofy/extractContextRestorations.js.map +1 -0
- package/dist/tools/goofy/findCodePointers.d.ts +364 -0
- package/dist/tools/goofy/findCodePointers.d.ts.map +1 -0
- package/dist/tools/goofy/findCodePointers.js +1764 -0
- package/dist/tools/goofy/findCodePointers.js.map +1 -0
- package/dist/tools/goofy/findMemoryGallery.d.ts +40 -0
- package/dist/tools/goofy/findMemoryGallery.d.ts.map +1 -0
- package/dist/tools/goofy/findMemoryGallery.js +66 -0
- package/dist/tools/goofy/findMemoryGallery.js.map +1 -0
- package/dist/tools/goofy/findWhatISaid.d.ts +300 -0
- package/dist/tools/goofy/findWhatISaid.d.ts.map +1 -0
- package/dist/tools/goofy/findWhatISaid.js +2547 -0
- package/dist/tools/goofy/findWhatISaid.js.map +1 -0
- package/dist/tools/goofy/forceResync.d.ts +57 -0
- package/dist/tools/goofy/forceResync.d.ts.map +1 -0
- package/dist/tools/goofy/forceResync.js +100 -0
- package/dist/tools/goofy/forceResync.js.map +1 -0
- package/dist/tools/goofy/getActiveTeamMembers.d.ts +48 -0
- package/dist/tools/goofy/getActiveTeamMembers.d.ts.map +1 -0
- package/dist/tools/goofy/getActiveTeamMembers.js +136 -0
- package/dist/tools/goofy/getActiveTeamMembers.js.map +1 -0
- package/dist/tools/goofy/getMemoryFull.d.ts +34 -0
- package/dist/tools/goofy/getMemoryFull.d.ts.map +1 -0
- package/dist/tools/goofy/getMemoryFull.js +58 -0
- package/dist/tools/goofy/getMemoryFull.js.map +1 -0
- package/dist/tools/goofy/getSessionWatcherStatus.d.ts +43 -0
- package/dist/tools/goofy/getSessionWatcherStatus.d.ts.map +1 -0
- package/dist/tools/goofy/getSessionWatcherStatus.js +92 -0
- package/dist/tools/goofy/getSessionWatcherStatus.js.map +1 -0
- package/dist/tools/goofy/getTeamMemberOutput.d.ts +35 -0
- package/dist/tools/goofy/getTeamMemberOutput.d.ts.map +1 -0
- package/dist/tools/goofy/getTeamMemberOutput.js +62 -0
- package/dist/tools/goofy/getTeamMemberOutput.js.map +1 -0
- package/dist/tools/goofy/getTeamMemberScreen.d.ts +28 -0
- package/dist/tools/goofy/getTeamMemberScreen.d.ts.map +1 -0
- package/dist/tools/goofy/getTeamMemberScreen.js +59 -0
- package/dist/tools/goofy/getTeamMemberScreen.js.map +1 -0
- package/dist/tools/goofy/getTeamMemberStatus.d.ts +33 -0
- package/dist/tools/goofy/getTeamMemberStatus.d.ts.map +1 -0
- package/dist/tools/goofy/getTeamMemberStatus.js +56 -0
- package/dist/tools/goofy/getTeamMemberStatus.js.map +1 -0
- package/dist/tools/goofy/index.d.ts +39 -0
- package/dist/tools/goofy/index.d.ts.map +1 -0
- package/dist/tools/goofy/index.js +51 -0
- package/dist/tools/goofy/index.js.map +1 -0
- package/dist/tools/goofy/interveneTeamMember.d.ts +33 -0
- package/dist/tools/goofy/interveneTeamMember.d.ts.map +1 -0
- package/dist/tools/goofy/interveneTeamMember.js +69 -0
- package/dist/tools/goofy/interveneTeamMember.js.map +1 -0
- package/dist/tools/goofy/killDeployedTeamMember.d.ts +29 -0
- package/dist/tools/goofy/killDeployedTeamMember.d.ts.map +1 -0
- package/dist/tools/goofy/killDeployedTeamMember.js +56 -0
- package/dist/tools/goofy/killDeployedTeamMember.js.map +1 -0
- package/dist/tools/goofy/linkTheVibes.d.ts +125 -0
- package/dist/tools/goofy/linkTheVibes.d.ts.map +1 -0
- package/dist/tools/goofy/linkTheVibes.js +354 -0
- package/dist/tools/goofy/linkTheVibes.js.map +1 -0
- package/dist/tools/goofy/listDeployedTeamMembers.d.ts +26 -0
- package/dist/tools/goofy/listDeployedTeamMembers.d.ts.map +1 -0
- package/dist/tools/goofy/listDeployedTeamMembers.js +52 -0
- package/dist/tools/goofy/listDeployedTeamMembers.js.map +1 -0
- package/dist/tools/goofy/listenForMessages.d.ts +56 -0
- package/dist/tools/goofy/listenForMessages.d.ts.map +1 -0
- package/dist/tools/goofy/listenForMessages.js +122 -0
- package/dist/tools/goofy/listenForMessages.js.map +1 -0
- package/dist/tools/goofy/memoryHealthCheck.d.ts +159 -0
- package/dist/tools/goofy/memoryHealthCheck.d.ts.map +1 -0
- package/dist/tools/goofy/memoryHealthCheck.js +443 -0
- package/dist/tools/goofy/memoryHealthCheck.js.map +1 -0
- package/dist/tools/goofy/rememberThisShit.d.ts +103 -0
- package/dist/tools/goofy/rememberThisShit.d.ts.map +1 -0
- package/dist/tools/goofy/rememberThisShit.js +291 -0
- package/dist/tools/goofy/rememberThisShit.js.map +1 -0
- package/dist/tools/goofy/sayToTeamMember.d.ts +55 -0
- package/dist/tools/goofy/sayToTeamMember.d.ts.map +1 -0
- package/dist/tools/goofy/sayToTeamMember.js +116 -0
- package/dist/tools/goofy/sayToTeamMember.js.map +1 -0
- package/dist/tools/goofy/selfMessage.d.ts +54 -0
- package/dist/tools/goofy/selfMessage.d.ts.map +1 -0
- package/dist/tools/goofy/selfMessage.js +111 -0
- package/dist/tools/goofy/selfMessage.js.map +1 -0
- package/dist/tools/goofy/sendHeartbeat.d.ts +53 -0
- package/dist/tools/goofy/sendHeartbeat.d.ts.map +1 -0
- package/dist/tools/goofy/sendHeartbeat.js +119 -0
- package/dist/tools/goofy/sendHeartbeat.js.map +1 -0
- package/dist/tools/goofy/showMeTheStats.d.ts +216 -0
- package/dist/tools/goofy/showMeTheStats.d.ts.map +1 -0
- package/dist/tools/goofy/showMeTheStats.js +535 -0
- package/dist/tools/goofy/showMeTheStats.js.map +1 -0
- package/dist/tools/goofy/smartRecall.d.ts +136 -0
- package/dist/tools/goofy/smartRecall.d.ts.map +1 -0
- package/dist/tools/goofy/smartRecall.js +286 -0
- package/dist/tools/goofy/smartRecall.js.map +1 -0
- package/dist/tools/goofy/smartSearch.d.ts +64 -0
- package/dist/tools/goofy/smartSearch.d.ts.map +1 -0
- package/dist/tools/goofy/smartSearch.js +89 -0
- package/dist/tools/goofy/smartSearch.js.map +1 -0
- package/dist/tools/goofy/smushMemoriesTogether.d.ts +128 -0
- package/dist/tools/goofy/smushMemoriesTogether.d.ts.map +1 -0
- package/dist/tools/goofy/smushMemoriesTogether.js +536 -0
- package/dist/tools/goofy/smushMemoriesTogether.js.map +1 -0
- package/dist/tools/goofy/spatialSearch.d.ts +198 -0
- package/dist/tools/goofy/spatialSearch.d.ts.map +1 -0
- package/dist/tools/goofy/spatialSearch.js +551 -0
- package/dist/tools/goofy/spatialSearch.js.map +1 -0
- package/dist/tools/goofy/spawnResearchTeamMember.d.ts +104 -0
- package/dist/tools/goofy/spawnResearchTeamMember.d.ts.map +1 -0
- package/dist/tools/goofy/spawnResearchTeamMember.js +290 -0
- package/dist/tools/goofy/spawnResearchTeamMember.js.map +1 -0
- package/dist/tools/goofy/spawnResearchTeamMemberTool.d.ts +121 -0
- package/dist/tools/goofy/spawnResearchTeamMemberTool.d.ts.map +1 -0
- package/dist/tools/goofy/spawnResearchTeamMemberTool.js +215 -0
- package/dist/tools/goofy/spawnResearchTeamMemberTool.js.map +1 -0
- package/dist/tools/goofy/startWatchingTheFiles.d.ts +81 -0
- package/dist/tools/goofy/startWatchingTheFiles.d.ts.map +1 -0
- package/dist/tools/goofy/startWatchingTheFiles.js +161 -0
- package/dist/tools/goofy/startWatchingTheFiles.js.map +1 -0
- package/dist/tools/goofy/stopWatchingTheFiles.d.ts +50 -0
- package/dist/tools/goofy/stopWatchingTheFiles.d.ts.map +1 -0
- package/dist/tools/goofy/stopWatchingTheFiles.js +81 -0
- package/dist/tools/goofy/stopWatchingTheFiles.js.map +1 -0
- package/dist/tools/goofy/whatDidIMean.d.ts +113 -0
- package/dist/tools/goofy/whatDidIMean.d.ts.map +1 -0
- package/dist/tools/goofy/whatDidIMean.js +401 -0
- package/dist/tools/goofy/whatDidIMean.js.map +1 -0
- package/dist/tools/goofy/yeahNahDeleteThat.d.ts +109 -0
- package/dist/tools/goofy/yeahNahDeleteThat.d.ts.map +1 -0
- package/dist/tools/goofy/yeahNahDeleteThat.js +319 -0
- package/dist/tools/goofy/yeahNahDeleteThat.js.map +1 -0
- package/dist/tools/index.d.ts +9 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +9 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/teamMemberDeployer.d.ts +117 -0
- package/dist/tools/teamMemberDeployer.d.ts.map +1 -0
- package/dist/tools/teamMemberDeployer.js +613 -0
- package/dist/tools/teamMemberDeployer.js.map +1 -0
- package/dist/trace/index.d.ts +14 -0
- package/dist/trace/index.d.ts.map +1 -0
- package/dist/trace/index.js +16 -0
- package/dist/trace/index.js.map +1 -0
- package/dist/trace/tools/analyzeImpact.d.ts +90 -0
- package/dist/trace/tools/analyzeImpact.d.ts.map +1 -0
- package/dist/trace/tools/analyzeImpact.js +240 -0
- package/dist/trace/tools/analyzeImpact.js.map +1 -0
- package/dist/trace/tools/exploreDependencies.d.ts +81 -0
- package/dist/trace/tools/exploreDependencies.d.ts.map +1 -0
- package/dist/trace/tools/exploreDependencies.js +161 -0
- package/dist/trace/tools/exploreDependencies.js.map +1 -0
- package/dist/trace/tools/findSimilarBugs.d.ts +112 -0
- package/dist/trace/tools/findSimilarBugs.d.ts.map +1 -0
- package/dist/trace/tools/findSimilarBugs.js +216 -0
- package/dist/trace/tools/findSimilarBugs.js.map +1 -0
- package/dist/trace/tools/index.d.ts +22 -0
- package/dist/trace/tools/index.d.ts.map +1 -0
- package/dist/trace/tools/index.js +39 -0
- package/dist/trace/tools/index.js.map +1 -0
- package/dist/trace/tools/smartExplore.d.ts +126 -0
- package/dist/trace/tools/smartExplore.d.ts.map +1 -0
- package/dist/trace/tools/smartExplore.js +303 -0
- package/dist/trace/tools/smartExplore.js.map +1 -0
- package/dist/trace/tools/traceError.d.ts +101 -0
- package/dist/trace/tools/traceError.d.ts.map +1 -0
- package/dist/trace/tools/traceError.js +175 -0
- package/dist/trace/tools/traceError.js.map +1 -0
- package/dist/trace/traceExploreSystem.d.ts +271 -0
- package/dist/trace/traceExploreSystem.d.ts.map +1 -0
- package/dist/trace/traceExploreSystem.js +789 -0
- package/dist/trace/traceExploreSystem.js.map +1 -0
- package/dist/types/index.d.ts +421 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +118 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/circuitBreaker.d.ts +195 -0
- package/dist/utils/circuitBreaker.d.ts.map +1 -0
- package/dist/utils/circuitBreaker.js +374 -0
- package/dist/utils/circuitBreaker.js.map +1 -0
- package/dist/utils/cleanupHandler.d.ts +108 -0
- package/dist/utils/cleanupHandler.d.ts.map +1 -0
- package/dist/utils/cleanupHandler.js +203 -0
- package/dist/utils/cleanupHandler.js.map +1 -0
- package/dist/utils/compactXmlResponse.d.ts +60 -0
- package/dist/utils/compactXmlResponse.d.ts.map +1 -0
- package/dist/utils/compactXmlResponse.js +209 -0
- package/dist/utils/compactXmlResponse.js.map +1 -0
- package/dist/utils/cotBroadcast.d.ts +56 -0
- package/dist/utils/cotBroadcast.d.ts.map +1 -0
- package/dist/utils/cotBroadcast.js +157 -0
- package/dist/utils/cotBroadcast.js.map +1 -0
- package/dist/utils/debugLogger.d.ts +95 -0
- package/dist/utils/debugLogger.d.ts.map +1 -0
- package/dist/utils/debugLogger.js +610 -0
- package/dist/utils/debugLogger.js.map +1 -0
- package/dist/utils/fileProcessingQueue.d.ts +259 -0
- package/dist/utils/fileProcessingQueue.d.ts.map +1 -0
- package/dist/utils/fileProcessingQueue.js +714 -0
- package/dist/utils/fileProcessingQueue.js.map +1 -0
- package/dist/utils/humanReadableOutput.d.ts +124 -0
- package/dist/utils/humanReadableOutput.d.ts.map +1 -0
- package/dist/utils/humanReadableOutput.js +340 -0
- package/dist/utils/humanReadableOutput.js.map +1 -0
- package/dist/utils/index.d.ts +32 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +71 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/instanceManager.d.ts +530 -0
- package/dist/utils/instanceManager.d.ts.map +1 -0
- package/dist/utils/instanceManager.js +1784 -0
- package/dist/utils/instanceManager.js.map +1 -0
- package/dist/utils/logger.d.ts +6 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +49 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/mapCleanup.d.ts +58 -0
- package/dist/utils/mapCleanup.d.ts.map +1 -0
- package/dist/utils/mapCleanup.js +150 -0
- package/dist/utils/mapCleanup.js.map +1 -0
- package/dist/utils/memoryManager.d.ts +349 -0
- package/dist/utils/memoryManager.d.ts.map +1 -0
- package/dist/utils/memoryManager.js +799 -0
- package/dist/utils/memoryManager.js.map +1 -0
- package/dist/utils/metrics.d.ts +160 -0
- package/dist/utils/metrics.d.ts.map +1 -0
- package/dist/utils/metrics.js +558 -0
- package/dist/utils/metrics.js.map +1 -0
- package/dist/utils/pathValidator.d.ts +96 -0
- package/dist/utils/pathValidator.d.ts.map +1 -0
- package/dist/utils/pathValidator.js +320 -0
- package/dist/utils/pathValidator.js.map +1 -0
- package/dist/utils/portAllocator.d.ts +296 -0
- package/dist/utils/portAllocator.d.ts.map +1 -0
- package/dist/utils/portAllocator.js +768 -0
- package/dist/utils/portAllocator.js.map +1 -0
- package/dist/utils/portUtils.d.ts +97 -0
- package/dist/utils/portUtils.d.ts.map +1 -0
- package/dist/utils/portUtils.js +285 -0
- package/dist/utils/portUtils.js.map +1 -0
- package/dist/utils/postgresAutoSetup.d.ts +55 -0
- package/dist/utils/postgresAutoSetup.d.ts.map +1 -0
- package/dist/utils/postgresAutoSetup.js +406 -0
- package/dist/utils/postgresAutoSetup.js.map +1 -0
- package/dist/utils/processHealthCheck.d.ts +61 -0
- package/dist/utils/processHealthCheck.d.ts.map +1 -0
- package/dist/utils/processHealthCheck.js +313 -0
- package/dist/utils/processHealthCheck.js.map +1 -0
- package/dist/utils/progressReporter.d.ts +151 -0
- package/dist/utils/progressReporter.d.ts.map +1 -0
- package/dist/utils/progressReporter.js +345 -0
- package/dist/utils/progressReporter.js.map +1 -0
- package/dist/utils/projectEnv.d.ts +73 -0
- package/dist/utils/projectEnv.d.ts.map +1 -0
- package/dist/utils/projectEnv.js +137 -0
- package/dist/utils/projectEnv.js.map +1 -0
- package/dist/utils/qoms.d.ts +122 -0
- package/dist/utils/qoms.d.ts.map +1 -0
- package/dist/utils/qoms.js +650 -0
- package/dist/utils/qoms.js.map +1 -0
- package/dist/utils/retryHelper.d.ts +122 -0
- package/dist/utils/retryHelper.d.ts.map +1 -0
- package/dist/utils/retryHelper.js +272 -0
- package/dist/utils/retryHelper.js.map +1 -0
- package/dist/utils/safeProcessTermination.d.ts +206 -0
- package/dist/utils/safeProcessTermination.d.ts.map +1 -0
- package/dist/utils/safeProcessTermination.js +552 -0
- package/dist/utils/safeProcessTermination.js.map +1 -0
- package/dist/utils/sessionInjector.d.ts +68 -0
- package/dist/utils/sessionInjector.d.ts.map +1 -0
- package/dist/utils/sessionInjector.js +189 -0
- package/dist/utils/sessionInjector.js.map +1 -0
- package/dist/utils/statsCache.d.ts +134 -0
- package/dist/utils/statsCache.d.ts.map +1 -0
- package/dist/utils/statsCache.js +285 -0
- package/dist/utils/statsCache.js.map +1 -0
- package/dist/utils/timeoutMiddleware.d.ts +81 -0
- package/dist/utils/timeoutMiddleware.d.ts.map +1 -0
- package/dist/utils/timeoutMiddleware.js +155 -0
- package/dist/utils/timeoutMiddleware.js.map +1 -0
- package/dist/utils/timerRegistry.d.ts +91 -0
- package/dist/utils/timerRegistry.d.ts.map +1 -0
- package/dist/utils/timerRegistry.js +187 -0
- package/dist/utils/timerRegistry.js.map +1 -0
- package/dist/utils/tokenCompressor.d.ts +332 -0
- package/dist/utils/tokenCompressor.d.ts.map +1 -0
- package/dist/utils/tokenCompressor.js +1306 -0
- package/dist/utils/tokenCompressor.js.map +1 -0
- package/dist/utils/tracing.d.ts +236 -0
- package/dist/utils/tracing.d.ts.map +1 -0
- package/dist/utils/tracing.js +378 -0
- package/dist/utils/tracing.js.map +1 -0
- package/dist/watcher/changeHandler.d.ts +123 -0
- package/dist/watcher/changeHandler.d.ts.map +1 -0
- package/dist/watcher/changeHandler.js +623 -0
- package/dist/watcher/changeHandler.js.map +1 -0
- package/dist/watcher/changeQueue.d.ts +133 -0
- package/dist/watcher/changeQueue.d.ts.map +1 -0
- package/dist/watcher/changeQueue.js +355 -0
- package/dist/watcher/changeQueue.js.map +1 -0
- package/dist/watcher/fileWatcher.d.ts +121 -0
- package/dist/watcher/fileWatcher.d.ts.map +1 -0
- package/dist/watcher/fileWatcher.js +531 -0
- package/dist/watcher/fileWatcher.js.map +1 -0
- package/dist/watcher/index.d.ts +94 -0
- package/dist/watcher/index.d.ts.map +1 -0
- package/dist/watcher/index.js +235 -0
- package/dist/watcher/index.js.map +1 -0
- package/dist/watcher/syncChecker.d.ts +93 -0
- package/dist/watcher/syncChecker.d.ts.map +1 -0
- package/dist/watcher/syncChecker.js +401 -0
- package/dist/watcher/syncChecker.js.map +1 -0
- package/dist/watcher/tsCompiler.d.ts +88 -0
- package/dist/watcher/tsCompiler.d.ts.map +1 -0
- package/dist/watcher/tsCompiler.js +212 -0
- package/dist/watcher/tsCompiler.js.map +1 -0
- package/embedding-sandbox/Dockerfile +77 -0
- package/embedding-sandbox/Dockerfile.frankenstein +91 -0
- package/embedding-sandbox/README.md +193 -0
- package/embedding-sandbox/__pycache__/frankenstein-embeddings.cpython-312.pyc +0 -0
- package/embedding-sandbox/__pycache__/frankenstein-embeddings.cpython-313.pyc +0 -0
- package/embedding-sandbox/__pycache__/qqms_v2.cpython-312.pyc +0 -0
- package/embedding-sandbox/__pycache__/qqms_v2.cpython-313.pyc +0 -0
- package/embedding-sandbox/add_js_docs.py +684 -0
- package/embedding-sandbox/build_docs_db.py +239 -0
- package/embedding-sandbox/client.cjs +376 -0
- package/embedding-sandbox/client.ts +913 -0
- package/embedding-sandbox/deploy-frankenstein.sh +240 -0
- package/embedding-sandbox/docker-compose.yml +60 -0
- package/embedding-sandbox/docker-manager.py +325 -0
- package/embedding-sandbox/docs/python_docs.db +0 -0
- package/embedding-sandbox/download-model.mjs +79 -0
- package/embedding-sandbox/download-model.py +28 -0
- package/embedding-sandbox/embedding-supervisor.sh +164 -0
- package/embedding-sandbox/frankenstein-embeddings.py +3940 -0
- package/embedding-sandbox/manage-services.sh +354 -0
- package/embedding-sandbox/overflow_queue.py +345 -0
- package/embedding-sandbox/package.json +17 -0
- package/embedding-sandbox/project_isolation.py +292 -0
- package/embedding-sandbox/qqms_v2.py +967 -0
- package/embedding-sandbox/ram-manager.sh +311 -0
- package/embedding-sandbox/requirements-frankenstein.txt +7 -0
- package/embedding-sandbox/run_js_docs.py +59 -0
- package/embedding-sandbox/seed_docs.py +885 -0
- package/embedding-sandbox/server-batch.mjs +228 -0
- package/embedding-sandbox/server.mjs +389 -0
- package/embedding-sandbox/specmem/sockets/claude-input-state.json +1 -0
- package/embedding-sandbox/specmem/sockets/embedding-death-reason.txt +3 -0
- package/embedding-sandbox/specmem/sockets/seen-sessions.json +1 -0
- package/embedding-sandbox/specmem/sockets/session-start.lock +1 -0
- package/embedding-sandbox/specmem/sockets/session-stops.log +7 -0
- package/embedding-sandbox/start-frankenstein-throttled.sh +98 -0
- package/embedding-sandbox/start-on-demand.sh +116 -0
- package/embedding-sandbox/start-sandbox.sh +237 -0
- package/embedding-sandbox/start-supervised.sh +11 -0
- package/embedding-sandbox/stop-sandbox.sh +51 -0
- package/embedding-sandbox/test-socket.mjs +61 -0
- package/embedding-sandbox/warm-start.sh +353 -0
- package/embedding-sandbox/warm_start_feeder.py +660 -0
- package/legal/README.md +31 -0
- package/legal/anthropic-privacy-center-screenshot-2026-01-30.png +0 -0
- package/legal/anthropic-tos-screenshot-2026-01-30.png +0 -0
- package/lib/codebase-bridge.cjs +308 -0
- package/package.json +136 -0
- package/plugins/specmem-agents/agents/bug-hunter.md +79 -0
- package/plugins/specmem-agents/agents/memory-explorer.md +57 -0
- package/plugins/specmem-agents/agents/team-coordinator.md +82 -0
- package/scripts/auto-updater.cjs +399 -0
- package/scripts/backfill-code-definition-embeddings.ts +440 -0
- package/scripts/backfill-code-embeddings.ts +206 -0
- package/scripts/capture-tos-screenshots.cjs +94 -0
- package/scripts/check-global-install.cjs +67 -0
- package/scripts/cleanup-embedding-servers.sh +25 -0
- package/scripts/dashboard-standalone.sh +369 -0
- package/scripts/deploy-hooks.cjs +1451 -0
- package/scripts/deploy.sh +106 -0
- package/scripts/docker-project-down.sh +83 -0
- package/scripts/docker-project-list.sh +40 -0
- package/scripts/docker-project-up.sh +79 -0
- package/scripts/fast-backfill-embeddings.ts +173 -0
- package/scripts/fast-batch-embedder.cjs +334 -0
- package/scripts/first-run-model-setup.cjs +849 -0
- package/scripts/global-postinstall.cjs +1957 -0
- package/scripts/index-codebase.js +72 -0
- package/scripts/migrate-fix-embeddings.py +110 -0
- package/scripts/migrate-to-project-schemas.ts +525 -0
- package/scripts/optimize-embedding-model.py +324 -0
- package/scripts/optimize-instructions.cjs +530 -0
- package/scripts/pack-docker-images.sh +68 -0
- package/scripts/pack-for-testing.sh +130 -0
- package/scripts/postinstall.cjs +54 -0
- package/scripts/project-env.sh +51 -0
- package/scripts/reset-db.sh +30 -0
- package/scripts/run-indexer.ts +69 -0
- package/scripts/run-migrations.js +47 -0
- package/scripts/setup-db.sh +34 -0
- package/scripts/setup-minimal-schema.sql +143 -0
- package/scripts/skills/code-review.md +44 -0
- package/scripts/skills/debugging.md +56 -0
- package/scripts/skills/specmem-deployteam.md +239 -0
- package/scripts/skills/teammemberskills/EFFICIENT_GREP.md +171 -0
- package/scripts/skills/teammemberskills/task-planning.md +67 -0
- package/scripts/specmem/sockets/session-start.lock +1 -0
- package/scripts/specmem/sockets/session-stops.log +1 -0
- package/scripts/specmem-health.sh +382 -0
- package/scripts/specmem-init.cjs +6935 -0
- package/scripts/strip-debug-logs.cjs +43 -0
- package/scripts/test-mcp-standalone.sh +365 -0
- package/scripts/test-optimized-models.py +166 -0
- package/scripts/verify-embedding-fix.sh +148 -0
- package/skills/code-review.md +44 -0
- package/skills/debugging.md +56 -0
- package/skills/specmem-deployteam.md +239 -0
- package/skills/teammemberskills/EFFICIENT_GREP.md +171 -0
- package/skills/teammemberskills/task-planning.md +67 -0
- package/specmem-health.cjs +522 -0
- package/specmem.env +216 -0
|
@@ -0,0 +1,1154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLAUDE CONFIG INJECTOR - ENHANCED AUTO-CONFIGURATION
|
|
3
|
+
* =====================================================
|
|
4
|
+
*
|
|
5
|
+
* Auto-injects SpecMem configuration into Code on startup.
|
|
6
|
+
* This is the CENTRAL entry point for all configuration.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Auto-detects if SpecMem MCP server is configured for current project
|
|
10
|
+
* - Adds MCP server config to ~/.claude/config.json if missing
|
|
11
|
+
* - Deploys hooks to ~/.claude/hooks/
|
|
12
|
+
* - Deploys slash commands to ~/.claude/commands/
|
|
13
|
+
* - Sets required permissions in ~/.claude/settings.json
|
|
14
|
+
* - Sets SPECMEM_PROJECT_PATH for project isolation
|
|
15
|
+
* - Hot-patches running instances via SIGHUP
|
|
16
|
+
* - Fully idempotent - safe to run multiple times
|
|
17
|
+
*
|
|
18
|
+
* Config Hierarchy:
|
|
19
|
+
* - ~/.claude/config.json: MCP server registration (command, args, env)
|
|
20
|
+
* - ~/.claude/settings.json: Hooks, permissions, preferences
|
|
21
|
+
* - ~/.claude/hooks/: Hook script files
|
|
22
|
+
* - ~/.claude/commands/: Slash command .md files
|
|
23
|
+
*/
|
|
24
|
+
import * as fs from 'fs';
|
|
25
|
+
import * as path from 'path';
|
|
26
|
+
import * as os from 'os';
|
|
27
|
+
import { execSync } from 'child_process';
|
|
28
|
+
import { fileURLToPath } from 'url';
|
|
29
|
+
import { logger } from '../utils/logger.js';
|
|
30
|
+
// ES module equivalent of __dirname
|
|
31
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
32
|
+
const __dirname = path.dirname(__filename);
|
|
33
|
+
// ============================================================================
|
|
34
|
+
// Path Configuration
|
|
35
|
+
// ============================================================================
|
|
36
|
+
const HOME_DIR = os.homedir();
|
|
37
|
+
const CLAUDE_CONFIG_DIR = path.join(HOME_DIR, '.claude');
|
|
38
|
+
const CONFIG_PATH = path.join(CLAUDE_CONFIG_DIR, 'config.json');
|
|
39
|
+
const SETTINGS_PATH = path.join(CLAUDE_CONFIG_DIR, 'settings.json');
|
|
40
|
+
const HOOKS_DIR = path.join(CLAUDE_CONFIG_DIR, 'hooks');
|
|
41
|
+
const COMMANDS_DIR = path.join(CLAUDE_CONFIG_DIR, 'commands');
|
|
42
|
+
// stores per-project MCP configs in ~/.claude.json under "projects" key
|
|
43
|
+
const CLAUDE_JSON_PATH = path.join(HOME_DIR, '.claude.json');
|
|
44
|
+
// SpecMem directory detection - works from both src/ and dist/
|
|
45
|
+
function getSpecmemRoot() {
|
|
46
|
+
// Check environment variable first
|
|
47
|
+
if (process.env.SPECMEM_ROOT) {
|
|
48
|
+
return process.env.SPECMEM_ROOT;
|
|
49
|
+
}
|
|
50
|
+
// Try to detect from current file location
|
|
51
|
+
// When compiled: dist/init/claudeConfigInjector.js -> need to go up 2 levels
|
|
52
|
+
// When in src: src/init/claudeConfigInjector.ts -> need to go up 2 levels
|
|
53
|
+
const currentDir = __dirname;
|
|
54
|
+
const possibleRoot = path.resolve(currentDir, '..', '..');
|
|
55
|
+
// Verify by checking for bootstrap.js
|
|
56
|
+
const bootstrapPath = path.join(possibleRoot, 'bootstrap.js');
|
|
57
|
+
if (fs.existsSync(bootstrapPath)) {
|
|
58
|
+
return possibleRoot;
|
|
59
|
+
}
|
|
60
|
+
// Fallback to cwd
|
|
61
|
+
return process.cwd();
|
|
62
|
+
}
|
|
63
|
+
const SPECMEM_ROOT = getSpecmemRoot();
|
|
64
|
+
const BOOTSTRAP_PATH = path.join(SPECMEM_ROOT, 'bootstrap.js');
|
|
65
|
+
const SOURCE_HOOKS_DIR = path.join(SPECMEM_ROOT, 'claude-hooks');
|
|
66
|
+
const SOURCE_COMMANDS_DIR = path.join(SPECMEM_ROOT, 'commands');
|
|
67
|
+
// ============================================================================
|
|
68
|
+
// The specmem hooks that should be configured
|
|
69
|
+
// ============================================================================
|
|
70
|
+
// Environment variables for all hooks - MUST include paths!
|
|
71
|
+
// NOTE: Socket paths are per-project at {PROJECT}/specmem/sockets/
|
|
72
|
+
const HOOK_ENV = {
|
|
73
|
+
SPECMEM_HOME: path.join(HOME_DIR, '.specmem'), // Dynamic path using os.homedir()
|
|
74
|
+
SPECMEM_PKG: SPECMEM_ROOT, // Use detected package root
|
|
75
|
+
// Per-project socket paths - ${cwd} is expanded at runtime by Code
|
|
76
|
+
SPECMEM_RUN_DIR: '${cwd}/specmem/sockets',
|
|
77
|
+
SPECMEM_EMBEDDING_SOCKET: '${cwd}/specmem/sockets/embeddings.sock',
|
|
78
|
+
SPECMEM_PROJECT_PATH: '${cwd}', // Dynamically set by Code
|
|
79
|
+
SPECMEM_SEARCH_LIMIT: '5',
|
|
80
|
+
SPECMEM_THRESHOLD: '0.30',
|
|
81
|
+
SPECMEM_MAX_CONTENT: '200'
|
|
82
|
+
};
|
|
83
|
+
// ============================================================================
|
|
84
|
+
// Permissions SpecMem needs auto-allowed
|
|
85
|
+
// ============================================================================
|
|
86
|
+
const SPECMEM_PERMISSIONS = [
|
|
87
|
+
'mcp__specmem__*', // All SpecMem MCP tools
|
|
88
|
+
'Read(*)', // File reading for context
|
|
89
|
+
'Grep(*)', // Code search
|
|
90
|
+
'Glob(*)' // File pattern matching
|
|
91
|
+
];
|
|
92
|
+
// ============================================================================
|
|
93
|
+
// JSON File Utilities
|
|
94
|
+
// ============================================================================
|
|
95
|
+
function safeReadJson(filePath, defaultValue) {
|
|
96
|
+
try {
|
|
97
|
+
if (!fs.existsSync(filePath)) {
|
|
98
|
+
return defaultValue;
|
|
99
|
+
}
|
|
100
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
101
|
+
return JSON.parse(content);
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
logger.warn({ filePath, err }, '[ConfigInjector] Could not read JSON file');
|
|
105
|
+
return defaultValue;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function safeWriteJson(filePath, data) {
|
|
109
|
+
try {
|
|
110
|
+
// Ensure directory exists
|
|
111
|
+
const dir = path.dirname(filePath);
|
|
112
|
+
if (!fs.existsSync(dir)) {
|
|
113
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o755 });
|
|
114
|
+
}
|
|
115
|
+
// Create backup if file exists
|
|
116
|
+
if (fs.existsSync(filePath)) {
|
|
117
|
+
const backupPath = `${filePath}.backup.${Date.now()}`;
|
|
118
|
+
fs.copyFileSync(filePath, backupPath);
|
|
119
|
+
cleanupOldBackups(filePath, 3);
|
|
120
|
+
}
|
|
121
|
+
fs.writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf-8');
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
logger.error({ filePath, err }, '[ConfigInjector] Failed to write JSON');
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function cleanupOldBackups(basePath, keepCount) {
|
|
130
|
+
try {
|
|
131
|
+
const dir = path.dirname(basePath);
|
|
132
|
+
const baseName = path.basename(basePath);
|
|
133
|
+
const files = fs.readdirSync(dir);
|
|
134
|
+
const backups = files
|
|
135
|
+
.filter(f => f.startsWith(`${baseName}.backup.`))
|
|
136
|
+
.sort()
|
|
137
|
+
.reverse();
|
|
138
|
+
for (let i = keepCount; i < backups.length; i++) {
|
|
139
|
+
fs.unlinkSync(path.join(dir, backups[i]));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
// Ignore cleanup errors
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// ============================================================================
|
|
147
|
+
// MCP Server Configuration (config.json)
|
|
148
|
+
// ============================================================================
|
|
149
|
+
/**
|
|
150
|
+
* Check if SpecMem MCP server is configured for the current project
|
|
151
|
+
*/
|
|
152
|
+
export function isSpecmemMcpConfigured(projectPath) {
|
|
153
|
+
const config = safeReadJson(CONFIG_PATH, {});
|
|
154
|
+
if (!config.mcpServers?.specmem) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
const specmem = config.mcpServers.specmem;
|
|
158
|
+
// Check if it points to a valid bootstrap.js
|
|
159
|
+
if (!specmem.args || specmem.args.length < 2) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
const bootstrapArg = specmem.args[1];
|
|
163
|
+
// Check if bootstrap exists
|
|
164
|
+
if (!fs.existsSync(bootstrapArg)) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
// If projectPath specified, check if env has correct project path
|
|
168
|
+
if (projectPath) {
|
|
169
|
+
const configuredPath = specmem.env?.SPECMEM_PROJECT_PATH;
|
|
170
|
+
// ${PWD} is expanded at runtime by Code, so it's valid
|
|
171
|
+
if (configuredPath && configuredPath !== '${PWD}' && configuredPath !== projectPath) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Configure SpecMem MCP server in config.json
|
|
179
|
+
* Returns true if changes were made
|
|
180
|
+
*/
|
|
181
|
+
function configureMcpServer() {
|
|
182
|
+
// Verify bootstrap.js exists
|
|
183
|
+
if (!fs.existsSync(BOOTSTRAP_PATH)) {
|
|
184
|
+
return {
|
|
185
|
+
configured: false,
|
|
186
|
+
error: `bootstrap.js not found at ${BOOTSTRAP_PATH}`
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
const config = safeReadJson(CONFIG_PATH, {});
|
|
190
|
+
if (!config.mcpServers) {
|
|
191
|
+
config.mcpServers = {};
|
|
192
|
+
}
|
|
193
|
+
// Build the SpecMem MCP server config
|
|
194
|
+
// CRITICAL: ${cwd} is expanded by Code at runtime to current working directory
|
|
195
|
+
// NOTE: ${PWD} resolves at MCP server startup, ${cwd} resolves per-invocation
|
|
196
|
+
const specmemConfig = {
|
|
197
|
+
command: 'node',
|
|
198
|
+
args: ['--max-old-space-size=250', BOOTSTRAP_PATH],
|
|
199
|
+
env: {
|
|
200
|
+
// Core paths - ${cwd} gives us project isolation (dynamic per-directory)
|
|
201
|
+
HOME: HOME_DIR,
|
|
202
|
+
SPECMEM_PROJECT_PATH: '${cwd}',
|
|
203
|
+
SPECMEM_WATCHER_ROOT_PATH: '${cwd}',
|
|
204
|
+
SPECMEM_CODEBASE_PATH: '${cwd}',
|
|
205
|
+
// Database (use environment values or defaults)
|
|
206
|
+
SPECMEM_DB_HOST: process.env.SPECMEM_DB_HOST || 'localhost',
|
|
207
|
+
SPECMEM_DB_PORT: process.env.SPECMEM_DB_PORT || '5432',
|
|
208
|
+
// Watchers enabled by default
|
|
209
|
+
SPECMEM_SESSION_WATCHER_ENABLED: 'true',
|
|
210
|
+
SPECMEM_WATCHER_ENABLED: 'true',
|
|
211
|
+
// Dashboard
|
|
212
|
+
SPECMEM_DASHBOARD_ENABLED: 'true',
|
|
213
|
+
SPECMEM_DASHBOARD_PORT: process.env.SPECMEM_DASHBOARD_PORT || '8595',
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
// Check if update needed - compare serialized configs
|
|
217
|
+
const existing = config.mcpServers.specmem;
|
|
218
|
+
const needsUpdate = !existing ||
|
|
219
|
+
existing.args?.[1] !== BOOTSTRAP_PATH ||
|
|
220
|
+
!existing.env?.SPECMEM_PROJECT_PATH;
|
|
221
|
+
if (!needsUpdate) {
|
|
222
|
+
return { configured: false }; // Already correctly configured
|
|
223
|
+
}
|
|
224
|
+
// Update config
|
|
225
|
+
config.mcpServers.specmem = specmemConfig;
|
|
226
|
+
if (safeWriteJson(CONFIG_PATH, config)) {
|
|
227
|
+
logger.info({ path: CONFIG_PATH, bootstrap: BOOTSTRAP_PATH }, '[ConfigInjector] MCP server configured in config.json');
|
|
228
|
+
return { configured: true };
|
|
229
|
+
}
|
|
230
|
+
return { configured: false, error: 'Failed to write config.json' };
|
|
231
|
+
}
|
|
232
|
+
// ============================================================================
|
|
233
|
+
// Project-Level MCP Config Fixer
|
|
234
|
+
// ============================================================================
|
|
235
|
+
/**
|
|
236
|
+
* Fix outdated specmem MCP configs in ~/.claude.json
|
|
237
|
+
*
|
|
238
|
+
* stores per-project MCP configs in ~/.claude.json under "projects" key.
|
|
239
|
+
* Old specmem installations may have left stale paths that point to non-existent
|
|
240
|
+
* locations. This function scans all project entries and fixes specmem configs
|
|
241
|
+
* to point to the current BOOTSTRAP_PATH.
|
|
242
|
+
*
|
|
243
|
+
* @returns Number of project configs that were fixed
|
|
244
|
+
*/
|
|
245
|
+
function fixProjectMcpConfigs() {
|
|
246
|
+
const errors = [];
|
|
247
|
+
let fixed = 0;
|
|
248
|
+
// Read ~/.claude.json
|
|
249
|
+
if (!fs.existsSync(CLAUDE_JSON_PATH)) {
|
|
250
|
+
return { fixed: 0, errors: [] }; // No file = nothing to fix
|
|
251
|
+
}
|
|
252
|
+
let claudeJson;
|
|
253
|
+
try {
|
|
254
|
+
const content = fs.readFileSync(CLAUDE_JSON_PATH, 'utf-8');
|
|
255
|
+
claudeJson = JSON.parse(content);
|
|
256
|
+
}
|
|
257
|
+
catch (err) {
|
|
258
|
+
return { fixed: 0, errors: [`Failed to read ${CLAUDE_JSON_PATH}: ${err}`] };
|
|
259
|
+
}
|
|
260
|
+
// Check for projects section
|
|
261
|
+
if (!claudeJson.projects || typeof claudeJson.projects !== 'object') {
|
|
262
|
+
return { fixed: 0, errors: [] }; // No projects = nothing to fix
|
|
263
|
+
}
|
|
264
|
+
let modified = false;
|
|
265
|
+
// Scan all project entries
|
|
266
|
+
for (const [projectPath, projectConfig] of Object.entries(claudeJson.projects)) {
|
|
267
|
+
const config = projectConfig;
|
|
268
|
+
// Check if this project has a specmem MCP server config
|
|
269
|
+
if (config?.mcpServers?.specmem) {
|
|
270
|
+
const specmem = config.mcpServers.specmem;
|
|
271
|
+
const args = specmem.args || [];
|
|
272
|
+
// Check if the args contain an outdated specmem path
|
|
273
|
+
let needsUpdate = false;
|
|
274
|
+
const updatedArgs = args.map((arg) => {
|
|
275
|
+
if (typeof arg === 'string' &&
|
|
276
|
+
arg.includes('specmem') &&
|
|
277
|
+
arg !== BOOTSTRAP_PATH &&
|
|
278
|
+
(arg.endsWith('index.js') || arg.endsWith('bootstrap.js'))) {
|
|
279
|
+
needsUpdate = true;
|
|
280
|
+
return BOOTSTRAP_PATH;
|
|
281
|
+
}
|
|
282
|
+
return arg;
|
|
283
|
+
});
|
|
284
|
+
if (needsUpdate) {
|
|
285
|
+
// Update the args
|
|
286
|
+
specmem.args = updatedArgs;
|
|
287
|
+
// Ensure SPECMEM_PROJECT_PATH is set to actual project path
|
|
288
|
+
// CRITICAL: ${PWD} doesn't get expanded by Code, use literal path
|
|
289
|
+
if (!specmem.env) {
|
|
290
|
+
specmem.env = {};
|
|
291
|
+
}
|
|
292
|
+
if (!specmem.env.SPECMEM_PROJECT_PATH || specmem.env.SPECMEM_PROJECT_PATH === '${PWD}' || specmem.env.SPECMEM_PROJECT_PATH === '${cwd}') {
|
|
293
|
+
specmem.env.SPECMEM_PROJECT_PATH = projectPath; // Use the actual project path key
|
|
294
|
+
}
|
|
295
|
+
logger.info({ projectPath, oldArgs: args, newArgs: updatedArgs }, '[ConfigInjector] Fixed outdated specmem path in project config');
|
|
296
|
+
fixed++;
|
|
297
|
+
modified = true;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
// Write back if modified
|
|
302
|
+
if (modified) {
|
|
303
|
+
try {
|
|
304
|
+
fs.writeFileSync(CLAUDE_JSON_PATH, JSON.stringify(claudeJson, null, 2));
|
|
305
|
+
logger.info({ path: CLAUDE_JSON_PATH, projectsFixed: fixed }, '[ConfigInjector] Updated project-level MCP configs');
|
|
306
|
+
}
|
|
307
|
+
catch (err) {
|
|
308
|
+
errors.push(`Failed to write ${CLAUDE_JSON_PATH}: ${err}`);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return { fixed, errors };
|
|
312
|
+
}
|
|
313
|
+
// ============================================================================
|
|
314
|
+
// Hook Files Deployment
|
|
315
|
+
// ============================================================================
|
|
316
|
+
/**
|
|
317
|
+
* Copy hook files from source to ~/.claude/hooks/
|
|
318
|
+
* Only copies if content differs (idempotent)
|
|
319
|
+
*/
|
|
320
|
+
function deployHooks() {
|
|
321
|
+
const copied = [];
|
|
322
|
+
const errors = [];
|
|
323
|
+
// Ensure target directory exists
|
|
324
|
+
if (!fs.existsSync(HOOKS_DIR)) {
|
|
325
|
+
try {
|
|
326
|
+
fs.mkdirSync(HOOKS_DIR, { recursive: true, mode: 0o755 });
|
|
327
|
+
}
|
|
328
|
+
catch (err) {
|
|
329
|
+
return { copied: [], errors: [`Could not create hooks dir: ${err}`] };
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
// Check source directory
|
|
333
|
+
if (!fs.existsSync(SOURCE_HOOKS_DIR)) {
|
|
334
|
+
return { copied: [], errors: [`Source hooks dir not found: ${SOURCE_HOOKS_DIR}`] };
|
|
335
|
+
}
|
|
336
|
+
// Copy all hook files (including .js for CommonJS compatibility)
|
|
337
|
+
try {
|
|
338
|
+
const files = fs.readdirSync(SOURCE_HOOKS_DIR);
|
|
339
|
+
for (const file of files) {
|
|
340
|
+
if (file.endsWith('.js') || file.endsWith('.cjs') || file.endsWith('.py') || file.endsWith('.sh') || file.endsWith('.json')) {
|
|
341
|
+
const srcPath = path.join(SOURCE_HOOKS_DIR, file);
|
|
342
|
+
const dstPath = path.join(HOOKS_DIR, file);
|
|
343
|
+
try {
|
|
344
|
+
// Check if update needed
|
|
345
|
+
let needsCopy = true;
|
|
346
|
+
if (fs.existsSync(dstPath)) {
|
|
347
|
+
const srcContent = fs.readFileSync(srcPath, 'utf-8');
|
|
348
|
+
const dstContent = fs.readFileSync(dstPath, 'utf-8');
|
|
349
|
+
needsCopy = srcContent !== dstContent;
|
|
350
|
+
}
|
|
351
|
+
if (needsCopy) {
|
|
352
|
+
fs.copyFileSync(srcPath, dstPath);
|
|
353
|
+
// Make executable for scripts (not JSON data files)
|
|
354
|
+
if (!file.endsWith('.json')) {
|
|
355
|
+
fs.chmodSync(dstPath, 0o755);
|
|
356
|
+
}
|
|
357
|
+
copied.push(file);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
catch (err) {
|
|
361
|
+
errors.push(`Could not copy ${file}: ${err}`);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
catch (err) {
|
|
367
|
+
errors.push(`Could not read source dir: ${err}`);
|
|
368
|
+
}
|
|
369
|
+
return { copied, errors };
|
|
370
|
+
}
|
|
371
|
+
// ============================================================================
|
|
372
|
+
// Command Files Deployment
|
|
373
|
+
// ============================================================================
|
|
374
|
+
/**
|
|
375
|
+
* Copy slash command files from source to ~/.claude/commands/
|
|
376
|
+
*/
|
|
377
|
+
function deployCommands() {
|
|
378
|
+
const copied = [];
|
|
379
|
+
const errors = [];
|
|
380
|
+
// Ensure target directory exists
|
|
381
|
+
if (!fs.existsSync(COMMANDS_DIR)) {
|
|
382
|
+
try {
|
|
383
|
+
fs.mkdirSync(COMMANDS_DIR, { recursive: true, mode: 0o755 });
|
|
384
|
+
}
|
|
385
|
+
catch (err) {
|
|
386
|
+
return { copied: [], errors: [`Could not create commands dir: ${err}`] };
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
// Check source directory
|
|
390
|
+
if (!fs.existsSync(SOURCE_COMMANDS_DIR)) {
|
|
391
|
+
return { copied: [], errors: [`Source commands dir not found: ${SOURCE_COMMANDS_DIR}`] };
|
|
392
|
+
}
|
|
393
|
+
// Remove outdated specmem commands
|
|
394
|
+
try {
|
|
395
|
+
const existingFiles = fs.readdirSync(COMMANDS_DIR);
|
|
396
|
+
for (const file of existingFiles) {
|
|
397
|
+
if (file.startsWith('specmem-') && file.endsWith('.md')) {
|
|
398
|
+
const srcPath = path.join(SOURCE_COMMANDS_DIR, file);
|
|
399
|
+
if (!fs.existsSync(srcPath)) {
|
|
400
|
+
try {
|
|
401
|
+
fs.unlinkSync(path.join(COMMANDS_DIR, file));
|
|
402
|
+
logger.info({ file }, '[ConfigInjector] Removed outdated command');
|
|
403
|
+
}
|
|
404
|
+
catch {
|
|
405
|
+
// Non-fatal
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
catch {
|
|
412
|
+
// Non-fatal
|
|
413
|
+
}
|
|
414
|
+
// Copy command files
|
|
415
|
+
try {
|
|
416
|
+
const files = fs.readdirSync(SOURCE_COMMANDS_DIR);
|
|
417
|
+
for (const file of files) {
|
|
418
|
+
if (file.endsWith('.md')) {
|
|
419
|
+
const srcPath = path.join(SOURCE_COMMANDS_DIR, file);
|
|
420
|
+
const dstPath = path.join(COMMANDS_DIR, file);
|
|
421
|
+
try {
|
|
422
|
+
let needsCopy = true;
|
|
423
|
+
if (fs.existsSync(dstPath)) {
|
|
424
|
+
const srcContent = fs.readFileSync(srcPath, 'utf-8');
|
|
425
|
+
const dstContent = fs.readFileSync(dstPath, 'utf-8');
|
|
426
|
+
needsCopy = srcContent !== dstContent;
|
|
427
|
+
}
|
|
428
|
+
if (needsCopy) {
|
|
429
|
+
fs.copyFileSync(srcPath, dstPath);
|
|
430
|
+
copied.push(file.replace('.md', ''));
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
catch (err) {
|
|
434
|
+
errors.push(`Could not copy ${file}: ${err}`);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
catch (err) {
|
|
440
|
+
errors.push(`Could not read source dir: ${err}`);
|
|
441
|
+
}
|
|
442
|
+
return { copied, errors };
|
|
443
|
+
}
|
|
444
|
+
// ============================================================================
|
|
445
|
+
// Per-Project Command Deployment
|
|
446
|
+
// ============================================================================
|
|
447
|
+
/**
|
|
448
|
+
* Deploy commands to a specific project's .claude/commands/ directory
|
|
449
|
+
* This enables project-specific command overrides and ensures commands
|
|
450
|
+
* are available even without global installation.
|
|
451
|
+
*
|
|
452
|
+
* @param projectPath - The project root directory
|
|
453
|
+
*/
|
|
454
|
+
function deployCommandsToProject(projectPath) {
|
|
455
|
+
const copied = [];
|
|
456
|
+
const errors = [];
|
|
457
|
+
if (!projectPath) {
|
|
458
|
+
return { copied, errors: ['No project path provided'] };
|
|
459
|
+
}
|
|
460
|
+
const projectCommandsDir = path.join(projectPath, '.claude', 'commands');
|
|
461
|
+
// Ensure target directory exists
|
|
462
|
+
if (!fs.existsSync(projectCommandsDir)) {
|
|
463
|
+
try {
|
|
464
|
+
fs.mkdirSync(projectCommandsDir, { recursive: true, mode: 0o755 });
|
|
465
|
+
logger.info({ path: projectCommandsDir }, '[ConfigInjector] Created per-project commands dir');
|
|
466
|
+
}
|
|
467
|
+
catch (err) {
|
|
468
|
+
return { copied: [], errors: [`Could not create project commands dir: ${err}`] };
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
// Check source directory
|
|
472
|
+
if (!fs.existsSync(SOURCE_COMMANDS_DIR)) {
|
|
473
|
+
return { copied: [], errors: [`Source commands dir not found: ${SOURCE_COMMANDS_DIR}`] };
|
|
474
|
+
}
|
|
475
|
+
// Copy command files to project
|
|
476
|
+
try {
|
|
477
|
+
const files = fs.readdirSync(SOURCE_COMMANDS_DIR);
|
|
478
|
+
for (const file of files) {
|
|
479
|
+
if (file.endsWith('.md') && file.startsWith('specmem')) {
|
|
480
|
+
const srcPath = path.join(SOURCE_COMMANDS_DIR, file);
|
|
481
|
+
const dstPath = path.join(projectCommandsDir, file);
|
|
482
|
+
try {
|
|
483
|
+
let needsCopy = true;
|
|
484
|
+
if (fs.existsSync(dstPath)) {
|
|
485
|
+
const srcContent = fs.readFileSync(srcPath, 'utf-8');
|
|
486
|
+
const dstContent = fs.readFileSync(dstPath, 'utf-8');
|
|
487
|
+
needsCopy = srcContent !== dstContent;
|
|
488
|
+
}
|
|
489
|
+
if (needsCopy) {
|
|
490
|
+
fs.copyFileSync(srcPath, dstPath);
|
|
491
|
+
copied.push(file.replace('.md', ''));
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
catch (err) {
|
|
495
|
+
errors.push(`Could not copy ${file} to project: ${err}`);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
catch (err) {
|
|
501
|
+
errors.push(`Could not read source dir: ${err}`);
|
|
502
|
+
}
|
|
503
|
+
if (copied.length > 0) {
|
|
504
|
+
logger.info({ projectPath, copied }, '[ConfigInjector] Deployed commands to per-project dir');
|
|
505
|
+
}
|
|
506
|
+
return { copied, errors };
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Configure per-project settings.local.json
|
|
510
|
+
* This allows project-specific settings without modifying global config
|
|
511
|
+
*/
|
|
512
|
+
function configureProjectSettings(projectPath) {
|
|
513
|
+
if (!projectPath) {
|
|
514
|
+
return { updated: false, error: 'No project path provided' };
|
|
515
|
+
}
|
|
516
|
+
const projectSettingsPath = path.join(projectPath, '.claude', 'settings.local.json');
|
|
517
|
+
const projectDir = path.join(projectPath, '.claude');
|
|
518
|
+
// Ensure .claude directory exists
|
|
519
|
+
if (!fs.existsSync(projectDir)) {
|
|
520
|
+
try {
|
|
521
|
+
fs.mkdirSync(projectDir, { recursive: true, mode: 0o755 });
|
|
522
|
+
}
|
|
523
|
+
catch (err) {
|
|
524
|
+
return { updated: false, error: `Could not create .claude dir: ${err}` };
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
// Read existing or create new
|
|
528
|
+
let settings = {};
|
|
529
|
+
if (fs.existsSync(projectSettingsPath)) {
|
|
530
|
+
try {
|
|
531
|
+
settings = JSON.parse(fs.readFileSync(projectSettingsPath, 'utf-8'));
|
|
532
|
+
}
|
|
533
|
+
catch {
|
|
534
|
+
settings = {};
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
let needsUpdate = false;
|
|
538
|
+
// Ensure MCP permissions are set for this project
|
|
539
|
+
if (!settings.permissions)
|
|
540
|
+
settings.permissions = {};
|
|
541
|
+
if (!settings.permissions.allow)
|
|
542
|
+
settings.permissions.allow = [];
|
|
543
|
+
for (const perm of SPECMEM_PERMISSIONS) {
|
|
544
|
+
if (!settings.permissions.allow.includes(perm)) {
|
|
545
|
+
settings.permissions.allow.push(perm);
|
|
546
|
+
needsUpdate = true;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
// Set default mode to accept edits for smoother experience
|
|
550
|
+
if (!settings.permissions.defaultMode) {
|
|
551
|
+
settings.permissions.defaultMode = 'acceptEdits';
|
|
552
|
+
needsUpdate = true;
|
|
553
|
+
}
|
|
554
|
+
if (!needsUpdate) {
|
|
555
|
+
return { updated: false };
|
|
556
|
+
}
|
|
557
|
+
try {
|
|
558
|
+
fs.writeFileSync(projectSettingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
559
|
+
logger.info({ path: projectSettingsPath }, '[ConfigInjector] Updated per-project settings');
|
|
560
|
+
return { updated: true };
|
|
561
|
+
}
|
|
562
|
+
catch (err) {
|
|
563
|
+
return { updated: false, error: `Could not write settings: ${err}` };
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
// ============================================================================
|
|
567
|
+
// Settings Configuration (settings.json)
|
|
568
|
+
// ============================================================================
|
|
569
|
+
/**
|
|
570
|
+
* Configure hooks and permissions in settings.json
|
|
571
|
+
* Hook format rules from Code source:
|
|
572
|
+
* - UserPromptSubmit, SessionStart, Stop: NO matcher field
|
|
573
|
+
* - PreToolUse, PostToolUse: matcher is a STRING pattern ("*", "Bash", etc.)
|
|
574
|
+
*/
|
|
575
|
+
/**
|
|
576
|
+
* MASTER HOOK CONFIGURATION
|
|
577
|
+
* =========================
|
|
578
|
+
* ALL SpecMem hooks are defined here. If a hook is missing from settings.json,
|
|
579
|
+
* it will be added automatically. This ensures consistent configuration.
|
|
580
|
+
*/
|
|
581
|
+
function getRequiredHooks() {
|
|
582
|
+
// All hook files with their paths
|
|
583
|
+
const HOOKS = {
|
|
584
|
+
drilldown: path.join(HOOKS_DIR, 'specmem-drilldown-hook.js'),
|
|
585
|
+
smartContext: path.join(HOOKS_DIR, 'smart-context-hook.js'),
|
|
586
|
+
inputAware: path.join(HOOKS_DIR, 'input-aware-improver.js'),
|
|
587
|
+
sessionStart: path.join(HOOKS_DIR, 'specmem-session-start.js'),
|
|
588
|
+
precompact: path.join(HOOKS_DIR, 'specmem-precompact.js'),
|
|
589
|
+
agentLoading: path.join(HOOKS_DIR, 'agent-loading-hook.js'),
|
|
590
|
+
taskProgress: path.join(HOOKS_DIR, 'task-progress-hook.js'),
|
|
591
|
+
subagentLoading: path.join(HOOKS_DIR, 'subagent-loading-hook.js'),
|
|
592
|
+
teamMemberInject: path.join(HOOKS_DIR, 'specmem-team-member-inject.js'),
|
|
593
|
+
agentOutputInterceptor: path.join(HOOKS_DIR, 'agent-output-interceptor.js'),
|
|
594
|
+
// Daemon that monitors and compresses agent output files in real-time
|
|
595
|
+
agentOutputFader: path.join(HOOKS_DIR, 'agent-output-fader.cjs'),
|
|
596
|
+
};
|
|
597
|
+
// Environment for search/context hooks
|
|
598
|
+
const searchEnv = {
|
|
599
|
+
...HOOK_ENV,
|
|
600
|
+
SPECMEM_SEARCH_LIMIT: '3',
|
|
601
|
+
SPECMEM_THRESHOLD: '0.25',
|
|
602
|
+
SPECMEM_MAX_CONTENT: '150'
|
|
603
|
+
};
|
|
604
|
+
return {
|
|
605
|
+
// =========================================================================
|
|
606
|
+
// UserPromptSubmit - fires when user submits a prompt
|
|
607
|
+
// =========================================================================
|
|
608
|
+
UserPromptSubmit: [
|
|
609
|
+
{
|
|
610
|
+
hooks: [
|
|
611
|
+
// Drilldown hook - provides semantic context from memories
|
|
612
|
+
...(fs.existsSync(HOOKS.drilldown) ? [{
|
|
613
|
+
type: 'command',
|
|
614
|
+
command: `node ${HOOKS.drilldown}`,
|
|
615
|
+
timeout: 30,
|
|
616
|
+
env: HOOK_ENV
|
|
617
|
+
}] : []),
|
|
618
|
+
// Input-aware improver - enhances prompt understanding
|
|
619
|
+
...(fs.existsSync(HOOKS.inputAware) ? [{
|
|
620
|
+
type: 'command',
|
|
621
|
+
command: `node ${HOOKS.inputAware}`,
|
|
622
|
+
timeout: 5,
|
|
623
|
+
env: HOOK_ENV
|
|
624
|
+
}] : [])
|
|
625
|
+
].filter(h => h)
|
|
626
|
+
}
|
|
627
|
+
],
|
|
628
|
+
// =========================================================================
|
|
629
|
+
// PreToolUse - fires BEFORE a tool is used (can modify input!)
|
|
630
|
+
// =========================================================================
|
|
631
|
+
PreToolUse: [
|
|
632
|
+
// CRITICAL: Agent loading hook for Task tool - injects SpecMem context & auto-backgrounds
|
|
633
|
+
...(fs.existsSync(HOOKS.agentLoading) ? [{
|
|
634
|
+
matcher: 'Task',
|
|
635
|
+
hooks: [{
|
|
636
|
+
type: 'command',
|
|
637
|
+
command: `node ${HOOKS.agentLoading}`,
|
|
638
|
+
timeout: 10,
|
|
639
|
+
statusMessage: 'Deploying team member...',
|
|
640
|
+
env: HOOK_ENV
|
|
641
|
+
}]
|
|
642
|
+
}] : []),
|
|
643
|
+
// Smart context for Grep
|
|
644
|
+
...(fs.existsSync(HOOKS.smartContext) ? [{
|
|
645
|
+
matcher: 'Grep',
|
|
646
|
+
hooks: [{
|
|
647
|
+
type: 'command',
|
|
648
|
+
command: `node ${HOOKS.smartContext}`,
|
|
649
|
+
timeout: 8,
|
|
650
|
+
env: searchEnv
|
|
651
|
+
}]
|
|
652
|
+
}] : []),
|
|
653
|
+
// Smart context for Glob
|
|
654
|
+
...(fs.existsSync(HOOKS.smartContext) ? [{
|
|
655
|
+
matcher: 'Glob',
|
|
656
|
+
hooks: [{
|
|
657
|
+
type: 'command',
|
|
658
|
+
command: `node ${HOOKS.smartContext}`,
|
|
659
|
+
timeout: 8,
|
|
660
|
+
env: searchEnv
|
|
661
|
+
}]
|
|
662
|
+
}] : []),
|
|
663
|
+
// Smart context for Read
|
|
664
|
+
...(fs.existsSync(HOOKS.smartContext) ? [{
|
|
665
|
+
matcher: 'Read',
|
|
666
|
+
hooks: [{
|
|
667
|
+
type: 'command',
|
|
668
|
+
command: `node ${HOOKS.smartContext}`,
|
|
669
|
+
timeout: 8,
|
|
670
|
+
env: searchEnv
|
|
671
|
+
}]
|
|
672
|
+
}] : []),
|
|
673
|
+
// CRITICAL: Agent output interceptor - blocks wasteful agent output file reads
|
|
674
|
+
// Fires for Read to block direct file reads
|
|
675
|
+
...(fs.existsSync(HOOKS.agentOutputInterceptor) ? [{
|
|
676
|
+
matcher: 'Read',
|
|
677
|
+
hooks: [{
|
|
678
|
+
type: 'command',
|
|
679
|
+
command: `node ${HOOKS.agentOutputInterceptor}`,
|
|
680
|
+
timeout: 3,
|
|
681
|
+
env: HOOK_ENV
|
|
682
|
+
}]
|
|
683
|
+
}] : []),
|
|
684
|
+
// Also fires for Bash to block tail/cat/head on output files
|
|
685
|
+
...(fs.existsSync(HOOKS.agentOutputInterceptor) ? [{
|
|
686
|
+
matcher: 'Bash',
|
|
687
|
+
hooks: [{
|
|
688
|
+
type: 'command',
|
|
689
|
+
command: `node ${HOOKS.agentOutputInterceptor}`,
|
|
690
|
+
timeout: 3,
|
|
691
|
+
env: HOOK_ENV
|
|
692
|
+
}]
|
|
693
|
+
}] : [])
|
|
694
|
+
].filter(h => h.hooks?.length > 0),
|
|
695
|
+
// =========================================================================
|
|
696
|
+
// PostToolUse - fires AFTER a tool completes
|
|
697
|
+
// =========================================================================
|
|
698
|
+
PostToolUse: [
|
|
699
|
+
...(fs.existsSync(HOOKS.taskProgress) ? [{
|
|
700
|
+
matcher: 'Task',
|
|
701
|
+
hooks: [{
|
|
702
|
+
type: 'command',
|
|
703
|
+
command: `node ${HOOKS.taskProgress}`,
|
|
704
|
+
timeout: 10,
|
|
705
|
+
statusMessage: 'Team member finished',
|
|
706
|
+
env: HOOK_ENV
|
|
707
|
+
}]
|
|
708
|
+
}] : [])
|
|
709
|
+
].filter(h => h.hooks?.length > 0),
|
|
710
|
+
// =========================================================================
|
|
711
|
+
// SessionStart - fires when Code session starts
|
|
712
|
+
// =========================================================================
|
|
713
|
+
SessionStart: [
|
|
714
|
+
...(fs.existsSync(HOOKS.sessionStart) ? [{
|
|
715
|
+
hooks: [{
|
|
716
|
+
type: 'command',
|
|
717
|
+
command: `node ${HOOKS.sessionStart}`,
|
|
718
|
+
timeout: 30,
|
|
719
|
+
statusMessage: 'Loading SpecMem context...',
|
|
720
|
+
env: HOOK_ENV
|
|
721
|
+
}]
|
|
722
|
+
}] : []),
|
|
723
|
+
// Start the agent output fader daemon - monitors & compresses agent outputs in real-time
|
|
724
|
+
...(fs.existsSync(HOOKS.agentOutputFader) ? [{
|
|
725
|
+
hooks: [{
|
|
726
|
+
type: 'command',
|
|
727
|
+
command: `node ${HOOKS.agentOutputFader} --daemon`,
|
|
728
|
+
timeout: 3,
|
|
729
|
+
statusMessage: '🌫️ Starting output fader daemon...',
|
|
730
|
+
env: {}
|
|
731
|
+
}]
|
|
732
|
+
}] : [])
|
|
733
|
+
].filter(h => h.hooks?.length > 0),
|
|
734
|
+
// =========================================================================
|
|
735
|
+
// PreCompact - fires before context compaction (save memories!)
|
|
736
|
+
// =========================================================================
|
|
737
|
+
PreCompact: [
|
|
738
|
+
...(fs.existsSync(HOOKS.precompact) ? [{
|
|
739
|
+
hooks: [{
|
|
740
|
+
type: 'command',
|
|
741
|
+
command: `node ${HOOKS.precompact}`,
|
|
742
|
+
timeout: 60,
|
|
743
|
+
statusMessage: 'Saving context before compaction...',
|
|
744
|
+
env: HOOK_ENV
|
|
745
|
+
}]
|
|
746
|
+
}] : [])
|
|
747
|
+
].filter(h => h.hooks?.length > 0),
|
|
748
|
+
// =========================================================================
|
|
749
|
+
// SubagentStart/Stop - fires when subagents start/finish
|
|
750
|
+
// =========================================================================
|
|
751
|
+
SubagentStart: [
|
|
752
|
+
...(fs.existsSync(HOOKS.subagentLoading) ? [{
|
|
753
|
+
hooks: [{
|
|
754
|
+
type: 'command',
|
|
755
|
+
command: `node ${HOOKS.subagentLoading}`,
|
|
756
|
+
timeout: 5,
|
|
757
|
+
statusMessage: 'Starting subagent...'
|
|
758
|
+
}]
|
|
759
|
+
}] : [])
|
|
760
|
+
].filter(h => h.hooks?.length > 0),
|
|
761
|
+
SubagentStop: [
|
|
762
|
+
...(fs.existsSync(HOOKS.subagentLoading) ? [{
|
|
763
|
+
hooks: [{
|
|
764
|
+
type: 'command',
|
|
765
|
+
command: `node ${HOOKS.subagentLoading}`,
|
|
766
|
+
timeout: 5,
|
|
767
|
+
statusMessage: 'Subagent completed'
|
|
768
|
+
}]
|
|
769
|
+
}] : [])
|
|
770
|
+
].filter(h => h.hooks?.length > 0),
|
|
771
|
+
// =========================================================================
|
|
772
|
+
// Stop - fires when Code session ends
|
|
773
|
+
// =========================================================================
|
|
774
|
+
Stop: [
|
|
775
|
+
...(fs.existsSync(HOOKS.drilldown) ? [{
|
|
776
|
+
hooks: [{
|
|
777
|
+
type: 'command',
|
|
778
|
+
command: `node ${HOOKS.drilldown}`,
|
|
779
|
+
timeout: 15,
|
|
780
|
+
env: HOOK_ENV
|
|
781
|
+
}]
|
|
782
|
+
}] : [])
|
|
783
|
+
].filter(h => h.hooks?.length > 0)
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Check if a specific hook exists in settings with the correct command
|
|
788
|
+
*/
|
|
789
|
+
function hasHook(hooks, commandSubstring, matcher) {
|
|
790
|
+
if (!hooks || hooks.length === 0)
|
|
791
|
+
return false;
|
|
792
|
+
return hooks.some(entry => {
|
|
793
|
+
// For matchers, check if matcher matches
|
|
794
|
+
if (matcher && entry.matcher !== matcher)
|
|
795
|
+
return false;
|
|
796
|
+
// Check if any hook command includes the substring
|
|
797
|
+
return entry.hooks?.some(h => h.command?.includes(commandSubstring));
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
function configureSettings() {
|
|
801
|
+
const settings = safeReadJson(SETTINGS_PATH, {});
|
|
802
|
+
const permissionsAdded = [];
|
|
803
|
+
const hooksAdded = [];
|
|
804
|
+
let needsUpdate = false;
|
|
805
|
+
// Initialize sections
|
|
806
|
+
if (!settings.hooks)
|
|
807
|
+
settings.hooks = {};
|
|
808
|
+
if (!settings.permissions)
|
|
809
|
+
settings.permissions = { allow: [] };
|
|
810
|
+
if (!settings.permissions.allow)
|
|
811
|
+
settings.permissions.allow = [];
|
|
812
|
+
// Get all required hooks
|
|
813
|
+
const requiredHooks = getRequiredHooks();
|
|
814
|
+
// =========================================================================
|
|
815
|
+
// VERIFY AND ADD EACH HOOK TYPE
|
|
816
|
+
// =========================================================================
|
|
817
|
+
for (const [hookType, requiredEntries] of Object.entries(requiredHooks)) {
|
|
818
|
+
if (requiredEntries.length === 0)
|
|
819
|
+
continue;
|
|
820
|
+
const currentHooks = settings.hooks[hookType] || [];
|
|
821
|
+
// Check each required entry
|
|
822
|
+
for (const required of requiredEntries) {
|
|
823
|
+
const hookFile = required.hooks?.[0]?.command?.match(/node (.+\.js)/)?.[1] || '';
|
|
824
|
+
const hookName = path.basename(hookFile, '.js');
|
|
825
|
+
const matcher = required.matcher;
|
|
826
|
+
// Check if this specific hook already exists
|
|
827
|
+
const exists = hasHook(currentHooks, hookName, matcher);
|
|
828
|
+
if (!exists) {
|
|
829
|
+
// Add the missing hook
|
|
830
|
+
if (!settings.hooks[hookType]) {
|
|
831
|
+
settings.hooks[hookType] = [];
|
|
832
|
+
}
|
|
833
|
+
settings.hooks[hookType].push(required);
|
|
834
|
+
hooksAdded.push(`${hookType}:${matcher || 'default'}:${hookName}`);
|
|
835
|
+
needsUpdate = true;
|
|
836
|
+
logger.info({ hookType, hookName, matcher }, '[ConfigInjector] Added missing hook');
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
// =========================================================================
|
|
841
|
+
// PERMISSIONS
|
|
842
|
+
// =========================================================================
|
|
843
|
+
for (const perm of SPECMEM_PERMISSIONS) {
|
|
844
|
+
if (!settings.permissions.allow.includes(perm)) {
|
|
845
|
+
settings.permissions.allow.push(perm);
|
|
846
|
+
permissionsAdded.push(perm);
|
|
847
|
+
needsUpdate = true;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
if (!needsUpdate) {
|
|
851
|
+
return { updated: false, permissionsAdded: [], hooksAdded: [] };
|
|
852
|
+
}
|
|
853
|
+
// Log what we're adding
|
|
854
|
+
if (hooksAdded.length > 0) {
|
|
855
|
+
logger.info({ hooksAdded }, '[ConfigInjector] Adding hooks to settings.json');
|
|
856
|
+
}
|
|
857
|
+
if (safeWriteJson(SETTINGS_PATH, settings)) {
|
|
858
|
+
logger.info({ path: SETTINGS_PATH, permissionsAdded, hooksAdded }, '[ConfigInjector] Settings updated');
|
|
859
|
+
return { updated: true, permissionsAdded, hooksAdded };
|
|
860
|
+
}
|
|
861
|
+
return { updated: false, permissionsAdded: [], hooksAdded: [], error: 'Failed to write settings.json' };
|
|
862
|
+
}
|
|
863
|
+
// ============================================================================
|
|
864
|
+
// Hot-Patching Running Instances
|
|
865
|
+
// ============================================================================
|
|
866
|
+
/**
|
|
867
|
+
* Hot-patch running instances by sending SIGHUP
|
|
868
|
+
* This causes them to reload their configuration without restart
|
|
869
|
+
*
|
|
870
|
+
* SAFETY NOTE: This function is intentionally DISABLED by default because it
|
|
871
|
+
* sends signals to ALL processes on the machine, which could affect
|
|
872
|
+
* instances from OTHER projects. This is dangerous in multi-project
|
|
873
|
+
* environments.
|
|
874
|
+
*
|
|
875
|
+
* To enable, set SPECMEM_ENABLE_CLAUDE_HOT_PATCH=true in environment.
|
|
876
|
+
*
|
|
877
|
+
* Even when enabled, we:
|
|
878
|
+
* 1. Skip our own process
|
|
879
|
+
* 2. Skip our parent process (the that spawned us)
|
|
880
|
+
* 3. Log warnings about the cross-project nature of this operation
|
|
881
|
+
*/
|
|
882
|
+
function hotPatchRunning() {
|
|
883
|
+
// SAFETY: Disabled by default - opt-in only
|
|
884
|
+
if (process.env['SPECMEM_ENABLE_CLAUDE_HOT_PATCH'] !== 'true') {
|
|
885
|
+
logger.debug('[ConfigInjector] Hot-patching disabled (SPECMEM_ENABLE_CLAUDE_HOT_PATCH != true)');
|
|
886
|
+
return 0;
|
|
887
|
+
}
|
|
888
|
+
let patchedCount = 0;
|
|
889
|
+
// Get our parent PID - this is the that spawned us as MCP server
|
|
890
|
+
// We must NOT signal our parent or we'll kill ourselves!
|
|
891
|
+
const parentPid = process.ppid;
|
|
892
|
+
// SAFETY WARNING: We're about to signal ALL processes
|
|
893
|
+
logger.warn('[ConfigInjector] Hot-patching enabled - this may affect instances from OTHER projects!');
|
|
894
|
+
try {
|
|
895
|
+
// Find all running processes
|
|
896
|
+
const output = execSync('pgrep -f "claude" 2>/dev/null || true', { encoding: 'utf-8' });
|
|
897
|
+
const pids = output.trim().split('\n').filter(Boolean);
|
|
898
|
+
for (const pid of pids) {
|
|
899
|
+
try {
|
|
900
|
+
const pidNum = parseInt(pid, 10);
|
|
901
|
+
// Don't signal ourselves
|
|
902
|
+
if (pidNum === process.pid)
|
|
903
|
+
continue;
|
|
904
|
+
// Don't signal our parent (the that spawned us)!
|
|
905
|
+
if (pidNum === parentPid) {
|
|
906
|
+
logger.debug({ pid: pidNum }, '[ConfigInjector] Skipping parent process');
|
|
907
|
+
continue;
|
|
908
|
+
}
|
|
909
|
+
process.kill(pidNum, 'SIGHUP');
|
|
910
|
+
patchedCount++;
|
|
911
|
+
logger.info({ pid: pidNum }, '[ConfigInjector] Sent SIGHUP to ');
|
|
912
|
+
}
|
|
913
|
+
catch {
|
|
914
|
+
// Process might have exited, ignore
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
if (patchedCount > 0) {
|
|
918
|
+
logger.info({ count: patchedCount, skippedParent: parentPid }, '[ConfigInjector] Hot-patched running instances');
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
catch {
|
|
922
|
+
logger.debug('[ConfigInjector] No running processes found');
|
|
923
|
+
}
|
|
924
|
+
return patchedCount;
|
|
925
|
+
}
|
|
926
|
+
// ============================================================================
|
|
927
|
+
// Main Injection Function
|
|
928
|
+
// ============================================================================
|
|
929
|
+
/**
|
|
930
|
+
* Main injection function - call this on SpecMem startup
|
|
931
|
+
*
|
|
932
|
+
* This function:
|
|
933
|
+
* 1. Deploys hook files to ~/.claude/hooks/
|
|
934
|
+
* 2. Deploys command files to ~/.claude/commands/ (GLOBAL)
|
|
935
|
+
* 3. Configures MCP server in ~/.claude/config.json
|
|
936
|
+
* 4. Configures hooks and permissions in ~/.claude/settings.json
|
|
937
|
+
* 4.5. Deploys commands to {PROJECT}/.claude/commands/ (PER-PROJECT)
|
|
938
|
+
* 4.6. Configures {PROJECT}/.claude/settings.local.json (PER-PROJECT)
|
|
939
|
+
* 5. Hot-patches running instances (disabled by default)
|
|
940
|
+
*
|
|
941
|
+
* Deploy Targets:
|
|
942
|
+
* - GLOBAL: ~/.claude/commands/ - available to all projects
|
|
943
|
+
* - PER-PROJECT: {PROJECT}/.claude/commands/ - project-specific
|
|
944
|
+
* - GLOBAL SETTINGS: ~/.claude/settings.json - hooks & permissions
|
|
945
|
+
* - PER-PROJECT SETTINGS: {PROJECT}/.claude/settings.local.json
|
|
946
|
+
*
|
|
947
|
+
* Fully idempotent - safe to call on every startup
|
|
948
|
+
*/
|
|
949
|
+
export async function injectConfig(projectPath) {
|
|
950
|
+
logger.info({ projectPath: projectPath || 'auto' }, '[ConfigInjector] Starting config injection...');
|
|
951
|
+
const result = {
|
|
952
|
+
success: true,
|
|
953
|
+
mcpServerConfigured: false,
|
|
954
|
+
settingsUpdated: false,
|
|
955
|
+
hooksCopied: [],
|
|
956
|
+
commandsCopied: [],
|
|
957
|
+
permissionsAdded: [],
|
|
958
|
+
hooksAdded: [],
|
|
959
|
+
instancesPatched: 0,
|
|
960
|
+
projectConfigsFixed: 0,
|
|
961
|
+
errors: [],
|
|
962
|
+
alreadyConfigured: false,
|
|
963
|
+
bypassEnabled: false // backwards compat, set true when permissions added
|
|
964
|
+
};
|
|
965
|
+
try {
|
|
966
|
+
// Step 1: Deploy hook files FIRST (before settings.json references them)
|
|
967
|
+
const hooksResult = deployHooks();
|
|
968
|
+
result.hooksCopied = hooksResult.copied;
|
|
969
|
+
if (hooksResult.errors.length > 0) {
|
|
970
|
+
result.errors.push(...hooksResult.errors);
|
|
971
|
+
}
|
|
972
|
+
if (hooksResult.copied.length > 0) {
|
|
973
|
+
logger.info({ files: hooksResult.copied }, '[ConfigInjector] Deployed hooks');
|
|
974
|
+
}
|
|
975
|
+
// Step 2: Deploy command files
|
|
976
|
+
const commandsResult = deployCommands();
|
|
977
|
+
result.commandsCopied = commandsResult.copied;
|
|
978
|
+
if (commandsResult.errors.length > 0) {
|
|
979
|
+
result.errors.push(...commandsResult.errors);
|
|
980
|
+
}
|
|
981
|
+
if (commandsResult.copied.length > 0) {
|
|
982
|
+
logger.info({ files: commandsResult.copied }, '[ConfigInjector] Deployed commands');
|
|
983
|
+
}
|
|
984
|
+
// Step 3: Configure MCP server in config.json
|
|
985
|
+
const mcpResult = configureMcpServer();
|
|
986
|
+
result.mcpServerConfigured = mcpResult.configured;
|
|
987
|
+
if (mcpResult.error) {
|
|
988
|
+
result.errors.push(mcpResult.error);
|
|
989
|
+
}
|
|
990
|
+
// Step 3.5: Fix stale project-level MCP configs in ~/.claude.json
|
|
991
|
+
const projectFixResult = fixProjectMcpConfigs();
|
|
992
|
+
result.projectConfigsFixed = projectFixResult.fixed;
|
|
993
|
+
if (projectFixResult.errors.length > 0) {
|
|
994
|
+
result.errors.push(...projectFixResult.errors);
|
|
995
|
+
}
|
|
996
|
+
if (projectFixResult.fixed > 0) {
|
|
997
|
+
logger.info({ count: projectFixResult.fixed }, '[ConfigInjector] Fixed stale project MCP configs');
|
|
998
|
+
}
|
|
999
|
+
// Step 4: Configure settings (hooks + permissions)
|
|
1000
|
+
const settingsResult = configureSettings();
|
|
1001
|
+
result.settingsUpdated = settingsResult.updated;
|
|
1002
|
+
result.permissionsAdded = settingsResult.permissionsAdded;
|
|
1003
|
+
result.hooksAdded = settingsResult.hooksAdded || [];
|
|
1004
|
+
result.bypassEnabled = settingsResult.permissionsAdded.length > 0;
|
|
1005
|
+
if (settingsResult.error) {
|
|
1006
|
+
result.errors.push(settingsResult.error);
|
|
1007
|
+
}
|
|
1008
|
+
if (settingsResult.hooksAdded?.length > 0) {
|
|
1009
|
+
logger.info({ hooksAdded: settingsResult.hooksAdded }, '[ConfigInjector] Dynamically added hooks to settings.json');
|
|
1010
|
+
}
|
|
1011
|
+
// Step 4.5: Deploy commands to per-project .claude/commands/
|
|
1012
|
+
// This ensures commands work even without global installation
|
|
1013
|
+
const actualProjectPath = projectPath || process.env.SPECMEM_PROJECT_PATH || process.cwd();
|
|
1014
|
+
if (actualProjectPath && actualProjectPath !== HOME_DIR) {
|
|
1015
|
+
const projectCommandsResult = deployCommandsToProject(actualProjectPath);
|
|
1016
|
+
if (projectCommandsResult.copied.length > 0) {
|
|
1017
|
+
// Add to result (prefix with "project:" to distinguish)
|
|
1018
|
+
result.commandsCopied.push(...projectCommandsResult.copied.map(c => `project:${c}`));
|
|
1019
|
+
logger.info({
|
|
1020
|
+
projectPath: actualProjectPath,
|
|
1021
|
+
copied: projectCommandsResult.copied
|
|
1022
|
+
}, '[ConfigInjector] Deployed commands to per-project dir');
|
|
1023
|
+
}
|
|
1024
|
+
if (projectCommandsResult.errors.length > 0) {
|
|
1025
|
+
result.errors.push(...projectCommandsResult.errors);
|
|
1026
|
+
}
|
|
1027
|
+
// Also configure per-project settings.local.json
|
|
1028
|
+
const projectSettingsResult = configureProjectSettings(actualProjectPath);
|
|
1029
|
+
if (projectSettingsResult.updated) {
|
|
1030
|
+
result.settingsUpdated = true;
|
|
1031
|
+
logger.info({ projectPath: actualProjectPath }, '[ConfigInjector] Updated per-project settings.local.json');
|
|
1032
|
+
}
|
|
1033
|
+
if (projectSettingsResult.error) {
|
|
1034
|
+
result.errors.push(projectSettingsResult.error);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
// Step 5: Hot-patch running instances
|
|
1038
|
+
// DISABLED: Cannot safely signal parent from MCP child process
|
|
1039
|
+
// - SIGHUP kills Code
|
|
1040
|
+
// - Other instances have different project contexts
|
|
1041
|
+
// Config changes take effect on next restart
|
|
1042
|
+
result.instancesPatched = 0;
|
|
1043
|
+
// Determine if already fully configured
|
|
1044
|
+
result.alreadyConfigured =
|
|
1045
|
+
result.hooksCopied.length === 0 &&
|
|
1046
|
+
result.commandsCopied.length === 0 &&
|
|
1047
|
+
!result.mcpServerConfigured &&
|
|
1048
|
+
!result.settingsUpdated &&
|
|
1049
|
+
result.projectConfigsFixed === 0;
|
|
1050
|
+
// Set overall success
|
|
1051
|
+
result.success = result.errors.length === 0;
|
|
1052
|
+
// Log summary
|
|
1053
|
+
if (result.alreadyConfigured) {
|
|
1054
|
+
logger.info('[ConfigInjector] Already fully configured');
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
logger.info({
|
|
1058
|
+
mcpServerConfigured: result.mcpServerConfigured,
|
|
1059
|
+
settingsUpdated: result.settingsUpdated,
|
|
1060
|
+
hooksCopied: result.hooksCopied.length,
|
|
1061
|
+
commandsCopied: result.commandsCopied.length,
|
|
1062
|
+
permissionsAdded: result.permissionsAdded.length,
|
|
1063
|
+
projectConfigsFixed: result.projectConfigsFixed,
|
|
1064
|
+
instancesPatched: result.instancesPatched
|
|
1065
|
+
}, '[ConfigInjector] Config injection complete');
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
catch (error) {
|
|
1069
|
+
result.success = false;
|
|
1070
|
+
result.errors.push(`Unexpected error: ${error.message}`);
|
|
1071
|
+
logger.error({ error }, '[ConfigInjector] Config injection failed');
|
|
1072
|
+
}
|
|
1073
|
+
return result;
|
|
1074
|
+
}
|
|
1075
|
+
// ============================================================================
|
|
1076
|
+
// Quick Check Functions
|
|
1077
|
+
// ============================================================================
|
|
1078
|
+
/**
|
|
1079
|
+
* Check if SpecMem is fully configured in
|
|
1080
|
+
*/
|
|
1081
|
+
export function isConfigInjected() {
|
|
1082
|
+
// Check config.json has specmem MCP server
|
|
1083
|
+
const config = safeReadJson(CONFIG_PATH, {});
|
|
1084
|
+
if (!config.mcpServers?.specmem) {
|
|
1085
|
+
return false;
|
|
1086
|
+
}
|
|
1087
|
+
// Check settings.json has specmem hooks
|
|
1088
|
+
const settings = safeReadJson(SETTINGS_PATH, {});
|
|
1089
|
+
const hasPreToolHook = settings.hooks?.PreToolUse?.some((entry) => JSON.stringify(entry).includes('specmem'));
|
|
1090
|
+
const hasUserPromptHook = settings.hooks?.UserPromptSubmit?.some((entry) => JSON.stringify(entry).includes('specmem'));
|
|
1091
|
+
// Check at least one hook exists (now .js for CommonJS compatibility)
|
|
1092
|
+
const drilldownHookExists = fs.existsSync(path.join(HOOKS_DIR, 'specmem-drilldown-hook.js'));
|
|
1093
|
+
return !!(hasPreToolHook || hasUserPromptHook) && drilldownHookExists;
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Get detailed installation status
|
|
1097
|
+
*/
|
|
1098
|
+
export function getInstallationStatus() {
|
|
1099
|
+
const config = safeReadJson(CONFIG_PATH, {});
|
|
1100
|
+
const settings = safeReadJson(SETTINGS_PATH, {});
|
|
1101
|
+
const configOk = !!config.mcpServers?.specmem;
|
|
1102
|
+
const settingsOk = !!(settings.hooks?.UserPromptSubmit?.some((e) => JSON.stringify(e).includes('specmem')) ||
|
|
1103
|
+
settings.hooks?.PreToolUse?.some((e) => JSON.stringify(e).includes('specmem')));
|
|
1104
|
+
let hooksOk = false;
|
|
1105
|
+
try {
|
|
1106
|
+
if (fs.existsSync(HOOKS_DIR)) {
|
|
1107
|
+
const files = fs.readdirSync(HOOKS_DIR);
|
|
1108
|
+
hooksOk = files.some(f => f.includes('specmem'));
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
catch {
|
|
1112
|
+
// Not ok
|
|
1113
|
+
}
|
|
1114
|
+
let commandsOk = false;
|
|
1115
|
+
try {
|
|
1116
|
+
if (fs.existsSync(COMMANDS_DIR)) {
|
|
1117
|
+
const files = fs.readdirSync(COMMANDS_DIR);
|
|
1118
|
+
commandsOk = files.some(f => f.startsWith('specmem-'));
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
catch {
|
|
1122
|
+
// Not ok
|
|
1123
|
+
}
|
|
1124
|
+
return {
|
|
1125
|
+
config: configOk,
|
|
1126
|
+
settings: settingsOk,
|
|
1127
|
+
hooks: hooksOk,
|
|
1128
|
+
commands: commandsOk,
|
|
1129
|
+
fullyConfigured: configOk && settingsOk && hooksOk && commandsOk
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
// ============================================================================
|
|
1133
|
+
// Exports
|
|
1134
|
+
// ============================================================================
|
|
1135
|
+
export default {
|
|
1136
|
+
injectConfig,
|
|
1137
|
+
isConfigInjected,
|
|
1138
|
+
isSpecmemMcpConfigured,
|
|
1139
|
+
getInstallationStatus,
|
|
1140
|
+
hotPatchRunning
|
|
1141
|
+
};
|
|
1142
|
+
// Export paths for testing and other modules
|
|
1143
|
+
export const paths = {
|
|
1144
|
+
CLAUDE_CONFIG_DIR,
|
|
1145
|
+
CONFIG_PATH,
|
|
1146
|
+
SETTINGS_PATH,
|
|
1147
|
+
HOOKS_DIR,
|
|
1148
|
+
COMMANDS_DIR,
|
|
1149
|
+
SPECMEM_ROOT,
|
|
1150
|
+
BOOTSTRAP_PATH,
|
|
1151
|
+
SOURCE_HOOKS_DIR,
|
|
1152
|
+
SOURCE_COMMANDS_DIR
|
|
1153
|
+
};
|
|
1154
|
+
//# sourceMappingURL=claudeConfigInjector.js.map
|