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,1595 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// MEMORY BROWSER SCREEN - Full-screen two-panel memory browser for TUI
|
|
5
|
+
// ============================================================================
|
|
6
|
+
//
|
|
7
|
+
// A full-screen Memory Browser tab styled like AEGIS Trainer's ModelBrowserScreen.
|
|
8
|
+
// Two-panel horizontal split: memory list on the left, detail view on the right.
|
|
9
|
+
//
|
|
10
|
+
// Features:
|
|
11
|
+
// - Paginated memory list (25 per page) with colored type badges
|
|
12
|
+
// - Arrow key navigation with AEGIS-style cursor highlighting
|
|
13
|
+
// - Detail view with full content, tags, related memories, code pointers
|
|
14
|
+
// - Inline search bar with debounced filtering
|
|
15
|
+
// - MCP socket data source with graceful fallback
|
|
16
|
+
// - Responsive layout adapting to terminal dimensions
|
|
17
|
+
//
|
|
18
|
+
// Usage:
|
|
19
|
+
// const { MemoryBrowserScreen } = require('./MemoryBrowserScreen.cjs');
|
|
20
|
+
// const screen = new MemoryBrowserScreen({ projectPath: '/my/project' });
|
|
21
|
+
// screen.onActivate();
|
|
22
|
+
// const lines = screen.render(120, 40);
|
|
23
|
+
// screen.handleInput({ name: 'down' });
|
|
24
|
+
//
|
|
25
|
+
// NO external dependencies beyond project modules. CommonJS module.
|
|
26
|
+
// ============================================================================
|
|
27
|
+
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
// Imports (graceful fallback)
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
let AegisTheme, AEGIS_ICONS, AEGIS_COLORS;
|
|
33
|
+
try {
|
|
34
|
+
const aegis = require('./AegisTheme.cjs');
|
|
35
|
+
AegisTheme = aegis.AegisTheme;
|
|
36
|
+
AEGIS_ICONS = aegis.AEGIS_ICONS;
|
|
37
|
+
AEGIS_COLORS = aegis.AEGIS_COLORS;
|
|
38
|
+
} catch (_e) {
|
|
39
|
+
// AegisTheme not available - will use fallback colors
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
let AnsiRenderer;
|
|
43
|
+
try {
|
|
44
|
+
({ AnsiRenderer } = require('./AnsiRenderer.cjs'));
|
|
45
|
+
} catch (_e) {
|
|
46
|
+
// AnsiRenderer not available - will use basic string ops
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let MCPSocketClient;
|
|
50
|
+
try {
|
|
51
|
+
({ MCPSocketClient } = require('./mcp-socket-client.cjs'));
|
|
52
|
+
} catch (_e) {
|
|
53
|
+
// MCPSocketClient not available - will show empty state
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
// Constants
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
|
|
60
|
+
const RESET = '\x1b[0m';
|
|
61
|
+
const BOLD = '\x1b[1m';
|
|
62
|
+
const DIM = '\x1b[2m';
|
|
63
|
+
const ITALIC = '\x1b[3m';
|
|
64
|
+
const UNDERLINE = '\x1b[4m';
|
|
65
|
+
|
|
66
|
+
const PAGE_SIZE = 25;
|
|
67
|
+
const SEARCH_DEBOUNCE_MS = 300;
|
|
68
|
+
const DATA_REFRESH_MS = 30000; // Refresh data every 30s
|
|
69
|
+
const LEFT_PANEL_RATIO = 0.35; // Left panel takes 35% of width
|
|
70
|
+
const MIN_LEFT_WIDTH = 30;
|
|
71
|
+
const MIN_RIGHT_WIDTH = 40;
|
|
72
|
+
|
|
73
|
+
// Box drawing characters (rounded style)
|
|
74
|
+
const BOX = {
|
|
75
|
+
tl: '\u256D', tr: '\u256E', bl: '\u2570', br: '\u256F',
|
|
76
|
+
h: '\u2500', v: '\u2502',
|
|
77
|
+
teeL: '\u251C', teeR: '\u2524'
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
// Color utilities
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Convert hex color (#RRGGBB) to ANSI truecolor foreground escape sequence.
|
|
86
|
+
* @param {string} hex
|
|
87
|
+
* @returns {string}
|
|
88
|
+
*/
|
|
89
|
+
function hexFg(hex) {
|
|
90
|
+
if (!hex || typeof hex !== 'string') return '';
|
|
91
|
+
const clean = hex.replace('#', '');
|
|
92
|
+
const r = parseInt(clean.substring(0, 2), 16);
|
|
93
|
+
const g = parseInt(clean.substring(2, 4), 16);
|
|
94
|
+
const b = parseInt(clean.substring(4, 6), 16);
|
|
95
|
+
if (isNaN(r) || isNaN(g) || isNaN(b)) return '';
|
|
96
|
+
return `\x1b[38;2;${r};${g};${b}m`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Convert hex color (#RRGGBB) to ANSI truecolor background escape sequence.
|
|
101
|
+
* @param {string} hex
|
|
102
|
+
* @returns {string}
|
|
103
|
+
*/
|
|
104
|
+
function hexBg(hex) {
|
|
105
|
+
if (!hex || typeof hex !== 'string') return '';
|
|
106
|
+
const clean = hex.replace('#', '');
|
|
107
|
+
const r = parseInt(clean.substring(0, 2), 16);
|
|
108
|
+
const g = parseInt(clean.substring(2, 4), 16);
|
|
109
|
+
const b = parseInt(clean.substring(4, 6), 16);
|
|
110
|
+
if (isNaN(r) || isNaN(g) || isNaN(b)) return '';
|
|
111
|
+
return `\x1b[48;2;${r};${g};${b}m`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// AEGIS color palette
|
|
115
|
+
const COLORS = {
|
|
116
|
+
// Memory type colors
|
|
117
|
+
episodic: '#FF6B6B',
|
|
118
|
+
semantic: '#4ECDC4',
|
|
119
|
+
procedural: '#45B7D1',
|
|
120
|
+
working: '#96CEB4',
|
|
121
|
+
consolidated: '#DDA0DD',
|
|
122
|
+
|
|
123
|
+
// UI colors
|
|
124
|
+
cyan: '#00D4FF',
|
|
125
|
+
cyanDim: '#0088AA',
|
|
126
|
+
border: '#2a3a4a',
|
|
127
|
+
borderActive:'#00D4FF',
|
|
128
|
+
selectedBg: '#1a2233',
|
|
129
|
+
selectedFg: '#00D4FF',
|
|
130
|
+
title: '#00D4FF',
|
|
131
|
+
dim: '#5a6a7a',
|
|
132
|
+
dimText: '#6a7a8a',
|
|
133
|
+
text: '#c0d0e0',
|
|
134
|
+
white: '#e0e8f0',
|
|
135
|
+
warning: '#FFD93D',
|
|
136
|
+
error: '#FF6B6B',
|
|
137
|
+
success: '#4ECDC4',
|
|
138
|
+
tagColor: '#7a8a9a',
|
|
139
|
+
star: '#FFD700',
|
|
140
|
+
headerBg: '#0d1520',
|
|
141
|
+
panelBg: '#111a25'
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Build ANSI escape strings from the palette
|
|
145
|
+
const C = {};
|
|
146
|
+
for (const [key, hex] of Object.entries(COLORS)) {
|
|
147
|
+
C[key] = hexFg(hex);
|
|
148
|
+
C[key + 'Bg'] = hexBg(hex);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Memory type display config
|
|
152
|
+
const TYPE_CONFIG = {
|
|
153
|
+
episodic: { color: C.episodic, label: 'episodic', icon: '\u25CF' },
|
|
154
|
+
semantic: { color: C.semantic, label: 'semantic', icon: '\u25C6' },
|
|
155
|
+
procedural: { color: C.procedural, label: 'procedural', icon: '\u25B6' },
|
|
156
|
+
working: { color: C.working, label: 'working', icon: '\u25A0' },
|
|
157
|
+
consolidated: { color: C.consolidated, label: 'consolidated', icon: '\u2605' }
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// Importance to stars mapping
|
|
161
|
+
const IMPORTANCE_STARS = {
|
|
162
|
+
critical: '\u2605\u2605\u2605\u2605\u2605',
|
|
163
|
+
high: '\u2605\u2605\u2605\u2605',
|
|
164
|
+
medium: '\u2605\u2605\u2605',
|
|
165
|
+
low: '\u2605\u2605',
|
|
166
|
+
trivial: '\u2605'
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
// ---------------------------------------------------------------------------
|
|
170
|
+
// String utilities
|
|
171
|
+
// ---------------------------------------------------------------------------
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Get visible width of a string (excluding ANSI escape sequences).
|
|
175
|
+
* Uses AnsiRenderer if available, otherwise a simple regex strip.
|
|
176
|
+
* @param {string} str
|
|
177
|
+
* @returns {number}
|
|
178
|
+
*/
|
|
179
|
+
function vWidth(str) {
|
|
180
|
+
if (!str) return 0;
|
|
181
|
+
if (AnsiRenderer && typeof AnsiRenderer.visibleWidth === 'function') {
|
|
182
|
+
return AnsiRenderer.visibleWidth(str);
|
|
183
|
+
}
|
|
184
|
+
// Fallback: strip ANSI and measure
|
|
185
|
+
return str.replace(/\x1b\[[0-9;]*[A-Za-z]/g, '').length;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Truncate a string to maxWidth visible columns, preserving ANSI.
|
|
190
|
+
* @param {string} str
|
|
191
|
+
* @param {number} maxWidth
|
|
192
|
+
* @param {string} [ellipsis='\u2026']
|
|
193
|
+
* @returns {string}
|
|
194
|
+
*/
|
|
195
|
+
function truncate(str, maxWidth, ellipsis = '\u2026') {
|
|
196
|
+
if (!str) return '';
|
|
197
|
+
if (AnsiRenderer && typeof AnsiRenderer.truncate === 'function') {
|
|
198
|
+
return AnsiRenderer.truncate(str, maxWidth, ellipsis);
|
|
199
|
+
}
|
|
200
|
+
// Fallback: simple strip
|
|
201
|
+
const plain = str.replace(/\x1b\[[0-9;]*[A-Za-z]/g, '');
|
|
202
|
+
if (plain.length <= maxWidth) return str;
|
|
203
|
+
return plain.substring(0, maxWidth - 1) + ellipsis;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Pad a string to exactly targetWidth visible columns.
|
|
208
|
+
* @param {string} str
|
|
209
|
+
* @param {number} targetWidth
|
|
210
|
+
* @returns {string}
|
|
211
|
+
*/
|
|
212
|
+
function pad(str, targetWidth) {
|
|
213
|
+
if (!str) str = '';
|
|
214
|
+
if (AnsiRenderer && typeof AnsiRenderer.pad === 'function') {
|
|
215
|
+
return AnsiRenderer.pad(str, targetWidth);
|
|
216
|
+
}
|
|
217
|
+
const currentWidth = vWidth(str);
|
|
218
|
+
if (currentWidth >= targetWidth) return truncate(str, targetWidth, '');
|
|
219
|
+
return str + ' '.repeat(targetWidth - currentWidth);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Word-wrap a string to maxWidth.
|
|
224
|
+
* @param {string} str
|
|
225
|
+
* @param {number} maxWidth
|
|
226
|
+
* @returns {string[]}
|
|
227
|
+
*/
|
|
228
|
+
function wordWrap(str, maxWidth) {
|
|
229
|
+
if (!str) return [''];
|
|
230
|
+
if (AnsiRenderer && typeof AnsiRenderer.wordWrap === 'function') {
|
|
231
|
+
return AnsiRenderer.wordWrap(str, maxWidth);
|
|
232
|
+
}
|
|
233
|
+
// Simple fallback word wrap
|
|
234
|
+
const words = str.split(/\s+/);
|
|
235
|
+
const lines = [];
|
|
236
|
+
let currentLine = '';
|
|
237
|
+
for (const word of words) {
|
|
238
|
+
if (currentLine.length + word.length + 1 > maxWidth) {
|
|
239
|
+
if (currentLine) lines.push(currentLine);
|
|
240
|
+
currentLine = word;
|
|
241
|
+
} else {
|
|
242
|
+
currentLine = currentLine ? currentLine + ' ' + word : word;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (currentLine) lines.push(currentLine);
|
|
246
|
+
if (lines.length === 0) lines.push('');
|
|
247
|
+
return lines;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Format a date for display.
|
|
252
|
+
* @param {string|Date} date
|
|
253
|
+
* @returns {string}
|
|
254
|
+
*/
|
|
255
|
+
function formatDate(date) {
|
|
256
|
+
if (!date) return 'unknown';
|
|
257
|
+
try {
|
|
258
|
+
const d = new Date(date);
|
|
259
|
+
if (isNaN(d.getTime())) return String(date);
|
|
260
|
+
const year = d.getFullYear();
|
|
261
|
+
const month = String(d.getMonth() + 1).padStart(2, '0');
|
|
262
|
+
const day = String(d.getDate()).padStart(2, '0');
|
|
263
|
+
const hours = String(d.getHours()).padStart(2, '0');
|
|
264
|
+
const mins = String(d.getMinutes()).padStart(2, '0');
|
|
265
|
+
return `${year}-${month}-${day} ${hours}:${mins}`;
|
|
266
|
+
} catch (_e) {
|
|
267
|
+
return String(date);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Format a relative time from now.
|
|
273
|
+
* @param {string|Date} date
|
|
274
|
+
* @returns {string}
|
|
275
|
+
*/
|
|
276
|
+
function relativeTime(date) {
|
|
277
|
+
if (!date) return '';
|
|
278
|
+
try {
|
|
279
|
+
const d = new Date(date);
|
|
280
|
+
const now = Date.now();
|
|
281
|
+
const diff = now - d.getTime();
|
|
282
|
+
if (diff < 0) return 'just now';
|
|
283
|
+
const minutes = Math.floor(diff / 60000);
|
|
284
|
+
if (minutes < 1) return 'just now';
|
|
285
|
+
if (minutes < 60) return `${minutes}m ago`;
|
|
286
|
+
const hours = Math.floor(minutes / 60);
|
|
287
|
+
if (hours < 24) return `${hours}h ago`;
|
|
288
|
+
const days = Math.floor(hours / 24);
|
|
289
|
+
if (days < 30) return `${days}d ago`;
|
|
290
|
+
const months = Math.floor(days / 30);
|
|
291
|
+
return `${months}mo ago`;
|
|
292
|
+
} catch (_e) {
|
|
293
|
+
return '';
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// ---------------------------------------------------------------------------
|
|
298
|
+
// MemoryBrowserScreen
|
|
299
|
+
// ---------------------------------------------------------------------------
|
|
300
|
+
|
|
301
|
+
class MemoryBrowserScreen {
|
|
302
|
+
/**
|
|
303
|
+
* @param {Object} options
|
|
304
|
+
* @param {Object} [options.theme] - AegisTheme instance (optional)
|
|
305
|
+
* @param {string} [options.projectPath] - Path to project root
|
|
306
|
+
* @param {Function} [options.dbQuery] - Custom database query function
|
|
307
|
+
* @param {Object} [options.mcpClient] - Pre-existing MCPSocketClient instance
|
|
308
|
+
*/
|
|
309
|
+
constructor(options = {}) {
|
|
310
|
+
this.theme = options.theme || AegisTheme || null;
|
|
311
|
+
this.projectPath = options.projectPath || process.cwd();
|
|
312
|
+
this.dbQuery = options.dbQuery || null;
|
|
313
|
+
this.mcpClient = options.mcpClient || null;
|
|
314
|
+
|
|
315
|
+
// State
|
|
316
|
+
this._memories = []; // Currently loaded memories
|
|
317
|
+
this._filteredMemories = []; // After search filter
|
|
318
|
+
this._totalCount = 0; // Total memory count from DB
|
|
319
|
+
this._selectedIndex = 0; // Cursor position in list
|
|
320
|
+
this._page = 0; // Current page (0-based)
|
|
321
|
+
this._totalPages = 0;
|
|
322
|
+
this._activePanel = 'list'; // 'list' or 'detail'
|
|
323
|
+
this._detailScrollOffset = 0; // Scroll position in detail view
|
|
324
|
+
this._searchActive = false; // Whether search input is active
|
|
325
|
+
this._searchQuery = ''; // Current search text
|
|
326
|
+
this._searchDebounceTimer = null;
|
|
327
|
+
this._loading = false;
|
|
328
|
+
this._error = null;
|
|
329
|
+
this._lastRefresh = 0;
|
|
330
|
+
this._active = false; // Whether this screen is currently shown
|
|
331
|
+
|
|
332
|
+
// Cache for detail view
|
|
333
|
+
this._selectedMemory = null; // Full memory detail for selected item
|
|
334
|
+
this._relatedMemories = []; // Related memories for selected
|
|
335
|
+
this._detailLines = []; // Pre-rendered detail lines
|
|
336
|
+
|
|
337
|
+
// Data source initialization
|
|
338
|
+
this._dataSourceReady = false;
|
|
339
|
+
this._dataSourceError = null;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// =========================================================================
|
|
343
|
+
// Lifecycle
|
|
344
|
+
// =========================================================================
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Called when this screen tab becomes active/visible.
|
|
348
|
+
* Initializes data source and loads initial data.
|
|
349
|
+
*/
|
|
350
|
+
async onActivate() {
|
|
351
|
+
this._active = true;
|
|
352
|
+
this._error = null;
|
|
353
|
+
|
|
354
|
+
// Initialize data source if not ready
|
|
355
|
+
if (!this._dataSourceReady) {
|
|
356
|
+
await this._initDataSource();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Load initial data
|
|
360
|
+
await this.update();
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Called when switching away from this screen tab.
|
|
365
|
+
*/
|
|
366
|
+
onDeactivate() {
|
|
367
|
+
this._active = false;
|
|
368
|
+
if (this._searchDebounceTimer) {
|
|
369
|
+
clearTimeout(this._searchDebounceTimer);
|
|
370
|
+
this._searchDebounceTimer = null;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// =========================================================================
|
|
375
|
+
// Data Source
|
|
376
|
+
// =========================================================================
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Initialize the data source (MCP socket or direct DB query).
|
|
380
|
+
* @private
|
|
381
|
+
*/
|
|
382
|
+
async _initDataSource() {
|
|
383
|
+
// If a custom dbQuery was provided, use that
|
|
384
|
+
if (this.dbQuery) {
|
|
385
|
+
this._dataSourceReady = true;
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// Try connecting via MCP socket
|
|
390
|
+
if (MCPSocketClient && this.projectPath) {
|
|
391
|
+
try {
|
|
392
|
+
if (!this.mcpClient) {
|
|
393
|
+
this.mcpClient = new MCPSocketClient(this.projectPath);
|
|
394
|
+
}
|
|
395
|
+
await this.mcpClient.connect();
|
|
396
|
+
this._dataSourceReady = true;
|
|
397
|
+
} catch (err) {
|
|
398
|
+
this._dataSourceError = err.message;
|
|
399
|
+
this._dataSourceReady = false;
|
|
400
|
+
}
|
|
401
|
+
} else {
|
|
402
|
+
this._dataSourceError = 'No data source available. MCPSocketClient not found.';
|
|
403
|
+
this._dataSourceReady = false;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Fetch memories from the data source.
|
|
409
|
+
* @param {Object} [queryOptions]
|
|
410
|
+
* @param {string} [queryOptions.search] - Search query
|
|
411
|
+
* @param {number} [queryOptions.offset] - Pagination offset
|
|
412
|
+
* @param {number} [queryOptions.limit] - Items per page
|
|
413
|
+
* @returns {Promise<{memories: Array, total: number}>}
|
|
414
|
+
* @private
|
|
415
|
+
*/
|
|
416
|
+
async _fetchMemories(queryOptions = {}) {
|
|
417
|
+
const { search = '', offset = 0, limit = PAGE_SIZE } = queryOptions;
|
|
418
|
+
|
|
419
|
+
// Custom database query function
|
|
420
|
+
if (this.dbQuery) {
|
|
421
|
+
try {
|
|
422
|
+
const result = await this.dbQuery({ search, offset, limit });
|
|
423
|
+
return {
|
|
424
|
+
memories: result.memories || result.items || [],
|
|
425
|
+
total: result.total || result.count || 0
|
|
426
|
+
};
|
|
427
|
+
} catch (err) {
|
|
428
|
+
this._error = 'Query failed: ' + err.message;
|
|
429
|
+
return { memories: [], total: 0 };
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// MCP socket query
|
|
434
|
+
if (this.mcpClient && this._dataSourceReady) {
|
|
435
|
+
try {
|
|
436
|
+
if (search) {
|
|
437
|
+
// Use find_memory for search
|
|
438
|
+
const result = await this.mcpClient.callTool('find_memory', {
|
|
439
|
+
query: search,
|
|
440
|
+
limit: limit,
|
|
441
|
+
summarize: false,
|
|
442
|
+
maxContentLength: 0,
|
|
443
|
+
cameraRollMode: false
|
|
444
|
+
});
|
|
445
|
+
const memories = this._parseMCPResult(result);
|
|
446
|
+
return { memories, total: memories.length };
|
|
447
|
+
} else {
|
|
448
|
+
// Use get_memory for browsing (paginated)
|
|
449
|
+
const result = await this.mcpClient.callTool('get_memory', {
|
|
450
|
+
limit: limit,
|
|
451
|
+
offset: offset,
|
|
452
|
+
orderBy: 'created',
|
|
453
|
+
orderDirection: 'desc',
|
|
454
|
+
summarize: false
|
|
455
|
+
});
|
|
456
|
+
const memories = this._parseMCPResult(result);
|
|
457
|
+
// Try to get total count
|
|
458
|
+
const countResult = await this.mcpClient.callTool('show_me_the_stats', {
|
|
459
|
+
includeTypeDistribution: true,
|
|
460
|
+
includeCacheStats: false,
|
|
461
|
+
includeEmbeddingServerStatus: false
|
|
462
|
+
});
|
|
463
|
+
const total = this._extractTotalCount(countResult) || memories.length;
|
|
464
|
+
return { memories, total };
|
|
465
|
+
}
|
|
466
|
+
} catch (err) {
|
|
467
|
+
this._error = 'MCP query failed: ' + err.message;
|
|
468
|
+
return { memories: [], total: 0 };
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// No data source
|
|
473
|
+
return { memories: [], total: 0 };
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Parse MCP tool result into memory objects array.
|
|
478
|
+
* @param {*} result
|
|
479
|
+
* @returns {Array}
|
|
480
|
+
* @private
|
|
481
|
+
*/
|
|
482
|
+
_parseMCPResult(result) {
|
|
483
|
+
if (!result) return [];
|
|
484
|
+
|
|
485
|
+
// MCP results come in content array format
|
|
486
|
+
if (result.content && Array.isArray(result.content)) {
|
|
487
|
+
for (const block of result.content) {
|
|
488
|
+
if (block.type === 'text' && block.text) {
|
|
489
|
+
try {
|
|
490
|
+
const parsed = JSON.parse(block.text);
|
|
491
|
+
if (Array.isArray(parsed)) return parsed;
|
|
492
|
+
if (parsed.memories) return parsed.memories;
|
|
493
|
+
if (parsed.results) return parsed.results;
|
|
494
|
+
if (parsed.items) return parsed.items;
|
|
495
|
+
return [parsed];
|
|
496
|
+
} catch (_e) {
|
|
497
|
+
// Not JSON, try to extract from formatted text
|
|
498
|
+
return this._parseFormattedText(block.text);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// Direct array
|
|
505
|
+
if (Array.isArray(result)) return result;
|
|
506
|
+
|
|
507
|
+
// Object with memories/results
|
|
508
|
+
if (result.memories) return result.memories;
|
|
509
|
+
if (result.results) return result.results;
|
|
510
|
+
if (result.items) return result.items;
|
|
511
|
+
|
|
512
|
+
return [];
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Parse formatted text output from MCP tools into memory objects.
|
|
517
|
+
* @param {string} text
|
|
518
|
+
* @returns {Array}
|
|
519
|
+
* @private
|
|
520
|
+
*/
|
|
521
|
+
_parseFormattedText(text) {
|
|
522
|
+
// Try to extract structured data from formatted MCP output
|
|
523
|
+
const memories = [];
|
|
524
|
+
const blocks = text.split(/\n(?=ID:|Memory ID:|\u2500{3,}|\u250C)/);
|
|
525
|
+
|
|
526
|
+
for (const block of blocks) {
|
|
527
|
+
const memory = {};
|
|
528
|
+
const idMatch = block.match(/(?:ID|Memory ID):\s*([a-f0-9-]+)/i);
|
|
529
|
+
if (idMatch) memory.id = idMatch[1];
|
|
530
|
+
|
|
531
|
+
const typeMatch = block.match(/Type:\s*(\w+)/i);
|
|
532
|
+
if (typeMatch) memory.memoryType = typeMatch[1].toLowerCase();
|
|
533
|
+
|
|
534
|
+
const importanceMatch = block.match(/Importance:\s*(\w+)/i);
|
|
535
|
+
if (importanceMatch) memory.importance = importanceMatch[1].toLowerCase();
|
|
536
|
+
|
|
537
|
+
const contentMatch = block.match(/Content:\s*(.+?)(?:\n(?:Tags|Type|Importance|Created|ID):|$)/is);
|
|
538
|
+
if (contentMatch) memory.content = contentMatch[1].trim();
|
|
539
|
+
|
|
540
|
+
const tagsMatch = block.match(/Tags:\s*(.+)/i);
|
|
541
|
+
if (tagsMatch) {
|
|
542
|
+
memory.tags = tagsMatch[1].split(/[,\s]+/).filter(t => t.length > 0).map(t => t.replace('#', ''));
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
const dateMatch = block.match(/Created:\s*(.+)/i);
|
|
546
|
+
if (dateMatch) memory.created_at = dateMatch[1].trim();
|
|
547
|
+
|
|
548
|
+
if (memory.id || memory.content) {
|
|
549
|
+
memories.push(memory);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
return memories;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Extract total memory count from stats result.
|
|
558
|
+
* @param {*} result
|
|
559
|
+
* @returns {number}
|
|
560
|
+
* @private
|
|
561
|
+
*/
|
|
562
|
+
_extractTotalCount(result) {
|
|
563
|
+
if (!result) return 0;
|
|
564
|
+
try {
|
|
565
|
+
if (result.content && Array.isArray(result.content)) {
|
|
566
|
+
for (const block of result.content) {
|
|
567
|
+
if (block.text) {
|
|
568
|
+
const match = block.text.match(/total[:\s]*(\d+)/i);
|
|
569
|
+
if (match) return parseInt(match[1], 10);
|
|
570
|
+
// Try type distribution totals
|
|
571
|
+
const countMatches = block.text.match(/(\d+)\s*(?:memories|total)/i);
|
|
572
|
+
if (countMatches) return parseInt(countMatches[1], 10);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
if (typeof result.total === 'number') return result.total;
|
|
577
|
+
if (typeof result.count === 'number') return result.count;
|
|
578
|
+
} catch (_e) {
|
|
579
|
+
// ignore
|
|
580
|
+
}
|
|
581
|
+
return 0;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
// =========================================================================
|
|
585
|
+
// Update / Refresh
|
|
586
|
+
// =========================================================================
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Refresh data from the data source.
|
|
590
|
+
* Called periodically and on page changes.
|
|
591
|
+
*/
|
|
592
|
+
async update() {
|
|
593
|
+
if (this._loading) return;
|
|
594
|
+
|
|
595
|
+
this._loading = true;
|
|
596
|
+
this._error = null;
|
|
597
|
+
|
|
598
|
+
try {
|
|
599
|
+
const offset = this._page * PAGE_SIZE;
|
|
600
|
+
const { memories, total } = await this._fetchMemories({
|
|
601
|
+
search: this._searchQuery,
|
|
602
|
+
offset: offset,
|
|
603
|
+
limit: PAGE_SIZE
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
this._memories = memories;
|
|
607
|
+
this._filteredMemories = memories; // Search is done server-side
|
|
608
|
+
this._totalCount = total;
|
|
609
|
+
this._totalPages = Math.max(1, Math.ceil(total / PAGE_SIZE));
|
|
610
|
+
this._lastRefresh = Date.now();
|
|
611
|
+
|
|
612
|
+
// Clamp selection
|
|
613
|
+
if (this._selectedIndex >= this._filteredMemories.length) {
|
|
614
|
+
this._selectedIndex = Math.max(0, this._filteredMemories.length - 1);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// Update selected memory detail
|
|
618
|
+
this._updateSelectedDetail();
|
|
619
|
+
} catch (err) {
|
|
620
|
+
this._error = 'Failed to load memories: ' + err.message;
|
|
621
|
+
} finally {
|
|
622
|
+
this._loading = false;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Update the detail view for the currently selected memory.
|
|
628
|
+
* @private
|
|
629
|
+
*/
|
|
630
|
+
_updateSelectedDetail() {
|
|
631
|
+
const memories = this._filteredMemories;
|
|
632
|
+
if (memories.length === 0 || this._selectedIndex >= memories.length) {
|
|
633
|
+
this._selectedMemory = null;
|
|
634
|
+
this._relatedMemories = [];
|
|
635
|
+
this._detailLines = [];
|
|
636
|
+
this._detailScrollOffset = 0;
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
this._selectedMemory = memories[this._selectedIndex];
|
|
641
|
+
this._detailScrollOffset = 0;
|
|
642
|
+
// Detail lines will be rendered lazily in _renderDetailPanel
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
// =========================================================================
|
|
646
|
+
// Input Handling
|
|
647
|
+
// =========================================================================
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Handle keyboard input.
|
|
651
|
+
* @param {Object|string} key - Key event object or key name string
|
|
652
|
+
* @returns {string|null} Action result or null
|
|
653
|
+
*/
|
|
654
|
+
handleInput(key) {
|
|
655
|
+
const keyName = typeof key === 'string' ? key : (key && key.name) || '';
|
|
656
|
+
const ctrl = typeof key === 'object' && key.ctrl;
|
|
657
|
+
const ch = typeof key === 'string' ? key : (key && key.sequence) || '';
|
|
658
|
+
|
|
659
|
+
// Search mode input handling
|
|
660
|
+
if (this._searchActive) {
|
|
661
|
+
return this._handleSearchInput(keyName, ch, ctrl);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
// Normal mode
|
|
665
|
+
switch (keyName) {
|
|
666
|
+
case 'up':
|
|
667
|
+
return this._moveCursor(-1);
|
|
668
|
+
case 'down':
|
|
669
|
+
return this._moveCursor(1);
|
|
670
|
+
case 'pageup':
|
|
671
|
+
return this._changePage(-1);
|
|
672
|
+
case 'pagedown':
|
|
673
|
+
return this._changePage(1);
|
|
674
|
+
case 'home':
|
|
675
|
+
this._selectedIndex = 0;
|
|
676
|
+
this._updateSelectedDetail();
|
|
677
|
+
return 'navigate';
|
|
678
|
+
case 'end':
|
|
679
|
+
this._selectedIndex = Math.max(0, this._filteredMemories.length - 1);
|
|
680
|
+
this._updateSelectedDetail();
|
|
681
|
+
return 'navigate';
|
|
682
|
+
case 'return':
|
|
683
|
+
case 'enter':
|
|
684
|
+
return this._togglePanel();
|
|
685
|
+
case 'tab':
|
|
686
|
+
return this._togglePanel();
|
|
687
|
+
case 'escape':
|
|
688
|
+
if (this._activePanel === 'detail') {
|
|
689
|
+
this._activePanel = 'list';
|
|
690
|
+
return 'panel_switch';
|
|
691
|
+
}
|
|
692
|
+
return 'back';
|
|
693
|
+
case 'd':
|
|
694
|
+
if (!ctrl) return this._requestDelete();
|
|
695
|
+
break;
|
|
696
|
+
case 'r':
|
|
697
|
+
if (!ctrl) {
|
|
698
|
+
this.update();
|
|
699
|
+
return 'refresh';
|
|
700
|
+
}
|
|
701
|
+
break;
|
|
702
|
+
default:
|
|
703
|
+
// Check for '/' to activate search
|
|
704
|
+
if (ch === '/') {
|
|
705
|
+
this._searchActive = true;
|
|
706
|
+
this._searchQuery = '';
|
|
707
|
+
return 'search_activate';
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// Detail panel scrolling when in detail view
|
|
711
|
+
if (this._activePanel === 'detail') {
|
|
712
|
+
if (keyName === 'up' || keyName === 'k') {
|
|
713
|
+
this._detailScrollOffset = Math.max(0, this._detailScrollOffset - 1);
|
|
714
|
+
return 'detail_scroll';
|
|
715
|
+
}
|
|
716
|
+
if (keyName === 'down' || keyName === 'j') {
|
|
717
|
+
this._detailScrollOffset++;
|
|
718
|
+
return 'detail_scroll';
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
break;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
return null;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Handle input while search bar is active.
|
|
729
|
+
* @private
|
|
730
|
+
*/
|
|
731
|
+
_handleSearchInput(keyName, ch, ctrl) {
|
|
732
|
+
if (keyName === 'escape') {
|
|
733
|
+
this._searchActive = false;
|
|
734
|
+
if (this._searchQuery === '') {
|
|
735
|
+
// If search was empty, just close
|
|
736
|
+
return 'search_close';
|
|
737
|
+
}
|
|
738
|
+
return 'search_close';
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
if (keyName === 'return' || keyName === 'enter') {
|
|
742
|
+
this._searchActive = false;
|
|
743
|
+
// Trigger search with current query
|
|
744
|
+
this._page = 0;
|
|
745
|
+
this._selectedIndex = 0;
|
|
746
|
+
this.update();
|
|
747
|
+
return 'search_submit';
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
if (keyName === 'backspace') {
|
|
751
|
+
if (this._searchQuery.length > 0) {
|
|
752
|
+
this._searchQuery = this._searchQuery.slice(0, -1);
|
|
753
|
+
this._scheduleSearch();
|
|
754
|
+
} else {
|
|
755
|
+
// Backspace on empty clears search entirely
|
|
756
|
+
this._searchActive = false;
|
|
757
|
+
this._searchQuery = '';
|
|
758
|
+
this._page = 0;
|
|
759
|
+
this._selectedIndex = 0;
|
|
760
|
+
this.update();
|
|
761
|
+
return 'search_clear';
|
|
762
|
+
}
|
|
763
|
+
return 'search_input';
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
if (ctrl && ch === 'u') {
|
|
767
|
+
this._searchQuery = '';
|
|
768
|
+
this._scheduleSearch();
|
|
769
|
+
return 'search_clear_line';
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// Printable character
|
|
773
|
+
if (ch && ch.length === 1 && ch.charCodeAt(0) >= 32) {
|
|
774
|
+
this._searchQuery += ch;
|
|
775
|
+
this._scheduleSearch();
|
|
776
|
+
return 'search_input';
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
return null;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* Schedule a debounced search.
|
|
784
|
+
* @private
|
|
785
|
+
*/
|
|
786
|
+
_scheduleSearch() {
|
|
787
|
+
if (this._searchDebounceTimer) {
|
|
788
|
+
clearTimeout(this._searchDebounceTimer);
|
|
789
|
+
}
|
|
790
|
+
this._searchDebounceTimer = setTimeout(() => {
|
|
791
|
+
this._page = 0;
|
|
792
|
+
this._selectedIndex = 0;
|
|
793
|
+
this.update();
|
|
794
|
+
}, SEARCH_DEBOUNCE_MS);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Move cursor up/down in the list.
|
|
799
|
+
* @param {number} delta - Direction (-1 up, +1 down)
|
|
800
|
+
* @returns {string}
|
|
801
|
+
* @private
|
|
802
|
+
*/
|
|
803
|
+
_moveCursor(delta) {
|
|
804
|
+
const maxIndex = this._filteredMemories.length - 1;
|
|
805
|
+
if (maxIndex < 0) return 'navigate';
|
|
806
|
+
|
|
807
|
+
const newIndex = this._selectedIndex + delta;
|
|
808
|
+
|
|
809
|
+
if (newIndex < 0) {
|
|
810
|
+
// Wrap or stay at top
|
|
811
|
+
if (this._page > 0) {
|
|
812
|
+
this._page--;
|
|
813
|
+
this._selectedIndex = PAGE_SIZE - 1;
|
|
814
|
+
this.update();
|
|
815
|
+
}
|
|
816
|
+
return 'navigate';
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
if (newIndex > maxIndex) {
|
|
820
|
+
// Advance to next page if available
|
|
821
|
+
if (this._page < this._totalPages - 1) {
|
|
822
|
+
this._page++;
|
|
823
|
+
this._selectedIndex = 0;
|
|
824
|
+
this.update();
|
|
825
|
+
}
|
|
826
|
+
return 'navigate';
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
this._selectedIndex = newIndex;
|
|
830
|
+
this._updateSelectedDetail();
|
|
831
|
+
return 'navigate';
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Change page.
|
|
836
|
+
* @param {number} delta - Direction (-1 prev, +1 next)
|
|
837
|
+
* @returns {string}
|
|
838
|
+
* @private
|
|
839
|
+
*/
|
|
840
|
+
_changePage(delta) {
|
|
841
|
+
const newPage = this._page + delta;
|
|
842
|
+
if (newPage < 0 || newPage >= this._totalPages) return 'page_bounds';
|
|
843
|
+
|
|
844
|
+
this._page = newPage;
|
|
845
|
+
this._selectedIndex = 0;
|
|
846
|
+
this.update();
|
|
847
|
+
return 'page_change';
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* Toggle between list and detail panels.
|
|
852
|
+
* @returns {string}
|
|
853
|
+
* @private
|
|
854
|
+
*/
|
|
855
|
+
_togglePanel() {
|
|
856
|
+
this._activePanel = this._activePanel === 'list' ? 'detail' : 'list';
|
|
857
|
+
this._detailScrollOffset = 0;
|
|
858
|
+
return 'panel_switch';
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Request deletion of the currently selected memory.
|
|
863
|
+
* Returns a delete action for the parent to confirm.
|
|
864
|
+
* @returns {string}
|
|
865
|
+
* @private
|
|
866
|
+
*/
|
|
867
|
+
_requestDelete() {
|
|
868
|
+
if (!this._selectedMemory) return null;
|
|
869
|
+
return 'delete_request:' + (this._selectedMemory.id || '');
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
// =========================================================================
|
|
873
|
+
// Rendering
|
|
874
|
+
// =========================================================================
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Render the full screen as an array of ANSI-colored strings.
|
|
878
|
+
* @param {number} width - Terminal width in columns
|
|
879
|
+
* @param {number} height - Terminal height in rows
|
|
880
|
+
* @returns {string[]} Array of strings, one per row
|
|
881
|
+
*/
|
|
882
|
+
render(width, height) {
|
|
883
|
+
if (width < 40 || height < 10) {
|
|
884
|
+
return this._renderTooSmall(width, height);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
const lines = [];
|
|
888
|
+
|
|
889
|
+
// Layout calculation
|
|
890
|
+
const headerHeight = 1;
|
|
891
|
+
const footerHeight = 1;
|
|
892
|
+
const contentHeight = height - headerHeight - footerHeight;
|
|
893
|
+
const innerWidth = width - 2; // 1 char border on each side
|
|
894
|
+
|
|
895
|
+
// Panel widths
|
|
896
|
+
let leftWidth = Math.max(MIN_LEFT_WIDTH, Math.floor(innerWidth * LEFT_PANEL_RATIO));
|
|
897
|
+
let rightWidth = innerWidth - leftWidth - 1; // -1 for separator
|
|
898
|
+
if (rightWidth < MIN_RIGHT_WIDTH) {
|
|
899
|
+
rightWidth = MIN_RIGHT_WIDTH;
|
|
900
|
+
leftWidth = innerWidth - rightWidth - 1;
|
|
901
|
+
}
|
|
902
|
+
if (leftWidth < MIN_LEFT_WIDTH) {
|
|
903
|
+
leftWidth = MIN_LEFT_WIDTH;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// 1. Header
|
|
907
|
+
lines.push(this._renderHeader(width));
|
|
908
|
+
|
|
909
|
+
// 2. Content area (left + right panels side by side)
|
|
910
|
+
const leftLines = this._renderLeftPanel(leftWidth, contentHeight);
|
|
911
|
+
const rightLines = this._renderRightPanel(rightWidth, contentHeight);
|
|
912
|
+
|
|
913
|
+
for (let i = 0; i < contentHeight; i++) {
|
|
914
|
+
const left = leftLines[i] || pad('', leftWidth);
|
|
915
|
+
const right = rightLines[i] || pad('', rightWidth);
|
|
916
|
+
const sep = C.border + BOX.v + RESET;
|
|
917
|
+
lines.push(left + sep + right);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
// 3. Footer
|
|
921
|
+
lines.push(this._renderFooter(width));
|
|
922
|
+
|
|
923
|
+
return lines;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
// -------------------------------------------------------------------------
|
|
927
|
+
// Header
|
|
928
|
+
// -------------------------------------------------------------------------
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* Render the header bar.
|
|
932
|
+
* @param {number} width
|
|
933
|
+
* @returns {string}
|
|
934
|
+
* @private
|
|
935
|
+
*/
|
|
936
|
+
_renderHeader(width) {
|
|
937
|
+
const titleText = ' Memory Browser ';
|
|
938
|
+
const countText = this._totalCount > 0
|
|
939
|
+
? ` ${this._totalCount.toLocaleString()} memories `
|
|
940
|
+
: ' 0 memories ';
|
|
941
|
+
|
|
942
|
+
// Search field
|
|
943
|
+
let searchText = '';
|
|
944
|
+
if (this._searchActive) {
|
|
945
|
+
const cursor = '\u2588'; // Block cursor
|
|
946
|
+
searchText = ` Search: [${C.white}${this._searchQuery}${cursor}${RESET}${C.dim}] `;
|
|
947
|
+
} else if (this._searchQuery) {
|
|
948
|
+
searchText = ` Search: [${C.white}${this._searchQuery}${RESET}${C.dim}] `;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// Loading indicator
|
|
952
|
+
const loadingText = this._loading ? ` ${C.warning}\u25CF loading${RESET}` : '';
|
|
953
|
+
|
|
954
|
+
// Build header
|
|
955
|
+
const prefix = `${C.border}${BOX.tl}${BOX.h}${BOX.h}`;
|
|
956
|
+
const title = `${BOLD}${C.cyan}${titleText}${RESET}`;
|
|
957
|
+
const count = `${C.dim}${BOX.h}${BOX.h}${countText}${RESET}`;
|
|
958
|
+
const search = searchText ? `${C.dim}${BOX.h}${BOX.h}${searchText}${RESET}` : '';
|
|
959
|
+
|
|
960
|
+
const contentWidth = vWidth(prefix) + vWidth(titleText) + vWidth(countText)
|
|
961
|
+
+ (searchText ? vWidth(searchText) + 2 : 0)
|
|
962
|
+
+ vWidth(loadingText);
|
|
963
|
+
|
|
964
|
+
const fillCount = Math.max(0, width - contentWidth - 2);
|
|
965
|
+
const fill = `${C.border}${BOX.h.repeat(fillCount)}${BOX.tr}${RESET}`;
|
|
966
|
+
|
|
967
|
+
return `${prefix}${title}${count}${search}${loadingText}${fill}`;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
// -------------------------------------------------------------------------
|
|
971
|
+
// Footer
|
|
972
|
+
// -------------------------------------------------------------------------
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Render the footer bar with key hints.
|
|
976
|
+
* @param {number} width
|
|
977
|
+
* @returns {string}
|
|
978
|
+
* @private
|
|
979
|
+
*/
|
|
980
|
+
_renderFooter(width) {
|
|
981
|
+
const hints = [
|
|
982
|
+
{ key: '/', desc: 'Search' },
|
|
983
|
+
{ key: '\u2191\u2193', desc: 'Navigate' },
|
|
984
|
+
{ key: 'Enter', desc: 'View' },
|
|
985
|
+
{ key: 'd', desc: 'Delete' },
|
|
986
|
+
{ key: 'r', desc: 'Refresh' },
|
|
987
|
+
{ key: 'PgUp/Dn', desc: 'Page' },
|
|
988
|
+
{ key: 'Tab', desc: 'Panel' },
|
|
989
|
+
{ key: 'ESC', desc: 'Back' }
|
|
990
|
+
];
|
|
991
|
+
|
|
992
|
+
let hintStr = '';
|
|
993
|
+
for (const hint of hints) {
|
|
994
|
+
hintStr += ` ${C.cyan}[${hint.key}]${RESET}${C.dim}${hint.desc}${RESET}`;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
const prefix = `${C.border}${BOX.bl}${BOX.h}${BOX.h}`;
|
|
998
|
+
const hintWidth = vWidth(hintStr);
|
|
999
|
+
const fillCount = Math.max(0, width - 4 - hintWidth - 1);
|
|
1000
|
+
const fill = `${C.border}${BOX.h.repeat(fillCount)}${BOX.br}${RESET}`;
|
|
1001
|
+
|
|
1002
|
+
return `${prefix}${hintStr} ${fill}`;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
// -------------------------------------------------------------------------
|
|
1006
|
+
// Left Panel (Memory List)
|
|
1007
|
+
// -------------------------------------------------------------------------
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* Render the left panel (memory list).
|
|
1011
|
+
* @param {number} panelWidth
|
|
1012
|
+
* @param {number} panelHeight
|
|
1013
|
+
* @returns {string[]}
|
|
1014
|
+
* @private
|
|
1015
|
+
*/
|
|
1016
|
+
_renderLeftPanel(panelWidth, panelHeight) {
|
|
1017
|
+
const lines = [];
|
|
1018
|
+
const isActive = this._activePanel === 'list';
|
|
1019
|
+
const borderColor = isActive ? C.borderActive : C.border;
|
|
1020
|
+
|
|
1021
|
+
// Panel title bar
|
|
1022
|
+
const titleBarText = ` Memories `;
|
|
1023
|
+
const pageInfo = this._totalPages > 1
|
|
1024
|
+
? `Pg ${this._page + 1}/${this._totalPages} `
|
|
1025
|
+
: '';
|
|
1026
|
+
const titleFill = Math.max(0, panelWidth - vWidth(titleBarText) - vWidth(pageInfo) - 4);
|
|
1027
|
+
lines.push(
|
|
1028
|
+
`${borderColor}${BOX.tl}${BOX.h}${RESET}` +
|
|
1029
|
+
`${BOLD}${C.cyan}${titleBarText}${RESET}` +
|
|
1030
|
+
`${borderColor}${BOX.h.repeat(titleFill)}${RESET}` +
|
|
1031
|
+
`${C.dim}${pageInfo}${RESET}` +
|
|
1032
|
+
`${borderColor}${BOX.tr}${RESET}`
|
|
1033
|
+
);
|
|
1034
|
+
|
|
1035
|
+
const contentWidth = panelWidth - 2; // borders
|
|
1036
|
+
const contentHeight = panelHeight - 2; // title + bottom border
|
|
1037
|
+
|
|
1038
|
+
if (!this._dataSourceReady && !this.dbQuery) {
|
|
1039
|
+
// Empty state: no data source
|
|
1040
|
+
const emptyLines = this._renderEmptyState(contentWidth, contentHeight);
|
|
1041
|
+
for (const line of emptyLines) {
|
|
1042
|
+
lines.push(`${borderColor}${BOX.v}${RESET}${line}${borderColor}${BOX.v}${RESET}`);
|
|
1043
|
+
}
|
|
1044
|
+
} else if (this._error) {
|
|
1045
|
+
// Error state
|
|
1046
|
+
const errorLines = this._renderErrorState(contentWidth, contentHeight);
|
|
1047
|
+
for (const line of errorLines) {
|
|
1048
|
+
lines.push(`${borderColor}${BOX.v}${RESET}${line}${borderColor}${BOX.v}${RESET}`);
|
|
1049
|
+
}
|
|
1050
|
+
} else if (this._filteredMemories.length === 0) {
|
|
1051
|
+
// No results
|
|
1052
|
+
const noResultLines = this._renderNoResults(contentWidth, contentHeight);
|
|
1053
|
+
for (const line of noResultLines) {
|
|
1054
|
+
lines.push(`${borderColor}${BOX.v}${RESET}${line}${borderColor}${BOX.v}${RESET}`);
|
|
1055
|
+
}
|
|
1056
|
+
} else {
|
|
1057
|
+
// Memory list rows
|
|
1058
|
+
for (let i = 0; i < contentHeight; i++) {
|
|
1059
|
+
if (i < this._filteredMemories.length) {
|
|
1060
|
+
const memory = this._filteredMemories[i];
|
|
1061
|
+
const isSelected = i === this._selectedIndex;
|
|
1062
|
+
const row = this._renderMemoryRow(memory, contentWidth, isSelected);
|
|
1063
|
+
lines.push(`${borderColor}${BOX.v}${RESET}${row}${borderColor}${BOX.v}${RESET}`);
|
|
1064
|
+
} else {
|
|
1065
|
+
// Empty row
|
|
1066
|
+
lines.push(`${borderColor}${BOX.v}${RESET}${pad('', contentWidth)}${borderColor}${BOX.v}${RESET}`);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
// Bottom border
|
|
1072
|
+
const bottomFill = Math.max(0, panelWidth - 2);
|
|
1073
|
+
lines.push(`${borderColor}${BOX.bl}${BOX.h.repeat(bottomFill)}${BOX.br}${RESET}`);
|
|
1074
|
+
|
|
1075
|
+
// Pad to exact height
|
|
1076
|
+
while (lines.length < panelHeight) {
|
|
1077
|
+
lines.push(pad('', panelWidth));
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
return lines.slice(0, panelHeight);
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Render a single memory row in the list.
|
|
1085
|
+
* @param {Object} memory
|
|
1086
|
+
* @param {number} width
|
|
1087
|
+
* @param {boolean} isSelected
|
|
1088
|
+
* @returns {string}
|
|
1089
|
+
* @private
|
|
1090
|
+
*/
|
|
1091
|
+
_renderMemoryRow(memory, width, isSelected) {
|
|
1092
|
+
const type = (memory.memoryType || memory.type || 'semantic').toLowerCase();
|
|
1093
|
+
const config = TYPE_CONFIG[type] || TYPE_CONFIG.semantic;
|
|
1094
|
+
const importance = (memory.importance || 'medium').toLowerCase();
|
|
1095
|
+
|
|
1096
|
+
// Type badge: [type]
|
|
1097
|
+
const badge = `${config.color}[${config.label}]${RESET}`;
|
|
1098
|
+
const badgeWidth = config.label.length + 2;
|
|
1099
|
+
|
|
1100
|
+
// Importance stars
|
|
1101
|
+
const stars = IMPORTANCE_STARS[importance] || '\u2605';
|
|
1102
|
+
const starsStr = `${C.star}${stars}${RESET}`;
|
|
1103
|
+
const starsWidth = stars.length;
|
|
1104
|
+
|
|
1105
|
+
// Content preview
|
|
1106
|
+
const content = (memory.content || memory.summary || '(no content)')
|
|
1107
|
+
.replace(/[\n\r\t]+/g, ' ')
|
|
1108
|
+
.trim();
|
|
1109
|
+
|
|
1110
|
+
const previewWidth = Math.max(0, width - badgeWidth - starsWidth - 3); // spaces
|
|
1111
|
+
const preview = truncate(content, previewWidth);
|
|
1112
|
+
|
|
1113
|
+
// Build the row
|
|
1114
|
+
let row;
|
|
1115
|
+
if (isSelected) {
|
|
1116
|
+
const selectedBg = C.selectedBgBg || hexBg(COLORS.selectedBg);
|
|
1117
|
+
const selectedFg = C.selectedFg || hexFg(COLORS.selectedFg);
|
|
1118
|
+
row = `${selectedBg}${selectedFg} ${badge}${selectedBg}${selectedFg} ${preview}${RESET}${selectedBg} ${starsStr}${RESET}`;
|
|
1119
|
+
} else {
|
|
1120
|
+
row = ` ${badge} ${C.text}${preview}${RESET} ${starsStr}`;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
return pad(row, width);
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
// -------------------------------------------------------------------------
|
|
1127
|
+
// Right Panel (Detail View)
|
|
1128
|
+
// -------------------------------------------------------------------------
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* Render the right panel (detail view).
|
|
1132
|
+
* @param {number} panelWidth
|
|
1133
|
+
* @param {number} panelHeight
|
|
1134
|
+
* @returns {string[]}
|
|
1135
|
+
* @private
|
|
1136
|
+
*/
|
|
1137
|
+
_renderRightPanel(panelWidth, panelHeight) {
|
|
1138
|
+
const lines = [];
|
|
1139
|
+
const isActive = this._activePanel === 'detail';
|
|
1140
|
+
const borderColor = isActive ? C.borderActive : C.border;
|
|
1141
|
+
|
|
1142
|
+
// Panel title bar
|
|
1143
|
+
const titleBarText = ' Detail ';
|
|
1144
|
+
const titleFill = Math.max(0, panelWidth - vWidth(titleBarText) - 4);
|
|
1145
|
+
lines.push(
|
|
1146
|
+
`${borderColor}${BOX.tl}${BOX.h}${RESET}` +
|
|
1147
|
+
`${BOLD}${C.cyan}${titleBarText}${RESET}` +
|
|
1148
|
+
`${borderColor}${BOX.h.repeat(titleFill)}${BOX.tr}${RESET}`
|
|
1149
|
+
);
|
|
1150
|
+
|
|
1151
|
+
const contentWidth = panelWidth - 2; // borders
|
|
1152
|
+
const contentHeight = panelHeight - 2; // title + bottom border
|
|
1153
|
+
|
|
1154
|
+
if (!this._selectedMemory) {
|
|
1155
|
+
// No selection
|
|
1156
|
+
const emptyLines = this._renderDetailEmpty(contentWidth, contentHeight);
|
|
1157
|
+
for (const line of emptyLines) {
|
|
1158
|
+
lines.push(`${borderColor}${BOX.v}${RESET}${line}${borderColor}${BOX.v}${RESET}`);
|
|
1159
|
+
}
|
|
1160
|
+
} else {
|
|
1161
|
+
// Render detail content
|
|
1162
|
+
const detailContent = this._buildDetailContent(this._selectedMemory, contentWidth);
|
|
1163
|
+
|
|
1164
|
+
// Apply scroll offset
|
|
1165
|
+
const scrolled = detailContent.slice(this._detailScrollOffset);
|
|
1166
|
+
for (let i = 0; i < contentHeight; i++) {
|
|
1167
|
+
if (i < scrolled.length) {
|
|
1168
|
+
lines.push(`${borderColor}${BOX.v}${RESET}${pad(scrolled[i], contentWidth)}${borderColor}${BOX.v}${RESET}`);
|
|
1169
|
+
} else {
|
|
1170
|
+
lines.push(`${borderColor}${BOX.v}${RESET}${pad('', contentWidth)}${borderColor}${BOX.v}${RESET}`);
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
// Bottom border with scroll indicator
|
|
1176
|
+
let bottomContent = '';
|
|
1177
|
+
if (this._selectedMemory) {
|
|
1178
|
+
const detailContent = this._buildDetailContent(this._selectedMemory, contentWidth);
|
|
1179
|
+
if (detailContent.length > contentHeight) {
|
|
1180
|
+
const scrollPct = Math.round((this._detailScrollOffset / Math.max(1, detailContent.length - contentHeight)) * 100);
|
|
1181
|
+
bottomContent = ` ${C.dim}${Math.min(100, scrollPct)}% ${RESET}`;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
const bottomContentWidth = vWidth(bottomContent);
|
|
1185
|
+
const bottomFill = Math.max(0, panelWidth - 2 - bottomContentWidth);
|
|
1186
|
+
lines.push(`${borderColor}${BOX.bl}${BOX.h.repeat(bottomFill)}${RESET}${bottomContent}${borderColor}${BOX.br}${RESET}`);
|
|
1187
|
+
|
|
1188
|
+
// Pad to exact height
|
|
1189
|
+
while (lines.length < panelHeight) {
|
|
1190
|
+
lines.push(pad('', panelWidth));
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
return lines.slice(0, panelHeight);
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
/**
|
|
1197
|
+
* Build the detail content lines for a memory.
|
|
1198
|
+
* @param {Object} memory
|
|
1199
|
+
* @param {number} width
|
|
1200
|
+
* @returns {string[]}
|
|
1201
|
+
* @private
|
|
1202
|
+
*/
|
|
1203
|
+
_buildDetailContent(memory, width) {
|
|
1204
|
+
const lines = [];
|
|
1205
|
+
const labelWidth = 12;
|
|
1206
|
+
const valueWidth = width - labelWidth - 1;
|
|
1207
|
+
|
|
1208
|
+
// ID
|
|
1209
|
+
const id = memory.id || memory.memoryId || 'unknown';
|
|
1210
|
+
lines.push(` ${C.dim}ID:${RESET} ${C.text}${truncate(id, valueWidth)}${RESET}`);
|
|
1211
|
+
|
|
1212
|
+
// Type with colored badge
|
|
1213
|
+
const type = (memory.memoryType || memory.type || 'semantic').toLowerCase();
|
|
1214
|
+
const config = TYPE_CONFIG[type] || TYPE_CONFIG.semantic;
|
|
1215
|
+
lines.push(` ${C.dim}Type:${RESET} ${config.color}${config.icon} ${config.label}${RESET}`);
|
|
1216
|
+
|
|
1217
|
+
// Created date
|
|
1218
|
+
const created = memory.created_at || memory.createdAt || memory.timestamp;
|
|
1219
|
+
const dateStr = formatDate(created);
|
|
1220
|
+
const relStr = relativeTime(created);
|
|
1221
|
+
lines.push(` ${C.dim}Created:${RESET} ${C.text}${dateStr}${RESET} ${C.dim}(${relStr})${RESET}`);
|
|
1222
|
+
|
|
1223
|
+
// Updated date (if different from created)
|
|
1224
|
+
const updated = memory.updated_at || memory.updatedAt;
|
|
1225
|
+
if (updated && updated !== created) {
|
|
1226
|
+
lines.push(` ${C.dim}Updated:${RESET} ${C.text}${formatDate(updated)}${RESET} ${C.dim}(${relativeTime(updated)})${RESET}`);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
// Importance with stars
|
|
1230
|
+
const importance = (memory.importance || 'medium').toLowerCase();
|
|
1231
|
+
const stars = IMPORTANCE_STARS[importance] || '\u2605';
|
|
1232
|
+
lines.push(` ${C.dim}Importance:${RESET} ${C.star}${stars}${RESET} ${C.text}${importance}${RESET}`);
|
|
1233
|
+
|
|
1234
|
+
// Tags
|
|
1235
|
+
const tags = memory.tags || [];
|
|
1236
|
+
if (tags.length > 0) {
|
|
1237
|
+
const tagStr = tags.map(t => `${C.tagColor}#${t}${RESET}`).join(' ');
|
|
1238
|
+
const tagLines = wordWrap(tagStr, valueWidth);
|
|
1239
|
+
lines.push(` ${C.dim}Tags:${RESET} ${tagLines[0] || ''}`);
|
|
1240
|
+
for (let i = 1; i < tagLines.length; i++) {
|
|
1241
|
+
lines.push(`${' '.repeat(labelWidth)}${tagLines[i]}`);
|
|
1242
|
+
}
|
|
1243
|
+
} else {
|
|
1244
|
+
lines.push(` ${C.dim}Tags:${RESET} ${C.dim}(none)${RESET}`);
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
// Access count
|
|
1248
|
+
if (memory.access_count != null || memory.accessCount != null) {
|
|
1249
|
+
const accessCount = memory.access_count || memory.accessCount || 0;
|
|
1250
|
+
lines.push(` ${C.dim}Accessed:${RESET} ${C.text}${accessCount} times${RESET}`);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
// Separator
|
|
1254
|
+
lines.push('');
|
|
1255
|
+
lines.push(` ${C.border}${BOX.h.repeat(width - 2)}${RESET}`);
|
|
1256
|
+
lines.push('');
|
|
1257
|
+
|
|
1258
|
+
// Content section
|
|
1259
|
+
lines.push(` ${BOLD}${C.cyan}Content${RESET}`);
|
|
1260
|
+
lines.push('');
|
|
1261
|
+
|
|
1262
|
+
const content = memory.content || memory.summary || '(no content)';
|
|
1263
|
+
const contentLines = wordWrap(content, width - 2);
|
|
1264
|
+
for (const line of contentLines) {
|
|
1265
|
+
lines.push(` ${C.text}${line}${RESET}`);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
// Code pointers section
|
|
1269
|
+
const codePointers = memory.code_pointers || memory.codePointers || [];
|
|
1270
|
+
if (codePointers.length > 0) {
|
|
1271
|
+
lines.push('');
|
|
1272
|
+
lines.push(` ${C.border}${BOX.h.repeat(width - 2)}${RESET}`);
|
|
1273
|
+
lines.push('');
|
|
1274
|
+
lines.push(` ${BOLD}${C.cyan}Code Pointers${RESET}`);
|
|
1275
|
+
lines.push('');
|
|
1276
|
+
|
|
1277
|
+
for (const pointer of codePointers) {
|
|
1278
|
+
const file = pointer.file || pointer.filePath || pointer.path || '';
|
|
1279
|
+
const lineNum = pointer.line || pointer.lineNumber || '';
|
|
1280
|
+
const func = pointer.function || pointer.functionName || '';
|
|
1281
|
+
|
|
1282
|
+
let pointerStr = ` ${C.procedural}\u2192${RESET} ${C.text}${file}${RESET}`;
|
|
1283
|
+
if (lineNum) pointerStr += `${C.dim}:${lineNum}${RESET}`;
|
|
1284
|
+
if (func) pointerStr += ` ${C.dim}(${func})${RESET}`;
|
|
1285
|
+
|
|
1286
|
+
lines.push(truncate(pointerStr, width - 1));
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
// Related memories section
|
|
1291
|
+
const related = memory.related || memory.relatedMemories || this._relatedMemories || [];
|
|
1292
|
+
if (related.length > 0) {
|
|
1293
|
+
lines.push('');
|
|
1294
|
+
lines.push(` ${C.border}${BOX.h.repeat(width - 2)}${RESET}`);
|
|
1295
|
+
lines.push('');
|
|
1296
|
+
lines.push(` ${BOLD}${C.cyan}Related${RESET}`);
|
|
1297
|
+
lines.push('');
|
|
1298
|
+
|
|
1299
|
+
for (const rel of related.slice(0, 10)) {
|
|
1300
|
+
const relContent = (rel.content || rel.summary || 'untitled').replace(/[\n\r]+/g, ' ').trim();
|
|
1301
|
+
const score = rel.similarity || rel.score || rel.strength || 0;
|
|
1302
|
+
const scoreStr = typeof score === 'number' ? `(${score.toFixed(2)})` : '';
|
|
1303
|
+
const relPreview = truncate(relContent, width - 10);
|
|
1304
|
+
lines.push(` ${C.semantic}\u2192${RESET} ${C.text}${relPreview}${RESET} ${C.dim}${scoreStr}${RESET}`);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
// Metadata section
|
|
1309
|
+
const metadata = memory.metadata || {};
|
|
1310
|
+
const metaKeys = Object.keys(metadata).filter(k => k !== 'content' && k !== 'tags');
|
|
1311
|
+
if (metaKeys.length > 0) {
|
|
1312
|
+
lines.push('');
|
|
1313
|
+
lines.push(` ${C.border}${BOX.h.repeat(width - 2)}${RESET}`);
|
|
1314
|
+
lines.push('');
|
|
1315
|
+
lines.push(` ${BOLD}${C.cyan}Metadata${RESET}`);
|
|
1316
|
+
lines.push('');
|
|
1317
|
+
|
|
1318
|
+
for (const key of metaKeys.slice(0, 15)) {
|
|
1319
|
+
const val = String(metadata[key]).replace(/[\n\r]+/g, ' ').trim();
|
|
1320
|
+
const valTrunc = truncate(val, width - key.length - 6);
|
|
1321
|
+
lines.push(` ${C.dim}${key}:${RESET} ${C.text}${valTrunc}${RESET}`);
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
return lines;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
// -------------------------------------------------------------------------
|
|
1329
|
+
// Empty / Error States
|
|
1330
|
+
// -------------------------------------------------------------------------
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* Render empty state (no data source).
|
|
1334
|
+
* @param {number} width
|
|
1335
|
+
* @param {number} height
|
|
1336
|
+
* @returns {string[]}
|
|
1337
|
+
* @private
|
|
1338
|
+
*/
|
|
1339
|
+
_renderEmptyState(width, height) {
|
|
1340
|
+
const lines = [];
|
|
1341
|
+
const center = (text) => {
|
|
1342
|
+
const tw = vWidth(text);
|
|
1343
|
+
const leftPad = Math.max(0, Math.floor((width - tw) / 2));
|
|
1344
|
+
return ' '.repeat(leftPad) + text;
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
lines.push(pad('', width));
|
|
1348
|
+
lines.push(pad('', width));
|
|
1349
|
+
lines.push(pad(center(`${C.dim}\u2500\u2500\u2500 No Data Source \u2500\u2500\u2500${RESET}`), width));
|
|
1350
|
+
lines.push(pad('', width));
|
|
1351
|
+
lines.push(pad(center(`${C.text}SpecMem MCP server not connected.${RESET}`), width));
|
|
1352
|
+
lines.push(pad('', width));
|
|
1353
|
+
|
|
1354
|
+
if (this._dataSourceError) {
|
|
1355
|
+
const errLines = wordWrap(this._dataSourceError, width - 4);
|
|
1356
|
+
for (const line of errLines) {
|
|
1357
|
+
lines.push(pad(` ${C.error}${line}${RESET}`, width));
|
|
1358
|
+
}
|
|
1359
|
+
lines.push(pad('', width));
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
lines.push(pad(center(`${C.dim}To start the MCP server:${RESET}`), width));
|
|
1363
|
+
lines.push(pad(` ${C.cyan}specmem start${RESET}`, width));
|
|
1364
|
+
lines.push(pad('', width));
|
|
1365
|
+
lines.push(pad(center(`${C.dim}Or provide a dbQuery function${RESET}`), width));
|
|
1366
|
+
lines.push(pad(center(`${C.dim}in the constructor options.${RESET}`), width));
|
|
1367
|
+
|
|
1368
|
+
while (lines.length < height) {
|
|
1369
|
+
lines.push(pad('', width));
|
|
1370
|
+
}
|
|
1371
|
+
return lines.slice(0, height);
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/**
|
|
1375
|
+
* Render error state.
|
|
1376
|
+
* @param {number} width
|
|
1377
|
+
* @param {number} height
|
|
1378
|
+
* @returns {string[]}
|
|
1379
|
+
* @private
|
|
1380
|
+
*/
|
|
1381
|
+
_renderErrorState(width, height) {
|
|
1382
|
+
const lines = [];
|
|
1383
|
+
lines.push(pad('', width));
|
|
1384
|
+
lines.push(pad(` ${C.error}\u26A0 Error${RESET}`, width));
|
|
1385
|
+
lines.push(pad('', width));
|
|
1386
|
+
|
|
1387
|
+
if (this._error) {
|
|
1388
|
+
const errLines = wordWrap(this._error, width - 4);
|
|
1389
|
+
for (const line of errLines) {
|
|
1390
|
+
lines.push(pad(` ${C.text}${line}${RESET}`, width));
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
lines.push(pad('', width));
|
|
1395
|
+
lines.push(pad(` ${C.dim}Press 'r' to retry${RESET}`, width));
|
|
1396
|
+
|
|
1397
|
+
while (lines.length < height) {
|
|
1398
|
+
lines.push(pad('', width));
|
|
1399
|
+
}
|
|
1400
|
+
return lines.slice(0, height);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* Render no-results state.
|
|
1405
|
+
* @param {number} width
|
|
1406
|
+
* @param {number} height
|
|
1407
|
+
* @returns {string[]}
|
|
1408
|
+
* @private
|
|
1409
|
+
*/
|
|
1410
|
+
_renderNoResults(width, height) {
|
|
1411
|
+
const lines = [];
|
|
1412
|
+
lines.push(pad('', width));
|
|
1413
|
+
lines.push(pad(` ${C.dim}\u2500\u2500\u2500 No Memories Found \u2500\u2500\u2500${RESET}`, width));
|
|
1414
|
+
lines.push(pad('', width));
|
|
1415
|
+
|
|
1416
|
+
if (this._searchQuery) {
|
|
1417
|
+
lines.push(pad(` ${C.text}No results for: "${this._searchQuery}"${RESET}`, width));
|
|
1418
|
+
lines.push(pad('', width));
|
|
1419
|
+
lines.push(pad(` ${C.dim}Try a different search term${RESET}`, width));
|
|
1420
|
+
lines.push(pad(` ${C.dim}or press ESC to clear search.${RESET}`, width));
|
|
1421
|
+
} else {
|
|
1422
|
+
lines.push(pad(` ${C.text}No memories stored yet.${RESET}`, width));
|
|
1423
|
+
lines.push(pad('', width));
|
|
1424
|
+
lines.push(pad(` ${C.dim}Use SpecMem to save memories:${RESET}`, width));
|
|
1425
|
+
lines.push(pad(` ${C.cyan}save_memory({content: "..."})${RESET}`, width));
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
while (lines.length < height) {
|
|
1429
|
+
lines.push(pad('', width));
|
|
1430
|
+
}
|
|
1431
|
+
return lines.slice(0, height);
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* Render empty detail panel (no selection).
|
|
1436
|
+
* @param {number} width
|
|
1437
|
+
* @param {number} height
|
|
1438
|
+
* @returns {string[]}
|
|
1439
|
+
* @private
|
|
1440
|
+
*/
|
|
1441
|
+
_renderDetailEmpty(width, height) {
|
|
1442
|
+
const lines = [];
|
|
1443
|
+
const center = (text) => {
|
|
1444
|
+
const tw = vWidth(text);
|
|
1445
|
+
const leftPad = Math.max(0, Math.floor((width - tw) / 2));
|
|
1446
|
+
return ' '.repeat(leftPad) + text;
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1449
|
+
const emptyHeight = Math.floor(height / 2) - 1;
|
|
1450
|
+
for (let i = 0; i < emptyHeight; i++) {
|
|
1451
|
+
lines.push(pad('', width));
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
lines.push(pad(center(`${C.dim}Select a memory to view details${RESET}`), width));
|
|
1455
|
+
lines.push(pad('', width));
|
|
1456
|
+
lines.push(pad(center(`${C.dim}Use \u2191\u2193 to navigate, Enter to focus${RESET}`), width));
|
|
1457
|
+
|
|
1458
|
+
while (lines.length < height) {
|
|
1459
|
+
lines.push(pad('', width));
|
|
1460
|
+
}
|
|
1461
|
+
return lines.slice(0, height);
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* Render "terminal too small" message.
|
|
1466
|
+
* @param {number} width
|
|
1467
|
+
* @param {number} height
|
|
1468
|
+
* @returns {string[]}
|
|
1469
|
+
* @private
|
|
1470
|
+
*/
|
|
1471
|
+
_renderTooSmall(width, height) {
|
|
1472
|
+
const lines = [];
|
|
1473
|
+
for (let i = 0; i < height; i++) {
|
|
1474
|
+
if (i === Math.floor(height / 2)) {
|
|
1475
|
+
const msg = 'Terminal too small';
|
|
1476
|
+
const truncMsg = msg.substring(0, width);
|
|
1477
|
+
lines.push(truncMsg + ' '.repeat(Math.max(0, width - truncMsg.length)));
|
|
1478
|
+
} else {
|
|
1479
|
+
lines.push(' '.repeat(width));
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
return lines;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
// =========================================================================
|
|
1486
|
+
// Public API helpers
|
|
1487
|
+
// =========================================================================
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* Get the currently selected memory object.
|
|
1491
|
+
* @returns {Object|null}
|
|
1492
|
+
*/
|
|
1493
|
+
getSelectedMemory() {
|
|
1494
|
+
return this._selectedMemory;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* Get current state for external use (e.g., status bar).
|
|
1499
|
+
* @returns {Object}
|
|
1500
|
+
*/
|
|
1501
|
+
getState() {
|
|
1502
|
+
return {
|
|
1503
|
+
page: this._page + 1,
|
|
1504
|
+
totalPages: this._totalPages,
|
|
1505
|
+
totalMemories: this._totalCount,
|
|
1506
|
+
selectedIndex: this._selectedIndex,
|
|
1507
|
+
searchQuery: this._searchQuery,
|
|
1508
|
+
searchActive: this._searchActive,
|
|
1509
|
+
activePanel: this._activePanel,
|
|
1510
|
+
loading: this._loading,
|
|
1511
|
+
error: this._error,
|
|
1512
|
+
dataSourceReady: this._dataSourceReady
|
|
1513
|
+
};
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
/**
|
|
1517
|
+
* Set the search query programmatically.
|
|
1518
|
+
* @param {string} query
|
|
1519
|
+
*/
|
|
1520
|
+
setSearchQuery(query) {
|
|
1521
|
+
this._searchQuery = query || '';
|
|
1522
|
+
this._page = 0;
|
|
1523
|
+
this._selectedIndex = 0;
|
|
1524
|
+
this.update();
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
/**
|
|
1528
|
+
* Navigate to a specific page.
|
|
1529
|
+
* @param {number} page - 1-based page number
|
|
1530
|
+
*/
|
|
1531
|
+
goToPage(page) {
|
|
1532
|
+
const targetPage = Math.max(0, Math.min((page || 1) - 1, this._totalPages - 1));
|
|
1533
|
+
if (targetPage !== this._page) {
|
|
1534
|
+
this._page = targetPage;
|
|
1535
|
+
this._selectedIndex = 0;
|
|
1536
|
+
this.update();
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* Get the screen name for tab display.
|
|
1542
|
+
* @returns {string}
|
|
1543
|
+
*/
|
|
1544
|
+
getName() {
|
|
1545
|
+
return 'Memory Browser';
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
/**
|
|
1549
|
+
* Get the short name for tab bar.
|
|
1550
|
+
* @returns {string}
|
|
1551
|
+
*/
|
|
1552
|
+
getShortName() {
|
|
1553
|
+
return 'Memories';
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
/**
|
|
1557
|
+
* Check if the screen needs a refresh.
|
|
1558
|
+
* @returns {boolean}
|
|
1559
|
+
*/
|
|
1560
|
+
needsRefresh() {
|
|
1561
|
+
return this._active && (Date.now() - this._lastRefresh > DATA_REFRESH_MS);
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* Delete a memory by ID (called after confirmation by parent).
|
|
1566
|
+
* @param {string} memoryId
|
|
1567
|
+
* @returns {Promise<boolean>}
|
|
1568
|
+
*/
|
|
1569
|
+
async deleteMemory(memoryId) {
|
|
1570
|
+
if (!memoryId) return false;
|
|
1571
|
+
|
|
1572
|
+
try {
|
|
1573
|
+
if (this.mcpClient && this._dataSourceReady) {
|
|
1574
|
+
await this.mcpClient.callTool('remove_memory', { id: memoryId });
|
|
1575
|
+
await this.update();
|
|
1576
|
+
return true;
|
|
1577
|
+
}
|
|
1578
|
+
if (this.dbQuery) {
|
|
1579
|
+
// Custom delete via dbQuery
|
|
1580
|
+
await this.dbQuery({ action: 'delete', id: memoryId });
|
|
1581
|
+
await this.update();
|
|
1582
|
+
return true;
|
|
1583
|
+
}
|
|
1584
|
+
} catch (err) {
|
|
1585
|
+
this._error = 'Delete failed: ' + err.message;
|
|
1586
|
+
}
|
|
1587
|
+
return false;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
// ---------------------------------------------------------------------------
|
|
1592
|
+
// Exports
|
|
1593
|
+
// ---------------------------------------------------------------------------
|
|
1594
|
+
|
|
1595
|
+
module.exports = { MemoryBrowserScreen };
|