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,1353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* codeAnalyzer.ts - Advanced Code Analysis for Semantic Search
|
|
3
|
+
*
|
|
4
|
+
* yo this analyzer SLAPS - extracts definitions, dependencies, chunks, and complexity
|
|
5
|
+
* from code files for storage in PostgreSQL with vector embeddings
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Function/class/variable definition extraction
|
|
9
|
+
* - Import/dependency tracking
|
|
10
|
+
* - Code chunking for semantic search
|
|
11
|
+
* - Complexity metrics calculation
|
|
12
|
+
* - Multi-language support (TypeScript, JavaScript, Python, etc.)
|
|
13
|
+
*/
|
|
14
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
15
|
+
import { logger } from '../utils/logger.js';
|
|
16
|
+
import { getProjectPath } from '../config.js';
|
|
17
|
+
// ========================================
|
|
18
|
+
// CODE ANALYZER CLASS
|
|
19
|
+
// ========================================
|
|
20
|
+
/**
|
|
21
|
+
* CodeAnalyzer - extracts semantic information from code
|
|
22
|
+
*
|
|
23
|
+
* yo this class is the BRAIN of semantic code search
|
|
24
|
+
* parses code and extracts definitions, dependencies, chunks
|
|
25
|
+
*/
|
|
26
|
+
export class CodeAnalyzer {
|
|
27
|
+
chunkSize;
|
|
28
|
+
chunkOverlap;
|
|
29
|
+
analyzerVersion = '1.0.0';
|
|
30
|
+
constructor(options) {
|
|
31
|
+
this.chunkSize = options?.chunkSize ?? 50; // lines per chunk
|
|
32
|
+
this.chunkOverlap = options?.chunkOverlap ?? 10; // overlap between chunks
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* analyzeFile - performs complete analysis of a code file
|
|
36
|
+
*/
|
|
37
|
+
async analyzeFile(fileId, filePath, content, language) {
|
|
38
|
+
const startTime = Date.now();
|
|
39
|
+
logger.debug({ filePath, language }, 'analyzing file...');
|
|
40
|
+
const lines = content.split('\n');
|
|
41
|
+
// Extract all components
|
|
42
|
+
const definitions = this.extractDefinitions(fileId, filePath, content, language);
|
|
43
|
+
const dependencies = this.extractDependencies(fileId, filePath, content, language);
|
|
44
|
+
const chunks = this.createChunks(fileId, filePath, content, language, lines);
|
|
45
|
+
const complexity = this.calculateComplexity(fileId, filePath, content, language, lines);
|
|
46
|
+
const duration = Date.now() - startTime;
|
|
47
|
+
logger.debug({
|
|
48
|
+
filePath,
|
|
49
|
+
definitions: definitions.length,
|
|
50
|
+
dependencies: dependencies.length,
|
|
51
|
+
chunks: chunks.length,
|
|
52
|
+
duration
|
|
53
|
+
}, 'file analysis complete');
|
|
54
|
+
return {
|
|
55
|
+
fileId,
|
|
56
|
+
filePath,
|
|
57
|
+
language,
|
|
58
|
+
definitions,
|
|
59
|
+
dependencies,
|
|
60
|
+
chunks,
|
|
61
|
+
complexity,
|
|
62
|
+
analyzedAt: new Date()
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// ========================================
|
|
66
|
+
// DEFINITION EXTRACTION
|
|
67
|
+
// ========================================
|
|
68
|
+
/**
|
|
69
|
+
* extractDefinitions - extracts function/class/variable definitions
|
|
70
|
+
*/
|
|
71
|
+
extractDefinitions(fileId, filePath, content, language) {
|
|
72
|
+
const definitions = [];
|
|
73
|
+
const lines = content.split('\n');
|
|
74
|
+
// Language-specific extraction
|
|
75
|
+
switch (language) {
|
|
76
|
+
case 'typescript':
|
|
77
|
+
case 'typescript-react':
|
|
78
|
+
case 'javascript':
|
|
79
|
+
case 'javascript-react':
|
|
80
|
+
this.extractTSJSDefinitions(fileId, filePath, lines, language, definitions);
|
|
81
|
+
break;
|
|
82
|
+
case 'python':
|
|
83
|
+
this.extractPythonDefinitions(fileId, filePath, lines, language, definitions);
|
|
84
|
+
break;
|
|
85
|
+
case 'go':
|
|
86
|
+
this.extractGoDefinitions(fileId, filePath, lines, language, definitions);
|
|
87
|
+
break;
|
|
88
|
+
case 'rust':
|
|
89
|
+
this.extractRustDefinitions(fileId, filePath, lines, language, definitions);
|
|
90
|
+
break;
|
|
91
|
+
default:
|
|
92
|
+
// Generic extraction for unknown languages
|
|
93
|
+
this.extractGenericDefinitions(fileId, filePath, lines, language, definitions);
|
|
94
|
+
}
|
|
95
|
+
return definitions;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* extractTSJSDefinitions - extracts TypeScript/JavaScript definitions
|
|
99
|
+
*
|
|
100
|
+
* Uses a definition stack to track nested functions/classes/methods
|
|
101
|
+
* so inner functions get proper parentDefinitionId linkage
|
|
102
|
+
*/
|
|
103
|
+
extractTSJSDefinitions(fileId, filePath, lines, language, definitions) {
|
|
104
|
+
// Regex patterns for TS/JS
|
|
105
|
+
const patterns = {
|
|
106
|
+
// Functions: function name(), async function, etc.
|
|
107
|
+
function: /^(?:export\s+)?(?:async\s+)?function\s+(\w+)\s*(?:<[^>]*>)?\s*\(([^)]*)\)(?:\s*:\s*([^\{]+))?/,
|
|
108
|
+
// Top-level arrow functions
|
|
109
|
+
arrowFunction: /^(?:export\s+)?(?:const|let|var)\s+(\w+)\s*(?::\s*[^=]+)?\s*=\s*(?:async\s+)?(?:\([^)]*\)|[^=])\s*=>/,
|
|
110
|
+
// Nested arrow functions (indented)
|
|
111
|
+
nestedArrowFunction: /^\s+(?:const|let|var)\s+(\w+)\s*(?::\s*[^=]+)?\s*=\s*(?:async\s+)?(?:\([^)]*\)|[^=])\s*=>/,
|
|
112
|
+
// Nested function declarations (indented)
|
|
113
|
+
nestedFunction: /^\s+(?:async\s+)?function\s+(\w+)\s*(?:<[^>]*>)?\s*\(([^)]*)\)(?:\s*:\s*([^\{]+))?/,
|
|
114
|
+
// Classes and interfaces
|
|
115
|
+
class: /^(?:export\s+)?(?:abstract\s+)?class\s+(\w+)(?:\s+extends\s+(\w+))?(?:\s+implements\s+([^{]+))?/,
|
|
116
|
+
interface: /^(?:export\s+)?interface\s+(\w+)(?:\s+extends\s+([^{]+))?/,
|
|
117
|
+
type: /^(?:export\s+)?type\s+(\w+)\s*(?:<[^>]*>)?\s*=/,
|
|
118
|
+
enum: /^(?:export\s+)?(?:const\s+)?enum\s+(\w+)/,
|
|
119
|
+
// Methods within classes
|
|
120
|
+
method: /^\s+(?:public\s+|private\s+|protected\s+)?(?:static\s+)?(?:async\s+)?(\w+)\s*(?:<[^>]*>)?\s*\(([^)]*)\)(?:\s*:\s*([^\{]+))?/,
|
|
121
|
+
// Constants and variables
|
|
122
|
+
constant: /^(?:export\s+)?const\s+(\w+)\s*(?::\s*([^=]+))?\s*=/,
|
|
123
|
+
variable: /^(?:export\s+)?(?:let|var)\s+(\w+)\s*(?::\s*([^=]+))?\s*=/
|
|
124
|
+
};
|
|
125
|
+
// Stack to track nested definitions - each entry has {def, braceDepthAtStart}
|
|
126
|
+
// bruh this stack approach lets us track nested functions properly
|
|
127
|
+
const definitionStack = [];
|
|
128
|
+
let braceDepth = 0;
|
|
129
|
+
for (let i = 0; i < lines.length; i++) {
|
|
130
|
+
const line = lines[i];
|
|
131
|
+
const trimmed = line.trim();
|
|
132
|
+
// Track brace depth - do this BEFORE popping the stack
|
|
133
|
+
const openBraces = (line.match(/\{/g) || []).length;
|
|
134
|
+
const closeBraces = (line.match(/\}/g) || []).length;
|
|
135
|
+
// Pop definitions from stack when their scope closes
|
|
136
|
+
// gotta check before we update braceDepth so we catch the closing brace
|
|
137
|
+
for (let b = 0; b < closeBraces; b++) {
|
|
138
|
+
const newDepth = braceDepth - (b + 1);
|
|
139
|
+
while (definitionStack.length > 0 && definitionStack[definitionStack.length - 1].braceDepthAtStart >= newDepth) {
|
|
140
|
+
definitionStack.pop();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
braceDepth += openBraces - closeBraces;
|
|
144
|
+
// Skip comments and empty lines
|
|
145
|
+
if (trimmed.startsWith('//') || trimmed.startsWith('/*') || trimmed === '') {
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
// Helper to get current parent definition
|
|
149
|
+
const getCurrentParent = () => {
|
|
150
|
+
return definitionStack.length > 0 ? definitionStack[definitionStack.length - 1].def : null;
|
|
151
|
+
};
|
|
152
|
+
// Helper to get qualified name
|
|
153
|
+
const getQualifiedName = (name) => {
|
|
154
|
+
const parent = getCurrentParent();
|
|
155
|
+
if (!parent)
|
|
156
|
+
return undefined;
|
|
157
|
+
return parent.qualifiedName ? `${parent.qualifiedName}.${name}` : `${parent.name}.${name}`;
|
|
158
|
+
};
|
|
159
|
+
// Check for class definition
|
|
160
|
+
let match = line.match(patterns.class);
|
|
161
|
+
if (match) {
|
|
162
|
+
const parent = getCurrentParent();
|
|
163
|
+
const def = this.createDefinition(fileId, filePath, {
|
|
164
|
+
name: match[1],
|
|
165
|
+
qualifiedName: getQualifiedName(match[1]),
|
|
166
|
+
definitionType: 'class',
|
|
167
|
+
startLine: i + 1,
|
|
168
|
+
language,
|
|
169
|
+
isExported: line.includes('export'),
|
|
170
|
+
isAbstract: line.includes('abstract'),
|
|
171
|
+
parentDefinitionId: parent?.id,
|
|
172
|
+
signature: trimmed
|
|
173
|
+
});
|
|
174
|
+
definitions.push(def);
|
|
175
|
+
// Push to stack so nested stuff knows its parent
|
|
176
|
+
if (line.includes('{')) {
|
|
177
|
+
definitionStack.push({ def, braceDepthAtStart: braceDepth - openBraces });
|
|
178
|
+
}
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
// Check for interface definition
|
|
182
|
+
match = line.match(patterns.interface);
|
|
183
|
+
if (match) {
|
|
184
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
185
|
+
name: match[1],
|
|
186
|
+
definitionType: 'interface',
|
|
187
|
+
startLine: i + 1,
|
|
188
|
+
language,
|
|
189
|
+
isExported: line.includes('export'),
|
|
190
|
+
signature: trimmed
|
|
191
|
+
}));
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
// Check for type definition
|
|
195
|
+
match = line.match(patterns.type);
|
|
196
|
+
if (match) {
|
|
197
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
198
|
+
name: match[1],
|
|
199
|
+
definitionType: 'type',
|
|
200
|
+
startLine: i + 1,
|
|
201
|
+
language,
|
|
202
|
+
isExported: line.includes('export'),
|
|
203
|
+
signature: trimmed
|
|
204
|
+
}));
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
// Check for enum definition
|
|
208
|
+
match = line.match(patterns.enum);
|
|
209
|
+
if (match) {
|
|
210
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
211
|
+
name: match[1],
|
|
212
|
+
definitionType: 'enum',
|
|
213
|
+
startLine: i + 1,
|
|
214
|
+
language,
|
|
215
|
+
isExported: line.includes('export'),
|
|
216
|
+
signature: trimmed
|
|
217
|
+
}));
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
// Check for top-level function definition
|
|
221
|
+
match = line.match(patterns.function);
|
|
222
|
+
if (match) {
|
|
223
|
+
const parent = getCurrentParent();
|
|
224
|
+
const params = this.parseParameters(match[2] || '');
|
|
225
|
+
const def = this.createDefinition(fileId, filePath, {
|
|
226
|
+
name: match[1],
|
|
227
|
+
qualifiedName: getQualifiedName(match[1]),
|
|
228
|
+
definitionType: 'function',
|
|
229
|
+
startLine: i + 1,
|
|
230
|
+
language,
|
|
231
|
+
isExported: line.includes('export'),
|
|
232
|
+
isAsync: line.includes('async'),
|
|
233
|
+
returnType: match[3]?.trim(),
|
|
234
|
+
parameters: params,
|
|
235
|
+
parentDefinitionId: parent?.id,
|
|
236
|
+
signature: trimmed
|
|
237
|
+
});
|
|
238
|
+
definitions.push(def);
|
|
239
|
+
// Push to stack for nested function tracking
|
|
240
|
+
if (line.includes('{')) {
|
|
241
|
+
definitionStack.push({ def, braceDepthAtStart: braceDepth - openBraces });
|
|
242
|
+
}
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
// Check for top-level arrow function
|
|
246
|
+
match = line.match(patterns.arrowFunction);
|
|
247
|
+
if (match && braceDepth === 0) {
|
|
248
|
+
const def = this.createDefinition(fileId, filePath, {
|
|
249
|
+
name: match[1],
|
|
250
|
+
definitionType: 'function',
|
|
251
|
+
startLine: i + 1,
|
|
252
|
+
language,
|
|
253
|
+
isExported: line.includes('export'),
|
|
254
|
+
isAsync: line.includes('async'),
|
|
255
|
+
signature: trimmed
|
|
256
|
+
});
|
|
257
|
+
definitions.push(def);
|
|
258
|
+
// Push if it has a body block
|
|
259
|
+
if (line.includes('{')) {
|
|
260
|
+
definitionStack.push({ def, braceDepthAtStart: braceDepth - openBraces });
|
|
261
|
+
}
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
// Check for nested function/arrow function inside another definition
|
|
265
|
+
const parent = getCurrentParent();
|
|
266
|
+
if (parent && braceDepth > 0) {
|
|
267
|
+
// Check for nested function declaration
|
|
268
|
+
match = line.match(patterns.nestedFunction);
|
|
269
|
+
if (match) {
|
|
270
|
+
const params = this.parseParameters(match[2] || '');
|
|
271
|
+
const def = this.createDefinition(fileId, filePath, {
|
|
272
|
+
name: match[1],
|
|
273
|
+
qualifiedName: getQualifiedName(match[1]),
|
|
274
|
+
definitionType: 'function',
|
|
275
|
+
startLine: i + 1,
|
|
276
|
+
language,
|
|
277
|
+
isAsync: line.includes('async'),
|
|
278
|
+
returnType: match[3]?.trim(),
|
|
279
|
+
parameters: params,
|
|
280
|
+
parentDefinitionId: parent.id,
|
|
281
|
+
signature: trimmed
|
|
282
|
+
});
|
|
283
|
+
definitions.push(def);
|
|
284
|
+
if (line.includes('{')) {
|
|
285
|
+
definitionStack.push({ def, braceDepthAtStart: braceDepth - openBraces });
|
|
286
|
+
}
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
// Check for nested arrow function
|
|
290
|
+
match = line.match(patterns.nestedArrowFunction);
|
|
291
|
+
if (match) {
|
|
292
|
+
const def = this.createDefinition(fileId, filePath, {
|
|
293
|
+
name: match[1],
|
|
294
|
+
qualifiedName: getQualifiedName(match[1]),
|
|
295
|
+
definitionType: 'function',
|
|
296
|
+
startLine: i + 1,
|
|
297
|
+
language,
|
|
298
|
+
isAsync: line.includes('async'),
|
|
299
|
+
parentDefinitionId: parent.id,
|
|
300
|
+
signature: trimmed
|
|
301
|
+
});
|
|
302
|
+
definitions.push(def);
|
|
303
|
+
if (line.includes('{')) {
|
|
304
|
+
definitionStack.push({ def, braceDepthAtStart: braceDepth - openBraces });
|
|
305
|
+
}
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
// Check for method within class (parent must be a class)
|
|
309
|
+
if (parent.definitionType === 'class') {
|
|
310
|
+
match = line.match(patterns.method);
|
|
311
|
+
if (match && match[1] !== 'if' && match[1] !== 'for' && match[1] !== 'while' && match[1] !== 'switch' && match[1] !== 'catch') {
|
|
312
|
+
const params = this.parseParameters(match[2] || '');
|
|
313
|
+
const def = this.createDefinition(fileId, filePath, {
|
|
314
|
+
name: match[1],
|
|
315
|
+
qualifiedName: `${parent.name}.${match[1]}`,
|
|
316
|
+
definitionType: 'method',
|
|
317
|
+
startLine: i + 1,
|
|
318
|
+
language,
|
|
319
|
+
visibility: this.detectVisibility(line),
|
|
320
|
+
isStatic: line.includes('static'),
|
|
321
|
+
isAsync: line.includes('async'),
|
|
322
|
+
returnType: match[3]?.trim(),
|
|
323
|
+
parameters: params,
|
|
324
|
+
parentDefinitionId: parent.id,
|
|
325
|
+
signature: trimmed
|
|
326
|
+
});
|
|
327
|
+
definitions.push(def);
|
|
328
|
+
if (line.includes('{')) {
|
|
329
|
+
definitionStack.push({ def, braceDepthAtStart: braceDepth - openBraces });
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
// Check for constant (top-level only)
|
|
335
|
+
if (braceDepth === 0) {
|
|
336
|
+
match = line.match(patterns.constant);
|
|
337
|
+
if (match && !line.includes('=>')) {
|
|
338
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
339
|
+
name: match[1],
|
|
340
|
+
definitionType: 'constant',
|
|
341
|
+
startLine: i + 1,
|
|
342
|
+
language,
|
|
343
|
+
isExported: line.includes('export'),
|
|
344
|
+
signature: trimmed
|
|
345
|
+
}));
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* extractPythonDefinitions - extracts Python definitions
|
|
352
|
+
*
|
|
353
|
+
* Uses indentation-based stack to track nested functions/classes
|
|
354
|
+
* Python's indentation makes this cleaner than brace-based languages
|
|
355
|
+
*/
|
|
356
|
+
extractPythonDefinitions(fileId, filePath, lines, language, definitions) {
|
|
357
|
+
const patterns = {
|
|
358
|
+
function: /^(\s*)(?:async\s+)?def\s+(\w+)\s*\(([^)]*)\)(?:\s*->\s*([^:]+))?:/,
|
|
359
|
+
class: /^(\s*)class\s+(\w+)(?:\(([^)]*)\))?:/,
|
|
360
|
+
variable: /^(\w+)\s*(?::\s*([^=]+))?\s*=/
|
|
361
|
+
};
|
|
362
|
+
// Stack tracks {def, indentLevel} so we can pop when indent decreases
|
|
363
|
+
// Python uses indentation not braces, so this approach is more accurate
|
|
364
|
+
const definitionStack = [];
|
|
365
|
+
for (let i = 0; i < lines.length; i++) {
|
|
366
|
+
const line = lines[i];
|
|
367
|
+
const trimmed = line.trim();
|
|
368
|
+
// Skip comments and empty lines (but track them for line counting)
|
|
369
|
+
if (trimmed.startsWith('#') || trimmed === '') {
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
const indent = line.length - line.trimStart().length;
|
|
373
|
+
// Pop stack when indentation decreases - we've left the nested scope
|
|
374
|
+
while (definitionStack.length > 0 && definitionStack[definitionStack.length - 1].indentLevel >= indent) {
|
|
375
|
+
definitionStack.pop();
|
|
376
|
+
}
|
|
377
|
+
// Helper to get current parent
|
|
378
|
+
const getCurrentParent = () => {
|
|
379
|
+
return definitionStack.length > 0 ? definitionStack[definitionStack.length - 1].def : null;
|
|
380
|
+
};
|
|
381
|
+
// Helper to build qualified name from stack
|
|
382
|
+
const getQualifiedName = (name) => {
|
|
383
|
+
if (definitionStack.length === 0)
|
|
384
|
+
return undefined;
|
|
385
|
+
const names = definitionStack.map(s => s.def.name);
|
|
386
|
+
names.push(name);
|
|
387
|
+
return names.join('.');
|
|
388
|
+
};
|
|
389
|
+
// Check for class definition
|
|
390
|
+
let match = line.match(patterns.class);
|
|
391
|
+
if (match) {
|
|
392
|
+
const classIndent = match[1].length;
|
|
393
|
+
const parent = getCurrentParent();
|
|
394
|
+
const def = this.createDefinition(fileId, filePath, {
|
|
395
|
+
name: match[2],
|
|
396
|
+
qualifiedName: getQualifiedName(match[2]),
|
|
397
|
+
definitionType: 'class',
|
|
398
|
+
startLine: i + 1,
|
|
399
|
+
language,
|
|
400
|
+
parentDefinitionId: parent?.id,
|
|
401
|
+
signature: trimmed
|
|
402
|
+
});
|
|
403
|
+
definitions.push(def);
|
|
404
|
+
definitionStack.push({ def, indentLevel: classIndent });
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
// Check for function/method definition
|
|
408
|
+
match = line.match(patterns.function);
|
|
409
|
+
if (match) {
|
|
410
|
+
const funcIndent = match[1].length;
|
|
411
|
+
const parent = getCurrentParent();
|
|
412
|
+
const params = this.parsePythonParameters(match[3] || '');
|
|
413
|
+
// Determine if this is a method (parent is a class) or nested function
|
|
414
|
+
const isMethod = parent?.definitionType === 'class';
|
|
415
|
+
const isNestedFunction = parent && !isMethod;
|
|
416
|
+
const def = this.createDefinition(fileId, filePath, {
|
|
417
|
+
name: match[2],
|
|
418
|
+
qualifiedName: getQualifiedName(match[2]),
|
|
419
|
+
definitionType: isMethod ? 'method' : 'function',
|
|
420
|
+
startLine: i + 1,
|
|
421
|
+
language,
|
|
422
|
+
isAsync: line.includes('async'),
|
|
423
|
+
returnType: match[4]?.trim(),
|
|
424
|
+
parameters: params,
|
|
425
|
+
parentDefinitionId: parent?.id,
|
|
426
|
+
visibility: match[2].startsWith('__') ? 'private' : (match[2].startsWith('_') ? 'protected' : 'public'),
|
|
427
|
+
signature: trimmed
|
|
428
|
+
});
|
|
429
|
+
definitions.push(def);
|
|
430
|
+
// Push to stack so nested functions inside this one get tracked
|
|
431
|
+
definitionStack.push({ def, indentLevel: funcIndent });
|
|
432
|
+
continue;
|
|
433
|
+
}
|
|
434
|
+
// Check for module-level variable (SCREAMING_CASE = constant)
|
|
435
|
+
if (indent === 0) {
|
|
436
|
+
match = trimmed.match(patterns.variable);
|
|
437
|
+
if (match && match[1][0] === match[1][0].toUpperCase()) {
|
|
438
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
439
|
+
name: match[1],
|
|
440
|
+
definitionType: 'constant',
|
|
441
|
+
startLine: i + 1,
|
|
442
|
+
language,
|
|
443
|
+
signature: trimmed
|
|
444
|
+
}));
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* extractGoDefinitions - extracts Go definitions
|
|
451
|
+
*/
|
|
452
|
+
extractGoDefinitions(fileId, filePath, lines, language, definitions) {
|
|
453
|
+
const patterns = {
|
|
454
|
+
function: /^func\s+(\w+)\s*\(([^)]*)\)(?:\s*\(([^)]*)\)|\s*([^\{]+))?/,
|
|
455
|
+
method: /^func\s+\((\w+)\s+\*?(\w+)\)\s+(\w+)\s*\(([^)]*)\)(?:\s*\(([^)]*)\)|\s*([^\{]+))?/,
|
|
456
|
+
struct: /^type\s+(\w+)\s+struct\s*\{/,
|
|
457
|
+
interface: /^type\s+(\w+)\s+interface\s*\{/,
|
|
458
|
+
type: /^type\s+(\w+)\s+/,
|
|
459
|
+
constant: /^const\s+(\w+)\s*(?:(\w+))?\s*=/,
|
|
460
|
+
variable: /^var\s+(\w+)\s+/
|
|
461
|
+
};
|
|
462
|
+
for (let i = 0; i < lines.length; i++) {
|
|
463
|
+
const line = lines[i];
|
|
464
|
+
const trimmed = line.trim();
|
|
465
|
+
// Skip comments and empty lines
|
|
466
|
+
if (trimmed.startsWith('//') || trimmed === '') {
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
// Check for method (has receiver)
|
|
470
|
+
let match = line.match(patterns.method);
|
|
471
|
+
if (match) {
|
|
472
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
473
|
+
name: match[3],
|
|
474
|
+
qualifiedName: `${match[2]}.${match[3]}`,
|
|
475
|
+
definitionType: 'method',
|
|
476
|
+
startLine: i + 1,
|
|
477
|
+
language,
|
|
478
|
+
isExported: match[3][0] === match[3][0].toUpperCase(),
|
|
479
|
+
signature: trimmed
|
|
480
|
+
}));
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
// Check for function
|
|
484
|
+
match = line.match(patterns.function);
|
|
485
|
+
if (match) {
|
|
486
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
487
|
+
name: match[1],
|
|
488
|
+
definitionType: 'function',
|
|
489
|
+
startLine: i + 1,
|
|
490
|
+
language,
|
|
491
|
+
isExported: match[1][0] === match[1][0].toUpperCase(),
|
|
492
|
+
signature: trimmed
|
|
493
|
+
}));
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
// Check for struct
|
|
497
|
+
match = line.match(patterns.struct);
|
|
498
|
+
if (match) {
|
|
499
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
500
|
+
name: match[1],
|
|
501
|
+
definitionType: 'struct',
|
|
502
|
+
startLine: i + 1,
|
|
503
|
+
language,
|
|
504
|
+
isExported: match[1][0] === match[1][0].toUpperCase(),
|
|
505
|
+
signature: trimmed
|
|
506
|
+
}));
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
// Check for interface
|
|
510
|
+
match = line.match(patterns.interface);
|
|
511
|
+
if (match) {
|
|
512
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
513
|
+
name: match[1],
|
|
514
|
+
definitionType: 'interface',
|
|
515
|
+
startLine: i + 1,
|
|
516
|
+
language,
|
|
517
|
+
isExported: match[1][0] === match[1][0].toUpperCase(),
|
|
518
|
+
signature: trimmed
|
|
519
|
+
}));
|
|
520
|
+
continue;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* extractRustDefinitions - extracts Rust definitions
|
|
526
|
+
*/
|
|
527
|
+
extractRustDefinitions(fileId, filePath, lines, language, definitions) {
|
|
528
|
+
const patterns = {
|
|
529
|
+
function: /^(?:pub\s+)?(?:async\s+)?fn\s+(\w+)(?:<[^>]*>)?\s*\(([^)]*)\)(?:\s*->\s*([^\{]+))?/,
|
|
530
|
+
struct: /^(?:pub\s+)?struct\s+(\w+)/,
|
|
531
|
+
enum: /^(?:pub\s+)?enum\s+(\w+)/,
|
|
532
|
+
trait: /^(?:pub\s+)?trait\s+(\w+)/,
|
|
533
|
+
impl: /^impl(?:<[^>]*>)?\s+(?:(\w+)\s+for\s+)?(\w+)/,
|
|
534
|
+
constant: /^(?:pub\s+)?const\s+(\w+)\s*:/,
|
|
535
|
+
static: /^(?:pub\s+)?static\s+(\w+)\s*:/
|
|
536
|
+
};
|
|
537
|
+
for (let i = 0; i < lines.length; i++) {
|
|
538
|
+
const line = lines[i];
|
|
539
|
+
const trimmed = line.trim();
|
|
540
|
+
// Skip comments
|
|
541
|
+
if (trimmed.startsWith('//') || trimmed === '') {
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
// Check for function
|
|
545
|
+
let match = line.match(patterns.function);
|
|
546
|
+
if (match) {
|
|
547
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
548
|
+
name: match[1],
|
|
549
|
+
definitionType: 'function',
|
|
550
|
+
startLine: i + 1,
|
|
551
|
+
language,
|
|
552
|
+
isExported: line.includes('pub'),
|
|
553
|
+
isAsync: line.includes('async'),
|
|
554
|
+
returnType: match[3]?.trim(),
|
|
555
|
+
signature: trimmed
|
|
556
|
+
}));
|
|
557
|
+
continue;
|
|
558
|
+
}
|
|
559
|
+
// Check for struct
|
|
560
|
+
match = line.match(patterns.struct);
|
|
561
|
+
if (match) {
|
|
562
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
563
|
+
name: match[1],
|
|
564
|
+
definitionType: 'struct',
|
|
565
|
+
startLine: i + 1,
|
|
566
|
+
language,
|
|
567
|
+
isExported: line.includes('pub'),
|
|
568
|
+
signature: trimmed
|
|
569
|
+
}));
|
|
570
|
+
continue;
|
|
571
|
+
}
|
|
572
|
+
// Check for enum
|
|
573
|
+
match = line.match(patterns.enum);
|
|
574
|
+
if (match) {
|
|
575
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
576
|
+
name: match[1],
|
|
577
|
+
definitionType: 'enum',
|
|
578
|
+
startLine: i + 1,
|
|
579
|
+
language,
|
|
580
|
+
isExported: line.includes('pub'),
|
|
581
|
+
signature: trimmed
|
|
582
|
+
}));
|
|
583
|
+
continue;
|
|
584
|
+
}
|
|
585
|
+
// Check for trait
|
|
586
|
+
match = line.match(patterns.trait);
|
|
587
|
+
if (match) {
|
|
588
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
589
|
+
name: match[1],
|
|
590
|
+
definitionType: 'trait',
|
|
591
|
+
startLine: i + 1,
|
|
592
|
+
language,
|
|
593
|
+
isExported: line.includes('pub'),
|
|
594
|
+
signature: trimmed
|
|
595
|
+
}));
|
|
596
|
+
continue;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* extractGenericDefinitions - generic extraction for unknown languages
|
|
602
|
+
*/
|
|
603
|
+
extractGenericDefinitions(fileId, filePath, lines, language, definitions) {
|
|
604
|
+
// Basic patterns that work across many languages
|
|
605
|
+
const patterns = {
|
|
606
|
+
function: /(?:function|func|def|fn|sub)\s+(\w+)/,
|
|
607
|
+
class: /(?:class|struct|type)\s+(\w+)/
|
|
608
|
+
};
|
|
609
|
+
for (let i = 0; i < lines.length; i++) {
|
|
610
|
+
const line = lines[i];
|
|
611
|
+
const trimmed = line.trim();
|
|
612
|
+
let match = line.match(patterns.function);
|
|
613
|
+
if (match) {
|
|
614
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
615
|
+
name: match[1],
|
|
616
|
+
definitionType: 'function',
|
|
617
|
+
startLine: i + 1,
|
|
618
|
+
language,
|
|
619
|
+
signature: trimmed
|
|
620
|
+
}));
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
match = line.match(patterns.class);
|
|
624
|
+
if (match) {
|
|
625
|
+
definitions.push(this.createDefinition(fileId, filePath, {
|
|
626
|
+
name: match[1],
|
|
627
|
+
definitionType: 'class',
|
|
628
|
+
startLine: i + 1,
|
|
629
|
+
language,
|
|
630
|
+
signature: trimmed
|
|
631
|
+
}));
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
// ========================================
|
|
636
|
+
// DEPENDENCY EXTRACTION
|
|
637
|
+
// ========================================
|
|
638
|
+
/**
|
|
639
|
+
* extractDependencies - extracts import/require statements
|
|
640
|
+
*/
|
|
641
|
+
extractDependencies(fileId, filePath, content, language) {
|
|
642
|
+
const dependencies = [];
|
|
643
|
+
const lines = content.split('\n');
|
|
644
|
+
switch (language) {
|
|
645
|
+
case 'typescript':
|
|
646
|
+
case 'typescript-react':
|
|
647
|
+
case 'javascript':
|
|
648
|
+
case 'javascript-react':
|
|
649
|
+
this.extractTSJSDependencies(fileId, filePath, lines, language, dependencies);
|
|
650
|
+
break;
|
|
651
|
+
case 'python':
|
|
652
|
+
this.extractPythonDependencies(fileId, filePath, lines, language, dependencies);
|
|
653
|
+
break;
|
|
654
|
+
case 'go':
|
|
655
|
+
this.extractGoDependencies(fileId, filePath, lines, language, dependencies);
|
|
656
|
+
break;
|
|
657
|
+
case 'rust':
|
|
658
|
+
this.extractRustDependencies(fileId, filePath, lines, language, dependencies);
|
|
659
|
+
break;
|
|
660
|
+
default:
|
|
661
|
+
// Try generic patterns
|
|
662
|
+
this.extractGenericDependencies(fileId, filePath, lines, language, dependencies);
|
|
663
|
+
}
|
|
664
|
+
return dependencies;
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* extractTSJSDependencies - extracts TypeScript/JavaScript imports
|
|
668
|
+
*/
|
|
669
|
+
extractTSJSDependencies(fileId, filePath, lines, language, dependencies) {
|
|
670
|
+
const patterns = {
|
|
671
|
+
// import { foo, bar } from 'module'
|
|
672
|
+
namedImport: /^import\s+\{([^}]+)\}\s+from\s+['"]([^'"]+)['"]/,
|
|
673
|
+
// import foo from 'module'
|
|
674
|
+
defaultImport: /^import\s+(\w+)\s+from\s+['"]([^'"]+)['"]/,
|
|
675
|
+
// import * as foo from 'module'
|
|
676
|
+
namespaceImport: /^import\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]/,
|
|
677
|
+
// import 'module' (side effect)
|
|
678
|
+
sideEffectImport: /^import\s+['"]([^'"]+)['"]/,
|
|
679
|
+
// import type { foo } from 'module'
|
|
680
|
+
typeImport: /^import\s+type\s+\{([^}]+)\}\s+from\s+['"]([^'"]+)['"]/,
|
|
681
|
+
// const foo = require('module')
|
|
682
|
+
require: /(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))\s*=\s*require\s*\(\s*['"]([^'"]+)['"]\s*\)/,
|
|
683
|
+
// Dynamic import: import('module')
|
|
684
|
+
dynamicImport: /import\s*\(\s*['"]([^'"]+)['"]\s*\)/,
|
|
685
|
+
// export { foo } from 'module' (re-export)
|
|
686
|
+
reexport: /^export\s+\{([^}]+)\}\s+from\s+['"]([^'"]+)['"]/
|
|
687
|
+
};
|
|
688
|
+
for (let i = 0; i < lines.length; i++) {
|
|
689
|
+
const line = lines[i];
|
|
690
|
+
const trimmed = line.trim();
|
|
691
|
+
// Type import
|
|
692
|
+
let match = trimmed.match(patterns.typeImport);
|
|
693
|
+
if (match) {
|
|
694
|
+
const names = match[1].split(',').map(n => n.trim());
|
|
695
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
696
|
+
targetPath: match[2],
|
|
697
|
+
importType: 'import_type',
|
|
698
|
+
importStatement: trimmed,
|
|
699
|
+
importedNames: names,
|
|
700
|
+
isTypeImport: true,
|
|
701
|
+
lineNumber: i + 1,
|
|
702
|
+
language,
|
|
703
|
+
...this.classifyImport(match[2])
|
|
704
|
+
}));
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
707
|
+
// Named import
|
|
708
|
+
match = trimmed.match(patterns.namedImport);
|
|
709
|
+
if (match) {
|
|
710
|
+
const names = match[1].split(',').map(n => n.trim().split(/\s+as\s+/)[0]);
|
|
711
|
+
const aliases = match[1].split(',').map(n => {
|
|
712
|
+
const parts = n.trim().split(/\s+as\s+/);
|
|
713
|
+
return parts[1] || parts[0];
|
|
714
|
+
});
|
|
715
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
716
|
+
targetPath: match[2],
|
|
717
|
+
importType: 'import',
|
|
718
|
+
importStatement: trimmed,
|
|
719
|
+
importedNames: names,
|
|
720
|
+
importedAs: aliases,
|
|
721
|
+
lineNumber: i + 1,
|
|
722
|
+
language,
|
|
723
|
+
...this.classifyImport(match[2])
|
|
724
|
+
}));
|
|
725
|
+
continue;
|
|
726
|
+
}
|
|
727
|
+
// Namespace import
|
|
728
|
+
match = trimmed.match(patterns.namespaceImport);
|
|
729
|
+
if (match) {
|
|
730
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
731
|
+
targetPath: match[2],
|
|
732
|
+
importType: 'import',
|
|
733
|
+
importStatement: trimmed,
|
|
734
|
+
importedAs: [match[1]],
|
|
735
|
+
isNamespaceImport: true,
|
|
736
|
+
lineNumber: i + 1,
|
|
737
|
+
language,
|
|
738
|
+
...this.classifyImport(match[2])
|
|
739
|
+
}));
|
|
740
|
+
continue;
|
|
741
|
+
}
|
|
742
|
+
// Default import
|
|
743
|
+
match = trimmed.match(patterns.defaultImport);
|
|
744
|
+
if (match) {
|
|
745
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
746
|
+
targetPath: match[2],
|
|
747
|
+
importType: 'import',
|
|
748
|
+
importStatement: trimmed,
|
|
749
|
+
importedAs: [match[1]],
|
|
750
|
+
isDefaultImport: true,
|
|
751
|
+
lineNumber: i + 1,
|
|
752
|
+
language,
|
|
753
|
+
...this.classifyImport(match[2])
|
|
754
|
+
}));
|
|
755
|
+
continue;
|
|
756
|
+
}
|
|
757
|
+
// Side effect import
|
|
758
|
+
match = trimmed.match(patterns.sideEffectImport);
|
|
759
|
+
if (match && !trimmed.includes('from')) {
|
|
760
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
761
|
+
targetPath: match[1],
|
|
762
|
+
importType: 'side_effect',
|
|
763
|
+
importStatement: trimmed,
|
|
764
|
+
isSideEffectImport: true,
|
|
765
|
+
lineNumber: i + 1,
|
|
766
|
+
language,
|
|
767
|
+
...this.classifyImport(match[1])
|
|
768
|
+
}));
|
|
769
|
+
continue;
|
|
770
|
+
}
|
|
771
|
+
// Require
|
|
772
|
+
match = trimmed.match(patterns.require);
|
|
773
|
+
if (match) {
|
|
774
|
+
const target = match[3];
|
|
775
|
+
const names = match[1] ? match[1].split(',').map(n => n.trim()) : [];
|
|
776
|
+
const alias = match[2];
|
|
777
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
778
|
+
targetPath: target,
|
|
779
|
+
importType: 'require',
|
|
780
|
+
importStatement: trimmed,
|
|
781
|
+
importedNames: names,
|
|
782
|
+
importedAs: alias ? [alias] : [],
|
|
783
|
+
isDefaultImport: !!alias,
|
|
784
|
+
lineNumber: i + 1,
|
|
785
|
+
language,
|
|
786
|
+
...this.classifyImport(target)
|
|
787
|
+
}));
|
|
788
|
+
continue;
|
|
789
|
+
}
|
|
790
|
+
// Dynamic import
|
|
791
|
+
match = trimmed.match(patterns.dynamicImport);
|
|
792
|
+
if (match) {
|
|
793
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
794
|
+
targetPath: match[1],
|
|
795
|
+
importType: 'dynamic',
|
|
796
|
+
importStatement: trimmed,
|
|
797
|
+
isDynamic: true,
|
|
798
|
+
lineNumber: i + 1,
|
|
799
|
+
language,
|
|
800
|
+
...this.classifyImport(match[1])
|
|
801
|
+
}));
|
|
802
|
+
continue;
|
|
803
|
+
}
|
|
804
|
+
// Re-export
|
|
805
|
+
match = trimmed.match(patterns.reexport);
|
|
806
|
+
if (match) {
|
|
807
|
+
const names = match[1].split(',').map(n => n.trim());
|
|
808
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
809
|
+
targetPath: match[2],
|
|
810
|
+
importType: 'reexport',
|
|
811
|
+
importStatement: trimmed,
|
|
812
|
+
importedNames: names,
|
|
813
|
+
lineNumber: i + 1,
|
|
814
|
+
language,
|
|
815
|
+
...this.classifyImport(match[2])
|
|
816
|
+
}));
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* extractPythonDependencies - extracts Python imports
|
|
822
|
+
*/
|
|
823
|
+
extractPythonDependencies(fileId, filePath, lines, language, dependencies) {
|
|
824
|
+
const patterns = {
|
|
825
|
+
// from module import foo, bar
|
|
826
|
+
fromImport: /^from\s+([\w.]+)\s+import\s+(.+)/,
|
|
827
|
+
// import module
|
|
828
|
+
import: /^import\s+([\w.]+)(?:\s+as\s+(\w+))?/
|
|
829
|
+
};
|
|
830
|
+
for (let i = 0; i < lines.length; i++) {
|
|
831
|
+
const line = lines[i];
|
|
832
|
+
const trimmed = line.trim();
|
|
833
|
+
// from import
|
|
834
|
+
let match = trimmed.match(patterns.fromImport);
|
|
835
|
+
if (match) {
|
|
836
|
+
const names = match[2].split(',').map(n => n.trim().split(/\s+as\s+/)[0]);
|
|
837
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
838
|
+
targetPath: match[1],
|
|
839
|
+
importType: 'from',
|
|
840
|
+
importStatement: trimmed,
|
|
841
|
+
importedNames: names,
|
|
842
|
+
lineNumber: i + 1,
|
|
843
|
+
language,
|
|
844
|
+
isExternal: !match[1].startsWith('.'),
|
|
845
|
+
isRelative: match[1].startsWith('.')
|
|
846
|
+
}));
|
|
847
|
+
continue;
|
|
848
|
+
}
|
|
849
|
+
// simple import
|
|
850
|
+
match = trimmed.match(patterns.import);
|
|
851
|
+
if (match) {
|
|
852
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
853
|
+
targetPath: match[1],
|
|
854
|
+
importType: 'import',
|
|
855
|
+
importStatement: trimmed,
|
|
856
|
+
importedAs: match[2] ? [match[2]] : [],
|
|
857
|
+
lineNumber: i + 1,
|
|
858
|
+
language,
|
|
859
|
+
isExternal: !match[1].startsWith('.'),
|
|
860
|
+
isRelative: match[1].startsWith('.')
|
|
861
|
+
}));
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* extractGoDependencies - extracts Go imports
|
|
867
|
+
*/
|
|
868
|
+
extractGoDependencies(fileId, filePath, lines, language, dependencies) {
|
|
869
|
+
const patterns = {
|
|
870
|
+
singleImport: /^import\s+(?:(\w+)\s+)?["']([^"']+)["']/,
|
|
871
|
+
blockStart: /^import\s*\(/
|
|
872
|
+
};
|
|
873
|
+
let inBlock = false;
|
|
874
|
+
for (let i = 0; i < lines.length; i++) {
|
|
875
|
+
const line = lines[i];
|
|
876
|
+
const trimmed = line.trim();
|
|
877
|
+
if (trimmed.match(patterns.blockStart)) {
|
|
878
|
+
inBlock = true;
|
|
879
|
+
continue;
|
|
880
|
+
}
|
|
881
|
+
if (inBlock && trimmed === ')') {
|
|
882
|
+
inBlock = false;
|
|
883
|
+
continue;
|
|
884
|
+
}
|
|
885
|
+
if (inBlock) {
|
|
886
|
+
const match = trimmed.match(/^(?:(\w+)\s+)?["']([^"']+)["']/);
|
|
887
|
+
if (match) {
|
|
888
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
889
|
+
targetPath: match[2],
|
|
890
|
+
importType: 'import',
|
|
891
|
+
importStatement: trimmed,
|
|
892
|
+
importedAs: match[1] ? [match[1]] : [],
|
|
893
|
+
lineNumber: i + 1,
|
|
894
|
+
language,
|
|
895
|
+
isExternal: !match[2].startsWith('.')
|
|
896
|
+
}));
|
|
897
|
+
}
|
|
898
|
+
continue;
|
|
899
|
+
}
|
|
900
|
+
const match = trimmed.match(patterns.singleImport);
|
|
901
|
+
if (match) {
|
|
902
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
903
|
+
targetPath: match[2],
|
|
904
|
+
importType: 'import',
|
|
905
|
+
importStatement: trimmed,
|
|
906
|
+
importedAs: match[1] ? [match[1]] : [],
|
|
907
|
+
lineNumber: i + 1,
|
|
908
|
+
language,
|
|
909
|
+
isExternal: !match[2].startsWith('.')
|
|
910
|
+
}));
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* extractRustDependencies - extracts Rust use statements
|
|
916
|
+
*/
|
|
917
|
+
extractRustDependencies(fileId, filePath, lines, language, dependencies) {
|
|
918
|
+
const patterns = {
|
|
919
|
+
use: /^use\s+([\w:]+)(?:::\{([^}]+)\})?(?:\s+as\s+(\w+))?;/,
|
|
920
|
+
extern: /^extern\s+crate\s+(\w+)/
|
|
921
|
+
};
|
|
922
|
+
for (let i = 0; i < lines.length; i++) {
|
|
923
|
+
const line = lines[i];
|
|
924
|
+
const trimmed = line.trim();
|
|
925
|
+
let match = trimmed.match(patterns.use);
|
|
926
|
+
if (match) {
|
|
927
|
+
const names = match[2] ? match[2].split(',').map(n => n.trim()) : [];
|
|
928
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
929
|
+
targetPath: match[1],
|
|
930
|
+
importType: 'import',
|
|
931
|
+
importStatement: trimmed,
|
|
932
|
+
importedNames: names,
|
|
933
|
+
importedAs: match[3] ? [match[3]] : [],
|
|
934
|
+
lineNumber: i + 1,
|
|
935
|
+
language,
|
|
936
|
+
isExternal: !match[1].startsWith('crate') && !match[1].startsWith('self') && !match[1].startsWith('super')
|
|
937
|
+
}));
|
|
938
|
+
continue;
|
|
939
|
+
}
|
|
940
|
+
match = trimmed.match(patterns.extern);
|
|
941
|
+
if (match) {
|
|
942
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
943
|
+
targetPath: match[1],
|
|
944
|
+
importType: 'import',
|
|
945
|
+
importStatement: trimmed,
|
|
946
|
+
packageName: match[1],
|
|
947
|
+
lineNumber: i + 1,
|
|
948
|
+
language,
|
|
949
|
+
isExternal: true
|
|
950
|
+
}));
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* extractGenericDependencies - generic extraction for unknown languages
|
|
956
|
+
*/
|
|
957
|
+
extractGenericDependencies(fileId, filePath, lines, language, dependencies) {
|
|
958
|
+
const patterns = {
|
|
959
|
+
import: /(?:import|include|require|use)\s+['"]?([^\s'"]+)['"]?/
|
|
960
|
+
};
|
|
961
|
+
for (let i = 0; i < lines.length; i++) {
|
|
962
|
+
const line = lines[i];
|
|
963
|
+
const trimmed = line.trim();
|
|
964
|
+
const match = trimmed.match(patterns.import);
|
|
965
|
+
if (match) {
|
|
966
|
+
dependencies.push(this.createDependency(fileId, filePath, {
|
|
967
|
+
targetPath: match[1],
|
|
968
|
+
importType: 'import',
|
|
969
|
+
importStatement: trimmed,
|
|
970
|
+
lineNumber: i + 1,
|
|
971
|
+
language
|
|
972
|
+
}));
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
// ========================================
|
|
977
|
+
// CODE CHUNKING
|
|
978
|
+
// ========================================
|
|
979
|
+
/**
|
|
980
|
+
* createChunks - splits code into chunks for semantic search
|
|
981
|
+
*/
|
|
982
|
+
createChunks(fileId, filePath, content, language, lines) {
|
|
983
|
+
const chunks = [];
|
|
984
|
+
// Don't chunk small files
|
|
985
|
+
if (lines.length <= this.chunkSize) {
|
|
986
|
+
chunks.push(this.createChunk(fileId, filePath, {
|
|
987
|
+
chunkIndex: 0,
|
|
988
|
+
startLine: 1,
|
|
989
|
+
endLine: lines.length,
|
|
990
|
+
startChar: 0,
|
|
991
|
+
endChar: content.length,
|
|
992
|
+
content,
|
|
993
|
+
language,
|
|
994
|
+
chunkType: 'code'
|
|
995
|
+
}));
|
|
996
|
+
return chunks;
|
|
997
|
+
}
|
|
998
|
+
// Create overlapping chunks
|
|
999
|
+
let chunkIndex = 0;
|
|
1000
|
+
let currentLine = 0;
|
|
1001
|
+
while (currentLine < lines.length) {
|
|
1002
|
+
const startLine = currentLine;
|
|
1003
|
+
const endLine = Math.min(currentLine + this.chunkSize, lines.length);
|
|
1004
|
+
const chunkLines = lines.slice(startLine, endLine);
|
|
1005
|
+
const chunkContent = chunkLines.join('\n');
|
|
1006
|
+
// Calculate character positions
|
|
1007
|
+
const startChar = lines.slice(0, startLine).join('\n').length + (startLine > 0 ? 1 : 0);
|
|
1008
|
+
const endChar = startChar + chunkContent.length;
|
|
1009
|
+
// Get context
|
|
1010
|
+
const contextBefore = startLine > 0
|
|
1011
|
+
? lines.slice(Math.max(0, startLine - 3), startLine).join('\n')
|
|
1012
|
+
: undefined;
|
|
1013
|
+
const contextAfter = endLine < lines.length
|
|
1014
|
+
? lines.slice(endLine, Math.min(lines.length, endLine + 3)).join('\n')
|
|
1015
|
+
: undefined;
|
|
1016
|
+
// Determine chunk type
|
|
1017
|
+
const chunkType = this.determineChunkType(chunkContent, language);
|
|
1018
|
+
chunks.push(this.createChunk(fileId, filePath, {
|
|
1019
|
+
chunkIndex,
|
|
1020
|
+
startLine: startLine + 1,
|
|
1021
|
+
endLine,
|
|
1022
|
+
startChar,
|
|
1023
|
+
endChar,
|
|
1024
|
+
content: chunkContent,
|
|
1025
|
+
language,
|
|
1026
|
+
chunkType,
|
|
1027
|
+
contextBefore,
|
|
1028
|
+
contextAfter
|
|
1029
|
+
}));
|
|
1030
|
+
chunkIndex++;
|
|
1031
|
+
currentLine += this.chunkSize - this.chunkOverlap;
|
|
1032
|
+
}
|
|
1033
|
+
return chunks;
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* determineChunkType - determines the type of a code chunk
|
|
1037
|
+
*/
|
|
1038
|
+
determineChunkType(content, language) {
|
|
1039
|
+
const lines = content.split('\n');
|
|
1040
|
+
let codeLines = 0;
|
|
1041
|
+
let commentLines = 0;
|
|
1042
|
+
let importLines = 0;
|
|
1043
|
+
for (const line of lines) {
|
|
1044
|
+
const trimmed = line.trim();
|
|
1045
|
+
if (trimmed === '')
|
|
1046
|
+
continue;
|
|
1047
|
+
if (this.isComment(trimmed, language)) {
|
|
1048
|
+
commentLines++;
|
|
1049
|
+
}
|
|
1050
|
+
else if (this.isImport(trimmed, language)) {
|
|
1051
|
+
importLines++;
|
|
1052
|
+
}
|
|
1053
|
+
else {
|
|
1054
|
+
codeLines++;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
const total = codeLines + commentLines + importLines;
|
|
1058
|
+
if (total === 0)
|
|
1059
|
+
return 'code';
|
|
1060
|
+
if (importLines / total > 0.7)
|
|
1061
|
+
return 'import';
|
|
1062
|
+
if (commentLines / total > 0.7)
|
|
1063
|
+
return 'comment';
|
|
1064
|
+
if (codeLines / total > 0.7)
|
|
1065
|
+
return 'code';
|
|
1066
|
+
return 'mixed';
|
|
1067
|
+
}
|
|
1068
|
+
// ========================================
|
|
1069
|
+
// COMPLEXITY CALCULATION
|
|
1070
|
+
// ========================================
|
|
1071
|
+
/**
|
|
1072
|
+
* calculateComplexity - calculates complexity metrics for a file
|
|
1073
|
+
*/
|
|
1074
|
+
calculateComplexity(fileId, filePath, content, language, lines) {
|
|
1075
|
+
let linesOfCode = 0;
|
|
1076
|
+
let commentLines = 0;
|
|
1077
|
+
let blankLines = 0;
|
|
1078
|
+
let cyclomaticComplexity = 1; // Base complexity
|
|
1079
|
+
let nestingDepth = 0;
|
|
1080
|
+
let maxNestingDepth = 0;
|
|
1081
|
+
let returnStatements = 0;
|
|
1082
|
+
const issues = [];
|
|
1083
|
+
for (const line of lines) {
|
|
1084
|
+
const trimmed = line.trim();
|
|
1085
|
+
if (trimmed === '') {
|
|
1086
|
+
blankLines++;
|
|
1087
|
+
continue;
|
|
1088
|
+
}
|
|
1089
|
+
if (this.isComment(trimmed, language)) {
|
|
1090
|
+
commentLines++;
|
|
1091
|
+
continue;
|
|
1092
|
+
}
|
|
1093
|
+
linesOfCode++;
|
|
1094
|
+
// Track nesting depth
|
|
1095
|
+
const openBraces = (line.match(/\{/g) || []).length;
|
|
1096
|
+
const closeBraces = (line.match(/\}/g) || []).length;
|
|
1097
|
+
nestingDepth += openBraces - closeBraces;
|
|
1098
|
+
maxNestingDepth = Math.max(maxNestingDepth, nestingDepth);
|
|
1099
|
+
// Count decision points for cyclomatic complexity
|
|
1100
|
+
cyclomaticComplexity += (line.match(/\b(if|else if|elif|for|while|catch|case|&&|\|\||\?)/g) || []).length;
|
|
1101
|
+
// Count return statements
|
|
1102
|
+
returnStatements += (line.match(/\breturn\b/g) || []).length;
|
|
1103
|
+
}
|
|
1104
|
+
// Check for complexity issues
|
|
1105
|
+
if (cyclomaticComplexity > 10) {
|
|
1106
|
+
issues.push({
|
|
1107
|
+
type: 'high_cyclomatic_complexity',
|
|
1108
|
+
severity: cyclomaticComplexity > 20 ? 'error' : 'warning',
|
|
1109
|
+
message: `High cyclomatic complexity: ${cyclomaticComplexity}`
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1112
|
+
if (maxNestingDepth > 4) {
|
|
1113
|
+
issues.push({
|
|
1114
|
+
type: 'deep_nesting',
|
|
1115
|
+
severity: maxNestingDepth > 6 ? 'error' : 'warning',
|
|
1116
|
+
message: `Deep nesting detected: ${maxNestingDepth} levels`
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
if (linesOfCode > 300) {
|
|
1120
|
+
issues.push({
|
|
1121
|
+
type: 'long_file',
|
|
1122
|
+
severity: linesOfCode > 500 ? 'error' : 'warning',
|
|
1123
|
+
message: `File is too long: ${linesOfCode} lines`
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
// Calculate maintainability index (simplified version)
|
|
1127
|
+
// MI = 171 - 5.2 * ln(HV) - 0.23 * CC - 16.2 * ln(LOC)
|
|
1128
|
+
const halsteadVolume = Math.max(1, linesOfCode * 10); // Simplified
|
|
1129
|
+
const maintainabilityIndex = Math.max(0, Math.min(100, 171 - 5.2 * Math.log(halsteadVolume) - 0.23 * cyclomaticComplexity - 16.2 * Math.log(Math.max(1, linesOfCode))));
|
|
1130
|
+
return {
|
|
1131
|
+
id: uuidv4(),
|
|
1132
|
+
fileId,
|
|
1133
|
+
filePath,
|
|
1134
|
+
scopeType: 'file',
|
|
1135
|
+
linesOfCode,
|
|
1136
|
+
logicalLines: linesOfCode,
|
|
1137
|
+
commentLines,
|
|
1138
|
+
blankLines,
|
|
1139
|
+
cyclomaticComplexity,
|
|
1140
|
+
cognitiveComplexity: cyclomaticComplexity, // Simplified
|
|
1141
|
+
halsteadVolume,
|
|
1142
|
+
maintainabilityIndex,
|
|
1143
|
+
returnStatementCount: returnStatements,
|
|
1144
|
+
nestingDepth: maxNestingDepth,
|
|
1145
|
+
issuesCount: issues.length,
|
|
1146
|
+
issues,
|
|
1147
|
+
duplicateBlocks: 0,
|
|
1148
|
+
duplicateLines: 0,
|
|
1149
|
+
language,
|
|
1150
|
+
metadata: {},
|
|
1151
|
+
analyzedAt: new Date(),
|
|
1152
|
+
analyzerVersion: this.analyzerVersion
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
// ========================================
|
|
1156
|
+
// HELPER METHODS
|
|
1157
|
+
// ========================================
|
|
1158
|
+
createDefinition(fileId, filePath, data) {
|
|
1159
|
+
return {
|
|
1160
|
+
id: uuidv4(),
|
|
1161
|
+
fileId,
|
|
1162
|
+
filePath,
|
|
1163
|
+
name: data.name || 'unknown',
|
|
1164
|
+
qualifiedName: data.qualifiedName,
|
|
1165
|
+
definitionType: data.definitionType || 'function',
|
|
1166
|
+
startLine: data.startLine || 1,
|
|
1167
|
+
endLine: data.endLine || data.startLine || 1,
|
|
1168
|
+
startColumn: data.startColumn,
|
|
1169
|
+
endColumn: data.endColumn,
|
|
1170
|
+
signature: data.signature,
|
|
1171
|
+
docstring: data.docstring,
|
|
1172
|
+
returnType: data.returnType,
|
|
1173
|
+
visibility: data.visibility || 'public',
|
|
1174
|
+
isExported: data.isExported || false,
|
|
1175
|
+
isAsync: data.isAsync || false,
|
|
1176
|
+
isStatic: data.isStatic || false,
|
|
1177
|
+
isAbstract: data.isAbstract || false,
|
|
1178
|
+
parentDefinitionId: data.parentDefinitionId,
|
|
1179
|
+
parameters: data.parameters || [],
|
|
1180
|
+
language: data.language || 'unknown',
|
|
1181
|
+
decorators: data.decorators || [],
|
|
1182
|
+
metadata: data.metadata || {}
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
createDependency(fileId, filePath, data) {
|
|
1186
|
+
return {
|
|
1187
|
+
id: uuidv4(),
|
|
1188
|
+
sourceFileId: fileId,
|
|
1189
|
+
sourceFilePath: filePath,
|
|
1190
|
+
targetPath: data.targetPath || '',
|
|
1191
|
+
resolvedPath: data.resolvedPath,
|
|
1192
|
+
targetFileId: data.targetFileId,
|
|
1193
|
+
importType: data.importType || 'import',
|
|
1194
|
+
importStatement: data.importStatement || '',
|
|
1195
|
+
importedNames: data.importedNames || [],
|
|
1196
|
+
importedAs: data.importedAs || [],
|
|
1197
|
+
isDefaultImport: data.isDefaultImport || false,
|
|
1198
|
+
isNamespaceImport: data.isNamespaceImport || false,
|
|
1199
|
+
isTypeImport: data.isTypeImport || false,
|
|
1200
|
+
isSideEffectImport: data.isSideEffectImport || false,
|
|
1201
|
+
lineNumber: data.lineNumber || 1,
|
|
1202
|
+
columnNumber: data.columnNumber,
|
|
1203
|
+
isExternal: data.isExternal || false,
|
|
1204
|
+
isBuiltin: data.isBuiltin || false,
|
|
1205
|
+
isRelative: data.isRelative || false,
|
|
1206
|
+
isAbsolute: data.isAbsolute || false,
|
|
1207
|
+
isDynamic: data.isDynamic || false,
|
|
1208
|
+
packageName: data.packageName,
|
|
1209
|
+
packageVersion: data.packageVersion,
|
|
1210
|
+
language: data.language || 'unknown',
|
|
1211
|
+
metadata: data.metadata || {}
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
createChunk(fileId, filePath, data) {
|
|
1215
|
+
return {
|
|
1216
|
+
id: uuidv4(),
|
|
1217
|
+
fileId,
|
|
1218
|
+
filePath,
|
|
1219
|
+
chunkIndex: data.chunkIndex || 0,
|
|
1220
|
+
startLine: data.startLine || 1,
|
|
1221
|
+
endLine: data.endLine || 1,
|
|
1222
|
+
startChar: data.startChar || 0,
|
|
1223
|
+
endChar: data.endChar || 0,
|
|
1224
|
+
content: data.content || '',
|
|
1225
|
+
language: data.language || 'unknown',
|
|
1226
|
+
chunkType: data.chunkType || 'code',
|
|
1227
|
+
contextBefore: data.contextBefore,
|
|
1228
|
+
contextAfter: data.contextAfter,
|
|
1229
|
+
metadata: data.metadata || {}
|
|
1230
|
+
};
|
|
1231
|
+
}
|
|
1232
|
+
parseParameters(paramString) {
|
|
1233
|
+
if (!paramString.trim())
|
|
1234
|
+
return [];
|
|
1235
|
+
return paramString.split(',').map(p => {
|
|
1236
|
+
const trimmed = p.trim();
|
|
1237
|
+
const [nameType, defaultValue] = trimmed.split('=').map(s => s.trim());
|
|
1238
|
+
const [name, type] = (nameType || '').split(':').map(s => s.trim());
|
|
1239
|
+
return {
|
|
1240
|
+
name: name || '',
|
|
1241
|
+
type: type,
|
|
1242
|
+
defaultValue: defaultValue,
|
|
1243
|
+
optional: trimmed.includes('?') || defaultValue !== undefined
|
|
1244
|
+
};
|
|
1245
|
+
}).filter(p => p.name);
|
|
1246
|
+
}
|
|
1247
|
+
parsePythonParameters(paramString) {
|
|
1248
|
+
if (!paramString.trim())
|
|
1249
|
+
return [];
|
|
1250
|
+
const params = [];
|
|
1251
|
+
for (const p of paramString.split(',')) {
|
|
1252
|
+
const trimmed = p.trim();
|
|
1253
|
+
if (trimmed === 'self' || trimmed === 'cls')
|
|
1254
|
+
continue;
|
|
1255
|
+
const [nameType, defaultValue] = trimmed.split('=').map(s => s.trim());
|
|
1256
|
+
const [name, type] = (nameType || '').split(':').map(s => s.trim());
|
|
1257
|
+
if (name) {
|
|
1258
|
+
params.push({
|
|
1259
|
+
name,
|
|
1260
|
+
type: type || undefined,
|
|
1261
|
+
defaultValue: defaultValue || undefined,
|
|
1262
|
+
optional: defaultValue !== undefined
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
return params;
|
|
1267
|
+
}
|
|
1268
|
+
detectVisibility(line) {
|
|
1269
|
+
if (line.includes('private'))
|
|
1270
|
+
return 'private';
|
|
1271
|
+
if (line.includes('protected'))
|
|
1272
|
+
return 'protected';
|
|
1273
|
+
if (line.includes('internal'))
|
|
1274
|
+
return 'internal';
|
|
1275
|
+
return 'public';
|
|
1276
|
+
}
|
|
1277
|
+
classifyImport(target) {
|
|
1278
|
+
const isRelative = target.startsWith('.') || target.startsWith('/');
|
|
1279
|
+
const isAbsolute = target.startsWith('/');
|
|
1280
|
+
const isBuiltin = ['fs', 'path', 'os', 'http', 'https', 'crypto', 'util', 'events', 'stream', 'buffer', 'url', 'querystring', 'child_process', 'cluster', 'dgram', 'dns', 'net', 'readline', 'repl', 'tls', 'tty', 'vm', 'zlib'].includes(target.split('/')[0]);
|
|
1281
|
+
const isExternal = !isRelative && !isBuiltin;
|
|
1282
|
+
const packageName = isExternal ? target.split('/')[0] : undefined;
|
|
1283
|
+
return {
|
|
1284
|
+
isRelative,
|
|
1285
|
+
isAbsolute,
|
|
1286
|
+
isBuiltin,
|
|
1287
|
+
isExternal,
|
|
1288
|
+
packageName: packageName?.startsWith('@') ? `${packageName}/${target.split('/')[1]}` : packageName
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
isComment(line, language) {
|
|
1292
|
+
switch (language) {
|
|
1293
|
+
case 'python':
|
|
1294
|
+
return line.startsWith('#');
|
|
1295
|
+
case 'typescript':
|
|
1296
|
+
case 'typescript-react':
|
|
1297
|
+
case 'javascript':
|
|
1298
|
+
case 'javascript-react':
|
|
1299
|
+
case 'go':
|
|
1300
|
+
case 'rust':
|
|
1301
|
+
case 'java':
|
|
1302
|
+
case 'c':
|
|
1303
|
+
case 'cpp':
|
|
1304
|
+
return line.startsWith('//') || line.startsWith('/*') || line.startsWith('*');
|
|
1305
|
+
default:
|
|
1306
|
+
return line.startsWith('//') || line.startsWith('#') || line.startsWith('/*');
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
isImport(line, language) {
|
|
1310
|
+
switch (language) {
|
|
1311
|
+
case 'python':
|
|
1312
|
+
return line.startsWith('import ') || line.startsWith('from ');
|
|
1313
|
+
case 'typescript':
|
|
1314
|
+
case 'typescript-react':
|
|
1315
|
+
case 'javascript':
|
|
1316
|
+
case 'javascript-react':
|
|
1317
|
+
return line.startsWith('import ') || line.includes('require(');
|
|
1318
|
+
case 'go':
|
|
1319
|
+
return line.startsWith('import ');
|
|
1320
|
+
case 'rust':
|
|
1321
|
+
return line.startsWith('use ') || line.startsWith('extern crate');
|
|
1322
|
+
default:
|
|
1323
|
+
return line.startsWith('import ') || line.startsWith('include ');
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
// Per-project analyzer instances - prevents cross-project pollution
|
|
1328
|
+
const analyzersByProject = new Map();
|
|
1329
|
+
/**
|
|
1330
|
+
* getCodeAnalyzer - returns project-scoped analyzer instance
|
|
1331
|
+
* uses Map<projectPath, CodeAnalyzer> pattern for proper isolation
|
|
1332
|
+
*/
|
|
1333
|
+
export function getCodeAnalyzer(options, projectPath) {
|
|
1334
|
+
const targetProject = projectPath || getProjectPath();
|
|
1335
|
+
if (!analyzersByProject.has(targetProject)) {
|
|
1336
|
+
analyzersByProject.set(targetProject, new CodeAnalyzer(options));
|
|
1337
|
+
}
|
|
1338
|
+
return analyzersByProject.get(targetProject);
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* resetCodeAnalyzer - resets the analyzer for a specific project (for testing)
|
|
1342
|
+
*/
|
|
1343
|
+
export function resetCodeAnalyzer(projectPath) {
|
|
1344
|
+
const targetProject = projectPath || getProjectPath();
|
|
1345
|
+
analyzersByProject.delete(targetProject);
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* resetAllCodeAnalyzers - resets all project analyzers (for testing)
|
|
1349
|
+
*/
|
|
1350
|
+
export function resetAllCodeAnalyzers() {
|
|
1351
|
+
analyzersByProject.clear();
|
|
1352
|
+
}
|
|
1353
|
+
//# sourceMappingURL=codeAnalyzer.js.map
|