@umsai/ums-code 0.0.14-v1 → 0.1.4-v2
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/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +19 -11
- package/dist/src/commands/extensions/disable.d.ts +13 -0
- package/dist/src/commands/extensions/disable.js +56 -0
- package/dist/src/commands/extensions/disable.js.map +1 -0
- package/dist/src/commands/extensions/enable.d.ts +13 -0
- package/dist/src/commands/extensions/enable.js +59 -0
- package/dist/src/commands/extensions/enable.js.map +1 -0
- package/dist/src/commands/extensions/examples/context/QWEN.md +8 -0
- package/dist/src/commands/extensions/examples/context/qwen-extension.json +4 -0
- package/dist/src/commands/extensions/examples/custom-commands/commands/fs/grep-code.toml +6 -0
- package/dist/src/commands/extensions/examples/custom-commands/qwen-extension.json +4 -0
- package/dist/src/commands/extensions/examples/exclude-tools/qwen-extension.json +5 -0
- package/dist/src/commands/extensions/examples/mcp-server/example.ts +60 -0
- package/dist/src/commands/extensions/examples/mcp-server/package.json +18 -0
- package/dist/src/commands/extensions/examples/mcp-server/qwen-extension.json +11 -0
- package/dist/src/commands/extensions/examples/mcp-server/tsconfig.json +13 -0
- package/dist/src/commands/extensions/install.d.ts +14 -0
- package/dist/src/commands/extensions/install.js +78 -0
- package/dist/src/commands/extensions/install.js.map +1 -0
- package/dist/src/commands/extensions/install.test.d.ts +6 -0
- package/dist/src/commands/extensions/install.test.js +102 -0
- package/dist/src/commands/extensions/install.test.js.map +1 -0
- package/dist/src/commands/extensions/link.d.ts +12 -0
- package/dist/src/commands/extensions/link.js +37 -0
- package/dist/src/commands/extensions/link.js.map +1 -0
- package/dist/src/commands/extensions/list.d.ts +8 -0
- package/dist/src/commands/extensions/list.js +32 -0
- package/dist/src/commands/extensions/list.js.map +1 -0
- package/dist/src/commands/extensions/new.d.ts +7 -0
- package/dist/src/commands/extensions/new.js +90 -0
- package/dist/src/commands/extensions/new.js.map +1 -0
- package/dist/src/commands/extensions/new.test.d.ts +6 -0
- package/dist/src/commands/extensions/new.test.js +59 -0
- package/dist/src/commands/extensions/new.test.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.d.ts +12 -0
- package/dist/src/commands/extensions/uninstall.js +38 -0
- package/dist/src/commands/extensions/uninstall.js.map +1 -0
- package/dist/src/commands/extensions/uninstall.test.d.ts +6 -0
- package/dist/src/commands/extensions/uninstall.test.js +18 -0
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -0
- package/dist/src/commands/extensions/update.d.ts +13 -0
- package/dist/src/commands/extensions/update.js +104 -0
- package/dist/src/commands/extensions/update.js.map +1 -0
- package/dist/src/commands/extensions.d.ts +7 -0
- package/dist/src/commands/extensions.js +33 -0
- package/dist/src/commands/extensions.js.map +1 -0
- package/dist/src/commands/mcp/add.d.ts +7 -0
- package/dist/src/commands/mcp/add.js +172 -0
- package/dist/src/commands/mcp/add.js.map +1 -0
- package/dist/src/commands/mcp/list.d.ts +8 -0
- package/dist/src/commands/mcp/list.js +111 -0
- package/dist/src/commands/mcp/list.js.map +1 -0
- package/dist/src/commands/mcp/remove.d.ts +7 -0
- package/dist/src/commands/mcp/remove.js +44 -0
- package/dist/src/commands/mcp/remove.js.map +1 -0
- package/dist/src/commands/mcp.d.ts +7 -0
- package/dist/src/commands/mcp.js +23 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/config/auth.d.ts +2 -4
- package/dist/src/config/auth.js +15 -40
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/auth.test.d.ts +6 -0
- package/dist/src/config/auth.test.js +37 -0
- package/dist/src/config/auth.test.js.map +1 -0
- package/dist/src/config/config.d.ts +17 -10
- package/dist/src/config/config.js +379 -196
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +64 -3
- package/dist/src/config/extension.js +477 -61
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extensions/extensionEnablement.d.ts +47 -0
- package/dist/src/config/extensions/extensionEnablement.js +189 -0
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -0
- package/dist/src/config/extensions/extensionEnablement.test.d.ts +6 -0
- package/dist/src/config/extensions/extensionEnablement.test.js +333 -0
- package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -0
- package/dist/src/config/extensions/github.d.ts +30 -0
- package/dist/src/config/extensions/github.js +322 -0
- package/dist/src/config/extensions/github.js.map +1 -0
- package/dist/src/config/extensions/github.test.d.ts +6 -0
- package/dist/src/config/extensions/github.test.js +334 -0
- package/dist/src/config/extensions/github.test.js.map +1 -0
- package/dist/src/config/extensions/update.d.ts +19 -0
- package/dist/src/config/extensions/update.js +113 -0
- package/dist/src/config/extensions/update.js.map +1 -0
- package/dist/src/config/extensions/update.test.d.ts +6 -0
- package/dist/src/config/extensions/update.test.js +342 -0
- package/dist/src/config/extensions/update.test.js.map +1 -0
- package/dist/src/config/extensions/variableSchema.d.ts +36 -0
- package/dist/src/config/extensions/variableSchema.js +22 -0
- package/dist/src/config/extensions/variableSchema.js.map +1 -0
- package/dist/src/config/extensions/variables.d.ts +17 -0
- package/dist/src/config/extensions/variables.js +40 -0
- package/dist/src/config/extensions/variables.js.map +1 -0
- package/dist/src/config/extensions/variables.test.d.ts +6 -0
- package/dist/src/config/extensions/variables.test.js +17 -0
- package/dist/src/config/extensions/variables.test.js.map +1 -0
- package/dist/src/config/keyBindings.d.ts +70 -0
- package/dist/src/config/keyBindings.js +130 -0
- package/dist/src/config/keyBindings.js.map +1 -0
- package/dist/src/config/keyBindings.test.d.ts +6 -0
- package/dist/src/config/keyBindings.test.js +51 -0
- package/dist/src/config/keyBindings.test.js.map +1 -0
- package/dist/src/config/sandboxConfig.d.ts +2 -2
- package/dist/src/config/sandboxConfig.js +8 -10
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/settings.d.ts +22 -72
- package/dist/src/config/settings.js +425 -151
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +1102 -0
- package/dist/src/config/settingsSchema.js +1068 -0
- package/dist/src/config/settingsSchema.js.map +1 -0
- package/dist/src/config/settingsSchema.test.d.ts +6 -0
- package/dist/src/config/settingsSchema.test.js +201 -0
- package/dist/src/config/settingsSchema.test.js.map +1 -0
- package/dist/src/config/trustedFolders.d.ts +56 -0
- package/dist/src/config/trustedFolders.js +168 -0
- package/dist/src/config/trustedFolders.js.map +1 -0
- package/dist/src/config/trustedFolders.test.d.ts +6 -0
- package/dist/src/config/trustedFolders.test.js +340 -0
- package/dist/src/config/trustedFolders.test.js.map +1 -0
- package/dist/src/core/auth.d.ts +13 -0
- package/dist/src/core/auth.js +27 -0
- package/dist/src/core/auth.js.map +1 -0
- package/dist/src/core/initializer.d.ts +21 -0
- package/dist/src/core/initializer.js +33 -0
- package/dist/src/core/initializer.js.map +1 -0
- package/dist/src/core/theme.d.ts +12 -0
- package/dist/src/core/theme.js +20 -0
- package/dist/src/core/theme.js.map +1 -0
- package/dist/src/gemini.d.ts +4 -1
- package/dist/src/gemini.js +202 -154
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.d.ts +6 -0
- package/dist/src/gemini.test.js +390 -0
- package/dist/src/gemini.test.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +2 -1
- package/dist/src/generated/git-commit.js +2 -1
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/nonInteractiveCli.d.ts +3 -2
- package/dist/src/nonInteractiveCli.js +101 -88
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCliCommands.d.ts +17 -0
- package/dist/src/nonInteractiveCliCommands.js +79 -0
- package/dist/src/nonInteractiveCliCommands.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.d.ts +3 -4
- package/dist/src/services/BuiltinCommandLoader.js +18 -7
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.d.ts +6 -0
- package/dist/src/services/BuiltinCommandLoader.test.js +164 -0
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -0
- package/dist/src/services/CommandService.d.ts +2 -2
- package/dist/src/services/CommandService.test.d.ts +6 -0
- package/dist/src/services/CommandService.test.js +233 -0
- package/dist/src/services/CommandService.test.js.map +1 -0
- package/dist/src/services/FileCommandLoader.d.ts +5 -3
- package/dist/src/services/FileCommandLoader.js +38 -19
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.d.ts +14 -4
- package/dist/src/services/McpPromptLoader.js +89 -28
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.test.d.ts +6 -0
- package/dist/src/services/McpPromptLoader.test.js +341 -0
- package/dist/src/services/McpPromptLoader.test.js.map +1 -0
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +5 -10
- package/dist/src/services/prompt-processors/argumentProcessor.js +5 -12
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/atFileProcessor.d.ts +12 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js +62 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.js +174 -0
- package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +1 -0
- package/dist/src/services/prompt-processors/injectionParser.d.ts +29 -0
- package/dist/src/services/prompt-processors/injectionParser.js +60 -0
- package/dist/src/services/prompt-processors/injectionParser.js.map +1 -0
- package/dist/src/services/prompt-processors/injectionParser.test.d.ts +6 -0
- package/dist/src/services/prompt-processors/injectionParser.test.js +189 -0
- package/dist/src/services/prompt-processors/injectionParser.test.js.map +1 -0
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +11 -16
- package/dist/src/services/prompt-processors/shellProcessor.js +92 -41
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/types.d.ts +15 -8
- package/dist/src/services/prompt-processors/types.js +6 -0
- package/dist/src/services/prompt-processors/types.js.map +1 -1
- package/dist/src/services/types.d.ts +1 -1
- package/dist/src/test-utils/createExtension.d.ts +15 -0
- package/dist/src/test-utils/createExtension.js +25 -0
- package/dist/src/test-utils/createExtension.js.map +1 -0
- package/dist/src/test-utils/customMatchers.d.ts +14 -0
- package/dist/src/test-utils/customMatchers.js +40 -0
- package/dist/src/test-utils/customMatchers.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.d.ts +18 -0
- package/dist/src/test-utils/mockCommandContext.js +92 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.test.d.ts +6 -0
- package/dist/src/test-utils/mockCommandContext.test.js +51 -0
- package/dist/src/test-utils/mockCommandContext.test.js.map +1 -0
- package/dist/src/test-utils/render.d.ts +12 -0
- package/dist/src/test-utils/render.js +14 -0
- package/dist/src/test-utils/render.js.map +1 -0
- package/dist/src/ui/App.d.ts +1 -10
- package/dist/src/ui/App.js +27 -562
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/AppContainer.d.ts +17 -0
- package/dist/src/ui/AppContainer.js +1069 -0
- package/dist/src/ui/AppContainer.js.map +1 -0
- package/dist/src/ui/AppContainer.test.d.ts +6 -0
- package/dist/src/ui/AppContainer.test.js +831 -0
- package/dist/src/ui/AppContainer.test.js.map +1 -0
- package/dist/src/ui/IdeIntegrationNudge.d.ts +16 -0
- package/dist/src/ui/IdeIntegrationNudge.js +50 -0
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
- package/dist/src/ui/{components → auth}/AuthDialog.d.ts +7 -3
- package/dist/src/ui/{components → auth}/AuthDialog.js +42 -44
- package/dist/src/ui/auth/AuthDialog.js.map +1 -0
- package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
- package/dist/src/ui/auth/AuthDialog.test.js +362 -0
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
- package/dist/src/ui/{components → auth}/AuthInProgress.d.ts +1 -1
- package/dist/src/ui/auth/AuthInProgress.js +23 -0
- package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
- package/dist/src/ui/auth/useAuth.d.ts +24 -0
- package/dist/src/ui/auth/useAuth.js +108 -0
- package/dist/src/ui/auth/useAuth.js.map +1 -0
- package/dist/src/ui/colors.d.ts +1 -1
- package/dist/src/ui/commands/aboutCommand.d.ts +1 -1
- package/dist/src/ui/commands/aboutCommand.js +16 -6
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.d.ts +7 -0
- package/dist/src/ui/commands/agentsCommand.js +32 -0
- package/dist/src/ui/commands/agentsCommand.js.map +1 -0
- package/dist/src/ui/commands/approvalModeCommand.d.ts +7 -0
- package/dist/src/ui/commands/approvalModeCommand.js +340 -0
- package/dist/src/ui/commands/approvalModeCommand.js.map +1 -0
- package/dist/src/ui/commands/approvalModeCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/approvalModeCommand.test.js +293 -0
- package/dist/src/ui/commands/approvalModeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/authCommand.d.ts +1 -1
- package/dist/src/ui/commands/authCommand.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.js +27 -5
- package/dist/src/ui/commands/bugCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.d.ts +3 -1
- package/dist/src/ui/commands/chatCommand.js +120 -12
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.d.ts +1 -1
- package/dist/src/ui/commands/clearCommand.js +1 -2
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.d.ts +1 -1
- package/dist/src/ui/commands/compressCommand.js +2 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.d.ts +1 -1
- package/dist/src/ui/commands/copyCommand.js +2 -2
- package/dist/src/ui/commands/copyCommand.js.map +1 -1
- package/dist/src/ui/commands/corgiCommand.js +1 -0
- package/dist/src/ui/commands/corgiCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.d.ts +1 -1
- package/dist/src/ui/commands/directoryCommand.js +7 -8
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/docsCommand.js +1 -1
- package/dist/src/ui/commands/docsCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.js +92 -15
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/helpCommand.d.ts +1 -1
- package/dist/src/ui/commands/helpCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.d.ts +2 -3
- package/dist/src/ui/commands/ideCommand.js +107 -28
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.d.ts +2 -2
- package/dist/src/ui/commands/initCommand.js +20 -10
- package/dist/src/ui/commands/initCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.d.ts +1 -1
- package/dist/src/ui/commands/mcpCommand.js +98 -269
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.d.ts +1 -1
- package/dist/src/ui/commands/memoryCommand.js +143 -9
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.d.ts +7 -0
- package/dist/src/ui/commands/modelCommand.js +53 -0
- package/dist/src/ui/commands/modelCommand.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/modelCommand.test.js +137 -0
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -0
- package/dist/src/ui/commands/permissionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/{privacyCommand.js → permissionsCommand.js} +5 -5
- package/dist/src/ui/commands/permissionsCommand.js.map +1 -0
- package/dist/src/ui/commands/permissionsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/permissionsCommand.test.js +30 -0
- package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.d.ts +1 -0
- package/dist/src/ui/commands/quitCommand.js +25 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.d.ts +1 -1
- package/dist/src/ui/commands/restoreCommand.js +4 -8
- package/dist/src/ui/commands/restoreCommand.js.map +1 -1
- package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
- package/dist/src/ui/commands/settingsCommand.js +16 -0
- package/dist/src/ui/commands/settingsCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.d.ts +3 -1
- package/dist/src/ui/commands/setupGithubCommand.js +133 -27
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js +167 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/summaryCommand.d.ts +7 -0
- package/dist/src/ui/commands/summaryCommand.js +149 -0
- package/dist/src/ui/commands/summaryCommand.js.map +1 -0
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +13 -0
- package/dist/src/ui/commands/terminalSetupCommand.js +41 -0
- package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.d.ts +1 -1
- package/dist/src/ui/commands/themeCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.js +11 -25
- package/dist/src/ui/commands/toolsCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +31 -11
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/ums/umsInitCommand.d.ts +1 -1
- package/dist/src/ui/commands/ums/umsInitCommand.js +54 -20
- package/dist/src/ui/commands/ums/umsInitCommand.js.map +1 -1
- package/dist/src/ui/commands/vimCommand.d.ts +1 -1
- package/dist/src/ui/commands/vimCommand.js.map +1 -1
- package/dist/src/ui/components/AboutBox.d.ts +2 -1
- package/dist/src/ui/components/AboutBox.js +2 -2
- package/dist/src/ui/components/AboutBox.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.d.ts +13 -0
- package/dist/src/ui/components/AnsiOutput.js +12 -0
- package/dist/src/ui/components/AnsiOutput.js.map +1 -0
- package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
- package/dist/src/ui/components/AnsiOutput.test.js +97 -0
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
- package/dist/src/ui/components/AppHeader.d.ts +10 -0
- package/dist/src/ui/components/AppHeader.js +19 -0
- package/dist/src/ui/components/AppHeader.js.map +1 -0
- package/dist/src/ui/components/AsciiArt.d.ts +1 -0
- package/dist/src/ui/components/AsciiArt.js +8 -0
- package/dist/src/ui/components/AsciiArt.js.map +1 -1
- package/dist/src/ui/components/AutoAcceptIndicator.d.ts +1 -1
- package/dist/src/ui/components/AutoAcceptIndicator.js +12 -7
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/components/Composer.d.ts +6 -0
- package/dist/src/ui/components/Composer.js +54 -0
- package/dist/src/ui/components/Composer.js.map +1 -0
- package/dist/src/ui/components/Composer.test.d.ts +6 -0
- package/dist/src/ui/components/Composer.test.js +337 -0
- package/dist/src/ui/components/Composer.test.js.map +1 -0
- package/dist/src/ui/components/ConfigInitDisplay.d.ts +6 -0
- package/dist/src/ui/components/ConfigInitDisplay.js +38 -0
- package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -0
- package/dist/src/ui/components/ConsentPrompt.d.ts +13 -0
- package/dist/src/ui/components/ConsentPrompt.js +19 -0
- package/dist/src/ui/components/ConsentPrompt.js.map +1 -0
- package/dist/src/ui/components/ConsentPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/ConsentPrompt.test.js +67 -0
- package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +1 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +2 -2
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +24 -26
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +12 -0
- package/dist/src/ui/components/ContextUsageDisplay.js +36 -0
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/DebugProfiler.js +7 -6
- package/dist/src/ui/components/DebugProfiler.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +2 -2
- package/dist/src/ui/components/DetailedMessagesDisplay.js +8 -8
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/DialogManager.d.ts +12 -0
- package/dist/src/ui/components/DialogManager.js +130 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +4 -3
- package/dist/src/ui/components/EditorSettingsDialog.js +30 -23
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/ExitWarning.d.ts +7 -0
- package/dist/src/ui/components/ExitWarning.js +9 -0
- package/dist/src/ui/components/ExitWarning.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.d.ts +17 -0
- package/dist/src/ui/components/FolderTrustDialog.js +58 -0
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js +88 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/Footer.d.ts +2 -17
- package/dist/src/ui/components/Footer.js +38 -6
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +6 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.js +10 -3
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -1
- package/dist/src/ui/components/Header.d.ts +1 -2
- package/dist/src/ui/components/Header.js +14 -6
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Header.test.d.ts +6 -0
- package/dist/src/ui/components/Header.test.js +37 -0
- package/dist/src/ui/components/Header.test.js.map +1 -0
- package/dist/src/ui/components/Help.d.ts +2 -2
- package/dist/src/ui/components/Help.js +9 -6
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/Help.test.d.ts +6 -0
- package/dist/src/ui/components/Help.test.js +57 -0
- package/dist/src/ui/components/Help.test.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +7 -6
- package/dist/src/ui/components/HistoryItemDisplay.js +14 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js +174 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +11 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js +32 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js +57 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +15 -5
- package/dist/src/ui/components/InputPrompt.js +407 -76
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.d.ts +2 -2
- package/dist/src/ui/components/LoadingIndicator.js +11 -6
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/LoadingIndicator.test.js +194 -0
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js +37 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +28 -0
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
- package/dist/src/ui/components/MainContent.d.ts +6 -0
- package/dist/src/ui/components/MainContent.js +28 -0
- package/dist/src/ui/components/MainContent.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +1 -1
- package/dist/src/ui/components/MemoryUsageDisplay.js +6 -9
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.d.ts +11 -0
- package/dist/src/ui/components/ModelDialog.js +42 -0
- package/dist/src/ui/components/ModelDialog.js.map +1 -0
- package/dist/src/ui/components/ModelDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ModelDialog.test.js +158 -0
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.js +7 -7
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelSwitchDialog.d.ts +17 -0
- package/dist/src/ui/components/ModelSwitchDialog.js +41 -0
- package/dist/src/ui/components/ModelSwitchDialog.js.map +1 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.js +129 -0
- package/dist/src/ui/components/ModelSwitchDialog.test.js.map +1 -0
- package/dist/src/ui/components/Notifications.d.ts +6 -0
- package/dist/src/ui/components/Notifications.js +23 -0
- package/dist/src/ui/components/Notifications.js.map +1 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.d.ts +1 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.js +63 -44
- package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js +51 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +13 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js +48 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +154 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/PlanSummaryDisplay.d.ts +14 -0
- package/dist/src/ui/components/PlanSummaryDisplay.js +9 -0
- package/dist/src/ui/components/PlanSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.d.ts +4 -4
- package/dist/src/ui/components/PrepareLabel.js +67 -11
- package/dist/src/ui/components/PrepareLabel.js.map +1 -1
- package/dist/src/ui/components/PrepareLabel.test.d.ts +6 -0
- package/dist/src/ui/components/PrepareLabel.test.js +71 -0
- package/dist/src/ui/components/PrepareLabel.test.js.map +1 -0
- package/dist/src/ui/components/ProQuotaDialog.d.ts +13 -0
- package/dist/src/ui/components/ProQuotaDialog.js +23 -0
- package/dist/src/ui/components/ProQuotaDialog.js.map +1 -0
- package/dist/src/ui/components/ProQuotaDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ProQuotaDialog.test.js +58 -0
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.d.ts +9 -0
- package/dist/src/ui/components/QueuedMessageDisplay.js +20 -0
- package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +56 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -0
- package/dist/src/ui/components/QuitConfirmationDialog.d.ts +17 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js +48 -0
- package/dist/src/ui/components/QuitConfirmationDialog.js.map +1 -0
- package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
- package/dist/src/ui/components/QuittingDisplay.js +20 -0
- package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
- package/dist/src/ui/components/QwenOAuthProgress.d.ts +2 -2
- package/dist/src/ui/components/QwenOAuthProgress.js +7 -11
- package/dist/src/ui/components/QwenOAuthProgress.js.map +1 -1
- package/dist/src/ui/components/QwenOAuthProgress.test.d.ts +6 -0
- package/dist/src/ui/components/QwenOAuthProgress.test.js +363 -0
- package/dist/src/ui/components/QwenOAuthProgress.test.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +16 -0
- package/dist/src/ui/components/SettingsDialog.js +624 -0
- package/dist/src/ui/components/SettingsDialog.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.test.d.ts +6 -0
- package/dist/src/ui/components/SettingsDialog.test.js +1036 -0
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.js +12 -7
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +40 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
- package/dist/src/ui/components/ShellInputPrompt.js +36 -0
- package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.d.ts +1 -1
- package/dist/src/ui/components/ShellModeIndicator.js +2 -2
- package/dist/src/ui/components/ShellModeIndicator.js.map +1 -1
- package/dist/src/ui/components/ShowMoreLines.js +2 -2
- package/dist/src/ui/components/ShowMoreLines.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/StatsDisplay.js +10 -9
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +7 -2
- package/dist/src/ui/components/SuggestionsDisplay.js +16 -8
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.d.ts +3 -2
- package/dist/src/ui/components/ThemeDialog.js +25 -55
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ThemeDialog.test.js +75 -0
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
- package/dist/src/ui/components/Tips.d.ts +1 -1
- package/dist/src/ui/components/Tips.js +3 -2
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/TodoDisplay.d.ts +16 -0
- package/dist/src/ui/components/TodoDisplay.js +27 -0
- package/dist/src/ui/components/TodoDisplay.js.map +1 -0
- package/dist/src/ui/components/TodoDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/TodoDisplay.test.js +77 -0
- package/dist/src/ui/components/TodoDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.js +4 -4
- package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/UpdateNotification.js +2 -2
- package/dist/src/ui/components/UpdateNotification.js.map +1 -1
- package/dist/src/ui/components/WelcomeBackDialog.d.ts +13 -0
- package/dist/src/ui/components/WelcomeBackDialog.js +34 -0
- package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -0
- package/dist/src/ui/components/WorkspaceMigrationDialog.d.ts +11 -0
- package/dist/src/ui/components/WorkspaceMigrationDialog.js +45 -0
- package/dist/src/ui/components/WorkspaceMigrationDialog.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +2 -3
- package/dist/src/ui/components/messages/CompressionMessage.js +38 -8
- package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js +160 -0
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +3 -2
- package/dist/src/ui/components/messages/DiffRenderer.js +22 -17
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +6 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js +239 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -0
- package/dist/src/ui/components/messages/ErrorMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/ErrorMessage.js +2 -2
- package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.js +3 -2
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +1 -1
- package/dist/src/ui/components/messages/InfoMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/InfoMessage.js +7 -2
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/SummaryMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/SummaryMessage.js +35 -0
- package/dist/src/ui/components/messages/SummaryMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +4 -3
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +149 -38
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +165 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +5 -4
- package/dist/src/ui/components/messages/ToolGroupMessage.js +18 -15
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +261 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.d.ts +5 -1
- package/dist/src/ui/components/messages/ToolMessage.js +135 -16
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js +182 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/UserMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/UserMessage.js +6 -5
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.d.ts +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.js +2 -2
- package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
- package/dist/src/ui/components/messages/WarningMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/WarningMessage.js +10 -0
- package/dist/src/ui/components/messages/WarningMessage.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.d.ts +38 -0
- package/dist/src/ui/components/shared/BaseSelectionList.js +72 -0
- package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +6 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +376 -0
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +35 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +13 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +79 -0
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
- package/dist/src/ui/components/shared/EnumSelector.js +44 -0
- package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
- package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
- package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js +3 -3
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +6 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +154 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +3 -4
- package/dist/src/ui/components/shared/RadioButtonSelect.js +11 -109
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +134 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
- package/dist/src/ui/components/shared/ScopeSelector.js +14 -0
- package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
- package/dist/src/ui/components/shared/TextInput.d.ts +16 -0
- package/dist/src/ui/components/shared/TextInput.js +127 -0
- package/dist/src/ui/components/shared/TextInput.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +42 -6
- package/dist/src/ui/components/shared/text-buffer.js +530 -283
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.js +139 -152
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -1
- package/dist/src/ui/components/subagents/constants.d.ts +23 -0
- package/dist/src/ui/components/subagents/constants.js +67 -0
- package/dist/src/ui/components/subagents/constants.js.map +1 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.d.ts +15 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js +173 -0
- package/dist/src/ui/components/subagents/create/AgentCreationWizard.js.map +1 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.d.ts +15 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.js +43 -0
- package/dist/src/ui/components/subagents/create/ColorSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.js +164 -0
- package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.js +104 -0
- package/dist/src/ui/components/subagents/create/DescriptionInput.js.map +1 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js +34 -0
- package/dist/src/ui/components/subagents/create/GenerationMethodSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.d.ts +10 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.js +34 -0
- package/dist/src/ui/components/subagents/create/LocationSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.d.ts +26 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.js +28 -0
- package/dist/src/ui/components/subagents/create/TextEntryStep.js.map +1 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.d.ts +16 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.js +144 -0
- package/dist/src/ui/components/subagents/create/ToolSelector.js.map +1 -0
- package/dist/src/ui/components/subagents/index.d.ts +8 -0
- package/dist/src/ui/components/subagents/index.js +12 -0
- package/dist/src/ui/components/subagents/index.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.d.ts +13 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js +46 -0
- package/dist/src/ui/components/subagents/manage/ActionSelectionStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.d.ts +13 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js +33 -0
- package/dist/src/ui/components/subagents/manage/AgentDeleteStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.d.ts +15 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js +64 -0
- package/dist/src/ui/components/subagents/manage/AgentEditStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.d.ts +12 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js +224 -0
- package/dist/src/ui/components/subagents/manage/AgentSelectionStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.d.ts +11 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js +19 -0
- package/dist/src/ui/components/subagents/manage/AgentViewerStep.js.map +1 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.d.ts +15 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js +211 -0
- package/dist/src/ui/components/subagents/manage/AgentsManagerDialog.js.map +1 -0
- package/dist/src/ui/components/subagents/reducers.d.ts +14 -0
- package/dist/src/ui/components/subagents/reducers.js +162 -0
- package/dist/src/ui/components/subagents/reducers.js.map +1 -0
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.d.ts +20 -0
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +193 -0
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +1 -0
- package/dist/src/ui/components/subagents/types.d.ts +137 -0
- package/dist/src/ui/components/subagents/types.js +15 -0
- package/dist/src/ui/components/subagents/types.js.map +1 -0
- package/dist/src/ui/components/subagents/utils.d.ts +15 -0
- package/dist/src/ui/components/subagents/utils.js +79 -0
- package/dist/src/ui/components/subagents/utils.js.map +1 -0
- package/dist/src/ui/components/ums/UMSKeyPrompt.d.ts +2 -2
- package/dist/src/ui/components/ums/UMSKeyPrompt.js +67 -65
- package/dist/src/ui/components/ums/UMSKeyPrompt.js.map +1 -1
- package/dist/src/ui/components/ums/useUMSAuth.d.ts +1 -1
- package/dist/src/ui/components/ums/useUMSAuth.js +1 -1
- package/dist/src/ui/components/ums/useUMSAuth.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionsList.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.js +47 -0
- package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js +97 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.d.ts +27 -0
- package/dist/src/ui/components/views/McpStatus.js +77 -0
- package/dist/src/ui/components/views/McpStatus.js.map +1 -0
- package/dist/src/ui/components/views/McpStatus.test.d.ts +6 -0
- package/dist/src/ui/components/views/McpStatus.test.js +117 -0
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -0
- package/dist/src/ui/components/views/ToolsList.d.ts +14 -0
- package/dist/src/ui/components/views/ToolsList.js +7 -0
- package/dist/src/ui/components/views/ToolsList.js.map +1 -0
- package/dist/src/ui/components/views/ToolsList.test.d.ts +6 -0
- package/dist/src/ui/components/views/ToolsList.test.js +45 -0
- package/dist/src/ui/components/views/ToolsList.test.js.map +1 -0
- package/dist/src/ui/constants.d.ts +9 -0
- package/dist/src/ui/constants.js +10 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/AppContext.d.ts +11 -0
- package/dist/src/ui/contexts/AppContext.js +15 -0
- package/dist/src/ui/contexts/AppContext.js.map +1 -0
- package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
- package/dist/src/ui/contexts/ConfigContext.js +16 -0
- package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.d.ts +35 -0
- package/dist/src/ui/contexts/KeypressContext.js +636 -0
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/KeypressContext.test.js +1180 -0
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -0
- package/dist/src/ui/contexts/OverflowContext.d.ts +1 -1
- package/dist/src/ui/contexts/OverflowContext.js +0 -5
- package/dist/src/ui/contexts/OverflowContext.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +11 -3
- package/dist/src/ui/contexts/SessionContext.js +110 -21
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
- package/dist/src/ui/contexts/SettingsContext.js +15 -0
- package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
- package/dist/src/ui/contexts/ShellFocusContext.d.ts +7 -0
- package/dist/src/ui/contexts/ShellFocusContext.js +9 -0
- package/dist/src/ui/contexts/ShellFocusContext.js.map +1 -0
- package/dist/src/ui/contexts/StreamingContext.d.ts +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +45 -0
- package/dist/src/ui/contexts/UIActionsContext.js +21 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
- package/dist/src/ui/contexts/UIStateContext.d.ts +117 -0
- package/dist/src/ui/contexts/UIStateContext.js +17 -0
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
- package/dist/src/ui/contexts/VimModeContext.d.ts +1 -1
- package/dist/src/ui/contexts/VimModeContext.js +4 -4
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +3 -3
- package/dist/src/ui/hooks/atCommandProcessor.js +29 -29
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js +834 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
- package/dist/src/ui/hooks/keyToAnsi.js +67 -0
- package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +5 -4
- package/dist/src/ui/hooks/shellCommandProcessor.js +76 -30
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +508 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +32 -7
- package/dist/src/ui/hooks/slashCommandProcessor.js +232 -96
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAgentsManagerDialog.d.ts +11 -0
- package/dist/src/ui/hooks/useAgentsManagerDialog.js +21 -0
- package/dist/src/ui/hooks/useAgentsManagerDialog.js.map +1 -0
- package/dist/src/ui/hooks/useAtCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useAtCompletion.js +7 -5
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +5 -2
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +26 -23
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +306 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +8 -5
- package/dist/src/ui/hooks/useCommandCompletion.js +30 -9
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useCompletion.js +1 -1
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +1 -1
- package/dist/src/ui/hooks/useDialogClose.d.ts +32 -0
- package/dist/src/ui/hooks/useDialogClose.js +48 -0
- package/dist/src/ui/hooks/useDialogClose.js.map +1 -0
- package/dist/src/ui/hooks/useEditorSettings.d.ts +2 -2
- package/dist/src/ui/hooks/useEditorSettings.js +1 -1
- package/dist/src/ui/hooks/useEditorSettings.js.map +1 -1
- package/dist/src/ui/hooks/useEditorSettings.test.d.ts +6 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js +164 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionUpdates.d.ts +21 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js +116 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +243 -0
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
- package/dist/src/ui/hooks/useFocus.d.ts +4 -0
- package/dist/src/ui/hooks/useFocus.js +14 -4
- package/dist/src/ui/hooks/useFocus.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +13 -0
- package/dist/src/ui/hooks/useFolderTrust.js +60 -0
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +21 -5
- package/dist/src/ui/hooks/useGeminiStream.js +276 -128
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +16 -19
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.d.ts +6 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js +171 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -0
- package/dist/src/ui/hooks/useHistoryManager.d.ts +1 -1
- package/dist/src/ui/hooks/useHistoryManager.test.d.ts +6 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js +171 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -0
- package/dist/src/ui/hooks/useIdeTrustListener.d.ts +16 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js +65 -0
- package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +6 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.js +183 -0
- package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistory.test.js +207 -0
- package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.d.ts +19 -0
- package/dist/src/ui/hooks/useInputHistoryStore.js +81 -0
- package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js +234 -0
- package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -0
- package/dist/src/ui/hooks/useKeypress.d.ts +4 -16
- package/dist/src/ui/hooks/useKeypress.js +8 -140
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +15 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +20 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -0
- package/dist/src/ui/hooks/useLaunchEditor.d.ts +10 -0
- package/dist/src/ui/hooks/useLaunchEditor.js +70 -0
- package/dist/src/ui/hooks/useLaunchEditor.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js +2 -2
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +91 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useLogger.d.ts +2 -1
- package/dist/src/ui/hooks/useLogger.js +3 -3
- package/dist/src/ui/hooks/useLogger.js.map +1 -1
- package/dist/src/ui/hooks/useMemoryMonitor.d.ts +13 -0
- package/dist/src/ui/hooks/useMemoryMonitor.js +28 -0
- package/dist/src/ui/hooks/useMemoryMonitor.js.map +1 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.js +57 -0
- package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.d.ts +23 -0
- package/dist/src/ui/hooks/useMessageQueue.js +51 -0
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js +167 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -0
- package/dist/src/ui/hooks/useModelCommand.d.ts +12 -0
- package/dist/src/ui/hooks/useModelCommand.js +21 -0
- package/dist/src/ui/hooks/useModelCommand.js.map +1 -0
- package/dist/src/ui/hooks/useModelCommand.test.d.ts +6 -0
- package/dist/src/ui/hooks/useModelCommand.test.js +35 -0
- package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +17 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js +78 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +182 -0
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +13 -10
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePromptCompletion.d.ts +23 -0
- package/dist/src/ui/hooks/usePromptCompletion.js +177 -0
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useQuitConfirmation.d.ts +14 -0
- package/dist/src/ui/hooks/useQuitConfirmation.js +36 -0
- package/dist/src/ui/hooks/useQuitConfirmation.js.map +1 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +21 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.js +122 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +6 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +269 -0
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -0
- package/dist/src/ui/hooks/useQwenAuth.d.ts +1 -1
- package/dist/src/ui/hooks/useQwenAuth.js +1 -1
- package/dist/src/ui/hooks/useQwenAuth.js.map +1 -1
- package/dist/src/ui/hooks/useQwenAuth.test.d.ts +6 -0
- package/dist/src/ui/hooks/useQwenAuth.test.js +292 -0
- package/dist/src/ui/hooks/useQwenAuth.test.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +4 -3
- package/dist/src/ui/hooks/useReactToolScheduler.js +40 -35
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +3 -3
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +67 -20
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +163 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.d.ts +34 -0
- package/dist/src/ui/hooks/useSelectionList.js +245 -0
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSelectionList.test.js +701 -0
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -0
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
- package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
- package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.d.ts +2 -1
- package/dist/src/ui/hooks/useShellHistory.js +9 -10
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -1
- package/dist/src/ui/hooks/useShellHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useShellHistory.test.js +187 -0
- package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +3 -3
- package/dist/src/ui/hooks/useShowMemoryCommand.js +1 -1
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useSlashCompletion.js +281 -67
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +9 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js +597 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useStateAndRef.d.ts +1 -1
- package/dist/src/ui/hooks/useStateAndRef.js +2 -2
- package/dist/src/ui/hooks/useStateAndRef.js.map +1 -1
- package/dist/src/ui/hooks/useSubagentCreateDialog.d.ts +10 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.js +21 -0
- package/dist/src/ui/hooks/useSubagentCreateDialog.js.map +1 -0
- package/dist/src/ui/hooks/useThemeCommand.d.ts +2 -2
- package/dist/src/ui/hooks/useThemeCommand.js +10 -21
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/useTimer.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTimer.test.js +90 -0
- package/dist/src/ui/hooks/useTimer.test.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.test.d.ts +6 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js +623 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.d.ts +47 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.js +292 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.js.map +1 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.d.ts +6 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.js +515 -0
- package/dist/src/ui/hooks/useVisionAutoSwitch.test.js.map +1 -0
- package/dist/src/ui/hooks/useWelcomeBack.d.ts +23 -0
- package/dist/src/ui/hooks/useWelcomeBack.js +79 -0
- package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -0
- package/dist/src/ui/hooks/useWorkspaceMigration.d.ts +13 -0
- package/dist/src/ui/hooks/useWorkspaceMigration.js +54 -0
- package/dist/src/ui/hooks/useWorkspaceMigration.js.map +1 -0
- package/dist/src/ui/keyMatchers.d.ts +27 -0
- package/dist/src/ui/keyMatchers.js +68 -0
- package/dist/src/ui/keyMatchers.js.map +1 -0
- package/dist/src/ui/keyMatchers.test.d.ts +6 -0
- package/dist/src/ui/keyMatchers.test.js +293 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -0
- package/dist/src/ui/layouts/DefaultAppLayout.d.ts +9 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js +13 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +7 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js +14 -0
- package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +1 -0
- package/dist/src/ui/models/availableModels.d.ts +35 -0
- package/dist/src/ui/models/availableModels.js +126 -0
- package/dist/src/ui/models/availableModels.js.map +1 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +12 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +28 -0
- package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -0
- package/dist/src/ui/semantic-colors.d.ts +7 -0
- package/dist/src/ui/semantic-colors.js +24 -0
- package/dist/src/ui/semantic-colors.js.map +1 -0
- package/dist/src/ui/state/extensions.d.ts +42 -0
- package/dist/src/ui/state/extensions.js +62 -0
- package/dist/src/ui/state/extensions.js.map +1 -0
- package/dist/src/ui/textConstants.d.ts +9 -0
- package/dist/src/ui/textConstants.js +10 -0
- package/dist/src/ui/textConstants.js.map +1 -0
- package/dist/src/ui/themes/ansi-light.js +2 -1
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +2 -1
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/ayu.js +1 -1
- package/dist/src/ui/themes/color-utils.test.d.ts +6 -0
- package/dist/src/ui/themes/color-utils.test.js +197 -0
- package/dist/src/ui/themes/color-utils.test.js.map +1 -0
- package/dist/src/ui/themes/dracula.js +2 -2
- package/dist/src/ui/themes/github-dark.js +1 -1
- package/dist/src/ui/themes/googlecode.js +1 -1
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +30 -1
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/qwen-dark.js +2 -1
- package/dist/src/ui/themes/qwen-dark.js.map +1 -1
- package/dist/src/ui/themes/qwen-light.js +2 -1
- package/dist/src/ui/themes/qwen-light.js.map +1 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +37 -0
- package/dist/src/ui/themes/semantic-tokens.js +94 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.d.ts +9 -1
- package/dist/src/ui/themes/theme-manager.js +81 -7
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.test.d.ts +6 -0
- package/dist/src/ui/themes/theme-manager.test.js +142 -0
- package/dist/src/ui/themes/theme-manager.test.js.map +1 -0
- package/dist/src/ui/themes/theme.d.ts +45 -2
- package/dist/src/ui/themes/theme.js +122 -109
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/types.d.ts +110 -6
- package/dist/src/ui/types.js +16 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +3 -2
- package/dist/src/ui/utils/CodeColorizer.js +8 -6
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +2 -1
- package/dist/src/ui/utils/ConsolePatcher.js +4 -1
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +13 -6
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +15 -13
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +6 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js +169 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -0
- package/dist/src/ui/utils/TableRenderer.js +4 -4
- package/dist/src/ui/utils/TableRenderer.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.js +7 -8
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/clipboardUtils.test.js +65 -0
- package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.d.ts +2 -1
- package/dist/src/ui/utils/commandUtils.js +74 -15
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/commandUtils.test.js +349 -0
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -0
- package/dist/src/ui/utils/computeStats.d.ts +1 -1
- package/dist/src/ui/utils/computeStats.js +3 -1
- package/dist/src/ui/utils/computeStats.js.map +1 -1
- package/dist/src/ui/utils/displayUtils.d.ts +1 -0
- package/dist/src/ui/utils/displayUtils.js +7 -4
- package/dist/src/ui/utils/displayUtils.js.map +1 -1
- package/dist/src/ui/utils/displayUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/displayUtils.test.js +61 -0
- package/dist/src/ui/utils/displayUtils.test.js.map +1 -0
- package/dist/src/ui/utils/formatters.test.d.ts +6 -0
- package/dist/src/ui/utils/formatters.test.js +56 -0
- package/dist/src/ui/utils/formatters.test.js.map +1 -0
- package/dist/src/ui/utils/highlight.d.ts +11 -0
- package/dist/src/ui/utils/highlight.js +78 -0
- package/dist/src/ui/utils/highlight.js.map +1 -0
- package/dist/src/ui/utils/highlight.test.d.ts +6 -0
- package/dist/src/ui/utils/highlight.test.js +120 -0
- package/dist/src/ui/utils/highlight.test.js.map +1 -0
- package/dist/src/ui/utils/isNarrowWidth.d.ts +6 -0
- package/dist/src/ui/utils/isNarrowWidth.js +9 -0
- package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +13 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js +98 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -0
- package/dist/src/ui/utils/markdownUtilities.test.d.ts +6 -0
- package/dist/src/ui/utils/markdownUtilities.test.js +42 -0
- package/dist/src/ui/utils/markdownUtilities.test.js.map +1 -0
- package/dist/src/ui/utils/platformConstants.d.ts +75 -0
- package/dist/src/ui/utils/platformConstants.js +78 -0
- package/dist/src/ui/utils/platformConstants.js.map +1 -0
- package/dist/src/ui/utils/terminalSetup.d.ts +30 -0
- package/dist/src/ui/utils/terminalSetup.js +281 -0
- package/dist/src/ui/utils/terminalSetup.js.map +1 -0
- package/dist/src/ui/utils/textUtils.d.ts +28 -0
- package/dist/src/ui/utils/textUtils.js +152 -3
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/textUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/textUtils.test.js +132 -0
- package/dist/src/ui/utils/textUtils.test.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.d.ts +3 -2
- package/dist/src/ui/utils/updateCheck.js +55 -4
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.test.d.ts +6 -0
- package/dist/src/ui/utils/updateCheck.test.js +145 -0
- package/dist/src/ui/utils/updateCheck.test.js.map +1 -0
- package/dist/src/utils/checks.d.ts +19 -0
- package/dist/src/utils/checks.js +24 -0
- package/dist/src/utils/checks.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +2 -2
- package/dist/src/utils/cleanup.js +7 -6
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/commands.d.ts +20 -0
- package/dist/src/utils/commands.js +53 -0
- package/dist/src/utils/commands.js.map +1 -0
- package/dist/src/utils/commands.test.d.ts +6 -0
- package/dist/src/utils/commands.test.js +115 -0
- package/dist/src/utils/commands.test.js.map +1 -0
- package/dist/src/utils/commentJson.d.ts +9 -0
- package/dist/src/utils/commentJson.js +48 -0
- package/dist/src/utils/commentJson.js.map +1 -0
- package/dist/src/utils/commentJson.test.d.ts +6 -0
- package/dist/src/utils/commentJson.test.js +146 -0
- package/dist/src/utils/commentJson.test.js.map +1 -0
- package/dist/src/utils/deepMerge.d.ts +9 -0
- package/dist/src/utils/deepMerge.js +58 -0
- package/dist/src/utils/deepMerge.js.map +1 -0
- package/dist/src/utils/deepMerge.test.d.ts +6 -0
- package/dist/src/utils/deepMerge.test.js +143 -0
- package/dist/src/utils/deepMerge.test.js.map +1 -0
- package/dist/src/utils/dialogScopeUtils.d.ts +32 -0
- package/dist/src/utils/dialogScopeUtils.js +48 -0
- package/dist/src/utils/dialogScopeUtils.js.map +1 -0
- package/dist/src/utils/envVarResolver.d.ts +39 -0
- package/dist/src/utils/envVarResolver.js +97 -0
- package/dist/src/utils/envVarResolver.js.map +1 -0
- package/dist/src/utils/envVarResolver.test.d.ts +6 -0
- package/dist/src/utils/envVarResolver.test.js +221 -0
- package/dist/src/utils/envVarResolver.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +27 -0
- package/dist/src/utils/errors.js +105 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/errors.test.d.ts +6 -0
- package/dist/src/utils/errors.test.js +303 -0
- package/dist/src/utils/errors.test.js.map +1 -0
- package/dist/src/utils/events.d.ts +3 -2
- package/dist/src/utils/events.js +2 -1
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/gitUtils.d.ts +21 -1
- package/dist/src/utils/gitUtils.js +69 -4
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/gitUtils.test.d.ts +6 -0
- package/dist/src/utils/gitUtils.test.js +113 -0
- package/dist/src/utils/gitUtils.test.js.map +1 -0
- package/dist/src/utils/handleAutoUpdate.d.ts +4 -4
- package/dist/src/utils/handleAutoUpdate.js +10 -6
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/installationInfo.js +3 -3
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/installationInfo.test.d.ts +6 -0
- package/dist/src/utils/installationInfo.test.js +242 -0
- package/dist/src/utils/installationInfo.test.js.map +1 -0
- package/dist/src/utils/math.d.ts +13 -0
- package/dist/src/utils/math.js +14 -0
- package/dist/src/utils/math.js.map +1 -0
- package/dist/src/utils/package.js +2 -2
- package/dist/src/utils/package.js.map +1 -1
- package/dist/src/utils/processUtils.d.ts +13 -0
- package/dist/src/utils/processUtils.js +18 -0
- package/dist/src/utils/processUtils.js.map +1 -0
- package/dist/src/utils/processUtils.test.d.ts +6 -0
- package/dist/src/utils/processUtils.test.js +20 -0
- package/dist/src/utils/processUtils.test.js.map +1 -0
- package/dist/src/utils/readStdin.js +25 -0
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/readStdin.test.d.ts +6 -0
- package/dist/src/utils/readStdin.test.js +88 -0
- package/dist/src/utils/readStdin.test.js.map +1 -0
- package/dist/src/utils/relaunch.d.ts +7 -0
- package/dist/src/utils/relaunch.js +57 -0
- package/dist/src/utils/relaunch.js.map +1 -0
- package/dist/src/utils/relaunch.test.d.ts +6 -0
- package/dist/src/utils/relaunch.test.js +273 -0
- package/dist/src/utils/relaunch.test.js.map +1 -0
- package/dist/src/utils/resolvePath.js +2 -2
- package/dist/src/utils/resolvePath.js.map +1 -1
- package/dist/src/utils/sandbox.d.ts +2 -2
- package/dist/src/utils/sandbox.js +484 -443
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +144 -0
- package/dist/src/utils/settingsUtils.js +340 -0
- package/dist/src/utils/settingsUtils.js.map +1 -0
- package/dist/src/utils/settingsUtils.test.d.ts +6 -0
- package/dist/src/utils/settingsUtils.test.js +808 -0
- package/dist/src/utils/settingsUtils.test.js.map +1 -0
- package/dist/src/utils/spawnWrapper.d.ts +1 -1
- package/dist/src/utils/spawnWrapper.js +1 -1
- package/dist/src/utils/spawnWrapper.js.map +1 -1
- package/dist/src/utils/startupWarnings.js +3 -3
- package/dist/src/utils/startupWarnings.js.map +1 -1
- package/dist/src/utils/updateEventEmitter.d.ts +1 -1
- package/dist/src/utils/updateEventEmitter.js +1 -1
- package/dist/src/utils/updateEventEmitter.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.d.ts +7 -1
- package/dist/src/utils/userStartupWarnings.js +24 -9
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.test.d.ts +6 -0
- package/dist/src/utils/userStartupWarnings.test.js +88 -0
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -0
- package/dist/src/utils/version.js +1 -1
- package/dist/src/utils/version.js.map +1 -1
- package/dist/src/utils/windowTitle.d.ts +12 -0
- package/dist/src/utils/windowTitle.js +19 -0
- package/dist/src/utils/windowTitle.js.map +1 -0
- package/dist/src/utils/windowTitle.test.d.ts +6 -0
- package/dist/src/utils/windowTitle.test.js +49 -0
- package/dist/src/utils/windowTitle.test.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.d.ts +4 -2
- package/dist/src/validateNonInterActiveAuth.js +35 -23
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/zed-integration/acp.d.ts +63 -0
- package/dist/src/{acp → zed-integration}/acp.js +78 -45
- package/dist/src/zed-integration/acp.js.map +1 -0
- package/dist/src/zed-integration/fileSystemService.d.ts +20 -0
- package/dist/src/zed-integration/fileSystemService.js +46 -0
- package/dist/src/zed-integration/fileSystemService.js.map +1 -0
- package/dist/src/zed-integration/schema.d.ts +11782 -0
- package/dist/src/zed-integration/schema.js +311 -0
- package/dist/src/zed-integration/schema.js.map +1 -0
- package/dist/src/zed-integration/zedIntegration.d.ts +17 -0
- package/dist/src/zed-integration/zedIntegration.js +791 -0
- package/dist/src/zed-integration/zedIntegration.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -12
- package/dist/src/acp/acp.d.ts +0 -208
- package/dist/src/acp/acp.js.map +0 -1
- package/dist/src/acp/acpPeer.d.ts +0 -8
- package/dist/src/acp/acpPeer.js +0 -537
- package/dist/src/acp/acpPeer.js.map +0 -1
- package/dist/src/ui/commands/privacyCommand.d.ts +0 -7
- package/dist/src/ui/commands/privacyCommand.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.js.map +0 -1
- package/dist/src/ui/components/AuthInProgress.js +0 -27
- package/dist/src/ui/components/AuthInProgress.js.map +0 -1
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +0 -1
- package/dist/src/ui/hooks/useAuthCommand.d.ts +0 -14
- package/dist/src/ui/hooks/useAuthCommand.js +0 -65
- package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +0 -16
- package/dist/src/ui/hooks/usePrivacySettings.js +0 -115
- package/dist/src/ui/hooks/usePrivacySettings.js.map +0 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +0 -40
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +0 -17
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +0 -17
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/PrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/PrivacyNotice.js +0 -25
- package/dist/src/ui/privacy/PrivacyNotice.js.map +0 -1
- package/dist/src/ui/utils/errorParsing.d.ts +0 -7
- package/dist/src/ui/utils/errorParsing.js +0 -90
- package/dist/src/ui/utils/errorParsing.js.map +0 -1
|
@@ -8,9 +8,13 @@ import os from 'node:os';
|
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import fs from 'node:fs';
|
|
10
10
|
import { readFile } from 'node:fs/promises';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
11
12
|
import { quote, parse } from 'shell-quote';
|
|
12
13
|
import { USER_SETTINGS_DIR, SETTINGS_DIRECTORY_NAME, } from '../config/settings.js';
|
|
13
|
-
import { promisify } from 'util';
|
|
14
|
+
import { promisify } from 'node:util';
|
|
15
|
+
import { FatalSandboxError } from '@umsai/ums-code-core';
|
|
16
|
+
import { ConsolePatcher } from '../ui/utils/ConsolePatcher.js';
|
|
17
|
+
import { randomBytes } from 'node:crypto';
|
|
14
18
|
const execAsync = promisify(exec);
|
|
15
19
|
function getContainerPath(hostPath) {
|
|
16
20
|
if (os.platform() !== 'win32') {
|
|
@@ -53,7 +57,7 @@ const BUILTIN_SEATBELT_PROFILES = [
|
|
|
53
57
|
* @returns {Promise<boolean>} A promise that resolves to true if the current user's UID/GID should be used, false otherwise.
|
|
54
58
|
*/
|
|
55
59
|
async function shouldUseCurrentUserInSandbox() {
|
|
56
|
-
const envVar = process.env
|
|
60
|
+
const envVar = process.env['SANDBOX_SET_UID_GID']?.toLowerCase().trim();
|
|
57
61
|
if (envVar === '1' || envVar === 'true') {
|
|
58
62
|
return true;
|
|
59
63
|
}
|
|
@@ -90,19 +94,19 @@ function parseImageName(image) {
|
|
|
90
94
|
return tag ? `${name}-${tag}` : name;
|
|
91
95
|
}
|
|
92
96
|
function ports() {
|
|
93
|
-
return (process.env
|
|
97
|
+
return (process.env['SANDBOX_PORTS'] ?? '')
|
|
94
98
|
.split(',')
|
|
95
99
|
.filter((p) => p.trim())
|
|
96
100
|
.map((p) => p.trim());
|
|
97
101
|
}
|
|
98
|
-
function entrypoint(workdir) {
|
|
102
|
+
function entrypoint(workdir, cliArgs) {
|
|
99
103
|
const isWindows = os.platform() === 'win32';
|
|
100
104
|
const containerWorkdir = getContainerPath(workdir);
|
|
101
105
|
const shellCmds = [];
|
|
102
106
|
const pathSeparator = isWindows ? ';' : ':';
|
|
103
107
|
let pathSuffix = '';
|
|
104
|
-
if (process.env
|
|
105
|
-
const paths = process.env
|
|
108
|
+
if (process.env['PATH']) {
|
|
109
|
+
const paths = process.env['PATH'].split(pathSeparator);
|
|
106
110
|
for (const p of paths) {
|
|
107
111
|
const containerPath = getContainerPath(p);
|
|
108
112
|
if (containerPath.toLowerCase().startsWith(containerWorkdir.toLowerCase())) {
|
|
@@ -114,8 +118,8 @@ function entrypoint(workdir) {
|
|
|
114
118
|
shellCmds.push(`export PATH="$PATH${pathSuffix}";`);
|
|
115
119
|
}
|
|
116
120
|
let pythonPathSuffix = '';
|
|
117
|
-
if (process.env
|
|
118
|
-
const paths = process.env
|
|
121
|
+
if (process.env['PYTHONPATH']) {
|
|
122
|
+
const paths = process.env['PYTHONPATH'].split(pathSeparator);
|
|
119
123
|
for (const p of paths) {
|
|
120
124
|
const containerPath = getContainerPath(p);
|
|
121
125
|
if (containerPath.toLowerCase().startsWith(containerWorkdir.toLowerCase())) {
|
|
@@ -131,111 +135,479 @@ function entrypoint(workdir) {
|
|
|
131
135
|
shellCmds.push(`source ${getContainerPath(projectSandboxBashrc)};`);
|
|
132
136
|
}
|
|
133
137
|
ports().forEach((p) => shellCmds.push(`socat TCP4-LISTEN:${p},bind=$(hostname -i),fork,reuseaddr TCP4:127.0.0.1:${p} 2> /dev/null &`));
|
|
134
|
-
const
|
|
135
|
-
const cliCmd = process.env
|
|
136
|
-
? process.env
|
|
138
|
+
const quotedCliArgs = cliArgs.slice(2).map((arg) => quote([arg]));
|
|
139
|
+
const cliCmd = process.env['NODE_ENV'] === 'development'
|
|
140
|
+
? process.env['DEBUG']
|
|
137
141
|
? 'npm run debug --'
|
|
138
142
|
: 'npm rebuild && npm run start --'
|
|
139
|
-
: process.env
|
|
140
|
-
? `node --inspect-brk=0.0.0.0:${process.env
|
|
143
|
+
: process.env['DEBUG']
|
|
144
|
+
? `node --inspect-brk=0.0.0.0:${process.env['DEBUG_PORT'] || '9229'} $(which qwen)`
|
|
141
145
|
: 'qwen';
|
|
142
|
-
const args = [...shellCmds, cliCmd, ...
|
|
146
|
+
const args = [...shellCmds, cliCmd, ...quotedCliArgs];
|
|
143
147
|
return ['bash', '-c', args.join(' ')];
|
|
144
148
|
}
|
|
145
|
-
export async function start_sandbox(config, nodeArgs = [], cliConfig) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
149
|
+
export async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
150
|
+
const patcher = new ConsolePatcher({
|
|
151
|
+
debugMode: cliConfig?.getDebugMode() || !!process.env['DEBUG'],
|
|
152
|
+
stderr: true,
|
|
153
|
+
});
|
|
154
|
+
patcher.patch();
|
|
155
|
+
try {
|
|
156
|
+
if (config.command === 'sandbox-exec') {
|
|
157
|
+
// disallow BUILD_SANDBOX
|
|
158
|
+
if (process.env['BUILD_SANDBOX']) {
|
|
159
|
+
throw new FatalSandboxError('Cannot BUILD_SANDBOX when using macOS Seatbelt');
|
|
160
|
+
}
|
|
161
|
+
const profile = (process.env['SEATBELT_PROFILE'] ??= 'permissive-open');
|
|
162
|
+
let profileFile = fileURLToPath(new URL(`sandbox-macos-${profile}.sb`, import.meta.url));
|
|
163
|
+
// if profile name is not recognized, then look for file under project settings directory
|
|
164
|
+
if (!BUILTIN_SEATBELT_PROFILES.includes(profile)) {
|
|
165
|
+
profileFile = path.join(SETTINGS_DIRECTORY_NAME, `sandbox-macos-${profile}.sb`);
|
|
166
|
+
}
|
|
167
|
+
if (!fs.existsSync(profileFile)) {
|
|
168
|
+
throw new FatalSandboxError(`Missing macos seatbelt profile file '${profileFile}'`);
|
|
169
|
+
}
|
|
170
|
+
// Log on STDERR so it doesn't clutter the output on STDOUT
|
|
171
|
+
console.error(`using macos seatbelt (profile: ${profile}) ...`);
|
|
172
|
+
// if DEBUG is set, convert to --inspect-brk in NODE_OPTIONS
|
|
173
|
+
const nodeOptions = [
|
|
174
|
+
...(process.env['DEBUG'] ? ['--inspect-brk'] : []),
|
|
175
|
+
...nodeArgs,
|
|
176
|
+
].join(' ');
|
|
177
|
+
const args = [
|
|
178
|
+
'-D',
|
|
179
|
+
`TARGET_DIR=${fs.realpathSync(process.cwd())}`,
|
|
180
|
+
'-D',
|
|
181
|
+
`TMP_DIR=${fs.realpathSync(os.tmpdir())}`,
|
|
182
|
+
'-D',
|
|
183
|
+
`HOME_DIR=${fs.realpathSync(os.homedir())}`,
|
|
184
|
+
'-D',
|
|
185
|
+
`CACHE_DIR=${fs.realpathSync(execSync(`getconf DARWIN_USER_CACHE_DIR`).toString().trim())}`,
|
|
186
|
+
];
|
|
187
|
+
// Add included directories from the workspace context
|
|
188
|
+
// Always add 5 INCLUDE_DIR parameters to ensure .sb files can reference them
|
|
189
|
+
const MAX_INCLUDE_DIRS = 5;
|
|
190
|
+
const targetDir = fs.realpathSync(cliConfig?.getTargetDir() || '');
|
|
191
|
+
const includedDirs = [];
|
|
192
|
+
if (cliConfig) {
|
|
193
|
+
const workspaceContext = cliConfig.getWorkspaceContext();
|
|
194
|
+
const directories = workspaceContext.getDirectories();
|
|
195
|
+
// Filter out TARGET_DIR
|
|
196
|
+
for (const dir of directories) {
|
|
197
|
+
const realDir = fs.realpathSync(dir);
|
|
198
|
+
if (realDir !== targetDir) {
|
|
199
|
+
includedDirs.push(realDir);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
for (let i = 0; i < MAX_INCLUDE_DIRS; i++) {
|
|
204
|
+
let dirPath = '/dev/null'; // Default to a safe path that won't cause issues
|
|
205
|
+
if (i < includedDirs.length) {
|
|
206
|
+
dirPath = includedDirs[i];
|
|
207
|
+
}
|
|
208
|
+
args.push('-D', `INCLUDE_DIR_${i}=${dirPath}`);
|
|
209
|
+
}
|
|
210
|
+
const finalArgv = cliArgs;
|
|
211
|
+
args.push('-f', profileFile, 'sh', '-c', [
|
|
212
|
+
`SANDBOX=sandbox-exec`,
|
|
213
|
+
`NODE_OPTIONS="${nodeOptions}"`,
|
|
214
|
+
...finalArgv.map((arg) => quote([arg])),
|
|
215
|
+
].join(' '));
|
|
216
|
+
// start and set up proxy if GEMINI_SANDBOX_PROXY_COMMAND is set
|
|
217
|
+
const proxyCommand = process.env['GEMINI_SANDBOX_PROXY_COMMAND'];
|
|
218
|
+
let proxyProcess = undefined;
|
|
219
|
+
let sandboxProcess = undefined;
|
|
220
|
+
const sandboxEnv = { ...process.env };
|
|
221
|
+
if (proxyCommand) {
|
|
222
|
+
const proxy = process.env['HTTPS_PROXY'] ||
|
|
223
|
+
process.env['https_proxy'] ||
|
|
224
|
+
process.env['HTTP_PROXY'] ||
|
|
225
|
+
process.env['http_proxy'] ||
|
|
226
|
+
'http://localhost:8877';
|
|
227
|
+
sandboxEnv['HTTPS_PROXY'] = proxy;
|
|
228
|
+
sandboxEnv['https_proxy'] = proxy; // lower-case can be required, e.g. for curl
|
|
229
|
+
sandboxEnv['HTTP_PROXY'] = proxy;
|
|
230
|
+
sandboxEnv['http_proxy'] = proxy;
|
|
231
|
+
const noProxy = process.env['NO_PROXY'] || process.env['no_proxy'];
|
|
232
|
+
if (noProxy) {
|
|
233
|
+
sandboxEnv['NO_PROXY'] = noProxy;
|
|
234
|
+
sandboxEnv['no_proxy'] = noProxy;
|
|
235
|
+
}
|
|
236
|
+
proxyProcess = spawn(proxyCommand, {
|
|
237
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
238
|
+
shell: true,
|
|
239
|
+
detached: true,
|
|
240
|
+
});
|
|
241
|
+
// install handlers to stop proxy on exit/signal
|
|
242
|
+
const stopProxy = () => {
|
|
243
|
+
console.log('stopping proxy ...');
|
|
244
|
+
if (proxyProcess?.pid) {
|
|
245
|
+
process.kill(-proxyProcess.pid, 'SIGTERM');
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
process.on('exit', stopProxy);
|
|
249
|
+
process.on('SIGINT', stopProxy);
|
|
250
|
+
process.on('SIGTERM', stopProxy);
|
|
251
|
+
// commented out as it disrupts ink rendering
|
|
252
|
+
// proxyProcess.stdout?.on('data', (data) => {
|
|
253
|
+
// console.info(data.toString());
|
|
254
|
+
// });
|
|
255
|
+
proxyProcess.stderr?.on('data', (data) => {
|
|
256
|
+
console.error(data.toString());
|
|
257
|
+
});
|
|
258
|
+
proxyProcess.on('close', (code, signal) => {
|
|
259
|
+
if (sandboxProcess?.pid) {
|
|
260
|
+
process.kill(-sandboxProcess.pid, 'SIGTERM');
|
|
261
|
+
}
|
|
262
|
+
throw new FatalSandboxError(`Proxy command '${proxyCommand}' exited with code ${code}, signal ${signal}`);
|
|
263
|
+
});
|
|
264
|
+
console.log('waiting for proxy to start ...');
|
|
265
|
+
await execAsync(`until timeout 0.25 curl -s http://localhost:8877; do sleep 0.25; done`);
|
|
266
|
+
}
|
|
267
|
+
// spawn child and let it inherit stdio
|
|
268
|
+
process.stdin.pause();
|
|
269
|
+
sandboxProcess = spawn(config.command, args, {
|
|
270
|
+
stdio: 'inherit',
|
|
271
|
+
});
|
|
272
|
+
return new Promise((resolve, reject) => {
|
|
273
|
+
sandboxProcess?.on('error', reject);
|
|
274
|
+
sandboxProcess?.on('close', (code) => {
|
|
275
|
+
process.stdin.resume();
|
|
276
|
+
resolve(code ?? 1);
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
console.error(`hopping into sandbox (command: ${config.command}) ...`);
|
|
281
|
+
// determine full path for gemini-cli to distinguish linked vs installed setting
|
|
282
|
+
const gcPath = fs.realpathSync(process.argv[1]);
|
|
283
|
+
const projectSandboxDockerfile = path.join(SETTINGS_DIRECTORY_NAME, 'sandbox.Dockerfile');
|
|
284
|
+
const isCustomProjectSandbox = fs.existsSync(projectSandboxDockerfile);
|
|
285
|
+
const image = config.image;
|
|
286
|
+
const workdir = path.resolve(process.cwd());
|
|
287
|
+
const containerWorkdir = getContainerPath(workdir);
|
|
288
|
+
// if BUILD_SANDBOX is set, then call scripts/build_sandbox.js under gemini-cli repo
|
|
289
|
+
//
|
|
290
|
+
// note this can only be done with binary linked from gemini-cli repo
|
|
291
|
+
if (process.env['BUILD_SANDBOX']) {
|
|
292
|
+
if (!gcPath.includes('gemini-cli/packages/')) {
|
|
293
|
+
throw new FatalSandboxError('Cannot build sandbox using installed gemini binary; ' +
|
|
294
|
+
'run `npm link ./packages/cli` under gemini-cli repo to switch to linked binary.');
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
console.error('building sandbox ...');
|
|
298
|
+
const gcRoot = gcPath.split('/packages/')[0];
|
|
299
|
+
// if project folder has sandbox.Dockerfile under project settings folder, use that
|
|
300
|
+
let buildArgs = '';
|
|
301
|
+
const projectSandboxDockerfile = path.join(SETTINGS_DIRECTORY_NAME, 'sandbox.Dockerfile');
|
|
302
|
+
if (isCustomProjectSandbox) {
|
|
303
|
+
console.error(`using ${projectSandboxDockerfile} for sandbox`);
|
|
304
|
+
buildArgs += `-f ${path.resolve(projectSandboxDockerfile)} -i ${image}`;
|
|
193
305
|
}
|
|
306
|
+
execSync(`cd ${gcRoot} && node scripts/build_sandbox.js -s ${buildArgs}`, {
|
|
307
|
+
stdio: 'inherit',
|
|
308
|
+
env: {
|
|
309
|
+
...process.env,
|
|
310
|
+
GEMINI_SANDBOX: config.command, // in case sandbox is enabled via flags (see config.ts under cli package)
|
|
311
|
+
},
|
|
312
|
+
});
|
|
194
313
|
}
|
|
195
314
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
315
|
+
// stop if image is missing
|
|
316
|
+
if (!(await ensureSandboxImageIsPresent(config.command, image))) {
|
|
317
|
+
const remedy = image === LOCAL_DEV_SANDBOX_IMAGE_NAME
|
|
318
|
+
? 'Try running `npm run build:all` or `npm run build:sandbox` under the gemini-cli repo to build it locally, or check the image name and your network connection.'
|
|
319
|
+
: 'Please check the image name, your network connection, or notify gemini-cli-dev@google.com if the issue persists.';
|
|
320
|
+
throw new FatalSandboxError(`Sandbox image '${image}' is missing or could not be pulled. ${remedy}`);
|
|
321
|
+
}
|
|
322
|
+
// use interactive mode and auto-remove container on exit
|
|
323
|
+
// run init binary inside container to forward signals & reap zombies
|
|
324
|
+
const args = ['run', '-i', '--rm', '--init', '--workdir', containerWorkdir];
|
|
325
|
+
// add custom flags from SANDBOX_FLAGS
|
|
326
|
+
if (process.env['SANDBOX_FLAGS']) {
|
|
327
|
+
const flags = parse(process.env['SANDBOX_FLAGS'], process.env).filter((f) => typeof f === 'string');
|
|
328
|
+
args.push(...flags);
|
|
329
|
+
}
|
|
330
|
+
// add TTY only if stdin is TTY as well, i.e. for piped input don't init TTY in container
|
|
331
|
+
if (process.stdin.isTTY) {
|
|
332
|
+
args.push('-t');
|
|
333
|
+
}
|
|
334
|
+
// allow access to host.docker.internal
|
|
335
|
+
args.push('--add-host', 'host.docker.internal:host-gateway');
|
|
336
|
+
// mount current directory as working directory in sandbox (set via --workdir)
|
|
337
|
+
args.push('--volume', `${workdir}:${containerWorkdir}`);
|
|
338
|
+
// mount user settings directory inside container, after creating if missing
|
|
339
|
+
// note user/home changes inside sandbox and we mount at BOTH paths for consistency
|
|
340
|
+
const userSettingsDirOnHost = USER_SETTINGS_DIR;
|
|
341
|
+
const userSettingsDirInSandbox = getContainerPath(`/home/node/${SETTINGS_DIRECTORY_NAME}`);
|
|
342
|
+
if (!fs.existsSync(userSettingsDirOnHost)) {
|
|
343
|
+
fs.mkdirSync(userSettingsDirOnHost);
|
|
344
|
+
}
|
|
345
|
+
args.push('--volume', `${userSettingsDirOnHost}:${userSettingsDirInSandbox}`);
|
|
346
|
+
if (userSettingsDirInSandbox !== userSettingsDirOnHost) {
|
|
347
|
+
args.push('--volume', `${userSettingsDirOnHost}:${getContainerPath(userSettingsDirOnHost)}`);
|
|
348
|
+
}
|
|
349
|
+
// mount os.tmpdir() as os.tmpdir() inside container
|
|
350
|
+
args.push('--volume', `${os.tmpdir()}:${getContainerPath(os.tmpdir())}`);
|
|
351
|
+
// mount gcloud config directory if it exists
|
|
352
|
+
const gcloudConfigDir = path.join(os.homedir(), '.config', 'gcloud');
|
|
353
|
+
if (fs.existsSync(gcloudConfigDir)) {
|
|
354
|
+
args.push('--volume', `${gcloudConfigDir}:${getContainerPath(gcloudConfigDir)}:ro`);
|
|
355
|
+
}
|
|
356
|
+
// mount ADC file if GOOGLE_APPLICATION_CREDENTIALS is set
|
|
357
|
+
if (process.env['GOOGLE_APPLICATION_CREDENTIALS']) {
|
|
358
|
+
const adcFile = process.env['GOOGLE_APPLICATION_CREDENTIALS'];
|
|
359
|
+
if (fs.existsSync(adcFile)) {
|
|
360
|
+
args.push('--volume', `${adcFile}:${getContainerPath(adcFile)}:ro`);
|
|
361
|
+
args.push('--env', `GOOGLE_APPLICATION_CREDENTIALS=${getContainerPath(adcFile)}`);
|
|
200
362
|
}
|
|
201
|
-
args.push('-D', `INCLUDE_DIR_${i}=${dirPath}`);
|
|
202
363
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
364
|
+
// mount paths listed in SANDBOX_MOUNTS
|
|
365
|
+
if (process.env['SANDBOX_MOUNTS']) {
|
|
366
|
+
for (let mount of process.env['SANDBOX_MOUNTS'].split(',')) {
|
|
367
|
+
if (mount.trim()) {
|
|
368
|
+
// parse mount as from:to:opts
|
|
369
|
+
let [from, to, opts] = mount.trim().split(':');
|
|
370
|
+
to = to || from; // default to mount at same path inside container
|
|
371
|
+
opts = opts || 'ro'; // default to read-only
|
|
372
|
+
mount = `${from}:${to}:${opts}`;
|
|
373
|
+
// check that from path is absolute
|
|
374
|
+
if (!path.isAbsolute(from)) {
|
|
375
|
+
throw new FatalSandboxError(`Path '${from}' listed in SANDBOX_MOUNTS must be absolute`);
|
|
376
|
+
}
|
|
377
|
+
// check that from path exists on host
|
|
378
|
+
if (!fs.existsSync(from)) {
|
|
379
|
+
throw new FatalSandboxError(`Missing mount path '${from}' listed in SANDBOX_MOUNTS`);
|
|
380
|
+
}
|
|
381
|
+
console.error(`SANDBOX_MOUNTS: ${from} -> ${to} (${opts})`);
|
|
382
|
+
args.push('--volume', mount);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
// expose env-specified ports on the sandbox
|
|
387
|
+
ports().forEach((p) => args.push('--publish', `${p}:${p}`));
|
|
388
|
+
// if DEBUG is set, expose debugging port
|
|
389
|
+
if (process.env['DEBUG']) {
|
|
390
|
+
const debugPort = process.env['DEBUG_PORT'] || '9229';
|
|
391
|
+
args.push(`--publish`, `${debugPort}:${debugPort}`);
|
|
392
|
+
}
|
|
393
|
+
// copy proxy environment variables, replacing localhost with SANDBOX_PROXY_NAME
|
|
394
|
+
// copy as both upper-case and lower-case as is required by some utilities
|
|
395
|
+
// GEMINI_SANDBOX_PROXY_COMMAND implies HTTPS_PROXY unless HTTP_PROXY is set
|
|
396
|
+
const proxyCommand = process.env['GEMINI_SANDBOX_PROXY_COMMAND'];
|
|
213
397
|
if (proxyCommand) {
|
|
214
|
-
|
|
215
|
-
process.env
|
|
216
|
-
process.env
|
|
217
|
-
process.env
|
|
398
|
+
let proxy = process.env['HTTPS_PROXY'] ||
|
|
399
|
+
process.env['https_proxy'] ||
|
|
400
|
+
process.env['HTTP_PROXY'] ||
|
|
401
|
+
process.env['http_proxy'] ||
|
|
218
402
|
'http://localhost:8877';
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
403
|
+
proxy = proxy.replace('localhost', SANDBOX_PROXY_NAME);
|
|
404
|
+
if (proxy) {
|
|
405
|
+
args.push('--env', `HTTPS_PROXY=${proxy}`);
|
|
406
|
+
args.push('--env', `https_proxy=${proxy}`); // lower-case can be required, e.g. for curl
|
|
407
|
+
args.push('--env', `HTTP_PROXY=${proxy}`);
|
|
408
|
+
args.push('--env', `http_proxy=${proxy}`);
|
|
409
|
+
}
|
|
410
|
+
const noProxy = process.env['NO_PROXY'] || process.env['no_proxy'];
|
|
224
411
|
if (noProxy) {
|
|
225
|
-
|
|
226
|
-
|
|
412
|
+
args.push('--env', `NO_PROXY=${noProxy}`);
|
|
413
|
+
args.push('--env', `no_proxy=${noProxy}`);
|
|
227
414
|
}
|
|
228
|
-
|
|
415
|
+
// if using proxy, switch to internal networking through proxy
|
|
416
|
+
if (proxy) {
|
|
417
|
+
execSync(`${config.command} network inspect ${SANDBOX_NETWORK_NAME} || ${config.command} network create --internal ${SANDBOX_NETWORK_NAME}`);
|
|
418
|
+
args.push('--network', SANDBOX_NETWORK_NAME);
|
|
419
|
+
// if proxy command is set, create a separate network w/ host access (i.e. non-internal)
|
|
420
|
+
// we will run proxy in its own container connected to both host network and internal network
|
|
421
|
+
// this allows proxy to work even on rootless podman on macos with host<->vm<->container isolation
|
|
422
|
+
if (proxyCommand) {
|
|
423
|
+
execSync(`${config.command} network inspect ${SANDBOX_PROXY_NAME} || ${config.command} network create ${SANDBOX_PROXY_NAME}`);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
// name container after image, plus random suffix to avoid conflicts
|
|
428
|
+
const imageName = parseImageName(image);
|
|
429
|
+
const isIntegrationTest = process.env['GEMINI_CLI_INTEGRATION_TEST'] === 'true';
|
|
430
|
+
let containerName;
|
|
431
|
+
if (isIntegrationTest) {
|
|
432
|
+
containerName = `gemini-cli-integration-test-${randomBytes(4).toString('hex')}`;
|
|
433
|
+
console.log(`ContainerName: ${containerName}`);
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
let index = 0;
|
|
437
|
+
const containerNameCheck = execSync(`${config.command} ps -a --format "{{.Names}}"`)
|
|
438
|
+
.toString()
|
|
439
|
+
.trim();
|
|
440
|
+
while (containerNameCheck.includes(`${imageName}-${index}`)) {
|
|
441
|
+
index++;
|
|
442
|
+
}
|
|
443
|
+
containerName = `${imageName}-${index}`;
|
|
444
|
+
console.log(`ContainerName (regular): ${containerName}`);
|
|
445
|
+
}
|
|
446
|
+
args.push('--name', containerName, '--hostname', containerName);
|
|
447
|
+
// copy GEMINI_CLI_TEST_VAR for integration tests
|
|
448
|
+
if (process.env['GEMINI_CLI_TEST_VAR']) {
|
|
449
|
+
args.push('--env', `GEMINI_CLI_TEST_VAR=${process.env['GEMINI_CLI_TEST_VAR']}`);
|
|
450
|
+
}
|
|
451
|
+
// copy GEMINI_API_KEY(s)
|
|
452
|
+
if (process.env['GEMINI_API_KEY']) {
|
|
453
|
+
args.push('--env', `GEMINI_API_KEY=${process.env['GEMINI_API_KEY']}`);
|
|
454
|
+
}
|
|
455
|
+
if (process.env['GOOGLE_API_KEY']) {
|
|
456
|
+
args.push('--env', `GOOGLE_API_KEY=${process.env['GOOGLE_API_KEY']}`);
|
|
457
|
+
}
|
|
458
|
+
// copy OPENAI_API_KEY and related env vars for Qwen
|
|
459
|
+
if (process.env['OPENAI_API_KEY']) {
|
|
460
|
+
args.push('--env', `OPENAI_API_KEY=${process.env['OPENAI_API_KEY']}`);
|
|
461
|
+
}
|
|
462
|
+
// copy TAVILY_API_KEY for web search tool
|
|
463
|
+
if (process.env['TAVILY_API_KEY']) {
|
|
464
|
+
args.push('--env', `TAVILY_API_KEY=${process.env['TAVILY_API_KEY']}`);
|
|
465
|
+
}
|
|
466
|
+
if (process.env['OPENAI_BASE_URL']) {
|
|
467
|
+
args.push('--env', `OPENAI_BASE_URL=${process.env['OPENAI_BASE_URL']}`);
|
|
468
|
+
}
|
|
469
|
+
if (process.env['OPENAI_MODEL']) {
|
|
470
|
+
args.push('--env', `OPENAI_MODEL=${process.env['OPENAI_MODEL']}`);
|
|
471
|
+
}
|
|
472
|
+
// copy GOOGLE_GENAI_USE_VERTEXAI
|
|
473
|
+
if (process.env['GOOGLE_GENAI_USE_VERTEXAI']) {
|
|
474
|
+
args.push('--env', `GOOGLE_GENAI_USE_VERTEXAI=${process.env['GOOGLE_GENAI_USE_VERTEXAI']}`);
|
|
475
|
+
}
|
|
476
|
+
// copy GOOGLE_GENAI_USE_GCA
|
|
477
|
+
if (process.env['GOOGLE_GENAI_USE_GCA']) {
|
|
478
|
+
args.push('--env', `GOOGLE_GENAI_USE_GCA=${process.env['GOOGLE_GENAI_USE_GCA']}`);
|
|
479
|
+
}
|
|
480
|
+
// copy GOOGLE_CLOUD_PROJECT
|
|
481
|
+
if (process.env['GOOGLE_CLOUD_PROJECT']) {
|
|
482
|
+
args.push('--env', `GOOGLE_CLOUD_PROJECT=${process.env['GOOGLE_CLOUD_PROJECT']}`);
|
|
483
|
+
}
|
|
484
|
+
// copy GOOGLE_CLOUD_LOCATION
|
|
485
|
+
if (process.env['GOOGLE_CLOUD_LOCATION']) {
|
|
486
|
+
args.push('--env', `GOOGLE_CLOUD_LOCATION=${process.env['GOOGLE_CLOUD_LOCATION']}`);
|
|
487
|
+
}
|
|
488
|
+
// copy GEMINI_MODEL
|
|
489
|
+
if (process.env['GEMINI_MODEL']) {
|
|
490
|
+
args.push('--env', `GEMINI_MODEL=${process.env['GEMINI_MODEL']}`);
|
|
491
|
+
}
|
|
492
|
+
// copy TERM and COLORTERM to try to maintain terminal setup
|
|
493
|
+
if (process.env['TERM']) {
|
|
494
|
+
args.push('--env', `TERM=${process.env['TERM']}`);
|
|
495
|
+
}
|
|
496
|
+
if (process.env['COLORTERM']) {
|
|
497
|
+
args.push('--env', `COLORTERM=${process.env['COLORTERM']}`);
|
|
498
|
+
}
|
|
499
|
+
// Pass through IDE mode environment variables
|
|
500
|
+
for (const envVar of [
|
|
501
|
+
'QWEN_CODE_IDE_SERVER_PORT',
|
|
502
|
+
'QWEN_CODE_IDE_WORKSPACE_PATH',
|
|
503
|
+
'TERM_PROGRAM',
|
|
504
|
+
]) {
|
|
505
|
+
if (process.env[envVar]) {
|
|
506
|
+
args.push('--env', `${envVar}=${process.env[envVar]}`);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
// copy VIRTUAL_ENV if under working directory
|
|
510
|
+
// also mount-replace VIRTUAL_ENV directory with <project_settings>/sandbox.venv
|
|
511
|
+
// sandbox can then set up this new VIRTUAL_ENV directory using sandbox.bashrc (see below)
|
|
512
|
+
// directory will be empty if not set up, which is still preferable to having host binaries
|
|
513
|
+
if (process.env['VIRTUAL_ENV']
|
|
514
|
+
?.toLowerCase()
|
|
515
|
+
.startsWith(workdir.toLowerCase())) {
|
|
516
|
+
const sandboxVenvPath = path.resolve(SETTINGS_DIRECTORY_NAME, 'sandbox.venv');
|
|
517
|
+
if (!fs.existsSync(sandboxVenvPath)) {
|
|
518
|
+
fs.mkdirSync(sandboxVenvPath, { recursive: true });
|
|
519
|
+
}
|
|
520
|
+
args.push('--volume', `${sandboxVenvPath}:${getContainerPath(process.env['VIRTUAL_ENV'])}`);
|
|
521
|
+
args.push('--env', `VIRTUAL_ENV=${getContainerPath(process.env['VIRTUAL_ENV'])}`);
|
|
522
|
+
}
|
|
523
|
+
// copy additional environment variables from SANDBOX_ENV
|
|
524
|
+
if (process.env['SANDBOX_ENV']) {
|
|
525
|
+
for (let env of process.env['SANDBOX_ENV'].split(',')) {
|
|
526
|
+
if ((env = env.trim())) {
|
|
527
|
+
if (env.includes('=')) {
|
|
528
|
+
console.error(`SANDBOX_ENV: ${env}`);
|
|
529
|
+
args.push('--env', env);
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
throw new FatalSandboxError('SANDBOX_ENV must be a comma-separated list of key=value pairs');
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
// copy NODE_OPTIONS
|
|
538
|
+
const existingNodeOptions = process.env['NODE_OPTIONS'] || '';
|
|
539
|
+
const allNodeOptions = [
|
|
540
|
+
...(existingNodeOptions ? [existingNodeOptions] : []),
|
|
541
|
+
...nodeArgs,
|
|
542
|
+
].join(' ');
|
|
543
|
+
if (allNodeOptions.length > 0) {
|
|
544
|
+
args.push('--env', `NODE_OPTIONS="${allNodeOptions}"`);
|
|
545
|
+
}
|
|
546
|
+
// set SANDBOX as container name
|
|
547
|
+
args.push('--env', `SANDBOX=${containerName}`);
|
|
548
|
+
// for podman only, use empty --authfile to skip unnecessary auth refresh overhead
|
|
549
|
+
if (config.command === 'podman') {
|
|
550
|
+
const emptyAuthFilePath = path.join(os.tmpdir(), 'empty_auth.json');
|
|
551
|
+
fs.writeFileSync(emptyAuthFilePath, '{}', 'utf-8');
|
|
552
|
+
args.push('--authfile', emptyAuthFilePath);
|
|
553
|
+
}
|
|
554
|
+
// Determine if the current user's UID/GID should be passed to the sandbox.
|
|
555
|
+
// See shouldUseCurrentUserInSandbox for more details.
|
|
556
|
+
let userFlag = '';
|
|
557
|
+
const finalEntrypoint = entrypoint(workdir, cliArgs);
|
|
558
|
+
if (process.env['GEMINI_CLI_INTEGRATION_TEST'] === 'true') {
|
|
559
|
+
args.push('--user', 'root');
|
|
560
|
+
userFlag = '--user root';
|
|
561
|
+
}
|
|
562
|
+
else if (await shouldUseCurrentUserInSandbox()) {
|
|
563
|
+
// For the user-creation logic to work, the container must start as root.
|
|
564
|
+
// The entrypoint script then handles dropping privileges to the correct user.
|
|
565
|
+
args.push('--user', 'root');
|
|
566
|
+
const uid = execSync('id -u').toString().trim();
|
|
567
|
+
const gid = execSync('id -g').toString().trim();
|
|
568
|
+
// Instead of passing --user to the main sandbox container, we let it
|
|
569
|
+
// start as root, then create a user with the host's UID/GID, and
|
|
570
|
+
// finally switch to that user to run the gemini process. This is
|
|
571
|
+
// necessary on Linux to ensure the user exists within the
|
|
572
|
+
// container's /etc/passwd file, which is required by os.userInfo().
|
|
573
|
+
const username = 'gemini';
|
|
574
|
+
const homeDir = getContainerPath(os.homedir());
|
|
575
|
+
const setupUserCommands = [
|
|
576
|
+
// Use -f with groupadd to avoid errors if the group already exists.
|
|
577
|
+
`groupadd -f -g ${gid} ${username}`,
|
|
578
|
+
// Create user only if it doesn't exist. Use -o for non-unique UID.
|
|
579
|
+
`id -u ${username} &>/dev/null || useradd -o -u ${uid} -g ${gid} -d ${homeDir} -s /bin/bash ${username}`,
|
|
580
|
+
].join(' && ');
|
|
581
|
+
const originalCommand = finalEntrypoint[2];
|
|
582
|
+
const escapedOriginalCommand = originalCommand.replace(/'/g, "'\\''");
|
|
583
|
+
// Use `su -p` to preserve the environment.
|
|
584
|
+
const suCommand = `su -p ${username} -c '${escapedOriginalCommand}'`;
|
|
585
|
+
// The entrypoint is always `['bash', '-c', '<command>']`, so we modify the command part.
|
|
586
|
+
finalEntrypoint[2] = `${setupUserCommands} && ${suCommand}`;
|
|
587
|
+
// We still need userFlag for the simpler proxy container, which does not have this issue.
|
|
588
|
+
userFlag = `--user ${uid}:${gid}`;
|
|
589
|
+
// When forcing a UID in the sandbox, $HOME can be reset to '/', so we copy $HOME as well.
|
|
590
|
+
args.push('--env', `HOME=${os.homedir()}`);
|
|
591
|
+
}
|
|
592
|
+
// push container image name
|
|
593
|
+
args.push(image);
|
|
594
|
+
// push container entrypoint (including args)
|
|
595
|
+
args.push(...finalEntrypoint);
|
|
596
|
+
// start and set up proxy if GEMINI_SANDBOX_PROXY_COMMAND is set
|
|
597
|
+
let proxyProcess = undefined;
|
|
598
|
+
let sandboxProcess = undefined;
|
|
599
|
+
if (proxyCommand) {
|
|
600
|
+
// run proxyCommand in its own container
|
|
601
|
+
const proxyContainerCommand = `${config.command} run --rm --init ${userFlag} --name ${SANDBOX_PROXY_NAME} --network ${SANDBOX_PROXY_NAME} -p 8877:8877 -v ${process.cwd()}:${workdir} --workdir ${workdir} ${image} ${proxyCommand}`;
|
|
602
|
+
proxyProcess = spawn(proxyContainerCommand, {
|
|
229
603
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
230
604
|
shell: true,
|
|
231
605
|
detached: true,
|
|
232
606
|
});
|
|
233
607
|
// install handlers to stop proxy on exit/signal
|
|
234
608
|
const stopProxy = () => {
|
|
235
|
-
console.log('stopping proxy ...');
|
|
236
|
-
|
|
237
|
-
process.kill(-proxyProcess.pid, 'SIGTERM');
|
|
238
|
-
}
|
|
609
|
+
console.log('stopping proxy container ...');
|
|
610
|
+
execSync(`${config.command} rm -f ${SANDBOX_PROXY_NAME}`);
|
|
239
611
|
};
|
|
240
612
|
process.on('exit', stopProxy);
|
|
241
613
|
process.on('SIGINT', stopProxy);
|
|
@@ -245,373 +617,42 @@ export async function start_sandbox(config, nodeArgs = [], cliConfig) {
|
|
|
245
617
|
// console.info(data.toString());
|
|
246
618
|
// });
|
|
247
619
|
proxyProcess.stderr?.on('data', (data) => {
|
|
248
|
-
console.error(data.toString());
|
|
620
|
+
console.error(data.toString().trim());
|
|
249
621
|
});
|
|
250
622
|
proxyProcess.on('close', (code, signal) => {
|
|
251
|
-
console.error(`ERROR: proxy command '${proxyCommand}' exited with code ${code}, signal ${signal}`);
|
|
252
623
|
if (sandboxProcess?.pid) {
|
|
253
624
|
process.kill(-sandboxProcess.pid, 'SIGTERM');
|
|
254
625
|
}
|
|
255
|
-
|
|
626
|
+
throw new FatalSandboxError(`Proxy container command '${proxyContainerCommand}' exited with code ${code}, signal ${signal}`);
|
|
256
627
|
});
|
|
257
628
|
console.log('waiting for proxy to start ...');
|
|
258
629
|
await execAsync(`until timeout 0.25 curl -s http://localhost:8877; do sleep 0.25; done`);
|
|
630
|
+
// connect proxy container to sandbox network
|
|
631
|
+
// (workaround for older versions of docker that don't support multiple --network args)
|
|
632
|
+
await execAsync(`${config.command} network connect ${SANDBOX_NETWORK_NAME} ${SANDBOX_PROXY_NAME}`);
|
|
259
633
|
}
|
|
260
634
|
// spawn child and let it inherit stdio
|
|
635
|
+
process.stdin.pause();
|
|
261
636
|
sandboxProcess = spawn(config.command, args, {
|
|
262
637
|
stdio: 'inherit',
|
|
263
638
|
});
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
// determine full path for gemini-cli to distinguish linked vs installed setting
|
|
269
|
-
const gcPath = fs.realpathSync(process.argv[1]);
|
|
270
|
-
const projectSandboxDockerfile = path.join(SETTINGS_DIRECTORY_NAME, 'sandbox.Dockerfile');
|
|
271
|
-
const isCustomProjectSandbox = fs.existsSync(projectSandboxDockerfile);
|
|
272
|
-
const image = config.image;
|
|
273
|
-
const workdir = path.resolve(process.cwd());
|
|
274
|
-
const containerWorkdir = getContainerPath(workdir);
|
|
275
|
-
// if BUILD_SANDBOX is set, then call scripts/build_sandbox.js under gemini-cli repo
|
|
276
|
-
//
|
|
277
|
-
// note this can only be done with binary linked from gemini-cli repo
|
|
278
|
-
if (process.env.BUILD_SANDBOX) {
|
|
279
|
-
if (!gcPath.includes('gemini-cli/packages/')) {
|
|
280
|
-
console.error('ERROR: cannot build sandbox using installed gemini binary; ' +
|
|
281
|
-
'run `npm link ./packages/cli` under gemini-cli repo to switch to linked binary.');
|
|
282
|
-
process.exit(1);
|
|
283
|
-
}
|
|
284
|
-
else {
|
|
285
|
-
console.error('building sandbox ...');
|
|
286
|
-
const gcRoot = gcPath.split('/packages/')[0];
|
|
287
|
-
// if project folder has sandbox.Dockerfile under project settings folder, use that
|
|
288
|
-
let buildArgs = '';
|
|
289
|
-
const projectSandboxDockerfile = path.join(SETTINGS_DIRECTORY_NAME, 'sandbox.Dockerfile');
|
|
290
|
-
if (isCustomProjectSandbox) {
|
|
291
|
-
console.error(`using ${projectSandboxDockerfile} for sandbox`);
|
|
292
|
-
buildArgs += `-f ${path.resolve(projectSandboxDockerfile)} -i ${image}`;
|
|
293
|
-
}
|
|
294
|
-
execSync(`cd ${gcRoot} && node scripts/build_sandbox.js -s ${buildArgs}`, {
|
|
295
|
-
stdio: 'inherit',
|
|
296
|
-
env: {
|
|
297
|
-
...process.env,
|
|
298
|
-
GEMINI_SANDBOX: config.command, // in case sandbox is enabled via flags (see config.ts under cli package)
|
|
299
|
-
},
|
|
639
|
+
return new Promise((resolve, reject) => {
|
|
640
|
+
sandboxProcess.on('error', (err) => {
|
|
641
|
+
console.error('Sandbox process error:', err);
|
|
642
|
+
reject(err);
|
|
300
643
|
});
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const remedy = image === LOCAL_DEV_SANDBOX_IMAGE_NAME
|
|
306
|
-
? 'Try running `npm run build:all` or `npm run build:sandbox` under the gemini-cli repo to build it locally, or check the image name and your network connection.'
|
|
307
|
-
: 'Please check the image name, your network connection, or notify gemini-cli-dev@google.com if the issue persists.';
|
|
308
|
-
console.error(`ERROR: Sandbox image '${image}' is missing or could not be pulled. ${remedy}`);
|
|
309
|
-
process.exit(1);
|
|
310
|
-
}
|
|
311
|
-
// use interactive mode and auto-remove container on exit
|
|
312
|
-
// run init binary inside container to forward signals & reap zombies
|
|
313
|
-
const args = ['run', '-i', '--rm', '--init', '--workdir', containerWorkdir];
|
|
314
|
-
// add custom flags from SANDBOX_FLAGS
|
|
315
|
-
if (process.env.SANDBOX_FLAGS) {
|
|
316
|
-
const flags = parse(process.env.SANDBOX_FLAGS, process.env).filter((f) => typeof f === 'string');
|
|
317
|
-
args.push(...flags);
|
|
318
|
-
}
|
|
319
|
-
// add TTY only if stdin is TTY as well, i.e. for piped input don't init TTY in container
|
|
320
|
-
if (process.stdin.isTTY) {
|
|
321
|
-
args.push('-t');
|
|
322
|
-
}
|
|
323
|
-
// mount current directory as working directory in sandbox (set via --workdir)
|
|
324
|
-
args.push('--volume', `${workdir}:${containerWorkdir}`);
|
|
325
|
-
// mount user settings directory inside container, after creating if missing
|
|
326
|
-
// note user/home changes inside sandbox and we mount at BOTH paths for consistency
|
|
327
|
-
const userSettingsDirOnHost = USER_SETTINGS_DIR;
|
|
328
|
-
const userSettingsDirInSandbox = getContainerPath(`/home/node/${SETTINGS_DIRECTORY_NAME}`);
|
|
329
|
-
if (!fs.existsSync(userSettingsDirOnHost)) {
|
|
330
|
-
fs.mkdirSync(userSettingsDirOnHost);
|
|
331
|
-
}
|
|
332
|
-
args.push('--volume', `${userSettingsDirOnHost}:${userSettingsDirInSandbox}`);
|
|
333
|
-
if (userSettingsDirInSandbox !== userSettingsDirOnHost) {
|
|
334
|
-
args.push('--volume', `${userSettingsDirOnHost}:${getContainerPath(userSettingsDirOnHost)}`);
|
|
335
|
-
}
|
|
336
|
-
// mount os.tmpdir() as os.tmpdir() inside container
|
|
337
|
-
args.push('--volume', `${os.tmpdir()}:${getContainerPath(os.tmpdir())}`);
|
|
338
|
-
// mount gcloud config directory if it exists
|
|
339
|
-
const gcloudConfigDir = path.join(os.homedir(), '.config', 'gcloud');
|
|
340
|
-
if (fs.existsSync(gcloudConfigDir)) {
|
|
341
|
-
args.push('--volume', `${gcloudConfigDir}:${getContainerPath(gcloudConfigDir)}:ro`);
|
|
342
|
-
}
|
|
343
|
-
// mount ADC file if GOOGLE_APPLICATION_CREDENTIALS is set
|
|
344
|
-
if (process.env.GOOGLE_APPLICATION_CREDENTIALS) {
|
|
345
|
-
const adcFile = process.env.GOOGLE_APPLICATION_CREDENTIALS;
|
|
346
|
-
if (fs.existsSync(adcFile)) {
|
|
347
|
-
args.push('--volume', `${adcFile}:${getContainerPath(adcFile)}:ro`);
|
|
348
|
-
args.push('--env', `GOOGLE_APPLICATION_CREDENTIALS=${getContainerPath(adcFile)}`);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
// mount paths listed in SANDBOX_MOUNTS
|
|
352
|
-
if (process.env.SANDBOX_MOUNTS) {
|
|
353
|
-
for (let mount of process.env.SANDBOX_MOUNTS.split(',')) {
|
|
354
|
-
if (mount.trim()) {
|
|
355
|
-
// parse mount as from:to:opts
|
|
356
|
-
let [from, to, opts] = mount.trim().split(':');
|
|
357
|
-
to = to || from; // default to mount at same path inside container
|
|
358
|
-
opts = opts || 'ro'; // default to read-only
|
|
359
|
-
mount = `${from}:${to}:${opts}`;
|
|
360
|
-
// check that from path is absolute
|
|
361
|
-
if (!path.isAbsolute(from)) {
|
|
362
|
-
console.error(`ERROR: path '${from}' listed in SANDBOX_MOUNTS must be absolute`);
|
|
363
|
-
process.exit(1);
|
|
364
|
-
}
|
|
365
|
-
// check that from path exists on host
|
|
366
|
-
if (!fs.existsSync(from)) {
|
|
367
|
-
console.error(`ERROR: missing mount path '${from}' listed in SANDBOX_MOUNTS`);
|
|
368
|
-
process.exit(1);
|
|
369
|
-
}
|
|
370
|
-
console.error(`SANDBOX_MOUNTS: ${from} -> ${to} (${opts})`);
|
|
371
|
-
args.push('--volume', mount);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
// expose env-specified ports on the sandbox
|
|
376
|
-
ports().forEach((p) => args.push('--publish', `${p}:${p}`));
|
|
377
|
-
// if DEBUG is set, expose debugging port
|
|
378
|
-
if (process.env.DEBUG) {
|
|
379
|
-
const debugPort = process.env.DEBUG_PORT || '9229';
|
|
380
|
-
args.push(`--publish`, `${debugPort}:${debugPort}`);
|
|
381
|
-
}
|
|
382
|
-
// copy proxy environment variables, replacing localhost with SANDBOX_PROXY_NAME
|
|
383
|
-
// copy as both upper-case and lower-case as is required by some utilities
|
|
384
|
-
// GEMINI_SANDBOX_PROXY_COMMAND implies HTTPS_PROXY unless HTTP_PROXY is set
|
|
385
|
-
const proxyCommand = process.env.GEMINI_SANDBOX_PROXY_COMMAND;
|
|
386
|
-
if (proxyCommand) {
|
|
387
|
-
let proxy = process.env.HTTPS_PROXY ||
|
|
388
|
-
process.env.https_proxy ||
|
|
389
|
-
process.env.HTTP_PROXY ||
|
|
390
|
-
process.env.http_proxy ||
|
|
391
|
-
'http://localhost:8877';
|
|
392
|
-
proxy = proxy.replace('localhost', SANDBOX_PROXY_NAME);
|
|
393
|
-
if (proxy) {
|
|
394
|
-
args.push('--env', `HTTPS_PROXY=${proxy}`);
|
|
395
|
-
args.push('--env', `https_proxy=${proxy}`); // lower-case can be required, e.g. for curl
|
|
396
|
-
args.push('--env', `HTTP_PROXY=${proxy}`);
|
|
397
|
-
args.push('--env', `http_proxy=${proxy}`);
|
|
398
|
-
}
|
|
399
|
-
const noProxy = process.env.NO_PROXY || process.env.no_proxy;
|
|
400
|
-
if (noProxy) {
|
|
401
|
-
args.push('--env', `NO_PROXY=${noProxy}`);
|
|
402
|
-
args.push('--env', `no_proxy=${noProxy}`);
|
|
403
|
-
}
|
|
404
|
-
// if using proxy, switch to internal networking through proxy
|
|
405
|
-
if (proxy) {
|
|
406
|
-
execSync(`${config.command} network inspect ${SANDBOX_NETWORK_NAME} || ${config.command} network create --internal ${SANDBOX_NETWORK_NAME}`);
|
|
407
|
-
args.push('--network', SANDBOX_NETWORK_NAME);
|
|
408
|
-
// if proxy command is set, create a separate network w/ host access (i.e. non-internal)
|
|
409
|
-
// we will run proxy in its own container connected to both host network and internal network
|
|
410
|
-
// this allows proxy to work even on rootless podman on macos with host<->vm<->container isolation
|
|
411
|
-
if (proxyCommand) {
|
|
412
|
-
execSync(`${config.command} network inspect ${SANDBOX_PROXY_NAME} || ${config.command} network create ${SANDBOX_PROXY_NAME}`);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
// name container after image, plus numeric suffix to avoid conflicts
|
|
417
|
-
const imageName = parseImageName(image);
|
|
418
|
-
let index = 0;
|
|
419
|
-
const containerNameCheck = execSync(`${config.command} ps -a --format "{{.Names}}"`)
|
|
420
|
-
.toString()
|
|
421
|
-
.trim();
|
|
422
|
-
while (containerNameCheck.includes(`${imageName}-${index}`)) {
|
|
423
|
-
index++;
|
|
424
|
-
}
|
|
425
|
-
const containerName = `${imageName}-${index}`;
|
|
426
|
-
args.push('--name', containerName, '--hostname', containerName);
|
|
427
|
-
// copy GEMINI_API_KEY(s)
|
|
428
|
-
if (process.env.GEMINI_API_KEY) {
|
|
429
|
-
args.push('--env', `GEMINI_API_KEY=${process.env.GEMINI_API_KEY}`);
|
|
430
|
-
}
|
|
431
|
-
if (process.env.GOOGLE_API_KEY) {
|
|
432
|
-
args.push('--env', `GOOGLE_API_KEY=${process.env.GOOGLE_API_KEY}`);
|
|
433
|
-
}
|
|
434
|
-
// copy OPENAI_API_KEY and related env vars for Qwen
|
|
435
|
-
if (process.env.OPENAI_API_KEY) {
|
|
436
|
-
args.push('--env', `OPENAI_API_KEY=${process.env.OPENAI_API_KEY}`);
|
|
437
|
-
}
|
|
438
|
-
// copy TAVILY_API_KEY for web search tool
|
|
439
|
-
if (process.env.TAVILY_API_KEY) {
|
|
440
|
-
args.push('--env', `TAVILY_API_KEY=${process.env.TAVILY_API_KEY}`);
|
|
441
|
-
}
|
|
442
|
-
if (process.env.OPENAI_BASE_URL) {
|
|
443
|
-
args.push('--env', `OPENAI_BASE_URL=${process.env.OPENAI_BASE_URL}`);
|
|
444
|
-
}
|
|
445
|
-
if (process.env.OPENAI_MODEL) {
|
|
446
|
-
args.push('--env', `OPENAI_MODEL=${process.env.OPENAI_MODEL}`);
|
|
447
|
-
}
|
|
448
|
-
// copy GOOGLE_GENAI_USE_VERTEXAI
|
|
449
|
-
if (process.env.GOOGLE_GENAI_USE_VERTEXAI) {
|
|
450
|
-
args.push('--env', `GOOGLE_GENAI_USE_VERTEXAI=${process.env.GOOGLE_GENAI_USE_VERTEXAI}`);
|
|
451
|
-
}
|
|
452
|
-
// copy GOOGLE_GENAI_USE_GCA
|
|
453
|
-
if (process.env.GOOGLE_GENAI_USE_GCA) {
|
|
454
|
-
args.push('--env', `GOOGLE_GENAI_USE_GCA=${process.env.GOOGLE_GENAI_USE_GCA}`);
|
|
455
|
-
}
|
|
456
|
-
// copy GOOGLE_CLOUD_PROJECT
|
|
457
|
-
if (process.env.GOOGLE_CLOUD_PROJECT) {
|
|
458
|
-
args.push('--env', `GOOGLE_CLOUD_PROJECT=${process.env.GOOGLE_CLOUD_PROJECT}`);
|
|
459
|
-
}
|
|
460
|
-
// copy GOOGLE_CLOUD_LOCATION
|
|
461
|
-
if (process.env.GOOGLE_CLOUD_LOCATION) {
|
|
462
|
-
args.push('--env', `GOOGLE_CLOUD_LOCATION=${process.env.GOOGLE_CLOUD_LOCATION}`);
|
|
463
|
-
}
|
|
464
|
-
// copy GEMINI_MODEL
|
|
465
|
-
if (process.env.GEMINI_MODEL) {
|
|
466
|
-
args.push('--env', `GEMINI_MODEL=${process.env.GEMINI_MODEL}`);
|
|
467
|
-
}
|
|
468
|
-
// copy TERM and COLORTERM to try to maintain terminal setup
|
|
469
|
-
if (process.env.TERM) {
|
|
470
|
-
args.push('--env', `TERM=${process.env.TERM}`);
|
|
471
|
-
}
|
|
472
|
-
if (process.env.COLORTERM) {
|
|
473
|
-
args.push('--env', `COLORTERM=${process.env.COLORTERM}`);
|
|
474
|
-
}
|
|
475
|
-
// copy VIRTUAL_ENV if under working directory
|
|
476
|
-
// also mount-replace VIRTUAL_ENV directory with <project_settings>/sandbox.venv
|
|
477
|
-
// sandbox can then set up this new VIRTUAL_ENV directory using sandbox.bashrc (see below)
|
|
478
|
-
// directory will be empty if not set up, which is still preferable to having host binaries
|
|
479
|
-
if (process.env.VIRTUAL_ENV?.toLowerCase().startsWith(workdir.toLowerCase())) {
|
|
480
|
-
const sandboxVenvPath = path.resolve(SETTINGS_DIRECTORY_NAME, 'sandbox.venv');
|
|
481
|
-
if (!fs.existsSync(sandboxVenvPath)) {
|
|
482
|
-
fs.mkdirSync(sandboxVenvPath, { recursive: true });
|
|
483
|
-
}
|
|
484
|
-
args.push('--volume', `${sandboxVenvPath}:${getContainerPath(process.env.VIRTUAL_ENV)}`);
|
|
485
|
-
args.push('--env', `VIRTUAL_ENV=${getContainerPath(process.env.VIRTUAL_ENV)}`);
|
|
486
|
-
}
|
|
487
|
-
// copy additional environment variables from SANDBOX_ENV
|
|
488
|
-
if (process.env.SANDBOX_ENV) {
|
|
489
|
-
for (let env of process.env.SANDBOX_ENV.split(',')) {
|
|
490
|
-
if ((env = env.trim())) {
|
|
491
|
-
if (env.includes('=')) {
|
|
492
|
-
console.error(`SANDBOX_ENV: ${env}`);
|
|
493
|
-
args.push('--env', env);
|
|
644
|
+
sandboxProcess?.on('close', (code, signal) => {
|
|
645
|
+
process.stdin.resume();
|
|
646
|
+
if (code !== 0 && code !== null) {
|
|
647
|
+
console.log(`Sandbox process exited with code: ${code}, signal: ${signal}`);
|
|
494
648
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
process.exit(1);
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
// copy NODE_OPTIONS
|
|
503
|
-
const existingNodeOptions = process.env.NODE_OPTIONS || '';
|
|
504
|
-
const allNodeOptions = [
|
|
505
|
-
...(existingNodeOptions ? [existingNodeOptions] : []),
|
|
506
|
-
...nodeArgs,
|
|
507
|
-
].join(' ');
|
|
508
|
-
if (allNodeOptions.length > 0) {
|
|
509
|
-
args.push('--env', `NODE_OPTIONS="${allNodeOptions}"`);
|
|
510
|
-
}
|
|
511
|
-
// set SANDBOX as container name
|
|
512
|
-
args.push('--env', `SANDBOX=${containerName}`);
|
|
513
|
-
// for podman only, use empty --authfile to skip unnecessary auth refresh overhead
|
|
514
|
-
if (config.command === 'podman') {
|
|
515
|
-
const emptyAuthFilePath = path.join(os.tmpdir(), 'empty_auth.json');
|
|
516
|
-
fs.writeFileSync(emptyAuthFilePath, '{}', 'utf-8');
|
|
517
|
-
args.push('--authfile', emptyAuthFilePath);
|
|
518
|
-
}
|
|
519
|
-
// Determine if the current user's UID/GID should be passed to the sandbox.
|
|
520
|
-
// See shouldUseCurrentUserInSandbox for more details.
|
|
521
|
-
let userFlag = '';
|
|
522
|
-
const finalEntrypoint = entrypoint(workdir);
|
|
523
|
-
if (process.env.GEMINI_CLI_INTEGRATION_TEST === 'true') {
|
|
524
|
-
args.push('--user', 'root');
|
|
525
|
-
userFlag = '--user root';
|
|
526
|
-
}
|
|
527
|
-
else if (await shouldUseCurrentUserInSandbox()) {
|
|
528
|
-
// For the user-creation logic to work, the container must start as root.
|
|
529
|
-
// The entrypoint script then handles dropping privileges to the correct user.
|
|
530
|
-
args.push('--user', 'root');
|
|
531
|
-
const uid = execSync('id -u').toString().trim();
|
|
532
|
-
const gid = execSync('id -g').toString().trim();
|
|
533
|
-
// Instead of passing --user to the main sandbox container, we let it
|
|
534
|
-
// start as root, then create a user with the host's UID/GID, and
|
|
535
|
-
// finally switch to that user to run the gemini process. This is
|
|
536
|
-
// necessary on Linux to ensure the user exists within the
|
|
537
|
-
// container's /etc/passwd file, which is required by os.userInfo().
|
|
538
|
-
const username = 'gemini';
|
|
539
|
-
const homeDir = getContainerPath(os.homedir());
|
|
540
|
-
const setupUserCommands = [
|
|
541
|
-
// Use -f with groupadd to avoid errors if the group already exists.
|
|
542
|
-
`groupadd -f -g ${gid} ${username}`,
|
|
543
|
-
// Create user only if it doesn't exist. Use -o for non-unique UID.
|
|
544
|
-
`id -u ${username} &>/dev/null || useradd -o -u ${uid} -g ${gid} -d ${homeDir} -s /bin/bash ${username}`,
|
|
545
|
-
].join(' && ');
|
|
546
|
-
const originalCommand = finalEntrypoint[2];
|
|
547
|
-
const escapedOriginalCommand = originalCommand.replace(/'/g, "'\\''");
|
|
548
|
-
// Use `su -p` to preserve the environment.
|
|
549
|
-
const suCommand = `su -p ${username} -c '${escapedOriginalCommand}'`;
|
|
550
|
-
// The entrypoint is always `['bash', '-c', '<command>']`, so we modify the command part.
|
|
551
|
-
finalEntrypoint[2] = `${setupUserCommands} && ${suCommand}`;
|
|
552
|
-
// We still need userFlag for the simpler proxy container, which does not have this issue.
|
|
553
|
-
userFlag = `--user ${uid}:${gid}`;
|
|
554
|
-
// When forcing a UID in the sandbox, $HOME can be reset to '/', so we copy $HOME as well.
|
|
555
|
-
args.push('--env', `HOME=${os.homedir()}`);
|
|
556
|
-
}
|
|
557
|
-
// push container image name
|
|
558
|
-
args.push(image);
|
|
559
|
-
// push container entrypoint (including args)
|
|
560
|
-
args.push(...finalEntrypoint);
|
|
561
|
-
// start and set up proxy if GEMINI_SANDBOX_PROXY_COMMAND is set
|
|
562
|
-
let proxyProcess = undefined;
|
|
563
|
-
let sandboxProcess = undefined;
|
|
564
|
-
if (proxyCommand) {
|
|
565
|
-
// run proxyCommand in its own container
|
|
566
|
-
const proxyContainerCommand = `${config.command} run --rm --init ${userFlag} --name ${SANDBOX_PROXY_NAME} --network ${SANDBOX_PROXY_NAME} -p 8877:8877 -v ${process.cwd()}:${workdir} --workdir ${workdir} ${image} ${proxyCommand}`;
|
|
567
|
-
proxyProcess = spawn(proxyContainerCommand, {
|
|
568
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
569
|
-
shell: true,
|
|
570
|
-
detached: true,
|
|
571
|
-
});
|
|
572
|
-
// install handlers to stop proxy on exit/signal
|
|
573
|
-
const stopProxy = () => {
|
|
574
|
-
console.log('stopping proxy container ...');
|
|
575
|
-
execSync(`${config.command} rm -f ${SANDBOX_PROXY_NAME}`);
|
|
576
|
-
};
|
|
577
|
-
process.on('exit', stopProxy);
|
|
578
|
-
process.on('SIGINT', stopProxy);
|
|
579
|
-
process.on('SIGTERM', stopProxy);
|
|
580
|
-
// commented out as it disrupts ink rendering
|
|
581
|
-
// proxyProcess.stdout?.on('data', (data) => {
|
|
582
|
-
// console.info(data.toString());
|
|
583
|
-
// });
|
|
584
|
-
proxyProcess.stderr?.on('data', (data) => {
|
|
585
|
-
console.error(data.toString().trim());
|
|
586
|
-
});
|
|
587
|
-
proxyProcess.on('close', (code, signal) => {
|
|
588
|
-
console.error(`ERROR: proxy container command '${proxyContainerCommand}' exited with code ${code}, signal ${signal}`);
|
|
589
|
-
if (sandboxProcess?.pid) {
|
|
590
|
-
process.kill(-sandboxProcess.pid, 'SIGTERM');
|
|
591
|
-
}
|
|
592
|
-
process.exit(1);
|
|
649
|
+
resolve(code ?? 1);
|
|
650
|
+
});
|
|
593
651
|
});
|
|
594
|
-
console.log('waiting for proxy to start ...');
|
|
595
|
-
await execAsync(`until timeout 0.25 curl -s http://localhost:8877; do sleep 0.25; done`);
|
|
596
|
-
// connect proxy container to sandbox network
|
|
597
|
-
// (workaround for older versions of docker that don't support multiple --network args)
|
|
598
|
-
await execAsync(`${config.command} network connect ${SANDBOX_NETWORK_NAME} ${SANDBOX_PROXY_NAME}`);
|
|
599
652
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
});
|
|
604
|
-
sandboxProcess.on('error', (err) => {
|
|
605
|
-
console.error('Sandbox process error:', err);
|
|
606
|
-
});
|
|
607
|
-
await new Promise((resolve) => {
|
|
608
|
-
sandboxProcess?.on('close', (code, signal) => {
|
|
609
|
-
if (code !== 0) {
|
|
610
|
-
console.log(`Sandbox process exited with code: ${code}, signal: ${signal}`);
|
|
611
|
-
}
|
|
612
|
-
resolve();
|
|
613
|
-
});
|
|
614
|
-
});
|
|
653
|
+
finally {
|
|
654
|
+
patcher.cleanup();
|
|
655
|
+
}
|
|
615
656
|
}
|
|
616
657
|
// Helper functions to ensure sandbox image is present
|
|
617
658
|
async function imageExists(sandbox, image) {
|