@machina.ai/cell-cli 1.41.1-rc2 → 1.45.1-rc1
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 +17 -17
- package/dist/index.js.map +1 -1
- package/dist/package.json +4 -4
- package/dist/src/acp/README.md +81 -0
- package/dist/src/acp/{commandHandler.d.ts → acpCommandHandler.d.ts} +1 -1
- package/dist/src/acp/{commandHandler.js → acpCommandHandler.js} +2 -2
- package/dist/src/acp/acpCommandHandler.js.map +1 -0
- package/dist/src/acp/{commandHandler.test.js → acpCommandHandler.test.js} +4 -5
- package/dist/src/acp/acpCommandHandler.test.js.map +1 -0
- package/dist/src/acp/acpErrors.d.ts +1 -1
- package/dist/src/acp/acpErrors.js +1 -1
- package/dist/src/acp/acpErrors.test.d.ts +1 -1
- package/dist/src/acp/acpErrors.test.js +1 -1
- package/dist/src/acp/{fileSystemService.d.ts → acpFileSystemService.d.ts} +1 -1
- package/dist/src/acp/{fileSystemService.js → acpFileSystemService.js} +7 -4
- package/dist/src/acp/acpFileSystemService.js.map +1 -0
- package/dist/src/acp/{fileSystemService.test.js → acpFileSystemService.test.js} +3 -3
- package/dist/src/acp/acpFileSystemService.test.js.map +1 -0
- package/dist/src/acp/acpResume.test.d.ts +1 -1
- package/dist/src/acp/acpResume.test.js +12 -7
- package/dist/src/acp/acpResume.test.js.map +1 -1
- package/dist/src/acp/acpRpcDispatcher.d.ts +28 -0
- package/dist/src/acp/acpRpcDispatcher.js +177 -0
- package/dist/src/acp/acpRpcDispatcher.js.map +1 -0
- package/dist/src/acp/acpRpcDispatcher.test.d.ts +6 -0
- package/dist/src/acp/acpRpcDispatcher.test.js +238 -0
- package/dist/src/acp/acpRpcDispatcher.test.js.map +1 -0
- package/dist/src/acp/acpSession.d.ts +36 -0
- package/dist/src/acp/{acpClient.js → acpSession.js} +333 -781
- package/dist/src/acp/acpSession.js.map +1 -0
- package/dist/src/acp/acpSession.test.d.ts +6 -0
- package/dist/src/acp/acpSession.test.js +739 -0
- package/dist/src/acp/acpSession.test.js.map +1 -0
- package/dist/src/acp/acpSessionManager.d.ts +30 -0
- package/dist/src/acp/acpSessionManager.js +206 -0
- package/dist/src/acp/acpSessionManager.js.map +1 -0
- package/dist/src/acp/acpSessionManager.test.d.ts +6 -0
- package/dist/src/acp/acpSessionManager.test.js +283 -0
- package/dist/src/acp/acpSessionManager.test.js.map +1 -0
- package/dist/src/acp/acpStdioTransport.d.ts +9 -0
- package/dist/src/acp/acpStdioTransport.js +23 -0
- package/dist/src/acp/acpStdioTransport.js.map +1 -0
- package/dist/src/acp/acpUtils.d.ts +56 -0
- package/dist/src/acp/acpUtils.js +288 -0
- package/dist/src/acp/acpUtils.js.map +1 -0
- package/dist/src/acp/commands/commandRegistry.d.ts +1 -1
- package/dist/src/acp/commands/commandRegistry.js +1 -1
- package/dist/src/acp/commands/extensions.d.ts +1 -1
- package/dist/src/acp/commands/extensions.js +1 -1
- package/dist/src/acp/commands/extensions.test.d.ts +6 -0
- package/dist/src/acp/commands/extensions.test.js +70 -0
- package/dist/src/acp/commands/extensions.test.js.map +1 -0
- package/dist/src/acp/commands/init.d.ts +1 -1
- package/dist/src/acp/commands/init.js +1 -1
- package/dist/src/acp/commands/memory.d.ts +3 -8
- package/dist/src/acp/commands/memory.js +18 -47
- package/dist/src/acp/commands/memory.js.map +1 -1
- package/dist/src/acp/commands/restore.d.ts +1 -1
- package/dist/src/acp/commands/restore.js +1 -1
- package/dist/src/acp/commands/restore.test.js +7 -13
- package/dist/src/acp/commands/restore.test.js.map +1 -1
- package/dist/src/acp/commands/types.d.ts +1 -1
- package/dist/src/acp/commands/types.js +1 -1
- package/dist/src/commands/extensions/configure.test.js +6 -2
- package/dist/src/commands/extensions/configure.test.js.map +1 -1
- package/dist/src/commands/extensions/utils.d.ts +1 -1
- package/dist/src/commands/extensions/utils.js +1 -2
- package/dist/src/commands/extensions/utils.js.map +1 -1
- package/dist/src/commands/mcp/list.js +19 -5
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/mcp/list.test.js +285 -100
- package/dist/src/commands/mcp/list.test.js.map +1 -1
- package/dist/src/config/auth.d.ts +1 -1
- package/dist/src/config/auth.js +4 -3
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/auth.test.js +11 -4
- package/dist/src/config/auth.test.js.map +1 -1
- package/dist/src/config/config.d.ts +4 -0
- package/dist/src/config/config.js +65 -47
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +25 -106
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/extension-manager-agents.test.js +2 -0
- package/dist/src/config/extension-manager-agents.test.js.map +1 -1
- package/dist/src/config/extension-manager-hydration.test.js +2 -0
- package/dist/src/config/extension-manager-hydration.test.js.map +1 -1
- package/dist/src/config/extension-manager-scope.test.js +4 -2
- package/dist/src/config/extension-manager-scope.test.js.map +1 -1
- package/dist/src/config/extension-manager-themes.spec.js +2 -0
- package/dist/src/config/extension-manager-themes.spec.js.map +1 -1
- package/dist/src/config/extension-manager.d.ts +2 -2
- package/dist/src/config/extension-manager.js +2 -1
- package/dist/src/config/extension-manager.js.map +1 -1
- package/dist/src/config/extensionRegistryClient.js +0 -1
- package/dist/src/config/extensionRegistryClient.js.map +1 -1
- package/dist/src/config/extensions/consent.d.ts +1 -1
- package/dist/src/config/extensions/consent.js +5 -4
- package/dist/src/config/extensions/consent.js.map +1 -1
- package/dist/src/config/extensions/consent.test.js +22 -0
- package/dist/src/config/extensions/consent.test.js.map +1 -1
- package/dist/src/config/extensions/extensionEnablement.js +4 -2
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.d.ts +3 -3
- package/dist/src/config/extensions/extensionSettings.js +7 -3
- package/dist/src/config/extensions/extensionSettings.js.map +1 -1
- package/dist/src/config/extensions/variables.js +1 -3
- package/dist/src/config/extensions/variables.js.map +1 -1
- package/dist/src/config/footerItems.d.ts +4 -0
- package/dist/src/config/footerItems.js +6 -0
- package/dist/src/config/footerItems.js.map +1 -1
- package/dist/src/config/footerItems.test.js +1 -0
- package/dist/src/config/footerItems.test.js.map +1 -1
- package/dist/src/config/mcp/mcpServerEnablement.js +1 -1
- package/dist/src/config/mcp/mcpServerEnablement.js.map +1 -1
- package/dist/src/config/mutual-exclusivity.test.js +33 -0
- package/dist/src/config/mutual-exclusivity.test.js.map +1 -0
- package/dist/src/config/settings-env-isolation.test.d.ts +6 -0
- package/dist/src/config/settings-env-isolation.test.js +188 -0
- package/dist/src/config/settings-env-isolation.test.js.map +1 -0
- package/dist/src/config/settings.d.ts +15 -1
- package/dist/src/config/settings.js +85 -10
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settings.test.js +167 -0
- package/dist/src/config/settings.test.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +56 -25
- package/dist/src/config/settingsSchema.js +66 -27
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +8 -0
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/skipExtensions.test.d.ts +6 -0
- package/dist/src/config/skipExtensions.test.js +49 -0
- package/dist/src/config/skipExtensions.test.js.map +1 -0
- package/dist/src/config/workspace-policy-cli.test.js +0 -5
- package/dist/src/config/workspace-policy-cli.test.js.map +1 -1
- package/dist/src/gemini.d.ts +2 -2
- package/dist/src/gemini.js +108 -30
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +147 -16
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/gemini_cleanup.test.js +1 -1
- package/dist/src/gemini_cleanup.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/interactiveCli.js +1 -1
- package/dist/src/interactiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.d.ts +7 -0
- package/dist/src/nonInteractiveCli.js +56 -6
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.js +253 -18
- package/dist/src/nonInteractiveCli.test.js.map +1 -1
- package/dist/src/nonInteractiveCliAgentSession.d.ts +7 -0
- package/dist/src/nonInteractiveCliAgentSession.js +22 -3
- package/dist/src/nonInteractiveCliAgentSession.js.map +1 -1
- package/dist/src/nonInteractiveCliAgentSession.test.js +200 -20
- package/dist/src/nonInteractiveCliAgentSession.test.js.map +1 -1
- package/dist/src/output-redirection.test.d.ts +6 -0
- package/dist/src/output-redirection.test.js +77 -0
- package/dist/src/output-redirection.test.js.map +1 -0
- package/dist/src/patches/http-proxy-agent.d.ts +6 -0
- package/dist/src/patches/http-proxy-agent.js +8 -0
- package/dist/src/patches/http-proxy-agent.js.map +1 -0
- package/dist/src/patches/https-proxy-agent.d.ts +6 -0
- package/dist/src/patches/https-proxy-agent.js +8 -0
- package/dist/src/patches/https-proxy-agent.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.js +5 -1
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +6 -1
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/FileCommandLoader.d.ts +21 -0
- package/dist/src/services/FileCommandLoader.js +58 -6
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/FileCommandLoader.test.js +27 -1
- package/dist/src/services/FileCommandLoader.test.js.map +1 -1
- package/dist/src/test-utils/mockCommandContext.js +6 -1
- package/dist/src/test-utils/mockCommandContext.js.map +1 -1
- package/dist/src/test-utils/mockConfig.js +0 -3
- package/dist/src/test-utils/mockConfig.js.map +1 -1
- package/dist/src/test-utils/render.js +1 -0
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/test-utils/settings.d.ts +1 -0
- package/dist/src/test-utils/settings.js.map +1 -1
- package/dist/src/ui/AppContainer.js +60 -73
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +101 -1
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.js +6 -3
- package/dist/src/ui/auth/AuthDialog.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.test.js +33 -10
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/LoginRestartDialog.d.ts +13 -0
- package/dist/src/ui/auth/{LoginWithGoogleRestartDialog.js → LoginRestartDialog.js} +7 -6
- package/dist/src/ui/auth/LoginRestartDialog.js.map +1 -0
- package/dist/src/ui/auth/LoginRestartDialog.test.d.ts +6 -0
- package/dist/src/ui/auth/{LoginWithGoogleRestartDialog.test.js → LoginRestartDialog.test.js} +13 -8
- package/dist/src/ui/auth/LoginRestartDialog.test.js.map +1 -0
- package/dist/src/ui/auth/useAuth.d.ts +1 -1
- package/dist/src/ui/auth/useAuth.js +2 -2
- package/dist/src/ui/auth/useAuth.js.map +1 -1
- package/dist/src/ui/auth/useAuth.test.js +10 -10
- package/dist/src/ui/auth/useAuth.test.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.js +19 -2
- package/dist/src/ui/commands/agentsCommand.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.test.js +34 -3
- package/dist/src/ui/commands/agentsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.js +36 -0
- package/dist/src/ui/commands/bugCommand.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.test.js +106 -1
- package/dist/src/ui/commands/bugCommand.test.js.map +1 -1
- package/dist/src/ui/commands/bugMemoryCommand.d.ts +7 -0
- package/dist/src/ui/commands/bugMemoryCommand.js +62 -0
- package/dist/src/ui/commands/bugMemoryCommand.js.map +1 -0
- package/dist/src/ui/commands/bugMemoryCommand.test.js +100 -0
- package/dist/src/ui/commands/bugMemoryCommand.test.js.map +1 -0
- package/dist/src/ui/commands/commandsCommand.js +52 -4
- package/dist/src/ui/commands/commandsCommand.js.map +1 -1
- package/dist/src/ui/commands/commandsCommand.test.js +75 -2
- package/dist/src/ui/commands/commandsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.js +28 -26
- package/dist/src/ui/commands/compressCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.test.js +5 -0
- package/dist/src/ui/commands/compressCommand.test.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.js +2 -2
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.test.js +1 -0
- package/dist/src/ui/commands/directoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/exportSessionCommand.d.ts +7 -0
- package/dist/src/ui/commands/exportSessionCommand.js +74 -0
- package/dist/src/ui/commands/exportSessionCommand.js.map +1 -0
- package/dist/src/ui/commands/exportSessionCommand.test.js +100 -0
- package/dist/src/ui/commands/exportSessionCommand.test.js.map +1 -0
- package/dist/src/ui/commands/extensionsCommand.js +1 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.test.js +4 -0
- package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.d.ts +2 -1
- package/dist/src/ui/commands/memoryCommand.js +110 -117
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.test.js +18 -71
- package/dist/src/ui/commands/memoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/quitCommand.js +3 -1
- package/dist/src/ui/commands/quitCommand.js.map +1 -1
- package/dist/src/ui/commands/quitCommand.test.js +46 -1
- package/dist/src/ui/commands/quitCommand.test.js.map +1 -1
- package/dist/src/ui/commands/rewindCommand.js.map +1 -1
- package/dist/src/ui/commands/skillsCommand.js +1 -1
- package/dist/src/ui/commands/skillsCommand.js.map +1 -1
- package/dist/src/ui/commands/skillsCommand.test.js +19 -0
- package/dist/src/ui/commands/skillsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +3 -1
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +6 -6
- package/dist/src/ui/components/AsciiArt.js +6 -6
- package/dist/src/ui/components/AskUserDialog.js +3 -1
- package/dist/src/ui/components/AskUserDialog.js.map +1 -1
- package/dist/src/ui/components/AskUserDialog.test.js +43 -0
- package/dist/src/ui/components/AskUserDialog.test.js.map +1 -1
- package/dist/src/ui/components/Composer.js +1 -1
- package/dist/src/ui/components/Composer.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +4 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.js +3 -6
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/Footer.js +6 -0
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/FooterConfigDialog.js +1 -0
- package/dist/src/ui/components/FooterConfigDialog.js.map +1 -1
- package/dist/src/ui/components/FooterConfigDialog.test.js +1 -1
- package/dist/src/ui/components/FooterConfigDialog.test.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.js +3 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.js +15 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
- package/dist/src/ui/components/{SkillInboxDialog.d.ts → InboxDialog.d.ts} +3 -2
- package/dist/src/ui/components/InboxDialog.js +756 -0
- package/dist/src/ui/components/InboxDialog.js.map +1 -0
- package/dist/src/ui/components/InboxDialog.test.d.ts +6 -0
- package/dist/src/ui/components/InboxDialog.test.js +824 -0
- package/dist/src/ui/components/InboxDialog.test.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +3 -0
- package/dist/src/ui/components/InputPrompt.js +35 -17
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.js +95 -46
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/ListeningIndicator.d.ts +10 -0
- package/dist/src/ui/components/ListeningIndicator.js +30 -0
- package/dist/src/ui/components/ListeningIndicator.js.map +1 -0
- package/dist/src/ui/components/MainContent.test.js +23 -3
- package/dist/src/ui/components/MainContent.test.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.js +32 -37
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.test.js +30 -27
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.js +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.test.js +41 -0
- package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SessionBrowser.js +7 -0
- package/dist/src/ui/components/SessionBrowser.js.map +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.js +9 -4
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.test.js +12 -23
- package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.js +37 -17
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +83 -1
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.js +2 -2
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.test.js +24 -0
- package/dist/src/ui/components/StatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.constants.d.ts +26 -0
- package/dist/src/ui/components/ThemeDialog.constants.js +27 -0
- package/dist/src/ui/components/ThemeDialog.constants.js.map +1 -0
- package/dist/src/ui/components/ThemeDialog.js +5 -15
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/ToolConfirmationQueue.test.js +1 -1
- package/dist/src/ui/components/ToolConfirmationQueue.test.js.map +1 -1
- package/dist/src/ui/components/VoiceModelDialog.js +7 -2
- package/dist/src/ui/components/VoiceModelDialog.js.map +1 -1
- package/dist/src/ui/components/VoiceModelDialog.test.d.ts +6 -0
- package/dist/src/ui/components/VoiceModelDialog.test.js +68 -0
- package/dist/src/ui/components/VoiceModelDialog.test.js.map +1 -0
- package/dist/src/ui/components/messages/ExportSessionMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/ExportSessionMessage.js +15 -0
- package/dist/src/ui/components/messages/ExportSessionMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ExportSessionMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ExportSessionMessage.test.js +31 -0
- package/dist/src/ui/components/messages/ExportSessionMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ShellToolMessage.js +6 -2
- package/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ShellToolMessage.test.js +33 -0
- package/dist/src/ui/components/messages/ShellToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/SubagentGroupDisplay.js +13 -13
- package/dist/src/ui/components/messages/SubagentGroupDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/SubagentGroupDisplay.test.js +5 -5
- package/dist/src/ui/components/messages/SubagentGroupDisplay.test.js.map +1 -1
- package/dist/src/ui/components/messages/SubagentHistoryMessage.test.js +4 -3
- package/dist/src/ui/components/messages/SubagentHistoryMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/SubagentProgressDisplay.d.ts +1 -1
- package/dist/src/ui/components/messages/SubagentProgressDisplay.js +7 -6
- package/dist/src/ui/components/messages/SubagentProgressDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/SubagentProgressDisplay.test.js +10 -9
- package/dist/src/ui/components/messages/SubagentProgressDisplay.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +3 -9
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +60 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupDisplay.d.ts +13 -0
- package/dist/src/ui/components/messages/ToolGroupDisplay.js +78 -0
- package/dist/src/ui/components/messages/ToolGroupDisplay.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolGroupDisplay.test.js +210 -0
- package/dist/src/ui/components/messages/ToolGroupDisplay.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.js +4 -2
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +28 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessageRegression.test.js +3 -3
- package/dist/src/ui/components/messages/ToolGroupMessageRegression.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.js +6 -2
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolShared.d.ts +1 -0
- package/dist/src/ui/components/messages/ToolShared.js +5 -3
- package/dist/src/ui/components/messages/ToolShared.js.map +1 -1
- package/dist/src/ui/components/messages/ToolShared.test.js +18 -1
- package/dist/src/ui/components/messages/ToolShared.test.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSettingsDialog.d.ts +6 -1
- package/dist/src/ui/components/shared/BaseSettingsDialog.js +8 -8
- package/dist/src/ui/components/shared/BaseSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/shared/performance.test.js +9 -0
- package/dist/src/ui/components/shared/performance.test.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.js +22 -5
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.test.js +211 -0
- package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -1
- package/dist/src/ui/constants/tips.js +0 -1
- package/dist/src/ui/constants/tips.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +1 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +2 -0
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +78 -69
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +128 -18
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +13 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +85 -0
- package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/useAgentStream.d.ts +2 -2
- package/dist/src/ui/hooks/useAgentStream.js +63 -30
- package/dist/src/ui/hooks/useAgentStream.js.map +1 -1
- package/dist/src/ui/hooks/useAgentStream.test.js +1 -1
- package/dist/src/ui/hooks/useAgentStream.test.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.js +0 -2
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +2 -2
- package/dist/src/ui/hooks/useGeminiStream.js +48 -29
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +44 -82
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +29 -16
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.js +102 -51
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
- package/dist/src/ui/hooks/useIncludeDirsTrust.js +2 -2
- package/dist/src/ui/hooks/useIncludeDirsTrust.js.map +1 -1
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +2 -0
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.d.ts +2 -1
- package/dist/src/ui/hooks/useMessageQueue.js +3 -1
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.test.js +38 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.d.ts +3 -3
- package/dist/src/ui/hooks/useSessionBrowser.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.test.js +44 -38
- package/dist/src/ui/hooks/useSessionBrowser.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionResume.d.ts +3 -3
- package/dist/src/ui/hooks/useSessionResume.js.map +1 -1
- package/dist/src/ui/hooks/useSessionResume.test.js +6 -4
- package/dist/src/ui/hooks/useSessionResume.test.js.map +1 -1
- package/dist/src/ui/hooks/useSuspend.d.ts +1 -3
- package/dist/src/ui/hooks/useSuspend.js +3 -17
- package/dist/src/ui/hooks/useSuspend.js.map +1 -1
- package/dist/src/ui/hooks/useSuspend.test.js +0 -14
- package/dist/src/ui/hooks/useSuspend.test.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +6 -6
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/useVoiceMode.js +25 -19
- package/dist/src/ui/hooks/useVoiceMode.js.map +1 -1
- package/dist/src/ui/hooks/vim-passthrough.test.js +10 -0
- package/dist/src/ui/hooks/vim-passthrough.test.js.map +1 -1
- package/dist/src/ui/hooks/vim.js +8 -0
- package/dist/src/ui/hooks/vim.js.map +1 -1
- package/dist/src/ui/hooks/vim.test.js +61 -0
- package/dist/src/ui/hooks/vim.test.js.map +1 -1
- package/dist/src/ui/key/keyBindings.d.ts +2 -0
- package/dist/src/ui/key/keyBindings.js +26 -9
- package/dist/src/ui/key/keyBindings.js.map +1 -1
- package/dist/src/ui/key/keyBindings.test.js +24 -0
- package/dist/src/ui/key/keyBindings.test.js.map +1 -1
- package/dist/src/ui/key/keyMatchers.test.js +26 -5
- package/dist/src/ui/key/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.js +0 -2
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/types.d.ts +23 -2
- package/dist/src/ui/types.js +3 -2
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.js +6 -6
- package/dist/src/ui/utils/TableRenderer.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.test.js +10 -0
- package/dist/src/ui/utils/TableRenderer.test.js.map +1 -1
- package/dist/src/ui/utils/directoryUtils.test.js +0 -5
- package/dist/src/ui/utils/directoryUtils.test.js.map +1 -1
- package/dist/src/ui/utils/editorUtils.d.ts +2 -1
- package/dist/src/ui/utils/editorUtils.js +75 -28
- package/dist/src/ui/utils/editorUtils.js.map +1 -1
- package/dist/src/ui/utils/latexToUnicode.d.ts +21 -0
- package/dist/src/ui/utils/latexToUnicode.js +538 -0
- package/dist/src/ui/utils/latexToUnicode.js.map +1 -0
- package/dist/src/ui/utils/latexToUnicode.test.d.ts +6 -0
- package/dist/src/ui/utils/latexToUnicode.test.js +222 -0
- package/dist/src/ui/utils/latexToUnicode.test.js.map +1 -0
- package/dist/src/ui/utils/markdownParsingUtils.d.ts +1 -5
- package/dist/src/ui/utils/markdownParsingUtils.js +36 -1
- package/dist/src/ui/utils/markdownParsingUtils.js.map +1 -1
- package/dist/src/ui/utils/markdownParsingUtils.test.js +35 -0
- package/dist/src/ui/utils/markdownParsingUtils.test.js.map +1 -1
- package/dist/src/ui/utils/memorySnapshot.d.ts +19 -0
- package/dist/src/ui/utils/memorySnapshot.js +28 -0
- package/dist/src/ui/utils/memorySnapshot.js.map +1 -0
- package/dist/src/ui/utils/memorySnapshot.test.d.ts +6 -0
- package/dist/src/ui/utils/memorySnapshot.test.js +62 -0
- package/dist/src/ui/utils/memorySnapshot.test.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.js +11 -2
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.test.js +73 -0
- package/dist/src/ui/utils/updateCheck.test.js.map +1 -1
- package/dist/src/utils/commands.d.ts +1 -1
- package/dist/src/utils/commands.js +1 -1
- package/dist/src/utils/commands.test.js +14 -14
- package/dist/src/utils/commands.test.js.map +1 -1
- package/dist/src/utils/envVarResolver.js +10 -7
- package/dist/src/utils/envVarResolver.js.map +1 -1
- package/dist/src/utils/gitUtils.js +1 -2
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.d.ts +1 -1
- package/dist/src/utils/handleAutoUpdate.js +15 -3
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.test.js +45 -16
- package/dist/src/utils/handleAutoUpdate.test.js.map +1 -1
- package/dist/src/utils/installationInfo.d.ts +1 -0
- package/dist/src/utils/installationInfo.js +16 -1
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/installationInfo.test.js +16 -0
- package/dist/src/utils/installationInfo.test.js.map +1 -1
- package/dist/src/utils/jsonoutput.js +0 -2
- package/dist/src/utils/jsonoutput.js.map +1 -1
- package/dist/src/utils/processUtils.d.ts +28 -0
- package/dist/src/utils/processUtils.js +71 -0
- package/dist/src/utils/processUtils.js.map +1 -1
- package/dist/src/utils/processUtils.test.js +122 -1
- package/dist/src/utils/processUtils.test.js.map +1 -1
- package/dist/src/utils/readStdin.js +22 -4
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/readStdin.test.js +32 -0
- package/dist/src/utils/readStdin.test.js.map +1 -1
- package/dist/src/utils/relaunch.js +6 -13
- package/dist/src/utils/relaunch.js.map +1 -1
- package/dist/src/utils/relaunch.test.js +82 -86
- package/dist/src/utils/relaunch.test.js.map +1 -1
- package/dist/src/utils/sandbox.js +34 -24
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/sandbox.test.js +108 -9
- package/dist/src/utils/sandbox.test.js.map +1 -1
- package/dist/src/utils/sandboxUtils.js +12 -7
- package/dist/src/utils/sandboxUtils.js.map +1 -1
- package/dist/src/utils/sandboxUtils.test.js +68 -0
- package/dist/src/utils/sandboxUtils.test.js.map +1 -1
- package/dist/src/utils/sessionCleanup.js +49 -14
- package/dist/src/utils/sessionCleanup.js.map +1 -1
- package/dist/src/utils/sessionCleanup.test.js +63 -0
- package/dist/src/utils/sessionCleanup.test.js.map +1 -1
- package/dist/src/utils/sessionUtils.js +22 -7
- package/dist/src/utils/sessionUtils.js.map +1 -1
- package/dist/src/utils/sessionUtils.test.js +99 -0
- package/dist/src/utils/sessionUtils.test.js.map +1 -1
- package/dist/src/utils/sessions.js +2 -4
- package/dist/src/utils/sessions.js.map +1 -1
- package/dist/src/utils/sessions.test.js +9 -12
- package/dist/src/utils/sessions.test.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.js +4 -3
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.test.js +40 -3
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.js +1 -1
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/src/acp/acpClient.d.ts +0 -56
- package/dist/src/acp/acpClient.js.map +0 -1
- package/dist/src/acp/acpClient.test.js +0 -1816
- package/dist/src/acp/acpClient.test.js.map +0 -1
- package/dist/src/acp/commandHandler.js.map +0 -1
- package/dist/src/acp/commandHandler.test.js.map +0 -1
- package/dist/src/acp/fileSystemService.js.map +0 -1
- package/dist/src/acp/fileSystemService.test.js.map +0 -1
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.d.ts +0 -12
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.js.map +0 -1
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js.map +0 -1
- package/dist/src/ui/components/SkillInboxDialog.js +0 -420
- package/dist/src/ui/components/SkillInboxDialog.js.map +0 -1
- package/dist/src/ui/components/SkillInboxDialog.test.js +0 -467
- package/dist/src/ui/components/SkillInboxDialog.test.js.map +0 -1
- /package/dist/src/acp/{commandHandler.test.d.ts → acpCommandHandler.test.d.ts} +0 -0
- /package/dist/src/{ui/components/SkillInboxDialog.test.d.ts → acp/acpFileSystemService.test.d.ts} +0 -0
- /package/dist/src/{acp/acpClient.test.d.ts → config/mutual-exclusivity.test.d.ts} +0 -0
- /package/dist/src/{acp/fileSystemService.test.d.ts → ui/commands/bugMemoryCommand.test.d.ts} +0 -0
- /package/dist/src/ui/{auth/LoginWithGoogleRestartDialog.test.d.ts → commands/exportSessionCommand.test.d.ts} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { ToolErrorType, GeminiEventType, OutputFormat, uiTelemetryService, FatalInputError, CoreEvent, CoreToolCallStatus, } from '@google/gemini-cli-core';
|
|
6
|
+
import { ToolErrorType, GeminiEventType, OutputFormat, uiTelemetryService, FatalInputError, CoreEvent, CoreToolCallStatus, JsonStreamEventType, } from '@google/gemini-cli-core';
|
|
7
7
|
import { runNonInteractive } from './nonInteractiveCli.js';
|
|
8
8
|
import { describe, it, expect, beforeEach, afterEach, vi, } from 'vitest';
|
|
9
9
|
// Mock core modules
|
|
@@ -193,7 +193,7 @@ describe('runNonInteractive', () => {
|
|
|
193
193
|
input: 'Test input',
|
|
194
194
|
prompt_id: 'prompt-id-1',
|
|
195
195
|
});
|
|
196
|
-
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Test input' }], expect.any(AbortSignal), 'prompt-id-1', undefined,
|
|
196
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Test input' }], expect.any(AbortSignal), 'prompt-id-1', undefined, 'Test input');
|
|
197
197
|
expect(getWrittenOutput()).toBe('Hello World\n');
|
|
198
198
|
// Note: Telemetry shutdown is now handled in runExitCleanup() in cleanup.ts
|
|
199
199
|
// so we no longer expect shutdownTelemetry to be called directly here
|
|
@@ -286,7 +286,7 @@ describe('runNonInteractive', () => {
|
|
|
286
286
|
});
|
|
287
287
|
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(2);
|
|
288
288
|
expect(mockSchedulerSchedule).toHaveBeenCalledWith([expect.objectContaining({ name: 'testTool' })], expect.any(AbortSignal));
|
|
289
|
-
expect(mockGeminiClient.sendMessageStream).toHaveBeenNthCalledWith(2, [{ text: 'Tool response' }], expect.any(AbortSignal), 'prompt-id-2', undefined,
|
|
289
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenNthCalledWith(2, [{ text: 'Tool response' }], expect.any(AbortSignal), 'prompt-id-2', undefined, undefined);
|
|
290
290
|
expect(getWrittenOutput()).toBe('Final answer\n');
|
|
291
291
|
});
|
|
292
292
|
it('should write a single newline between sequential text outputs from the model', async () => {
|
|
@@ -425,7 +425,7 @@ describe('runNonInteractive', () => {
|
|
|
425
425
|
},
|
|
426
426
|
},
|
|
427
427
|
},
|
|
428
|
-
], expect.any(AbortSignal), 'prompt-id-3', undefined,
|
|
428
|
+
], expect.any(AbortSignal), 'prompt-id-3', undefined, undefined);
|
|
429
429
|
expect(getWrittenOutput()).toBe('Sorry, let me try again.\n');
|
|
430
430
|
});
|
|
431
431
|
it('should exit with error if sendMessageStream throws initially', async () => {
|
|
@@ -537,7 +537,7 @@ describe('runNonInteractive', () => {
|
|
|
537
537
|
prompt_id: 'prompt-id-7',
|
|
538
538
|
});
|
|
539
539
|
// 5. Assert that sendMessageStream was called with the PROCESSED parts, not the raw input
|
|
540
|
-
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith(processedParts, expect.any(AbortSignal), 'prompt-id-7', undefined,
|
|
540
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith(processedParts, expect.any(AbortSignal), 'prompt-id-7', undefined, rawInput);
|
|
541
541
|
// 6. Assert the final output is correct
|
|
542
542
|
expect(getWrittenOutput()).toBe('Summary complete.\n');
|
|
543
543
|
});
|
|
@@ -551,14 +551,14 @@ describe('runNonInteractive', () => {
|
|
|
551
551
|
];
|
|
552
552
|
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
|
|
553
553
|
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
|
|
554
|
-
vi.
|
|
554
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
555
555
|
await runNonInteractive({
|
|
556
556
|
config: mockConfig,
|
|
557
557
|
settings: mockSettings,
|
|
558
558
|
input: 'Test input',
|
|
559
559
|
prompt_id: 'prompt-id-1',
|
|
560
560
|
});
|
|
561
|
-
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Test input' }], expect.any(AbortSignal), 'prompt-id-1', undefined,
|
|
561
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Test input' }], expect.any(AbortSignal), 'prompt-id-1', undefined, 'Test input');
|
|
562
562
|
expect(processStdoutSpy).toHaveBeenCalledWith(JSON.stringify({
|
|
563
563
|
session_id: 'test-session-id',
|
|
564
564
|
response: 'Hello World',
|
|
@@ -619,7 +619,7 @@ describe('runNonInteractive', () => {
|
|
|
619
619
|
.mockReturnValueOnce(createStreamFromEvents(firstCallEvents))
|
|
620
620
|
.mockReturnValueOnce(createStreamFromEvents(secondCallEvents));
|
|
621
621
|
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
|
|
622
|
-
vi.
|
|
622
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
623
623
|
await runNonInteractive({
|
|
624
624
|
config: mockConfig,
|
|
625
625
|
settings: mockSettings,
|
|
@@ -645,14 +645,14 @@ describe('runNonInteractive', () => {
|
|
|
645
645
|
];
|
|
646
646
|
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
|
|
647
647
|
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
|
|
648
|
-
vi.
|
|
648
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
649
649
|
await runNonInteractive({
|
|
650
650
|
config: mockConfig,
|
|
651
651
|
settings: mockSettings,
|
|
652
652
|
input: 'Empty response test',
|
|
653
653
|
prompt_id: 'prompt-id-empty',
|
|
654
654
|
});
|
|
655
|
-
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Empty response test' }], expect.any(AbortSignal), 'prompt-id-empty', undefined,
|
|
655
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Empty response test' }], expect.any(AbortSignal), 'prompt-id-empty', undefined, 'Empty response test');
|
|
656
656
|
// This should output JSON with empty response but include stats
|
|
657
657
|
expect(processStdoutSpy).toHaveBeenCalledWith(JSON.stringify({
|
|
658
658
|
session_id: 'test-session-id',
|
|
@@ -747,7 +747,7 @@ describe('runNonInteractive', () => {
|
|
|
747
747
|
prompt_id: 'prompt-id-slash',
|
|
748
748
|
});
|
|
749
749
|
// Ensure the prompt sent to the model is from the command, not the raw input
|
|
750
|
-
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Prompt from command' }], expect.any(AbortSignal), 'prompt-id-slash', undefined,
|
|
750
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Prompt from command' }], expect.any(AbortSignal), 'prompt-id-slash', undefined, '/testcommand');
|
|
751
751
|
expect(getWrittenOutput()).toBe('Response from command\n');
|
|
752
752
|
});
|
|
753
753
|
it('should handle slash commands', async () => {
|
|
@@ -769,7 +769,7 @@ describe('runNonInteractive', () => {
|
|
|
769
769
|
prompt_id: 'prompt-id-slash',
|
|
770
770
|
});
|
|
771
771
|
expect(handleSlashCommandSpy).toHaveBeenCalledWith('/help', expect.any(AbortController), mockConfig, mockSettings);
|
|
772
|
-
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Slash command output' }], expect.any(AbortSignal), 'prompt-id-slash', undefined,
|
|
772
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: 'Slash command output' }], expect.any(AbortSignal), 'prompt-id-slash', undefined, '/help');
|
|
773
773
|
expect(getWrittenOutput()).toBe('Response to slash command\n');
|
|
774
774
|
handleSlashCommandSpy.mockRestore();
|
|
775
775
|
});
|
|
@@ -901,7 +901,7 @@ describe('runNonInteractive', () => {
|
|
|
901
901
|
prompt_id: 'prompt-id-unknown',
|
|
902
902
|
});
|
|
903
903
|
// Ensure the raw input is sent to the model
|
|
904
|
-
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: '/unknowncommand' }], expect.any(AbortSignal), 'prompt-id-unknown', undefined,
|
|
904
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledWith([{ text: '/unknowncommand' }], expect.any(AbortSignal), 'prompt-id-unknown', undefined, '/unknowncommand');
|
|
905
905
|
expect(getWrittenOutput()).toBe('Response to unknown\n');
|
|
906
906
|
});
|
|
907
907
|
it('should throw for unhandled command result types', async () => {
|
|
@@ -1138,7 +1138,7 @@ describe('runNonInteractive', () => {
|
|
|
1138
1138
|
});
|
|
1139
1139
|
it('should emit appropriate events for streaming JSON output', async () => {
|
|
1140
1140
|
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
|
|
1141
|
-
vi.
|
|
1141
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1142
1142
|
const toolCallEvent = {
|
|
1143
1143
|
type: GeminiEventType.ToolCallRequest,
|
|
1144
1144
|
value: {
|
|
@@ -1265,7 +1265,7 @@ describe('runNonInteractive', () => {
|
|
|
1265
1265
|
},
|
|
1266
1266
|
])('should emit appropriate error event in streaming JSON mode: $name', async ({ events, input, promptId }) => {
|
|
1267
1267
|
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
|
|
1268
|
-
vi.
|
|
1268
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1269
1269
|
const streamEvents = [
|
|
1270
1270
|
...events,
|
|
1271
1271
|
{
|
|
@@ -1291,6 +1291,42 @@ describe('runNonInteractive', () => {
|
|
|
1291
1291
|
.replace(/"duration_ms":\d+/g, '"duration_ms":<DURATION>');
|
|
1292
1292
|
expect(sanitizedOutput).toMatchSnapshot();
|
|
1293
1293
|
});
|
|
1294
|
+
it.each([
|
|
1295
|
+
{
|
|
1296
|
+
name: 'loop detected',
|
|
1297
|
+
events: [
|
|
1298
|
+
{ type: GeminiEventType.LoopDetected },
|
|
1299
|
+
],
|
|
1300
|
+
expectedWarning: 'Loop detected, stopping execution',
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
name: 'max session turns',
|
|
1304
|
+
events: [
|
|
1305
|
+
{ type: GeminiEventType.MaxSessionTurns },
|
|
1306
|
+
],
|
|
1307
|
+
expectedWarning: 'Maximum session turns exceeded',
|
|
1308
|
+
},
|
|
1309
|
+
])('should include warning in JSON mode for: $name', async ({ events, expectedWarning }) => {
|
|
1310
|
+
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
|
|
1311
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1312
|
+
const streamEvents = [
|
|
1313
|
+
...events,
|
|
1314
|
+
{
|
|
1315
|
+
type: GeminiEventType.Finished,
|
|
1316
|
+
value: { reason: undefined, usageMetadata: { totalTokenCount: 0 } },
|
|
1317
|
+
},
|
|
1318
|
+
];
|
|
1319
|
+
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(streamEvents));
|
|
1320
|
+
await runNonInteractive({
|
|
1321
|
+
config: mockConfig,
|
|
1322
|
+
settings: mockSettings,
|
|
1323
|
+
input: 'test',
|
|
1324
|
+
prompt_id: 'test',
|
|
1325
|
+
});
|
|
1326
|
+
const output = JSON.parse(getWrittenOutput());
|
|
1327
|
+
expect(output.warnings).toBeDefined();
|
|
1328
|
+
expect(output.warnings).toContain(expectedWarning);
|
|
1329
|
+
});
|
|
1294
1330
|
it('should log error when tool recording fails', async () => {
|
|
1295
1331
|
const toolCallEvent = {
|
|
1296
1332
|
type: GeminiEventType.ToolCallRequest,
|
|
@@ -1410,7 +1446,7 @@ describe('runNonInteractive', () => {
|
|
|
1410
1446
|
});
|
|
1411
1447
|
it('should write JSON output when a tool call returns STOP_EXECUTION error', async () => {
|
|
1412
1448
|
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
|
|
1413
|
-
vi.
|
|
1449
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1414
1450
|
const toolCallEvent = {
|
|
1415
1451
|
type: GeminiEventType.ToolCallRequest,
|
|
1416
1452
|
value: {
|
|
@@ -1455,7 +1491,7 @@ describe('runNonInteractive', () => {
|
|
|
1455
1491
|
});
|
|
1456
1492
|
it('should emit result event when a tool call returns STOP_EXECUTION error in streaming JSON mode', async () => {
|
|
1457
1493
|
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
|
|
1458
|
-
vi.
|
|
1494
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1459
1495
|
const toolCallEvent = {
|
|
1460
1496
|
type: GeminiEventType.ToolCallRequest,
|
|
1461
1497
|
value: {
|
|
@@ -1512,6 +1548,51 @@ describe('runNonInteractive', () => {
|
|
|
1512
1548
|
// Should exit without calling sendMessageStream again
|
|
1513
1549
|
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
|
|
1514
1550
|
});
|
|
1551
|
+
it('should write JSON output when AgentExecutionStopped event occurs', async () => {
|
|
1552
|
+
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
|
|
1553
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1554
|
+
const events = [
|
|
1555
|
+
{ type: GeminiEventType.Content, value: 'Partial content' },
|
|
1556
|
+
{
|
|
1557
|
+
type: GeminiEventType.AgentExecutionStopped,
|
|
1558
|
+
value: { reason: 'Stopped by hook' },
|
|
1559
|
+
},
|
|
1560
|
+
];
|
|
1561
|
+
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
|
|
1562
|
+
await runNonInteractive({
|
|
1563
|
+
config: mockConfig,
|
|
1564
|
+
settings: mockSettings,
|
|
1565
|
+
input: 'test stop',
|
|
1566
|
+
prompt_id: 'prompt-id-stop-json',
|
|
1567
|
+
});
|
|
1568
|
+
expect(processStdoutSpy).toHaveBeenCalledWith(JSON.stringify({
|
|
1569
|
+
session_id: 'test-session-id',
|
|
1570
|
+
response: 'Partial content',
|
|
1571
|
+
stats: MOCK_SESSION_METRICS,
|
|
1572
|
+
warnings: ['Agent execution stopped: Stopped by hook'],
|
|
1573
|
+
}, null, 2));
|
|
1574
|
+
});
|
|
1575
|
+
it('should emit result event when AgentExecutionStopped event occurs in streaming JSON mode', async () => {
|
|
1576
|
+
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
|
|
1577
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1578
|
+
const events = [
|
|
1579
|
+
{ type: GeminiEventType.Content, value: 'Partial content' },
|
|
1580
|
+
{
|
|
1581
|
+
type: GeminiEventType.AgentExecutionStopped,
|
|
1582
|
+
value: { reason: 'Stopped by hook' },
|
|
1583
|
+
},
|
|
1584
|
+
];
|
|
1585
|
+
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
|
|
1586
|
+
await runNonInteractive({
|
|
1587
|
+
config: mockConfig,
|
|
1588
|
+
settings: mockSettings,
|
|
1589
|
+
input: 'test stop',
|
|
1590
|
+
prompt_id: 'prompt-id-stop-stream',
|
|
1591
|
+
});
|
|
1592
|
+
const output = getWrittenOutput();
|
|
1593
|
+
expect(output).toContain('"type":"result"');
|
|
1594
|
+
expect(output).toContain('"status":"success"');
|
|
1595
|
+
});
|
|
1515
1596
|
it('should handle AgentExecutionBlocked event', async () => {
|
|
1516
1597
|
const allEvents = [
|
|
1517
1598
|
{
|
|
@@ -1536,6 +1617,160 @@ describe('runNonInteractive', () => {
|
|
|
1536
1617
|
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
|
|
1537
1618
|
expect(getWrittenOutput()).toBe('Final answer\n');
|
|
1538
1619
|
});
|
|
1620
|
+
it('should emit ERROR event in STREAM_JSON mode when AgentExecutionBlocked occurs', async () => {
|
|
1621
|
+
const allEvents = [
|
|
1622
|
+
{
|
|
1623
|
+
type: GeminiEventType.AgentExecutionBlocked,
|
|
1624
|
+
value: { reason: 'Blocked by hook' },
|
|
1625
|
+
},
|
|
1626
|
+
{ type: GeminiEventType.Content, value: 'Final answer' },
|
|
1627
|
+
{
|
|
1628
|
+
type: GeminiEventType.Finished,
|
|
1629
|
+
value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
|
|
1630
|
+
},
|
|
1631
|
+
];
|
|
1632
|
+
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(allEvents));
|
|
1633
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1634
|
+
// Setup stream-json format
|
|
1635
|
+
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
|
|
1636
|
+
await runNonInteractive({
|
|
1637
|
+
config: mockConfig,
|
|
1638
|
+
settings: mockSettings,
|
|
1639
|
+
input: 'test block',
|
|
1640
|
+
prompt_id: 'prompt-id-block',
|
|
1641
|
+
});
|
|
1642
|
+
const calls = processStdoutSpy.mock.calls.map((call) => JSON.parse(call[0]));
|
|
1643
|
+
const errorEvent = calls.find((c) => c.type === JsonStreamEventType.ERROR);
|
|
1644
|
+
expect(errorEvent).toBeDefined();
|
|
1645
|
+
expect(errorEvent.message).toContain('Agent execution blocked: Blocked by hook');
|
|
1646
|
+
expect(errorEvent.severity).toBe('warning');
|
|
1647
|
+
});
|
|
1648
|
+
it('should include warning in JSON mode when AgentExecutionBlocked occurs', async () => {
|
|
1649
|
+
const allEvents = [
|
|
1650
|
+
{
|
|
1651
|
+
type: GeminiEventType.AgentExecutionBlocked,
|
|
1652
|
+
value: { reason: 'Blocked by hook' },
|
|
1653
|
+
},
|
|
1654
|
+
{ type: GeminiEventType.Content, value: 'Final answer' },
|
|
1655
|
+
{
|
|
1656
|
+
type: GeminiEventType.Finished,
|
|
1657
|
+
value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
|
|
1658
|
+
},
|
|
1659
|
+
];
|
|
1660
|
+
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(allEvents));
|
|
1661
|
+
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
|
|
1662
|
+
await runNonInteractive({
|
|
1663
|
+
config: mockConfig,
|
|
1664
|
+
settings: mockSettings,
|
|
1665
|
+
input: 'test block',
|
|
1666
|
+
prompt_id: 'prompt-id-block',
|
|
1667
|
+
});
|
|
1668
|
+
const output = JSON.parse(getWrittenOutput());
|
|
1669
|
+
expect(output.warnings).toBeDefined();
|
|
1670
|
+
expect(output.warnings).toContain('Agent execution blocked: Blocked by hook');
|
|
1671
|
+
});
|
|
1672
|
+
it('should handle multiple AgentExecutionBlocked events and collect all warnings', async () => {
|
|
1673
|
+
const allEvents = [
|
|
1674
|
+
{
|
|
1675
|
+
type: GeminiEventType.AgentExecutionBlocked,
|
|
1676
|
+
value: { reason: 'Block 1', systemMessage: 'Reason 1' },
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
type: GeminiEventType.AgentExecutionBlocked,
|
|
1680
|
+
value: { reason: 'Block 2', systemMessage: 'Reason 2' },
|
|
1681
|
+
},
|
|
1682
|
+
{ type: GeminiEventType.Content, value: 'Final answer' },
|
|
1683
|
+
{
|
|
1684
|
+
type: GeminiEventType.Finished,
|
|
1685
|
+
value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
|
|
1686
|
+
},
|
|
1687
|
+
];
|
|
1688
|
+
mockGeminiClient.sendMessageStream.mockImplementation(() => createStreamFromEvents(allEvents));
|
|
1689
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1690
|
+
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
|
|
1691
|
+
await runNonInteractive({
|
|
1692
|
+
config: mockConfig,
|
|
1693
|
+
settings: mockSettings,
|
|
1694
|
+
input: 'test',
|
|
1695
|
+
prompt_id: 'test',
|
|
1696
|
+
});
|
|
1697
|
+
const output = JSON.parse(getWrittenOutput());
|
|
1698
|
+
expect(output.warnings).toHaveLength(2);
|
|
1699
|
+
expect(output.warnings).toContain('Agent execution blocked: Reason 1');
|
|
1700
|
+
expect(output.warnings).toContain('Agent execution blocked: Reason 2');
|
|
1701
|
+
});
|
|
1702
|
+
it('should not include warnings field in JSON output if no blocks occur', async () => {
|
|
1703
|
+
const allEvents = [
|
|
1704
|
+
{ type: GeminiEventType.Content, value: 'Clean answer' },
|
|
1705
|
+
{
|
|
1706
|
+
type: GeminiEventType.Finished,
|
|
1707
|
+
value: { reason: undefined, usageMetadata: { totalTokenCount: 10 } },
|
|
1708
|
+
},
|
|
1709
|
+
];
|
|
1710
|
+
mockGeminiClient.sendMessageStream.mockImplementation(() => createStreamFromEvents(allEvents));
|
|
1711
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1712
|
+
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.JSON);
|
|
1713
|
+
await runNonInteractive({
|
|
1714
|
+
config: mockConfig,
|
|
1715
|
+
settings: mockSettings,
|
|
1716
|
+
input: 'test',
|
|
1717
|
+
prompt_id: 'test',
|
|
1718
|
+
});
|
|
1719
|
+
const output = JSON.parse(getWrittenOutput());
|
|
1720
|
+
expect(output.warnings).toBeUndefined();
|
|
1721
|
+
});
|
|
1722
|
+
it('should handle InvalidStream event gracefully in TEXT mode', async () => {
|
|
1723
|
+
const events = [
|
|
1724
|
+
{ type: GeminiEventType.InvalidStream },
|
|
1725
|
+
];
|
|
1726
|
+
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
|
|
1727
|
+
await runNonInteractive({
|
|
1728
|
+
config: mockConfig,
|
|
1729
|
+
settings: mockSettings,
|
|
1730
|
+
input: 'test invalid stream',
|
|
1731
|
+
prompt_id: 'prompt-id-invalid',
|
|
1732
|
+
});
|
|
1733
|
+
expect(processStderrSpy).toHaveBeenCalledWith('[ERROR] Invalid stream: The model returned an empty response or malformed tool call.\n');
|
|
1734
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
|
|
1735
|
+
});
|
|
1736
|
+
it('should handle InvalidStream event gracefully in STREAM_JSON mode', async () => {
|
|
1737
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1738
|
+
vi.spyOn(mockConfig, 'getOutputFormat').mockReturnValue(OutputFormat.STREAM_JSON);
|
|
1739
|
+
const events = [
|
|
1740
|
+
{ type: GeminiEventType.InvalidStream },
|
|
1741
|
+
];
|
|
1742
|
+
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
|
|
1743
|
+
await runNonInteractive({
|
|
1744
|
+
config: mockConfig,
|
|
1745
|
+
settings: mockSettings,
|
|
1746
|
+
input: 'test invalid stream',
|
|
1747
|
+
prompt_id: 'prompt-id-invalid',
|
|
1748
|
+
});
|
|
1749
|
+
const output = getWrittenOutput();
|
|
1750
|
+
expect(output).toContain('"type":"error"');
|
|
1751
|
+
expect(output).toContain('"severity":"error"');
|
|
1752
|
+
expect(output).toContain('Invalid stream: The model returned an empty response or malformed tool call.');
|
|
1753
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
|
|
1754
|
+
});
|
|
1755
|
+
it('should handle InvalidStream event gracefully in JSON mode', async () => {
|
|
1756
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1757
|
+
vi.spyOn(mockConfig, 'getOutputFormat').mockReturnValue(OutputFormat.JSON);
|
|
1758
|
+
const events = [
|
|
1759
|
+
{ type: GeminiEventType.InvalidStream },
|
|
1760
|
+
];
|
|
1761
|
+
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
|
|
1762
|
+
await runNonInteractive({
|
|
1763
|
+
config: mockConfig,
|
|
1764
|
+
settings: mockSettings,
|
|
1765
|
+
input: 'test invalid stream',
|
|
1766
|
+
prompt_id: 'prompt-id-invalid',
|
|
1767
|
+
});
|
|
1768
|
+
const output = getWrittenOutput();
|
|
1769
|
+
expect(output).toContain('"error": {');
|
|
1770
|
+
expect(output).toContain('"type": "INVALID_STREAM"');
|
|
1771
|
+
expect(output).toContain('Invalid stream: The model returned an empty response or malformed tool call.');
|
|
1772
|
+
expect(mockGeminiClient.sendMessageStream).toHaveBeenCalledTimes(1);
|
|
1773
|
+
});
|
|
1539
1774
|
});
|
|
1540
1775
|
describe('Output Sanitization', () => {
|
|
1541
1776
|
const ANSI_SEQUENCE = '\u001B[31mRed Text\u001B[0m';
|
|
@@ -1672,7 +1907,7 @@ describe('runNonInteractive', () => {
|
|
|
1672
1907
|
];
|
|
1673
1908
|
mockGeminiClient.sendMessageStream.mockReturnValue(createStreamFromEvents(events));
|
|
1674
1909
|
vi.mocked(mockConfig.getOutputFormat).mockReturnValue(OutputFormat.STREAM_JSON);
|
|
1675
|
-
vi.
|
|
1910
|
+
vi.spyOn(uiTelemetryService, 'getMetrics').mockReturnValue(MOCK_SESSION_METRICS);
|
|
1676
1911
|
await runNonInteractive({
|
|
1677
1912
|
config: mockConfig,
|
|
1678
1913
|
settings: mockSettings,
|