@machina.ai/cell-cli 1.41.1-rc1 → 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 +5 -5
- 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 -774
- 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 +89 -17
- 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 +120 -31
- 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/marketplaceCommand.js +13 -1
- package/dist/src/ui/commands/marketplaceCommand.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 +40 -34
- 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 +83 -73
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +134 -42
- 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 +5 -5
- 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 -1814
- 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
|
@@ -0,0 +1,756 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import * as path from 'node:path';
|
|
8
|
+
import { Fragment, useState, useMemo, useCallback, useEffect } from 'react';
|
|
9
|
+
import { Box, Text } from 'ink';
|
|
10
|
+
import { theme } from '../semantic-colors.js';
|
|
11
|
+
import { useUIState } from '../contexts/UIStateContext.js';
|
|
12
|
+
import { useKeypress } from '../hooks/useKeypress.js';
|
|
13
|
+
import { Command } from '../key/keyMatchers.js';
|
|
14
|
+
import { useKeyMatchers } from '../hooks/useKeyMatchers.js';
|
|
15
|
+
import { BaseSelectionList } from './shared/BaseSelectionList.js';
|
|
16
|
+
import { DialogFooter } from './shared/DialogFooter.js';
|
|
17
|
+
import { DiffRenderer, parseDiffWithLineNumbers, renderDiffLines, } from './messages/DiffRenderer.js';
|
|
18
|
+
import { ScrollableList } from './shared/ScrollableList.js';
|
|
19
|
+
import { ShowMoreLines } from './ShowMoreLines.js';
|
|
20
|
+
import { useAlternateBuffer } from '../hooks/useAlternateBuffer.js';
|
|
21
|
+
import { OverflowProvider } from '../contexts/OverflowContext.js';
|
|
22
|
+
import { getErrorMessage, listInboxSkills, listInboxPatches, listInboxMemoryPatches, moveInboxSkill, dismissInboxSkill, applyInboxPatch, dismissInboxPatch, applyInboxMemoryPatch, dismissInboxMemoryPatch, isProjectSkillPatchTarget, } from '@google/gemini-cli-core';
|
|
23
|
+
const SKILL_DESTINATION_CHOICES = [
|
|
24
|
+
{
|
|
25
|
+
destination: 'global',
|
|
26
|
+
label: 'Global',
|
|
27
|
+
description: '~/.cell-cli/skills — available in all projects',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
destination: 'project',
|
|
31
|
+
label: 'Project',
|
|
32
|
+
description: '.cell-cli/skills — available in this workspace',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
const SKILL_PREVIEW_CHOICES = [
|
|
36
|
+
{
|
|
37
|
+
action: 'move',
|
|
38
|
+
label: 'Move',
|
|
39
|
+
description: 'Choose where to install this skill',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
action: 'dismiss',
|
|
43
|
+
label: 'Dismiss',
|
|
44
|
+
description: 'Delete from inbox',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
const PATCH_ACTION_CHOICES = [
|
|
48
|
+
{
|
|
49
|
+
action: 'apply',
|
|
50
|
+
label: 'Apply',
|
|
51
|
+
description: 'Apply patch and delete from inbox',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
action: 'dismiss',
|
|
55
|
+
label: 'Dismiss',
|
|
56
|
+
description: 'Delete from inbox without applying',
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
// Dismiss-first: memory patches modify durable on-disk state outside the
|
|
60
|
+
// project (private MEMORY.md and sibling files, plus ~/.cell-cli/GEMINI.md),
|
|
61
|
+
// so a stray Enter on a freshly-opened memory-patch preview must NOT apply.
|
|
62
|
+
// The lower-stakes skill-patch list (PATCH_ACTION_CHOICES) keeps Apply as
|
|
63
|
+
// the default.
|
|
64
|
+
const MEMORY_PATCH_ACTION_CHOICES = [
|
|
65
|
+
{
|
|
66
|
+
action: 'dismiss',
|
|
67
|
+
label: 'Dismiss',
|
|
68
|
+
description: 'Delete from inbox without applying',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
action: 'apply',
|
|
72
|
+
label: 'Apply',
|
|
73
|
+
description: 'Apply patch and delete from inbox',
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
function normalizePathForUi(filePath) {
|
|
77
|
+
return path.posix.normalize(filePath.replaceAll('\\', '/'));
|
|
78
|
+
}
|
|
79
|
+
function getPathBasename(filePath) {
|
|
80
|
+
const normalizedPath = normalizePathForUi(filePath);
|
|
81
|
+
const basename = path.posix.basename(normalizedPath);
|
|
82
|
+
return basename === '.' ? filePath : basename;
|
|
83
|
+
}
|
|
84
|
+
function formatMemoryPatchSummary(patch) {
|
|
85
|
+
const hunkCount = patch.entries.length;
|
|
86
|
+
const sourceCount = patch.sourceFiles.length;
|
|
87
|
+
const hunkLabel = hunkCount === 1 ? 'hunk' : 'hunks';
|
|
88
|
+
const sourceLabel = sourceCount === 1 ? 'patch' : 'patches';
|
|
89
|
+
return `${hunkCount} ${hunkLabel} from ${sourceCount} source ${sourceLabel}`;
|
|
90
|
+
}
|
|
91
|
+
async function patchTargetsProjectSkills(patch, config) {
|
|
92
|
+
const entryTargetsProjectSkills = await Promise.all(patch.entries.map((entry) => isProjectSkillPatchTarget(entry.targetPath, config)));
|
|
93
|
+
return entryTargetsProjectSkills.some(Boolean);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Derives a bracketed origin tag from a skill file path,
|
|
97
|
+
* matching the existing [Built-in] convention in SkillsList.
|
|
98
|
+
*/
|
|
99
|
+
function getSkillOriginTag(filePath) {
|
|
100
|
+
const normalizedPath = normalizePathForUi(filePath);
|
|
101
|
+
if (normalizedPath.includes('/bundle/')) {
|
|
102
|
+
return 'Built-in';
|
|
103
|
+
}
|
|
104
|
+
if (normalizedPath.includes('/extensions/')) {
|
|
105
|
+
return 'Extension';
|
|
106
|
+
}
|
|
107
|
+
if (normalizedPath.includes('/.cell-cli/skills/')) {
|
|
108
|
+
const homeDirs = [process.env['HOME'], process.env['USERPROFILE']]
|
|
109
|
+
.filter((homeDir) => Boolean(homeDir))
|
|
110
|
+
.map(normalizePathForUi);
|
|
111
|
+
if (homeDirs.some((homeDir) => normalizedPath.startsWith(`${homeDir}/.cell-cli/skills/`))) {
|
|
112
|
+
return 'Global';
|
|
113
|
+
}
|
|
114
|
+
return 'Workspace';
|
|
115
|
+
}
|
|
116
|
+
return '';
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Creates a unified diff string representing a new file.
|
|
120
|
+
*/
|
|
121
|
+
function newFileDiff(filename, content) {
|
|
122
|
+
const lines = content.split('\n');
|
|
123
|
+
const hunkLines = lines.map((l) => `+${l}`).join('\n');
|
|
124
|
+
return [
|
|
125
|
+
`--- /dev/null`,
|
|
126
|
+
`+++ ${filename}`,
|
|
127
|
+
`@@ -0,0 +1,${lines.length} @@`,
|
|
128
|
+
hunkLines,
|
|
129
|
+
].join('\n');
|
|
130
|
+
}
|
|
131
|
+
function formatDate(isoString) {
|
|
132
|
+
try {
|
|
133
|
+
const date = new Date(isoString);
|
|
134
|
+
return date.toLocaleDateString(undefined, {
|
|
135
|
+
year: 'numeric',
|
|
136
|
+
month: 'short',
|
|
137
|
+
day: 'numeric',
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return isoString;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* A fixed-height, scrollable diff viewer used by the skill, patch, and
|
|
146
|
+
* memory-patch preview phases. It flattens one or more DiffSections into
|
|
147
|
+
* individual line items so ScrollableList can virtualize and so
|
|
148
|
+
* PgUp/PgDn/Shift+arrows move the viewport over arbitrarily long diffs
|
|
149
|
+
* without overflowing the alternate buffer.
|
|
150
|
+
*
|
|
151
|
+
* The visual styling matches DiffRenderer's renderDiffLines path; we share
|
|
152
|
+
* that helper instead of nesting DiffRenderer (whose own MaxSizedBox
|
|
153
|
+
* wrapping would interfere with virtualization).
|
|
154
|
+
*/
|
|
155
|
+
const ScrollableDiffViewport = ({ sections, width, height, hasFocus }) => {
|
|
156
|
+
const items = useMemo(() => {
|
|
157
|
+
const result = [];
|
|
158
|
+
sections.forEach((section, sectionIndex) => {
|
|
159
|
+
// Header (with a blank spacer row above for separation between
|
|
160
|
+
// sections — skipped above the first section).
|
|
161
|
+
if (sectionIndex > 0) {
|
|
162
|
+
result.push({
|
|
163
|
+
key: `${section.key}:spacer`,
|
|
164
|
+
element: _jsx(Text, { children: " " }),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
result.push({
|
|
168
|
+
key: `${section.key}:header`,
|
|
169
|
+
element: (_jsx(Text, { color: theme.text.secondary, bold: true, children: section.header })),
|
|
170
|
+
});
|
|
171
|
+
const parsed = parseDiffWithLineNumbers(section.diffContent);
|
|
172
|
+
const rendered = renderDiffLines({
|
|
173
|
+
parsedLines: parsed,
|
|
174
|
+
filename: section.header,
|
|
175
|
+
terminalWidth: width,
|
|
176
|
+
});
|
|
177
|
+
rendered.forEach((node, index) => {
|
|
178
|
+
result.push({
|
|
179
|
+
key: `${section.key}:line:${index}`,
|
|
180
|
+
// renderDiffLines emits ReactNodes with their own keys; wrap each
|
|
181
|
+
// in a Fragment so ScrollableList sees a single ReactElement per
|
|
182
|
+
// row regardless of node shape.
|
|
183
|
+
element: _jsx(Fragment, { children: node }),
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
return result;
|
|
188
|
+
}, [sections, width]);
|
|
189
|
+
const renderItem = useCallback(({ item }) => item.element, []);
|
|
190
|
+
const keyExtractor = useCallback((item) => item.key, []);
|
|
191
|
+
// Most diff rows are exactly one line tall; long lines wrap so this is a
|
|
192
|
+
// lower bound. ScrollableList re-measures via ResizeObserver, so the
|
|
193
|
+
// estimate only matters for initial sizing.
|
|
194
|
+
const estimatedItemHeight = useCallback(() => 1, []);
|
|
195
|
+
return (_jsx(Box, { height: height, width: width, flexShrink: 0, flexDirection: "column", children: _jsx(ScrollableList, { data: items, renderItem: renderItem, keyExtractor: keyExtractor, estimatedItemHeight: estimatedItemHeight, hasFocus: hasFocus, initialScrollIndex: 0, scrollbar: true }) }));
|
|
196
|
+
};
|
|
197
|
+
export const InboxDialog = ({ config, onClose, onReloadSkills, onReloadMemory, }) => {
|
|
198
|
+
const keyMatchers = useKeyMatchers();
|
|
199
|
+
const { terminalWidth, terminalHeight, constrainHeight } = useUIState();
|
|
200
|
+
const isAlternateBuffer = useAlternateBuffer();
|
|
201
|
+
const isTrustedFolder = config.isTrustedFolder();
|
|
202
|
+
const [phase, setPhase] = useState('list');
|
|
203
|
+
const [items, setItems] = useState([]);
|
|
204
|
+
const [loading, setLoading] = useState(true);
|
|
205
|
+
const [selectedItem, setSelectedItem] = useState(null);
|
|
206
|
+
const [feedback, setFeedback] = useState(null);
|
|
207
|
+
// Tracks the most recent highlighted/selected position in the list so we
|
|
208
|
+
// can restore focus when the user backs out of a sub-phase (e.g. ESC from
|
|
209
|
+
// the apply dialog) instead of jumping back to the top of the list.
|
|
210
|
+
const [lastListIndex, setLastListIndex] = useState(0);
|
|
211
|
+
// Load inbox skills and patches on mount
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
let cancelled = false;
|
|
214
|
+
void (async () => {
|
|
215
|
+
try {
|
|
216
|
+
const [skills, patches, memoryPatches] = await Promise.all([
|
|
217
|
+
listInboxSkills(config),
|
|
218
|
+
listInboxPatches(config),
|
|
219
|
+
listInboxMemoryPatches(config),
|
|
220
|
+
]);
|
|
221
|
+
const patchItems = await Promise.all(patches.map(async (patch) => {
|
|
222
|
+
let targetsProjectSkills = false;
|
|
223
|
+
try {
|
|
224
|
+
targetsProjectSkills = await patchTargetsProjectSkills(patch, config);
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
targetsProjectSkills = false;
|
|
228
|
+
}
|
|
229
|
+
return {
|
|
230
|
+
type: 'patch',
|
|
231
|
+
patch,
|
|
232
|
+
targetsProjectSkills,
|
|
233
|
+
};
|
|
234
|
+
}));
|
|
235
|
+
if (!cancelled) {
|
|
236
|
+
const combined = [
|
|
237
|
+
...skills.map((skill) => ({ type: 'skill', skill })),
|
|
238
|
+
...patchItems,
|
|
239
|
+
...memoryPatches.map((memoryPatch) => ({
|
|
240
|
+
type: 'memory-patch',
|
|
241
|
+
memoryPatch,
|
|
242
|
+
})),
|
|
243
|
+
];
|
|
244
|
+
setItems(combined);
|
|
245
|
+
setLoading(false);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
if (!cancelled) {
|
|
250
|
+
setItems([]);
|
|
251
|
+
setLoading(false);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
})();
|
|
255
|
+
return () => {
|
|
256
|
+
cancelled = true;
|
|
257
|
+
};
|
|
258
|
+
}, [config]);
|
|
259
|
+
const getItemKey = useCallback((item) => item.type === 'skill'
|
|
260
|
+
? `skill:${item.skill.dirName}`
|
|
261
|
+
: item.type === 'patch'
|
|
262
|
+
? `patch:${item.patch.fileName}`
|
|
263
|
+
: item.type === 'memory-patch'
|
|
264
|
+
? `memory:${item.memoryPatch.kind}:${item.memoryPatch.relativePath}`
|
|
265
|
+
: `header:${item.label}`, []);
|
|
266
|
+
const listItems = useMemo(() => {
|
|
267
|
+
const skills = items.filter((i) => i.type === 'skill');
|
|
268
|
+
const patches = items.filter((i) => i.type === 'patch');
|
|
269
|
+
const memoryPatches = items.filter((i) => i.type === 'memory-patch');
|
|
270
|
+
const result = [];
|
|
271
|
+
const groups = [
|
|
272
|
+
{ label: 'New Skills', items: skills },
|
|
273
|
+
{ label: 'Skill Updates', items: patches },
|
|
274
|
+
{ label: 'Memory Updates', items: memoryPatches },
|
|
275
|
+
].filter((group) => group.items.length > 0);
|
|
276
|
+
const showHeaders = groups.length > 1;
|
|
277
|
+
for (const group of groups) {
|
|
278
|
+
if (showHeaders) {
|
|
279
|
+
const header = { type: 'header', label: group.label };
|
|
280
|
+
result.push({
|
|
281
|
+
key: `header:${group.label}`,
|
|
282
|
+
value: header,
|
|
283
|
+
disabled: true,
|
|
284
|
+
hideNumber: true,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
for (const item of group.items) {
|
|
288
|
+
result.push({ key: getItemKey(item), value: item });
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return result;
|
|
292
|
+
}, [items, getItemKey]);
|
|
293
|
+
const destinationItems = useMemo(() => SKILL_DESTINATION_CHOICES.map((choice) => {
|
|
294
|
+
if (choice.destination === 'project' && !isTrustedFolder) {
|
|
295
|
+
return {
|
|
296
|
+
key: choice.destination,
|
|
297
|
+
value: {
|
|
298
|
+
...choice,
|
|
299
|
+
description: '.cell-cli/skills — unavailable until this workspace is trusted',
|
|
300
|
+
},
|
|
301
|
+
disabled: true,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
return {
|
|
305
|
+
key: choice.destination,
|
|
306
|
+
value: choice,
|
|
307
|
+
};
|
|
308
|
+
}), [isTrustedFolder]);
|
|
309
|
+
const selectedPatchTargetsProjectSkills = useMemo(() => {
|
|
310
|
+
if (!selectedItem || selectedItem.type !== 'patch') {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
return selectedItem.targetsProjectSkills;
|
|
314
|
+
}, [selectedItem]);
|
|
315
|
+
const patchActionItems = useMemo(() => PATCH_ACTION_CHOICES.map((choice) => {
|
|
316
|
+
if (choice.action === 'apply' &&
|
|
317
|
+
selectedPatchTargetsProjectSkills &&
|
|
318
|
+
!isTrustedFolder) {
|
|
319
|
+
return {
|
|
320
|
+
key: choice.action,
|
|
321
|
+
value: {
|
|
322
|
+
...choice,
|
|
323
|
+
description: '.cell-cli/skills — unavailable until this workspace is trusted',
|
|
324
|
+
},
|
|
325
|
+
disabled: true,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
return {
|
|
329
|
+
key: choice.action,
|
|
330
|
+
value: choice,
|
|
331
|
+
};
|
|
332
|
+
}), [isTrustedFolder, selectedPatchTargetsProjectSkills]);
|
|
333
|
+
const skillPreviewItems = useMemo(() => SKILL_PREVIEW_CHOICES.map((choice) => ({
|
|
334
|
+
key: choice.action,
|
|
335
|
+
value: choice,
|
|
336
|
+
})), []);
|
|
337
|
+
const memoryPatchActionItems = useMemo(() => MEMORY_PATCH_ACTION_CHOICES.map((choice) => ({
|
|
338
|
+
key: choice.action,
|
|
339
|
+
value: choice,
|
|
340
|
+
})), []);
|
|
341
|
+
const handleSelectItem = useCallback((item) => {
|
|
342
|
+
setSelectedItem(item);
|
|
343
|
+
setFeedback(null);
|
|
344
|
+
// Remember which list row we navigated away from so ESC restores focus
|
|
345
|
+
// instead of jumping the cursor back to the top of the list.
|
|
346
|
+
const idx = listItems.findIndex((i) => i.value === item);
|
|
347
|
+
if (idx >= 0) {
|
|
348
|
+
setLastListIndex(idx);
|
|
349
|
+
}
|
|
350
|
+
setPhase(item.type === 'skill'
|
|
351
|
+
? 'skill-preview'
|
|
352
|
+
: item.type === 'patch'
|
|
353
|
+
? 'patch-preview'
|
|
354
|
+
: 'memory-preview');
|
|
355
|
+
}, [listItems]);
|
|
356
|
+
const removeItem = useCallback((item) => {
|
|
357
|
+
setItems((prev) => prev.filter((i) => getItemKey(i) !== getItemKey(item)));
|
|
358
|
+
}, [getItemKey]);
|
|
359
|
+
const handleSkillPreviewAction = useCallback((choice) => {
|
|
360
|
+
if (!selectedItem || selectedItem.type !== 'skill')
|
|
361
|
+
return;
|
|
362
|
+
if (choice.action === 'move') {
|
|
363
|
+
setFeedback(null);
|
|
364
|
+
setPhase('skill-action');
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
// Dismiss
|
|
368
|
+
setFeedback(null);
|
|
369
|
+
const skill = selectedItem.skill;
|
|
370
|
+
void (async () => {
|
|
371
|
+
try {
|
|
372
|
+
const result = await dismissInboxSkill(config, skill.dirName);
|
|
373
|
+
setFeedback({ text: result.message, isError: !result.success });
|
|
374
|
+
if (result.success) {
|
|
375
|
+
removeItem(selectedItem);
|
|
376
|
+
setSelectedItem(null);
|
|
377
|
+
setPhase('list');
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
catch (error) {
|
|
381
|
+
setFeedback({
|
|
382
|
+
text: `Failed to dismiss skill: ${getErrorMessage(error)}`,
|
|
383
|
+
isError: true,
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
})();
|
|
387
|
+
}, [config, selectedItem, removeItem]);
|
|
388
|
+
const handleSelectDestination = useCallback((choice) => {
|
|
389
|
+
if (!selectedItem || selectedItem.type !== 'skill')
|
|
390
|
+
return;
|
|
391
|
+
const skill = selectedItem.skill;
|
|
392
|
+
if (choice.destination === 'project' && !config.isTrustedFolder()) {
|
|
393
|
+
setFeedback({
|
|
394
|
+
text: 'Project skills are unavailable until this workspace is trusted.',
|
|
395
|
+
isError: true,
|
|
396
|
+
});
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
setFeedback(null);
|
|
400
|
+
void (async () => {
|
|
401
|
+
try {
|
|
402
|
+
const result = await moveInboxSkill(config, skill.dirName, choice.destination);
|
|
403
|
+
setFeedback({ text: result.message, isError: !result.success });
|
|
404
|
+
if (!result.success) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
removeItem(selectedItem);
|
|
408
|
+
setSelectedItem(null);
|
|
409
|
+
setPhase('list');
|
|
410
|
+
try {
|
|
411
|
+
await onReloadSkills();
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
setFeedback({
|
|
415
|
+
text: `${result.message} Failed to reload skills: ${getErrorMessage(error)}`,
|
|
416
|
+
isError: true,
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
catch (error) {
|
|
421
|
+
setFeedback({
|
|
422
|
+
text: `Failed to install skill: ${getErrorMessage(error)}`,
|
|
423
|
+
isError: true,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
})();
|
|
427
|
+
}, [config, selectedItem, onReloadSkills, removeItem]);
|
|
428
|
+
const handleSelectPatchAction = useCallback((choice) => {
|
|
429
|
+
if (!selectedItem || selectedItem.type !== 'patch')
|
|
430
|
+
return;
|
|
431
|
+
const patch = selectedItem.patch;
|
|
432
|
+
if (choice.action === 'apply' &&
|
|
433
|
+
!config.isTrustedFolder() &&
|
|
434
|
+
selectedItem.targetsProjectSkills) {
|
|
435
|
+
setFeedback({
|
|
436
|
+
text: 'Project skill patches are unavailable until this workspace is trusted.',
|
|
437
|
+
isError: true,
|
|
438
|
+
});
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
setFeedback(null);
|
|
442
|
+
void (async () => {
|
|
443
|
+
try {
|
|
444
|
+
let result;
|
|
445
|
+
if (choice.action === 'apply') {
|
|
446
|
+
result = await applyInboxPatch(config, patch.fileName);
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
result = await dismissInboxPatch(config, patch.fileName);
|
|
450
|
+
}
|
|
451
|
+
setFeedback({ text: result.message, isError: !result.success });
|
|
452
|
+
if (!result.success) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
removeItem(selectedItem);
|
|
456
|
+
setSelectedItem(null);
|
|
457
|
+
setPhase('list');
|
|
458
|
+
if (choice.action === 'apply') {
|
|
459
|
+
try {
|
|
460
|
+
await onReloadSkills();
|
|
461
|
+
}
|
|
462
|
+
catch (error) {
|
|
463
|
+
setFeedback({
|
|
464
|
+
text: `${result.message} Failed to reload skills: ${getErrorMessage(error)}`,
|
|
465
|
+
isError: true,
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
catch (error) {
|
|
471
|
+
const operation = choice.action === 'apply' ? 'apply patch' : 'dismiss patch';
|
|
472
|
+
setFeedback({
|
|
473
|
+
text: `Failed to ${operation}: ${getErrorMessage(error)}`,
|
|
474
|
+
isError: true,
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
})();
|
|
478
|
+
}, [config, selectedItem, onReloadSkills, removeItem]);
|
|
479
|
+
const handleSelectMemoryPatchAction = useCallback((choice) => {
|
|
480
|
+
if (!selectedItem || selectedItem.type !== 'memory-patch')
|
|
481
|
+
return;
|
|
482
|
+
const memoryPatch = selectedItem.memoryPatch;
|
|
483
|
+
setFeedback(null);
|
|
484
|
+
void (async () => {
|
|
485
|
+
try {
|
|
486
|
+
let result;
|
|
487
|
+
if (choice.action === 'apply') {
|
|
488
|
+
result = await applyInboxMemoryPatch(config, memoryPatch.kind, memoryPatch.relativePath);
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
result = await dismissInboxMemoryPatch(config, memoryPatch.kind, memoryPatch.relativePath);
|
|
492
|
+
}
|
|
493
|
+
setFeedback({ text: result.message, isError: !result.success });
|
|
494
|
+
if (!result.success) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
removeItem(selectedItem);
|
|
498
|
+
setSelectedItem(null);
|
|
499
|
+
setPhase('list');
|
|
500
|
+
if (choice.action === 'apply' && onReloadMemory) {
|
|
501
|
+
try {
|
|
502
|
+
await onReloadMemory();
|
|
503
|
+
}
|
|
504
|
+
catch (error) {
|
|
505
|
+
setFeedback({
|
|
506
|
+
text: `${result.message} Failed to reload memory: ${getErrorMessage(error)}`,
|
|
507
|
+
isError: true,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
catch (error) {
|
|
513
|
+
const operation = choice.action === 'apply'
|
|
514
|
+
? 'apply memory patch'
|
|
515
|
+
: 'dismiss memory patch';
|
|
516
|
+
setFeedback({
|
|
517
|
+
text: `Failed to ${operation}: ${getErrorMessage(error)}`,
|
|
518
|
+
isError: true,
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
})();
|
|
522
|
+
}, [config, selectedItem, onReloadMemory, removeItem]);
|
|
523
|
+
useKeypress((key) => {
|
|
524
|
+
if (keyMatchers[Command.ESCAPE](key)) {
|
|
525
|
+
if (phase === 'skill-action') {
|
|
526
|
+
setPhase('skill-preview');
|
|
527
|
+
setFeedback(null);
|
|
528
|
+
}
|
|
529
|
+
else if (phase !== 'list') {
|
|
530
|
+
setPhase('list');
|
|
531
|
+
setSelectedItem(null);
|
|
532
|
+
setFeedback(null);
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
onClose();
|
|
536
|
+
}
|
|
537
|
+
return true;
|
|
538
|
+
}
|
|
539
|
+
return false;
|
|
540
|
+
}, { isActive: true, priority: true });
|
|
541
|
+
// Hoist the per-phase preview data so the array literals passed to
|
|
542
|
+
// ScrollableDiffViewport don't change identity on every parent render.
|
|
543
|
+
// ScrollableDiffViewport memoizes its expensive `parseDiffWithLineNumbers`
|
|
544
|
+
// + `renderDiffLines` on `sections`, so a new array literal every render
|
|
545
|
+
// would defeat that and re-colorize the diff each time. Keying on
|
|
546
|
+
// `selectedItem` captures every input that affects the rendered diffs.
|
|
547
|
+
// Must live above the early returns below so React sees a consistent
|
|
548
|
+
// hook order.
|
|
549
|
+
const previewData = useMemo(() => {
|
|
550
|
+
if (!selectedItem) {
|
|
551
|
+
return {
|
|
552
|
+
skillSections: undefined,
|
|
553
|
+
patchSections: undefined,
|
|
554
|
+
memoryGroups: undefined,
|
|
555
|
+
memorySections: undefined,
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
if (selectedItem.type === 'skill') {
|
|
559
|
+
const skill = selectedItem.skill;
|
|
560
|
+
if (!skill.content) {
|
|
561
|
+
return {
|
|
562
|
+
skillSections: undefined,
|
|
563
|
+
patchSections: undefined,
|
|
564
|
+
memoryGroups: undefined,
|
|
565
|
+
memorySections: undefined,
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
return {
|
|
569
|
+
skillSections: [
|
|
570
|
+
{
|
|
571
|
+
key: `skill:${skill.dirName}`,
|
|
572
|
+
header: 'SKILL.md',
|
|
573
|
+
diffContent: newFileDiff('SKILL.md', skill.content),
|
|
574
|
+
},
|
|
575
|
+
],
|
|
576
|
+
patchSections: undefined,
|
|
577
|
+
memoryGroups: undefined,
|
|
578
|
+
memorySections: undefined,
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
if (selectedItem.type === 'patch') {
|
|
582
|
+
const patch = selectedItem.patch;
|
|
583
|
+
return {
|
|
584
|
+
skillSections: undefined,
|
|
585
|
+
patchSections: patch.entries.map((entry, index) => ({
|
|
586
|
+
key: `${patch.fileName}:${entry.targetPath}:${index}`,
|
|
587
|
+
header: entry.targetPath,
|
|
588
|
+
diffContent: entry.diffContent,
|
|
589
|
+
})),
|
|
590
|
+
memoryGroups: undefined,
|
|
591
|
+
memorySections: undefined,
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
if (selectedItem.type === 'memory-patch') {
|
|
595
|
+
// Group hunks by target file. Multiple source patches may touch the
|
|
596
|
+
// same file (e.g. several patches all updating MEMORY.md); showing
|
|
597
|
+
// the file path once with all its hunks beneath is less noisy than
|
|
598
|
+
// repeating the path for every hunk.
|
|
599
|
+
const groups = new Map();
|
|
600
|
+
for (const entry of selectedItem.memoryPatch.entries) {
|
|
601
|
+
const existing = groups.get(entry.targetPath);
|
|
602
|
+
if (existing) {
|
|
603
|
+
existing.diffs.push(entry.diffContent);
|
|
604
|
+
if (entry.isNewFile)
|
|
605
|
+
existing.isNewFile = true;
|
|
606
|
+
}
|
|
607
|
+
else {
|
|
608
|
+
groups.set(entry.targetPath, {
|
|
609
|
+
isNewFile: entry.isNewFile,
|
|
610
|
+
diffs: [entry.diffContent],
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
const memoryGroups = Array.from(groups.entries());
|
|
615
|
+
const memorySections = [];
|
|
616
|
+
memoryGroups.forEach(([targetPath, { isNewFile, diffs }], groupIndex) => {
|
|
617
|
+
const headerAnnotation = `${isNewFile ? ' (new file)' : ''}${diffs.length > 1
|
|
618
|
+
? ` · ${diffs.length} changes from different patches`
|
|
619
|
+
: ''}`;
|
|
620
|
+
diffs.forEach((diff, hunkIndex) => {
|
|
621
|
+
memorySections.push({
|
|
622
|
+
key: `${targetPath}:${groupIndex}:${hunkIndex}`,
|
|
623
|
+
header: hunkIndex === 0 ? `${targetPath}${headerAnnotation}` : targetPath,
|
|
624
|
+
diffContent: diff,
|
|
625
|
+
});
|
|
626
|
+
});
|
|
627
|
+
});
|
|
628
|
+
return {
|
|
629
|
+
skillSections: undefined,
|
|
630
|
+
patchSections: undefined,
|
|
631
|
+
memoryGroups,
|
|
632
|
+
memorySections,
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
return {
|
|
636
|
+
skillSections: undefined,
|
|
637
|
+
patchSections: undefined,
|
|
638
|
+
memoryGroups: undefined,
|
|
639
|
+
memorySections: undefined,
|
|
640
|
+
};
|
|
641
|
+
}, [selectedItem]);
|
|
642
|
+
if (loading) {
|
|
643
|
+
return (_jsx(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.border.default, paddingX: 2, paddingY: 1, children: _jsx(Text, { children: "Loading inbox\u2026" }) }));
|
|
644
|
+
}
|
|
645
|
+
if (items.length === 0 && !feedback) {
|
|
646
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.border.default, paddingX: 2, paddingY: 1, children: [_jsx(Text, { bold: true, children: "Memory Inbox" }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.text.secondary, children: "No items in inbox." }) }), _jsx(DialogFooter, { primaryAction: "Esc to close", cancelAction: "" })] }));
|
|
647
|
+
}
|
|
648
|
+
// Border + paddingX account for 6 chars of width
|
|
649
|
+
const contentWidth = terminalWidth - 6;
|
|
650
|
+
// Diff-rendering budgets. Two strategies, picked by `isAlternateBuffer`:
|
|
651
|
+
//
|
|
652
|
+
// - Alt-buffer: a fixed-height ScrollableList viewport. There is no
|
|
653
|
+
// terminal scrollback, so we must scroll inside the dialog itself
|
|
654
|
+
// via PgUp/PgDn/Shift+arrows.
|
|
655
|
+
//
|
|
656
|
+
// - Non-alt-buffer: the codebase's standard pattern of a bounded
|
|
657
|
+
// DiffRenderer + ShowMoreLines + Ctrl+O (see FolderTrustDialog,
|
|
658
|
+
// ThemeDialog). Clipped content lands in terminal scrollback when
|
|
659
|
+
// the user expands via Ctrl+O.
|
|
660
|
+
//
|
|
661
|
+
// Chrome accounts for the dialog's borders, padding, title + subtitle,
|
|
662
|
+
// action list (two `minHeight={2}` rows), the section's `marginTop`,
|
|
663
|
+
// the dialog footer, and a couple of safety rows. Bumped when inline
|
|
664
|
+
// feedback is showing.
|
|
665
|
+
const DIALOG_CHROME_HEIGHT = 16;
|
|
666
|
+
const feedbackHeight = feedback ? 2 : 0;
|
|
667
|
+
const diffViewportHeight = Math.max(3, terminalHeight - DIALOG_CHROME_HEIGHT - feedbackHeight);
|
|
668
|
+
// For the non-alt-buffer DiffRenderer path, mirror MainContent /
|
|
669
|
+
// DialogManager and drop the clamp when the user has pressed Ctrl+O.
|
|
670
|
+
const availableContentHeight = constrainHeight
|
|
671
|
+
? diffViewportHeight
|
|
672
|
+
: undefined;
|
|
673
|
+
const PATCH_ENTRY_OVERHEAD = 2; // target-path label + marginBottom
|
|
674
|
+
const patchEntryCount = selectedItem?.type === 'patch'
|
|
675
|
+
? selectedItem.patch.entries.length
|
|
676
|
+
: selectedItem?.type === 'memory-patch'
|
|
677
|
+
? selectedItem.memoryPatch.entries.length
|
|
678
|
+
: 1;
|
|
679
|
+
const availablePatchEntryHeight = availableContentHeight === undefined
|
|
680
|
+
? undefined
|
|
681
|
+
: Math.max(3, Math.floor((availableContentHeight - patchEntryCount * PATCH_ENTRY_OVERHEAD) /
|
|
682
|
+
Math.max(1, patchEntryCount)));
|
|
683
|
+
const previewNavigationHint = isAlternateBuffer
|
|
684
|
+
? 'PgUp/PgDn to scroll'
|
|
685
|
+
: undefined;
|
|
686
|
+
// Budget the list phase so the dialog footer never clips on shorter
|
|
687
|
+
// terminals. Every visible row — skill items, patch items, memory-patch
|
|
688
|
+
// items, and the section headers — renders at exactly 2 rows tall
|
|
689
|
+
// (enforced by `height={2}` on item renders and `marginTop={1}` + 1
|
|
690
|
+
// text line for headers), so the windowed-slot count maps directly to
|
|
691
|
+
// terminal rows.
|
|
692
|
+
//
|
|
693
|
+
// Chrome rows accounted for:
|
|
694
|
+
// - round border (2)
|
|
695
|
+
// - paddingY (2)
|
|
696
|
+
// - DefaultAppLayout's alt-buffer paddingBottom (1)
|
|
697
|
+
// - title + subtitle (2)
|
|
698
|
+
// - marginTop above the list (1)
|
|
699
|
+
// - dialog footer marginTop + text (2)
|
|
700
|
+
// - BaseSelectionList ▲ + ▼ scroll arrows (2) — always shown when
|
|
701
|
+
// items > maxItemsToShow, which is precisely when this budget
|
|
702
|
+
// matters
|
|
703
|
+
const LIST_PHASE_CHROME_HEIGHT = 12;
|
|
704
|
+
const LIST_ROW_HEIGHT = 2;
|
|
705
|
+
const listMaxItemsToShow = Math.max(1, Math.min(8, Math.floor((terminalHeight - LIST_PHASE_CHROME_HEIGHT - feedbackHeight) /
|
|
706
|
+
LIST_ROW_HEIGHT)));
|
|
707
|
+
return (_jsx(OverflowProvider, { children: _jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.border.default, paddingX: 2, paddingY: 1, width: "100%", children: [phase === 'list' && (_jsxs(_Fragment, { children: [_jsxs(Text, { bold: true, children: ["Memory Inbox (", items.length, " item", items.length !== 1 ? 's' : '', ")"] }), _jsx(Text, { color: theme.text.secondary, children: "Extracted from past sessions. Select one to review." }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(BaseSelectionList, { items: listItems, initialIndex: Math.max(0, Math.min(lastListIndex, listItems.length - 1)), onSelect: handleSelectItem, isFocused: true, showNumbers: false, showScrollArrows: true, maxItemsToShow: listMaxItemsToShow, renderItem: (item, { titleColor }) => {
|
|
708
|
+
if (item.value.type === 'header') {
|
|
709
|
+
return (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.text.secondary, bold: true, children: item.value.label }) }));
|
|
710
|
+
}
|
|
711
|
+
if (item.value.type === 'skill') {
|
|
712
|
+
const skill = item.value.skill;
|
|
713
|
+
const subtitle = skill.extractedAt
|
|
714
|
+
? `${skill.description} · ${formatDate(skill.extractedAt)}`
|
|
715
|
+
: skill.description;
|
|
716
|
+
return (_jsxs(Box, { flexDirection: "column", height: 2, children: [_jsx(Text, { color: titleColor, bold: true, wrap: "truncate-end", children: skill.name }), _jsx(Text, { color: theme.text.secondary, wrap: "truncate-end", children: subtitle })] }));
|
|
717
|
+
}
|
|
718
|
+
if (item.value.type === 'memory-patch') {
|
|
719
|
+
const memoryPatch = item.value.memoryPatch;
|
|
720
|
+
const summary = formatMemoryPatchSummary(memoryPatch);
|
|
721
|
+
const subtitle = memoryPatch.extractedAt
|
|
722
|
+
? `${summary} · ${formatDate(memoryPatch.extractedAt)}`
|
|
723
|
+
: summary;
|
|
724
|
+
return (_jsxs(Box, { flexDirection: "column", height: 2, children: [_jsx(Text, { color: titleColor, bold: true, wrap: "truncate-end", children: memoryPatch.name }), _jsx(Text, { color: theme.text.secondary, wrap: "truncate-end", children: subtitle })] }));
|
|
725
|
+
}
|
|
726
|
+
const patch = item.value.patch;
|
|
727
|
+
const fileNames = patch.entries.map((e) => getPathBasename(e.targetPath));
|
|
728
|
+
const origin = getSkillOriginTag(patch.entries[0]?.targetPath ?? '');
|
|
729
|
+
const titleLine = origin
|
|
730
|
+
? `${patch.name} [${origin}]`
|
|
731
|
+
: patch.name;
|
|
732
|
+
const subtitle = patch.extractedAt
|
|
733
|
+
? `${fileNames.join(', ')} · ${formatDate(patch.extractedAt)}`
|
|
734
|
+
: fileNames.join(', ');
|
|
735
|
+
return (_jsxs(Box, { flexDirection: "column", height: 2, children: [_jsx(Text, { color: titleColor, bold: true, wrap: "truncate-end", children: titleLine }), _jsx(Text, { color: theme.text.secondary, wrap: "truncate-end", children: subtitle })] }));
|
|
736
|
+
} }) }), feedback && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: feedback.isError ? theme.status.error : theme.status.success, children: [feedback.isError ? '✗ ' : '✓ ', feedback.text] }) })), _jsx(DialogFooter, { primaryAction: "Enter to select", cancelAction: "Esc to close" })] })), phase === 'skill-preview' && selectedItem?.type === 'skill' && (_jsxs(_Fragment, { children: [_jsx(Text, { bold: true, children: selectedItem.skill.name }), _jsx(Text, { color: theme.text.secondary, children: "Review new skill before installing." }), selectedItem.skill.content &&
|
|
737
|
+
(isAlternateBuffer ? (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(ScrollableDiffViewport, { sections: previewData.skillSections ?? [], width: contentWidth, height: diffViewportHeight, hasFocus: true }) })) : (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: theme.text.secondary, bold: true, children: "SKILL.md" }), _jsx(DiffRenderer, { diffContent: newFileDiff('SKILL.md', selectedItem.skill.content), filename: "SKILL.md", terminalWidth: contentWidth, availableTerminalHeight: availableContentHeight })] }))), _jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(BaseSelectionList, { items: skillPreviewItems, onSelect: handleSkillPreviewAction, isFocused: true, showNumbers: true, renderItem: (item, { titleColor }) => (_jsxs(Box, { flexDirection: "column", minHeight: 2, children: [_jsx(Text, { color: titleColor, bold: true, children: item.value.label }), _jsx(Text, { color: theme.text.secondary, children: item.value.description })] })) }) }), feedback && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: feedback.isError ? theme.status.error : theme.status.success, children: [feedback.isError ? '✗ ' : '✓ ', feedback.text] }) })), !isAlternateBuffer && (_jsx(ShowMoreLines, { constrainHeight: constrainHeight })), _jsx(DialogFooter, { primaryAction: "Enter to confirm", navigationActions: previewNavigationHint, cancelAction: "Esc to go back" })] })), phase === 'skill-action' && selectedItem?.type === 'skill' && (_jsxs(_Fragment, { children: [_jsxs(Text, { bold: true, children: ["Move \"", selectedItem.skill.name, "\""] }), _jsx(Text, { color: theme.text.secondary, children: "Choose where to install this skill." }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(BaseSelectionList, { items: destinationItems, onSelect: handleSelectDestination, isFocused: true, showNumbers: true, renderItem: (item, { titleColor }) => (_jsxs(Box, { flexDirection: "column", minHeight: 2, children: [_jsx(Text, { color: titleColor, bold: true, children: item.value.label }), _jsx(Text, { color: theme.text.secondary, children: item.value.description })] })) }) }), feedback && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: feedback.isError ? theme.status.error : theme.status.success, children: [feedback.isError ? '✗ ' : '✓ ', feedback.text] }) })), _jsx(DialogFooter, { primaryAction: "Enter to confirm", cancelAction: "Esc to go back" })] })), phase === 'patch-preview' && selectedItem?.type === 'patch' && (_jsxs(_Fragment, { children: [_jsx(Text, { bold: true, children: selectedItem.patch.name }), _jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: theme.text.secondary, children: "Review changes before applying." }), (() => {
|
|
738
|
+
const origin = getSkillOriginTag(selectedItem.patch.entries[0]?.targetPath ?? '');
|
|
739
|
+
return origin ? (_jsx(Text, { color: theme.text.secondary, children: ` [${origin}]` })) : null;
|
|
740
|
+
})()] }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: isAlternateBuffer ? (_jsx(ScrollableDiffViewport, { sections: previewData.patchSections ?? [], width: contentWidth, height: diffViewportHeight, hasFocus: true })) : (selectedItem.patch.entries.map((entry, index) => (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: theme.text.secondary, bold: true, children: entry.targetPath }), _jsx(DiffRenderer, { diffContent: entry.diffContent, filename: entry.targetPath, terminalWidth: contentWidth, availableTerminalHeight: availablePatchEntryHeight })] }, `${selectedItem.patch.fileName}:${entry.targetPath}:${index}`)))) }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(BaseSelectionList, { items: patchActionItems, onSelect: handleSelectPatchAction, isFocused: true, showNumbers: true, renderItem: (item, { titleColor }) => (_jsxs(Box, { flexDirection: "column", minHeight: 2, children: [_jsx(Text, { color: titleColor, bold: true, children: item.value.label }), _jsx(Text, { color: theme.text.secondary, children: item.value.description })] })) }) }), feedback && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: feedback.isError ? theme.status.error : theme.status.success, children: [feedback.isError ? '✗ ' : '✓ ', feedback.text] }) })), !isAlternateBuffer && (_jsx(ShowMoreLines, { constrainHeight: constrainHeight })), _jsx(DialogFooter, { primaryAction: "Enter to confirm", navigationActions: previewNavigationHint, cancelAction: "Esc to go back" })] })), phase === 'memory-preview' &&
|
|
741
|
+
selectedItem?.type === 'memory-patch' && (_jsxs(_Fragment, { children: [_jsx(Text, { bold: true, children: selectedItem.memoryPatch.name }), _jsxs(Text, { color: theme.text.secondary, children: ["Review ", formatMemoryPatchSummary(selectedItem.memoryPatch), ' ', "before applying. Apply runs each source patch atomically; Dismiss removes them all."] }), (() => {
|
|
742
|
+
// Grouping + section flattening were hoisted into the
|
|
743
|
+
// `previewData` useMemo so the array identities passed into
|
|
744
|
+
// ScrollableDiffViewport stay stable across re-renders.
|
|
745
|
+
const groupEntries = previewData.memoryGroups ?? [];
|
|
746
|
+
if (isAlternateBuffer) {
|
|
747
|
+
return (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(ScrollableDiffViewport, { sections: previewData.memorySections ?? [], width: contentWidth, height: diffViewportHeight, hasFocus: true }) }));
|
|
748
|
+
}
|
|
749
|
+
return groupEntries.map(([targetPath, { isNewFile, diffs }]) => (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Text, { color: theme.text.secondary, bold: true, children: [targetPath, isNewFile ? ' (new file)' : '', diffs.length > 1
|
|
750
|
+
? ` · ${diffs.length} changes from different patches`
|
|
751
|
+
: ''] }), diffs.map((diff, hunkIndex) => (_jsx(DiffRenderer, { diffContent: diff, filename: targetPath, terminalWidth: contentWidth, availableTerminalHeight: availablePatchEntryHeight }, `${targetPath}:${hunkIndex}`)))] }, targetPath)));
|
|
752
|
+
})(), _jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(BaseSelectionList, { items: memoryPatchActionItems, onSelect: handleSelectMemoryPatchAction, isFocused: true, showNumbers: true, renderItem: (item, { titleColor }) => (_jsxs(Box, { flexDirection: "column", minHeight: 2, children: [_jsx(Text, { color: titleColor, bold: true, children: item.value.label }), _jsx(Text, { color: theme.text.secondary, children: item.value.description })] })) }) }), feedback && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: feedback.isError
|
|
753
|
+
? theme.status.error
|
|
754
|
+
: theme.status.success, children: [feedback.isError ? '✗ ' : '✓ ', feedback.text] }) })), !isAlternateBuffer && (_jsx(ShowMoreLines, { constrainHeight: constrainHeight })), _jsx(DialogFooter, { primaryAction: "Enter to confirm", navigationActions: previewNavigationHint, cancelAction: "Esc to go back" })] }))] }) }));
|
|
755
|
+
};
|
|
756
|
+
//# sourceMappingURL=InboxDialog.js.map
|