@nanocollective/nanocoder 1.11.3
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/LICENSE.md +23 -0
- package/README.md +366 -0
- package/dist/app/hooks/useAppInitialization.d.ts +26 -0
- package/dist/app/hooks/useAppInitialization.d.ts.map +1 -0
- package/dist/app/hooks/useAppInitialization.js +151 -0
- package/dist/app/hooks/useAppInitialization.js.map +1 -0
- package/dist/app/hooks/useAppState.d.ts +84 -0
- package/dist/app/hooks/useAppState.d.ts.map +1 -0
- package/dist/app/hooks/useAppState.js +162 -0
- package/dist/app/hooks/useAppState.js.map +1 -0
- package/dist/app/hooks/useChatHandler.d.ts +26 -0
- package/dist/app/hooks/useChatHandler.d.ts.map +1 -0
- package/dist/app/hooks/useChatHandler.js +532 -0
- package/dist/app/hooks/useChatHandler.js.map +1 -0
- package/dist/app/hooks/useDirectoryTrust.d.ts +15 -0
- package/dist/app/hooks/useDirectoryTrust.d.ts.map +1 -0
- package/dist/app/hooks/useDirectoryTrust.js +77 -0
- package/dist/app/hooks/useDirectoryTrust.js.map +1 -0
- package/dist/app/hooks/useModeHandlers.d.ts +31 -0
- package/dist/app/hooks/useModeHandlers.d.ts.map +1 -0
- package/dist/app/hooks/useModeHandlers.js +98 -0
- package/dist/app/hooks/useModeHandlers.js.map +1 -0
- package/dist/app/hooks/useToolHandler.d.ts +32 -0
- package/dist/app/hooks/useToolHandler.d.ts.map +1 -0
- package/dist/app/hooks/useToolHandler.js +154 -0
- package/dist/app/hooks/useToolHandler.js.map +1 -0
- package/dist/app/utils/appUtils.d.ts +4 -0
- package/dist/app/utils/appUtils.d.ts.map +1 -0
- package/dist/app/utils/appUtils.js +147 -0
- package/dist/app/utils/appUtils.js.map +1 -0
- package/dist/app/utils/conversationState.d.ts +68 -0
- package/dist/app/utils/conversationState.d.ts.map +1 -0
- package/dist/app/utils/conversationState.js +199 -0
- package/dist/app/utils/conversationState.js.map +1 -0
- package/dist/app.d.ts +2 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +193 -0
- package/dist/app.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +6 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-factory.d.ts +6 -0
- package/dist/client-factory.d.ts.map +1 -0
- package/dist/client-factory.js +111 -0
- package/dist/client-factory.js.map +1 -0
- package/dist/command-parser.d.ts +5 -0
- package/dist/command-parser.d.ts.map +1 -0
- package/dist/command-parser.js +36 -0
- package/dist/command-parser.js.map +1 -0
- package/dist/commands/clear.d.ts +3 -0
- package/dist/commands/clear.d.ts.map +1 -0
- package/dist/commands/clear.js +17 -0
- package/dist/commands/clear.js.map +1 -0
- package/dist/commands/custom-commands.d.ts +3 -0
- package/dist/commands/custom-commands.d.ts.map +1 -0
- package/dist/commands/custom-commands.js +41 -0
- package/dist/commands/custom-commands.js.map +1 -0
- package/dist/commands/debug.d.ts +3 -0
- package/dist/commands/debug.d.ts.map +1 -0
- package/dist/commands/debug.js +86 -0
- package/dist/commands/debug.js.map +1 -0
- package/dist/commands/exit.d.ts +3 -0
- package/dist/commands/exit.d.ts.map +1 -0
- package/dist/commands/exit.js +17 -0
- package/dist/commands/exit.js.map +1 -0
- package/dist/commands/export.d.ts +3 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +63 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/help.d.ts +3 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +31 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/index.d.ts +13 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +13 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +214 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mcp.d.ts +9 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +41 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/model.d.ts +3 -0
- package/dist/commands/model.d.ts.map +1 -0
- package/dist/commands/model.js +11 -0
- package/dist/commands/model.js.map +1 -0
- package/dist/commands/provider.d.ts +3 -0
- package/dist/commands/provider.d.ts.map +1 -0
- package/dist/commands/provider.js +11 -0
- package/dist/commands/provider.js.map +1 -0
- package/dist/commands/theme.d.ts +3 -0
- package/dist/commands/theme.d.ts.map +1 -0
- package/dist/commands/theme.js +11 -0
- package/dist/commands/theme.js.map +1 -0
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +10 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands.d.ts +16 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +46 -0
- package/dist/commands.js.map +1 -0
- package/dist/components/assistant-message.d.ts +4 -0
- package/dist/components/assistant-message.d.ts.map +1 -0
- package/dist/components/assistant-message.js +43 -0
- package/dist/components/assistant-message.js.map +1 -0
- package/dist/components/bash-execution-indicator.d.ts +4 -0
- package/dist/components/bash-execution-indicator.d.ts.map +1 -0
- package/dist/components/bash-execution-indicator.js +9 -0
- package/dist/components/bash-execution-indicator.js.map +1 -0
- package/dist/components/cancelling-indicator.d.ts +3 -0
- package/dist/components/cancelling-indicator.d.ts.map +1 -0
- package/dist/components/cancelling-indicator.js +10 -0
- package/dist/components/cancelling-indicator.js.map +1 -0
- package/dist/components/chat-queue.d.ts +4 -0
- package/dist/components/chat-queue.d.ts.map +1 -0
- package/dist/components/chat-queue.js +23 -0
- package/dist/components/chat-queue.js.map +1 -0
- package/dist/components/custom-commands.d.ts +7 -0
- package/dist/components/custom-commands.d.ts.map +1 -0
- package/dist/components/custom-commands.js +27 -0
- package/dist/components/custom-commands.js.map +1 -0
- package/dist/components/error-message.d.ts +7 -0
- package/dist/components/error-message.d.ts.map +1 -0
- package/dist/components/error-message.js +12 -0
- package/dist/components/error-message.js.map +1 -0
- package/dist/components/info-message.d.ts +6 -0
- package/dist/components/info-message.d.ts.map +1 -0
- package/dist/components/info-message.js +11 -0
- package/dist/components/info-message.js.map +1 -0
- package/dist/components/model-selector.d.ts +10 -0
- package/dist/components/model-selector.d.ts.map +1 -0
- package/dist/components/model-selector.js +59 -0
- package/dist/components/model-selector.js.map +1 -0
- package/dist/components/provider-selector.d.ts +9 -0
- package/dist/components/provider-selector.d.ts.map +1 -0
- package/dist/components/provider-selector.js +36 -0
- package/dist/components/provider-selector.js.map +1 -0
- package/dist/components/security-disclaimer.d.ts +7 -0
- package/dist/components/security-disclaimer.d.ts.map +1 -0
- package/dist/components/security-disclaimer.js +36 -0
- package/dist/components/security-disclaimer.js.map +1 -0
- package/dist/components/status.d.ts +6 -0
- package/dist/components/status.d.ts.map +1 -0
- package/dist/components/status.js +35 -0
- package/dist/components/status.js.map +1 -0
- package/dist/components/success-message.d.ts +6 -0
- package/dist/components/success-message.d.ts.map +1 -0
- package/dist/components/success-message.js +11 -0
- package/dist/components/success-message.js.map +1 -0
- package/dist/components/theme-selector.d.ts +8 -0
- package/dist/components/theme-selector.d.ts.map +1 -0
- package/dist/components/theme-selector.js +40 -0
- package/dist/components/theme-selector.js.map +1 -0
- package/dist/components/thinking-indicator.d.ts +4 -0
- package/dist/components/thinking-indicator.d.ts.map +1 -0
- package/dist/components/thinking-indicator.js +32 -0
- package/dist/components/thinking-indicator.js.map +1 -0
- package/dist/components/tool-confirmation.d.ts +9 -0
- package/dist/components/tool-confirmation.d.ts.map +1 -0
- package/dist/components/tool-confirmation.js +72 -0
- package/dist/components/tool-confirmation.js.map +1 -0
- package/dist/components/tool-execution-indicator.d.ts +3 -0
- package/dist/components/tool-execution-indicator.d.ts.map +1 -0
- package/dist/components/tool-execution-indicator.js +9 -0
- package/dist/components/tool-execution-indicator.js.map +1 -0
- package/dist/components/tool-message.d.ts +10 -0
- package/dist/components/tool-message.d.ts.map +1 -0
- package/dist/components/tool-message.js +16 -0
- package/dist/components/tool-message.js.map +1 -0
- package/dist/components/update-message.d.ts +7 -0
- package/dist/components/update-message.d.ts.map +1 -0
- package/dist/components/update-message.js +93 -0
- package/dist/components/update-message.js.map +1 -0
- package/dist/components/user-input.d.ts +10 -0
- package/dist/components/user-input.d.ts.map +1 -0
- package/dist/components/user-input.js +188 -0
- package/dist/components/user-input.js.map +1 -0
- package/dist/components/user-message.d.ts +4 -0
- package/dist/components/user-message.d.ts.map +1 -0
- package/dist/components/user-message.js +15 -0
- package/dist/components/user-message.js.map +1 -0
- package/dist/components/welcome-message.d.ts +3 -0
- package/dist/components/welcome-message.d.ts.map +1 -0
- package/dist/components/welcome-message.js +21 -0
- package/dist/components/welcome-message.js.map +1 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +44 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/logging.d.ts +14 -0
- package/dist/config/logging.d.ts.map +1 -0
- package/dist/config/logging.js +58 -0
- package/dist/config/logging.js.map +1 -0
- package/dist/config/preferences.d.ts +7 -0
- package/dist/config/preferences.d.ts.map +1 -0
- package/dist/config/preferences.js +46 -0
- package/dist/config/preferences.js.map +1 -0
- package/dist/config/themes.d.ts +6 -0
- package/dist/config/themes.d.ts.map +1 -0
- package/dist/config/themes.js +295 -0
- package/dist/config/themes.js.map +1 -0
- package/dist/custom-commands/executor.d.ts +12 -0
- package/dist/custom-commands/executor.d.ts.map +1 -0
- package/dist/custom-commands/executor.js +45 -0
- package/dist/custom-commands/executor.js.map +1 -0
- package/dist/custom-commands/index.d.ts +4 -0
- package/dist/custom-commands/index.d.ts.map +1 -0
- package/dist/custom-commands/index.js +4 -0
- package/dist/custom-commands/index.js.map +1 -0
- package/dist/custom-commands/loader.d.ts +41 -0
- package/dist/custom-commands/loader.d.ts.map +1 -0
- package/dist/custom-commands/loader.js +129 -0
- package/dist/custom-commands/loader.js.map +1 -0
- package/dist/custom-commands/parser.d.ts +10 -0
- package/dist/custom-commands/parser.d.ts.map +1 -0
- package/dist/custom-commands/parser.js +181 -0
- package/dist/custom-commands/parser.js.map +1 -0
- package/dist/hooks/useInputState.d.ts +14 -0
- package/dist/hooks/useInputState.d.ts.map +1 -0
- package/dist/hooks/useInputState.js +66 -0
- package/dist/hooks/useInputState.js.map +1 -0
- package/dist/hooks/useTerminalWidth.d.ts +2 -0
- package/dist/hooks/useTerminalWidth.d.ts.map +1 -0
- package/dist/hooks/useTerminalWidth.js +20 -0
- package/dist/hooks/useTerminalWidth.js.map +1 -0
- package/dist/hooks/useTheme.d.ts +9 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/hooks/useTheme.js +10 -0
- package/dist/hooks/useTheme.js.map +1 -0
- package/dist/hooks/useUIState.d.ts +19 -0
- package/dist/hooks/useUIState.d.ts.map +1 -0
- package/dist/hooks/useUIState.js +46 -0
- package/dist/hooks/useUIState.js.map +1 -0
- package/dist/init/agents-template-generator.d.ts +29 -0
- package/dist/init/agents-template-generator.d.ts.map +1 -0
- package/dist/init/agents-template-generator.js +340 -0
- package/dist/init/agents-template-generator.js.map +1 -0
- package/dist/init/existing-rules-extractor.d.ts +43 -0
- package/dist/init/existing-rules-extractor.d.ts.map +1 -0
- package/dist/init/existing-rules-extractor.js +226 -0
- package/dist/init/existing-rules-extractor.js.map +1 -0
- package/dist/init/file-scanner.d.ts +40 -0
- package/dist/init/file-scanner.d.ts.map +1 -0
- package/dist/init/file-scanner.js +153 -0
- package/dist/init/file-scanner.js.map +1 -0
- package/dist/init/framework-detector.d.ts +57 -0
- package/dist/init/framework-detector.d.ts.map +1 -0
- package/dist/init/framework-detector.js +277 -0
- package/dist/init/framework-detector.js.map +1 -0
- package/dist/init/language-detector.d.ts +31 -0
- package/dist/init/language-detector.d.ts.map +1 -0
- package/dist/init/language-detector.js +205 -0
- package/dist/init/language-detector.js.map +1 -0
- package/dist/init/project-analyzer.d.ts +62 -0
- package/dist/init/project-analyzer.d.ts.map +1 -0
- package/dist/init/project-analyzer.js +294 -0
- package/dist/init/project-analyzer.js.map +1 -0
- package/dist/langgraph-client.d.ts +20 -0
- package/dist/langgraph-client.d.ts.map +1 -0
- package/dist/langgraph-client.js +245 -0
- package/dist/langgraph-client.js.map +1 -0
- package/dist/mcp/mcp-client.d.ts +23 -0
- package/dist/mcp/mcp-client.d.ts.map +1 -0
- package/dist/mcp/mcp-client.js +194 -0
- package/dist/mcp/mcp-client.js.map +1 -0
- package/dist/mcp/mcp-tool-adapter.d.ts +22 -0
- package/dist/mcp/mcp-tool-adapter.d.ts.map +1 -0
- package/dist/mcp/mcp-tool-adapter.js +49 -0
- package/dist/mcp/mcp-tool-adapter.js.map +1 -0
- package/dist/message-handler.d.ts +7 -0
- package/dist/message-handler.d.ts.map +1 -0
- package/dist/message-handler.js +53 -0
- package/dist/message-handler.js.map +1 -0
- package/dist/prompt-history.d.ts +14 -0
- package/dist/prompt-history.d.ts.map +1 -0
- package/dist/prompt-history.js +88 -0
- package/dist/prompt-history.js.map +1 -0
- package/dist/tool-calling/index.d.ts +6 -0
- package/dist/tool-calling/index.d.ts.map +1 -0
- package/dist/tool-calling/index.js +5 -0
- package/dist/tool-calling/index.js.map +1 -0
- package/dist/tool-calling/json-parser.d.ts +7 -0
- package/dist/tool-calling/json-parser.d.ts.map +1 -0
- package/dist/tool-calling/json-parser.js +168 -0
- package/dist/tool-calling/json-parser.js.map +1 -0
- package/dist/tool-calling/xml-parser.d.ts +34 -0
- package/dist/tool-calling/xml-parser.d.ts.map +1 -0
- package/dist/tool-calling/xml-parser.js +113 -0
- package/dist/tool-calling/xml-parser.js.map +1 -0
- package/dist/tools/create-file.d.ts +3 -0
- package/dist/tools/create-file.d.ts.map +1 -0
- package/dist/tools/create-file.js +66 -0
- package/dist/tools/create-file.js.map +1 -0
- package/dist/tools/delete-lines.d.ts +3 -0
- package/dist/tools/delete-lines.d.ts.map +1 -0
- package/dist/tools/delete-lines.js +218 -0
- package/dist/tools/delete-lines.js.map +1 -0
- package/dist/tools/execute-bash.d.ts +3 -0
- package/dist/tools/execute-bash.d.ts.map +1 -0
- package/dist/tools/execute-bash.js +107 -0
- package/dist/tools/execute-bash.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +23 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/insert-lines.d.ts +3 -0
- package/dist/tools/insert-lines.d.ts.map +1 -0
- package/dist/tools/insert-lines.js +185 -0
- package/dist/tools/insert-lines.js.map +1 -0
- package/dist/tools/read-file.d.ts +3 -0
- package/dist/tools/read-file.d.ts.map +1 -0
- package/dist/tools/read-file.js +81 -0
- package/dist/tools/read-file.js.map +1 -0
- package/dist/tools/read-many-files.d.ts +3 -0
- package/dist/tools/read-many-files.d.ts.map +1 -0
- package/dist/tools/read-many-files.js +109 -0
- package/dist/tools/read-many-files.js.map +1 -0
- package/dist/tools/replace-lines.d.ts +3 -0
- package/dist/tools/replace-lines.d.ts.map +1 -0
- package/dist/tools/replace-lines.js +220 -0
- package/dist/tools/replace-lines.js.map +1 -0
- package/dist/tools/tool-manager.d.ts +54 -0
- package/dist/tools/tool-manager.d.ts.map +1 -0
- package/dist/tools/tool-manager.js +108 -0
- package/dist/tools/tool-manager.js.map +1 -0
- package/dist/types/app.d.ts +46 -0
- package/dist/types/app.d.ts.map +1 -0
- package/dist/types/app.js +2 -0
- package/dist/types/app.js.map +1 -0
- package/dist/types/commands.d.ts +36 -0
- package/dist/types/commands.d.ts.map +1 -0
- package/dist/types/commands.js +2 -0
- package/dist/types/commands.js.map +1 -0
- package/dist/types/components.d.ts +87 -0
- package/dist/types/components.d.ts.map +1 -0
- package/dist/types/components.js +2 -0
- package/dist/types/components.js.map +1 -0
- package/dist/types/config.d.ts +35 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/core.d.ts +57 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +2 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/hooks.d.ts +26 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/hooks.js +2 -0
- package/dist/types/hooks.js.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +12 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/mcp.d.ts +19 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +2 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/tools.d.ts +31 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +2 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types/ui.d.ts +22 -0
- package/dist/types/ui.d.ts.map +1 -0
- package/dist/types/ui.js +2 -0
- package/dist/types/ui.js.map +1 -0
- package/dist/types/utils.d.ts +19 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js +2 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/utils/message-queue.d.ts +8 -0
- package/dist/utils/message-queue.d.ts.map +1 -0
- package/dist/utils/message-queue.js +50 -0
- package/dist/utils/message-queue.js.map +1 -0
- package/dist/utils/programming-language-helper.d.ts +2 -0
- package/dist/utils/programming-language-helper.d.ts.map +1 -0
- package/dist/utils/programming-language-helper.js +32 -0
- package/dist/utils/programming-language-helper.js.map +1 -0
- package/dist/utils/prompt-processor.d.ts +6 -0
- package/dist/utils/prompt-processor.d.ts.map +1 -0
- package/dist/utils/prompt-processor.js +103 -0
- package/dist/utils/prompt-processor.js.map +1 -0
- package/dist/utils/update-checker.d.ts +6 -0
- package/dist/utils/update-checker.d.ts.map +1 -0
- package/dist/utils/update-checker.js +120 -0
- package/dist/utils/update-checker.js.map +1 -0
- package/package.json +97 -0
- package/source/app/prompts/main-prompt.md +107 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2025 Nano Collective
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
# Nanocoder
|
|
2
|
+
|
|
3
|
+
A local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter. Built with privacy and control in mind, Nanocoder supports multiple AI providers with tool support for file operations and command execution.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [FAQs](#faqs)
|
|
10
|
+
- [Installation](#installation)
|
|
11
|
+
- [For Users (Recommended)](#for-users-recommended)
|
|
12
|
+
- [For Development](#for-development)
|
|
13
|
+
- [Configuration](#configuration)
|
|
14
|
+
- [AI Provider Setup](#ai-provider-setup)
|
|
15
|
+
- [MCP (Model Context Protocol) Servers](#mcp-model-context-protocol-servers)
|
|
16
|
+
- [User Preferences](#user-preferences)
|
|
17
|
+
- [Commands](#commands)
|
|
18
|
+
- [Built-in Commands](#built-in-commands)
|
|
19
|
+
- [Custom Commands](#custom-commands)
|
|
20
|
+
- [Features](#features)
|
|
21
|
+
- [Multi-Provider Support](#-multi-provider-support)
|
|
22
|
+
- [Advanced Tool System](#️-advanced-tool-system)
|
|
23
|
+
- [Custom Command System](#-custom-command-system)
|
|
24
|
+
- [Enhanced User Experience](#-enhanced-user-experience)
|
|
25
|
+
- [Developer Features](#️-developer-features)
|
|
26
|
+
- [Community](#community)
|
|
27
|
+
|
|
28
|
+
## FAQs
|
|
29
|
+
|
|
30
|
+
### What is Nanocoder?
|
|
31
|
+
|
|
32
|
+
Nanocoder is a local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter. Built with privacy and control in mind, Nanocoder supports any AI provider that has an OpenAI compatible end-point, tool and non-tool calling models.
|
|
33
|
+
|
|
34
|
+
### How is this different to OpenCode?
|
|
35
|
+
|
|
36
|
+
This comes down to philosophy. OpenCode is a great tool, but it's owned and managed by a venture-backed company that restricts community and open-source involvement to the outskirts. With Nanocoder, the focus is on building a true community-led project where anyone can contribute openly and directly. We believe AI is too powerful to be in the hands of big corporations and everyone should have access to it.
|
|
37
|
+
|
|
38
|
+
We also strongly believe in the "local-first" approach, where your data, models, and processing stay on your machine whenever possible to ensure maximum privacy and user control. Beyond that, we're actively pushing to develop advancements and frameworks for small, local models to be effective at coding locally.
|
|
39
|
+
|
|
40
|
+
Not everyone will agree with this philosophy, and that's okay. We believe in fostering an inclusive community that's focused on open collaboration and privacy-first AI coding tools.
|
|
41
|
+
|
|
42
|
+
### I want to be involved, how do I start?
|
|
43
|
+
|
|
44
|
+
Firstly, we would love for you to be involved. You can get started contributing to Nanocoder in several ways, check out the [Community](#community) section of this README.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
### For Users (Recommended)
|
|
49
|
+
|
|
50
|
+
Install globally and use anywhere:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install -g @nanocollective/nanocoder
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Then run in any directory:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
nanocoder
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### For Development
|
|
63
|
+
|
|
64
|
+
If you want to contribute or modify Nanocoder:
|
|
65
|
+
|
|
66
|
+
**Prerequisites:**
|
|
67
|
+
|
|
68
|
+
- Node.js 18+
|
|
69
|
+
- npm
|
|
70
|
+
|
|
71
|
+
**Setup:**
|
|
72
|
+
|
|
73
|
+
1. Clone and install dependencies:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git clone [repo-url]
|
|
77
|
+
cd nanocoder
|
|
78
|
+
npm install
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
2. Build the project:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm run build
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
3. Run locally:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm run start
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Or build and run in one command:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm run dev
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Configuration
|
|
100
|
+
|
|
101
|
+
### AI Provider Setup
|
|
102
|
+
|
|
103
|
+
Nanocoder supports any OpenAI-compatible API through a unified provider configuration. Create `agents.config.json` in your **working directory** (where you run `nanocoder`):
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"nanocoder": {
|
|
108
|
+
"providers": [
|
|
109
|
+
{
|
|
110
|
+
"name": "llama-cpp",
|
|
111
|
+
"baseUrl": "http://localhost:8080/v1",
|
|
112
|
+
"models": ["qwen3-coder:a3b", "deepseek-v3.1"]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "Ollama",
|
|
116
|
+
"baseUrl": "http://localhost:11434/v1",
|
|
117
|
+
"models": ["qwen2.5-coder:14b", "llama3.2"]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "OpenRouter",
|
|
121
|
+
"baseUrl": "https://openrouter.ai/api/v1",
|
|
122
|
+
"apiKey": "your-openrouter-api-key",
|
|
123
|
+
"models": ["openai/gpt-4o-mini", "anthropic/claude-3-haiku"]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "LM Studio",
|
|
127
|
+
"baseUrl": "http://localhost:1234/v1",
|
|
128
|
+
"models": ["local-model"]
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Common Provider Examples:**
|
|
136
|
+
|
|
137
|
+
- **llama.cpp server**: `"baseUrl": "http://localhost:8080/v1"`
|
|
138
|
+
- **llama-swap**: `"baseUrl": "http://localhost:9292/v1"`
|
|
139
|
+
- **Ollama (Local)**:
|
|
140
|
+
|
|
141
|
+
- First run: `ollama pull qwen2.5-coder:14b`
|
|
142
|
+
- Use: `"baseUrl": "http://localhost:11434/v1"`
|
|
143
|
+
|
|
144
|
+
- **OpenRouter (Cloud)**:
|
|
145
|
+
|
|
146
|
+
- Use: `"baseUrl": "https://openrouter.ai/api/v1"`
|
|
147
|
+
- Requires: `"apiKey": "your-api-key"`
|
|
148
|
+
|
|
149
|
+
- **LM Studio**: `"baseUrl": "http://localhost:1234/v1"`
|
|
150
|
+
- **vLLM**: `"baseUrl": "http://localhost:8000/v1"`
|
|
151
|
+
- **LocalAI**: `"baseUrl": "http://localhost:8080/v1"`
|
|
152
|
+
- **OpenAI**: `"baseUrl": "https://api.openai.com/v1"`
|
|
153
|
+
|
|
154
|
+
**Provider Configuration:**
|
|
155
|
+
|
|
156
|
+
- `name`: Display name used in `/provider` command
|
|
157
|
+
- `baseUrl`: OpenAI-compatible API endpoint
|
|
158
|
+
- `apiKey`: API key (optional for local servers)
|
|
159
|
+
- `models`: Available model list for `/model` command
|
|
160
|
+
|
|
161
|
+
### MCP (Model Context Protocol) Servers
|
|
162
|
+
|
|
163
|
+
Nanocoder supports connecting to MCP servers to extend its capabilities with additional tools. Configure MCP servers in your `agents.config.json`:
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"nanocoder": {
|
|
168
|
+
"mcpServers": [
|
|
169
|
+
{
|
|
170
|
+
"name": "filesystem",
|
|
171
|
+
"command": "npx",
|
|
172
|
+
"args": [
|
|
173
|
+
"@modelcontextprotocol/server-filesystem",
|
|
174
|
+
"/path/to/allowed/directory"
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "github",
|
|
179
|
+
"command": "npx",
|
|
180
|
+
"args": ["@modelcontextprotocol/server-github"],
|
|
181
|
+
"env": {
|
|
182
|
+
"GITHUB_TOKEN": "your-github-token"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "custom-server",
|
|
187
|
+
"command": "python",
|
|
188
|
+
"args": ["path/to/server.py"],
|
|
189
|
+
"env": {
|
|
190
|
+
"API_KEY": "your-api-key"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
When MCP servers are configured, Nanocoder will:
|
|
199
|
+
|
|
200
|
+
- Automatically connect to all configured servers on startup
|
|
201
|
+
- Make all server tools available to the AI model
|
|
202
|
+
- Show connected servers and their tools with the `/mcp` command
|
|
203
|
+
|
|
204
|
+
Popular MCP servers:
|
|
205
|
+
|
|
206
|
+
- **Filesystem**: Enhanced file operations
|
|
207
|
+
- **GitHub**: Repository management
|
|
208
|
+
- **Brave Search**: Web search capabilities
|
|
209
|
+
- **Memory**: Persistent context storage
|
|
210
|
+
- [View more MCP servers](https://github.com/modelcontextprotocol/servers)
|
|
211
|
+
|
|
212
|
+
> **Note**: The `agents.config.json` file should be placed in the directory where you run Nanocoder, allowing for project-by-project configuration with different models or API keys per repository.
|
|
213
|
+
|
|
214
|
+
### User Preferences
|
|
215
|
+
|
|
216
|
+
Nanocoder automatically saves your preferences to remember your choices across sessions. Preferences are stored in `~/.nanocoder-preferences.json` in your home directory.
|
|
217
|
+
|
|
218
|
+
**What gets saved automatically:**
|
|
219
|
+
|
|
220
|
+
- **Last provider used**: The AI provider you last selected (by name from your configuration)
|
|
221
|
+
- **Last model per provider**: Your preferred model for each provider
|
|
222
|
+
- **Session continuity**: Automatically switches back to your preferred provider/model when restarting
|
|
223
|
+
|
|
224
|
+
**How it works:**
|
|
225
|
+
|
|
226
|
+
- When you switch providers with `/provider`, your choice is saved
|
|
227
|
+
- When you switch models with `/model`, the selection is saved for that specific provider
|
|
228
|
+
- Next time you start Nanocoder, it will use your last provider and model
|
|
229
|
+
- Each provider remembers its own preferred model independently
|
|
230
|
+
|
|
231
|
+
**Manual management:**
|
|
232
|
+
|
|
233
|
+
- View current preferences: The file is human-readable JSON
|
|
234
|
+
- Reset preferences: Delete `~/.nanocoder-preferences.json` to start fresh
|
|
235
|
+
- No manual editing needed: Use the `/provider` and `/model` commands instead
|
|
236
|
+
|
|
237
|
+
### Commands
|
|
238
|
+
|
|
239
|
+
#### Built-in Commands
|
|
240
|
+
|
|
241
|
+
- `/help` - Show available commands
|
|
242
|
+
- `/init` - Initialize project with intelligent analysis, create AGENTS.md and configuration files
|
|
243
|
+
- `/clear` - Clear chat history
|
|
244
|
+
- `/model` - Switch between available models
|
|
245
|
+
- `/provider` - Switch between configured AI providers
|
|
246
|
+
- `/mcp` - Show connected MCP servers and their tools
|
|
247
|
+
- `/debug` - Toggle logging levels (silent/normal/verbose)
|
|
248
|
+
- `/custom-commands` - List all custom commands
|
|
249
|
+
- `/exit` - Exit the application
|
|
250
|
+
- `/export` - Export current session to markdown file
|
|
251
|
+
- `/theme` - Select a theme for the Nanocoder CLI
|
|
252
|
+
- `/update` - Update Nanocoder to the latest version
|
|
253
|
+
- `!command` - Execute bash commands directly without leaving Nanocoder (output becomes context for the LLM)
|
|
254
|
+
|
|
255
|
+
#### Custom Commands
|
|
256
|
+
|
|
257
|
+
Nanocoder supports custom commands defined as markdown files in the `.nanocoder/commands` directory. Like `agents.config.json`, this directory is created per codebase, allowing you to create reusable prompts with parameters and organize them by category specific to each project.
|
|
258
|
+
|
|
259
|
+
**Example custom command** (`.nanocoder/commands/test.md`):
|
|
260
|
+
|
|
261
|
+
```markdown
|
|
262
|
+
---
|
|
263
|
+
description: 'Generate comprehensive unit tests for the specified component'
|
|
264
|
+
aliases: ['testing', 'spec']
|
|
265
|
+
parameters:
|
|
266
|
+
- name: 'component'
|
|
267
|
+
description: 'The component or function to test'
|
|
268
|
+
required: true
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
Generate comprehensive unit tests for {{component}}. Include:
|
|
272
|
+
|
|
273
|
+
- Happy path scenarios
|
|
274
|
+
- Edge cases and error handling
|
|
275
|
+
- Mock dependencies where appropriate
|
|
276
|
+
- Clear test descriptions
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**Usage**: `/test component="UserService"`
|
|
280
|
+
|
|
281
|
+
**Features**:
|
|
282
|
+
|
|
283
|
+
- YAML frontmatter for metadata (description, aliases, parameters)
|
|
284
|
+
- Template variable substitution with `{{parameter}}` syntax
|
|
285
|
+
- Namespace support through directories (e.g., `/refactor:dry`)
|
|
286
|
+
- Autocomplete integration for command discovery
|
|
287
|
+
- Parameter validation and prompting
|
|
288
|
+
|
|
289
|
+
**Pre-installed Commands**:
|
|
290
|
+
|
|
291
|
+
- `/test` - Generate comprehensive unit tests for components
|
|
292
|
+
- `/review` - Perform thorough code reviews with suggestions
|
|
293
|
+
- `/refactor:dry` - Apply DRY (Don't Repeat Yourself) principle
|
|
294
|
+
- `/refactor:solid` - Apply SOLID design principles
|
|
295
|
+
|
|
296
|
+
## Features
|
|
297
|
+
|
|
298
|
+
### 🔌 Multi-Provider Support
|
|
299
|
+
|
|
300
|
+
- **Universal OpenAI compatibility**: Works with any OpenAI-compatible API
|
|
301
|
+
- **Local providers**: Ollama, LM Studio, vLLM, LocalAI, llama.cpp
|
|
302
|
+
- **Cloud providers**: OpenRouter, OpenAI, and other hosted services
|
|
303
|
+
- **Smart fallback**: Automatically switches to available providers if one fails
|
|
304
|
+
- **Per-provider preferences**: Remembers your preferred model for each provider
|
|
305
|
+
- **Dynamic configuration**: Add any provider with just a name and endpoint
|
|
306
|
+
|
|
307
|
+
### 🛠️ Advanced Tool System
|
|
308
|
+
|
|
309
|
+
- **Built-in tools**: File operations, bash command execution
|
|
310
|
+
- **MCP (Model Context Protocol) servers**: Extend capabilities with any MCP-compatible tool
|
|
311
|
+
- **Dynamic tool loading**: Tools are loaded on-demand from configured MCP servers
|
|
312
|
+
- **Tool approval**: Optional confirmation before executing potentially destructive operations
|
|
313
|
+
|
|
314
|
+
### 📝 Custom Command System
|
|
315
|
+
|
|
316
|
+
- **Markdown-based commands**: Define reusable prompts in `.nanocoder/commands/`
|
|
317
|
+
- **Template variables**: Use `{{parameter}}` syntax for dynamic content
|
|
318
|
+
- **Namespace organization**: Organize commands in folders (e.g., `refactor/dry.md`)
|
|
319
|
+
- **Autocomplete support**: Tab completion for command discovery
|
|
320
|
+
- **Rich metadata**: YAML frontmatter for descriptions, aliases, and parameters
|
|
321
|
+
|
|
322
|
+
### 🎯 Enhanced User Experience
|
|
323
|
+
|
|
324
|
+
- **Smart autocomplete**: Tab completion for commands with real-time suggestions
|
|
325
|
+
- **Prompt history**: Access and reuse previous prompts with `/history`
|
|
326
|
+
- **Configurable logging**: Silent, normal, or verbose output levels
|
|
327
|
+
- **Colorized output**: Syntax highlighting and structured display
|
|
328
|
+
- **Session persistence**: Maintains context and preferences across sessions
|
|
329
|
+
- **Real-time indicators**: Shows token usage, timing, and processing status
|
|
330
|
+
- **First-time directory security disclaimer**: Prompts on first run and stores a per-project trust decision to prevent accidental exposure of local code or secrets.
|
|
331
|
+
|
|
332
|
+
### ⚙️ Developer Features
|
|
333
|
+
|
|
334
|
+
- **TypeScript-first**: Full type safety and IntelliSense support
|
|
335
|
+
- **Extensible architecture**: Plugin-style system for adding new capabilities
|
|
336
|
+
- **Project-specific config**: Different settings per project via `agents.config.json`
|
|
337
|
+
- **Debug tools**: Built-in debugging commands and verbose logging
|
|
338
|
+
- **Error resilience**: Graceful handling of provider failures and network issues
|
|
339
|
+
|
|
340
|
+
## Community
|
|
341
|
+
|
|
342
|
+
We're a small community-led team building Nanocoder and would love your help! Whether you're interested in contributing code, documentation, or just being part of our community, there are several ways to get involved.
|
|
343
|
+
|
|
344
|
+
**If you want to contribute to the code:**
|
|
345
|
+
|
|
346
|
+
- Read our detailed [CONTRIBUTING.md](CONTRIBUTING.md) guide for information on development setup, coding standards, and how to submit your changes.
|
|
347
|
+
|
|
348
|
+
**If you want to be part of our community or help with other aspects like design or marketing:**
|
|
349
|
+
|
|
350
|
+
- Join our Discord server to connect with other users, ask questions, share ideas, and get help: [Join our Discord server](https://discord.gg/ktPDV6rekE)
|
|
351
|
+
|
|
352
|
+
- Head to our GitHub issues or discussions to open and join current conversations with others in the community.
|
|
353
|
+
|
|
354
|
+
**What does Nanocoder you need help with?**
|
|
355
|
+
|
|
356
|
+
Nanocoder could benefit from help all across the board. Such as:
|
|
357
|
+
|
|
358
|
+
- Adding support for new AI providers
|
|
359
|
+
- Improving tool functionality
|
|
360
|
+
- Enhancing the user experience
|
|
361
|
+
- Writing documentation
|
|
362
|
+
- Reporting bugs or suggesting features
|
|
363
|
+
- Marketing and getting the word out
|
|
364
|
+
- Design and building more great software
|
|
365
|
+
|
|
366
|
+
All contributions and community participation are welcome!
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LLMClient, ProviderType } from '../../types/core.js';
|
|
3
|
+
import { ToolManager } from '../../tools/tool-manager.js';
|
|
4
|
+
import { CustomCommandLoader } from '../../custom-commands/loader.js';
|
|
5
|
+
import { CustomCommandExecutor } from '../../custom-commands/executor.js';
|
|
6
|
+
interface UseAppInitializationProps {
|
|
7
|
+
setClient: (client: LLMClient | null) => void;
|
|
8
|
+
setCurrentModel: (model: string) => void;
|
|
9
|
+
setCurrentProvider: (provider: ProviderType) => void;
|
|
10
|
+
setToolManager: (manager: ToolManager | null) => void;
|
|
11
|
+
setCustomCommandLoader: (loader: CustomCommandLoader | null) => void;
|
|
12
|
+
setCustomCommandExecutor: (executor: CustomCommandExecutor | null) => void;
|
|
13
|
+
setCustomCommandCache: (cache: Map<string, any>) => void;
|
|
14
|
+
setStartChat: (start: boolean) => void;
|
|
15
|
+
setMcpInitialized: (initialized: boolean) => void;
|
|
16
|
+
addToChatQueue: (component: React.ReactNode) => void;
|
|
17
|
+
componentKeyCounter: number;
|
|
18
|
+
customCommandCache: Map<string, any>;
|
|
19
|
+
}
|
|
20
|
+
export declare function useAppInitialization({ setClient, setCurrentModel, setCurrentProvider, setToolManager, setCustomCommandLoader, setCustomCommandExecutor, setCustomCommandCache, setStartChat, setMcpInitialized, addToChatQueue, componentKeyCounter, customCommandCache, }: UseAppInitializationProps): {
|
|
21
|
+
initializeClient: (preferredProvider?: ProviderType) => Promise<void>;
|
|
22
|
+
loadCustomCommands: (loader: CustomCommandLoader) => Promise<void>;
|
|
23
|
+
initializeMCPServers: (toolManager: ToolManager) => Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=useAppInitialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAppInitialization.d.ts","sourceRoot":"","sources":["../../../source/app/hooks/useAppInitialization.tsx"],"names":[],"mappings":"AAAA,OAA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ACjB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GAClB,EAAE,yBAAyB;2CAEyB,YAAY;iCA4BtB,mBAAmB;wCA4BZ,WAAW;EAmJ5D"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { ToolManager } from '../../tools/tool-manager.js';
|
|
4
|
+
import { CustomCommandLoader } from '../../custom-commands/loader.js';
|
|
5
|
+
import { CustomCommandExecutor } from '../../custom-commands/executor.js';
|
|
6
|
+
import { createLLMClient } from '../../client-factory.js';
|
|
7
|
+
import { getLastUsedModel, loadPreferences, updateLastUsed, } from '../../config/preferences.js';
|
|
8
|
+
import { setToolManagerGetter, setToolRegistryGetter, } from '../../message-handler.js';
|
|
9
|
+
import { commandRegistry } from '../../commands.js';
|
|
10
|
+
import { shouldLog } from '../../config/logging.js';
|
|
11
|
+
import { appConfig } from '../../config/index.js';
|
|
12
|
+
import { clearCommand, commandsCommand, debugCommand, exitCommand, exportCommand, helpCommand, initCommand, mcpCommand, modelCommand, providerCommand, themeCommand, updateCommand, } from '../../commands/index.js';
|
|
13
|
+
import SuccessMessage from '../../components/success-message.js';
|
|
14
|
+
import ErrorMessage from '../../components/error-message.js';
|
|
15
|
+
import InfoMessage from '../../components/info-message.js';
|
|
16
|
+
export function useAppInitialization({ setClient, setCurrentModel, setCurrentProvider, setToolManager, setCustomCommandLoader, setCustomCommandExecutor, setCustomCommandCache, setStartChat, setMcpInitialized, addToChatQueue, componentKeyCounter, customCommandCache, }) {
|
|
17
|
+
// Initialize LLM client and model
|
|
18
|
+
const initializeClient = async (preferredProvider) => {
|
|
19
|
+
const { client, actualProvider } = await createLLMClient(preferredProvider);
|
|
20
|
+
setClient(client);
|
|
21
|
+
setCurrentProvider(actualProvider);
|
|
22
|
+
// Try to use the last used model for this provider
|
|
23
|
+
const lastUsedModel = getLastUsedModel(actualProvider);
|
|
24
|
+
let finalModel;
|
|
25
|
+
if (lastUsedModel) {
|
|
26
|
+
const availableModels = await client.getAvailableModels();
|
|
27
|
+
if (availableModels.includes(lastUsedModel)) {
|
|
28
|
+
client.setModel(lastUsedModel);
|
|
29
|
+
finalModel = lastUsedModel;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
finalModel = client.getCurrentModel();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
finalModel = client.getCurrentModel();
|
|
37
|
+
}
|
|
38
|
+
setCurrentModel(finalModel);
|
|
39
|
+
// Save the preference - use actualProvider and the model that was actually set
|
|
40
|
+
updateLastUsed(actualProvider, finalModel);
|
|
41
|
+
};
|
|
42
|
+
// Load and cache custom commands
|
|
43
|
+
const loadCustomCommands = async (loader) => {
|
|
44
|
+
await loader.loadCommands();
|
|
45
|
+
const customCommands = loader.getAllCommands() || [];
|
|
46
|
+
// Populate command cache for better performance
|
|
47
|
+
customCommandCache.clear();
|
|
48
|
+
for (const command of customCommands) {
|
|
49
|
+
customCommandCache.set(command.name, command);
|
|
50
|
+
// Also cache aliases for quick lookup
|
|
51
|
+
if (command.metadata?.aliases) {
|
|
52
|
+
for (const alias of command.metadata.aliases) {
|
|
53
|
+
customCommandCache.set(alias, command);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (customCommands.length > 0 && shouldLog('info')) {
|
|
58
|
+
addToChatQueue(_jsx(InfoMessage, { message: `Loaded ${customCommands.length} custom commands from .nanocoder/commands`, hideBox: true }, `custom-commands-loaded-${componentKeyCounter}`));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
// Initialize MCP servers if configured
|
|
62
|
+
const initializeMCPServers = async (toolManager) => {
|
|
63
|
+
if (appConfig.mcpServers && appConfig.mcpServers.length > 0) {
|
|
64
|
+
// Add connecting message to chat queue
|
|
65
|
+
addToChatQueue(_jsx(InfoMessage, { message: `Connecting to ${appConfig.mcpServers.length} MCP server${appConfig.mcpServers.length > 1 ? 's' : ''}...`, hideBox: true }, `mcp-connecting-${componentKeyCounter}`));
|
|
66
|
+
// Define progress callback to show live updates
|
|
67
|
+
const onProgress = (result) => {
|
|
68
|
+
if (result.success) {
|
|
69
|
+
addToChatQueue(_jsx(SuccessMessage, { message: `Connected to MCP server "${result.serverName}" with ${result.toolCount} tools`, hideBox: true }, `mcp-success-${result.serverName}-${componentKeyCounter}`));
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
addToChatQueue(_jsx(ErrorMessage, { message: `Failed to connect to MCP server "${result.serverName}": ${result.error}`, hideBox: true }, `mcp-error-${result.serverName}-${componentKeyCounter}`));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
try {
|
|
76
|
+
await toolManager.initializeMCP(appConfig.mcpServers, onProgress);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
addToChatQueue(_jsx(ErrorMessage, { message: `Failed to initialize MCP servers: ${error}`, hideBox: true }, `mcp-fatal-error-${componentKeyCounter}`));
|
|
80
|
+
}
|
|
81
|
+
// Mark MCP as initialized whether successful or not
|
|
82
|
+
setMcpInitialized(true);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// No MCP servers configured, mark as initialized immediately
|
|
86
|
+
setMcpInitialized(true);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const start = async (newToolManager, newCustomCommandLoader, preferences) => {
|
|
90
|
+
try {
|
|
91
|
+
await initializeClient(preferences.lastProvider);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
// Don't crash the app - just show the error and continue without a client
|
|
95
|
+
addToChatQueue(_jsx(ErrorMessage, { message: `No providers available: ${error}`, hideBox: true }, `init-error-${componentKeyCounter}`));
|
|
96
|
+
// Leave client as null - the UI will handle this gracefully
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
await loadCustomCommands(newCustomCommandLoader);
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
addToChatQueue(_jsx(ErrorMessage, { message: `Failed to load custom commands: ${error}`, hideBox: true }, `commands-error-${componentKeyCounter}`));
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
const initializeApp = async () => {
|
|
107
|
+
setClient(null);
|
|
108
|
+
setCurrentModel('');
|
|
109
|
+
const newToolManager = new ToolManager();
|
|
110
|
+
const newCustomCommandLoader = new CustomCommandLoader();
|
|
111
|
+
const newCustomCommandExecutor = new CustomCommandExecutor();
|
|
112
|
+
setToolManager(newToolManager);
|
|
113
|
+
setCustomCommandLoader(newCustomCommandLoader);
|
|
114
|
+
setCustomCommandExecutor(newCustomCommandExecutor);
|
|
115
|
+
// Load preferences - we'll pass them directly to avoid state timing issues
|
|
116
|
+
const preferences = loadPreferences();
|
|
117
|
+
// Add info message to chat queue when preferences are loaded
|
|
118
|
+
addToChatQueue(_jsx(SuccessMessage, { message: "User preferences loaded...", hideBox: true }, "preferences-loaded"));
|
|
119
|
+
// Set up the tool registry getter for the message handler
|
|
120
|
+
setToolRegistryGetter(() => newToolManager.getToolRegistry());
|
|
121
|
+
// Set up the tool manager getter for commands that need it
|
|
122
|
+
setToolManagerGetter(() => newToolManager);
|
|
123
|
+
commandRegistry.register([
|
|
124
|
+
helpCommand,
|
|
125
|
+
exitCommand,
|
|
126
|
+
clearCommand,
|
|
127
|
+
modelCommand,
|
|
128
|
+
providerCommand,
|
|
129
|
+
commandsCommand,
|
|
130
|
+
debugCommand,
|
|
131
|
+
mcpCommand,
|
|
132
|
+
initCommand,
|
|
133
|
+
themeCommand,
|
|
134
|
+
exportCommand,
|
|
135
|
+
updateCommand,
|
|
136
|
+
]);
|
|
137
|
+
// Now start with the properly initialized objects (excluding MCP)
|
|
138
|
+
await start(newToolManager, newCustomCommandLoader, preferences);
|
|
139
|
+
setStartChat(true);
|
|
140
|
+
// Initialize MCP servers after UI is shown
|
|
141
|
+
await initializeMCPServers(newToolManager);
|
|
142
|
+
};
|
|
143
|
+
initializeApp();
|
|
144
|
+
}, []);
|
|
145
|
+
return {
|
|
146
|
+
initializeClient,
|
|
147
|
+
loadCustomCommands,
|
|
148
|
+
initializeMCPServers,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=useAppInitialization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAppInitialization.js","sourceRoot":"","sources":["../../../source/app/hooks/useAppInitialization.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAC,qBAAqB,EAAC,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,cAAc,GACd,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACN,oBAAoB,EACpB,qBAAqB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAChD,OAAO,EACN,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,aAAa,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,YAAY,MAAM,mCAAmC,CAAC;AAC7D,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAiB3D,MAAM,UAAU,oBAAoB,CAAC,EACpC,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,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MAAM,KAAK,CAAC,cAAc,EAAE,sBAAsB,EAAE,WAAW,CAAC,CAAC;YACjE,YAAY,CAAC,IAAI,CAAC,CAAC;YAEnB,2CAA2C;YAC3C,MAAM,oBAAoB,CAAC,cAAc,CAAC,CAAC;QAC5C,CAAC,CAAC;QAEF,aAAa,EAAE,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACN,gBAAgB;QAChB,kBAAkB;QAClB,oBAAoB;KACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { LLMClient, Message, ProviderType } from '../../types/core.js';
|
|
2
|
+
import { ToolManager } from '../../tools/tool-manager.js';
|
|
3
|
+
import { CustomCommandLoader } from '../../custom-commands/loader.js';
|
|
4
|
+
import { CustomCommandExecutor } from '../../custom-commands/executor.js';
|
|
5
|
+
import type { ThemePreset } from '../../types/ui.js';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
export interface ThinkingStats {
|
|
8
|
+
tokenCount: number;
|
|
9
|
+
contextSize: number;
|
|
10
|
+
totalTokensUsed: number;
|
|
11
|
+
tokensPerSecond?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ConversationContext {
|
|
14
|
+
updatedMessages: Message[];
|
|
15
|
+
assistantMsg: Message;
|
|
16
|
+
systemMessage: Message;
|
|
17
|
+
}
|
|
18
|
+
export declare function useAppState(): {
|
|
19
|
+
client: LLMClient | null;
|
|
20
|
+
messages: Message[];
|
|
21
|
+
displayMessages: Message[];
|
|
22
|
+
messageTokenCache: Map<string, number>;
|
|
23
|
+
currentModel: string;
|
|
24
|
+
currentProvider: ProviderType;
|
|
25
|
+
currentTheme: ThemePreset;
|
|
26
|
+
toolManager: ToolManager | null;
|
|
27
|
+
customCommandLoader: CustomCommandLoader | null;
|
|
28
|
+
customCommandExecutor: CustomCommandExecutor | null;
|
|
29
|
+
customCommandCache: Map<string, any>;
|
|
30
|
+
startChat: boolean;
|
|
31
|
+
mcpInitialized: boolean;
|
|
32
|
+
isThinking: boolean;
|
|
33
|
+
isCancelling: boolean;
|
|
34
|
+
thinkingStats: ThinkingStats;
|
|
35
|
+
abortController: AbortController | null;
|
|
36
|
+
isModelSelectionMode: boolean;
|
|
37
|
+
isProviderSelectionMode: boolean;
|
|
38
|
+
isThemeSelectionMode: boolean;
|
|
39
|
+
isToolConfirmationMode: boolean;
|
|
40
|
+
isToolExecuting: boolean;
|
|
41
|
+
isBashExecuting: boolean;
|
|
42
|
+
currentBashCommand: string;
|
|
43
|
+
pendingToolCalls: any[];
|
|
44
|
+
currentToolIndex: number;
|
|
45
|
+
completedToolResults: any[];
|
|
46
|
+
currentConversationContext: ConversationContext | null;
|
|
47
|
+
chatComponents: React.ReactNode[];
|
|
48
|
+
componentKeyCounter: number;
|
|
49
|
+
setClient: React.Dispatch<React.SetStateAction<LLMClient | null>>;
|
|
50
|
+
setMessages: React.Dispatch<React.SetStateAction<Message[]>>;
|
|
51
|
+
setDisplayMessages: React.Dispatch<React.SetStateAction<Message[]>>;
|
|
52
|
+
setMessageTokenCache: React.Dispatch<React.SetStateAction<Map<string, number>>>;
|
|
53
|
+
setCurrentModel: React.Dispatch<React.SetStateAction<string>>;
|
|
54
|
+
setCurrentProvider: React.Dispatch<React.SetStateAction<ProviderType>>;
|
|
55
|
+
setCurrentTheme: React.Dispatch<React.SetStateAction<ThemePreset>>;
|
|
56
|
+
setToolManager: React.Dispatch<React.SetStateAction<ToolManager | null>>;
|
|
57
|
+
setCustomCommandLoader: React.Dispatch<React.SetStateAction<CustomCommandLoader | null>>;
|
|
58
|
+
setCustomCommandExecutor: React.Dispatch<React.SetStateAction<CustomCommandExecutor | null>>;
|
|
59
|
+
setCustomCommandCache: React.Dispatch<React.SetStateAction<Map<string, any>>>;
|
|
60
|
+
setStartChat: React.Dispatch<React.SetStateAction<boolean>>;
|
|
61
|
+
setMcpInitialized: React.Dispatch<React.SetStateAction<boolean>>;
|
|
62
|
+
setIsThinking: React.Dispatch<React.SetStateAction<boolean>>;
|
|
63
|
+
setIsCancelling: React.Dispatch<React.SetStateAction<boolean>>;
|
|
64
|
+
setThinkingStats: React.Dispatch<React.SetStateAction<ThinkingStats>>;
|
|
65
|
+
setAbortController: React.Dispatch<React.SetStateAction<AbortController | null>>;
|
|
66
|
+
setIsModelSelectionMode: React.Dispatch<React.SetStateAction<boolean>>;
|
|
67
|
+
setIsProviderSelectionMode: React.Dispatch<React.SetStateAction<boolean>>;
|
|
68
|
+
setIsThemeSelectionMode: React.Dispatch<React.SetStateAction<boolean>>;
|
|
69
|
+
setIsToolConfirmationMode: React.Dispatch<React.SetStateAction<boolean>>;
|
|
70
|
+
setIsToolExecuting: React.Dispatch<React.SetStateAction<boolean>>;
|
|
71
|
+
setIsBashExecuting: React.Dispatch<React.SetStateAction<boolean>>;
|
|
72
|
+
setCurrentBashCommand: React.Dispatch<React.SetStateAction<string>>;
|
|
73
|
+
setPendingToolCalls: React.Dispatch<React.SetStateAction<any[]>>;
|
|
74
|
+
setCurrentToolIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
75
|
+
setCompletedToolResults: React.Dispatch<React.SetStateAction<any[]>>;
|
|
76
|
+
setCurrentConversationContext: React.Dispatch<React.SetStateAction<ConversationContext | null>>;
|
|
77
|
+
setChatComponents: React.Dispatch<React.SetStateAction<React.ReactNode[]>>;
|
|
78
|
+
setComponentKeyCounter: React.Dispatch<React.SetStateAction<number>>;
|
|
79
|
+
addToChatQueue: (component: React.ReactNode) => void;
|
|
80
|
+
getMessageTokens: (message: Message) => number;
|
|
81
|
+
updateMessages: (newMessages: Message[]) => void;
|
|
82
|
+
resetToolConfirmationState: () => void;
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=useAppState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAppState.d.ts","sourceRoot":"","sources":["../../../source/app/hooks/useAppState.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAC,qBAAqB,EAAC,MAAM,mCAAmC,CAAC;AAGxE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,aAAa;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IACnC,eAAe,EAAE,OAAO,EAAE,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAmDqB,KAAK,CAAC,SAAS;gCAmBf,OAAO;kCAaL,OAAO,EAAE;;EA6F1D"}
|