@machina.ai/cell-cli 1.33.0-rc1 → 1.38.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 +14 -1
- package/dist/index.js.map +1 -1
- package/dist/package.json +7 -7
- package/dist/src/acp/acpClient.d.ts +56 -0
- package/dist/src/{zed-integration/zedIntegration.js → acp/acpClient.js} +765 -121
- package/dist/src/acp/acpClient.js.map +1 -0
- package/dist/src/acp/acpClient.test.js +1787 -0
- package/dist/src/acp/acpClient.test.js.map +1 -0
- package/dist/src/{zed-integration → acp}/acpErrors.js +2 -0
- package/dist/src/acp/acpErrors.js.map +1 -0
- package/dist/src/acp/acpErrors.test.js.map +1 -0
- package/dist/src/{zed-integration → acp}/acpResume.test.js +83 -8
- package/dist/src/acp/acpResume.test.js.map +1 -0
- package/dist/src/acp/commandHandler.d.ts +26 -0
- package/dist/src/acp/commandHandler.js +106 -0
- package/dist/src/acp/commandHandler.js.map +1 -0
- package/dist/src/acp/commandHandler.test.js +29 -0
- package/dist/src/acp/commandHandler.test.js.map +1 -0
- package/dist/src/acp/commands/about.d.ts +11 -0
- package/dist/src/acp/commands/about.js +53 -0
- package/dist/src/acp/commands/about.js.map +1 -0
- package/dist/src/acp/commands/commandRegistry.d.ts +12 -0
- package/dist/src/acp/commands/commandRegistry.js +26 -0
- package/dist/src/acp/commands/commandRegistry.js.map +1 -0
- package/dist/src/acp/commands/extensions.d.ts +57 -0
- package/dist/src/acp/commands/extensions.js +331 -0
- package/dist/src/acp/commands/extensions.js.map +1 -0
- package/dist/src/acp/commands/help.d.ts +14 -0
- package/dist/src/acp/commands/help.js +35 -0
- package/dist/src/acp/commands/help.js.map +1 -0
- package/dist/src/acp/commands/help.test.js +40 -0
- package/dist/src/acp/commands/help.test.js.map +1 -0
- package/dist/src/acp/commands/init.d.ts +12 -0
- package/dist/src/acp/commands/init.js +47 -0
- package/dist/src/acp/commands/init.js.map +1 -0
- package/dist/src/acp/commands/memory.d.ts +34 -0
- package/dist/src/acp/commands/memory.js +86 -0
- package/dist/src/acp/commands/memory.js.map +1 -0
- package/dist/src/acp/commands/restore.d.ts +18 -0
- package/dist/src/acp/commands/restore.js +141 -0
- package/dist/src/acp/commands/restore.js.map +1 -0
- package/dist/src/acp/commands/types.d.ts +31 -0
- package/dist/src/acp/commands/types.js +7 -0
- package/dist/src/acp/commands/types.js.map +1 -0
- package/dist/src/{zed-integration → acp}/fileSystemService.d.ts +6 -2
- package/dist/src/acp/fileSystemService.js +78 -0
- package/dist/src/acp/fileSystemService.js.map +1 -0
- package/dist/src/acp/fileSystemService.test.js +162 -0
- package/dist/src/acp/fileSystemService.test.js.map +1 -0
- package/dist/src/commands/extensions/disable.js +1 -2
- package/dist/src/commands/extensions/disable.js.map +1 -1
- package/dist/src/commands/extensions/disable.test.js +2 -2
- package/dist/src/commands/extensions/disable.test.js.map +1 -1
- package/dist/src/commands/extensions/examples/policies/README.md +41 -0
- package/dist/src/commands/extensions/examples/policies/gemini-extension.json +5 -0
- package/dist/src/commands/extensions/examples/policies/policies/policies.toml +28 -0
- package/dist/src/commands/extensions/examples/themes-example/README.md +8 -5
- package/dist/src/commands/extensions/examples/themes-example/gemini-extension.json +1 -1
- package/dist/src/commands/extensions/install.d.ts +1 -0
- package/dist/src/commands/extensions/install.js +86 -6
- package/dist/src/commands/extensions/install.js.map +1 -1
- package/dist/src/commands/extensions/install.test.js +199 -28
- package/dist/src/commands/extensions/install.test.js.map +1 -1
- package/dist/src/commands/extensions/link.js +1 -2
- package/dist/src/commands/extensions/link.js.map +1 -1
- package/dist/src/commands/extensions/link.test.js +6 -22
- package/dist/src/commands/extensions/link.test.js.map +1 -1
- package/dist/src/commands/extensions/list.js +1 -2
- package/dist/src/commands/extensions/list.js.map +1 -1
- package/dist/src/commands/extensions/list.test.js +9 -25
- package/dist/src/commands/extensions/list.test.js.map +1 -1
- package/dist/src/commands/extensions/new.js +1 -1
- package/dist/src/commands/extensions/new.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.d.ts +2 -1
- package/dist/src/commands/extensions/uninstall.js +27 -6
- package/dist/src/commands/extensions/uninstall.js.map +1 -1
- package/dist/src/commands/extensions/uninstall.test.js +48 -7
- package/dist/src/commands/extensions/uninstall.test.js.map +1 -1
- package/dist/src/commands/extensions/update.js +1 -2
- package/dist/src/commands/extensions/update.js.map +1 -1
- package/dist/src/commands/extensions/utils.js +1 -0
- package/dist/src/commands/extensions/utils.js.map +1 -1
- package/dist/src/commands/extensions/validate.js +1 -2
- package/dist/src/commands/extensions/validate.js.map +1 -1
- package/dist/src/commands/hooks/migrate.js +3 -0
- package/dist/src/commands/hooks/migrate.js.map +1 -1
- package/dist/src/commands/mcp/list.d.ts +3 -3
- package/dist/src/commands/mcp/list.js +68 -24
- package/dist/src/commands/mcp/list.js.map +1 -1
- package/dist/src/commands/mcp/list.test.js +69 -3
- package/dist/src/commands/mcp/list.test.js.map +1 -1
- package/dist/src/commands/mcp.test.js +2 -3
- package/dist/src/commands/mcp.test.js.map +1 -1
- package/dist/src/commands/skills/disable.test.js +4 -7
- package/dist/src/commands/skills/disable.test.js.map +1 -1
- package/dist/src/commands/skills/enable.test.js +4 -7
- package/dist/src/commands/skills/enable.test.js.map +1 -1
- package/dist/src/commands/skills/install.js +1 -2
- package/dist/src/commands/skills/install.js.map +1 -1
- package/dist/src/commands/skills/install.test.js +13 -9
- package/dist/src/commands/skills/install.test.js.map +1 -1
- package/dist/src/commands/skills/link.js +1 -2
- package/dist/src/commands/skills/link.js.map +1 -1
- package/dist/src/commands/skills/link.test.js +6 -2
- package/dist/src/commands/skills/link.test.js.map +1 -1
- package/dist/src/commands/skills/list.js +5 -8
- package/dist/src/commands/skills/list.js.map +1 -1
- package/dist/src/commands/skills/list.test.js +21 -30
- package/dist/src/commands/skills/list.test.js.map +1 -1
- package/dist/src/commands/skills/uninstall.js +1 -2
- package/dist/src/commands/skills/uninstall.js.map +1 -1
- package/dist/src/commands/skills/uninstall.test.js +10 -6
- package/dist/src/commands/skills/uninstall.test.js.map +1 -1
- package/dist/src/config/config.d.ts +18 -3
- package/dist/src/config/config.js +334 -136
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +513 -61
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/extension-manager-hydration.test.js +2 -2
- package/dist/src/config/extension-manager-hydration.test.js.map +1 -1
- package/dist/src/config/extension-manager-permissions.test.d.ts +6 -0
- package/dist/src/config/extension-manager-permissions.test.js +107 -0
- package/dist/src/config/extension-manager-permissions.test.js.map +1 -0
- package/dist/src/config/extension-manager-scope.test.js +1 -1
- package/dist/src/config/extension-manager-scope.test.js.map +1 -1
- package/dist/src/config/extension-manager-skills.test.js +9 -0
- package/dist/src/config/extension-manager-skills.test.js.map +1 -1
- package/dist/src/config/extension-manager-themes.spec.js +3 -1
- package/dist/src/config/extension-manager-themes.spec.js.map +1 -1
- package/dist/src/config/extension-manager.d.ts +16 -3
- package/dist/src/config/extension-manager.js +202 -54
- package/dist/src/config/extension-manager.js.map +1 -1
- package/dist/src/config/extension-manager.test.js +430 -0
- package/dist/src/config/extension-manager.test.js.map +1 -0
- package/dist/src/config/extension.d.ts +13 -0
- package/dist/src/config/extension.js +1 -1
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extension.test.js +139 -30
- package/dist/src/config/extension.test.js.map +1 -1
- package/dist/src/config/extensionRegistryClient.d.ts +3 -1
- package/dist/src/config/extensionRegistryClient.js +29 -9
- package/dist/src/config/extensionRegistryClient.js.map +1 -1
- package/dist/src/config/extensionRegistryClient.test.js +81 -3
- package/dist/src/config/extensionRegistryClient.test.js.map +1 -1
- package/dist/src/config/extensions/consent.d.ts +11 -1
- package/dist/src/config/extensions/consent.js +27 -7
- package/dist/src/config/extensions/consent.js.map +1 -1
- package/dist/src/config/extensions/consent.test.js +43 -44
- package/dist/src/config/extensions/consent.test.js.map +1 -1
- package/dist/src/config/extensions/extensionEnablement.js +1 -0
- package/dist/src/config/extensions/extensionEnablement.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.js +20 -3
- package/dist/src/config/extensions/extensionSettings.js.map +1 -1
- package/dist/src/config/extensions/extensionSettings.test.js +17 -1
- package/dist/src/config/extensions/extensionSettings.test.js.map +1 -1
- package/dist/src/config/extensions/extensionUpdates.test.js +74 -13
- package/dist/src/config/extensions/extensionUpdates.test.js.map +1 -1
- package/dist/src/config/extensions/github.js +13 -3
- package/dist/src/config/extensions/github.js.map +1 -1
- package/dist/src/config/extensions/github.test.js +14 -1
- package/dist/src/config/extensions/github.test.js.map +1 -1
- package/dist/src/config/extensions/update.js +25 -2
- package/dist/src/config/extensions/update.js.map +1 -1
- package/dist/src/config/extensions/update.test.js +68 -3
- package/dist/src/config/extensions/update.test.js.map +1 -1
- package/dist/src/config/extensions/variables.js +14 -2
- package/dist/src/config/extensions/variables.js.map +1 -1
- package/dist/src/config/extensions/variables.test.js +16 -0
- package/dist/src/config/extensions/variables.test.js.map +1 -1
- package/dist/src/config/footerItems.d.ts +62 -0
- package/dist/src/config/footerItems.js +128 -0
- package/dist/src/config/footerItems.js.map +1 -0
- package/dist/src/config/footerItems.test.d.ts +6 -0
- package/dist/src/config/footerItems.test.js +141 -0
- package/dist/src/config/footerItems.test.js.map +1 -0
- package/dist/src/config/mcp/mcpServerEnablement.test.js +1 -0
- package/dist/src/config/mcp/mcpServerEnablement.test.js.map +1 -1
- package/dist/src/config/policy-engine.integration.test.js +90 -51
- package/dist/src/config/policy-engine.integration.test.js.map +1 -1
- package/dist/src/config/policy.d.ts +35 -3
- package/dist/src/config/policy.js +82 -5
- package/dist/src/config/policy.js.map +1 -1
- package/dist/src/config/policy.test.js +199 -0
- package/dist/src/config/policy.test.js.map +1 -0
- package/dist/src/config/sandboxConfig.js +50 -7
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/sandboxConfig.test.js +227 -10
- package/dist/src/config/sandboxConfig.test.js.map +1 -1
- package/dist/src/config/settings-validation.js +1 -1
- package/dist/src/config/settings-validation.js.map +1 -1
- package/dist/src/config/settings-validation.test.js +2 -3
- package/dist/src/config/settings-validation.test.js.map +1 -1
- package/dist/src/config/settings.d.ts +26 -2
- package/dist/src/config/settings.js +102 -31
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settings.test.js +374 -146
- package/dist/src/config/settings.test.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +838 -67
- package/dist/src/config/settingsSchema.js +988 -81
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/settingsSchema.test.js +128 -7
- package/dist/src/config/settingsSchema.test.js.map +1 -1
- package/dist/src/config/settings_repro.test.js +0 -1
- package/dist/src/config/settings_repro.test.js.map +1 -1
- package/dist/src/config/settings_validation_warning.test.js +2 -1
- package/dist/src/config/settings_validation_warning.test.js.map +1 -1
- package/dist/src/config/trustedFolders.test.js +4 -2
- package/dist/src/config/trustedFolders.test.js.map +1 -1
- package/dist/src/config/workspace-policy-cli.test.js +209 -0
- package/dist/src/config/workspace-policy-cli.test.js.map +1 -0
- package/dist/src/core/auth.d.ts +7 -2
- package/dist/src/core/auth.js +28 -6
- package/dist/src/core/auth.js.map +1 -1
- package/dist/src/core/auth.test.js +53 -7
- package/dist/src/core/auth.test.js.map +1 -1
- package/dist/src/core/initializer.d.ts +2 -0
- package/dist/src/core/initializer.js +12 -5
- package/dist/src/core/initializer.js.map +1 -1
- package/dist/src/core/initializer.test.js +12 -2
- package/dist/src/core/initializer.test.js.map +1 -1
- package/dist/src/deferred.test.js +1 -1
- package/dist/src/deferred.test.js.map +1 -1
- package/dist/src/gemini.d.ts +3 -3
- package/dist/src/gemini.js +120 -146
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/gemini.test.js +220 -44
- package/dist/src/gemini.test.js.map +1 -1
- package/dist/src/gemini_cleanup.test.js +99 -30
- 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/integration-tests/modelSteering.test.d.ts +6 -0
- package/dist/src/integration-tests/modelSteering.test.js +62 -0
- package/dist/src/integration-tests/modelSteering.test.js.map +1 -0
- package/dist/src/interactiveCli.d.ts +9 -0
- package/dist/src/interactiveCli.js +128 -0
- package/dist/src/interactiveCli.js.map +1 -0
- package/dist/src/nonInteractiveCli.d.ts +1 -1
- package/dist/src/nonInteractiveCli.js +15 -6
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/nonInteractiveCli.test.js +20 -16
- package/dist/src/nonInteractiveCli.test.js.map +1 -1
- package/dist/src/nonInteractiveCliAgentSession.d.ts +16 -0
- package/dist/src/nonInteractiveCliAgentSession.js +484 -0
- package/dist/src/nonInteractiveCliAgentSession.js.map +1 -0
- package/dist/src/nonInteractiveCliAgentSession.test.js +1837 -0
- package/dist/src/nonInteractiveCliAgentSession.test.js.map +1 -0
- package/dist/src/nonInteractiveCliCommands.js +3 -3
- package/dist/src/nonInteractiveCliCommands.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +41 -7
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.test.js +83 -6
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -1
- package/dist/src/services/CommandService.d.ts +25 -18
- package/dist/src/services/CommandService.js +51 -42
- package/dist/src/services/CommandService.js.map +1 -1
- package/dist/src/services/CommandService.test.js +44 -204
- package/dist/src/services/CommandService.test.js.map +1 -1
- package/dist/src/services/FileCommandLoader.d.ts +2 -1
- package/dist/src/services/FileCommandLoader.js +14 -6
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/FileCommandLoader.test.js.map +1 -1
- package/dist/src/services/McpPromptLoader.d.ts +2 -2
- package/dist/src/services/McpPromptLoader.js +3 -2
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/SkillCommandLoader.d.ts +23 -0
- package/dist/src/services/SkillCommandLoader.js +52 -0
- package/dist/src/services/SkillCommandLoader.js.map +1 -0
- package/dist/src/services/SkillCommandLoader.test.d.ts +6 -0
- package/dist/src/services/SkillCommandLoader.test.js +113 -0
- package/dist/src/services/SkillCommandLoader.test.js.map +1 -0
- package/dist/src/services/SlashCommandConflictHandler.d.ts +35 -0
- package/dist/src/services/SlashCommandConflictHandler.js +128 -0
- package/dist/src/services/SlashCommandConflictHandler.js.map +1 -0
- package/dist/src/services/SlashCommandConflictHandler.test.d.ts +6 -0
- package/dist/src/services/SlashCommandConflictHandler.test.js +144 -0
- package/dist/src/services/SlashCommandConflictHandler.test.js.map +1 -0
- package/dist/src/services/SlashCommandResolver.d.ts +53 -0
- package/dist/src/services/SlashCommandResolver.js +156 -0
- package/dist/src/services/SlashCommandResolver.js.map +1 -0
- package/dist/src/services/SlashCommandResolver.test.d.ts +6 -0
- package/dist/src/services/SlashCommandResolver.test.js +186 -0
- package/dist/src/services/SlashCommandResolver.test.js.map +1 -0
- package/dist/src/services/prompt-processors/atFileProcessor.js +1 -1
- package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/atFileProcessor.test.js +6 -3
- package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.js +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -1
- package/dist/src/services/prompt-processors/shellProcessor.test.js +14 -4
- package/dist/src/services/prompt-processors/shellProcessor.test.js.map +1 -1
- package/dist/src/services/types.d.ts +8 -0
- package/dist/src/test-utils/AppRig.d.ts +83 -0
- package/dist/src/test-utils/AppRig.js +583 -0
- package/dist/src/test-utils/AppRig.js.map +1 -0
- package/dist/src/test-utils/AppRig.test.d.ts +6 -0
- package/dist/src/test-utils/AppRig.test.js +60 -0
- package/dist/src/test-utils/AppRig.test.js.map +1 -0
- package/dist/src/test-utils/MockShellExecutionService.d.ts +37 -0
- package/dist/src/test-utils/MockShellExecutionService.js +88 -0
- package/dist/src/test-utils/MockShellExecutionService.js.map +1 -0
- package/dist/src/test-utils/async.d.ts +1 -1
- package/dist/src/test-utils/async.js +1 -1
- package/dist/src/test-utils/async.js.map +1 -1
- package/dist/src/test-utils/customMatchers.d.ts +25 -5
- package/dist/src/test-utils/customMatchers.js +47 -2
- package/dist/src/test-utils/customMatchers.js.map +1 -1
- package/dist/src/test-utils/mockCommandContext.js +2 -5
- package/dist/src/test-utils/mockCommandContext.js.map +1 -1
- package/dist/src/test-utils/mockCommandContext.test.js +4 -4
- package/dist/src/test-utils/mockCommandContext.test.js.map +1 -1
- package/dist/src/test-utils/mockConfig.d.ts +1 -1
- package/dist/src/test-utils/mockConfig.js +41 -12
- package/dist/src/test-utils/mockConfig.js.map +1 -1
- package/dist/src/test-utils/mockDebugLogger.d.ts +35 -0
- package/dist/src/test-utils/mockDebugLogger.js +68 -0
- package/dist/src/test-utils/mockDebugLogger.js.map +1 -0
- package/dist/src/test-utils/mockSpinner.d.ts +6 -0
- package/dist/src/test-utils/mockSpinner.js +21 -0
- package/dist/src/test-utils/mockSpinner.js.map +1 -0
- package/dist/src/test-utils/render.d.ts +109 -14
- package/dist/src/test-utils/render.js +393 -95
- package/dist/src/test-utils/render.js.map +1 -1
- package/dist/src/test-utils/render.test.js +34 -30
- package/dist/src/test-utils/render.test.js.map +1 -1
- package/dist/src/test-utils/settings.js +2 -11
- package/dist/src/test-utils/settings.js.map +1 -1
- package/dist/src/test-utils/svg.d.ts +7 -0
- package/dist/src/test-utils/svg.js +182 -0
- package/dist/src/test-utils/svg.js.map +1 -0
- package/dist/src/ui/App.test.js +64 -36
- package/dist/src/ui/App.test.js.map +1 -1
- package/dist/src/ui/AppContainer.d.ts +2 -2
- package/dist/src/ui/AppContainer.js +696 -301
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/AppContainer.test.js +1155 -707
- package/dist/src/ui/AppContainer.test.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.js +1 -1
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.test.js +27 -36
- package/dist/src/ui/IdeIntegrationNudge.test.js.map +1 -1
- package/dist/src/ui/ToolConfirmationFullFrame.test.d.ts +1 -0
- package/dist/src/ui/ToolConfirmationFullFrame.test.js +158 -0
- package/dist/src/ui/ToolConfirmationFullFrame.test.js.map +1 -0
- package/dist/src/ui/auth/ApiAuthDialog.js +4 -2
- package/dist/src/ui/auth/ApiAuthDialog.js.map +1 -1
- package/dist/src/ui/auth/ApiAuthDialog.test.js +23 -13
- package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.d.ts +1 -1
- package/dist/src/ui/auth/AuthDialog.js +10 -17
- package/dist/src/ui/auth/AuthDialog.js.map +1 -1
- package/dist/src/ui/auth/AuthDialog.test.js +69 -34
- package/dist/src/ui/auth/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/auth/AuthInProgress.test.js +33 -15
- package/dist/src/ui/auth/AuthInProgress.test.js.map +1 -1
- package/dist/src/ui/auth/BannedAccountDialog.d.ts +14 -0
- package/dist/src/ui/auth/BannedAccountDialog.js +66 -0
- package/dist/src/ui/auth/BannedAccountDialog.js.map +1 -0
- package/dist/src/ui/auth/BannedAccountDialog.test.d.ts +6 -0
- package/dist/src/ui/auth/BannedAccountDialog.test.js +140 -0
- package/dist/src/ui/auth/BannedAccountDialog.test.js.map +1 -0
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.js +4 -6
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.js.map +1 -1
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js +10 -6
- package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js.map +1 -1
- package/dist/src/ui/auth/useAuth.d.ts +4 -1
- package/dist/src/ui/auth/useAuth.js +22 -4
- package/dist/src/ui/auth/useAuth.js.map +1 -1
- package/dist/src/ui/auth/useAuth.test.js +83 -58
- package/dist/src/ui/auth/useAuth.test.js.map +1 -1
- package/dist/src/ui/colors.js +8 -2
- package/dist/src/ui/colors.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.d.ts +1 -1
- package/dist/src/ui/commands/aboutCommand.js +5 -4
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.test.js +8 -6
- package/dist/src/ui/commands/aboutCommand.test.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.js +17 -13
- package/dist/src/ui/commands/agentsCommand.js.map +1 -1
- package/dist/src/ui/commands/agentsCommand.test.js +20 -13
- package/dist/src/ui/commands/agentsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/authCommand.js +7 -5
- package/dist/src/ui/commands/authCommand.js.map +1 -1
- package/dist/src/ui/commands/authCommand.test.js +18 -13
- package/dist/src/ui/commands/authCommand.test.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.js +4 -3
- package/dist/src/ui/commands/bugCommand.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.test.js +29 -23
- package/dist/src/ui/commands/bugCommand.test.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.d.ts +2 -0
- package/dist/src/ui/commands/chatCommand.js +60 -26
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.test.js +22 -15
- package/dist/src/ui/commands/chatCommand.test.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.d.ts +1 -1
- package/dist/src/ui/commands/clearCommand.js +16 -14
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.test.js +27 -17
- package/dist/src/ui/commands/clearCommand.test.js.map +1 -1
- package/dist/src/ui/commands/commandsCommand.d.ts +7 -0
- package/dist/src/ui/commands/commandsCommand.js +56 -0
- package/dist/src/ui/commands/commandsCommand.js.map +1 -0
- package/dist/src/ui/commands/commandsCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/commandsCommand.test.js +42 -0
- package/dist/src/ui/commands/commandsCommand.test.js.map +1 -0
- package/dist/src/ui/commands/compressCommand.d.ts +1 -1
- package/dist/src/ui/commands/compressCommand.js +2 -4
- package/dist/src/ui/commands/compressCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.test.js +10 -3
- package/dist/src/ui/commands/compressCommand.test.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.d.ts +1 -1
- package/dist/src/ui/commands/copyCommand.js +4 -3
- package/dist/src/ui/commands/copyCommand.js.map +1 -1
- package/dist/src/ui/commands/copyCommand.test.js +10 -8
- package/dist/src/ui/commands/copyCommand.test.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.d.ts +1 -1
- package/dist/src/ui/commands/directoryCommand.js +15 -15
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.test.js +5 -2
- package/dist/src/ui/commands/directoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.js +110 -55
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -1
- package/dist/src/ui/commands/extensionsCommand.test.js +80 -33
- package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/footerCommand.d.ts +7 -0
- package/dist/src/ui/commands/footerCommand.js +20 -0
- package/dist/src/ui/commands/footerCommand.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.d.ts +1 -1
- package/dist/src/ui/commands/helpCommand.js.map +1 -1
- package/dist/src/ui/commands/helpCommand.test.js +1 -2
- package/dist/src/ui/commands/helpCommand.test.js.map +1 -1
- package/dist/src/ui/commands/hooksCommand.js +26 -15
- package/dist/src/ui/commands/hooksCommand.js.map +1 -1
- package/dist/src/ui/commands/hooksCommand.test.js +23 -31
- package/dist/src/ui/commands/hooksCommand.test.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.js +3 -3
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.test.js +7 -5
- package/dist/src/ui/commands/ideCommand.test.js.map +1 -1
- package/dist/src/ui/commands/initCommand.js +2 -2
- package/dist/src/ui/commands/initCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.test.js +5 -3
- package/dist/src/ui/commands/initCommand.test.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +68 -28
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.test.js +49 -8
- package/dist/src/ui/commands/mcpCommand.test.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.d.ts +1 -1
- package/dist/src/ui/commands/memoryCommand.js +9 -8
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.test.js +39 -35
- package/dist/src/ui/commands/memoryCommand.test.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.js +41 -4
- package/dist/src/ui/commands/modelCommand.js.map +1 -1
- package/dist/src/ui/commands/modelCommand.test.js +98 -4
- package/dist/src/ui/commands/modelCommand.test.js.map +1 -1
- package/dist/src/ui/commands/oncallCommand.js +4 -2
- package/dist/src/ui/commands/oncallCommand.js.map +1 -1
- package/dist/src/ui/commands/planCommand.js +44 -5
- package/dist/src/ui/commands/planCommand.js.map +1 -1
- package/dist/src/ui/commands/planCommand.test.js +73 -14
- package/dist/src/ui/commands/planCommand.test.js.map +1 -1
- package/dist/src/ui/commands/policiesCommand.js +7 -1
- package/dist/src/ui/commands/policiesCommand.js.map +1 -1
- package/dist/src/ui/commands/policiesCommand.test.js +50 -4
- package/dist/src/ui/commands/policiesCommand.test.js.map +1 -1
- package/dist/src/ui/commands/privacyCommand.d.ts +1 -1
- package/dist/src/ui/commands/privacyCommand.js +1 -1
- package/dist/src/ui/commands/privacyCommand.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.js +6 -6
- package/dist/src/ui/commands/restoreCommand.js.map +1 -1
- package/dist/src/ui/commands/restoreCommand.test.js +6 -3
- package/dist/src/ui/commands/restoreCommand.test.js.map +1 -1
- package/dist/src/ui/commands/resumeCommand.js +3 -1
- package/dist/src/ui/commands/resumeCommand.js.map +1 -1
- package/dist/src/ui/commands/resumeCommand.test.js +28 -0
- package/dist/src/ui/commands/resumeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/rewindCommand.js +9 -5
- package/dist/src/ui/commands/rewindCommand.js.map +1 -1
- package/dist/src/ui/commands/rewindCommand.test.js +20 -9
- package/dist/src/ui/commands/rewindCommand.test.js.map +1 -1
- package/dist/src/ui/commands/settingsCommand.d.ts +1 -1
- package/dist/src/ui/commands/settingsCommand.js +2 -1
- package/dist/src/ui/commands/settingsCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.d.ts +1 -1
- package/dist/src/ui/commands/setupGithubCommand.js +9 -7
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -1
- package/dist/src/ui/commands/shortcutsCommand.d.ts +1 -1
- package/dist/src/ui/commands/shortcutsCommand.js.map +1 -1
- package/dist/src/ui/commands/skillsCommand.js +23 -13
- package/dist/src/ui/commands/skillsCommand.js.map +1 -1
- package/dist/src/ui/commands/skillsCommand.test.js +19 -20
- package/dist/src/ui/commands/skillsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.js +27 -14
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/statsCommand.test.js +20 -4
- package/dist/src/ui/commands/statsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/{shellsCommand.d.ts → tasksCommand.d.ts} +1 -1
- package/dist/src/ui/commands/{shellsCommand.js → tasksCommand.js} +6 -6
- package/dist/src/ui/commands/tasksCommand.js.map +1 -0
- package/dist/src/ui/commands/tasksCommand.test.js +30 -0
- package/dist/src/ui/commands/tasksCommand.test.js.map +1 -0
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +1 -1
- package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -1
- package/dist/src/ui/commands/themeCommand.d.ts +1 -1
- package/dist/src/ui/commands/themeCommand.js +1 -1
- package/dist/src/ui/commands/themeCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.js +43 -27
- package/dist/src/ui/commands/toolsCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.test.js +97 -10
- package/dist/src/ui/commands/toolsCommand.test.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +26 -5
- package/dist/src/ui/commands/types.js +4 -1
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/upgradeCommand.d.ts +11 -0
- package/dist/src/ui/commands/upgradeCommand.js +58 -0
- package/dist/src/ui/commands/upgradeCommand.js.map +1 -0
- package/dist/src/ui/commands/upgradeCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/upgradeCommand.test.js +102 -0
- package/dist/src/ui/commands/upgradeCommand.test.js.map +1 -0
- package/dist/src/ui/commands/vimCommand.d.ts +1 -1
- package/dist/src/ui/commands/vimCommand.js +1 -0
- package/dist/src/ui/commands/vimCommand.js.map +1 -1
- package/dist/src/ui/components/AboutBox.js +2 -2
- package/dist/src/ui/components/AboutBox.test.js +14 -10
- package/dist/src/ui/components/AboutBox.test.js.map +1 -1
- package/dist/src/ui/components/AdminSettingsChangedDialog.js +3 -1
- package/dist/src/ui/components/AdminSettingsChangedDialog.js.map +1 -1
- package/dist/src/ui/components/AdminSettingsChangedDialog.test.js +4 -4
- package/dist/src/ui/components/AdminSettingsChangedDialog.test.js.map +1 -1
- package/dist/src/ui/components/AgentConfigDialog.d.ts +4 -2
- package/dist/src/ui/components/AgentConfigDialog.js +25 -38
- package/dist/src/ui/components/AgentConfigDialog.js.map +1 -1
- package/dist/src/ui/components/AgentConfigDialog.test.js +52 -26
- package/dist/src/ui/components/AgentConfigDialog.test.js.map +1 -1
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.js +2 -4
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.js.map +1 -1
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +23 -18
- package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.js +7 -1
- package/dist/src/ui/components/AnsiOutput.js.map +1 -1
- package/dist/src/ui/components/AnsiOutput.test.js +40 -19
- package/dist/src/ui/components/AnsiOutput.test.js.map +1 -1
- package/dist/src/ui/components/AppHeader.d.ts +3 -2
- package/dist/src/ui/components/AppHeader.js +55 -8
- package/dist/src/ui/components/AppHeader.js.map +1 -1
- package/dist/src/ui/components/AppHeader.test.js +62 -40
- package/dist/src/ui/components/AppHeader.test.js.map +1 -1
- package/dist/src/ui/components/AppHeaderIcon.test.d.ts +6 -0
- package/dist/src/ui/components/AppHeaderIcon.test.js +39 -0
- package/dist/src/ui/components/AppHeaderIcon.test.js.map +1 -0
- package/dist/src/ui/components/ApprovalModeIndicator.d.ts +1 -1
- package/dist/src/ui/components/ApprovalModeIndicator.js +14 -10
- package/dist/src/ui/components/ApprovalModeIndicator.js.map +1 -1
- package/dist/src/ui/components/ApprovalModeIndicator.test.js +12 -12
- package/dist/src/ui/components/ApprovalModeIndicator.test.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +9 -6
- package/dist/src/ui/components/AsciiArt.js +24 -6
- package/dist/src/ui/components/AsciiArt.js.map +1 -1
- package/dist/src/ui/components/AskUserDialog.d.ts +5 -1
- package/dist/src/ui/components/AskUserDialog.js +126 -54
- package/dist/src/ui/components/AskUserDialog.js.map +1 -1
- package/dist/src/ui/components/AskUserDialog.test.js +394 -96
- package/dist/src/ui/components/AskUserDialog.test.js.map +1 -1
- package/dist/src/ui/components/BackgroundTaskDisplay.d.ts +16 -0
- package/dist/src/ui/components/{BackgroundShellDisplay.js → BackgroundTaskDisplay.js} +36 -19
- package/dist/src/ui/components/BackgroundTaskDisplay.js.map +1 -0
- package/dist/src/ui/components/{BackgroundShellDisplay.test.js → BackgroundTaskDisplay.test.js} +54 -66
- package/dist/src/ui/components/BackgroundTaskDisplay.test.js.map +1 -0
- package/dist/src/ui/components/Banner.js +4 -4
- package/dist/src/ui/components/Banner.js.map +1 -1
- package/dist/src/ui/components/Banner.test.js +12 -7
- package/dist/src/ui/components/Banner.test.js.map +1 -1
- package/dist/src/ui/components/BubblingRegression.test.js +3 -1
- package/dist/src/ui/components/BubblingRegression.test.js.map +1 -1
- package/dist/src/ui/components/Checklist.js +1 -1
- package/dist/src/ui/components/Checklist.js.map +1 -1
- package/dist/src/ui/components/Checklist.test.js +12 -12
- package/dist/src/ui/components/Checklist.test.js.map +1 -1
- package/dist/src/ui/components/ChecklistItem.d.ts +1 -1
- package/dist/src/ui/components/ChecklistItem.js +3 -0
- package/dist/src/ui/components/ChecklistItem.js.map +1 -1
- package/dist/src/ui/components/ChecklistItem.test.js +7 -6
- package/dist/src/ui/components/ChecklistItem.test.js.map +1 -1
- package/dist/src/ui/components/CliSpinner.test.js +8 -5
- package/dist/src/ui/components/CliSpinner.test.js.map +1 -1
- package/dist/src/ui/components/ColorsDisplay.d.ts +12 -0
- package/dist/src/ui/components/ColorsDisplay.js +119 -0
- package/dist/src/ui/components/ColorsDisplay.js.map +1 -0
- package/dist/src/ui/components/ColorsDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ColorsDisplay.test.js +107 -0
- package/dist/src/ui/components/ColorsDisplay.test.js.map +1 -0
- package/dist/src/ui/components/Composer.d.ts +1 -1
- package/dist/src/ui/components/Composer.js +53 -58
- package/dist/src/ui/components/Composer.js.map +1 -1
- package/dist/src/ui/components/Composer.test.js +436 -108
- package/dist/src/ui/components/Composer.test.js.map +1 -1
- package/dist/src/ui/components/ConfigExtensionDialog.js +2 -2
- package/dist/src/ui/components/ConfigExtensionDialog.js.map +1 -1
- package/dist/src/ui/components/ConfigInitDisplay.js +4 -4
- package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -1
- package/dist/src/ui/components/ConfigInitDisplay.test.js +7 -7
- package/dist/src/ui/components/ConfigInitDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ConsentPrompt.js +5 -4
- package/dist/src/ui/components/ConsentPrompt.js.map +1 -1
- package/dist/src/ui/components/ConsentPrompt.test.js +10 -8
- package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.test.js +7 -5
- package/dist/src/ui/components/ConsoleSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +5 -10
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.test.js +9 -30
- package/dist/src/ui/components/ContextSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.js +17 -5
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.test.js +26 -19
- package/dist/src/ui/components/ContextUsageDisplay.test.js.map +1 -1
- package/dist/src/ui/components/CopyModeWarning.js +3 -6
- package/dist/src/ui/components/CopyModeWarning.js.map +1 -1
- package/dist/src/ui/components/CopyModeWarning.test.js +14 -12
- package/dist/src/ui/components/CopyModeWarning.test.js.map +1 -1
- package/dist/src/ui/components/DebugProfiler.js +12 -0
- package/dist/src/ui/components/DebugProfiler.js.map +1 -1
- package/dist/src/ui/components/DebugProfiler.test.js +13 -14
- package/dist/src/ui/components/DebugProfiler.test.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +0 -2
- package/dist/src/ui/components/DetailedMessagesDisplay.js +12 -7
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js +50 -9
- package/dist/src/ui/components/DetailedMessagesDisplay.test.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +25 -9
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/DialogManager.test.js +11 -5
- package/dist/src/ui/components/DialogManager.test.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.js +2 -3
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/EditorSettingsDialog.test.js +13 -11
- package/dist/src/ui/components/EditorSettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/EmptyWalletDialog.d.ts +22 -0
- package/dist/src/ui/components/EmptyWalletDialog.js +33 -0
- package/dist/src/ui/components/EmptyWalletDialog.js.map +1 -0
- package/dist/src/ui/components/EmptyWalletDialog.test.d.ts +6 -0
- package/dist/src/ui/components/EmptyWalletDialog.test.js +116 -0
- package/dist/src/ui/components/EmptyWalletDialog.test.js.map +1 -0
- package/dist/src/ui/components/ExitPlanModeDialog.d.ts +2 -1
- package/dist/src/ui/components/ExitPlanModeDialog.js +49 -9
- package/dist/src/ui/components/ExitPlanModeDialog.js.map +1 -1
- package/dist/src/ui/components/ExitPlanModeDialog.test.js +81 -37
- package/dist/src/ui/components/ExitPlanModeDialog.test.js.map +1 -1
- package/dist/src/ui/components/ExitWarning.test.js +14 -10
- package/dist/src/ui/components/ExitWarning.test.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.d.ts +2 -0
- package/dist/src/ui/components/FolderTrustDialog.js +52 -7
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/FolderTrustDialog.test.js +256 -23
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +13 -0
- package/dist/src/ui/components/Footer.js +228 -14
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Footer.test.js +547 -109
- package/dist/src/ui/components/Footer.test.js.map +1 -1
- package/dist/src/ui/components/FooterConfigDialog.d.ts +11 -0
- package/dist/src/ui/components/FooterConfigDialog.js +214 -0
- package/dist/src/ui/components/FooterConfigDialog.js.map +1 -0
- package/dist/src/ui/components/FooterConfigDialog.test.d.ts +6 -0
- package/dist/src/ui/components/FooterConfigDialog.test.js +191 -0
- package/dist/src/ui/components/FooterConfigDialog.test.js.map +1 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +6 -5
- package/dist/src/ui/components/GeminiRespondingSpinner.js +6 -35
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js +23 -19
- package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +1 -1
- package/dist/src/ui/components/GeminiSpinner.d.ts +13 -0
- package/dist/src/ui/components/GeminiSpinner.js +35 -0
- package/dist/src/ui/components/GeminiSpinner.js.map +1 -0
- package/dist/src/ui/components/GradientRegression.test.js +22 -11
- package/dist/src/ui/components/GradientRegression.test.js.map +1 -1
- package/dist/src/ui/components/Header.test.js +16 -12
- package/dist/src/ui/components/Header.test.js.map +1 -1
- package/dist/src/ui/components/Help.js +3 -3
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/Help.test.js +8 -8
- package/dist/src/ui/components/Help.test.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +5 -3
- package/dist/src/ui/components/HistoryItemDisplay.js +15 -12
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.js +95 -44
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -1
- package/dist/src/ui/components/HookStatusDisplay.js +18 -11
- package/dist/src/ui/components/HookStatusDisplay.js.map +1 -1
- package/dist/src/ui/components/HookStatusDisplay.test.js +35 -9
- package/dist/src/ui/components/HookStatusDisplay.test.js.map +1 -1
- package/dist/src/ui/components/HooksDialog.d.ts +36 -0
- package/dist/src/ui/components/HooksDialog.js +83 -0
- package/dist/src/ui/components/HooksDialog.js.map +1 -0
- package/dist/src/ui/components/HooksDialog.test.d.ts +6 -0
- package/dist/src/ui/components/HooksDialog.test.js +175 -0
- package/dist/src/ui/components/HooksDialog.test.js.map +1 -0
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js +39 -19
- package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +12 -8
- package/dist/src/ui/components/InputPrompt.js +383 -180
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.d.ts +12 -1
- package/dist/src/ui/components/InputPrompt.test.js +701 -239
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.d.ts +7 -0
- package/dist/src/ui/components/LoadingIndicator.js +18 -13
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.test.js +170 -60
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/components/LogoutConfirmationDialog.js +3 -3
- package/dist/src/ui/components/LogoutConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/LogoutConfirmationDialog.test.js +23 -12
- package/dist/src/ui/components/LogoutConfirmationDialog.test.js.map +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.js +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -1
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js +7 -5
- package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -1
- package/dist/src/ui/components/MainContent.d.ts +1 -1
- package/dist/src/ui/components/MainContent.js +144 -29
- package/dist/src/ui/components/MainContent.js.map +1 -1
- package/dist/src/ui/components/MainContent.test.js +558 -27
- package/dist/src/ui/components/MainContent.test.js.map +1 -1
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +4 -1
- package/dist/src/ui/components/MemoryUsageDisplay.js +10 -9
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -1
- package/dist/src/ui/components/MemoryUsageDisplay.test.js +6 -3
- package/dist/src/ui/components/MemoryUsageDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.js +131 -21
- package/dist/src/ui/components/ModelDialog.js.map +1 -1
- package/dist/src/ui/components/ModelDialog.test.js +148 -35
- package/dist/src/ui/components/ModelDialog.test.js.map +1 -1
- package/dist/src/ui/components/ModelQuotaDisplay.d.ts +18 -0
- package/dist/src/ui/components/ModelQuotaDisplay.js +104 -0
- package/dist/src/ui/components/ModelQuotaDisplay.js.map +1 -0
- package/dist/src/ui/components/ModelQuotaDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/ModelQuotaDisplay.test.js +62 -0
- package/dist/src/ui/components/ModelQuotaDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.js +56 -4
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -1
- package/dist/src/ui/components/ModelStatsDisplay.test.js +212 -20
- package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.d.ts +1 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.js +2 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.js.map +1 -1
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js +24 -9
- package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/NewAgentsNotification.d.ts +1 -1
- package/dist/src/ui/components/NewAgentsNotification.js +17 -1
- package/dist/src/ui/components/NewAgentsNotification.js.map +1 -1
- package/dist/src/ui/components/NewAgentsNotification.test.js +39 -4
- package/dist/src/ui/components/NewAgentsNotification.test.js.map +1 -1
- package/dist/src/ui/components/Notifications.js +50 -4
- package/dist/src/ui/components/Notifications.js.map +1 -1
- package/dist/src/ui/components/Notifications.test.js +160 -36
- package/dist/src/ui/components/Notifications.test.js.map +1 -1
- package/dist/src/ui/components/OverageMenuDialog.d.ts +22 -0
- package/dist/src/ui/components/OverageMenuDialog.js +32 -0
- package/dist/src/ui/components/OverageMenuDialog.js.map +1 -0
- package/dist/src/ui/components/OverageMenuDialog.test.d.ts +6 -0
- package/dist/src/ui/components/OverageMenuDialog.test.js +118 -0
- package/dist/src/ui/components/OverageMenuDialog.test.js.map +1 -0
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +31 -12
- package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -1
- package/dist/src/ui/components/PolicyUpdateDialog.d.ts +18 -0
- package/dist/src/ui/components/PolicyUpdateDialog.js +61 -0
- package/dist/src/ui/components/PolicyUpdateDialog.js.map +1 -0
- package/dist/src/ui/components/PolicyUpdateDialog.test.d.ts +6 -0
- package/dist/src/ui/components/PolicyUpdateDialog.test.js +92 -0
- package/dist/src/ui/components/PolicyUpdateDialog.test.js.map +1 -0
- package/dist/src/ui/components/ProQuotaDialog.d.ts +4 -1
- package/dist/src/ui/components/ProQuotaDialog.js +13 -6
- package/dist/src/ui/components/ProQuotaDialog.js.map +1 -1
- package/dist/src/ui/components/ProQuotaDialog.test.js +53 -22
- package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -1
- package/dist/src/ui/components/ProgressBar.d.ts +13 -0
- package/dist/src/ui/components/ProgressBar.js +17 -0
- package/dist/src/ui/components/ProgressBar.js.map +1 -0
- package/dist/src/ui/components/ProgressBar.test.d.ts +6 -0
- package/dist/src/ui/components/ProgressBar.test.js +28 -0
- package/dist/src/ui/components/ProgressBar.test.js.map +1 -0
- package/dist/src/ui/components/QueuedMessageDisplay.test.js +11 -11
- package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -1
- package/dist/src/ui/components/QuittingDisplay.test.js +7 -5
- package/dist/src/ui/components/QuittingDisplay.test.js.map +1 -1
- package/dist/src/ui/components/QuotaDisplay.d.ts +2 -0
- package/dist/src/ui/components/QuotaDisplay.js +23 -14
- package/dist/src/ui/components/QuotaDisplay.js.map +1 -1
- package/dist/src/ui/components/QuotaDisplay.test.js +41 -23
- package/dist/src/ui/components/QuotaDisplay.test.js.map +1 -1
- package/dist/src/ui/components/QuotaStatsInfo.js +13 -9
- package/dist/src/ui/components/QuotaStatsInfo.js.map +1 -1
- package/dist/src/ui/components/RatingWidget.js +2 -2
- package/dist/src/ui/components/RatingWidget.js.map +1 -1
- package/dist/src/ui/components/RawMarkdownIndicator.js +3 -1
- package/dist/src/ui/components/RawMarkdownIndicator.js.map +1 -1
- package/dist/src/ui/components/RawMarkdownIndicator.test.js +11 -7
- package/dist/src/ui/components/RawMarkdownIndicator.test.js.map +1 -1
- package/dist/src/ui/components/RewindConfirmation.js +11 -3
- package/dist/src/ui/components/RewindConfirmation.js.map +1 -1
- package/dist/src/ui/components/RewindConfirmation.test.js +11 -7
- package/dist/src/ui/components/RewindConfirmation.test.js.map +1 -1
- package/dist/src/ui/components/RewindViewer.js +32 -9
- package/dist/src/ui/components/RewindViewer.js.map +1 -1
- package/dist/src/ui/components/RewindViewer.test.js +90 -18
- package/dist/src/ui/components/RewindViewer.test.js.map +1 -1
- package/dist/src/ui/components/SessionBrowser/SessionBrowserEmpty.d.ts +10 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserEmpty.js +8 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserEmpty.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserError.d.ts +13 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserError.js +8 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserError.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserLoading.d.ts +10 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserLoading.js +8 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserLoading.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserNav.d.ts +23 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserNav.js +17 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserNav.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserSearchNav.test.d.ts +6 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserSearchNav.test.js +47 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserSearchNav.test.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserStates.test.d.ts +6 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserStates.test.js +27 -0
- package/dist/src/ui/components/SessionBrowser/SessionBrowserStates.test.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser/SessionListHeader.d.ts +13 -0
- package/dist/src/ui/components/SessionBrowser/SessionListHeader.js +8 -0
- package/dist/src/ui/components/SessionBrowser/SessionListHeader.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser/utils.d.ts +33 -0
- package/dist/src/ui/components/SessionBrowser/utils.js +100 -0
- package/dist/src/ui/components/SessionBrowser/utils.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser/utils.test.d.ts +6 -0
- package/dist/src/ui/components/SessionBrowser/utils.test.js +108 -0
- package/dist/src/ui/components/SessionBrowser/utils.test.js.map +1 -0
- package/dist/src/ui/components/SessionBrowser.js +13 -128
- package/dist/src/ui/components/SessionBrowser.js.map +1 -1
- package/dist/src/ui/components/SessionBrowser.test.js +22 -13
- package/dist/src/ui/components/SessionBrowser.test.js.map +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.js +17 -1
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.test.js +118 -20
- package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +1 -5
- package/dist/src/ui/components/SettingsDialog.js +120 -329
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.test.js +366 -212
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/ShellInputPrompt.js +11 -3
- package/dist/src/ui/components/ShellInputPrompt.js.map +1 -1
- package/dist/src/ui/components/ShellInputPrompt.test.js +111 -67
- package/dist/src/ui/components/ShellInputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/ShellModeIndicator.test.js +3 -2
- package/dist/src/ui/components/ShellModeIndicator.test.js.map +1 -1
- package/dist/src/ui/components/ShortcutsHelp.js +46 -17
- package/dist/src/ui/components/ShortcutsHelp.js.map +1 -1
- package/dist/src/ui/components/ShortcutsHelp.test.js +11 -3
- package/dist/src/ui/components/ShortcutsHelp.test.js.map +1 -1
- package/dist/src/ui/components/ShowMoreLines.d.ts +2 -1
- package/dist/src/ui/components/ShowMoreLines.js +7 -5
- package/dist/src/ui/components/ShowMoreLines.js.map +1 -1
- package/dist/src/ui/components/ShowMoreLines.test.js +42 -7
- package/dist/src/ui/components/ShowMoreLines.test.js.map +1 -1
- package/dist/src/ui/components/ShowMoreLinesLayout.test.d.ts +1 -0
- package/dist/src/ui/components/ShowMoreLinesLayout.test.js +67 -0
- package/dist/src/ui/components/ShowMoreLinesLayout.test.js.map +1 -0
- package/dist/src/ui/components/StatsDisplay.d.ts +4 -2
- package/dist/src/ui/components/StatsDisplay.js +58 -88
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.test.js +109 -166
- package/dist/src/ui/components/StatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/StatusDisplay.d.ts +1 -2
- package/dist/src/ui/components/StatusDisplay.js +1 -6
- package/dist/src/ui/components/StatusDisplay.js.map +1 -1
- package/dist/src/ui/components/StatusDisplay.test.js +37 -24
- package/dist/src/ui/components/StatusDisplay.test.js.map +1 -1
- package/dist/src/ui/components/StatusRow.d.ts +32 -0
- package/dist/src/ui/components/StatusRow.js +180 -0
- package/dist/src/ui/components/StatusRow.js.map +1 -0
- package/dist/src/ui/components/StatusRow.test.d.ts +6 -0
- package/dist/src/ui/components/StatusRow.test.js +99 -0
- package/dist/src/ui/components/StatusRow.test.js.map +1 -0
- package/dist/src/ui/components/StickyHeader.test.js +3 -2
- package/dist/src/ui/components/StickyHeader.test.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +3 -0
- package/dist/src/ui/components/SuggestionsDisplay.js +9 -5
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.test.js +39 -13
- package/dist/src/ui/components/SuggestionsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/Table.test.js +26 -8
- package/dist/src/ui/components/Table.test.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.d.ts +1 -1
- package/dist/src/ui/components/ThemeDialog.js +31 -32
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.test.js +48 -24
- package/dist/src/ui/components/ThemeDialog.test.js.map +1 -1
- package/dist/src/ui/components/ThemedGradient.test.js +7 -2
- package/dist/src/ui/components/ThemedGradient.test.js.map +1 -1
- package/dist/src/ui/components/Tips.d.ts +1 -1
- package/dist/src/ui/components/Tips.js +1 -1
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/Tips.test.d.ts +1 -1
- package/dist/src/ui/components/Tips.test.js +8 -8
- package/dist/src/ui/components/Tips.test.js.map +1 -1
- package/dist/src/ui/components/ToastDisplay.d.ts +2 -1
- package/dist/src/ui/components/ToastDisplay.js +13 -6
- package/dist/src/ui/components/ToastDisplay.js.map +1 -1
- package/dist/src/ui/components/ToastDisplay.test.js +69 -34
- package/dist/src/ui/components/ToastDisplay.test.js.map +1 -1
- package/dist/src/ui/components/ToolConfirmationQueue.js +34 -19
- package/dist/src/ui/components/ToolConfirmationQueue.js.map +1 -1
- package/dist/src/ui/components/ToolConfirmationQueue.test.js +276 -50
- package/dist/src/ui/components/ToolConfirmationQueue.test.js.map +1 -1
- package/dist/src/ui/components/ToolStatsDisplay.test.js +19 -12
- package/dist/src/ui/components/ToolStatsDisplay.test.js.map +1 -1
- package/dist/src/ui/components/UpdateNotification.test.js +3 -2
- package/dist/src/ui/components/UpdateNotification.test.js.map +1 -1
- package/dist/src/ui/components/UserIdentity.d.ts +1 -1
- package/dist/src/ui/components/UserIdentity.js +14 -11
- package/dist/src/ui/components/UserIdentity.js.map +1 -1
- package/dist/src/ui/components/UserIdentity.test.d.ts +1 -1
- package/dist/src/ui/components/UserIdentity.test.js +60 -17
- package/dist/src/ui/components/UserIdentity.test.js.map +1 -1
- package/dist/src/ui/components/ValidationDialog.js +4 -2
- package/dist/src/ui/components/ValidationDialog.js.map +1 -1
- package/dist/src/ui/components/ValidationDialog.test.js +25 -16
- package/dist/src/ui/components/ValidationDialog.test.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.test.js +91 -102
- package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/DenseToolMessage.d.ts +13 -0
- package/dist/src/ui/components/messages/DenseToolMessage.js +270 -0
- package/dist/src/ui/components/messages/DenseToolMessage.js.map +1 -0
- package/dist/src/ui/components/messages/DenseToolMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/DenseToolMessage.test.js +383 -0
- package/dist/src/ui/components/messages/DenseToolMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +18 -0
- package/dist/src/ui/components/messages/DiffRenderer.js +55 -35
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.js +46 -17
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -1
- package/dist/src/ui/components/messages/ErrorMessage.test.js +6 -4
- package/dist/src/ui/components/messages/ErrorMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.js +3 -6
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessage.test.js +15 -4
- package/dist/src/ui/components/messages/GeminiMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessageContent.js +4 -7
- package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -1
- package/dist/src/ui/components/messages/HintMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/HintMessage.js +14 -0
- package/dist/src/ui/components/messages/HintMessage.js.map +1 -0
- package/dist/src/ui/components/messages/InfoMessage.d.ts +3 -0
- package/dist/src/ui/components/messages/InfoMessage.js +2 -2
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -1
- package/dist/src/ui/components/messages/InfoMessage.test.js +9 -6
- package/dist/src/ui/components/messages/InfoMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/RedirectionConfirmation.test.js +6 -4
- package/dist/src/ui/components/messages/RedirectionConfirmation.test.js.map +1 -1
- package/dist/src/ui/components/messages/ShellToolMessage.d.ts +2 -3
- package/dist/src/ui/components/messages/ShellToolMessage.js +37 -29
- package/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ShellToolMessage.test.js +140 -55
- package/dist/src/ui/components/messages/ShellToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/SubagentGroupDisplay.d.ts +17 -0
- package/dist/src/ui/components/messages/SubagentGroupDisplay.js +139 -0
- package/dist/src/ui/components/messages/SubagentGroupDisplay.js.map +1 -0
- package/dist/src/ui/components/messages/SubagentGroupDisplay.test.d.ts +1 -0
- package/dist/src/ui/components/messages/SubagentGroupDisplay.test.js +91 -0
- package/dist/src/ui/components/messages/SubagentGroupDisplay.test.js.map +1 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.d.ts +13 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.js +4 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.js.map +1 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.test.js +68 -0
- package/dist/src/ui/components/messages/SubagentHistoryMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/SubagentProgressDisplay.d.ts +14 -0
- package/dist/src/ui/components/messages/SubagentProgressDisplay.js +79 -0
- package/dist/src/ui/components/messages/SubagentProgressDisplay.js.map +1 -0
- package/dist/src/ui/components/messages/SubagentProgressDisplay.test.js +163 -0
- package/dist/src/ui/components/messages/SubagentProgressDisplay.test.js.map +1 -0
- package/dist/src/ui/components/messages/ThinkingMessage.d.ts +2 -0
- package/dist/src/ui/components/messages/ThinkingMessage.js +26 -25
- package/dist/src/ui/components/messages/ThinkingMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ThinkingMessage.test.js +81 -22
- package/dist/src/ui/components/messages/ThinkingMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/Todo.js +5 -3
- package/dist/src/ui/components/messages/Todo.js.map +1 -1
- package/dist/src/ui/components/messages/Todo.test.js +35 -21
- package/dist/src/ui/components/messages/Todo.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +4 -2
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +357 -81
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +296 -31
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.compact.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.compact.test.js +147 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.compact.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +6 -5
- package/dist/src/ui/components/messages/ToolGroupMessage.js +275 -86
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +495 -293
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessageRegression.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolGroupMessageRegression.test.js +101 -0
- package/dist/src/ui/components/messages/ToolGroupMessageRegression.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.js +7 -4
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +158 -43
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js +15 -8
- package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js +15 -5
- package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.js +88 -0
- package/dist/src/ui/components/messages/ToolOverflowConsistencyChecks.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.d.ts +1 -0
- package/dist/src/ui/components/messages/ToolResultDisplay.js +108 -88
- package/dist/src/ui/components/messages/ToolResultDisplay.js.map +1 -1
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js +193 -55
- package/dist/src/ui/components/messages/ToolResultDisplay.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolResultDisplayOverflow.test.js +63 -39
- package/dist/src/ui/components/messages/ToolResultDisplayOverflow.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolShared.d.ts +15 -6
- package/dist/src/ui/components/messages/ToolShared.js +45 -26
- package/dist/src/ui/components/messages/ToolShared.js.map +1 -1
- package/dist/src/ui/components/messages/ToolShared.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolShared.test.js +47 -0
- package/dist/src/ui/components/messages/ToolShared.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js +17 -10
- package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js.map +1 -1
- package/dist/src/ui/components/messages/TopicMessage.d.ts +15 -0
- package/dist/src/ui/components/messages/TopicMessage.js +56 -0
- package/dist/src/ui/components/messages/TopicMessage.js.map +1 -0
- package/dist/src/ui/components/messages/TopicMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/TopicMessage.test.js +77 -0
- package/dist/src/ui/components/messages/TopicMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/UserMessage.js +2 -3
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
- package/dist/src/ui/components/messages/UserMessage.test.js +12 -8
- package/dist/src/ui/components/messages/UserMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/UserShellMessage.js +1 -2
- package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -1
- package/dist/src/ui/components/messages/WarningMessage.test.js +6 -4
- package/dist/src/ui/components/messages/WarningMessage.test.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSelectionList.d.ts +3 -2
- package/dist/src/ui/components/shared/BaseSelectionList.js +25 -20
- package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSelectionList.test.js +140 -113
- package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSettingsDialog.d.ts +16 -5
- package/dist/src/ui/components/shared/BaseSettingsDialog.js +130 -170
- package/dist/src/ui/components/shared/BaseSettingsDialog.js.map +1 -1
- package/dist/src/ui/components/shared/BaseSettingsDialog.test.js +244 -48
- package/dist/src/ui/components/shared/BaseSettingsDialog.test.js.map +1 -1
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +16 -6
- package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -1
- package/dist/src/ui/components/shared/DialogFooter.d.ts +3 -1
- package/dist/src/ui/components/shared/DialogFooter.js +2 -1
- package/dist/src/ui/components/shared/DialogFooter.js.map +1 -1
- package/dist/src/ui/components/shared/EnumSelector.js +0 -5
- package/dist/src/ui/components/shared/EnumSelector.js.map +1 -1
- package/dist/src/ui/components/shared/EnumSelector.test.js +33 -20
- package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -1
- package/dist/src/ui/components/shared/ExpandableText.test.js +28 -23
- package/dist/src/ui/components/shared/ExpandableText.test.js.map +1 -1
- package/dist/src/ui/components/shared/HalfLinePaddedBox.js +3 -2
- package/dist/src/ui/components/shared/HalfLinePaddedBox.js.map +1 -1
- package/dist/src/ui/components/shared/HalfLinePaddedBox.test.js +4 -4
- package/dist/src/ui/components/shared/HalfLinePaddedBox.test.js.map +1 -1
- package/dist/src/ui/components/shared/HorizontalLine.d.ts +1 -0
- package/dist/src/ui/components/shared/HorizontalLine.js +1 -1
- package/dist/src/ui/components/shared/HorizontalLine.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.d.ts +2 -2
- package/dist/src/ui/components/shared/MaxSizedBox.js +18 -6
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +90 -32
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.js +2 -2
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +22 -11
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -1
- package/dist/src/ui/components/shared/Scrollable.d.ts +5 -1
- package/dist/src/ui/components/shared/Scrollable.js +103 -45
- package/dist/src/ui/components/shared/Scrollable.js.map +1 -1
- package/dist/src/ui/components/shared/Scrollable.test.js +41 -36
- package/dist/src/ui/components/shared/Scrollable.test.js.map +1 -1
- package/dist/src/ui/components/shared/ScrollableList.d.ts +9 -12
- package/dist/src/ui/components/shared/ScrollableList.js +20 -13
- package/dist/src/ui/components/shared/ScrollableList.js.map +1 -1
- package/dist/src/ui/components/shared/ScrollableList.test.js +213 -22
- package/dist/src/ui/components/shared/ScrollableList.test.js.map +1 -1
- package/dist/src/ui/components/shared/SearchableList.d.ts +61 -0
- package/dist/src/ui/components/shared/SearchableList.js +86 -0
- package/dist/src/ui/components/shared/SearchableList.js.map +1 -0
- package/dist/src/ui/components/shared/SearchableList.test.js +169 -0
- package/dist/src/ui/components/shared/SearchableList.test.js.map +1 -0
- package/dist/src/ui/components/shared/SectionHeader.d.ts +1 -0
- package/dist/src/ui/components/shared/SectionHeader.js +1 -1
- package/dist/src/ui/components/shared/SectionHeader.js.map +1 -1
- package/dist/src/ui/components/shared/SectionHeader.test.js +8 -2
- package/dist/src/ui/components/shared/SectionHeader.test.js.map +1 -1
- package/dist/src/ui/components/shared/SlicingMaxSizedBox.d.ts +18 -0
- package/dist/src/ui/components/shared/SlicingMaxSizedBox.js +75 -0
- package/dist/src/ui/components/shared/SlicingMaxSizedBox.js.map +1 -0
- package/dist/src/ui/components/shared/SlicingMaxSizedBox.test.d.ts +6 -0
- package/dist/src/ui/components/shared/SlicingMaxSizedBox.test.js +53 -0
- package/dist/src/ui/components/shared/SlicingMaxSizedBox.test.js.map +1 -0
- package/dist/src/ui/components/shared/TabHeader.js +1 -1
- package/dist/src/ui/components/shared/TabHeader.js.map +1 -1
- package/dist/src/ui/components/shared/TabHeader.test.js +52 -25
- package/dist/src/ui/components/shared/TabHeader.test.js.map +1 -1
- package/dist/src/ui/components/shared/TextInput.d.ts +1 -1
- package/dist/src/ui/components/shared/TextInput.js +7 -3
- package/dist/src/ui/components/shared/TextInput.js.map +1 -1
- package/dist/src/ui/components/shared/TextInput.test.js +144 -66
- package/dist/src/ui/components/shared/TextInput.test.js.map +1 -1
- package/dist/src/ui/components/shared/VirtualizedList.d.ts +13 -1
- package/dist/src/ui/components/shared/VirtualizedList.js +269 -113
- package/dist/src/ui/components/shared/VirtualizedList.js.map +1 -1
- package/dist/src/ui/components/shared/VirtualizedList.test.js +30 -51
- package/dist/src/ui/components/shared/VirtualizedList.test.js.map +1 -1
- package/dist/src/ui/components/shared/performance.test.js +4 -4
- package/dist/src/ui/components/shared/performance.test.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +172 -2
- package/dist/src/ui/components/shared/text-buffer.js +228 -64
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.test.js +382 -275
- package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +42 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js +673 -32
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.test.js +1296 -42
- package/dist/src/ui/components/shared/vim-buffer-actions.test.js.map +1 -1
- package/dist/src/ui/components/triage/TriageDuplicates.d.ts +1 -1
- package/dist/src/ui/components/triage/TriageDuplicates.js +6 -2
- package/dist/src/ui/components/triage/TriageDuplicates.js.map +1 -1
- package/dist/src/ui/components/triage/TriageIssues.d.ts +1 -1
- package/dist/src/ui/components/triage/TriageIssues.js +6 -2
- package/dist/src/ui/components/triage/TriageIssues.js.map +1 -1
- package/dist/src/ui/components/views/ChatList.test.js +6 -6
- package/dist/src/ui/components/views/ChatList.test.js.map +1 -1
- package/dist/src/ui/components/views/ExtensionDetails.d.ts +18 -0
- package/dist/src/ui/components/views/ExtensionDetails.js +85 -0
- package/dist/src/ui/components/views/ExtensionDetails.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionDetails.test.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionDetails.test.js +154 -0
- package/dist/src/ui/components/views/ExtensionDetails.test.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.d.ts +15 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.js +97 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.test.d.ts +6 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.test.js +222 -0
- package/dist/src/ui/components/views/ExtensionRegistryView.test.js.map +1 -0
- package/dist/src/ui/components/views/ExtensionsList.test.js +16 -19
- package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.d.ts +2 -2
- package/dist/src/ui/components/views/McpStatus.js +8 -3
- package/dist/src/ui/components/views/McpStatus.js.map +1 -1
- package/dist/src/ui/components/views/McpStatus.test.js +47 -26
- package/dist/src/ui/components/views/McpStatus.test.js.map +1 -1
- package/dist/src/ui/components/views/SkillsList.js +2 -1
- package/dist/src/ui/components/views/SkillsList.js.map +1 -1
- package/dist/src/ui/components/views/SkillsList.test.js +15 -13
- package/dist/src/ui/components/views/SkillsList.test.js.map +1 -1
- package/dist/src/ui/components/views/ToolsList.test.js +6 -6
- package/dist/src/ui/components/views/ToolsList.test.js.map +1 -1
- package/dist/src/ui/constants/tips.js +81 -82
- package/dist/src/ui/constants/tips.js.map +1 -1
- package/dist/src/ui/constants/wittyPhrases.js +107 -107
- package/dist/src/ui/constants/wittyPhrases.js.map +1 -1
- package/dist/src/ui/constants.d.ts +14 -1
- package/dist/src/ui/constants.js +24 -1
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/AppContext.d.ts +2 -1
- package/dist/src/ui/contexts/AppContext.js.map +1 -1
- package/dist/src/ui/contexts/InputContext.d.ts +17 -0
- package/dist/src/ui/contexts/InputContext.js +15 -0
- package/dist/src/ui/contexts/InputContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.d.ts +8 -3
- package/dist/src/ui/contexts/KeypressContext.js +196 -45
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/KeypressContext.test.js +200 -76
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -1
- package/dist/src/ui/contexts/MouseContext.d.ts +1 -2
- package/dist/src/ui/contexts/MouseContext.js +7 -3
- package/dist/src/ui/contexts/MouseContext.js.map +1 -1
- package/dist/src/ui/contexts/MouseContext.test.js +32 -21
- package/dist/src/ui/contexts/MouseContext.test.js.map +1 -1
- package/dist/src/ui/contexts/OverflowContext.d.ts +3 -3
- package/dist/src/ui/contexts/OverflowContext.js +49 -20
- package/dist/src/ui/contexts/OverflowContext.js.map +1 -1
- package/dist/src/ui/contexts/ScrollProvider.drag.test.js +6 -6
- package/dist/src/ui/contexts/ScrollProvider.drag.test.js.map +1 -1
- package/dist/src/ui/contexts/ScrollProvider.js +25 -3
- package/dist/src/ui/contexts/ScrollProvider.js.map +1 -1
- package/dist/src/ui/contexts/ScrollProvider.test.js +111 -11
- package/dist/src/ui/contexts/ScrollProvider.test.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +2 -2
- package/dist/src/ui/contexts/SessionContext.js +10 -0
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.test.js +26 -11
- package/dist/src/ui/contexts/SessionContext.test.js.map +1 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +9 -1
- package/dist/src/ui/contexts/SettingsContext.js +34 -1
- package/dist/src/ui/contexts/SettingsContext.js.map +1 -1
- package/dist/src/ui/contexts/SettingsContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/SettingsContext.test.js +106 -0
- package/dist/src/ui/contexts/SettingsContext.test.js.map +1 -0
- package/dist/src/ui/contexts/TerminalContext.d.ts +1 -0
- package/dist/src/ui/contexts/TerminalContext.js +15 -2
- package/dist/src/ui/contexts/TerminalContext.js.map +1 -1
- package/dist/src/ui/contexts/TerminalContext.test.js +24 -10
- package/dist/src/ui/contexts/TerminalContext.test.js.map +1 -1
- package/dist/src/ui/contexts/ToolActionsContext.d.ts +6 -0
- package/dist/src/ui/contexts/ToolActionsContext.js +28 -18
- package/dist/src/ui/contexts/ToolActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/ToolActionsContext.test.js +136 -56
- package/dist/src/ui/contexts/ToolActionsContext.test.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +20 -5
- package/dist/src/ui/contexts/UIActionsContext.js +1 -1
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +51 -19
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/contexts/VimModeContext.d.ts +1 -3
- package/dist/src/ui/contexts/VimModeContext.js +7 -16
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +15 -5
- package/dist/src/ui/hooks/atCommandProcessor.js +47 -18
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +92 -14
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor_agents.test.js +2 -1
- package/dist/src/ui/hooks/atCommandProcessor_agents.test.js.map +1 -1
- package/dist/src/ui/hooks/creditsFlowHandler.d.ts +35 -0
- package/dist/src/ui/hooks/creditsFlowHandler.js +158 -0
- package/dist/src/ui/hooks/creditsFlowHandler.js.map +1 -0
- package/dist/src/ui/hooks/creditsFlowHandler.test.d.ts +6 -0
- package/dist/src/ui/hooks/creditsFlowHandler.test.js +211 -0
- package/dist/src/ui/hooks/creditsFlowHandler.test.js.map +1 -0
- package/dist/src/ui/hooks/shell-completions/gitProvider.d.ts +7 -0
- package/dist/src/ui/hooks/shell-completions/gitProvider.js +73 -0
- package/dist/src/ui/hooks/shell-completions/gitProvider.js.map +1 -0
- package/dist/src/ui/hooks/shell-completions/gitProvider.test.d.ts +6 -0
- package/dist/src/ui/hooks/shell-completions/gitProvider.test.js +73 -0
- package/dist/src/ui/hooks/shell-completions/gitProvider.test.js.map +1 -0
- package/dist/src/ui/hooks/shell-completions/index.d.ts +7 -0
- package/dist/src/ui/hooks/shell-completions/index.js +16 -0
- package/dist/src/ui/hooks/shell-completions/index.js.map +1 -0
- package/dist/src/ui/hooks/shell-completions/npmProvider.d.ts +7 -0
- package/dist/src/ui/hooks/shell-completions/npmProvider.js +67 -0
- package/dist/src/ui/hooks/shell-completions/npmProvider.js.map +1 -0
- package/dist/src/ui/hooks/shell-completions/npmProvider.test.d.ts +6 -0
- package/dist/src/ui/hooks/shell-completions/npmProvider.test.js +69 -0
- package/dist/src/ui/hooks/shell-completions/npmProvider.test.js.map +1 -0
- package/dist/src/ui/hooks/shell-completions/types.d.ts +16 -0
- package/dist/src/ui/hooks/shell-completions/types.js +7 -0
- package/dist/src/ui/hooks/shell-completions/types.js.map +1 -0
- package/dist/src/ui/hooks/shellReducer.d.ts +12 -10
- package/dist/src/ui/hooks/shellReducer.js +67 -37
- package/dist/src/ui/hooks/shellReducer.js.map +1 -1
- package/dist/src/ui/hooks/shellReducer.test.js +207 -36
- package/dist/src/ui/hooks/shellReducer.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +38 -17
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.test.js +39 -83
- package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/toolMapping.d.ts +4 -3
- package/dist/src/ui/hooks/toolMapping.js +34 -32
- package/dist/src/ui/hooks/toolMapping.js.map +1 -1
- package/dist/src/ui/hooks/toolMapping.test.js +94 -27
- package/dist/src/ui/hooks/toolMapping.test.js.map +1 -1
- package/dist/src/ui/hooks/useAlternateBuffer.d.ts +2 -2
- package/dist/src/ui/hooks/useAlternateBuffer.js +10 -4
- package/dist/src/ui/hooks/useAlternateBuffer.js.map +1 -1
- package/dist/src/ui/hooks/useAlternateBuffer.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAlternateBuffer.test.js +62 -0
- package/dist/src/ui/hooks/useAlternateBuffer.test.js.map +1 -0
- package/dist/src/ui/hooks/useAnimatedScrollbar.js +15 -5
- package/dist/src/ui/hooks/useAnimatedScrollbar.js.map +1 -1
- package/dist/src/ui/hooks/useAnimatedScrollbar.test.js +12 -12
- package/dist/src/ui/hooks/useAnimatedScrollbar.test.js.map +1 -1
- package/dist/src/ui/hooks/useApprovalModeIndicator.d.ts +3 -2
- package/dist/src/ui/hooks/useApprovalModeIndicator.js +5 -3
- package/dist/src/ui/hooks/useApprovalModeIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useApprovalModeIndicator.test.js +66 -63
- package/dist/src/ui/hooks/useApprovalModeIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useAtCompletion.js +76 -24
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.test.js +152 -31
- package/dist/src/ui/hooks/useAtCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion_agents.test.js +2 -2
- package/dist/src/ui/hooks/useAtCompletion_agents.test.js.map +1 -1
- package/dist/src/ui/hooks/useBackgroundTaskManager.d.ts +22 -0
- package/dist/src/ui/hooks/useBackgroundTaskManager.js +58 -0
- package/dist/src/ui/hooks/useBackgroundTaskManager.js.map +1 -0
- package/dist/src/ui/hooks/useBackgroundTaskManager.test.d.ts +6 -0
- package/dist/src/ui/hooks/useBackgroundTaskManager.test.js +168 -0
- package/dist/src/ui/hooks/useBackgroundTaskManager.test.js.map +1 -0
- package/dist/src/ui/hooks/useBanner.d.ts +1 -0
- package/dist/src/ui/hooks/useBanner.js +16 -9
- package/dist/src/ui/hooks/useBanner.js.map +1 -1
- package/dist/src/ui/hooks/useBanner.test.js +19 -13
- package/dist/src/ui/hooks/useBanner.test.js.map +1 -1
- package/dist/src/ui/hooks/useBatchedScroll.js +2 -2
- package/dist/src/ui/hooks/useBatchedScroll.js.map +1 -1
- package/dist/src/ui/hooks/useBatchedScroll.test.js +14 -14
- package/dist/src/ui/hooks/useBatchedScroll.test.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +8 -3
- package/dist/src/ui/hooks/useCommandCompletion.js +110 -15
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.d.ts +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.test.js +275 -55
- package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useCompletion.js +1 -1
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useComposerStatus.d.ts +21 -0
- package/dist/src/ui/hooks/useComposerStatus.js +78 -0
- package/dist/src/ui/hooks/useComposerStatus.js.map +1 -0
- package/dist/src/ui/hooks/useConfirmingTool.d.ts +2 -6
- package/dist/src/ui/hooks/useConfirmingTool.js +2 -22
- package/dist/src/ui/hooks/useConfirmingTool.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +20 -4
- package/dist/src/ui/hooks/useConsoleMessages.js +126 -87
- package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.test.js +106 -64
- package/dist/src/ui/hooks/useConsoleMessages.test.js.map +1 -1
- package/dist/src/ui/hooks/useEditorSettings.test.js +20 -20
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
- package/dist/src/ui/hooks/useExecutionLifecycle.d.ts +28 -0
- package/dist/src/ui/hooks/{shellCommandProcessor.js → useExecutionLifecycle.js} +152 -70
- package/dist/src/ui/hooks/useExecutionLifecycle.js.map +1 -0
- package/dist/src/ui/hooks/useExecutionLifecycle.test.d.ts +6 -0
- package/dist/src/ui/hooks/{shellCommandProcessor.test.js → useExecutionLifecycle.test.js} +172 -124
- package/dist/src/ui/hooks/useExecutionLifecycle.test.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionRegistry.d.ts +13 -0
- package/dist/src/ui/hooks/useExtensionRegistry.js +70 -0
- package/dist/src/ui/hooks/useExtensionRegistry.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionUpdates.js +10 -9
- package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -1
- package/dist/src/ui/hooks/useExtensionUpdates.test.js +7 -6
- package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -1
- package/dist/src/ui/hooks/useFlickerDetector.test.js +12 -13
- package/dist/src/ui/hooks/useFlickerDetector.test.js.map +1 -1
- package/dist/src/ui/hooks/useFocus.d.ts +4 -1
- package/dist/src/ui/hooks/useFocus.js +7 -1
- package/dist/src/ui/hooks/useFocus.js.map +1 -1
- package/dist/src/ui/hooks/useFocus.test.js +35 -27
- package/dist/src/ui/hooks/useFocus.test.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +2 -0
- package/dist/src/ui/hooks/useFolderTrust.js +16 -4
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.test.js +23 -20
- package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +7 -7
- package/dist/src/ui/hooks/useGeminiStream.js +468 -125
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +832 -230
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.js +2 -2
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.js +63 -60
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
- package/dist/src/ui/hooks/useHistoryManager.js +9 -5
- package/dist/src/ui/hooks/useHistoryManager.js.map +1 -1
- package/dist/src/ui/hooks/useHistoryManager.test.js +63 -24
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -1
- package/dist/src/ui/hooks/useHookDisplayState.js +1 -0
- package/dist/src/ui/hooks/useHookDisplayState.js.map +1 -1
- package/dist/src/ui/hooks/useHookDisplayState.test.js +12 -12
- package/dist/src/ui/hooks/useHookDisplayState.test.js.map +1 -1
- package/dist/src/ui/hooks/useIdeTrustListener.test.js +17 -6
- package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -1
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +10 -10
- package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/useInlineEditBuffer.d.ts +43 -0
- package/dist/src/ui/hooks/useInlineEditBuffer.js +113 -0
- package/dist/src/ui/hooks/useInlineEditBuffer.js.map +1 -0
- package/dist/src/ui/hooks/useInlineEditBuffer.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInlineEditBuffer.test.js +112 -0
- package/dist/src/ui/hooks/useInlineEditBuffer.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.test.js +28 -28
- package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -1
- package/dist/src/ui/hooks/useInputHistoryStore.test.js +20 -20
- package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -1
- package/dist/src/ui/hooks/useKeyMatchers.d.ts +17 -0
- package/dist/src/ui/hooks/useKeyMatchers.js +13 -0
- package/dist/src/ui/hooks/useKeyMatchers.js.map +1 -0
- package/dist/src/ui/hooks/useKeypress.d.ts +4 -4
- package/dist/src/ui/hooks/useKeypress.js +3 -3
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/src/ui/hooks/useKeypress.test.js +23 -31
- package/dist/src/ui/hooks/useKeypress.test.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +7 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js +12 -5
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +67 -35
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useLogger.d.ts +1 -2
- package/dist/src/ui/hooks/useLogger.js +7 -4
- package/dist/src/ui/hooks/useLogger.js.map +1 -1
- package/dist/src/ui/hooks/useLogger.test.d.ts +6 -0
- package/dist/src/ui/hooks/useLogger.test.js +57 -0
- package/dist/src/ui/hooks/useLogger.test.js.map +1 -0
- package/dist/src/ui/hooks/useMcpStatus.test.js +10 -10
- package/dist/src/ui/hooks/useMcpStatus.test.js.map +1 -1
- package/dist/src/ui/hooks/useMemoryMonitor.test.js +6 -6
- package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -1
- package/dist/src/ui/hooks/useMessageQueue.test.js +29 -29
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -1
- package/dist/src/ui/hooks/useModelCommand.test.js +6 -6
- package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -1
- package/dist/src/ui/hooks/useMouse.d.ts +1 -1
- package/dist/src/ui/hooks/useMouse.js +1 -1
- package/dist/src/ui/hooks/useMouse.js.map +1 -1
- package/dist/src/ui/hooks/useMouse.test.js +11 -16
- package/dist/src/ui/hooks/useMouse.test.js.map +1 -1
- package/dist/src/ui/hooks/useMouseClick.test.js +15 -7
- package/dist/src/ui/hooks/useMouseClick.test.js.map +1 -1
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js +2 -2
- package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -1
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +19 -19
- package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +11 -4
- package/dist/src/ui/hooks/usePhraseCycler.js +116 -55
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.test.js +104 -126
- package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js +9 -3
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.js +20 -11
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -1
- package/dist/src/ui/hooks/usePromptCompletion.d.ts +2 -3
- package/dist/src/ui/hooks/usePromptCompletion.js +4 -4
- package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +11 -3
- package/dist/src/ui/hooks/useQuotaAndFallback.js +95 -19
- package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -1
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js +328 -38
- package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -1
- package/dist/src/ui/hooks/useRegistrySearch.d.ts +19 -0
- package/dist/src/ui/hooks/useRegistrySearch.js +35 -0
- package/dist/src/ui/hooks/useRegistrySearch.js.map +1 -0
- package/dist/src/ui/hooks/useRepeatedKeyPress.d.ts +15 -0
- package/dist/src/ui/hooks/useRepeatedKeyPress.js +50 -0
- package/dist/src/ui/hooks/useRepeatedKeyPress.js.map +1 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +20 -20
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useRewind.test.js +10 -10
- package/dist/src/ui/hooks/useRewind.test.js.map +1 -1
- package/dist/src/ui/hooks/useRunEventNotifications.d.ts +22 -0
- package/dist/src/ui/hooks/useRunEventNotifications.js +93 -0
- package/dist/src/ui/hooks/useRunEventNotifications.js.map +1 -0
- package/dist/src/ui/hooks/useSearchBuffer.d.ts +11 -0
- package/dist/src/ui/hooks/useSearchBuffer.js +24 -0
- package/dist/src/ui/hooks/useSearchBuffer.js.map +1 -0
- package/dist/src/ui/hooks/useSelectionList.js +5 -4
- package/dist/src/ui/hooks/useSelectionList.js.map +1 -1
- package/dist/src/ui/hooks/useSelectionList.test.js +162 -50
- package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.d.ts +3 -4
- package/dist/src/ui/hooks/useSessionBrowser.js +7 -5
- package/dist/src/ui/hooks/useSessionBrowser.js.map +1 -1
- package/dist/src/ui/hooks/useSessionBrowser.test.js +60 -17
- package/dist/src/ui/hooks/useSessionBrowser.test.js.map +1 -1
- package/dist/src/ui/hooks/useSessionResume.js +2 -2
- package/dist/src/ui/hooks/useSessionResume.js.map +1 -1
- package/dist/src/ui/hooks/useSessionResume.test.js +20 -20
- package/dist/src/ui/hooks/useSessionResume.test.js.map +1 -1
- package/dist/src/ui/hooks/useSettingsNavigation.d.ts +18 -0
- package/dist/src/ui/hooks/useSettingsNavigation.js +72 -0
- package/dist/src/ui/hooks/useSettingsNavigation.js.map +1 -0
- package/dist/src/ui/hooks/useSettingsNavigation.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSettingsNavigation.test.js +87 -0
- package/dist/src/ui/hooks/useSettingsNavigation.test.js.map +1 -0
- package/dist/src/ui/hooks/useShellCompletion.d.ts +50 -0
- package/dist/src/ui/hooks/useShellCompletion.js +502 -0
- package/dist/src/ui/hooks/useShellCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useShellCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useShellCompletion.test.js +354 -0
- package/dist/src/ui/hooks/useShellCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.test.js +7 -7
- package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -1
- package/dist/src/ui/hooks/useShellInactivityStatus.d.ts +1 -1
- package/dist/src/ui/hooks/useShellInactivityStatus.js +1 -1
- package/dist/src/ui/hooks/useShellInactivityStatus.js.map +1 -1
- package/dist/src/ui/hooks/useShellInactivityStatus.test.js +4 -4
- package/dist/src/ui/hooks/useShellInactivityStatus.test.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.js +67 -33
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +2 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +254 -162
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useSnowfall.js +1 -1
- package/dist/src/ui/hooks/useSnowfall.js.map +1 -1
- package/dist/src/ui/hooks/useSnowfall.test.js +15 -11
- package/dist/src/ui/hooks/useSnowfall.test.js.map +1 -1
- package/dist/src/ui/hooks/useStateAndRef.js +1 -0
- package/dist/src/ui/hooks/useStateAndRef.js.map +1 -1
- package/dist/src/ui/hooks/useSuspend.d.ts +16 -0
- package/dist/src/ui/hooks/useSuspend.js +116 -0
- package/dist/src/ui/hooks/useSuspend.js.map +1 -0
- package/dist/src/ui/hooks/useSuspend.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSuspend.test.js +150 -0
- package/dist/src/ui/hooks/useSuspend.test.js.map +1 -0
- package/dist/src/ui/hooks/useTabbedNavigation.js +4 -1
- package/dist/src/ui/hooks/useTabbedNavigation.js.map +1 -1
- package/dist/src/ui/hooks/useTabbedNavigation.test.js +49 -63
- package/dist/src/ui/hooks/useTabbedNavigation.test.js.map +1 -1
- package/dist/src/ui/hooks/useTerminalTheme.d.ts +1 -1
- package/dist/src/ui/hooks/useTerminalTheme.js +24 -9
- package/dist/src/ui/hooks/useTerminalTheme.js.map +1 -1
- package/dist/src/ui/hooks/useTerminalTheme.test.js +79 -38
- package/dist/src/ui/hooks/useTerminalTheme.test.js.map +1 -1
- package/dist/src/ui/hooks/useThemeCommand.d.ts +2 -2
- package/dist/src/ui/hooks/useThemeCommand.js +12 -5
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/useTimedMessage.d.ts +1 -1
- package/dist/src/ui/hooks/useTimedMessage.js +5 -3
- package/dist/src/ui/hooks/useTimedMessage.js.map +1 -1
- package/dist/src/ui/hooks/useTimer.test.js +18 -18
- package/dist/src/ui/hooks/useTimer.test.js.map +1 -1
- package/dist/src/ui/hooks/useTips.test.js +6 -6
- package/dist/src/ui/hooks/useTips.test.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.d.ts +34 -10
- package/dist/src/ui/hooks/useToolScheduler.js +202 -4
- package/dist/src/ui/hooks/useToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.d.ts +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +462 -809
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/hooks/useTurnActivityMonitor.d.ts +1 -1
- package/dist/src/ui/hooks/useTurnActivityMonitor.js +1 -1
- package/dist/src/ui/hooks/useTurnActivityMonitor.js.map +1 -1
- package/dist/src/ui/hooks/useTurnActivityMonitor.test.js +14 -12
- package/dist/src/ui/hooks/useTurnActivityMonitor.test.js.map +1 -1
- package/dist/src/ui/hooks/useVisibilityToggle.d.ts +12 -0
- package/dist/src/ui/hooks/useVisibilityToggle.js +60 -0
- package/dist/src/ui/hooks/useVisibilityToggle.js.map +1 -0
- package/dist/src/ui/hooks/vim-passthrough.test.js +2 -2
- package/dist/src/ui/hooks/vim-passthrough.test.js.map +1 -1
- package/dist/src/ui/hooks/vim.js +587 -27
- package/dist/src/ui/hooks/vim.js.map +1 -1
- package/dist/src/ui/hooks/vim.test.js +734 -183
- package/dist/src/ui/hooks/vim.test.js.map +1 -1
- package/dist/src/{config → ui/key}/keyBindings.d.ts +40 -26
- package/dist/src/ui/key/keyBindings.js +698 -0
- package/dist/src/ui/key/keyBindings.js.map +1 -0
- package/dist/src/ui/key/keyBindings.test.d.ts +6 -0
- package/dist/src/ui/key/keyBindings.test.js +214 -0
- package/dist/src/ui/key/keyBindings.test.js.map +1 -0
- package/dist/src/ui/{keyMatchers.d.ts → key/keyMatchers.d.ts} +11 -4
- package/dist/src/ui/key/keyMatchers.js +43 -0
- package/dist/src/ui/key/keyMatchers.js.map +1 -0
- package/dist/src/ui/key/keyMatchers.test.d.ts +6 -0
- package/dist/src/ui/{keyMatchers.test.js → key/keyMatchers.test.js} +149 -66
- package/dist/src/ui/key/keyMatchers.test.js.map +1 -0
- package/dist/src/ui/key/keyToAnsi.js +46 -0
- package/dist/src/ui/key/keyToAnsi.js.map +1 -0
- package/dist/src/ui/{utils → key}/keybindingUtils.d.ts +3 -3
- package/dist/src/ui/key/keybindingUtils.js +87 -0
- package/dist/src/ui/key/keybindingUtils.js.map +1 -0
- package/dist/src/ui/key/keybindingUtils.test.d.ts +6 -0
- package/dist/src/ui/key/keybindingUtils.test.js +121 -0
- package/dist/src/ui/key/keybindingUtils.test.js.map +1 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js +8 -6
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -1
- package/dist/src/ui/layouts/DefaultAppLayout.test.js +34 -26
- package/dist/src/ui/layouts/DefaultAppLayout.test.js.map +1 -1
- package/dist/src/ui/noninteractive/nonInteractiveUi.js +15 -2
- package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js +21 -8
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js.map +1 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js +14 -5
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js.map +1 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js +14 -5
- package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js.map +1 -1
- package/dist/src/ui/privacy/PrivacyNotice.test.js +3 -2
- package/dist/src/ui/privacy/PrivacyNotice.test.js.map +1 -1
- package/dist/src/ui/textConstants.d.ts +2 -1
- package/dist/src/ui/textConstants.js +2 -1
- package/dist/src/ui/textConstants.js.map +1 -1
- package/dist/src/ui/themes/{ansi.d.ts → builtin/dark/ansi-dark.d.ts} +2 -2
- package/dist/src/ui/themes/{ansi.js → builtin/dark/ansi-dark.js} +5 -4
- package/dist/src/ui/themes/builtin/dark/ansi-dark.js.map +1 -0
- package/dist/src/ui/themes/{atom-one-dark.d.ts → builtin/dark/atom-one-dark.d.ts} +2 -2
- package/dist/src/ui/themes/{atom-one-dark.js → builtin/dark/atom-one-dark.js} +3 -3
- package/dist/src/ui/themes/builtin/dark/atom-one-dark.js.map +1 -0
- package/dist/src/ui/themes/{ayu.d.ts → builtin/dark/ayu-dark.d.ts} +2 -2
- package/dist/src/ui/themes/{ayu.js → builtin/dark/ayu-dark.js} +4 -4
- package/dist/src/ui/themes/builtin/dark/ayu-dark.js.map +1 -0
- package/dist/src/ui/themes/{default.d.ts → builtin/dark/default-dark.d.ts} +2 -2
- package/dist/src/ui/themes/{default.js → builtin/dark/default-dark.js} +3 -3
- package/dist/src/ui/themes/builtin/dark/default-dark.js.map +1 -0
- package/dist/src/ui/themes/{dracula.d.ts → builtin/dark/dracula-dark.d.ts} +2 -2
- package/dist/src/ui/themes/{dracula.js → builtin/dark/dracula-dark.js} +4 -4
- package/dist/src/ui/themes/builtin/dark/dracula-dark.js.map +1 -0
- package/dist/src/ui/themes/{github-dark.d.ts → builtin/dark/github-dark.d.ts} +2 -2
- package/dist/src/ui/themes/{github-dark.js → builtin/dark/github-dark.js} +3 -3
- package/dist/src/ui/themes/builtin/dark/github-dark.js.map +1 -0
- package/dist/src/ui/themes/{holiday.d.ts → builtin/dark/holiday-dark.d.ts} +2 -2
- package/dist/src/ui/themes/{holiday.js → builtin/dark/holiday-dark.js} +5 -4
- package/dist/src/ui/themes/{holiday.js.map → builtin/dark/holiday-dark.js.map} +1 -1
- package/dist/src/ui/themes/{shades-of-purple.d.ts → builtin/dark/shades-of-purple-dark.d.ts} +2 -2
- package/dist/src/ui/themes/{shades-of-purple.js → builtin/dark/shades-of-purple-dark.js} +4 -4
- package/dist/src/ui/themes/builtin/dark/shades-of-purple-dark.js.map +1 -0
- package/dist/src/ui/themes/builtin/dark/solarized-dark.d.ts +7 -0
- package/dist/src/ui/themes/builtin/dark/solarized-dark.js +198 -0
- package/dist/src/ui/themes/builtin/dark/solarized-dark.js.map +1 -0
- package/dist/src/ui/themes/builtin/dark/tokyonight-dark.d.ts +7 -0
- package/dist/src/ui/themes/builtin/dark/tokyonight-dark.js +147 -0
- package/dist/src/ui/themes/builtin/dark/tokyonight-dark.js.map +1 -0
- package/dist/src/ui/themes/{ansi-light.d.ts → builtin/light/ansi-light.d.ts} +2 -2
- package/dist/src/ui/themes/{ansi-light.js → builtin/light/ansi-light.js} +3 -3
- package/dist/src/ui/themes/builtin/light/ansi-light.js.map +1 -0
- package/dist/src/ui/themes/{ayu-light.d.ts → builtin/light/ayu-light.d.ts} +2 -2
- package/dist/src/ui/themes/{ayu-light.js → builtin/light/ayu-light.js} +3 -3
- package/dist/src/ui/themes/builtin/light/ayu-light.js.map +1 -0
- package/dist/src/ui/themes/{default-light.d.ts → builtin/light/default-light.d.ts} +2 -2
- package/dist/src/ui/themes/{default-light.js → builtin/light/default-light.js} +2 -2
- package/dist/src/ui/themes/builtin/light/default-light.js.map +1 -0
- package/dist/src/ui/themes/{github-light.d.ts → builtin/light/github-light.d.ts} +2 -2
- package/dist/src/ui/themes/{github-light.js → builtin/light/github-light.js} +4 -3
- package/dist/src/ui/themes/builtin/light/github-light.js.map +1 -0
- package/dist/src/ui/themes/{googlecode.d.ts → builtin/light/googlecode-light.d.ts} +2 -2
- package/dist/src/ui/themes/{googlecode.js → builtin/light/googlecode-light.js} +4 -4
- package/dist/src/ui/themes/builtin/light/googlecode-light.js.map +1 -0
- package/dist/src/ui/themes/builtin/light/solarized-light.d.ts +7 -0
- package/dist/src/ui/themes/builtin/light/solarized-light.js +198 -0
- package/dist/src/ui/themes/builtin/light/solarized-light.js.map +1 -0
- package/dist/src/ui/themes/{xcode.d.ts → builtin/light/xcode-light.d.ts} +2 -2
- package/dist/src/ui/themes/{xcode.js → builtin/light/xcode-light.js} +5 -4
- package/dist/src/ui/themes/builtin/light/xcode-light.js.map +1 -0
- package/dist/src/ui/themes/{no-color.d.ts → builtin/no-color.d.ts} +2 -2
- package/dist/src/ui/themes/{no-color.js → builtin/no-color.js} +10 -3
- package/dist/src/ui/themes/builtin/no-color.js.map +1 -0
- package/dist/src/ui/themes/color-utils.d.ts +2 -18
- package/dist/src/ui/themes/color-utils.js +2 -231
- package/dist/src/ui/themes/color-utils.js.map +1 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +5 -1
- package/dist/src/ui/themes/semantic-tokens.js +12 -4
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.d.ts +47 -7
- package/dist/src/ui/themes/theme-manager.js +171 -27
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.test.js +86 -2
- package/dist/src/ui/themes/theme-manager.test.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +25 -0
- package/dist/src/ui/themes/theme.js +178 -36
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/theme.test.js +7 -7
- package/dist/src/ui/themes/theme.test.js.map +1 -1
- package/dist/src/ui/types.d.ts +48 -23
- package/dist/src/ui/types.js +31 -1
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +10 -2
- package/dist/src/ui/utils/CodeColorizer.js +37 -32
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/CodeColorizer.test.js +38 -2
- package/dist/src/ui/utils/CodeColorizer.test.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +1 -0
- package/dist/src/ui/utils/ConsolePatcher.js +12 -5
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.test.d.ts +6 -0
- package/dist/src/ui/utils/ConsolePatcher.test.js +199 -0
- package/dist/src/ui/utils/ConsolePatcher.test.js.map +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +0 -5
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +7 -103
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +3 -2
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.js +51 -35
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.js +124 -56
- package/dist/src/ui/utils/TableRenderer.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.test.js +344 -6
- package/dist/src/ui/utils/TableRenderer.test.js.map +1 -1
- package/dist/src/ui/utils/borderStyles.d.ts +18 -0
- package/dist/src/ui/utils/borderStyles.js +83 -0
- package/dist/src/ui/utils/borderStyles.js.map +1 -0
- package/dist/src/ui/utils/borderStyles.test.d.ts +6 -0
- package/dist/src/ui/utils/borderStyles.test.js +171 -0
- package/dist/src/ui/utils/borderStyles.test.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.d.ts +23 -11
- package/dist/src/ui/utils/clipboardUtils.js +79 -49
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.test.js +168 -120
- package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.d.ts +8 -3
- package/dist/src/ui/utils/commandUtils.js +20 -8
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.test.js +39 -7
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -1
- package/dist/src/ui/utils/computeStats.test.js +8 -0
- package/dist/src/ui/utils/computeStats.test.js.map +1 -1
- package/dist/src/ui/utils/confirmingTool.d.ts +15 -0
- package/dist/src/ui/utils/confirmingTool.js +26 -0
- package/dist/src/ui/utils/confirmingTool.js.map +1 -0
- package/dist/src/ui/utils/contextUsage.d.ts +7 -0
- package/dist/src/ui/utils/contextUsage.js +20 -0
- package/dist/src/ui/utils/contextUsage.js.map +1 -0
- package/dist/src/ui/utils/directoryUtils.js +1 -1
- package/dist/src/ui/utils/directoryUtils.js.map +1 -1
- package/dist/src/ui/utils/displayUtils.d.ts +9 -0
- package/dist/src/ui/utils/displayUtils.js +14 -0
- package/dist/src/ui/utils/displayUtils.js.map +1 -1
- package/dist/src/ui/utils/editorUtils.d.ts +17 -0
- package/dist/src/ui/utils/editorUtils.js +104 -0
- package/dist/src/ui/utils/editorUtils.js.map +1 -0
- package/dist/src/ui/utils/fileUtils.d.ts +10 -0
- package/dist/src/ui/utils/fileUtils.js +17 -0
- package/dist/src/ui/utils/fileUtils.js.map +1 -0
- package/dist/src/ui/utils/formatters.d.ts +1 -1
- package/dist/src/ui/utils/formatters.js +38 -12
- package/dist/src/ui/utils/formatters.js.map +1 -1
- package/dist/src/ui/utils/formatters.test.js +29 -1
- package/dist/src/ui/utils/formatters.test.js.map +1 -1
- package/dist/src/ui/utils/highlight.js +1 -1
- package/dist/src/ui/utils/highlight.js.map +1 -1
- package/dist/src/ui/utils/historyExportUtils.d.ts +2 -2
- package/dist/src/ui/utils/historyExportUtils.js.map +1 -1
- package/dist/src/ui/utils/historyUtils.d.ts +10 -0
- package/dist/src/ui/utils/historyUtils.js +56 -0
- package/dist/src/ui/utils/historyUtils.js.map +1 -0
- package/dist/src/ui/utils/markdownParsingUtils.d.ts +10 -0
- package/dist/src/ui/utils/markdownParsingUtils.js +150 -0
- package/dist/src/ui/utils/markdownParsingUtils.js.map +1 -0
- package/dist/src/ui/utils/markdownParsingUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/markdownParsingUtils.test.js +166 -0
- package/dist/src/ui/utils/markdownParsingUtils.test.js.map +1 -0
- package/dist/src/ui/utils/pendingAttentionNotification.d.ts +12 -0
- package/dist/src/ui/utils/pendingAttentionNotification.js +101 -0
- package/dist/src/ui/utils/pendingAttentionNotification.js.map +1 -0
- package/dist/src/ui/utils/pendingAttentionNotification.test.d.ts +6 -0
- package/dist/src/ui/utils/pendingAttentionNotification.test.js +79 -0
- package/dist/src/ui/utils/pendingAttentionNotification.test.js.map +1 -0
- package/dist/src/ui/utils/shortcutsHelp.d.ts +7 -0
- package/dist/src/ui/utils/shortcutsHelp.js +12 -0
- package/dist/src/ui/utils/shortcutsHelp.js.map +1 -0
- package/dist/src/ui/utils/terminalCapabilityManager.d.ts +14 -1
- package/dist/src/ui/utils/terminalCapabilityManager.js +73 -18
- package/dist/src/ui/utils/terminalCapabilityManager.js.map +1 -1
- package/dist/src/ui/utils/terminalCapabilityManager.test.js +126 -0
- package/dist/src/ui/utils/terminalCapabilityManager.test.js.map +1 -1
- package/dist/src/ui/utils/terminalSetup.d.ts +24 -0
- package/dist/src/ui/utils/terminalSetup.js +130 -34
- package/dist/src/ui/utils/terminalSetup.js.map +1 -1
- package/dist/src/ui/utils/terminalSetup.test.js +35 -1
- package/dist/src/ui/utils/terminalSetup.test.js.map +1 -1
- package/dist/src/ui/utils/textOutput.test.js +1 -0
- package/dist/src/ui/utils/textOutput.test.js.map +1 -1
- package/dist/src/ui/utils/textUtils.d.ts +4 -0
- package/dist/src/ui/utils/textUtils.js +10 -1
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/textUtils.test.js +28 -7
- package/dist/src/ui/utils/textUtils.test.js.map +1 -1
- package/dist/src/ui/utils/toolLayoutUtils.d.ts +49 -0
- package/dist/src/ui/utils/toolLayoutUtils.js +80 -0
- package/dist/src/ui/utils/toolLayoutUtils.js.map +1 -0
- package/dist/src/ui/utils/toolLayoutUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/toolLayoutUtils.test.js +187 -0
- package/dist/src/ui/utils/toolLayoutUtils.test.js.map +1 -0
- package/dist/src/ui/utils/ui-sizing.d.ts +2 -2
- package/dist/src/ui/utils/ui-sizing.js +2 -3
- package/dist/src/ui/utils/ui-sizing.js.map +1 -1
- package/dist/src/ui/utils/ui-sizing.test.js +6 -19
- package/dist/src/ui/utils/ui-sizing.test.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.d.ts +1 -0
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/ui/utils/urlSecurityUtils.d.ts +32 -0
- package/dist/src/ui/utils/urlSecurityUtils.js +71 -0
- package/dist/src/ui/utils/urlSecurityUtils.js.map +1 -0
- package/dist/src/ui/utils/urlSecurityUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/urlSecurityUtils.test.js +49 -0
- package/dist/src/ui/utils/urlSecurityUtils.test.js.map +1 -0
- package/dist/src/utils/activityLogger.js +113 -24
- package/dist/src/utils/activityLogger.js.map +1 -1
- package/dist/src/utils/agentSettings.d.ts +7 -14
- package/dist/src/utils/agentSettings.js +27 -84
- package/dist/src/utils/agentSettings.js.map +1 -1
- package/dist/src/utils/agentSettings.test.d.ts +6 -0
- package/dist/src/utils/agentSettings.test.js +111 -0
- package/dist/src/utils/agentSettings.test.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +2 -0
- package/dist/src/utils/cleanup.js +63 -6
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/cleanup.test.js +165 -2
- package/dist/src/utils/cleanup.test.js.map +1 -1
- package/dist/src/utils/commands.js +15 -0
- package/dist/src/utils/commands.js.map +1 -1
- package/dist/src/utils/commands.test.js +80 -1
- package/dist/src/utils/commands.test.js.map +1 -1
- package/dist/src/utils/deepMerge.js +1 -1
- package/dist/src/utils/deepMerge.js.map +1 -1
- package/dist/src/utils/deepMerge.test.js +13 -3
- package/dist/src/utils/deepMerge.test.js.map +1 -1
- package/dist/src/utils/devtoolsService.d.ts +11 -1
- package/dist/src/utils/devtoolsService.js +36 -2
- package/dist/src/utils/devtoolsService.js.map +1 -1
- package/dist/src/utils/devtoolsService.test.js +74 -2
- package/dist/src/utils/devtoolsService.test.js.map +1 -1
- package/dist/src/utils/dialogScopeUtils.d.ts +6 -2
- package/dist/src/utils/dialogScopeUtils.js +4 -4
- package/dist/src/utils/dialogScopeUtils.js.map +1 -1
- package/dist/src/utils/dialogScopeUtils.test.js +5 -5
- package/dist/src/utils/dialogScopeUtils.test.js.map +1 -1
- package/dist/src/utils/envVarResolver.d.ts +5 -2
- package/dist/src/utils/envVarResolver.js +18 -6
- package/dist/src/utils/envVarResolver.js.map +1 -1
- package/dist/src/utils/envVarResolver.test.js +41 -24
- package/dist/src/utils/envVarResolver.test.js.map +1 -1
- package/dist/src/utils/errors.d.ts +0 -1
- package/dist/src/utils/errors.js +4 -10
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/errors.test.js +2 -17
- package/dist/src/utils/errors.test.js.map +1 -1
- package/dist/src/utils/events.d.ts +3 -1
- package/dist/src/utils/events.js +1 -0
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/featureToggleUtils.d.ts +55 -0
- package/dist/src/utils/featureToggleUtils.js +95 -0
- package/dist/src/utils/featureToggleUtils.js.map +1 -0
- package/dist/src/utils/featureToggleUtils.test.d.ts +6 -0
- package/dist/src/utils/featureToggleUtils.test.js +126 -0
- package/dist/src/utils/featureToggleUtils.test.js.map +1 -0
- package/dist/src/utils/gitUtils.js +6 -4
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.d.ts +8 -1
- package/dist/src/utils/handleAutoUpdate.js +56 -3
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- package/dist/src/utils/handleAutoUpdate.test.js +67 -5
- 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 +10 -1
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/installationInfo.test.js +10 -0
- package/dist/src/utils/installationInfo.test.js.map +1 -1
- package/dist/src/utils/jsonoutput.js +3 -1
- package/dist/src/utils/jsonoutput.js.map +1 -1
- package/dist/src/utils/logCleanup.d.ts +12 -0
- package/dist/src/utils/logCleanup.js +58 -0
- package/dist/src/utils/logCleanup.js.map +1 -0
- package/dist/src/utils/logCleanup.test.d.ts +6 -0
- package/dist/src/utils/logCleanup.test.js +87 -0
- package/dist/src/utils/logCleanup.test.js.map +1 -0
- package/dist/src/utils/persistentState.d.ts +3 -0
- package/dist/src/utils/persistentState.js +1 -0
- package/dist/src/utils/persistentState.js.map +1 -1
- package/dist/src/utils/processUtils.d.ts +2 -3
- package/dist/src/utils/processUtils.js +10 -0
- package/dist/src/utils/processUtils.js.map +1 -1
- package/dist/src/utils/processUtils.test.js +11 -2
- package/dist/src/utils/processUtils.test.js.map +1 -1
- package/dist/src/utils/readStdin.js +1 -0
- package/dist/src/utils/readStdin.js.map +1 -1
- package/dist/src/utils/relaunch.test.js.map +1 -1
- package/dist/src/utils/{sandbox-macos-restrictive-closed.sb → sandbox-macos-strict-open.sb} +41 -3
- package/dist/src/utils/sandbox-macos-strict-proxied.sb +133 -0
- package/dist/src/utils/sandbox.js +277 -20
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/sandbox.test.js +198 -17
- package/dist/src/utils/sandbox.test.js.map +1 -1
- package/dist/src/utils/sandboxUtils.js +3 -3
- package/dist/src/utils/sandboxUtils.js.map +1 -1
- package/dist/src/utils/sessionCleanup.d.ts +6 -1
- package/dist/src/utils/sessionCleanup.integration.test.js +94 -0
- package/dist/src/utils/sessionCleanup.integration.test.js.map +1 -1
- package/dist/src/utils/sessionCleanup.js +107 -38
- package/dist/src/utils/sessionCleanup.js.map +1 -1
- package/dist/src/utils/sessionCleanup.test.js +545 -1089
- package/dist/src/utils/sessionCleanup.test.js.map +1 -1
- package/dist/src/utils/sessionUtils.d.ts +2 -7
- package/dist/src/utils/sessionUtils.js +39 -115
- package/dist/src/utils/sessionUtils.js.map +1 -1
- package/dist/src/utils/sessionUtils.test.js +269 -3
- package/dist/src/utils/sessionUtils.test.js.map +1 -1
- package/dist/src/utils/sessions.js +1 -1
- package/dist/src/utils/sessions.js.map +1 -1
- package/dist/src/utils/sessions.test.js +3 -1
- package/dist/src/utils/sessions.test.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +20 -93
- package/dist/src/utils/settingsUtils.js +135 -207
- package/dist/src/utils/settingsUtils.js.map +1 -1
- package/dist/src/utils/settingsUtils.test.js +129 -264
- package/dist/src/utils/settingsUtils.test.js.map +1 -1
- package/dist/src/utils/skillSettings.d.ts +4 -14
- package/dist/src/utils/skillSettings.js +32 -81
- package/dist/src/utils/skillSettings.js.map +1 -1
- package/dist/src/utils/skillSettings.test.d.ts +6 -0
- package/dist/src/utils/skillSettings.test.js +142 -0
- package/dist/src/utils/skillSettings.test.js.map +1 -0
- package/dist/src/utils/skillUtils.js +24 -7
- package/dist/src/utils/skillUtils.js.map +1 -1
- package/dist/src/utils/skillUtils.test.js +52 -4
- package/dist/src/utils/skillUtils.test.js.map +1 -1
- package/dist/src/utils/terminalNotifications.d.ts +25 -0
- package/dist/src/utils/terminalNotifications.js +75 -0
- package/dist/src/utils/terminalNotifications.js.map +1 -0
- package/dist/src/utils/terminalNotifications.test.d.ts +6 -0
- package/dist/src/utils/terminalNotifications.test.js +125 -0
- package/dist/src/utils/terminalNotifications.test.js.map +1 -0
- package/dist/src/utils/terminalTheme.js +3 -4
- package/dist/src/utils/terminalTheme.js.map +1 -1
- package/dist/src/utils/tierUtils.d.ts +12 -0
- package/dist/src/utils/tierUtils.js +15 -0
- package/dist/src/utils/tierUtils.js.map +1 -0
- package/dist/src/utils/tierUtils.test.d.ts +6 -0
- package/dist/src/utils/tierUtils.test.js +25 -0
- package/dist/src/utils/tierUtils.test.js.map +1 -0
- package/dist/src/utils/userStartupWarnings.d.ts +4 -1
- package/dist/src/utils/userStartupWarnings.js +24 -6
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.test.js +53 -11
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -1
- package/dist/src/utils/worktreeSetup.d.ts +14 -0
- package/dist/src/utils/worktreeSetup.js +32 -0
- package/dist/src/utils/worktreeSetup.js.map +1 -0
- package/dist/src/utils/worktreeSetup.test.d.ts +6 -0
- package/dist/src/utils/worktreeSetup.test.js +89 -0
- package/dist/src/utils/worktreeSetup.test.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.d.ts +1 -2
- package/dist/src/validateNonInterActiveAuth.js +1 -14
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/dist/src/config/keyBindings.js +0 -460
- package/dist/src/config/keyBindings.js.map +0 -1
- package/dist/src/config/keyBindings.test.js +0 -108
- package/dist/src/config/keyBindings.test.js.map +0 -1
- package/dist/src/ui/commands/shellsCommand.js.map +0 -1
- package/dist/src/ui/commands/shellsCommand.test.js +0 -29
- package/dist/src/ui/commands/shellsCommand.test.js.map +0 -1
- package/dist/src/ui/components/BackgroundShellDisplay.d.ts +0 -16
- package/dist/src/ui/components/BackgroundShellDisplay.js.map +0 -1
- package/dist/src/ui/components/BackgroundShellDisplay.test.js.map +0 -1
- package/dist/src/ui/components/ShortcutsHint.d.ts +0 -7
- package/dist/src/ui/components/ShortcutsHint.js +0 -12
- package/dist/src/ui/components/ShortcutsHint.js.map +0 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessageOverflow.test.js +0 -93
- package/dist/src/ui/components/messages/ToolConfirmationMessageOverflow.test.js.map +0 -1
- package/dist/src/ui/components/views/HooksList.d.ts +0 -24
- package/dist/src/ui/components/views/HooksList.js +0 -28
- package/dist/src/ui/components/views/HooksList.js.map +0 -1
- package/dist/src/ui/hooks/keyToAnsi.js +0 -67
- package/dist/src/ui/hooks/keyToAnsi.js.map +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +0 -28
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +0 -1
- package/dist/src/ui/hooks/useBackgroundShellManager.d.ts +0 -22
- package/dist/src/ui/hooks/useBackgroundShellManager.js +0 -58
- package/dist/src/ui/hooks/useBackgroundShellManager.js.map +0 -1
- package/dist/src/ui/hooks/useBackgroundShellManager.test.js +0 -168
- package/dist/src/ui/hooks/useBackgroundShellManager.test.js.map +0 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +0 -42
- package/dist/src/ui/hooks/useReactToolScheduler.js +0 -106
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +0 -1
- package/dist/src/ui/hooks/useReactToolScheduler.test.js +0 -58
- package/dist/src/ui/hooks/useReactToolScheduler.test.js.map +0 -1
- package/dist/src/ui/hooks/useToolExecutionScheduler.d.ts +0 -30
- package/dist/src/ui/hooks/useToolExecutionScheduler.js +0 -149
- package/dist/src/ui/hooks/useToolExecutionScheduler.js.map +0 -1
- package/dist/src/ui/hooks/useToolExecutionScheduler.test.js +0 -376
- package/dist/src/ui/hooks/useToolExecutionScheduler.test.js.map +0 -1
- package/dist/src/ui/keyMatchers.js +0 -46
- package/dist/src/ui/keyMatchers.js.map +0 -1
- package/dist/src/ui/keyMatchers.test.js.map +0 -1
- package/dist/src/ui/themes/ansi-light.js.map +0 -1
- package/dist/src/ui/themes/ansi.js.map +0 -1
- package/dist/src/ui/themes/atom-one-dark.js.map +0 -1
- package/dist/src/ui/themes/ayu-light.js.map +0 -1
- package/dist/src/ui/themes/ayu.js.map +0 -1
- package/dist/src/ui/themes/default-light.js.map +0 -1
- package/dist/src/ui/themes/default.js.map +0 -1
- package/dist/src/ui/themes/dracula.js.map +0 -1
- package/dist/src/ui/themes/github-dark.js.map +0 -1
- package/dist/src/ui/themes/github-light.js.map +0 -1
- package/dist/src/ui/themes/googlecode.js.map +0 -1
- package/dist/src/ui/themes/no-color.js.map +0 -1
- package/dist/src/ui/themes/shades-of-purple.js.map +0 -1
- package/dist/src/ui/themes/xcode.js.map +0 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.js +0 -21
- package/dist/src/ui/utils/InlineMarkdownRenderer.test.js.map +0 -1
- package/dist/src/ui/utils/keybindingUtils.js +0 -54
- package/dist/src/ui/utils/keybindingUtils.js.map +0 -1
- package/dist/src/ui/utils/keybindingUtils.test.js +0 -44
- package/dist/src/ui/utils/keybindingUtils.test.js.map +0 -1
- package/dist/src/utils/sandbox-macos-permissive-closed.sb +0 -32
- package/dist/src/zed-integration/acpErrors.js.map +0 -1
- package/dist/src/zed-integration/acpErrors.test.js.map +0 -1
- package/dist/src/zed-integration/acpResume.test.js.map +0 -1
- package/dist/src/zed-integration/fileSystemService.js +0 -41
- package/dist/src/zed-integration/fileSystemService.js.map +0 -1
- package/dist/src/zed-integration/fileSystemService.test.js +0 -88
- package/dist/src/zed-integration/fileSystemService.test.js.map +0 -1
- package/dist/src/zed-integration/zedIntegration.d.ts +0 -42
- package/dist/src/zed-integration/zedIntegration.js.map +0 -1
- package/dist/src/zed-integration/zedIntegration.test.js +0 -664
- package/dist/src/zed-integration/zedIntegration.test.js.map +0 -1
- /package/dist/src/{config/keyBindings.test.d.ts → acp/acpClient.test.d.ts} +0 -0
- /package/dist/src/{zed-integration → acp}/acpErrors.d.ts +0 -0
- /package/dist/src/{zed-integration → acp}/acpErrors.test.d.ts +0 -0
- /package/dist/src/{zed-integration → acp}/acpErrors.test.js +0 -0
- /package/dist/src/{zed-integration → acp}/acpResume.test.d.ts +0 -0
- /package/dist/src/{ui/components/messages/ToolConfirmationMessageOverflow.test.d.ts → acp/commandHandler.test.d.ts} +0 -0
- /package/dist/src/{ui/hooks/useToolExecutionScheduler.test.d.ts → acp/commands/help.test.d.ts} +0 -0
- /package/dist/src/{zed-integration → acp}/fileSystemService.test.d.ts +0 -0
- /package/dist/src/{ui/commands/shellsCommand.test.d.ts → config/extension-manager.test.d.ts} +0 -0
- /package/dist/src/{ui/components/BackgroundShellDisplay.test.d.ts → config/policy.test.d.ts} +0 -0
- /package/dist/src/{ui/hooks/shellCommandProcessor.test.d.ts → config/workspace-policy-cli.test.d.ts} +0 -0
- /package/dist/src/{ui/hooks/useBackgroundShellManager.test.d.ts → nonInteractiveCliAgentSession.test.d.ts} +0 -0
- /package/dist/src/ui/{hooks/useReactToolScheduler.test.d.ts → commands/resumeCommand.test.d.ts} +0 -0
- /package/dist/src/ui/{keyMatchers.test.d.ts → commands/tasksCommand.test.d.ts} +0 -0
- /package/dist/src/ui/{utils/InlineMarkdownRenderer.test.d.ts → components/BackgroundTaskDisplay.test.d.ts} +0 -0
- /package/dist/src/ui/{utils/keybindingUtils.test.d.ts → components/messages/SubagentProgressDisplay.test.d.ts} +0 -0
- /package/dist/src/{zed-integration/zedIntegration.test.d.ts → ui/components/shared/SearchableList.test.d.ts} +0 -0
- /package/dist/src/ui/{hooks → key}/keyToAnsi.d.ts +0 -0
|
@@ -5,113 +5,104 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
7
7
|
import * as fs from 'node:fs/promises';
|
|
8
|
+
import { existsSync, unlinkSync } from 'node:fs';
|
|
8
9
|
import * as path from 'node:path';
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
// Mock the fs module
|
|
13
|
-
vi.mock('node:fs/promises');
|
|
14
|
-
vi.mock('./sessionUtils.js', () => ({
|
|
15
|
-
getAllSessionFiles: vi.fn(),
|
|
16
|
-
}));
|
|
10
|
+
import * as os from 'node:os';
|
|
11
|
+
import { debugLogger, TOOL_OUTPUTS_DIR, Storage, } from '@google/gemini-cli-core';
|
|
12
|
+
import { cleanupExpiredSessions, cleanupToolOutputFiles, } from './sessionCleanup.js';
|
|
17
13
|
vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
|
18
14
|
const actual = await importOriginal();
|
|
19
15
|
return {
|
|
20
16
|
...actual,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
debugLogger: {
|
|
18
|
+
error: vi.fn(),
|
|
19
|
+
warn: vi.fn(),
|
|
20
|
+
debug: vi.fn(),
|
|
21
|
+
info: vi.fn(),
|
|
25
22
|
},
|
|
26
23
|
};
|
|
27
24
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
getProjectTempDir: vi.fn().mockReturnValue('/tmp/test-project'),
|
|
35
|
-
},
|
|
36
|
-
getSessionId: vi.fn().mockReturnValue('current123'),
|
|
37
|
-
getDebugMode: vi.fn().mockReturnValue(false),
|
|
38
|
-
initialize: vi.fn().mockResolvedValue(undefined),
|
|
39
|
-
...overrides,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
// Create test session data
|
|
43
|
-
function createTestSessions() {
|
|
44
|
-
const now = new Date();
|
|
45
|
-
const oneWeekAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
|
|
46
|
-
const twoWeeksAgo = new Date(now.getTime() - 14 * 24 * 60 * 60 * 1000);
|
|
47
|
-
const oneMonthAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
|
|
48
|
-
return [
|
|
49
|
-
{
|
|
50
|
-
id: 'current123',
|
|
51
|
-
file: `${SESSION_FILE_PREFIX}2025-01-20T10-30-00-current12`,
|
|
52
|
-
fileName: `${SESSION_FILE_PREFIX}2025-01-20T10-30-00-current12.json`,
|
|
53
|
-
startTime: now.toISOString(),
|
|
54
|
-
lastUpdated: now.toISOString(),
|
|
55
|
-
messageCount: 5,
|
|
56
|
-
displayName: 'Current session',
|
|
57
|
-
firstUserMessage: 'Current session',
|
|
58
|
-
isCurrentSession: true,
|
|
59
|
-
index: 1,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: 'recent456',
|
|
63
|
-
file: `${SESSION_FILE_PREFIX}2025-01-18T15-45-00-recent45`,
|
|
64
|
-
fileName: `${SESSION_FILE_PREFIX}2025-01-18T15-45-00-recent45.json`,
|
|
65
|
-
startTime: oneWeekAgo.toISOString(),
|
|
66
|
-
lastUpdated: oneWeekAgo.toISOString(),
|
|
67
|
-
messageCount: 10,
|
|
68
|
-
displayName: 'Recent session',
|
|
69
|
-
firstUserMessage: 'Recent session',
|
|
70
|
-
isCurrentSession: false,
|
|
71
|
-
index: 2,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: 'old789abc',
|
|
75
|
-
file: `${SESSION_FILE_PREFIX}2025-01-10T09-15-00-old789ab`,
|
|
76
|
-
fileName: `${SESSION_FILE_PREFIX}2025-01-10T09-15-00-old789ab.json`,
|
|
77
|
-
startTime: twoWeeksAgo.toISOString(),
|
|
78
|
-
lastUpdated: twoWeeksAgo.toISOString(),
|
|
79
|
-
messageCount: 3,
|
|
80
|
-
displayName: 'Old session',
|
|
81
|
-
firstUserMessage: 'Old session',
|
|
82
|
-
isCurrentSession: false,
|
|
83
|
-
index: 3,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: 'ancient12',
|
|
87
|
-
file: `${SESSION_FILE_PREFIX}2024-12-25T12-00-00-ancient1`,
|
|
88
|
-
fileName: `${SESSION_FILE_PREFIX}2024-12-25T12-00-00-ancient1.json`,
|
|
89
|
-
startTime: oneMonthAgo.toISOString(),
|
|
90
|
-
lastUpdated: oneMonthAgo.toISOString(),
|
|
91
|
-
messageCount: 15,
|
|
92
|
-
displayName: 'Ancient session',
|
|
93
|
-
firstUserMessage: 'Ancient session',
|
|
94
|
-
isCurrentSession: false,
|
|
95
|
-
index: 4,
|
|
96
|
-
},
|
|
97
|
-
];
|
|
98
|
-
}
|
|
99
|
-
describe('Session Cleanup', () => {
|
|
100
|
-
beforeEach(() => {
|
|
25
|
+
describe('Session Cleanup (Refactored)', () => {
|
|
26
|
+
let testTempDir;
|
|
27
|
+
let chatsDir;
|
|
28
|
+
let logsDir;
|
|
29
|
+
let toolOutputsDir;
|
|
30
|
+
beforeEach(async () => {
|
|
101
31
|
vi.clearAllMocks();
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
})));
|
|
32
|
+
testTempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'gemini-cli-cleanup-test-'));
|
|
33
|
+
chatsDir = path.join(testTempDir, 'chats');
|
|
34
|
+
logsDir = path.join(testTempDir, 'logs');
|
|
35
|
+
toolOutputsDir = path.join(testTempDir, TOOL_OUTPUTS_DIR);
|
|
36
|
+
await fs.mkdir(chatsDir, { recursive: true });
|
|
37
|
+
await fs.mkdir(logsDir, { recursive: true });
|
|
38
|
+
await fs.mkdir(toolOutputsDir, { recursive: true });
|
|
110
39
|
});
|
|
111
|
-
afterEach(() => {
|
|
40
|
+
afterEach(async () => {
|
|
112
41
|
vi.restoreAllMocks();
|
|
42
|
+
if (testTempDir && existsSync(testTempDir)) {
|
|
43
|
+
await fs.rm(testTempDir, { recursive: true, force: true });
|
|
44
|
+
}
|
|
113
45
|
});
|
|
114
|
-
|
|
46
|
+
function createMockConfig(overrides = {}) {
|
|
47
|
+
return {
|
|
48
|
+
storage: {
|
|
49
|
+
getProjectTempDir: () => testTempDir,
|
|
50
|
+
},
|
|
51
|
+
getSessionId: () => 'current123',
|
|
52
|
+
getDebugMode: () => false,
|
|
53
|
+
initialize: async () => { },
|
|
54
|
+
...overrides,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async function writeSessionFile(session) {
|
|
58
|
+
const filePath = path.join(chatsDir, session.fileName);
|
|
59
|
+
await fs.writeFile(filePath, JSON.stringify({
|
|
60
|
+
sessionId: session.id,
|
|
61
|
+
lastUpdated: session.lastUpdated,
|
|
62
|
+
startTime: session.lastUpdated,
|
|
63
|
+
messages: [{ type: 'user', content: 'hello' }],
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
async function writeArtifacts(sessionId) {
|
|
67
|
+
// Log file
|
|
68
|
+
await fs.writeFile(path.join(logsDir, `session-${sessionId}.jsonl`), 'log content');
|
|
69
|
+
// Tool output directory
|
|
70
|
+
const sessionOutputDir = path.join(toolOutputsDir, `session-${sessionId}`);
|
|
71
|
+
await fs.mkdir(sessionOutputDir, { recursive: true });
|
|
72
|
+
await fs.writeFile(path.join(sessionOutputDir, 'output.txt'), 'tool output');
|
|
73
|
+
// Session directory
|
|
74
|
+
await fs.mkdir(path.join(testTempDir, sessionId), { recursive: true });
|
|
75
|
+
// Subagent chats directory
|
|
76
|
+
await fs.mkdir(path.join(chatsDir, sessionId), { recursive: true });
|
|
77
|
+
}
|
|
78
|
+
async function seedSessions() {
|
|
79
|
+
const now = new Date();
|
|
80
|
+
const twoWeeksAgo = new Date(now.getTime() - 14 * 24 * 60 * 60 * 1000);
|
|
81
|
+
const oneMonthAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
|
|
82
|
+
const sessions = [
|
|
83
|
+
{
|
|
84
|
+
id: 'current123',
|
|
85
|
+
fileName: 'session-20250101-current1.json',
|
|
86
|
+
lastUpdated: now.toISOString(),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'old789abc',
|
|
90
|
+
fileName: 'session-20250110-old789ab.json',
|
|
91
|
+
lastUpdated: twoWeeksAgo.toISOString(),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: 'ancient12',
|
|
95
|
+
fileName: 'session-20241225-ancient1.json',
|
|
96
|
+
lastUpdated: oneMonthAgo.toISOString(),
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
for (const session of sessions) {
|
|
100
|
+
await writeSessionFile(session);
|
|
101
|
+
await writeArtifacts(session.id);
|
|
102
|
+
}
|
|
103
|
+
return sessions;
|
|
104
|
+
}
|
|
105
|
+
describe('Configuration boundaries & early exits', () => {
|
|
115
106
|
it('should return early when cleanup is disabled', async () => {
|
|
116
107
|
const config = createMockConfig();
|
|
117
108
|
const settings = {
|
|
@@ -126,1183 +117,648 @@ describe('Session Cleanup', () => {
|
|
|
126
117
|
});
|
|
127
118
|
it('should return early when sessionRetention is not configured', async () => {
|
|
128
119
|
const config = createMockConfig();
|
|
129
|
-
const settings = {};
|
|
120
|
+
const settings = { general: {} };
|
|
130
121
|
const result = await cleanupExpiredSessions(config, settings);
|
|
131
122
|
expect(result.disabled).toBe(true);
|
|
132
123
|
expect(result.scanned).toBe(0);
|
|
133
124
|
expect(result.deleted).toBe(0);
|
|
125
|
+
expect(result.skipped).toBe(0);
|
|
126
|
+
expect(result.failed).toBe(0);
|
|
134
127
|
});
|
|
135
|
-
it('should
|
|
136
|
-
const config = createMockConfig(
|
|
137
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
138
|
-
});
|
|
128
|
+
it('should require either maxAge or maxCount', async () => {
|
|
129
|
+
const config = createMockConfig();
|
|
139
130
|
const settings = {
|
|
140
|
-
general: {
|
|
141
|
-
sessionRetention: {
|
|
142
|
-
enabled: true,
|
|
143
|
-
maxAge: 'invalid-format',
|
|
144
|
-
},
|
|
145
|
-
},
|
|
131
|
+
general: { sessionRetention: { enabled: true } },
|
|
146
132
|
};
|
|
147
133
|
const result = await cleanupExpiredSessions(config, settings);
|
|
148
134
|
expect(result.disabled).toBe(true);
|
|
149
|
-
expect(
|
|
150
|
-
expect(result.deleted).toBe(0);
|
|
151
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Session cleanup disabled: Error: Invalid retention period format'));
|
|
135
|
+
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Either maxAge or maxCount must be specified'));
|
|
152
136
|
});
|
|
153
|
-
it('should
|
|
137
|
+
it.each([0, -1, -5])('should validate maxCount range (rejecting %i)', async (invalidCount) => {
|
|
154
138
|
const config = createMockConfig();
|
|
155
139
|
const settings = {
|
|
156
140
|
general: {
|
|
157
|
-
sessionRetention: {
|
|
158
|
-
enabled: true,
|
|
159
|
-
maxAge: '10d', // 10 days
|
|
160
|
-
},
|
|
141
|
+
sessionRetention: { enabled: true, maxCount: invalidCount },
|
|
161
142
|
},
|
|
162
143
|
};
|
|
163
|
-
// Mock successful file operations
|
|
164
|
-
mockFs.access.mockResolvedValue(undefined);
|
|
165
|
-
mockFs.readFile.mockResolvedValue(JSON.stringify({
|
|
166
|
-
sessionId: 'test',
|
|
167
|
-
messages: [],
|
|
168
|
-
startTime: '2025-01-01T00:00:00Z',
|
|
169
|
-
lastUpdated: '2025-01-01T00:00:00Z',
|
|
170
|
-
}));
|
|
171
|
-
mockFs.unlink.mockResolvedValue(undefined);
|
|
172
144
|
const result = await cleanupExpiredSessions(config, settings);
|
|
173
|
-
expect(result.disabled).toBe(
|
|
174
|
-
expect(
|
|
175
|
-
expect(result.deleted).toBe(2); // Should delete the 2-week-old and 1-month-old sessions
|
|
176
|
-
expect(result.skipped).toBe(2); // Current session + recent session should be skipped
|
|
177
|
-
expect(result.failed).toBe(0);
|
|
145
|
+
expect(result.disabled).toBe(true);
|
|
146
|
+
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('maxCount must be at least 1'));
|
|
178
147
|
});
|
|
179
|
-
it('should
|
|
148
|
+
it('should reject if both maxAge and maxCount are invalid', async () => {
|
|
180
149
|
const config = createMockConfig();
|
|
181
150
|
const settings = {
|
|
182
151
|
general: {
|
|
183
|
-
sessionRetention: {
|
|
184
|
-
enabled: true,
|
|
185
|
-
maxAge: '1d', // Very short retention
|
|
186
|
-
},
|
|
152
|
+
sessionRetention: { enabled: true, maxAge: 'invalid', maxCount: 0 },
|
|
187
153
|
},
|
|
188
154
|
};
|
|
189
|
-
// Mock successful file operations
|
|
190
|
-
mockFs.access.mockResolvedValue(undefined);
|
|
191
|
-
mockFs.readFile.mockResolvedValue(JSON.stringify({
|
|
192
|
-
sessionId: 'test',
|
|
193
|
-
messages: [],
|
|
194
|
-
startTime: '2025-01-01T00:00:00Z',
|
|
195
|
-
lastUpdated: '2025-01-01T00:00:00Z',
|
|
196
|
-
}));
|
|
197
|
-
mockFs.unlink.mockResolvedValue(undefined);
|
|
198
155
|
const result = await cleanupExpiredSessions(config, settings);
|
|
199
|
-
|
|
200
|
-
expect(
|
|
201
|
-
expect(result.deleted).toBe(3);
|
|
202
|
-
// Verify that unlink was never called with the current session file
|
|
203
|
-
const unlinkCalls = mockFs.unlink.mock.calls;
|
|
204
|
-
const currentSessionPath = path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}2025-01-20T10-30-00-current12.json`);
|
|
205
|
-
expect(unlinkCalls.find((call) => call[0] === currentSessionPath)).toBeUndefined();
|
|
156
|
+
expect(result.disabled).toBe(true);
|
|
157
|
+
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Invalid retention period format'));
|
|
206
158
|
});
|
|
207
|
-
it('should
|
|
159
|
+
it('should reject if maxAge is invalid even when maxCount is valid', async () => {
|
|
208
160
|
const config = createMockConfig();
|
|
209
161
|
const settings = {
|
|
210
162
|
general: {
|
|
211
|
-
sessionRetention: {
|
|
212
|
-
enabled: true,
|
|
213
|
-
maxCount: 2, // Keep only 2 most recent sessions
|
|
214
|
-
},
|
|
163
|
+
sessionRetention: { enabled: true, maxAge: 'invalid', maxCount: 5 },
|
|
215
164
|
},
|
|
216
165
|
};
|
|
217
|
-
// Mock successful file operations
|
|
218
|
-
mockFs.access.mockResolvedValue(undefined);
|
|
219
|
-
mockFs.readFile.mockResolvedValue(JSON.stringify({
|
|
220
|
-
sessionId: 'test',
|
|
221
|
-
messages: [],
|
|
222
|
-
startTime: '2025-01-01T00:00:00Z',
|
|
223
|
-
lastUpdated: '2025-01-01T00:00:00Z',
|
|
224
|
-
}));
|
|
225
|
-
mockFs.unlink.mockResolvedValue(undefined);
|
|
226
166
|
const result = await cleanupExpiredSessions(config, settings);
|
|
227
|
-
expect(result.disabled).toBe(
|
|
228
|
-
expect(
|
|
229
|
-
|
|
230
|
-
|
|
167
|
+
expect(result.disabled).toBe(true);
|
|
168
|
+
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Invalid retention period format'));
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
describe('Logging and Debug Mode', () => {
|
|
172
|
+
it('should log debug information when enabled', async () => {
|
|
173
|
+
await seedSessions();
|
|
174
|
+
const config = createMockConfig({
|
|
175
|
+
getDebugMode: vi.fn().mockReturnValue(true),
|
|
176
|
+
});
|
|
177
|
+
const settings = {
|
|
178
|
+
general: { sessionRetention: { enabled: true, maxCount: 1 } },
|
|
179
|
+
};
|
|
180
|
+
const debugSpy = vi
|
|
181
|
+
.spyOn(debugLogger, 'debug')
|
|
182
|
+
.mockImplementation(() => { });
|
|
183
|
+
await cleanupExpiredSessions(config, settings);
|
|
184
|
+
expect(debugSpy).toHaveBeenCalledWith(expect.stringContaining('Session cleanup: deleted'));
|
|
185
|
+
debugSpy.mockRestore();
|
|
231
186
|
});
|
|
232
|
-
|
|
187
|
+
});
|
|
188
|
+
describe('Basic retention rules', () => {
|
|
189
|
+
it('should delete sessions older than maxAge', async () => {
|
|
190
|
+
const sessions = await seedSessions();
|
|
233
191
|
const config = createMockConfig();
|
|
234
192
|
const settings = {
|
|
235
193
|
general: {
|
|
236
194
|
sessionRetention: {
|
|
237
195
|
enabled: true,
|
|
238
|
-
maxAge: '
|
|
196
|
+
maxAge: '10d',
|
|
239
197
|
},
|
|
240
198
|
},
|
|
241
199
|
};
|
|
242
|
-
// Mock file operations to succeed for access and readFile but fail for unlink
|
|
243
|
-
mockFs.access.mockResolvedValue(undefined);
|
|
244
|
-
mockFs.readFile.mockResolvedValue(JSON.stringify({
|
|
245
|
-
sessionId: 'test',
|
|
246
|
-
messages: [],
|
|
247
|
-
startTime: '2025-01-01T00:00:00Z',
|
|
248
|
-
lastUpdated: '2025-01-01T00:00:00Z',
|
|
249
|
-
}));
|
|
250
|
-
mockFs.unlink.mockRejectedValue(new Error('Permission denied'));
|
|
251
200
|
const result = await cleanupExpiredSessions(config, settings);
|
|
252
|
-
expect(result.
|
|
253
|
-
expect(result.
|
|
201
|
+
expect(result.scanned).toBe(3);
|
|
202
|
+
expect(result.deleted).toBe(2);
|
|
203
|
+
expect(result.skipped).toBe(1);
|
|
204
|
+
expect(result.failed).toBe(0);
|
|
205
|
+
expect(existsSync(path.join(chatsDir, sessions[0].fileName))).toBe(true);
|
|
206
|
+
expect(existsSync(path.join(chatsDir, sessions[1].fileName))).toBe(false);
|
|
207
|
+
expect(existsSync(path.join(chatsDir, sessions[2].fileName))).toBe(false);
|
|
208
|
+
// Verify artifacts for an old session are gone
|
|
209
|
+
expect(existsSync(path.join(logsDir, `session-${sessions[1].id}.jsonl`))).toBe(false);
|
|
210
|
+
expect(existsSync(path.join(toolOutputsDir, `session-${sessions[1].id}`))).toBe(false);
|
|
211
|
+
expect(existsSync(path.join(testTempDir, sessions[1].id))).toBe(false); // Session directory should be deleted
|
|
212
|
+
expect(existsSync(path.join(chatsDir, sessions[1].id))).toBe(false); // Subagent chats directory should be deleted
|
|
213
|
+
});
|
|
214
|
+
it('should NOT delete sessions within the cutoff date', async () => {
|
|
215
|
+
const sessions = await seedSessions(); // [current, 14d, 30d]
|
|
216
|
+
const config = createMockConfig();
|
|
217
|
+
const settings = {
|
|
218
|
+
general: { sessionRetention: { enabled: true, maxAge: '60d' } },
|
|
219
|
+
};
|
|
220
|
+
// 60d cutoff should keep everything that was seeded
|
|
221
|
+
const result = await cleanupExpiredSessions(config, settings);
|
|
254
222
|
expect(result.deleted).toBe(0);
|
|
255
|
-
expect(result.
|
|
223
|
+
expect(result.skipped).toBe(3);
|
|
224
|
+
for (const session of sessions) {
|
|
225
|
+
expect(existsSync(path.join(chatsDir, session.fileName))).toBe(true);
|
|
226
|
+
}
|
|
256
227
|
});
|
|
257
|
-
it('should handle
|
|
228
|
+
it('should handle count-based retention (keeping N most recent)', async () => {
|
|
229
|
+
const sessions = await seedSessions(); // [current, 14d, 30d]
|
|
230
|
+
// Seed two additional granular files to prove sorting works
|
|
231
|
+
const now = new Date();
|
|
232
|
+
const threeDaysAgo = new Date(now.getTime() - 3 * 24 * 60 * 60 * 1000);
|
|
233
|
+
const fiveDaysAgo = new Date(now.getTime() - 5 * 24 * 60 * 60 * 1000);
|
|
234
|
+
await writeSessionFile({
|
|
235
|
+
id: 'recent3',
|
|
236
|
+
fileName: 'session-20250117-recent3.json',
|
|
237
|
+
lastUpdated: threeDaysAgo.toISOString(),
|
|
238
|
+
});
|
|
239
|
+
await writeArtifacts('recent3');
|
|
240
|
+
await writeSessionFile({
|
|
241
|
+
id: 'recent5',
|
|
242
|
+
fileName: 'session-20250115-recent5.json',
|
|
243
|
+
lastUpdated: fiveDaysAgo.toISOString(),
|
|
244
|
+
});
|
|
245
|
+
await writeArtifacts('recent5');
|
|
258
246
|
const config = createMockConfig();
|
|
259
247
|
const settings = {
|
|
260
248
|
general: {
|
|
261
249
|
sessionRetention: {
|
|
262
250
|
enabled: true,
|
|
263
|
-
|
|
251
|
+
maxCount: 3, // Keep current + 2 most recent (which should be 3d and 5d)
|
|
264
252
|
},
|
|
265
253
|
},
|
|
266
254
|
};
|
|
267
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
268
255
|
const result = await cleanupExpiredSessions(config, settings);
|
|
269
|
-
expect(result.
|
|
270
|
-
expect(result.
|
|
271
|
-
expect(result.
|
|
272
|
-
expect(result.skipped).toBe(0);
|
|
256
|
+
expect(result.scanned).toBe(5);
|
|
257
|
+
expect(result.deleted).toBe(2); // Should only delete the 14d and 30d old sessions
|
|
258
|
+
expect(result.skipped).toBe(3);
|
|
273
259
|
expect(result.failed).toBe(0);
|
|
260
|
+
// Verify specifically WHICH files survived
|
|
261
|
+
expect(existsSync(path.join(chatsDir, sessions[0].fileName))).toBe(true); // current
|
|
262
|
+
expect(existsSync(path.join(chatsDir, 'session-20250117-recent3.json'))).toBe(true); // 3d
|
|
263
|
+
expect(existsSync(path.join(chatsDir, 'session-20250115-recent5.json'))).toBe(true); // 5d
|
|
264
|
+
// Verify the older ones were deleted
|
|
265
|
+
expect(existsSync(path.join(chatsDir, sessions[1].fileName))).toBe(false); // 14d
|
|
266
|
+
expect(existsSync(path.join(chatsDir, sessions[2].fileName))).toBe(false); // 30d
|
|
267
|
+
});
|
|
268
|
+
it('should delete subagent files sharing the same shortId', async () => {
|
|
269
|
+
const now = new Date();
|
|
270
|
+
const twoWeeksAgo = new Date(now.getTime() - 14 * 24 * 60 * 60 * 1000);
|
|
271
|
+
// Parent session (expired)
|
|
272
|
+
await writeSessionFile({
|
|
273
|
+
id: 'parent-uuid',
|
|
274
|
+
fileName: 'session-20250110-abc12345.json',
|
|
275
|
+
lastUpdated: twoWeeksAgo.toISOString(),
|
|
276
|
+
});
|
|
277
|
+
await writeArtifacts('parent-uuid');
|
|
278
|
+
// Subagent session (different UUID, same shortId)
|
|
279
|
+
await writeSessionFile({
|
|
280
|
+
id: 'sub-uuid',
|
|
281
|
+
fileName: 'session-20250110-subagent-abc12345.json',
|
|
282
|
+
lastUpdated: twoWeeksAgo.toISOString(),
|
|
283
|
+
});
|
|
284
|
+
await writeArtifacts('sub-uuid');
|
|
285
|
+
const config = createMockConfig();
|
|
286
|
+
const settings = {
|
|
287
|
+
general: { sessionRetention: { enabled: true, maxAge: '10d' } },
|
|
288
|
+
};
|
|
289
|
+
const result = await cleanupExpiredSessions(config, settings);
|
|
290
|
+
expect(result.deleted).toBe(2); // Both files should be deleted
|
|
291
|
+
expect(existsSync(path.join(chatsDir, 'session-20250110-abc12345.json'))).toBe(false);
|
|
292
|
+
expect(existsSync(path.join(chatsDir, 'session-20250110-subagent-abc12345.json'))).toBe(false);
|
|
293
|
+
// Artifacts for both should be gone
|
|
294
|
+
expect(existsSync(path.join(logsDir, 'session-parent-uuid.jsonl'))).toBe(false);
|
|
295
|
+
expect(existsSync(path.join(logsDir, 'session-sub-uuid.jsonl'))).toBe(false);
|
|
274
296
|
});
|
|
275
|
-
it('should
|
|
297
|
+
it('should delete corrupted session files', async () => {
|
|
298
|
+
// Write a corrupted file (invalid JSON)
|
|
299
|
+
const corruptPath = path.join(chatsDir, 'session-corrupt.json');
|
|
300
|
+
await fs.writeFile(corruptPath, 'invalid json');
|
|
276
301
|
const config = createMockConfig();
|
|
277
302
|
const settings = {
|
|
278
|
-
general: {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
303
|
+
general: { sessionRetention: { enabled: true, maxAge: '10d' } },
|
|
304
|
+
};
|
|
305
|
+
const result = await cleanupExpiredSessions(config, settings);
|
|
306
|
+
expect(result.deleted).toBe(1);
|
|
307
|
+
expect(existsSync(corruptPath)).toBe(false);
|
|
308
|
+
});
|
|
309
|
+
it('should safely delete 8-character sessions containing invalid JSON', async () => {
|
|
310
|
+
const config = createMockConfig();
|
|
311
|
+
const settings = {
|
|
312
|
+
general: { sessionRetention: { enabled: true, maxAge: '1d' } },
|
|
313
|
+
};
|
|
314
|
+
const badJsonPath = path.join(chatsDir, 'session-20241225-badjson1.json');
|
|
315
|
+
await fs.writeFile(badJsonPath, 'This is raw text, not JSON');
|
|
316
|
+
const result = await cleanupExpiredSessions(config, settings);
|
|
317
|
+
expect(result.deleted).toBe(1);
|
|
318
|
+
expect(result.failed).toBe(0);
|
|
319
|
+
expect(existsSync(badJsonPath)).toBe(false);
|
|
320
|
+
});
|
|
321
|
+
it('should safely delete legacy non-8-character sessions', async () => {
|
|
322
|
+
const config = createMockConfig();
|
|
323
|
+
const settings = {
|
|
324
|
+
general: { sessionRetention: { enabled: true, maxAge: '1d' } },
|
|
325
|
+
};
|
|
326
|
+
const legacyPath = path.join(chatsDir, 'session-20241225-legacy.json');
|
|
327
|
+
// Create valid JSON so the parser succeeds, but shortId derivation fails
|
|
328
|
+
await fs.writeFile(legacyPath, JSON.stringify({
|
|
329
|
+
sessionId: 'legacy-session-id',
|
|
330
|
+
lastUpdated: '2024-12-25T00:00:00.000Z',
|
|
331
|
+
messages: [],
|
|
332
|
+
}));
|
|
333
|
+
const result = await cleanupExpiredSessions(config, settings);
|
|
334
|
+
expect(result.deleted).toBe(1);
|
|
335
|
+
expect(result.failed).toBe(0);
|
|
336
|
+
expect(existsSync(legacyPath)).toBe(false);
|
|
337
|
+
});
|
|
338
|
+
it('should silently ignore ENOENT if file is already deleted before unlink', async () => {
|
|
339
|
+
await seedSessions(); // Seeds older 2024 and 2025 sessions
|
|
340
|
+
const targetFile = path.join(chatsDir, 'session-20241225-ancient1.json');
|
|
341
|
+
let getSessionIdCalls = 0;
|
|
342
|
+
const config = createMockConfig({
|
|
343
|
+
getSessionId: () => {
|
|
344
|
+
getSessionIdCalls++;
|
|
345
|
+
// First call is for `getAllSessionFiles`.
|
|
346
|
+
// Subsequent calls are right before `fs.unlink`!
|
|
347
|
+
if (getSessionIdCalls > 1) {
|
|
348
|
+
try {
|
|
349
|
+
unlinkSync(targetFile);
|
|
350
|
+
}
|
|
351
|
+
catch {
|
|
352
|
+
/* ignore */
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return 'mock-session-id';
|
|
283
356
|
},
|
|
357
|
+
});
|
|
358
|
+
const settings = {
|
|
359
|
+
general: { sessionRetention: { enabled: true, maxAge: '1d' } },
|
|
284
360
|
};
|
|
285
|
-
// Mock getSessionFiles to throw an error
|
|
286
|
-
mockGetAllSessionFiles.mockRejectedValue(new Error('Directory access failed'));
|
|
287
361
|
const result = await cleanupExpiredSessions(config, settings);
|
|
288
|
-
|
|
289
|
-
expect(result.failed).toBe(
|
|
290
|
-
expect(debugLogger.warn).toHaveBeenCalledWith('Session cleanup failed: Directory access failed');
|
|
362
|
+
// `failed` should not increment because ENOENT is silently swallowed
|
|
363
|
+
expect(result.failed).toBe(0);
|
|
291
364
|
});
|
|
292
365
|
it('should respect minRetention configuration', async () => {
|
|
366
|
+
await seedSessions();
|
|
293
367
|
const config = createMockConfig();
|
|
294
368
|
const settings = {
|
|
295
369
|
general: {
|
|
296
370
|
sessionRetention: {
|
|
297
371
|
enabled: true,
|
|
298
|
-
maxAge: '12h', // Less than 1 day
|
|
372
|
+
maxAge: '12h', // Less than 1 day minRetention
|
|
299
373
|
minRetention: '1d',
|
|
300
374
|
},
|
|
301
375
|
},
|
|
302
376
|
};
|
|
303
377
|
const result = await cleanupExpiredSessions(config, settings);
|
|
304
|
-
// Should
|
|
378
|
+
// Should return early and not delete anything
|
|
305
379
|
expect(result.disabled).toBe(true);
|
|
306
|
-
expect(result.scanned).toBe(0);
|
|
307
380
|
expect(result.deleted).toBe(0);
|
|
308
381
|
});
|
|
309
|
-
it('should
|
|
310
|
-
const
|
|
311
|
-
|
|
382
|
+
it('should handle combined maxAge and maxCount (most restrictive wins)', async () => {
|
|
383
|
+
const sessions = await seedSessions(); // [current, 14d, 30d]
|
|
384
|
+
// Seed 3d and 5d to mirror the granular sorting test
|
|
385
|
+
const now = new Date();
|
|
386
|
+
const threeDaysAgo = new Date(now.getTime() - 3 * 24 * 60 * 60 * 1000);
|
|
387
|
+
const fiveDaysAgo = new Date(now.getTime() - 5 * 24 * 60 * 60 * 1000);
|
|
388
|
+
await writeSessionFile({
|
|
389
|
+
id: 'recent3',
|
|
390
|
+
fileName: 'session-20250117-recent3.json',
|
|
391
|
+
lastUpdated: threeDaysAgo.toISOString(),
|
|
312
392
|
});
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
};
|
|
321
|
-
// Mock successful file operations
|
|
322
|
-
mockFs.access.mockResolvedValue(undefined);
|
|
323
|
-
mockFs.readFile.mockResolvedValue(JSON.stringify({
|
|
324
|
-
sessionId: 'test',
|
|
325
|
-
messages: [],
|
|
326
|
-
startTime: '2025-01-01T00:00:00Z',
|
|
327
|
-
lastUpdated: '2025-01-01T00:00:00Z',
|
|
328
|
-
}));
|
|
329
|
-
mockFs.unlink.mockResolvedValue(undefined);
|
|
330
|
-
const debugSpy = vi
|
|
331
|
-
.spyOn(debugLogger, 'debug')
|
|
332
|
-
.mockImplementation(() => { });
|
|
333
|
-
await cleanupExpiredSessions(config, settings);
|
|
334
|
-
expect(debugSpy).toHaveBeenCalledWith(expect.stringContaining('Session cleanup: deleted'));
|
|
335
|
-
expect(debugSpy).toHaveBeenCalledWith(expect.stringContaining('Deleted expired session:'));
|
|
336
|
-
debugSpy.mockRestore();
|
|
337
|
-
});
|
|
338
|
-
});
|
|
339
|
-
describe('Specific cleanup scenarios', () => {
|
|
340
|
-
it('should delete sessions that exceed the cutoff date', async () => {
|
|
393
|
+
await writeArtifacts('recent3');
|
|
394
|
+
await writeSessionFile({
|
|
395
|
+
id: 'recent5',
|
|
396
|
+
fileName: 'session-20250115-recent5.json',
|
|
397
|
+
lastUpdated: fiveDaysAgo.toISOString(),
|
|
398
|
+
});
|
|
399
|
+
await writeArtifacts('recent5');
|
|
341
400
|
const config = createMockConfig();
|
|
342
401
|
const settings = {
|
|
343
402
|
general: {
|
|
344
403
|
sessionRetention: {
|
|
345
404
|
enabled: true,
|
|
346
|
-
|
|
405
|
+
// 20d deletes 30d.
|
|
406
|
+
// maxCount: 2 keeps current and 3d.
|
|
407
|
+
// Restrictive wins: 30d deleted by maxAge. 14d, 5d deleted by maxCount.
|
|
408
|
+
maxAge: '20d',
|
|
409
|
+
maxCount: 2,
|
|
347
410
|
},
|
|
348
411
|
},
|
|
349
412
|
};
|
|
350
|
-
// Create sessions with specific dates
|
|
351
|
-
const now = new Date();
|
|
352
|
-
const fiveDaysAgo = new Date(now.getTime() - 5 * 24 * 60 * 60 * 1000);
|
|
353
|
-
const eightDaysAgo = new Date(now.getTime() - 8 * 24 * 60 * 60 * 1000);
|
|
354
|
-
const fifteenDaysAgo = new Date(now.getTime() - 15 * 24 * 60 * 60 * 1000);
|
|
355
|
-
const testSessions = [
|
|
356
|
-
{
|
|
357
|
-
id: 'current',
|
|
358
|
-
file: `${SESSION_FILE_PREFIX}current`,
|
|
359
|
-
fileName: `${SESSION_FILE_PREFIX}current.json`,
|
|
360
|
-
startTime: now.toISOString(),
|
|
361
|
-
lastUpdated: now.toISOString(),
|
|
362
|
-
messageCount: 1,
|
|
363
|
-
displayName: 'Current',
|
|
364
|
-
firstUserMessage: 'Current',
|
|
365
|
-
isCurrentSession: true,
|
|
366
|
-
index: 1,
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
id: 'session5d',
|
|
370
|
-
file: `${SESSION_FILE_PREFIX}5d`,
|
|
371
|
-
fileName: `${SESSION_FILE_PREFIX}5d.json`,
|
|
372
|
-
startTime: fiveDaysAgo.toISOString(),
|
|
373
|
-
lastUpdated: fiveDaysAgo.toISOString(),
|
|
374
|
-
messageCount: 1,
|
|
375
|
-
displayName: '5 days old',
|
|
376
|
-
firstUserMessage: '5 days',
|
|
377
|
-
isCurrentSession: false,
|
|
378
|
-
index: 2,
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
id: 'session8d',
|
|
382
|
-
file: `${SESSION_FILE_PREFIX}8d`,
|
|
383
|
-
fileName: `${SESSION_FILE_PREFIX}8d.json`,
|
|
384
|
-
startTime: eightDaysAgo.toISOString(),
|
|
385
|
-
lastUpdated: eightDaysAgo.toISOString(),
|
|
386
|
-
messageCount: 1,
|
|
387
|
-
displayName: '8 days old',
|
|
388
|
-
firstUserMessage: '8 days',
|
|
389
|
-
isCurrentSession: false,
|
|
390
|
-
index: 3,
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
id: 'session15d',
|
|
394
|
-
file: `${SESSION_FILE_PREFIX}15d`,
|
|
395
|
-
fileName: `${SESSION_FILE_PREFIX}15d.json`,
|
|
396
|
-
startTime: fifteenDaysAgo.toISOString(),
|
|
397
|
-
lastUpdated: fifteenDaysAgo.toISOString(),
|
|
398
|
-
messageCount: 1,
|
|
399
|
-
displayName: '15 days old',
|
|
400
|
-
firstUserMessage: '15 days',
|
|
401
|
-
isCurrentSession: false,
|
|
402
|
-
index: 4,
|
|
403
|
-
},
|
|
404
|
-
];
|
|
405
|
-
mockGetAllSessionFiles.mockResolvedValue(testSessions.map((session) => ({
|
|
406
|
-
fileName: session.fileName,
|
|
407
|
-
sessionInfo: session,
|
|
408
|
-
})));
|
|
409
|
-
// Mock successful file operations
|
|
410
|
-
mockFs.access.mockResolvedValue(undefined);
|
|
411
|
-
mockFs.readFile.mockResolvedValue(JSON.stringify({
|
|
412
|
-
sessionId: 'test',
|
|
413
|
-
messages: [],
|
|
414
|
-
startTime: '2025-01-01T00:00:00Z',
|
|
415
|
-
lastUpdated: '2025-01-01T00:00:00Z',
|
|
416
|
-
}));
|
|
417
|
-
mockFs.unlink.mockResolvedValue(undefined);
|
|
418
413
|
const result = await cleanupExpiredSessions(config, settings);
|
|
419
|
-
|
|
420
|
-
expect(result.
|
|
421
|
-
expect(result.
|
|
422
|
-
expect(result.
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
expect(
|
|
428
|
-
expect(
|
|
414
|
+
expect(result.scanned).toBe(5);
|
|
415
|
+
expect(result.deleted).toBe(3); // deletes 5d, 14d, 30d
|
|
416
|
+
expect(result.skipped).toBe(2); // keeps current, 3d
|
|
417
|
+
expect(result.failed).toBe(0);
|
|
418
|
+
// Assert kept
|
|
419
|
+
expect(existsSync(path.join(chatsDir, sessions[0].fileName))).toBe(true); // current
|
|
420
|
+
expect(existsSync(path.join(chatsDir, 'session-20250117-recent3.json'))).toBe(true); // 3d
|
|
421
|
+
// Assert deleted
|
|
422
|
+
expect(existsSync(path.join(chatsDir, 'session-20250115-recent5.json'))).toBe(false); // 5d
|
|
423
|
+
expect(existsSync(path.join(chatsDir, sessions[1].fileName))).toBe(false); // 14d
|
|
424
|
+
expect(existsSync(path.join(chatsDir, sessions[2].fileName))).toBe(false); // 30d
|
|
429
425
|
});
|
|
430
|
-
it('should
|
|
426
|
+
it('should handle empty sessions directory', async () => {
|
|
431
427
|
const config = createMockConfig();
|
|
432
428
|
const settings = {
|
|
433
|
-
general: {
|
|
434
|
-
sessionRetention: {
|
|
435
|
-
enabled: true,
|
|
436
|
-
maxAge: '14d', // Keep sessions for 14 days
|
|
437
|
-
},
|
|
438
|
-
},
|
|
429
|
+
general: { sessionRetention: { enabled: true, maxAge: '30d' } },
|
|
439
430
|
};
|
|
440
|
-
// Create sessions all within the retention period
|
|
441
|
-
const now = new Date();
|
|
442
|
-
const oneDayAgo = new Date(now.getTime() - 1 * 24 * 60 * 60 * 1000);
|
|
443
|
-
const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
|
|
444
|
-
const thirteenDaysAgo = new Date(now.getTime() - 13 * 24 * 60 * 60 * 1000);
|
|
445
|
-
const testSessions = [
|
|
446
|
-
{
|
|
447
|
-
id: 'current',
|
|
448
|
-
file: `${SESSION_FILE_PREFIX}current`,
|
|
449
|
-
fileName: `${SESSION_FILE_PREFIX}current.json`,
|
|
450
|
-
startTime: now.toISOString(),
|
|
451
|
-
lastUpdated: now.toISOString(),
|
|
452
|
-
messageCount: 1,
|
|
453
|
-
displayName: 'Current',
|
|
454
|
-
firstUserMessage: 'Current',
|
|
455
|
-
isCurrentSession: true,
|
|
456
|
-
index: 1,
|
|
457
|
-
},
|
|
458
|
-
{
|
|
459
|
-
id: 'session1d',
|
|
460
|
-
file: `${SESSION_FILE_PREFIX}1d`,
|
|
461
|
-
fileName: `${SESSION_FILE_PREFIX}1d.json`,
|
|
462
|
-
startTime: oneDayAgo.toISOString(),
|
|
463
|
-
lastUpdated: oneDayAgo.toISOString(),
|
|
464
|
-
messageCount: 1,
|
|
465
|
-
displayName: '1 day old',
|
|
466
|
-
firstUserMessage: '1 day',
|
|
467
|
-
isCurrentSession: false,
|
|
468
|
-
index: 2,
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
id: 'session7d',
|
|
472
|
-
file: `${SESSION_FILE_PREFIX}7d`,
|
|
473
|
-
fileName: `${SESSION_FILE_PREFIX}7d.json`,
|
|
474
|
-
startTime: sevenDaysAgo.toISOString(),
|
|
475
|
-
lastUpdated: sevenDaysAgo.toISOString(),
|
|
476
|
-
messageCount: 1,
|
|
477
|
-
displayName: '7 days old',
|
|
478
|
-
firstUserMessage: '7 days',
|
|
479
|
-
isCurrentSession: false,
|
|
480
|
-
index: 3,
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
id: 'session13d',
|
|
484
|
-
file: `${SESSION_FILE_PREFIX}13d`,
|
|
485
|
-
fileName: `${SESSION_FILE_PREFIX}13d.json`,
|
|
486
|
-
startTime: thirteenDaysAgo.toISOString(),
|
|
487
|
-
lastUpdated: thirteenDaysAgo.toISOString(),
|
|
488
|
-
messageCount: 1,
|
|
489
|
-
displayName: '13 days old',
|
|
490
|
-
firstUserMessage: '13 days',
|
|
491
|
-
isCurrentSession: false,
|
|
492
|
-
index: 4,
|
|
493
|
-
},
|
|
494
|
-
];
|
|
495
|
-
mockGetAllSessionFiles.mockResolvedValue(testSessions.map((session) => ({
|
|
496
|
-
fileName: session.fileName,
|
|
497
|
-
sessionInfo: session,
|
|
498
|
-
})));
|
|
499
|
-
// Mock successful file operations
|
|
500
|
-
mockFs.access.mockResolvedValue(undefined);
|
|
501
|
-
mockFs.readFile.mockResolvedValue(JSON.stringify({
|
|
502
|
-
sessionId: 'test',
|
|
503
|
-
messages: [],
|
|
504
|
-
startTime: '2025-01-01T00:00:00Z',
|
|
505
|
-
lastUpdated: '2025-01-01T00:00:00Z',
|
|
506
|
-
}));
|
|
507
|
-
mockFs.unlink.mockResolvedValue(undefined);
|
|
508
431
|
const result = await cleanupExpiredSessions(config, settings);
|
|
509
|
-
// Should NOT delete any sessions as all are within 14 days
|
|
510
432
|
expect(result.disabled).toBe(false);
|
|
511
|
-
expect(result.scanned).toBe(
|
|
433
|
+
expect(result.scanned).toBe(0);
|
|
512
434
|
expect(result.deleted).toBe(0);
|
|
513
|
-
expect(result.skipped).toBe(
|
|
435
|
+
expect(result.skipped).toBe(0);
|
|
514
436
|
expect(result.failed).toBe(0);
|
|
515
|
-
// Verify no files were deleted
|
|
516
|
-
expect(mockFs.unlink).not.toHaveBeenCalled();
|
|
517
437
|
});
|
|
518
|
-
|
|
438
|
+
});
|
|
439
|
+
describe('Error handling & resilience', () => {
|
|
440
|
+
it.skipIf(process.platform === 'win32')('should handle file system errors gracefully (e.g., EACCES)', async () => {
|
|
441
|
+
const sessions = await seedSessions();
|
|
519
442
|
const config = createMockConfig();
|
|
520
443
|
const settings = {
|
|
521
|
-
general: {
|
|
522
|
-
sessionRetention: {
|
|
523
|
-
enabled: true,
|
|
524
|
-
maxCount: 3, // Keep only 3 most recent sessions
|
|
525
|
-
},
|
|
526
|
-
},
|
|
444
|
+
general: { sessionRetention: { enabled: true, maxAge: '1d' } },
|
|
527
445
|
};
|
|
528
|
-
//
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
firstUserMessage: 'Current',
|
|
540
|
-
isCurrentSession: true,
|
|
541
|
-
index: 1,
|
|
542
|
-
},
|
|
543
|
-
];
|
|
544
|
-
// Add 5 more sessions with decreasing timestamps
|
|
545
|
-
for (let i = 1; i <= 5; i++) {
|
|
546
|
-
const daysAgo = new Date(now.getTime() - i * 24 * 60 * 60 * 1000);
|
|
547
|
-
sessions.push({
|
|
548
|
-
id: `session${i}`,
|
|
549
|
-
file: `${SESSION_FILE_PREFIX}${i}d`,
|
|
550
|
-
fileName: `${SESSION_FILE_PREFIX}${i}d.json`,
|
|
551
|
-
startTime: daysAgo.toISOString(),
|
|
552
|
-
lastUpdated: daysAgo.toISOString(),
|
|
553
|
-
messageCount: 1,
|
|
554
|
-
displayName: `${i} days old`,
|
|
555
|
-
firstUserMessage: `${i} days`,
|
|
556
|
-
isCurrentSession: false,
|
|
557
|
-
index: i + 1,
|
|
558
|
-
});
|
|
446
|
+
// Make one of the files read-only and its parent directory read-only to simulate EACCES during unlink
|
|
447
|
+
const targetFile = path.join(chatsDir, sessions[1].fileName);
|
|
448
|
+
await fs.chmod(targetFile, 0o444);
|
|
449
|
+
// Wait we want unlink to fail, so we make the directory read-only temporarily
|
|
450
|
+
await fs.chmod(chatsDir, 0o555);
|
|
451
|
+
try {
|
|
452
|
+
const result = await cleanupExpiredSessions(config, settings);
|
|
453
|
+
// It shouldn't crash
|
|
454
|
+
expect(result.disabled).toBe(false);
|
|
455
|
+
// It should have tried and failed to delete the old session
|
|
456
|
+
expect(result.failed).toBeGreaterThan(0);
|
|
559
457
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
458
|
+
finally {
|
|
459
|
+
// Restore permissions so cleanup can proceed in afterEach
|
|
460
|
+
await fs.chmod(chatsDir, 0o777);
|
|
461
|
+
await fs.chmod(targetFile, 0o666);
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
it.skipIf(process.platform === 'win32')('should handle global read errors gracefully', async () => {
|
|
465
|
+
const config = createMockConfig();
|
|
466
|
+
const settings = {
|
|
467
|
+
general: { sessionRetention: { enabled: true, maxAge: '1d' } },
|
|
468
|
+
};
|
|
469
|
+
// Make the chats directory unreadable
|
|
470
|
+
await fs.chmod(chatsDir, 0o000);
|
|
471
|
+
try {
|
|
472
|
+
const result = await cleanupExpiredSessions(config, settings);
|
|
473
|
+
// It shouldn't crash, but it should fail
|
|
474
|
+
expect(result.disabled).toBe(false);
|
|
475
|
+
expect(result.failed).toBe(1);
|
|
476
|
+
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Session cleanup failed'));
|
|
477
|
+
}
|
|
478
|
+
finally {
|
|
479
|
+
await fs.chmod(chatsDir, 0o777);
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
it('should NOT delete tempDir if safeSessionId is empty', async () => {
|
|
483
|
+
const config = createMockConfig();
|
|
484
|
+
const settings = {
|
|
485
|
+
general: { sessionRetention: { enabled: true, maxAge: '1d' } },
|
|
486
|
+
};
|
|
487
|
+
const sessions = await seedSessions();
|
|
488
|
+
const targetFile = path.join(chatsDir, sessions[1].fileName);
|
|
489
|
+
// Write a session ID that sanitizeFilenamePart will turn into an empty string ""
|
|
490
|
+
await fs.writeFile(targetFile, JSON.stringify({ sessionId: '../../..' }));
|
|
491
|
+
const tempDir = config.storage.getProjectTempDir();
|
|
492
|
+
expect(existsSync(tempDir)).toBe(true);
|
|
493
|
+
await cleanupExpiredSessions(config, settings);
|
|
494
|
+
// It must NOT delete the tempDir root
|
|
495
|
+
expect(existsSync(tempDir)).toBe(true);
|
|
496
|
+
});
|
|
497
|
+
it('should handle unexpected errors without throwing (e.g. string errors)', async () => {
|
|
498
|
+
await seedSessions();
|
|
499
|
+
const config = createMockConfig({
|
|
500
|
+
getSessionId: () => {
|
|
501
|
+
const stringError = 'String error';
|
|
502
|
+
throw stringError; // Throw a non-Error string without triggering no-restricted-syntax
|
|
503
|
+
},
|
|
504
|
+
});
|
|
505
|
+
const settings = {
|
|
506
|
+
general: { sessionRetention: { enabled: true, maxCount: 1 } },
|
|
507
|
+
};
|
|
573
508
|
const result = await cleanupExpiredSessions(config, settings);
|
|
574
|
-
// Should keep current + 2 most recent (1d and 2d), delete 3d, 4d, 5d
|
|
575
509
|
expect(result.disabled).toBe(false);
|
|
576
|
-
expect(result.
|
|
577
|
-
expect(result.deleted).toBe(3);
|
|
578
|
-
expect(result.skipped).toBe(3);
|
|
579
|
-
// Verify which files were deleted (should be the 3 oldest)
|
|
580
|
-
const unlinkCalls = mockFs.unlink.mock.calls.map((call) => call[0]);
|
|
581
|
-
expect(unlinkCalls).toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}3d.json`));
|
|
582
|
-
expect(unlinkCalls).toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}4d.json`));
|
|
583
|
-
expect(unlinkCalls).toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}5d.json`));
|
|
584
|
-
// Verify which files were NOT deleted
|
|
585
|
-
expect(unlinkCalls).not.toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}current.json`));
|
|
586
|
-
expect(unlinkCalls).not.toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}1d.json`));
|
|
587
|
-
expect(unlinkCalls).not.toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}2d.json`));
|
|
510
|
+
expect(result.failed).toBeGreaterThan(0);
|
|
588
511
|
});
|
|
589
|
-
it('should
|
|
512
|
+
it('should never run on the current session', async () => {
|
|
513
|
+
await seedSessions();
|
|
590
514
|
const config = createMockConfig();
|
|
591
515
|
const settings = {
|
|
592
516
|
general: {
|
|
593
517
|
sessionRetention: {
|
|
594
518
|
enabled: true,
|
|
595
|
-
|
|
596
|
-
maxCount: 2, // But also keep only 2 most recent
|
|
519
|
+
maxCount: 1, // Keep only 1 session (which will be the current one)
|
|
597
520
|
},
|
|
598
521
|
},
|
|
599
522
|
};
|
|
600
|
-
// Create sessions where maxCount is more restrictive
|
|
601
|
-
const now = new Date();
|
|
602
|
-
const threeDaysAgo = new Date(now.getTime() - 3 * 24 * 60 * 60 * 1000);
|
|
603
|
-
const fiveDaysAgo = new Date(now.getTime() - 5 * 24 * 60 * 60 * 1000);
|
|
604
|
-
const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
|
|
605
|
-
const twelveDaysAgo = new Date(now.getTime() - 12 * 24 * 60 * 60 * 1000);
|
|
606
|
-
const testSessions = [
|
|
607
|
-
{
|
|
608
|
-
id: 'current',
|
|
609
|
-
file: `${SESSION_FILE_PREFIX}current`,
|
|
610
|
-
fileName: `${SESSION_FILE_PREFIX}current.json`,
|
|
611
|
-
startTime: now.toISOString(),
|
|
612
|
-
lastUpdated: now.toISOString(),
|
|
613
|
-
messageCount: 1,
|
|
614
|
-
displayName: 'Current',
|
|
615
|
-
firstUserMessage: 'Current',
|
|
616
|
-
isCurrentSession: true,
|
|
617
|
-
index: 1,
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
id: 'session3d',
|
|
621
|
-
file: `${SESSION_FILE_PREFIX}3d`,
|
|
622
|
-
fileName: `${SESSION_FILE_PREFIX}3d.json`,
|
|
623
|
-
startTime: threeDaysAgo.toISOString(),
|
|
624
|
-
lastUpdated: threeDaysAgo.toISOString(),
|
|
625
|
-
messageCount: 1,
|
|
626
|
-
displayName: '3 days old',
|
|
627
|
-
firstUserMessage: '3 days',
|
|
628
|
-
isCurrentSession: false,
|
|
629
|
-
index: 2,
|
|
630
|
-
},
|
|
631
|
-
{
|
|
632
|
-
id: 'session5d',
|
|
633
|
-
file: `${SESSION_FILE_PREFIX}5d`,
|
|
634
|
-
fileName: `${SESSION_FILE_PREFIX}5d.json`,
|
|
635
|
-
startTime: fiveDaysAgo.toISOString(),
|
|
636
|
-
lastUpdated: fiveDaysAgo.toISOString(),
|
|
637
|
-
messageCount: 1,
|
|
638
|
-
displayName: '5 days old',
|
|
639
|
-
firstUserMessage: '5 days',
|
|
640
|
-
isCurrentSession: false,
|
|
641
|
-
index: 3,
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
id: 'session7d',
|
|
645
|
-
file: `${SESSION_FILE_PREFIX}7d`,
|
|
646
|
-
fileName: `${SESSION_FILE_PREFIX}7d.json`,
|
|
647
|
-
startTime: sevenDaysAgo.toISOString(),
|
|
648
|
-
lastUpdated: sevenDaysAgo.toISOString(),
|
|
649
|
-
messageCount: 1,
|
|
650
|
-
displayName: '7 days old',
|
|
651
|
-
firstUserMessage: '7 days',
|
|
652
|
-
isCurrentSession: false,
|
|
653
|
-
index: 4,
|
|
654
|
-
},
|
|
655
|
-
{
|
|
656
|
-
id: 'session12d',
|
|
657
|
-
file: `${SESSION_FILE_PREFIX}12d`,
|
|
658
|
-
fileName: `${SESSION_FILE_PREFIX}12d.json`,
|
|
659
|
-
startTime: twelveDaysAgo.toISOString(),
|
|
660
|
-
lastUpdated: twelveDaysAgo.toISOString(),
|
|
661
|
-
messageCount: 1,
|
|
662
|
-
displayName: '12 days old',
|
|
663
|
-
firstUserMessage: '12 days',
|
|
664
|
-
isCurrentSession: false,
|
|
665
|
-
index: 5,
|
|
666
|
-
},
|
|
667
|
-
];
|
|
668
|
-
mockGetAllSessionFiles.mockResolvedValue(testSessions.map((session) => ({
|
|
669
|
-
fileName: session.fileName,
|
|
670
|
-
sessionInfo: session,
|
|
671
|
-
})));
|
|
672
|
-
// Mock successful file operations
|
|
673
|
-
mockFs.access.mockResolvedValue(undefined);
|
|
674
|
-
mockFs.readFile.mockResolvedValue(JSON.stringify({
|
|
675
|
-
sessionId: 'test',
|
|
676
|
-
messages: [],
|
|
677
|
-
startTime: '2025-01-01T00:00:00Z',
|
|
678
|
-
lastUpdated: '2025-01-01T00:00:00Z',
|
|
679
|
-
}));
|
|
680
|
-
mockFs.unlink.mockResolvedValue(undefined);
|
|
681
523
|
const result = await cleanupExpiredSessions(config, settings);
|
|
682
|
-
|
|
683
|
-
//
|
|
684
|
-
|
|
685
|
-
expect(
|
|
686
|
-
expect(result.scanned).toBe(5);
|
|
687
|
-
expect(result.deleted).toBe(3);
|
|
688
|
-
expect(result.skipped).toBe(2); // Current + 3d session
|
|
689
|
-
// Verify which files were deleted
|
|
690
|
-
const unlinkCalls = mockFs.unlink.mock.calls.map((call) => call[0]);
|
|
691
|
-
expect(unlinkCalls).toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}5d.json`));
|
|
692
|
-
expect(unlinkCalls).toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}7d.json`));
|
|
693
|
-
expect(unlinkCalls).toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}12d.json`));
|
|
694
|
-
// Verify which files were NOT deleted
|
|
695
|
-
expect(unlinkCalls).not.toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}current.json`));
|
|
696
|
-
expect(unlinkCalls).not.toContain(path.join('/tmp/test-project', 'chats', `${SESSION_FILE_PREFIX}3d.json`));
|
|
524
|
+
expect(result.deleted).toBe(2);
|
|
525
|
+
expect(result.skipped).toBe(1); // The current session
|
|
526
|
+
const currentSessionFile = (await fs.readdir(chatsDir)).find((f) => f.includes('current1'));
|
|
527
|
+
expect(currentSessionFile).toBeDefined();
|
|
697
528
|
});
|
|
698
529
|
});
|
|
699
|
-
describe('
|
|
700
|
-
//
|
|
530
|
+
describe('Format parsing & validation', () => {
|
|
531
|
+
// Valid formats
|
|
701
532
|
it.each([
|
|
702
|
-
['1h'
|
|
703
|
-
['24h'
|
|
704
|
-
['168h'
|
|
705
|
-
['1d'
|
|
706
|
-
['7d'
|
|
707
|
-
['30d'
|
|
708
|
-
['365d'
|
|
709
|
-
['1w'
|
|
710
|
-
['2w'
|
|
711
|
-
['4w'
|
|
712
|
-
['52w'
|
|
713
|
-
['1m'
|
|
714
|
-
['3m'
|
|
715
|
-
['
|
|
716
|
-
['
|
|
717
|
-
])('should
|
|
533
|
+
['1h'],
|
|
534
|
+
['24h'],
|
|
535
|
+
['168h'],
|
|
536
|
+
['1d'],
|
|
537
|
+
['7d'],
|
|
538
|
+
['30d'],
|
|
539
|
+
['365d'],
|
|
540
|
+
['1w'],
|
|
541
|
+
['2w'],
|
|
542
|
+
['4w'],
|
|
543
|
+
['52w'],
|
|
544
|
+
['1m'],
|
|
545
|
+
['3m'],
|
|
546
|
+
['12m'],
|
|
547
|
+
['9999d'],
|
|
548
|
+
])('should accept valid maxAge format %s', async (input) => {
|
|
718
549
|
const config = createMockConfig();
|
|
719
550
|
const settings = {
|
|
720
551
|
general: {
|
|
721
552
|
sessionRetention: {
|
|
722
553
|
enabled: true,
|
|
723
554
|
maxAge: input,
|
|
724
|
-
// Set minRetention to 1h to allow testing of hour-based maxAge values
|
|
725
555
|
minRetention: '1h',
|
|
726
556
|
},
|
|
727
557
|
},
|
|
728
558
|
};
|
|
729
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
730
|
-
// If it parses correctly, cleanup should proceed without error
|
|
731
559
|
const result = await cleanupExpiredSessions(config, settings);
|
|
732
560
|
expect(result.disabled).toBe(false);
|
|
733
561
|
expect(result.failed).toBe(0);
|
|
734
562
|
});
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
'30', // Missing unit
|
|
738
|
-
'30x', // Invalid unit
|
|
739
|
-
'd', // No number
|
|
740
|
-
'1.5d', // Decimal not supported
|
|
741
|
-
'-5d', // Negative number
|
|
742
|
-
'1 d', // Space in format
|
|
743
|
-
'1dd', // Double unit
|
|
744
|
-
'abc', // Non-numeric
|
|
745
|
-
'30s', // Unsupported unit (seconds)
|
|
746
|
-
'30y', // Unsupported unit (years)
|
|
747
|
-
'0d', // Zero value (technically valid regex but semantically invalid)
|
|
748
|
-
])('should reject invalid format %s', async (input) => {
|
|
749
|
-
const config = createMockConfig({
|
|
750
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
751
|
-
});
|
|
563
|
+
it('should accept maxAge equal to minRetention', async () => {
|
|
564
|
+
const config = createMockConfig();
|
|
752
565
|
const settings = {
|
|
753
566
|
general: {
|
|
754
|
-
sessionRetention: {
|
|
755
|
-
enabled: true,
|
|
756
|
-
maxAge: input,
|
|
757
|
-
},
|
|
567
|
+
sessionRetention: { enabled: true, maxAge: '1d', minRetention: '1d' },
|
|
758
568
|
},
|
|
759
569
|
};
|
|
760
570
|
const result = await cleanupExpiredSessions(config, settings);
|
|
761
|
-
expect(result.disabled).toBe(
|
|
762
|
-
expect(result.scanned).toBe(0);
|
|
763
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining(input === '0d'
|
|
764
|
-
? 'Invalid retention period: 0d. Value must be greater than 0'
|
|
765
|
-
: `Invalid retention period format: ${input}`));
|
|
571
|
+
expect(result.disabled).toBe(false);
|
|
766
572
|
});
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
const config = createMockConfig({
|
|
770
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
771
|
-
});
|
|
573
|
+
it('should accept maxCount = 1000 (maximum valid)', async () => {
|
|
574
|
+
const config = createMockConfig();
|
|
772
575
|
const settings = {
|
|
773
|
-
general: {
|
|
774
|
-
sessionRetention: {
|
|
775
|
-
enabled: true,
|
|
776
|
-
maxAge: '',
|
|
777
|
-
},
|
|
778
|
-
},
|
|
576
|
+
general: { sessionRetention: { enabled: true, maxCount: 1000 } },
|
|
779
577
|
};
|
|
780
578
|
const result = await cleanupExpiredSessions(config, settings);
|
|
781
|
-
expect(result.disabled).toBe(
|
|
782
|
-
expect(result.scanned).toBe(0);
|
|
783
|
-
// Empty string means no valid retention method specified
|
|
784
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Either maxAge or maxCount must be specified'));
|
|
579
|
+
expect(result.disabled).toBe(false);
|
|
785
580
|
});
|
|
786
|
-
|
|
787
|
-
|
|
581
|
+
it('should reject maxAge less than default minRetention (1d)', async () => {
|
|
582
|
+
await seedSessions();
|
|
788
583
|
const config = createMockConfig();
|
|
789
584
|
const settings = {
|
|
790
585
|
general: {
|
|
791
586
|
sessionRetention: {
|
|
792
587
|
enabled: true,
|
|
793
|
-
maxAge: '
|
|
588
|
+
maxAge: '12h',
|
|
589
|
+
// Note: No minRetention provided here, should default to 1d
|
|
794
590
|
},
|
|
795
591
|
},
|
|
796
592
|
};
|
|
797
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
798
593
|
const result = await cleanupExpiredSessions(config, settings);
|
|
799
|
-
expect(result.disabled).toBe(
|
|
800
|
-
expect(
|
|
594
|
+
expect(result.disabled).toBe(true);
|
|
595
|
+
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('maxAge cannot be less than minRetention'));
|
|
801
596
|
});
|
|
802
|
-
it('should
|
|
803
|
-
const config = createMockConfig(
|
|
804
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
805
|
-
});
|
|
597
|
+
it('should reject maxAge less than custom minRetention', async () => {
|
|
598
|
+
const config = createMockConfig();
|
|
806
599
|
const settings = {
|
|
807
600
|
general: {
|
|
808
601
|
sessionRetention: {
|
|
809
602
|
enabled: true,
|
|
810
|
-
maxAge: '
|
|
811
|
-
minRetention: '
|
|
603
|
+
maxAge: '2d',
|
|
604
|
+
minRetention: '3d', // maxAge < minRetention
|
|
812
605
|
},
|
|
813
606
|
},
|
|
814
607
|
};
|
|
815
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
816
|
-
// Should fall back to default minRetention and proceed
|
|
817
608
|
const result = await cleanupExpiredSessions(config, settings);
|
|
818
|
-
|
|
819
|
-
expect(
|
|
820
|
-
expect(result.failed).toBe(0);
|
|
609
|
+
expect(result.disabled).toBe(true);
|
|
610
|
+
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('maxAge cannot be less than minRetention (3d)'));
|
|
821
611
|
});
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
it('should require either maxAge or maxCount', async () => {
|
|
825
|
-
const config = createMockConfig({
|
|
826
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
827
|
-
});
|
|
612
|
+
it('should reject zero value with a specific error message', async () => {
|
|
613
|
+
const config = createMockConfig();
|
|
828
614
|
const settings = {
|
|
829
|
-
general: {
|
|
830
|
-
sessionRetention: {
|
|
831
|
-
enabled: true,
|
|
832
|
-
// Neither maxAge nor maxCount specified
|
|
833
|
-
},
|
|
834
|
-
},
|
|
615
|
+
general: { sessionRetention: { enabled: true, maxAge: '0d' } },
|
|
835
616
|
};
|
|
836
617
|
const result = await cleanupExpiredSessions(config, settings);
|
|
837
618
|
expect(result.disabled).toBe(true);
|
|
838
|
-
expect(
|
|
839
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Either maxAge or maxCount must be specified'));
|
|
619
|
+
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Value must be greater than 0'));
|
|
840
620
|
});
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
621
|
+
// Invalid formats
|
|
622
|
+
it.each([
|
|
623
|
+
['30'],
|
|
624
|
+
['30x'],
|
|
625
|
+
['d'],
|
|
626
|
+
['1.5d'],
|
|
627
|
+
['-5d'],
|
|
628
|
+
['1 d'],
|
|
629
|
+
['1dd'],
|
|
630
|
+
['abc'],
|
|
631
|
+
['30s'],
|
|
632
|
+
['30y'],
|
|
633
|
+
])('should reject invalid maxAge format %s', async (input) => {
|
|
634
|
+
const config = createMockConfig();
|
|
845
635
|
const settings = {
|
|
846
|
-
general: {
|
|
847
|
-
sessionRetention: {
|
|
848
|
-
enabled: true,
|
|
849
|
-
maxCount: 0, // Invalid count
|
|
850
|
-
},
|
|
851
|
-
},
|
|
636
|
+
general: { sessionRetention: { enabled: true, maxAge: input } },
|
|
852
637
|
};
|
|
853
638
|
const result = await cleanupExpiredSessions(config, settings);
|
|
854
639
|
expect(result.disabled).toBe(true);
|
|
855
|
-
expect(
|
|
856
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('maxCount must be at least 1'));
|
|
857
|
-
});
|
|
858
|
-
describe('maxAge format validation', () => {
|
|
859
|
-
it('should reject invalid maxAge format - no unit', async () => {
|
|
860
|
-
const config = createMockConfig({
|
|
861
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
862
|
-
});
|
|
863
|
-
const settings = {
|
|
864
|
-
general: {
|
|
865
|
-
sessionRetention: {
|
|
866
|
-
enabled: true,
|
|
867
|
-
maxAge: '30', // Missing unit
|
|
868
|
-
},
|
|
869
|
-
},
|
|
870
|
-
};
|
|
871
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
872
|
-
expect(result.disabled).toBe(true);
|
|
873
|
-
expect(result.scanned).toBe(0);
|
|
874
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Invalid retention period format: 30'));
|
|
875
|
-
});
|
|
876
|
-
it('should reject invalid maxAge format - invalid unit', async () => {
|
|
877
|
-
const config = createMockConfig({
|
|
878
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
879
|
-
});
|
|
880
|
-
const settings = {
|
|
881
|
-
general: {
|
|
882
|
-
sessionRetention: {
|
|
883
|
-
enabled: true,
|
|
884
|
-
maxAge: '30x', // Invalid unit 'x'
|
|
885
|
-
},
|
|
886
|
-
},
|
|
887
|
-
};
|
|
888
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
889
|
-
expect(result.disabled).toBe(true);
|
|
890
|
-
expect(result.scanned).toBe(0);
|
|
891
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Invalid retention period format: 30x'));
|
|
892
|
-
});
|
|
893
|
-
it('should reject invalid maxAge format - no number', async () => {
|
|
894
|
-
const config = createMockConfig({
|
|
895
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
896
|
-
});
|
|
897
|
-
const settings = {
|
|
898
|
-
general: {
|
|
899
|
-
sessionRetention: {
|
|
900
|
-
enabled: true,
|
|
901
|
-
maxAge: 'd', // No number
|
|
902
|
-
},
|
|
903
|
-
},
|
|
904
|
-
};
|
|
905
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
906
|
-
expect(result.disabled).toBe(true);
|
|
907
|
-
expect(result.scanned).toBe(0);
|
|
908
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Invalid retention period format: d'));
|
|
909
|
-
});
|
|
910
|
-
it('should reject invalid maxAge format - decimal number', async () => {
|
|
911
|
-
const config = createMockConfig({
|
|
912
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
913
|
-
});
|
|
914
|
-
const settings = {
|
|
915
|
-
general: {
|
|
916
|
-
sessionRetention: {
|
|
917
|
-
enabled: true,
|
|
918
|
-
maxAge: '1.5d', // Decimal not supported
|
|
919
|
-
},
|
|
920
|
-
},
|
|
921
|
-
};
|
|
922
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
923
|
-
expect(result.disabled).toBe(true);
|
|
924
|
-
expect(result.scanned).toBe(0);
|
|
925
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Invalid retention period format: 1.5d'));
|
|
926
|
-
});
|
|
927
|
-
it('should reject invalid maxAge format - negative number', async () => {
|
|
928
|
-
const config = createMockConfig({
|
|
929
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
930
|
-
});
|
|
931
|
-
const settings = {
|
|
932
|
-
general: {
|
|
933
|
-
sessionRetention: {
|
|
934
|
-
enabled: true,
|
|
935
|
-
maxAge: '-5d', // Negative not allowed
|
|
936
|
-
},
|
|
937
|
-
},
|
|
938
|
-
};
|
|
939
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
940
|
-
expect(result.disabled).toBe(true);
|
|
941
|
-
expect(result.scanned).toBe(0);
|
|
942
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Invalid retention period format: -5d'));
|
|
943
|
-
});
|
|
944
|
-
it('should accept valid maxAge format - hours', async () => {
|
|
945
|
-
const config = createMockConfig();
|
|
946
|
-
const settings = {
|
|
947
|
-
general: {
|
|
948
|
-
sessionRetention: {
|
|
949
|
-
enabled: true,
|
|
950
|
-
maxAge: '48h', // Valid: 48 hours
|
|
951
|
-
maxCount: 10, // Need at least one valid retention method
|
|
952
|
-
},
|
|
953
|
-
},
|
|
954
|
-
};
|
|
955
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
956
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
957
|
-
// Should not reject the configuration
|
|
958
|
-
expect(result.disabled).toBe(false);
|
|
959
|
-
expect(result.scanned).toBe(0);
|
|
960
|
-
expect(result.failed).toBe(0);
|
|
961
|
-
});
|
|
962
|
-
it('should accept valid maxAge format - days', async () => {
|
|
963
|
-
const config = createMockConfig();
|
|
964
|
-
const settings = {
|
|
965
|
-
general: {
|
|
966
|
-
sessionRetention: {
|
|
967
|
-
enabled: true,
|
|
968
|
-
maxAge: '7d', // Valid: 7 days
|
|
969
|
-
},
|
|
970
|
-
},
|
|
971
|
-
};
|
|
972
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
973
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
974
|
-
// Should not reject the configuration
|
|
975
|
-
expect(result.disabled).toBe(false);
|
|
976
|
-
expect(result.scanned).toBe(0);
|
|
977
|
-
expect(result.failed).toBe(0);
|
|
978
|
-
});
|
|
979
|
-
it('should accept valid maxAge format - weeks', async () => {
|
|
980
|
-
const config = createMockConfig();
|
|
981
|
-
const settings = {
|
|
982
|
-
general: {
|
|
983
|
-
sessionRetention: {
|
|
984
|
-
enabled: true,
|
|
985
|
-
maxAge: '2w', // Valid: 2 weeks
|
|
986
|
-
},
|
|
987
|
-
},
|
|
988
|
-
};
|
|
989
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
990
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
991
|
-
// Should not reject the configuration
|
|
992
|
-
expect(result.disabled).toBe(false);
|
|
993
|
-
expect(result.scanned).toBe(0);
|
|
994
|
-
expect(result.failed).toBe(0);
|
|
995
|
-
});
|
|
996
|
-
it('should accept valid maxAge format - months', async () => {
|
|
997
|
-
const config = createMockConfig();
|
|
998
|
-
const settings = {
|
|
999
|
-
general: {
|
|
1000
|
-
sessionRetention: {
|
|
1001
|
-
enabled: true,
|
|
1002
|
-
maxAge: '3m', // Valid: 3 months
|
|
1003
|
-
},
|
|
1004
|
-
},
|
|
1005
|
-
};
|
|
1006
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
1007
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1008
|
-
// Should not reject the configuration
|
|
1009
|
-
expect(result.disabled).toBe(false);
|
|
1010
|
-
expect(result.scanned).toBe(0);
|
|
1011
|
-
expect(result.failed).toBe(0);
|
|
1012
|
-
});
|
|
1013
|
-
});
|
|
1014
|
-
describe('minRetention validation', () => {
|
|
1015
|
-
it('should reject maxAge less than default minRetention (1d)', async () => {
|
|
1016
|
-
const config = createMockConfig({
|
|
1017
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
1018
|
-
});
|
|
1019
|
-
const settings = {
|
|
1020
|
-
general: {
|
|
1021
|
-
sessionRetention: {
|
|
1022
|
-
enabled: true,
|
|
1023
|
-
maxAge: '12h', // Less than default 1d minRetention
|
|
1024
|
-
},
|
|
1025
|
-
},
|
|
1026
|
-
};
|
|
1027
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1028
|
-
expect(result.disabled).toBe(true);
|
|
1029
|
-
expect(result.scanned).toBe(0);
|
|
1030
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('maxAge cannot be less than minRetention (1d)'));
|
|
1031
|
-
});
|
|
1032
|
-
it('should reject maxAge less than custom minRetention', async () => {
|
|
1033
|
-
const config = createMockConfig({
|
|
1034
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
1035
|
-
});
|
|
1036
|
-
const settings = {
|
|
1037
|
-
general: {
|
|
1038
|
-
sessionRetention: {
|
|
1039
|
-
enabled: true,
|
|
1040
|
-
maxAge: '2d',
|
|
1041
|
-
minRetention: '3d', // maxAge < minRetention
|
|
1042
|
-
},
|
|
1043
|
-
},
|
|
1044
|
-
};
|
|
1045
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1046
|
-
expect(result.disabled).toBe(true);
|
|
1047
|
-
expect(result.scanned).toBe(0);
|
|
1048
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('maxAge cannot be less than minRetention (3d)'));
|
|
1049
|
-
});
|
|
1050
|
-
it('should accept maxAge equal to minRetention', async () => {
|
|
1051
|
-
const config = createMockConfig();
|
|
1052
|
-
const settings = {
|
|
1053
|
-
general: {
|
|
1054
|
-
sessionRetention: {
|
|
1055
|
-
enabled: true,
|
|
1056
|
-
maxAge: '2d',
|
|
1057
|
-
minRetention: '2d', // maxAge == minRetention (edge case)
|
|
1058
|
-
},
|
|
1059
|
-
},
|
|
1060
|
-
};
|
|
1061
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
1062
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1063
|
-
// Should not reject the configuration
|
|
1064
|
-
expect(result.disabled).toBe(false);
|
|
1065
|
-
expect(result.scanned).toBe(0);
|
|
1066
|
-
expect(result.failed).toBe(0);
|
|
1067
|
-
});
|
|
1068
|
-
it('should accept maxAge greater than minRetention', async () => {
|
|
1069
|
-
const config = createMockConfig();
|
|
1070
|
-
const settings = {
|
|
1071
|
-
general: {
|
|
1072
|
-
sessionRetention: {
|
|
1073
|
-
enabled: true,
|
|
1074
|
-
maxAge: '7d',
|
|
1075
|
-
minRetention: '2d', // maxAge > minRetention
|
|
1076
|
-
},
|
|
1077
|
-
},
|
|
1078
|
-
};
|
|
1079
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
1080
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1081
|
-
// Should not reject the configuration
|
|
1082
|
-
expect(result.disabled).toBe(false);
|
|
1083
|
-
expect(result.scanned).toBe(0);
|
|
1084
|
-
expect(result.failed).toBe(0);
|
|
1085
|
-
});
|
|
1086
|
-
it('should handle invalid minRetention format gracefully', async () => {
|
|
1087
|
-
const config = createMockConfig({
|
|
1088
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
1089
|
-
});
|
|
1090
|
-
const settings = {
|
|
1091
|
-
general: {
|
|
1092
|
-
sessionRetention: {
|
|
1093
|
-
enabled: true,
|
|
1094
|
-
maxAge: '5d',
|
|
1095
|
-
minRetention: 'invalid', // Invalid format
|
|
1096
|
-
},
|
|
1097
|
-
},
|
|
1098
|
-
};
|
|
1099
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
1100
|
-
// When minRetention is invalid, it should default to 1d
|
|
1101
|
-
// Since maxAge (5d) > default minRetention (1d), this should be valid
|
|
1102
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1103
|
-
// Should not reject due to minRetention (falls back to default)
|
|
1104
|
-
expect(result.disabled).toBe(false);
|
|
1105
|
-
expect(result.scanned).toBe(0);
|
|
1106
|
-
expect(result.failed).toBe(0);
|
|
1107
|
-
});
|
|
1108
|
-
});
|
|
1109
|
-
describe('maxCount boundary validation', () => {
|
|
1110
|
-
it('should accept maxCount = 1 (minimum valid)', async () => {
|
|
1111
|
-
const config = createMockConfig();
|
|
1112
|
-
const settings = {
|
|
1113
|
-
general: {
|
|
1114
|
-
sessionRetention: {
|
|
1115
|
-
enabled: true,
|
|
1116
|
-
maxCount: 1, // Minimum valid value
|
|
1117
|
-
},
|
|
1118
|
-
},
|
|
1119
|
-
};
|
|
1120
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
1121
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1122
|
-
// Should accept the configuration
|
|
1123
|
-
expect(result.disabled).toBe(false);
|
|
1124
|
-
expect(result.scanned).toBe(0);
|
|
1125
|
-
expect(result.failed).toBe(0);
|
|
1126
|
-
});
|
|
1127
|
-
it('should accept maxCount = 1000 (maximum valid)', async () => {
|
|
1128
|
-
const config = createMockConfig();
|
|
1129
|
-
const settings = {
|
|
1130
|
-
general: {
|
|
1131
|
-
sessionRetention: {
|
|
1132
|
-
enabled: true,
|
|
1133
|
-
maxCount: 1000, // Maximum valid value
|
|
1134
|
-
},
|
|
1135
|
-
},
|
|
1136
|
-
};
|
|
1137
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
1138
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1139
|
-
// Should accept the configuration
|
|
1140
|
-
expect(result.disabled).toBe(false);
|
|
1141
|
-
expect(result.scanned).toBe(0);
|
|
1142
|
-
expect(result.failed).toBe(0);
|
|
1143
|
-
});
|
|
1144
|
-
it('should reject negative maxCount', async () => {
|
|
1145
|
-
const config = createMockConfig({
|
|
1146
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
1147
|
-
});
|
|
1148
|
-
const settings = {
|
|
1149
|
-
general: {
|
|
1150
|
-
sessionRetention: {
|
|
1151
|
-
enabled: true,
|
|
1152
|
-
maxCount: -1, // Negative value
|
|
1153
|
-
},
|
|
1154
|
-
},
|
|
1155
|
-
};
|
|
1156
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1157
|
-
expect(result.disabled).toBe(true);
|
|
1158
|
-
expect(result.scanned).toBe(0);
|
|
1159
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('maxCount must be at least 1'));
|
|
1160
|
-
});
|
|
1161
|
-
it('should accept valid maxCount in normal range', async () => {
|
|
1162
|
-
const config = createMockConfig();
|
|
1163
|
-
const settings = {
|
|
1164
|
-
general: {
|
|
1165
|
-
sessionRetention: {
|
|
1166
|
-
enabled: true,
|
|
1167
|
-
maxCount: 50, // Normal valid value
|
|
1168
|
-
},
|
|
1169
|
-
},
|
|
1170
|
-
};
|
|
1171
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
1172
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1173
|
-
// Should accept the configuration
|
|
1174
|
-
expect(result.disabled).toBe(false);
|
|
1175
|
-
expect(result.scanned).toBe(0);
|
|
1176
|
-
expect(result.failed).toBe(0);
|
|
1177
|
-
});
|
|
640
|
+
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining(`Invalid retention period format: ${input}`));
|
|
1178
641
|
});
|
|
1179
|
-
|
|
1180
|
-
it('should accept valid maxAge and maxCount together', async () => {
|
|
1181
|
-
const config = createMockConfig();
|
|
1182
|
-
const settings = {
|
|
1183
|
-
general: {
|
|
1184
|
-
sessionRetention: {
|
|
1185
|
-
enabled: true,
|
|
1186
|
-
maxAge: '30d',
|
|
1187
|
-
maxCount: 10,
|
|
1188
|
-
},
|
|
1189
|
-
},
|
|
1190
|
-
};
|
|
1191
|
-
mockGetAllSessionFiles.mockResolvedValue([]);
|
|
1192
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1193
|
-
// Should accept the configuration
|
|
1194
|
-
expect(result.disabled).toBe(false);
|
|
1195
|
-
expect(result.scanned).toBe(0);
|
|
1196
|
-
expect(result.failed).toBe(0);
|
|
1197
|
-
});
|
|
1198
|
-
it('should reject if both maxAge and maxCount are invalid', async () => {
|
|
1199
|
-
const config = createMockConfig({
|
|
1200
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
1201
|
-
});
|
|
1202
|
-
const settings = {
|
|
1203
|
-
general: {
|
|
1204
|
-
sessionRetention: {
|
|
1205
|
-
enabled: true,
|
|
1206
|
-
maxAge: 'invalid',
|
|
1207
|
-
maxCount: 0,
|
|
1208
|
-
},
|
|
1209
|
-
},
|
|
1210
|
-
};
|
|
1211
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1212
|
-
expect(result.disabled).toBe(true);
|
|
1213
|
-
expect(result.scanned).toBe(0);
|
|
1214
|
-
// Should fail on first validation error (maxAge format)
|
|
1215
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Invalid retention period format'));
|
|
1216
|
-
});
|
|
1217
|
-
it('should reject if maxAge is invalid even when maxCount is valid', async () => {
|
|
1218
|
-
const config = createMockConfig({
|
|
1219
|
-
getDebugMode: vi.fn().mockReturnValue(true),
|
|
1220
|
-
});
|
|
1221
|
-
const settings = {
|
|
1222
|
-
general: {
|
|
1223
|
-
sessionRetention: {
|
|
1224
|
-
enabled: true,
|
|
1225
|
-
maxAge: 'invalid', // Invalid format
|
|
1226
|
-
maxCount: 5, // Valid count
|
|
1227
|
-
},
|
|
1228
|
-
},
|
|
1229
|
-
};
|
|
1230
|
-
// The validation logic rejects invalid maxAge format even if maxCount is valid
|
|
1231
|
-
const result = await cleanupExpiredSessions(config, settings);
|
|
1232
|
-
// Should reject due to invalid maxAge format
|
|
1233
|
-
expect(result.disabled).toBe(true);
|
|
1234
|
-
expect(result.scanned).toBe(0);
|
|
1235
|
-
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Invalid retention period format'));
|
|
1236
|
-
});
|
|
1237
|
-
});
|
|
1238
|
-
it('should never throw an exception, always returning a result', async () => {
|
|
642
|
+
it('should reject empty string for maxAge', async () => {
|
|
1239
643
|
const config = createMockConfig();
|
|
1240
644
|
const settings = {
|
|
1241
|
-
general: {
|
|
1242
|
-
sessionRetention: {
|
|
1243
|
-
enabled: true,
|
|
1244
|
-
maxAge: '7d',
|
|
1245
|
-
},
|
|
1246
|
-
},
|
|
645
|
+
general: { sessionRetention: { enabled: true, maxAge: '' } },
|
|
1247
646
|
};
|
|
1248
|
-
// Mock getSessionFiles to throw an error
|
|
1249
|
-
mockGetAllSessionFiles.mockRejectedValue(new Error('Failed to read directory'));
|
|
1250
|
-
// Should not throw, should return a result with errors
|
|
1251
647
|
const result = await cleanupExpiredSessions(config, settings);
|
|
1252
|
-
expect(result).
|
|
1253
|
-
expect(
|
|
1254
|
-
expect(result.failed).toBe(1);
|
|
648
|
+
expect(result.disabled).toBe(true);
|
|
649
|
+
expect(debugLogger.warn).toHaveBeenCalledWith(expect.stringContaining('Either maxAge or maxCount must be specified'));
|
|
1255
650
|
});
|
|
1256
|
-
it('should
|
|
651
|
+
it('should validate minRetention format', async () => {
|
|
1257
652
|
const config = createMockConfig();
|
|
1258
653
|
const settings = {
|
|
1259
654
|
general: {
|
|
1260
655
|
sessionRetention: {
|
|
1261
656
|
enabled: true,
|
|
1262
|
-
maxAge: '
|
|
657
|
+
maxAge: '5d',
|
|
658
|
+
minRetention: 'invalid-format',
|
|
1263
659
|
},
|
|
1264
660
|
},
|
|
1265
661
|
};
|
|
1266
|
-
//
|
|
1267
|
-
const validSession = createTestSessions()[0];
|
|
1268
|
-
mockGetAllSessionFiles.mockResolvedValue([
|
|
1269
|
-
{ fileName: validSession.fileName, sessionInfo: validSession },
|
|
1270
|
-
{
|
|
1271
|
-
fileName: `${SESSION_FILE_PREFIX}2025-01-02T10-00-00-corrupt1.json`,
|
|
1272
|
-
sessionInfo: null,
|
|
1273
|
-
},
|
|
1274
|
-
{
|
|
1275
|
-
fileName: `${SESSION_FILE_PREFIX}2025-01-03T10-00-00-corrupt2.json`,
|
|
1276
|
-
sessionInfo: null,
|
|
1277
|
-
},
|
|
1278
|
-
]);
|
|
1279
|
-
mockFs.unlink.mockResolvedValue(undefined);
|
|
662
|
+
// Should fall back to default minRetention and proceed
|
|
1280
663
|
const result = await cleanupExpiredSessions(config, settings);
|
|
1281
664
|
expect(result.disabled).toBe(false);
|
|
1282
|
-
expect(result.scanned).toBe(3); // 1 valid + 2 corrupted
|
|
1283
|
-
expect(result.deleted).toBe(2); // Should delete the 2 corrupted files
|
|
1284
|
-
expect(result.skipped).toBe(1); // The valid session is kept
|
|
1285
|
-
// Verify corrupted files were deleted
|
|
1286
|
-
expect(mockFs.unlink).toHaveBeenCalledWith(expect.stringContaining('corrupt1.json'));
|
|
1287
|
-
expect(mockFs.unlink).toHaveBeenCalledWith(expect.stringContaining('corrupt2.json'));
|
|
1288
665
|
});
|
|
1289
|
-
|
|
1290
|
-
|
|
666
|
+
});
|
|
667
|
+
describe('Tool Output Cleanup', () => {
|
|
668
|
+
let toolOutputDir;
|
|
669
|
+
beforeEach(async () => {
|
|
670
|
+
toolOutputDir = path.join(testTempDir, TOOL_OUTPUTS_DIR);
|
|
671
|
+
await fs.mkdir(toolOutputDir, { recursive: true });
|
|
672
|
+
});
|
|
673
|
+
async function seedToolOutputs() {
|
|
674
|
+
const now = new Date();
|
|
675
|
+
const oldTime = new Date(now.getTime() - 10 * 24 * 60 * 60 * 1000); // 10 days ago
|
|
676
|
+
const file1 = path.join(toolOutputDir, 'output1.json');
|
|
677
|
+
await fs.writeFile(file1, '{}');
|
|
678
|
+
const file2 = path.join(toolOutputDir, 'output2.json');
|
|
679
|
+
await fs.writeFile(file2, '{}');
|
|
680
|
+
// Manually backdate file1
|
|
681
|
+
await fs.utimes(file1, oldTime, oldTime);
|
|
682
|
+
// Create an old session subdirectory
|
|
683
|
+
const oldSubdir = path.join(toolOutputDir, 'session-old');
|
|
684
|
+
await fs.mkdir(oldSubdir);
|
|
685
|
+
await fs.utimes(oldSubdir, oldTime, oldTime);
|
|
686
|
+
return { file1, file2, oldSubdir };
|
|
687
|
+
}
|
|
688
|
+
it('should return early if cleanup is disabled', async () => {
|
|
1291
689
|
const settings = {
|
|
1292
|
-
general: {
|
|
1293
|
-
sessionRetention: {
|
|
1294
|
-
enabled: true,
|
|
1295
|
-
maxAge: '7d',
|
|
1296
|
-
},
|
|
1297
|
-
},
|
|
690
|
+
general: { sessionRetention: { enabled: false } },
|
|
1298
691
|
};
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
692
|
+
const result = await cleanupToolOutputFiles(settings, false, testTempDir);
|
|
693
|
+
expect(result.disabled).toBe(true);
|
|
694
|
+
expect(result.scanned).toBe(0);
|
|
695
|
+
expect(result.deleted).toBe(0);
|
|
696
|
+
});
|
|
697
|
+
it('should gracefully handle missing tool-outputs directory', async () => {
|
|
698
|
+
await fs.rm(toolOutputDir, { recursive: true, force: true });
|
|
699
|
+
const settings = {
|
|
700
|
+
general: { sessionRetention: { enabled: true, maxAge: '1d' } },
|
|
701
|
+
};
|
|
702
|
+
const result = await cleanupToolOutputFiles(settings, false, testTempDir);
|
|
1304
703
|
expect(result.disabled).toBe(false);
|
|
1305
|
-
expect(result.
|
|
704
|
+
expect(result.scanned).toBe(0);
|
|
705
|
+
});
|
|
706
|
+
it('should delete flat files and subdirectories based on maxAge', async () => {
|
|
707
|
+
const { file1, file2, oldSubdir } = await seedToolOutputs();
|
|
708
|
+
const settings = {
|
|
709
|
+
general: { sessionRetention: { enabled: true, maxAge: '5d' } },
|
|
710
|
+
};
|
|
711
|
+
const result = await cleanupToolOutputFiles(settings, false, testTempDir);
|
|
712
|
+
// file1 and oldSubdir should be deleted.
|
|
713
|
+
expect(result.deleted).toBe(2);
|
|
714
|
+
expect(existsSync(file1)).toBe(false);
|
|
715
|
+
expect(existsSync(oldSubdir)).toBe(false);
|
|
716
|
+
expect(existsSync(file2)).toBe(true);
|
|
717
|
+
});
|
|
718
|
+
it('should delete oldest-first flat files based on maxCount when maxAge does not hit', async () => {
|
|
719
|
+
const { file1, file2 } = await seedToolOutputs();
|
|
720
|
+
const settings = {
|
|
721
|
+
general: { sessionRetention: { enabled: true, maxCount: 1 } },
|
|
722
|
+
};
|
|
723
|
+
const result = await cleanupToolOutputFiles(settings, false, testTempDir);
|
|
724
|
+
// Excess is 1. Oldest is file1. So file1 is deleted.
|
|
725
|
+
expect(result.deleted).toBe(1);
|
|
726
|
+
expect(existsSync(file1)).toBe(false);
|
|
727
|
+
expect(existsSync(file2)).toBe(true);
|
|
728
|
+
});
|
|
729
|
+
it('should skip tool-output subdirectories with unsafe names', async () => {
|
|
730
|
+
const settings = {
|
|
731
|
+
general: { sessionRetention: { enabled: true, maxAge: '1d' } },
|
|
732
|
+
};
|
|
733
|
+
// Create a directory with a name that is semantically unsafe for sanitization rules
|
|
734
|
+
const unsafeSubdir = path.join(toolOutputDir, 'session-unsafe@name');
|
|
735
|
+
await fs.mkdir(unsafeSubdir);
|
|
736
|
+
// Backdate it so it WOULD be deleted if it were safely named
|
|
737
|
+
const oldTime = new Date(Date.now() - 10 * 24 * 60 * 60 * 1000);
|
|
738
|
+
await fs.utimes(unsafeSubdir, oldTime, oldTime);
|
|
739
|
+
const result = await cleanupToolOutputFiles(settings, false, testTempDir);
|
|
740
|
+
// Must be scanned but actively skipped from deletion due to sanitization mismatch
|
|
741
|
+
expect(result.deleted).toBe(0);
|
|
742
|
+
expect(existsSync(unsafeSubdir)).toBe(true);
|
|
743
|
+
});
|
|
744
|
+
it('should initialize Storage when projectTempDir is not explicitly provided', async () => {
|
|
745
|
+
const getProjectTempDirSpy = vi
|
|
746
|
+
.spyOn(Storage.prototype, 'getProjectTempDir')
|
|
747
|
+
.mockReturnValue(testTempDir);
|
|
748
|
+
const initializeSpy = vi
|
|
749
|
+
.spyOn(Storage.prototype, 'initialize')
|
|
750
|
+
.mockResolvedValue(undefined);
|
|
751
|
+
const settings = {
|
|
752
|
+
general: { sessionRetention: { enabled: true, maxAge: '1d' } },
|
|
753
|
+
};
|
|
754
|
+
const { oldSubdir } = await seedToolOutputs();
|
|
755
|
+
// Call explicitly without third parameter
|
|
756
|
+
const result = await cleanupToolOutputFiles(settings, false);
|
|
757
|
+
expect(initializeSpy).toHaveBeenCalled();
|
|
758
|
+
expect(result.deleted).toBeGreaterThan(0);
|
|
759
|
+
expect(existsSync(oldSubdir)).toBe(false);
|
|
760
|
+
getProjectTempDirSpy.mockRestore();
|
|
761
|
+
initializeSpy.mockRestore();
|
|
1306
762
|
});
|
|
1307
763
|
});
|
|
1308
764
|
});
|