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,990 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Agent Loading Hook for Code
|
|
4
|
+
* ===================================
|
|
5
|
+
*
|
|
6
|
+
* PreToolUse hook that intercepts Task tool calls and:
|
|
7
|
+
* 1. Shows a clean loading indicator instead of mega prompts
|
|
8
|
+
* 2. Silently injects team member context
|
|
9
|
+
* 3. Forces background execution
|
|
10
|
+
* 4. Suppresses verbose output
|
|
11
|
+
* 5. [NEW] Applies user-configurable agent settings from .specmem/agent-config.json
|
|
12
|
+
*
|
|
13
|
+
* Hook Event: PreToolUse
|
|
14
|
+
* Matcher: Task
|
|
15
|
+
*
|
|
16
|
+
* Output goes to STDERR (visible in terminal) not STDOUT (tool output)
|
|
17
|
+
*
|
|
18
|
+
* USER CONFIGURATION:
|
|
19
|
+
* Create .specmem/agent-config.json to customize agent deployment:
|
|
20
|
+
* {
|
|
21
|
+
* "defaults": { "model": "sonnet", "background": true, "ultrathink": false },
|
|
22
|
+
* "agents": { "Explore": { "model": "haiku" }, "feature-dev:code-explorer": { "model": "opus" } }
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const fs = require('fs');
|
|
27
|
+
const path = require('path');
|
|
28
|
+
const crypto = require('crypto');
|
|
29
|
+
const specmemPaths = require('./specmem-paths.cjs');
|
|
30
|
+
|
|
31
|
+
// Project-scoped marker for active agents (used by team-comms-enforcer)
|
|
32
|
+
const _projectPath = process.env.SPECMEM_PROJECT_PATH || process.cwd();
|
|
33
|
+
const _projectHash = crypto.createHash('sha256').update(path.resolve(_projectPath)).digest('hex').slice(0, 12);
|
|
34
|
+
const PROJECT_TMP_DIR = `/tmp/specmem-${_projectHash}`;
|
|
35
|
+
const ACTIVE_AGENTS_FILE = `${PROJECT_TMP_DIR}/active-agents.json`;
|
|
36
|
+
|
|
37
|
+
// Ensure tmp dir exists
|
|
38
|
+
try {
|
|
39
|
+
if (!fs.existsSync(PROJECT_TMP_DIR)) {
|
|
40
|
+
fs.mkdirSync(PROJECT_TMP_DIR, { recursive: true, mode: 0o755 });
|
|
41
|
+
}
|
|
42
|
+
} catch (e) {}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Mark that an agent is being spawned (for team-comms-enforcer detection)
|
|
46
|
+
*/
|
|
47
|
+
function markAgentSpawned(agentType, description) {
|
|
48
|
+
try {
|
|
49
|
+
let agents = {};
|
|
50
|
+
if (fs.existsSync(ACTIVE_AGENTS_FILE)) {
|
|
51
|
+
agents = JSON.parse(fs.readFileSync(ACTIVE_AGENTS_FILE, 'utf8'));
|
|
52
|
+
}
|
|
53
|
+
const id = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
54
|
+
agents[id] = {
|
|
55
|
+
type: agentType,
|
|
56
|
+
description: description.slice(0, 50),
|
|
57
|
+
spawnedAt: Date.now()
|
|
58
|
+
};
|
|
59
|
+
// Clean up old entries (>10 minutes)
|
|
60
|
+
const now = Date.now();
|
|
61
|
+
for (const [key, val] of Object.entries(agents)) {
|
|
62
|
+
if (now - val.spawnedAt > 600000) delete agents[key];
|
|
63
|
+
}
|
|
64
|
+
fs.writeFileSync(ACTIVE_AGENTS_FILE, JSON.stringify(agents, null, 2));
|
|
65
|
+
} catch (e) {}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Token compressor DISABLED - was cluttering agent context
|
|
69
|
+
// let compressHookOutput;
|
|
70
|
+
// try {
|
|
71
|
+
// compressHookOutput = require('./token-compressor.cjs').compressHookOutput;
|
|
72
|
+
// } catch (e) {
|
|
73
|
+
// compressHookOutput = (text) => text;
|
|
74
|
+
// }
|
|
75
|
+
|
|
76
|
+
// Use shared path utilities
|
|
77
|
+
const { expandCwd, getSpecmemHome, getSpecmemPkg } = specmemPaths;
|
|
78
|
+
const SPECMEM_HOME = getSpecmemHome();
|
|
79
|
+
|
|
80
|
+
// ============================================================================
|
|
81
|
+
// Interactive Agent Chooser Settings
|
|
82
|
+
// ============================================================================
|
|
83
|
+
|
|
84
|
+
// Skip interactive chooser if AUTO_MODE is set
|
|
85
|
+
const AUTO_MODE = process.env.SPECMEM_AGENT_AUTO === '1' || process.env.SPECMEM_AGENT_AUTO === 'true';
|
|
86
|
+
|
|
87
|
+
// Force interactive chooser for every deployment (default: false)
|
|
88
|
+
// Set SPECMEM_FORCE_CHOOSER=1 to enable mandatory approval
|
|
89
|
+
const FORCE_CHOOSER = process.env.SPECMEM_FORCE_CHOOSER === '1' || process.env.SPECMEM_FORCE_CHOOSER === 'true';
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* SR_DEV_APPROVED_MARKER - Prevents infinite denial loops in agent deployment
|
|
93
|
+
* ===========================================================================
|
|
94
|
+
*
|
|
95
|
+
* PROBLEM THIS SOLVES:
|
|
96
|
+
* When FORCE_CHOOSER is enabled, this hook denies Task tool calls and tells
|
|
97
|
+
* to ask the user for confirmation first. Without a marker system,
|
|
98
|
+
* would:
|
|
99
|
+
* 1. Try to deploy agent -> Hook denies, says "ask user first"
|
|
100
|
+
* 2. asks user, user confirms
|
|
101
|
+
* 3. tries to deploy agent again -> Hook denies AGAIN (infinite loop!)
|
|
102
|
+
*
|
|
103
|
+
* HOW THE MARKER SYSTEM WORKS:
|
|
104
|
+
* 1. First Task call: Hook denies with message telling to use AskUserQuestion
|
|
105
|
+
* 2. asks user via AskUserQuestion tool
|
|
106
|
+
* 3. User confirms deployment settings
|
|
107
|
+
* 4. re-calls Task with "[SR-DEV-APPROVED]" in the prompt parameter
|
|
108
|
+
* 5. Hook sees marker -> Allows deployment without re-asking
|
|
109
|
+
*
|
|
110
|
+
* MARKER DETECTION:
|
|
111
|
+
* The marker is checked in BOTH the prompt AND description fields because
|
|
112
|
+
* sometimes places it in the task title instead of the prompt body.
|
|
113
|
+
*
|
|
114
|
+
* FLOW DIAGRAM:
|
|
115
|
+
* Task(prompt: "do X")
|
|
116
|
+
* -> Hook: DENY, "ask user first"
|
|
117
|
+
* AskUserQuestion(...)
|
|
118
|
+
* -> User confirms
|
|
119
|
+
* Task(prompt: "do X [SR-DEV-APPROVED]")
|
|
120
|
+
* -> Hook: ALLOW (marker found)
|
|
121
|
+
*/
|
|
122
|
+
const SR_DEV_APPROVED_MARKER = '[SR-DEV-APPROVED]';
|
|
123
|
+
|
|
124
|
+
// ============================================================================
|
|
125
|
+
// User Configuration Loading
|
|
126
|
+
// ============================================================================
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Default agent configuration
|
|
130
|
+
*/
|
|
131
|
+
const DEFAULT_CONFIG = {
|
|
132
|
+
defaults: {
|
|
133
|
+
model: 'sonnet',
|
|
134
|
+
background: true,
|
|
135
|
+
ultrathink: false,
|
|
136
|
+
max_turns: null // null = no limit
|
|
137
|
+
},
|
|
138
|
+
agents: {},
|
|
139
|
+
presets: {},
|
|
140
|
+
// Chooser settings - default to AUTO (no prompting)
|
|
141
|
+
chooser: {
|
|
142
|
+
enabled: false, // Set to true to enable interactive chooser
|
|
143
|
+
autoMode: true // When enabled=false, just deploy with defaults
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Load user agent configuration from .specmem/agent-config.json
|
|
149
|
+
* Falls back to defaults if file doesn't exist
|
|
150
|
+
*/
|
|
151
|
+
function loadAgentConfig() {
|
|
152
|
+
const configPaths = [
|
|
153
|
+
path.join(process.cwd(), '.specmem', 'agent-config.json'),
|
|
154
|
+
path.join(SPECMEM_HOME, 'agent-config.json'),
|
|
155
|
+
path.join(process.env.HOME || '', '.specmem', 'agent-config.json')
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
for (const configPath of configPaths) {
|
|
159
|
+
try {
|
|
160
|
+
if (fs.existsSync(configPath)) {
|
|
161
|
+
const content = fs.readFileSync(configPath, 'utf8');
|
|
162
|
+
const userConfig = JSON.parse(content);
|
|
163
|
+
// Merge with defaults
|
|
164
|
+
return {
|
|
165
|
+
defaults: { ...DEFAULT_CONFIG.defaults, ...userConfig.defaults },
|
|
166
|
+
agents: { ...DEFAULT_CONFIG.agents, ...userConfig.agents },
|
|
167
|
+
presets: { ...DEFAULT_CONFIG.presets, ...userConfig.presets },
|
|
168
|
+
chooser: { ...DEFAULT_CONFIG.chooser, ...userConfig.chooser }
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
} catch (e) {
|
|
172
|
+
// Skip invalid configs
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return DEFAULT_CONFIG;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Get settings for a specific agent type
|
|
181
|
+
* Merges defaults with agent-specific overrides
|
|
182
|
+
*/
|
|
183
|
+
function getAgentSettings(agentType, config) {
|
|
184
|
+
const settings = { ...config.defaults };
|
|
185
|
+
|
|
186
|
+
// Apply agent-specific overrides
|
|
187
|
+
if (agentType && config.agents[agentType]) {
|
|
188
|
+
Object.assign(settings, config.agents[agentType]);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Ultrathink forces opus model
|
|
192
|
+
if (settings.ultrathink) {
|
|
193
|
+
settings.model = 'opus';
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return settings;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// ============================================================================
|
|
200
|
+
// ANSI Escape Codes for Terminal UI
|
|
201
|
+
// ============================================================================
|
|
202
|
+
|
|
203
|
+
const ANSI = {
|
|
204
|
+
reset: '\x1b[0m',
|
|
205
|
+
bold: '\x1b[1m',
|
|
206
|
+
dim: '\x1b[2m',
|
|
207
|
+
|
|
208
|
+
// Colors
|
|
209
|
+
green: '\x1b[32m',
|
|
210
|
+
yellow: '\x1b[33m',
|
|
211
|
+
blue: '\x1b[34m',
|
|
212
|
+
magenta: '\x1b[35m',
|
|
213
|
+
cyan: '\x1b[36m',
|
|
214
|
+
white: '\x1b[37m',
|
|
215
|
+
gray: '\x1b[90m',
|
|
216
|
+
|
|
217
|
+
// Background
|
|
218
|
+
bgBlue: '\x1b[44m',
|
|
219
|
+
bgGreen: '\x1b[42m',
|
|
220
|
+
|
|
221
|
+
// Cursor control
|
|
222
|
+
hideCursor: '\x1b[?25l',
|
|
223
|
+
showCursor: '\x1b[?25h',
|
|
224
|
+
clearLine: '\x1b[2K',
|
|
225
|
+
moveUp: '\x1b[1A',
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// ============================================================================
|
|
229
|
+
// Agent Chooser Instructions Builder
|
|
230
|
+
// ============================================================================
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* AGENT TYPE CATEGORIES - for 4-question flow
|
|
234
|
+
* Category -> Type -> Model -> Extras
|
|
235
|
+
*/
|
|
236
|
+
const AGENT_CATEGORIES = {
|
|
237
|
+
'Built-in Fast': {
|
|
238
|
+
desc: 'Quick tasks, codebase search',
|
|
239
|
+
types: [
|
|
240
|
+
{ name: 'Explore', desc: 'Fast codebase search & exploration' },
|
|
241
|
+
{ name: 'Bash', desc: 'Command execution specialist' },
|
|
242
|
+
{ name: 'claude-code-guide', desc: 'Documentation & API help' },
|
|
243
|
+
{ name: 'statusline-setup', desc: 'Configure status line' }
|
|
244
|
+
]
|
|
245
|
+
},
|
|
246
|
+
'Built-in Deep': {
|
|
247
|
+
desc: 'Complex reasoning tasks',
|
|
248
|
+
types: [
|
|
249
|
+
{ name: 'general-purpose', desc: 'Default - complex multi-step tasks' },
|
|
250
|
+
{ name: 'Plan', desc: 'Architecture planning & design' }
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
'Feature-dev': {
|
|
254
|
+
desc: 'Implementation work (opus default)',
|
|
255
|
+
types: [
|
|
256
|
+
{ name: 'feature-dev', desc: 'Feature implementation' },
|
|
257
|
+
{ name: 'feature-dev:code-explorer', desc: 'Deep code analysis' },
|
|
258
|
+
{ name: 'feature-dev:architect', desc: 'System architecture' }
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
'Utility': {
|
|
262
|
+
desc: 'Specialized tasks',
|
|
263
|
+
types: [
|
|
264
|
+
{ name: 'bug-hunter', desc: 'Find & fix bugs' },
|
|
265
|
+
{ name: 'test-writer', desc: 'Write tests' },
|
|
266
|
+
{ name: 'refactor', desc: 'Code refactoring' }
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* FLAT AGENT TYPES LIST (for backwards compat)
|
|
273
|
+
*/
|
|
274
|
+
const AGENT_TYPES = Object.values(AGENT_CATEGORIES).flatMap(cat =>
|
|
275
|
+
cat.types.map(t => ({ ...t, model: cat.desc.includes('opus') ? 'opus' : 'sonnet' }))
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
const MODELS = [
|
|
279
|
+
{ name: 'opus', desc: 'Deepest reasoning (slow, expensive)' },
|
|
280
|
+
{ name: 'sonnet', desc: 'Balanced (default)' },
|
|
281
|
+
{ name: 'haiku', desc: 'Fastest (cheap, simple tasks)' }
|
|
282
|
+
];
|
|
283
|
+
|
|
284
|
+
// ============================================================================
|
|
285
|
+
// Type Mapping: Custom types → Valid Code subagent_types
|
|
286
|
+
// ============================================================================
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Maps our custom agent type names to valid Code subagent_type values
|
|
290
|
+
* The Task tool only accepts: Bash, general-purpose, statusline-setup, Explore, Plan, claude-code-guide
|
|
291
|
+
*/
|
|
292
|
+
const SUBAGENT_TYPE_MAP = {
|
|
293
|
+
// Built-in types (pass through)
|
|
294
|
+
'Bash': 'Bash',
|
|
295
|
+
'general-purpose': 'general-purpose',
|
|
296
|
+
'statusline-setup': 'statusline-setup',
|
|
297
|
+
'Explore': 'Explore',
|
|
298
|
+
'Plan': 'Plan',
|
|
299
|
+
'claude-code-guide': 'claude-code-guide',
|
|
300
|
+
|
|
301
|
+
// Feature-dev variants → map to appropriate built-in
|
|
302
|
+
'feature-dev': 'general-purpose',
|
|
303
|
+
'feature-dev:code-explorer': 'Explore',
|
|
304
|
+
'feature-dev:architect': 'Plan',
|
|
305
|
+
|
|
306
|
+
// Utility types → general-purpose
|
|
307
|
+
'bug-hunter': 'general-purpose',
|
|
308
|
+
'test-writer': 'general-purpose',
|
|
309
|
+
'refactor': 'general-purpose',
|
|
310
|
+
|
|
311
|
+
// Plugin agent names (from ~/.claude/plugins/)
|
|
312
|
+
'code-explorer': 'Explore',
|
|
313
|
+
'code-architect': 'Plan',
|
|
314
|
+
'code-reviewer': 'general-purpose',
|
|
315
|
+
|
|
316
|
+
// SpecMem bundled agents (from /specmem/plugins/specmem-agents/)
|
|
317
|
+
'memory-explorer': 'Explore',
|
|
318
|
+
'team-coordinator': 'general-purpose',
|
|
319
|
+
'specmem-bug-hunter': 'general-purpose',
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Get valid Code subagent_type from our custom type name
|
|
324
|
+
*/
|
|
325
|
+
function getValidSubagentType(customType) {
|
|
326
|
+
return SUBAGENT_TYPE_MAP[customType] || 'general-purpose';
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Load plugin agent prompt from ~/.claude/plugins/{name}/agents/{agent}.md
|
|
331
|
+
* Returns the markdown content (without frontmatter) or null if not found
|
|
332
|
+
*/
|
|
333
|
+
function loadPluginAgentPrompt(agentName) {
|
|
334
|
+
// Normalize agent name (feature-dev:code-explorer → code-explorer)
|
|
335
|
+
const baseName = agentName.includes(':') ? agentName.split(':').pop() : agentName;
|
|
336
|
+
|
|
337
|
+
// Find SpecMem package directory (bundled plugins)
|
|
338
|
+
let specmemPkgDir = null;
|
|
339
|
+
try {
|
|
340
|
+
// Try to find specmem package via require.resolve
|
|
341
|
+
const specmemPath = require.resolve('specmem-hardwicksoftware/package.json');
|
|
342
|
+
specmemPkgDir = path.dirname(specmemPath);
|
|
343
|
+
} catch {
|
|
344
|
+
// Fallback: check common locations
|
|
345
|
+
const fallbackPaths = [
|
|
346
|
+
'/specmem/plugins', // Development
|
|
347
|
+
path.join(process.env.HOME || '', '.specmem', 'plugins'), // Global install
|
|
348
|
+
];
|
|
349
|
+
for (const p of fallbackPaths) {
|
|
350
|
+
if (fs.existsSync(p)) {
|
|
351
|
+
specmemPkgDir = path.dirname(p); // Parent of plugins
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Plugin directories to search (order matters - user plugins first)
|
|
358
|
+
const pluginDirs = [
|
|
359
|
+
path.join(process.env.HOME || '', '.claude', 'plugins'),
|
|
360
|
+
path.join(process.cwd(), '.claude', 'plugins'),
|
|
361
|
+
// SpecMem bundled plugins
|
|
362
|
+
specmemPkgDir ? path.join(specmemPkgDir, 'plugins') : null,
|
|
363
|
+
'/specmem/plugins', // Development fallback
|
|
364
|
+
].filter(Boolean);
|
|
365
|
+
|
|
366
|
+
for (const pluginDir of pluginDirs) {
|
|
367
|
+
try {
|
|
368
|
+
if (!fs.existsSync(pluginDir)) continue;
|
|
369
|
+
|
|
370
|
+
// Search all plugins for agents/ directory
|
|
371
|
+
const plugins = fs.readdirSync(pluginDir);
|
|
372
|
+
for (const plugin of plugins) {
|
|
373
|
+
const agentFile = path.join(pluginDir, plugin, 'agents', `${baseName}.md`);
|
|
374
|
+
if (fs.existsSync(agentFile)) {
|
|
375
|
+
const content = fs.readFileSync(agentFile, 'utf8');
|
|
376
|
+
// Remove YAML frontmatter (between --- markers)
|
|
377
|
+
const withoutFrontmatter = content.replace(/^---[\s\S]*?---\s*/m, '');
|
|
378
|
+
return withoutFrontmatter.trim();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
} catch (e) {
|
|
382
|
+
// Continue searching
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return null;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Get ALL agent types organized for pagination
|
|
391
|
+
* Returns array of 4-item pages for AskUserQuestion
|
|
392
|
+
*/
|
|
393
|
+
function getAgentTypePages(description) {
|
|
394
|
+
const desc = description.toLowerCase();
|
|
395
|
+
|
|
396
|
+
// Prioritize types based on keywords (most specific first)
|
|
397
|
+
let prioritized = [...AGENT_TYPES];
|
|
398
|
+
|
|
399
|
+
// Reorder based on task description
|
|
400
|
+
const boostTypes = [];
|
|
401
|
+
if (desc.includes('bug') || desc.includes('fix') || desc.includes('debug')) {
|
|
402
|
+
boostTypes.push('bug-hunter', 'feature-dev', 'general-purpose');
|
|
403
|
+
} else if (desc.includes('test') || desc.includes('spec')) {
|
|
404
|
+
boostTypes.push('test-writer', 'bug-hunter', 'general-purpose');
|
|
405
|
+
} else if (desc.includes('refactor') || desc.includes('clean')) {
|
|
406
|
+
boostTypes.push('refactor', 'feature-dev', 'general-purpose');
|
|
407
|
+
} else if (desc.includes('plan') || desc.includes('design') || desc.includes('architect')) {
|
|
408
|
+
boostTypes.push('Plan', 'feature-dev:architect', 'general-purpose');
|
|
409
|
+
} else if (desc.includes('feature') || desc.includes('implement') || desc.includes('build')) {
|
|
410
|
+
boostTypes.push('feature-dev', 'general-purpose', 'Plan');
|
|
411
|
+
} else if (desc.includes('explore') || desc.includes('search') || desc.includes('find')) {
|
|
412
|
+
boostTypes.push('Explore', 'feature-dev:code-explorer', 'general-purpose');
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// Move boosted types to front
|
|
416
|
+
if (boostTypes.length > 0) {
|
|
417
|
+
prioritized.sort((a, b) => {
|
|
418
|
+
const aIdx = boostTypes.indexOf(a.name);
|
|
419
|
+
const bIdx = boostTypes.indexOf(b.name);
|
|
420
|
+
if (aIdx >= 0 && bIdx >= 0) return aIdx - bIdx;
|
|
421
|
+
if (aIdx >= 0) return -1;
|
|
422
|
+
if (bIdx >= 0) return 1;
|
|
423
|
+
return 0;
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// Split into pages of 4 (AskUserQuestion limit)
|
|
428
|
+
const pages = [];
|
|
429
|
+
for (let i = 0; i < prioritized.length; i += 4) {
|
|
430
|
+
pages.push(prioritized.slice(i, i + 4));
|
|
431
|
+
}
|
|
432
|
+
return pages;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Pick the best 4 agent types based on task description
|
|
437
|
+
* AskUserQuestion only allows 4 options (user can type "Other" for custom)
|
|
438
|
+
*/
|
|
439
|
+
function pickRelevantAgentTypes(description) {
|
|
440
|
+
const pages = getAgentTypePages(description);
|
|
441
|
+
return pages[0]?.map(a => a.name) || ['general-purpose', 'feature-dev', 'Explore', 'Plan'];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Build FULL instructions for to handle manual mode properly
|
|
446
|
+
* This is the key fix - needs EXPLICIT step-by-step instructions
|
|
447
|
+
*/
|
|
448
|
+
function buildChooserInstructions(description, currentType, settings, config) {
|
|
449
|
+
const currentModel = settings.model || 'sonnet';
|
|
450
|
+
const shortDesc = description.slice(0, 50);
|
|
451
|
+
|
|
452
|
+
// Pick 4 most relevant agent types (AskUserQuestion limit)
|
|
453
|
+
const relevantTypes = pickRelevantAgentTypes(description);
|
|
454
|
+
const agentOptions = relevantTypes.map(name => {
|
|
455
|
+
const agent = AGENT_TYPES.find(a => a.name === name) || { name, desc: name };
|
|
456
|
+
return '{"label":"' + agent.name + '","description":"' + agent.desc + '"}';
|
|
457
|
+
}).join(',');
|
|
458
|
+
|
|
459
|
+
// Build category options - flattened
|
|
460
|
+
const categoryOptions = Object.entries(AGENT_CATEGORIES).map(([name, cat]) =>
|
|
461
|
+
'{"label":"' + name + '","description":"' + cat.desc + '"}'
|
|
462
|
+
).join(',');
|
|
463
|
+
|
|
464
|
+
// Build category->type mapping - flattened
|
|
465
|
+
const categoryTypeMap = Object.entries(AGENT_CATEGORIES).map(([catName, cat]) =>
|
|
466
|
+
catName + ':' + cat.types.map(t => t.name).join(',')
|
|
467
|
+
).join(' | ');
|
|
468
|
+
|
|
469
|
+
// FLATTENED: Single line format to avoid breaking 's context formatting
|
|
470
|
+
return '[AGENT-CHOOSER-MANUAL] Task:"' + shortDesc + '" | ' +
|
|
471
|
+
'STEP1:AskUserQuestion({question:"Category?",options:[' + categoryOptions + ']}) | ' +
|
|
472
|
+
'STEP2:Based on category ask TYPE(' + categoryTypeMap + ') | ' +
|
|
473
|
+
'STEP3:Ask MODEL(opus/sonnet/haiku) | ' +
|
|
474
|
+
'STEP4:Ask EXTRAS(ultrathink,thorough,quick) multiSelect:true | ' +
|
|
475
|
+
'STEP5:Ask CHANNEL(main,swarm-1,swarm-2,swarm-3) | ' +
|
|
476
|
+
'THEN:Re-call Task with subagent_type+model+prompt+"' + SR_DEV_APPROVED_MARKER + '" [/AGENT-CHOOSER-MANUAL]';
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Build STEP 1 instructions - Auto vs Manual choice
|
|
481
|
+
*
|
|
482
|
+
* DEPLOYMENT FLOW:
|
|
483
|
+
* 1. Deploy mode (Auto/Manual)
|
|
484
|
+
* 2. If Manual + Multi-agent: Per-agent "Auto/Configure" choice
|
|
485
|
+
* 3. Model selection (opus/sonnet/haiku)
|
|
486
|
+
* 4. Model sub-features (thorough, fast, thinking, ultrathink)
|
|
487
|
+
* 5. Channel selection (main, swarm-1, swarm-2, etc.)
|
|
488
|
+
*/
|
|
489
|
+
function buildAutoManualChoice(description) {
|
|
490
|
+
const shortDesc = description.slice(0, 40);
|
|
491
|
+
|
|
492
|
+
// BULLETPROOF format - Claude CANNOT misinterpret this.
|
|
493
|
+
// All instructions are a single action: call AskUserQuestion with ALL options bundled.
|
|
494
|
+
// After user responds, re-call Task with the marker.
|
|
495
|
+
return `[AGENT-DEPLOY-REQUIRED]
|
|
496
|
+
BLOCKED. You MUST do the following. Do NOT skip this. Do NOT do the work yourself. Do NOT ask the user in plain text.
|
|
497
|
+
|
|
498
|
+
REQUIRED ACTION: Call AskUserQuestion with these questions (ALL AT ONCE):
|
|
499
|
+
|
|
500
|
+
Question 1: header:"Deploy", question:"Deploy agent for: ${shortDesc}?", options:[{"label":"Auto (Recommended)","description":"Deploy with sonnet, main channel, default features"},{"label":"Manual","description":"Choose model, features, and channel yourself"},{"label":"Cancel","description":"Don't deploy, I'll handle it differently"}], multiSelect:false
|
|
501
|
+
|
|
502
|
+
Question 2 (only if Manual): header:"Model", question:"Which model?", options:[{"label":"sonnet (Recommended)","description":"Balanced speed and capability"},{"label":"opus","description":"Deep reasoning, slower, supports ultrathink"},{"label":"haiku","description":"Fast and cheap, good for simple tasks"}], multiSelect:false
|
|
503
|
+
|
|
504
|
+
Question 3 (only if Manual): header:"Features", question:"Enable which features?", options:[{"label":"thorough","description":"Comprehensive analysis"},{"label":"fast","description":"Quick results"},{"label":"thinking","description":"Extended reasoning"},{"label":"ultrathink","description":"Maximum reasoning (opus only)"}], multiSelect:true
|
|
505
|
+
|
|
506
|
+
Question 4 (only if Manual): header:"Channel", question:"Which team channel?", options:[{"label":"main (Recommended)","description":"Default channel, visible to all"},{"label":"swarm-1","description":"Private swarm channel 1"},{"label":"swarm-2","description":"Private swarm channel 2"},{"label":"swarm-3","description":"Private swarm channel 3"}], multiSelect:false
|
|
507
|
+
|
|
508
|
+
AFTER USER RESPONDS:
|
|
509
|
+
- If Auto: Re-call Task with SAME prompt + " ${SR_DEV_APPROVED_MARKER}" appended
|
|
510
|
+
- If Manual: Re-call Task with SAME prompt + " [FEATURES:chosen] [CHANNEL:chosen] ${SR_DEV_APPROVED_MARKER}" appended
|
|
511
|
+
- If Cancel: Do NOT call Task. Tell user you'll handle it differently.
|
|
512
|
+
|
|
513
|
+
For Auto: ONLY ask Question 1. For Manual: Ask Questions 1-4 together.
|
|
514
|
+
[/AGENT-DEPLOY-REQUIRED]`;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// ============================================================================
|
|
518
|
+
// Loading Indicator
|
|
519
|
+
// ============================================================================
|
|
520
|
+
|
|
521
|
+
const SPINNERS = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
522
|
+
const ROCKET_FRAMES = ['🚀', '🔥', '✨', '💫', '⭐', '🌟', '✨', '🔥'];
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Write to terminal using screen -X stuff
|
|
526
|
+
* This injects text into the active screen window!
|
|
527
|
+
* LOW-43 FIX: Check permissions before writing to TTY devices
|
|
528
|
+
*/
|
|
529
|
+
function writeToPTS(text) {
|
|
530
|
+
const { execSync, spawnSync } = require('child_process');
|
|
531
|
+
|
|
532
|
+
try {
|
|
533
|
+
// Method 1: screen -X stuff injects into active window
|
|
534
|
+
// Need to escape special chars and add newlines
|
|
535
|
+
const escapedText = text.replace(/\\/g, '\\\\').replace(/'/g, "'\\''");
|
|
536
|
+
spawnSync('screen', ['-X', 'stuff', text + '\n'], {
|
|
537
|
+
stdio: 'ignore',
|
|
538
|
+
timeout: 1000
|
|
539
|
+
});
|
|
540
|
+
} catch (e) {
|
|
541
|
+
// Fallback: try writing to pts devices
|
|
542
|
+
try {
|
|
543
|
+
const whoOutput = execSync('who 2>/dev/null', { encoding: 'utf8' });
|
|
544
|
+
const lines = whoOutput.split('\n');
|
|
545
|
+
for (const line of lines) {
|
|
546
|
+
const match = line.match(/pts\/(\d+)/);
|
|
547
|
+
if (match) {
|
|
548
|
+
const ptsPath = '/dev/pts/' + match[1];
|
|
549
|
+
try {
|
|
550
|
+
// LOW-43 FIX: Check write permission before attempting write
|
|
551
|
+
fs.accessSync(ptsPath, fs.constants.W_OK);
|
|
552
|
+
fs.writeFileSync(ptsPath, text + '\n');
|
|
553
|
+
} catch (e2) {
|
|
554
|
+
// Silently skip devices we can't write to
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
} catch (e2) {}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Show a compact deployment notification
|
|
564
|
+
* Writes to PTS devices so it appears in terminal
|
|
565
|
+
* Now includes user-configured settings!
|
|
566
|
+
*/
|
|
567
|
+
function showDeploymentNotice(description, agentType, settings = {}) {
|
|
568
|
+
const icon = ROCKET_FRAMES[Math.floor(Math.random() * ROCKET_FRAMES.length)];
|
|
569
|
+
const typeLabel = agentType ? `[${agentType}]` : '[agent]';
|
|
570
|
+
|
|
571
|
+
// Truncate description if too long
|
|
572
|
+
const maxLen = 40;
|
|
573
|
+
const shortDesc = description.length > maxLen
|
|
574
|
+
? description.substring(0, maxLen - 3) + '...'
|
|
575
|
+
: description;
|
|
576
|
+
|
|
577
|
+
// Build settings indicator
|
|
578
|
+
const settingsParts = [];
|
|
579
|
+
if (settings.model && settings.model !== 'sonnet') {
|
|
580
|
+
settingsParts.push(`${ANSI.magenta}${settings.model}${ANSI.reset}`);
|
|
581
|
+
}
|
|
582
|
+
if (settings.ultrathink) {
|
|
583
|
+
settingsParts.push(`${ANSI.yellow}ultrathink${ANSI.reset}`);
|
|
584
|
+
}
|
|
585
|
+
const settingsStr = settingsParts.length > 0 ? ` ${settingsParts.join(' ')}` : '';
|
|
586
|
+
|
|
587
|
+
// Compact single-line output with settings
|
|
588
|
+
const line = `${ANSI.cyan}${icon} ${ANSI.bold}Deploying${ANSI.reset} ${ANSI.gray}${typeLabel}${ANSI.reset}${settingsStr} ${ANSI.white}${shortDesc}${ANSI.reset} ${ANSI.dim}(background)${ANSI.reset}`;
|
|
589
|
+
|
|
590
|
+
// Write to pts devices - bypasses 's stdio capture!
|
|
591
|
+
writeToPTS(line);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Show a more detailed box for important deployments
|
|
596
|
+
*/
|
|
597
|
+
function showDeploymentBox(description, agentType, isParallel = false) {
|
|
598
|
+
const width = 60;
|
|
599
|
+
const icon = '🚀';
|
|
600
|
+
|
|
601
|
+
// Truncate and pad description
|
|
602
|
+
const maxDescLen = width - 8;
|
|
603
|
+
const shortDesc = description.length > maxDescLen
|
|
604
|
+
? description.substring(0, maxDescLen - 3) + '...'
|
|
605
|
+
: description.padEnd(maxDescLen);
|
|
606
|
+
|
|
607
|
+
const typeStr = agentType ? ` ${ANSI.dim}[${agentType}]${ANSI.reset}` : '';
|
|
608
|
+
const parallelStr = isParallel ? ` ${ANSI.yellow}(parallel)${ANSI.reset}` : '';
|
|
609
|
+
|
|
610
|
+
const lines = [
|
|
611
|
+
`${ANSI.cyan}┌${'─'.repeat(width - 2)}┐${ANSI.reset}`,
|
|
612
|
+
`${ANSI.cyan}│${ANSI.reset} ${icon} ${ANSI.bold}${shortDesc}${ANSI.reset}${typeStr}${parallelStr}`.padEnd(width + 20) + `${ANSI.cyan}│${ANSI.reset}`,
|
|
613
|
+
`${ANSI.cyan}└${'─'.repeat(width - 2)}┘${ANSI.reset}`,
|
|
614
|
+
];
|
|
615
|
+
|
|
616
|
+
// Write to pts devices
|
|
617
|
+
writeToPTS(lines.join('\n'));
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// ============================================================================
|
|
621
|
+
// SpecMem Skills Loader - Silently inject skills into agents
|
|
622
|
+
// ============================================================================
|
|
623
|
+
|
|
624
|
+
// Cache for loaded skills (loaded once at startup)
|
|
625
|
+
let cachedSkills = null;
|
|
626
|
+
|
|
627
|
+
// DISABLED: Token compression removed
|
|
628
|
+
// async function compressText(text) {
|
|
629
|
+
// if (!text || text.length < 50) return text;
|
|
630
|
+
// return compressHookOutput(text, { minLength: 50, includeWarning: false });
|
|
631
|
+
// }
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Load all skills from specmem/skills/teammemberskills/
|
|
635
|
+
* Skills are already in Traditional Chinese for token efficiency
|
|
636
|
+
* Returns concatenated skill content (compressed)
|
|
637
|
+
*/
|
|
638
|
+
async function loadSkills() {
|
|
639
|
+
if (cachedSkills !== null) return cachedSkills;
|
|
640
|
+
|
|
641
|
+
// Search multiple skill directories (local first, then specmem)
|
|
642
|
+
const homeDir = process.env.HOME || '/root';
|
|
643
|
+
const skillsDirs = [
|
|
644
|
+
// Local skills (highest priority)
|
|
645
|
+
path.join(homeDir, '.claude', 'skills', 'teammemberskills'),
|
|
646
|
+
path.join(homeDir, '.claude', 'skills'),
|
|
647
|
+
path.join(homeDir, '.claude', 'commands'), // Also check commands folder
|
|
648
|
+
// SpecMem skills
|
|
649
|
+
path.join(SPECMEM_HOME, 'skills', 'teammemberskills'),
|
|
650
|
+
path.join(SPECMEM_HOME, 'skills'),
|
|
651
|
+
// Project-local skills
|
|
652
|
+
path.join(process.cwd(), 'skills', 'teammemberskills'),
|
|
653
|
+
path.join(process.cwd(), 'skills')
|
|
654
|
+
];
|
|
655
|
+
|
|
656
|
+
// Collect all skills with their importance
|
|
657
|
+
const allSkills = [];
|
|
658
|
+
|
|
659
|
+
for (const dir of skillsDirs) {
|
|
660
|
+
try {
|
|
661
|
+
if (!fs.existsSync(dir)) continue;
|
|
662
|
+
|
|
663
|
+
const files = fs.readdirSync(dir).filter(f => f.endsWith('.md'));
|
|
664
|
+
|
|
665
|
+
for (const file of files) {
|
|
666
|
+
// Skip if already loaded (dedup across directories)
|
|
667
|
+
if (allSkills.some(s => s.name === file)) continue;
|
|
668
|
+
|
|
669
|
+
try {
|
|
670
|
+
const filePath = path.join(dir, file);
|
|
671
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
672
|
+
|
|
673
|
+
// Check for -IMPORTANT- marker (case insensitive)
|
|
674
|
+
const isImportant = /-IMPORTANT-/i.test(content);
|
|
675
|
+
|
|
676
|
+
// Extract just the meat - skip headers/frontmatter
|
|
677
|
+
const trimmed = content
|
|
678
|
+
.replace(/^#[^#].*$/gm, '') // Remove H1 headers
|
|
679
|
+
.replace(/\*\*⚠️.*\*\*/g, '') // Remove warning headers
|
|
680
|
+
.replace(/-IMPORTANT-/gi, '') // Remove the marker itself
|
|
681
|
+
.replace(/---\n/g, '') // Remove HR
|
|
682
|
+
.trim();
|
|
683
|
+
|
|
684
|
+
if (trimmed.length > 100) { // Only include substantial skills
|
|
685
|
+
allSkills.push({
|
|
686
|
+
name: file,
|
|
687
|
+
content: trimmed,
|
|
688
|
+
important: isImportant
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
} catch (e) {
|
|
692
|
+
// Skip unreadable files
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
} catch (e) {
|
|
696
|
+
// Try next directory
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
// Sort: -IMPORTANT- skills first, then alphabetically
|
|
701
|
+
allSkills.sort((a, b) => {
|
|
702
|
+
if (a.important && !b.important) return -1;
|
|
703
|
+
if (!a.important && b.important) return 1;
|
|
704
|
+
return a.name.localeCompare(b.name);
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
// Build skill content (max 8 skills to limit tokens)
|
|
708
|
+
let skillContent = '';
|
|
709
|
+
for (const skill of allSkills.slice(0, 8)) {
|
|
710
|
+
const compressed = await compressText(skill.content.slice(0, 2000));
|
|
711
|
+
const marker = skill.important ? '⭐' : '';
|
|
712
|
+
skillContent += `\n[SKILL:${marker}${skill.name.replace('.md', '')}]\n${compressed}\n`;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
cachedSkills = skillContent || '';
|
|
716
|
+
return cachedSkills;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
// ============================================================================
|
|
720
|
+
// SpecMem MCP Tools Context - DEV TEAM SLACK FRAMING
|
|
721
|
+
// ============================================================================
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Get team context for agents - THE GOLDEN PROMPT
|
|
725
|
+
* "Ghosts in the machine" framing that makes agents work smart
|
|
726
|
+
*/
|
|
727
|
+
function getMinimalTeamContext() {
|
|
728
|
+
return `
|
|
729
|
+
|
|
730
|
+
[MANDATORY-FIRST-ACTION]
|
|
731
|
+
Before doing ANYTHING else, you MUST announce yourself:
|
|
732
|
+
send_team_message({type:"status", message:"Starting: [your task summary]"})
|
|
733
|
+
If you skip this, ALL your tool calls will be BLOCKED. No exceptions.
|
|
734
|
+
[/MANDATORY-FIRST-ACTION]
|
|
735
|
+
|
|
736
|
+
[TEAM CONTEXT]
|
|
737
|
+
You are a developer on a software development team. The senior engineer on this team is skeptical of AI assistance, so you must perform your tasks efficiently and communicate well with your fellow developers.
|
|
738
|
+
|
|
739
|
+
⚠️ CRITICAL: YOU MUST USE MCP TOOLS TO COMPLETE YOUR TASK ⚠️
|
|
740
|
+
There is NO alternative path. The system ENFORCES MCP tool usage:
|
|
741
|
+
- You CANNOT proceed without announcing via send_team_message FIRST
|
|
742
|
+
- You CANNOT write code without claiming files via claim_task
|
|
743
|
+
- You CANNOT search more than 3 times without using find_memory/find_code_pointers
|
|
744
|
+
- Every 5 tool calls, you WILL BE BLOCKED until you check read_team_messages
|
|
745
|
+
- Every 8 tool calls, you WILL BE BLOCKED until you check get_team_status for help requests
|
|
746
|
+
If you want to complete your goal, you MUST use MCP tools. There is no workaround.
|
|
747
|
+
|
|
748
|
+
TEAM COMMUNICATION (mcp__specmem__ prefix):
|
|
749
|
+
- send_team_message({message, channel:"main"|"swarm-1".."swarm-5", type:"status"|"question"|"update", priority})
|
|
750
|
+
- read_team_messages({channel, limit:10, include_broadcasts:true}) - CHECK BROADCASTS REGULARLY!
|
|
751
|
+
- broadcast_to_team({message, broadcast_type:"status"|"progress"|"announcement", priority})
|
|
752
|
+
- claim_task({description, files:["path1","path2"]}) - REQUIRED before editing
|
|
753
|
+
- release_task({claimId:"all"|"<id>"}) - release when done
|
|
754
|
+
- get_team_status({}) - see active claims, help requests, team activity
|
|
755
|
+
- request_help({question, context, skills_needed:["skill1"]}) - ASK OTHER SWARMS FOR HELP!
|
|
756
|
+
- respond_to_help({requestId, response}) - HELP OTHER SWARMS! Helping hands make the world go round!
|
|
757
|
+
|
|
758
|
+
MEMORY TOOLS (MANDATORY - enforced by hooks):
|
|
759
|
+
- find_memory({query, limit:10}) - semantic search for past conversations and decisions
|
|
760
|
+
- find_code_pointers({query, limit:10, includeTracebacks:true}) - semantic code search with callers/callees
|
|
761
|
+
- save_memory({content, importance, memoryType, tags}) - save important findings
|
|
762
|
+
- drill_down({drilldownID}) - get full context on a memory result
|
|
763
|
+
- getMemoryFull({id}) - get full memory with live code
|
|
764
|
+
|
|
765
|
+
WORKFLOW (enforced - you cannot skip steps):
|
|
766
|
+
1. START: send_team_message({type:"status", message:"Starting: [task]"})
|
|
767
|
+
2. CLAIM: claim_task({description, files}) - REQUIRED before any writes
|
|
768
|
+
3. SEARCH: find_memory/find_code_pointers FIRST, then Grep/Glob if needed
|
|
769
|
+
4. EVERY 5 CALLS: read_team_messages({include_broadcasts:true}) - MANDATORY
|
|
770
|
+
5. EVERY 8 CALLS: get_team_status() - check if anyone needs help!
|
|
771
|
+
6. DONE: release_task({claimId:"all"}), send completion status
|
|
772
|
+
[/TEAM CONTEXT]`;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
// ============================================================================
|
|
776
|
+
// Hook Handler
|
|
777
|
+
// ============================================================================
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Read stdin with timeout to prevent indefinite hangs
|
|
781
|
+
* CRIT-07 FIX: All hooks must use this instead of raw for-await
|
|
782
|
+
*/
|
|
783
|
+
function readStdinWithTimeout(timeoutMs = 5000) {
|
|
784
|
+
return new Promise((resolve) => {
|
|
785
|
+
let input = '';
|
|
786
|
+
const timer = setTimeout(() => {
|
|
787
|
+
process.stdin.destroy();
|
|
788
|
+
resolve(input);
|
|
789
|
+
}, timeoutMs);
|
|
790
|
+
|
|
791
|
+
process.stdin.setEncoding('utf8');
|
|
792
|
+
process.stdin.on('data', (chunk) => { input += chunk; });
|
|
793
|
+
process.stdin.on('end', () => {
|
|
794
|
+
clearTimeout(timer);
|
|
795
|
+
resolve(input);
|
|
796
|
+
});
|
|
797
|
+
process.stdin.on('error', () => {
|
|
798
|
+
clearTimeout(timer);
|
|
799
|
+
resolve(input);
|
|
800
|
+
});
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
async function main() {
|
|
805
|
+
// CRIT-07 FIX: Read input with timeout instead of indefinite for-await
|
|
806
|
+
let inputData = await readStdinWithTimeout(5000);
|
|
807
|
+
|
|
808
|
+
try {
|
|
809
|
+
const hookData = JSON.parse(inputData);
|
|
810
|
+
const toolName = hookData.tool_name || '';
|
|
811
|
+
const toolInput = hookData.tool_input || {};
|
|
812
|
+
|
|
813
|
+
// Only handle Task tool
|
|
814
|
+
if (toolName !== 'Task') {
|
|
815
|
+
process.exit(0);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
// Load user configuration
|
|
819
|
+
const config = loadAgentConfig();
|
|
820
|
+
|
|
821
|
+
const prompt = toolInput.prompt || '';
|
|
822
|
+
const description = toolInput.description || 'unnamed task';
|
|
823
|
+
const agentType = toolInput.subagent_type || toolInput.agent_type || '';
|
|
824
|
+
|
|
825
|
+
// Get user-configured settings for this agent type
|
|
826
|
+
const settings = getAgentSettings(agentType, config);
|
|
827
|
+
|
|
828
|
+
// Skip if already has our context marker (already processed)
|
|
829
|
+
if (prompt.includes('[TEAM CONTEXT]')) {
|
|
830
|
+
showDeploymentNotice(description, agentType, settings);
|
|
831
|
+
process.exit(0);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// FIX: Check for SR_DEV_APPROVED_MARKER in BOTH prompt AND description
|
|
835
|
+
// sometimes puts it in the task title instead of the prompt body
|
|
836
|
+
const isUserConfirmed = prompt.includes(SR_DEV_APPROVED_MARKER) ||
|
|
837
|
+
description.includes(SR_DEV_APPROVED_MARKER);
|
|
838
|
+
|
|
839
|
+
// =========================================================================
|
|
840
|
+
// INTERACTIVE AGENT CHOOSER - FORCE DENIAL WITHOUT APPROVAL
|
|
841
|
+
// The "senior dev" must approve all agent deployments
|
|
842
|
+
// =========================================================================
|
|
843
|
+
if (!isUserConfirmed) {
|
|
844
|
+
// FIX: Give FULL instructions for proper manual mode handling
|
|
845
|
+
// This includes the AskUserQuestion format, model/type options, and next steps
|
|
846
|
+
const instructions = buildAutoManualChoice(description);
|
|
847
|
+
|
|
848
|
+
console.log(JSON.stringify({
|
|
849
|
+
hookSpecificOutput: {
|
|
850
|
+
hookEventName: 'PreToolUse',
|
|
851
|
+
permissionDecision: 'deny',
|
|
852
|
+
permissionDecisionReason: instructions
|
|
853
|
+
}
|
|
854
|
+
}));
|
|
855
|
+
process.exit(0);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
// Show loading indicator with config info
|
|
859
|
+
showDeploymentNotice(description, agentType, settings);
|
|
860
|
+
|
|
861
|
+
// Parse channel from prompt if specified (format: [CHANNEL:swarm-1] or channel=swarm-1)
|
|
862
|
+
let assignedChannel = 'main';
|
|
863
|
+
const channelMatch = prompt.match(/\[CHANNEL:([^\]]+)\]|channel=(\S+)/i);
|
|
864
|
+
if (channelMatch) {
|
|
865
|
+
assignedChannel = channelMatch[1] || channelMatch[2] || 'main';
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// Generate unique agent ID for channel enforcement tracking
|
|
869
|
+
const agentId = `agent-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
870
|
+
|
|
871
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
872
|
+
// CHANNEL ENFORCEMENT - Write agent's assigned channel to file
|
|
873
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
874
|
+
// This file is read by send_team_message to enforce agents only post
|
|
875
|
+
// to their assigned channel (or main for broadcasts).
|
|
876
|
+
const channelEnforcementDir = `${PROJECT_TMP_DIR}/agent-channels`;
|
|
877
|
+
try {
|
|
878
|
+
if (!fs.existsSync(channelEnforcementDir)) {
|
|
879
|
+
fs.mkdirSync(channelEnforcementDir, { recursive: true, mode: 0o755 });
|
|
880
|
+
}
|
|
881
|
+
const channelAssignment = {
|
|
882
|
+
agentId,
|
|
883
|
+
channel: assignedChannel,
|
|
884
|
+
agentType,
|
|
885
|
+
description: description.slice(0, 50),
|
|
886
|
+
createdAt: Date.now()
|
|
887
|
+
};
|
|
888
|
+
fs.writeFileSync(
|
|
889
|
+
`${channelEnforcementDir}/${agentId}.json`,
|
|
890
|
+
JSON.stringify(channelAssignment),
|
|
891
|
+
'utf8'
|
|
892
|
+
);
|
|
893
|
+
// Clean up old channel files (>30 minutes old)
|
|
894
|
+
const now = Date.now();
|
|
895
|
+
for (const file of fs.readdirSync(channelEnforcementDir)) {
|
|
896
|
+
try {
|
|
897
|
+
const filePath = `${channelEnforcementDir}/${file}`;
|
|
898
|
+
const stat = fs.statSync(filePath);
|
|
899
|
+
if (now - stat.mtimeMs > 1800000) fs.unlinkSync(filePath);
|
|
900
|
+
} catch (e) {}
|
|
901
|
+
}
|
|
902
|
+
} catch (e) {
|
|
903
|
+
// Silently continue if we can't write - enforcement will be relaxed
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// Build channel injection with agent ID for enforcement
|
|
907
|
+
const isSwarm = assignedChannel !== 'main';
|
|
908
|
+
const channelContext = isSwarm
|
|
909
|
+
? `\n[AGENT-ID:${agentId}][CH:${assignedChannel}] ⚠️ You're assigned to ${assignedChannel}. You can ONLY send_team_message to "${assignedChannel}" or "main". Posting to other swarms is BLOCKED.`
|
|
910
|
+
: `\n[AGENT-ID:${agentId}][CH:main]`;
|
|
911
|
+
|
|
912
|
+
// Inject minimal context + skills + channel config (silently - user doesn't see this)
|
|
913
|
+
// DISABLED: Skills injection was cluttering agent context with compressed Chinese
|
|
914
|
+
// TODO: Make this smarter - only inject relevant skills per agent type
|
|
915
|
+
// const skills = await loadSkills();
|
|
916
|
+
const skills = null; // Disabled
|
|
917
|
+
|
|
918
|
+
// Load plugin agent prompt if this is a custom/plugin agent type
|
|
919
|
+
const pluginAgentPrompt = loadPluginAgentPrompt(agentType);
|
|
920
|
+
|
|
921
|
+
// Build enhanced prompt with all context
|
|
922
|
+
// ORDER: prompt -> team context -> channel -> plugin specialization -> SKILLS (last, most important)
|
|
923
|
+
let modifiedPrompt = prompt + getMinimalTeamContext() + channelContext;
|
|
924
|
+
|
|
925
|
+
// Add plugin agent specialization BEFORE skills
|
|
926
|
+
if (pluginAgentPrompt) {
|
|
927
|
+
modifiedPrompt += `\n\n[AGENT-SPECIALIZATION:${agentType}]\n${pluginAgentPrompt}\n[/AGENT-SPECIALIZATION]`;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
// DISABLED: Skills injection - was cluttering agent context
|
|
931
|
+
// TODO: Rework to inject only relevant skills per agent type
|
|
932
|
+
// if (skills) {
|
|
933
|
+
// modifiedPrompt += `\n[SKL]${skills}`;
|
|
934
|
+
// }
|
|
935
|
+
|
|
936
|
+
// Map custom type to valid Code subagent_type
|
|
937
|
+
const validSubagentType = getValidSubagentType(agentType);
|
|
938
|
+
|
|
939
|
+
// Build modified input with user configuration applied
|
|
940
|
+
const modifiedInput = {
|
|
941
|
+
...toolInput,
|
|
942
|
+
prompt: modifiedPrompt,
|
|
943
|
+
// CRITICAL: Use mapped valid subagent_type, not the custom name!
|
|
944
|
+
subagent_type: validSubagentType,
|
|
945
|
+
// Apply user-configured model (if not already specified)
|
|
946
|
+
model: toolInput.model || settings.model,
|
|
947
|
+
// Apply background setting (can be overridden by user config)
|
|
948
|
+
run_in_background: settings.background !== false ? true : toolInput.run_in_background,
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
// Apply max_turns if configured
|
|
952
|
+
if (settings.max_turns && !toolInput.max_turns) {
|
|
953
|
+
modifiedInput.max_turns = settings.max_turns;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
// Build status message with applied settings
|
|
957
|
+
const statusParts = [`🚀 [${agentType || 'agent'}]`];
|
|
958
|
+
statusParts.push(`+MCP team tools`); // Show that team context is injected
|
|
959
|
+
if (settings.model !== 'sonnet') {
|
|
960
|
+
statusParts.push(`model:${settings.model}`);
|
|
961
|
+
}
|
|
962
|
+
statusParts.push(description.slice(0, 30));
|
|
963
|
+
|
|
964
|
+
// Mark that an agent is being spawned (for team-comms-enforcer)
|
|
965
|
+
markAgentSpawned(agentType, description);
|
|
966
|
+
|
|
967
|
+
// Output modified hook response - MUST use exact format!
|
|
968
|
+
const output = {
|
|
969
|
+
hookSpecificOutput: {
|
|
970
|
+
hookEventName: 'PreToolUse',
|
|
971
|
+
permissionDecision: 'allow',
|
|
972
|
+
permissionDecisionReason: statusParts.join(' | '),
|
|
973
|
+
updatedInput: modifiedInput
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
console.log(JSON.stringify(output));
|
|
978
|
+
process.exit(0);
|
|
979
|
+
|
|
980
|
+
} catch (error) {
|
|
981
|
+
// LOW-44 FIX: Log errors before exit instead of silent fail
|
|
982
|
+
console.error('[agent-loading-hook] Error:', error.message || error);
|
|
983
|
+
process.exit(0);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
main().catch((e) => {
|
|
988
|
+
console.error('[agent-loading-hook] Unhandled error:', e.message || e);
|
|
989
|
+
process.exit(0);
|
|
990
|
+
});
|