fss-link 1.2.0 → 1.2.1
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/.last_build +0 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +89 -0
- package/dist/src/commands/mcp/add.d.ts +7 -0
- package/dist/src/commands/mcp/add.js +166 -0
- package/dist/src/commands/mcp/add.js.map +1 -0
- package/dist/src/commands/mcp/list.d.ts +8 -0
- package/dist/src/commands/mcp/list.js +110 -0
- package/dist/src/commands/mcp/list.js.map +1 -0
- package/dist/src/commands/mcp/remove.d.ts +7 -0
- package/dist/src/commands/mcp/remove.js +44 -0
- package/dist/src/commands/mcp/remove.js.map +1 -0
- package/dist/src/commands/mcp.d.ts +7 -0
- package/dist/src/commands/mcp.js +23 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/config/archive-repository-pattern/README.md +26 -0
- package/dist/src/config/archive-repository-pattern/base-repository.d.ts +252 -0
- package/dist/src/config/archive-repository-pattern/base-repository.js +280 -0
- package/dist/src/config/archive-repository-pattern/base-repository.js.map +1 -0
- package/dist/src/config/archive-repository-pattern/model-repository.d.ts +274 -0
- package/dist/src/config/archive-repository-pattern/model-repository.js +482 -0
- package/dist/src/config/archive-repository-pattern/model-repository.js.map +1 -0
- package/dist/src/config/archive-repository-pattern/preferences-repository.d.ts +307 -0
- package/dist/src/config/archive-repository-pattern/preferences-repository.js +604 -0
- package/dist/src/config/archive-repository-pattern/preferences-repository.js.map +1 -0
- package/dist/src/config/archive-repository-pattern/repository-types.d.ts +166 -0
- package/dist/src/config/archive-repository-pattern/repository-types.js +67 -0
- package/dist/src/config/archive-repository-pattern/repository-types.js.map +1 -0
- package/dist/src/config/archive-repository-pattern/settings-repository.d.ts +274 -0
- package/dist/src/config/archive-repository-pattern/settings-repository.js +531 -0
- package/dist/src/config/archive-repository-pattern/settings-repository.js.map +1 -0
- package/dist/src/config/async-mutex.d.ts +61 -0
- package/dist/src/config/async-mutex.js +121 -0
- package/dist/src/config/async-mutex.js.map +1 -0
- package/dist/src/config/async-mutex.test.d.ts +6 -0
- package/dist/src/config/async-mutex.test.js +271 -0
- package/dist/src/config/async-mutex.test.js.map +1 -0
- package/dist/src/config/auth-stress-simplified.test.d.ts +6 -0
- package/dist/src/config/auth-stress-simplified.test.js +329 -0
- package/dist/src/config/auth-stress-simplified.test.js.map +1 -0
- package/dist/src/config/auth-stress.test.d.ts +9 -0
- package/dist/src/config/auth-stress.test.js +544 -0
- package/dist/src/config/auth-stress.test.js.map +1 -0
- package/dist/src/config/auth.d.ts +96 -0
- package/dist/src/config/auth.js +371 -0
- package/dist/src/config/auth.js.map +1 -0
- package/dist/src/config/auth.test.d.ts +6 -0
- package/dist/src/config/auth.test.js +61 -0
- package/dist/src/config/auth.test.js.map +1 -0
- package/dist/src/config/base-repository.d.ts +252 -0
- package/dist/src/config/base-repository.js +272 -0
- package/dist/src/config/base-repository.js.map +1 -0
- package/dist/src/config/config.d.ts +51 -0
- package/dist/src/config/config.js +553 -0
- package/dist/src/config/config.js.map +1 -0
- package/dist/src/config/core-database.d.ts +112 -0
- package/dist/src/config/core-database.js +370 -0
- package/dist/src/config/core-database.js.map +1 -0
- package/dist/src/config/database-integration.test.d.ts +6 -0
- package/dist/src/config/database-integration.test.js +547 -0
- package/dist/src/config/database-integration.test.js.map +1 -0
- package/dist/src/config/database-legacy-wrapper.d.ts +202 -0
- package/dist/src/config/database-legacy-wrapper.js +391 -0
- package/dist/src/config/database-legacy-wrapper.js.map +1 -0
- package/dist/src/config/database-monitor.d.ts +135 -0
- package/dist/src/config/database-monitor.js +306 -0
- package/dist/src/config/database-monitor.js.map +1 -0
- package/dist/src/config/database-queue.d.ts +106 -0
- package/dist/src/config/database-queue.js +187 -0
- package/dist/src/config/database-queue.js.map +1 -0
- package/dist/src/config/database-queue.test.d.ts +6 -0
- package/dist/src/config/database-queue.test.js +344 -0
- package/dist/src/config/database-queue.test.js.map +1 -0
- package/dist/src/config/database-regression-simple.test.d.ts +6 -0
- package/dist/src/config/database-regression-simple.test.js +335 -0
- package/dist/src/config/database-regression-simple.test.js.map +1 -0
- package/dist/src/config/database-regression.test.d.ts +6 -0
- package/dist/src/config/database-regression.test.js +523 -0
- package/dist/src/config/database-regression.test.js.map +1 -0
- package/dist/src/config/database-stress.test.d.ts +6 -0
- package/dist/src/config/database-stress.test.js +522 -0
- package/dist/src/config/database-stress.test.js.map +1 -0
- package/dist/src/config/database-utils.d.ts +281 -0
- package/dist/src/config/database-utils.js +664 -0
- package/dist/src/config/database-utils.js.map +1 -0
- package/dist/src/config/database-utils.test.d.ts +6 -0
- package/dist/src/config/database-utils.test.js +278 -0
- package/dist/src/config/database-utils.test.js.map +1 -0
- package/dist/src/config/database.d.ts +212 -0
- package/dist/src/config/database.js +458 -0
- package/dist/src/config/database.js.map +1 -0
- package/dist/src/config/databaseBackup.d.ts +114 -0
- package/dist/src/config/databaseBackup.js +334 -0
- package/dist/src/config/databaseBackup.js.map +1 -0
- package/dist/src/config/databaseHealthMonitor.d.ts +86 -0
- package/dist/src/config/databaseHealthMonitor.js +180 -0
- package/dist/src/config/databaseHealthMonitor.js.map +1 -0
- package/dist/src/config/databaseMetrics.d.ts +147 -0
- package/dist/src/config/databaseMetrics.js +369 -0
- package/dist/src/config/databaseMetrics.js.map +1 -0
- package/dist/src/config/databaseMigrations.d.ts +75 -0
- package/dist/src/config/databaseMigrations.js +405 -0
- package/dist/src/config/databaseMigrations.js.map +1 -0
- package/dist/src/config/databasePool.d.ts +72 -0
- package/dist/src/config/databasePool.js +226 -0
- package/dist/src/config/databasePool.js.map +1 -0
- package/dist/src/config/databaseSchemaValidator.d.ts +114 -0
- package/dist/src/config/databaseSchemaValidator.js +497 -0
- package/dist/src/config/databaseSchemaValidator.js.map +1 -0
- package/dist/src/config/extension.d.ts +23 -0
- package/dist/src/config/extension.js +126 -0
- package/dist/src/config/extension.js.map +1 -0
- package/dist/src/config/health-database.d.ts +172 -0
- package/dist/src/config/health-database.js +283 -0
- package/dist/src/config/health-database.js.map +1 -0
- package/dist/src/config/keyBindings.d.ts +66 -0
- package/dist/src/config/keyBindings.js +141 -0
- package/dist/src/config/keyBindings.js.map +1 -0
- package/dist/src/config/keyBindings.test.d.ts +6 -0
- package/dist/src/config/keyBindings.test.js +51 -0
- package/dist/src/config/keyBindings.test.js.map +1 -0
- package/dist/src/config/model-database.d.ts +157 -0
- package/dist/src/config/model-database.js +379 -0
- package/dist/src/config/model-database.js.map +1 -0
- package/dist/src/config/model-repository.d.ts +274 -0
- package/dist/src/config/model-repository.js +482 -0
- package/dist/src/config/model-repository.js.map +1 -0
- package/dist/src/config/modelManager.d.ts +146 -0
- package/dist/src/config/modelManager.js +573 -0
- package/dist/src/config/modelManager.js.map +1 -0
- package/dist/src/config/preferences-database.d.ts +101 -0
- package/dist/src/config/preferences-database.js +209 -0
- package/dist/src/config/preferences-database.js.map +1 -0
- package/dist/src/config/preferences-repository.d.ts +307 -0
- package/dist/src/config/preferences-repository.js +604 -0
- package/dist/src/config/preferences-repository.js.map +1 -0
- package/dist/src/config/provider-database.d.ts +102 -0
- package/dist/src/config/provider-database.js +250 -0
- package/dist/src/config/provider-database.js.map +1 -0
- package/dist/src/config/providerPersistence.d.ts +82 -0
- package/dist/src/config/providerPersistence.js +62 -0
- package/dist/src/config/providerPersistence.js.map +1 -0
- package/dist/src/config/queryOptimizer.d.ts +127 -0
- package/dist/src/config/queryOptimizer.js +330 -0
- package/dist/src/config/queryOptimizer.js.map +1 -0
- package/dist/src/config/repository-types.d.ts +166 -0
- package/dist/src/config/repository-types.js +67 -0
- package/dist/src/config/repository-types.js.map +1 -0
- package/dist/src/config/sandboxConfig.d.ts +13 -0
- package/dist/src/config/sandboxConfig.js +75 -0
- package/dist/src/config/sandboxConfig.js.map +1 -0
- package/dist/src/config/settings-repository.d.ts +274 -0
- package/dist/src/config/settings-repository.js +531 -0
- package/dist/src/config/settings-repository.js.map +1 -0
- package/dist/src/config/settings.d.ts +56 -0
- package/dist/src/config/settings.js +411 -0
- package/dist/src/config/settings.js.map +1 -0
- package/dist/src/config/settingsSchema.d.ts +703 -0
- package/dist/src/config/settingsSchema.js +679 -0
- package/dist/src/config/settingsSchema.js.map +1 -0
- package/dist/src/config/settingsSchema.test.d.ts +6 -0
- package/dist/src/config/settingsSchema.test.js +195 -0
- package/dist/src/config/settingsSchema.test.js.map +1 -0
- package/dist/src/config/trustedFolders.d.ts +37 -0
- package/dist/src/config/trustedFolders.js +118 -0
- package/dist/src/config/trustedFolders.js.map +1 -0
- package/dist/src/config/trustedFolders.test.d.ts +6 -0
- package/dist/src/config/trustedFolders.test.js +160 -0
- package/dist/src/config/trustedFolders.test.js.map +1 -0
- package/dist/src/config/unified-database.d.ts +383 -0
- package/dist/src/config/unified-database.js +651 -0
- package/dist/src/config/unified-database.js.map +1 -0
- package/dist/src/config/unified-database.test.d.ts +6 -0
- package/dist/src/config/unified-database.test.js +162 -0
- package/dist/src/config/unified-database.test.js.map +1 -0
- package/dist/src/gemini.d.ts +9 -0
- package/dist/src/gemini.js +334 -0
- package/dist/src/gemini.js.map +1 -0
- package/dist/src/gemini.test.d.ts +6 -0
- package/dist/src/gemini.test.js +193 -0
- package/dist/src/gemini.test.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +7 -0
- package/dist/src/generated/git-commit.js +10 -0
- package/dist/src/generated/git-commit.js.map +1 -0
- package/dist/src/nonInteractiveCli.d.ts +7 -0
- package/dist/src/nonInteractiveCli.js +103 -0
- package/dist/src/nonInteractiveCli.js.map +1 -0
- package/dist/src/patches/is-in-ci.d.ts +7 -0
- package/dist/src/patches/is-in-ci.js +15 -0
- package/dist/src/patches/is-in-ci.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
- package/dist/src/services/BuiltinCommandLoader.js +92 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.test.d.ts +6 -0
- package/dist/src/services/BuiltinCommandLoader.test.js +108 -0
- package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -0
- package/dist/src/services/CommandService.d.ts +55 -0
- package/dist/src/services/CommandService.js +90 -0
- package/dist/src/services/CommandService.js.map +1 -0
- package/dist/src/services/CommandService.test.d.ts +6 -0
- package/dist/src/services/CommandService.test.js +232 -0
- package/dist/src/services/CommandService.test.js.map +1 -0
- package/dist/src/services/FileCommandLoader.d.ts +49 -0
- package/dist/src/services/FileCommandLoader.js +210 -0
- package/dist/src/services/FileCommandLoader.js.map +1 -0
- package/dist/src/services/McpPromptLoader.d.ts +25 -0
- package/dist/src/services/McpPromptLoader.js +192 -0
- package/dist/src/services/McpPromptLoader.js.map +1 -0
- package/dist/src/services/SearchEngineConfigProvider.d.ts +33 -0
- package/dist/src/services/SearchEngineConfigProvider.js +82 -0
- package/dist/src/services/SearchEngineConfigProvider.js.map +1 -0
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +16 -0
- package/dist/src/services/prompt-processors/argumentProcessor.js +20 -0
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +35 -0
- package/dist/src/services/prompt-processors/shellProcessor.js +162 -0
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/types.d.ts +40 -0
- package/dist/src/services/prompt-processors/types.js +16 -0
- package/dist/src/services/prompt-processors/types.js.map +1 -0
- package/dist/src/services/types.d.ts +22 -0
- package/dist/src/services/types.js +7 -0
- package/dist/src/services/types.js.map +1 -0
- package/dist/src/test-utils/customMatchers.d.ts +14 -0
- package/dist/src/test-utils/customMatchers.js +46 -0
- package/dist/src/test-utils/customMatchers.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.d.ts +18 -0
- package/dist/src/test-utils/mockCommandContext.js +87 -0
- package/dist/src/test-utils/mockCommandContext.js.map +1 -0
- package/dist/src/test-utils/mockCommandContext.test.d.ts +6 -0
- package/dist/src/test-utils/mockCommandContext.test.js +51 -0
- package/dist/src/test-utils/mockCommandContext.test.js.map +1 -0
- package/dist/src/test-utils/render.d.ts +8 -0
- package/dist/src/test-utils/render.js +10 -0
- package/dist/src/test-utils/render.js.map +1 -0
- package/dist/src/ui/App.d.ts +15 -0
- package/dist/src/ui/App.js +687 -0
- package/dist/src/ui/App.js.map +1 -0
- package/dist/src/ui/IdeIntegrationNudge.d.ts +16 -0
- package/dist/src/ui/IdeIntegrationNudge.js +52 -0
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
- package/dist/src/ui/colors.d.ts +7 -0
- package/dist/src/ui/colors.js +54 -0
- package/dist/src/ui/colors.js.map +1 -0
- package/dist/src/ui/commands/aboutCommand.d.ts +7 -0
- package/dist/src/ui/commands/aboutCommand.js +43 -0
- package/dist/src/ui/commands/aboutCommand.js.map +1 -0
- package/dist/src/ui/commands/authCommand.d.ts +7 -0
- package/dist/src/ui/commands/authCommand.js +16 -0
- package/dist/src/ui/commands/authCommand.js.map +1 -0
- package/dist/src/ui/commands/bugCommand.d.ts +7 -0
- package/dist/src/ui/commands/bugCommand.js +71 -0
- package/dist/src/ui/commands/bugCommand.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.d.ts +7 -0
- package/dist/src/ui/commands/chatCommand.js +234 -0
- package/dist/src/ui/commands/chatCommand.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.d.ts +7 -0
- package/dist/src/ui/commands/clearCommand.js +27 -0
- package/dist/src/ui/commands/clearCommand.js.map +1 -0
- package/dist/src/ui/commands/compressCommand.d.ts +7 -0
- package/dist/src/ui/commands/compressCommand.js +64 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -0
- package/dist/src/ui/commands/contextCommand.d.ts +7 -0
- package/dist/src/ui/commands/contextCommand.js +115 -0
- package/dist/src/ui/commands/contextCommand.js.map +1 -0
- package/dist/src/ui/commands/copyCommand.d.ts +7 -0
- package/dist/src/ui/commands/copyCommand.js +59 -0
- package/dist/src/ui/commands/copyCommand.js.map +1 -0
- package/dist/src/ui/commands/corgiCommand.d.ts +7 -0
- package/dist/src/ui/commands/corgiCommand.js +15 -0
- package/dist/src/ui/commands/corgiCommand.js.map +1 -0
- package/dist/src/ui/commands/directoryCommand.d.ts +8 -0
- package/dist/src/ui/commands/directoryCommand.js +133 -0
- package/dist/src/ui/commands/directoryCommand.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.d.ts +7 -0
- package/dist/src/ui/commands/docsCommand.js +31 -0
- package/dist/src/ui/commands/docsCommand.js.map +1 -0
- package/dist/src/ui/commands/editorCommand.d.ts +7 -0
- package/dist/src/ui/commands/editorCommand.js +16 -0
- package/dist/src/ui/commands/editorCommand.js.map +1 -0
- package/dist/src/ui/commands/extensionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/extensionsCommand.js +31 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.d.ts +7 -0
- package/dist/src/ui/commands/helpCommand.js +21 -0
- package/dist/src/ui/commands/helpCommand.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.d.ts +8 -0
- package/dist/src/ui/commands/ideCommand.js +218 -0
- package/dist/src/ui/commands/ideCommand.js.map +1 -0
- package/dist/src/ui/commands/initCommand.d.ts +7 -0
- package/dist/src/ui/commands/initCommand.js +105 -0
- package/dist/src/ui/commands/initCommand.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
- package/dist/src/ui/commands/mcpCommand.js +424 -0
- package/dist/src/ui/commands/mcpCommand.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
- package/dist/src/ui/commands/memoryCommand.js +224 -0
- package/dist/src/ui/commands/memoryCommand.js.map +1 -0
- package/dist/src/ui/commands/privacyCommand.d.ts +7 -0
- package/dist/src/ui/commands/privacyCommand.js +16 -0
- package/dist/src/ui/commands/privacyCommand.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.d.ts +7 -0
- package/dist/src/ui/commands/quitCommand.js +34 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -0
- package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
- package/dist/src/ui/commands/restoreCommand.js +128 -0
- package/dist/src/ui/commands/restoreCommand.js.map +1 -0
- package/dist/src/ui/commands/searchEngineSetupCommand.d.ts +7 -0
- package/dist/src/ui/commands/searchEngineSetupCommand.js +17 -0
- package/dist/src/ui/commands/searchEngineSetupCommand.js.map +1 -0
- package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
- package/dist/src/ui/commands/settingsCommand.js +16 -0
- package/dist/src/ui/commands/settingsCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.d.ts +9 -0
- package/dist/src/ui/commands/setupGithubCommand.js +154 -0
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.test.d.ts +6 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js +167 -0
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -0
- package/dist/src/ui/commands/speakCommand.d.ts +7 -0
- package/dist/src/ui/commands/speakCommand.js +136 -0
- package/dist/src/ui/commands/speakCommand.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.d.ts +7 -0
- package/dist/src/ui/commands/statsCommand.js +54 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -0
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +13 -0
- package/dist/src/ui/commands/terminalSetupCommand.js +41 -0
- package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.d.ts +7 -0
- package/dist/src/ui/commands/themeCommand.js +16 -0
- package/dist/src/ui/commands/themeCommand.js.map +1 -0
- package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
- package/dist/src/ui/commands/toolsCommand.js +56 -0
- package/dist/src/ui/commands/toolsCommand.js.map +1 -0
- package/dist/src/ui/commands/ttsCommand.d.ts +7 -0
- package/dist/src/ui/commands/ttsCommand.js +122 -0
- package/dist/src/ui/commands/ttsCommand.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +157 -0
- package/dist/src/ui/commands/types.js +12 -0
- package/dist/src/ui/commands/types.js.map +1 -0
- package/dist/src/ui/commands/vimCommand.d.ts +7 -0
- package/dist/src/ui/commands/vimCommand.js +23 -0
- package/dist/src/ui/commands/vimCommand.js.map +1 -0
- package/dist/src/ui/commands/voiceCommand.d.ts +7 -0
- package/dist/src/ui/commands/voiceCommand.js +95 -0
- package/dist/src/ui/commands/voiceCommand.js.map +1 -0
- package/dist/src/ui/components/AboutBox.d.ts +17 -0
- package/dist/src/ui/components/AboutBox.js +6 -0
- package/dist/src/ui/components/AboutBox.js.map +1 -0
- package/dist/src/ui/components/AsciiArt.d.ts +8 -0
- package/dist/src/ui/components/AsciiArt.js +53 -0
- package/dist/src/ui/components/AsciiArt.js.map +1 -0
- package/dist/src/ui/components/AuthDialog.d.ts +15 -0
- package/dist/src/ui/components/AuthDialog.js +174 -0
- package/dist/src/ui/components/AuthDialog.js.map +1 -0
- package/dist/src/ui/components/AuthDialog.test.d.ts +6 -0
- package/dist/src/ui/components/AuthDialog.test.js +220 -0
- package/dist/src/ui/components/AuthDialog.test.js.map +1 -0
- package/dist/src/ui/components/AuthInProgress.d.ts +11 -0
- package/dist/src/ui/components/AuthInProgress.js +28 -0
- package/dist/src/ui/components/AuthInProgress.js.map +1 -0
- package/dist/src/ui/components/AutoAcceptIndicator.d.ts +12 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js +26 -0
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +1 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +11 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +11 -0
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +20 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js +65 -0
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +11 -0
- package/dist/src/ui/components/ContextUsageDisplay.js +100 -0
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/DebugProfiler.d.ts +6 -0
- package/dist/src/ui/components/DebugProfiler.js +27 -0
- package/dist/src/ui/components/DebugProfiler.js.map +1 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +14 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.js +34 -0
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -0
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +15 -0
- package/dist/src/ui/components/EditorSettingsDialog.js +74 -0
- package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.d.ts +16 -0
- package/dist/src/ui/components/FolderTrustDialog.js +39 -0
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.test.d.ts +6 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js +26 -0
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -0
- package/dist/src/ui/components/Footer.d.ts +24 -0
- package/dist/src/ui/components/Footer.js +25 -0
- package/dist/src/ui/components/Footer.js.map +1 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +17 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js +16 -0
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -0
- package/dist/src/ui/components/Header.d.ts +13 -0
- package/dist/src/ui/components/Header.js +28 -0
- package/dist/src/ui/components/Header.js.map +1 -0
- package/dist/src/ui/components/Header.test.d.ts +6 -0
- package/dist/src/ui/components/Header.test.js +37 -0
- package/dist/src/ui/components/Header.test.js.map +1 -0
- package/dist/src/ui/components/Help.d.ts +12 -0
- package/dist/src/ui/components/Help.js +10 -0
- package/dist/src/ui/components/Help.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +20 -0
- package/dist/src/ui/components/HistoryItemDisplay.js +18 -0
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js +91 -0
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +28 -0
- package/dist/src/ui/components/InputPrompt.js +440 -0
- package/dist/src/ui/components/InputPrompt.js.map +1 -0
- package/dist/src/ui/components/LMStudioModelPrompt.d.ts +12 -0
- package/dist/src/ui/components/LMStudioModelPrompt.js +100 -0
- package/dist/src/ui/components/LMStudioModelPrompt.js.map +1 -0
- package/dist/src/ui/components/LoadingIndicator.d.ts +15 -0
- package/dist/src/ui/components/LoadingIndicator.js +25 -0
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -0
- package/dist/src/ui/components/LoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/components/LoadingIndicator.test.js +190 -0
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +7 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js +27 -0
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/ModelStatsDisplay.d.ts +7 -0
- package/dist/src/ui/components/ModelStatsDisplay.js +33 -0
- package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -0
- package/dist/src/ui/components/OllamaModelPrompt.d.ts +12 -0
- package/dist/src/ui/components/OllamaModelPrompt.js +94 -0
- package/dist/src/ui/components/OllamaModelPrompt.js.map +1 -0
- package/dist/src/ui/components/OpenAIEndpointDialog.d.ts +18 -0
- package/dist/src/ui/components/OpenAIEndpointDialog.js +77 -0
- package/dist/src/ui/components/OpenAIEndpointDialog.js.map +1 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.d.ts +13 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.js +118 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.js.map +1 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.test.d.ts +6 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js +44 -0
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.d.ts +15 -0
- package/dist/src/ui/components/PrepareLabel.js +16 -0
- package/dist/src/ui/components/PrepareLabel.js.map +1 -0
- package/dist/src/ui/components/SearchEngineConfigDialog.d.ts +18 -0
- package/dist/src/ui/components/SearchEngineConfigDialog.js +180 -0
- package/dist/src/ui/components/SearchEngineConfigDialog.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +11 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js +4 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.d.ts +14 -0
- package/dist/src/ui/components/SettingsDialog.js +519 -0
- package/dist/src/ui/components/SettingsDialog.js.map +1 -0
- package/dist/src/ui/components/SettingsDialog.test.d.ts +6 -0
- package/dist/src/ui/components/SettingsDialog.test.js +568 -0
- package/dist/src/ui/components/SettingsDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +15 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js +46 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +6 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +40 -0
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +1 -0
- package/dist/src/ui/components/ShellModeIndicator.d.ts +7 -0
- package/dist/src/ui/components/ShellModeIndicator.js +5 -0
- package/dist/src/ui/components/ShellModeIndicator.js.map +1 -0
- package/dist/src/ui/components/ShowMoreLines.d.ts +10 -0
- package/dist/src/ui/components/ShowMoreLines.js +24 -0
- package/dist/src/ui/components/ShowMoreLines.js.map +1 -0
- package/dist/src/ui/components/StatsDisplay.d.ts +12 -0
- package/dist/src/ui/components/StatsDisplay.js +43 -0
- package/dist/src/ui/components/StatsDisplay.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +22 -0
- package/dist/src/ui/components/SuggestionsDisplay.js +32 -0
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -0
- package/dist/src/ui/components/ThemeDialog.d.ts +19 -0
- package/dist/src/ui/components/ThemeDialog.js +143 -0
- package/dist/src/ui/components/ThemeDialog.js.map +1 -0
- package/dist/src/ui/components/Tips.d.ts +12 -0
- package/dist/src/ui/components/Tips.js +8 -0
- package/dist/src/ui/components/Tips.js.map +1 -0
- package/dist/src/ui/components/TodoDisplay.d.ts +16 -0
- package/dist/src/ui/components/TodoDisplay.js +27 -0
- package/dist/src/ui/components/TodoDisplay.js.map +1 -0
- package/dist/src/ui/components/TodoDisplay.test.d.ts +6 -0
- package/dist/src/ui/components/TodoDisplay.test.js +77 -0
- package/dist/src/ui/components/TodoDisplay.test.js.map +1 -0
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +7 -0
- package/dist/src/ui/components/ToolStatsDisplay.js +41 -0
- package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -0
- package/dist/src/ui/components/UpdateNotification.d.ts +10 -0
- package/dist/src/ui/components/UpdateNotification.js +10 -0
- package/dist/src/ui/components/UpdateNotification.js.map +1 -0
- package/dist/src/ui/components/WelcomeBackDialog.d.ts +36 -0
- package/dist/src/ui/components/WelcomeBackDialog.js +109 -0
- package/dist/src/ui/components/WelcomeBackDialog.js.map +1 -0
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/CompressionMessage.js +16 -0
- package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +16 -0
- package/dist/src/ui/components/messages/DiffRenderer.js +222 -0
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +6 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js +239 -0
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -0
- package/dist/src/ui/components/messages/ErrorMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/ErrorMessage.js +9 -0
- package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -0
- package/dist/src/ui/components/messages/GeminiMessage.d.ts +14 -0
- package/dist/src/ui/components/messages/GeminiMessage.js +10 -0
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +14 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.js +15 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -0
- package/dist/src/ui/components/messages/InfoMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/InfoMessage.js +10 -0
- package/dist/src/ui/components/messages/InfoMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +15 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +145 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +37 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +18 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.js +55 -0
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.d.ts +15 -0
- package/dist/src/ui/components/messages/ToolMessage.js +111 -0
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -0
- package/dist/src/ui/components/messages/ToolMessage.test.d.ts +6 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js +118 -0
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -0
- package/dist/src/ui/components/messages/UserMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/UserMessage.js +12 -0
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -0
- package/dist/src/ui/components/messages/UserShellMessage.d.ts +11 -0
- package/dist/src/ui/components/messages/UserShellMessage.js +9 -0
- package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.d.ts +61 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js +451 -0
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +6 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +154 -0
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +46 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.js +121 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +6 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +111 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -0
- package/dist/src/ui/components/shared/text-buffer.d.ts +467 -0
- package/dist/src/ui/components/shared/text-buffer.js +1533 -0
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +72 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js +552 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -0
- package/dist/src/ui/constants.d.ts +9 -0
- package/dist/src/ui/constants.js +13 -0
- package/dist/src/ui/constants.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.d.ts +30 -0
- package/dist/src/ui/contexts/KeypressContext.js +331 -0
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.test.d.ts +6 -0
- package/dist/src/ui/contexts/KeypressContext.test.js +275 -0
- package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -0
- package/dist/src/ui/contexts/OverflowContext.d.ts +19 -0
- package/dist/src/ui/contexts/OverflowContext.js +43 -0
- package/dist/src/ui/contexts/OverflowContext.js.map +1 -0
- package/dist/src/ui/contexts/SessionContext.d.ts +39 -0
- package/dist/src/ui/contexts/SessionContext.js +60 -0
- package/dist/src/ui/contexts/SessionContext.js.map +1 -0
- package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
- package/dist/src/ui/contexts/SettingsContext.js +15 -0
- package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
- package/dist/src/ui/contexts/StreamingContext.d.ts +9 -0
- package/dist/src/ui/contexts/StreamingContext.js +15 -0
- package/dist/src/ui/contexts/StreamingContext.js.map +1 -0
- package/dist/src/ui/contexts/VimModeContext.d.ts +19 -0
- package/dist/src/ui/contexts/VimModeContext.js +48 -0
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -0
- package/dist/src/ui/editors/editorSettingsManager.d.ts +19 -0
- package/dist/src/ui/editors/editorSettingsManager.js +47 -0
- package/dist/src/ui/editors/editorSettingsManager.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +31 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +365 -0
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js +824 -0
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +17 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js +233 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +6 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +328 -0
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -0
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +28 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js +459 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -0
- package/dist/src/ui/hooks/useAtCompletion.d.ts +23 -0
- package/dist/src/ui/hooks/useAtCompletion.js +179 -0
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useAuthCommand.d.ts +14 -0
- package/dist/src/ui/hooks/useAuthCommand.js +100 -0
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +10 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +37 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +1 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +190 -0
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useBracketedPaste.d.ts +12 -0
- package/dist/src/ui/hooks/useBracketedPaste.js +32 -0
- package/dist/src/ui/hooks/useBracketedPaste.js.map +1 -0
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +29 -0
- package/dist/src/ui/hooks/useCommandCompletion.js +165 -0
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useCompletion.d.ts +24 -0
- package/dist/src/ui/hooks/useCompletion.js +88 -0
- package/dist/src/ui/hooks/useCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +12 -0
- package/dist/src/ui/hooks/useConsoleMessages.js +76 -0
- package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -0
- package/dist/src/ui/hooks/useEditorSettings.d.ts +16 -0
- package/dist/src/ui/hooks/useEditorSettings.js +43 -0
- package/dist/src/ui/hooks/useEditorSettings.js.map +1 -0
- package/dist/src/ui/hooks/useEditorSettings.test.d.ts +6 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js +164 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -0
- package/dist/src/ui/hooks/useFocus.d.ts +10 -0
- package/dist/src/ui/hooks/useFocus.js +41 -0
- package/dist/src/ui/hooks/useFocus.js.map +1 -0
- package/dist/src/ui/hooks/useFolderTrust.d.ts +12 -0
- package/dist/src/ui/hooks/useFolderTrust.js +55 -0
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +24 -0
- package/dist/src/ui/hooks/useGeminiStream.js +653 -0
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -0
- package/dist/src/ui/hooks/useGitBranchName.d.ts +6 -0
- package/dist/src/ui/hooks/useGitBranchName.js +61 -0
- package/dist/src/ui/hooks/useGitBranchName.js.map +1 -0
- package/dist/src/ui/hooks/useGitBranchName.test.d.ts +6 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js +215 -0
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -0
- package/dist/src/ui/hooks/useHistoryManager.d.ts +22 -0
- package/dist/src/ui/hooks/useHistoryManager.js +72 -0
- package/dist/src/ui/hooks/useHistoryManager.js.map +1 -0
- package/dist/src/ui/hooks/useHistoryManager.test.d.ts +6 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js +171 -0
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.d.ts +19 -0
- package/dist/src/ui/hooks/useInputHistory.js +84 -0
- package/dist/src/ui/hooks/useInputHistory.js.map +1 -0
- package/dist/src/ui/hooks/useInputHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useInputHistory.test.js +207 -0
- package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useKeypress.d.ts +17 -0
- package/dist/src/ui/hooks/useKeypress.js +27 -0
- package/dist/src/ui/hooks/useKeypress.js.map +1 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +15 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +20 -0
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +10 -0
- package/dist/src/ui/hooks/useLoadingIndicator.js +44 -0
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +6 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +91 -0
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -0
- package/dist/src/ui/hooks/useLogger.d.ts +10 -0
- package/dist/src/ui/hooks/useLogger.js +29 -0
- package/dist/src/ui/hooks/useLogger.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.d.ts +22 -0
- package/dist/src/ui/hooks/useMessageQueue.js +49 -0
- package/dist/src/ui/hooks/useMessageQueue.js.map +1 -0
- package/dist/src/ui/hooks/useMessageQueue.test.d.ts +6 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js +158 -0
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +14 -0
- package/dist/src/ui/hooks/usePhraseCycler.js +187 -0
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -0
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +16 -0
- package/dist/src/ui/hooks/usePrivacySettings.js +119 -0
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +6 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.js +154 -0
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +33 -0
- package/dist/src/ui/hooks/useReactToolScheduler.js +187 -0
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +6 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js +7 -0
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +1 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +19 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +56 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +163 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
- package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
- package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.d.ts +13 -0
- package/dist/src/ui/hooks/useShellHistory.js +112 -0
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.test.d.ts +6 -0
- package/dist/src/ui/hooks/useShellHistory.test.js +162 -0
- package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +9 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.js +58 -0
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +20 -0
- package/dist/src/ui/hooks/useSlashCompletion.js +135 -0
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +6 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js +272 -0
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -0
- package/dist/src/ui/hooks/useStateAndRef.d.ts +7 -0
- package/dist/src/ui/hooks/useStateAndRef.js +26 -0
- package/dist/src/ui/hooks/useStateAndRef.js.map +1 -0
- package/dist/src/ui/hooks/useTerminalSize.d.ts +9 -0
- package/dist/src/ui/hooks/useTerminalSize.js +27 -0
- package/dist/src/ui/hooks/useTerminalSize.js.map +1 -0
- package/dist/src/ui/hooks/useThemeCommand.d.ts +15 -0
- package/dist/src/ui/hooks/useThemeCommand.js +79 -0
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -0
- package/dist/src/ui/hooks/useTimer.d.ts +12 -0
- package/dist/src/ui/hooks/useTimer.js +58 -0
- package/dist/src/ui/hooks/useTimer.js.map +1 -0
- package/dist/src/ui/hooks/useTimer.test.d.ts +6 -0
- package/dist/src/ui/hooks/useTimer.test.js +90 -0
- package/dist/src/ui/hooks/useTimer.test.js.map +1 -0
- package/dist/src/ui/hooks/useToolScheduler.test.d.ts +6 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js +845 -0
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -0
- package/dist/src/ui/hooks/useWelcomeBack.d.ts +52 -0
- package/dist/src/ui/hooks/useWelcomeBack.js +214 -0
- package/dist/src/ui/hooks/useWelcomeBack.js.map +1 -0
- package/dist/src/ui/hooks/vim.d.ts +28 -0
- package/dist/src/ui/hooks/vim.js +639 -0
- package/dist/src/ui/hooks/vim.js.map +1 -0
- package/dist/src/ui/keyMatchers.d.ts +26 -0
- package/dist/src/ui/keyMatchers.js +68 -0
- package/dist/src/ui/keyMatchers.js.map +1 -0
- package/dist/src/ui/keyMatchers.test.d.ts +6 -0
- package/dist/src/ui/keyMatchers.test.js +276 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +12 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +41 -0
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +10 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +18 -0
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +10 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +18 -0
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -0
- package/dist/src/ui/privacy/PrivacyNotice.d.ts +12 -0
- package/dist/src/ui/privacy/PrivacyNotice.js +25 -0
- package/dist/src/ui/privacy/PrivacyNotice.js.map +1 -0
- package/dist/src/ui/semantic-colors.d.ts +7 -0
- package/dist/src/ui/semantic-colors.js +24 -0
- package/dist/src/ui/semantic-colors.js.map +1 -0
- package/dist/src/ui/themes/ansi-light.d.ts +7 -0
- package/dist/src/ui/themes/ansi-light.js +142 -0
- package/dist/src/ui/themes/ansi-light.js.map +1 -0
- package/dist/src/ui/themes/ansi.d.ts +7 -0
- package/dist/src/ui/themes/ansi.js +152 -0
- package/dist/src/ui/themes/ansi.js.map +1 -0
- package/dist/src/ui/themes/atom-one-dark.d.ts +7 -0
- package/dist/src/ui/themes/atom-one-dark.js +139 -0
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -0
- package/dist/src/ui/themes/ayu-light.d.ts +7 -0
- package/dist/src/ui/themes/ayu-light.js +131 -0
- package/dist/src/ui/themes/ayu-light.js.map +1 -0
- package/dist/src/ui/themes/ayu.d.ts +7 -0
- package/dist/src/ui/themes/ayu.js +105 -0
- package/dist/src/ui/themes/ayu.js.map +1 -0
- package/dist/src/ui/themes/color-utils.d.ts +21 -0
- package/dist/src/ui/themes/color-utils.js +221 -0
- package/dist/src/ui/themes/color-utils.js.map +1 -0
- package/dist/src/ui/themes/color-utils.test.d.ts +6 -0
- package/dist/src/ui/themes/color-utils.test.js +197 -0
- package/dist/src/ui/themes/color-utils.test.js.map +1 -0
- package/dist/src/ui/themes/default-light.d.ts +7 -0
- package/dist/src/ui/themes/default-light.js +101 -0
- package/dist/src/ui/themes/default-light.js.map +1 -0
- package/dist/src/ui/themes/default.d.ts +7 -0
- package/dist/src/ui/themes/default.js +144 -0
- package/dist/src/ui/themes/default.js.map +1 -0
- package/dist/src/ui/themes/dracula.d.ts +7 -0
- package/dist/src/ui/themes/dracula.js +116 -0
- package/dist/src/ui/themes/dracula.js.map +1 -0
- package/dist/src/ui/themes/fss-code-dark.d.ts +7 -0
- package/dist/src/ui/themes/fss-code-dark.js +148 -0
- package/dist/src/ui/themes/fss-code-dark.js.map +1 -0
- package/dist/src/ui/themes/fss-dark.d.ts +7 -0
- package/dist/src/ui/themes/fss-dark.js +105 -0
- package/dist/src/ui/themes/fss-dark.js.map +1 -0
- package/dist/src/ui/themes/fss-light.d.ts +7 -0
- package/dist/src/ui/themes/fss-light.js +131 -0
- package/dist/src/ui/themes/fss-light.js.map +1 -0
- package/dist/src/ui/themes/github-dark.d.ts +7 -0
- package/dist/src/ui/themes/github-dark.js +139 -0
- package/dist/src/ui/themes/github-dark.js.map +1 -0
- package/dist/src/ui/themes/github-light.d.ts +7 -0
- package/dist/src/ui/themes/github-light.js +141 -0
- package/dist/src/ui/themes/github-light.js.map +1 -0
- package/dist/src/ui/themes/googlecode.d.ts +7 -0
- package/dist/src/ui/themes/googlecode.js +138 -0
- package/dist/src/ui/themes/googlecode.js.map +1 -0
- package/dist/src/ui/themes/no-color.d.ts +7 -0
- package/dist/src/ui/themes/no-color.js +115 -0
- package/dist/src/ui/themes/no-color.js.map +1 -0
- package/dist/src/ui/themes/qwen-dark.d.ts +7 -0
- package/dist/src/ui/themes/qwen-dark.js +109 -0
- package/dist/src/ui/themes/qwen-dark.js.map +1 -0
- package/dist/src/ui/themes/qwen-light.d.ts +7 -0
- package/dist/src/ui/themes/qwen-light.js +135 -0
- package/dist/src/ui/themes/qwen-light.js.map +1 -0
- package/dist/src/ui/themes/semantic-tokens.d.ts +37 -0
- package/dist/src/ui/themes/semantic-tokens.js +94 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
- package/dist/src/ui/themes/shades-of-purple.d.ts +11 -0
- package/dist/src/ui/themes/shades-of-purple.js +305 -0
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.d.ts +64 -0
- package/dist/src/ui/themes/theme-manager.js +209 -0
- package/dist/src/ui/themes/theme-manager.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.test.d.ts +6 -0
- package/dist/src/ui/themes/theme-manager.test.js +83 -0
- package/dist/src/ui/themes/theme-manager.test.js.map +1 -0
- package/dist/src/ui/themes/theme.d.ts +130 -0
- package/dist/src/ui/themes/theme.js +351 -0
- package/dist/src/ui/themes/theme.js.map +1 -0
- package/dist/src/ui/themes/xcode.d.ts +7 -0
- package/dist/src/ui/themes/xcode.js +146 -0
- package/dist/src/ui/themes/xcode.js.map +1 -0
- package/dist/src/ui/types.d.ts +191 -0
- package/dist/src/ui/types.js +44 -0
- package/dist/src/ui/types.js.map +1 -0
- package/dist/src/ui/utils/CodeColorizer.d.ts +17 -0
- package/dist/src/ui/utils/CodeColorizer.js +110 -0
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -0
- package/dist/src/ui/utils/ConsolePatcher.d.ts +25 -0
- package/dist/src/ui/utils/ConsolePatcher.js +52 -0
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +16 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +111 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.d.ts +14 -0
- package/dist/src/ui/utils/MarkdownDisplay.js +207 -0
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +6 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js +151 -0
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -0
- package/dist/src/ui/utils/TableRenderer.d.ts +17 -0
- package/dist/src/ui/utils/TableRenderer.js +84 -0
- package/dist/src/ui/utils/TableRenderer.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.d.ts +22 -0
- package/dist/src/ui/utils/clipboardUtils.js +127 -0
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -0
- package/dist/src/ui/utils/clipboardUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/clipboardUtils.test.js +65 -0
- package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.d.ts +24 -0
- package/dist/src/ui/utils/commandUtils.js +93 -0
- package/dist/src/ui/utils/commandUtils.js.map +1 -0
- package/dist/src/ui/utils/commandUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/commandUtils.test.js +294 -0
- package/dist/src/ui/utils/commandUtils.test.js.map +1 -0
- package/dist/src/ui/utils/computeStats.d.ts +10 -0
- package/dist/src/ui/utils/computeStats.js +57 -0
- package/dist/src/ui/utils/computeStats.js.map +1 -0
- package/dist/src/ui/utils/displayUtils.d.ts +17 -0
- package/dist/src/ui/utils/displayUtils.js +24 -0
- package/dist/src/ui/utils/displayUtils.js.map +1 -0
- package/dist/src/ui/utils/displayUtils.test.d.ts +6 -0
- package/dist/src/ui/utils/displayUtils.test.js +42 -0
- package/dist/src/ui/utils/displayUtils.test.js.map +1 -0
- package/dist/src/ui/utils/formatters.d.ts +13 -0
- package/dist/src/ui/utils/formatters.js +56 -0
- package/dist/src/ui/utils/formatters.js.map +1 -0
- package/dist/src/ui/utils/formatters.test.d.ts +6 -0
- package/dist/src/ui/utils/formatters.test.js +56 -0
- package/dist/src/ui/utils/formatters.test.js.map +1 -0
- package/dist/src/ui/utils/isNarrowWidth.d.ts +6 -0
- package/dist/src/ui/utils/isNarrowWidth.js +9 -0
- package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +13 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js +88 -0
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +1 -0
- package/dist/src/ui/utils/markdownUtilities.d.ts +6 -0
- package/dist/src/ui/utils/markdownUtilities.js +110 -0
- package/dist/src/ui/utils/markdownUtilities.js.map +1 -0
- package/dist/src/ui/utils/markdownUtilities.test.d.ts +6 -0
- package/dist/src/ui/utils/markdownUtilities.test.js +42 -0
- package/dist/src/ui/utils/markdownUtilities.test.js.map +1 -0
- package/dist/src/ui/utils/platformConstants.d.ts +45 -0
- package/dist/src/ui/utils/platformConstants.js +46 -0
- package/dist/src/ui/utils/platformConstants.js.map +1 -0
- package/dist/src/ui/utils/terminalSetup.d.ts +30 -0
- package/dist/src/ui/utils/terminalSetup.js +281 -0
- package/dist/src/ui/utils/terminalSetup.js.map +1 -0
- package/dist/src/ui/utils/textUtils.d.ts +14 -0
- package/dist/src/ui/utils/textUtils.js +36 -0
- package/dist/src/ui/utils/textUtils.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.d.ts +12 -0
- package/dist/src/ui/utils/updateCheck.js +78 -0
- package/dist/src/ui/utils/updateCheck.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.test.d.ts +6 -0
- package/dist/src/ui/utils/updateCheck.test.js +145 -0
- package/dist/src/ui/utils/updateCheck.test.js.map +1 -0
- package/dist/src/utils/checks.d.ts +19 -0
- package/dist/src/utils/checks.js +24 -0
- package/dist/src/utils/checks.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +8 -0
- package/dist/src/utils/cleanup.js +34 -0
- package/dist/src/utils/cleanup.js.map +1 -0
- package/dist/src/utils/dialogScopeUtils.d.ts +31 -0
- package/dist/src/utils/dialogScopeUtils.js +48 -0
- package/dist/src/utils/dialogScopeUtils.js.map +1 -0
- package/dist/src/utils/events.d.ts +11 -0
- package/dist/src/utils/events.js +13 -0
- package/dist/src/utils/events.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +30 -0
- package/dist/src/utils/gitUtils.js +89 -0
- package/dist/src/utils/gitUtils.js.map +1 -0
- package/dist/src/utils/gitUtils.test.d.ts +6 -0
- package/dist/src/utils/gitUtils.test.js +113 -0
- package/dist/src/utils/gitUtils.test.js.map +1 -0
- package/dist/src/utils/handleAutoUpdate.d.ts +11 -0
- package/dist/src/utils/handleAutoUpdate.js +101 -0
- package/dist/src/utils/handleAutoUpdate.js.map +1 -0
- package/dist/src/utils/installationInfo.d.ts +23 -0
- package/dist/src/utils/installationInfo.js +169 -0
- package/dist/src/utils/installationInfo.js.map +1 -0
- package/dist/src/utils/installationInfo.test.d.ts +6 -0
- package/dist/src/utils/installationInfo.test.js +242 -0
- package/dist/src/utils/installationInfo.test.js.map +1 -0
- package/dist/src/utils/package.d.ts +12 -0
- package/dist/src/utils/package.js +24 -0
- package/dist/src/utils/package.js.map +1 -0
- package/dist/src/utils/readStdin.d.ts +6 -0
- package/dist/src/utils/readStdin.js +44 -0
- package/dist/src/utils/readStdin.js.map +1 -0
- package/dist/src/utils/resolvePath.d.ts +6 -0
- package/dist/src/utils/resolvePath.js +21 -0
- package/dist/src/utils/resolvePath.js.map +1 -0
- package/dist/src/utils/sandbox.d.ts +7 -0
- package/dist/src/utils/sandbox.js +739 -0
- package/dist/src/utils/sandbox.js.map +1 -0
- package/dist/src/utils/settingsUtils.d.ts +134 -0
- package/dist/src/utils/settingsUtils.js +336 -0
- package/dist/src/utils/settingsUtils.js.map +1 -0
- package/dist/src/utils/settingsUtils.test.d.ts +6 -0
- package/dist/src/utils/settingsUtils.test.js +514 -0
- package/dist/src/utils/settingsUtils.test.js.map +1 -0
- package/dist/src/utils/spawnWrapper.d.ts +7 -0
- package/dist/src/utils/spawnWrapper.js +8 -0
- package/dist/src/utils/spawnWrapper.js.map +1 -0
- package/dist/src/utils/startupWarnings.d.ts +6 -0
- package/dist/src/utils/startupWarnings.js +40 -0
- package/dist/src/utils/startupWarnings.js.map +1 -0
- package/dist/src/utils/updateEventEmitter.d.ts +11 -0
- package/dist/src/utils/updateEventEmitter.js +12 -0
- package/dist/src/utils/updateEventEmitter.js.map +1 -0
- package/dist/src/utils/userStartupWarnings.d.ts +6 -0
- package/dist/src/utils/userStartupWarnings.js +54 -0
- package/dist/src/utils/userStartupWarnings.js.map +1 -0
- package/dist/src/utils/userStartupWarnings.test.d.ts +6 -0
- package/dist/src/utils/userStartupWarnings.test.js +67 -0
- package/dist/src/utils/userStartupWarnings.test.js.map +1 -0
- package/dist/src/utils/version.d.ts +6 -0
- package/dist/src/utils/version.js +11 -0
- package/dist/src/utils/version.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.d.ts +7 -0
- package/dist/src/validateNonInterActiveAuth.js +51 -0
- package/dist/src/validateNonInterActiveAuth.js.map +1 -0
- package/dist/src/zed-integration/acp.d.ts +63 -0
- package/dist/src/zed-integration/acp.js +225 -0
- package/dist/src/zed-integration/acp.js.map +1 -0
- package/dist/src/zed-integration/fileSystemService.d.ts +19 -0
- package/dist/src/zed-integration/fileSystemService.js +43 -0
- package/dist/src/zed-integration/fileSystemService.js.map +1 -0
- package/dist/src/zed-integration/schema.d.ts +11782 -0
- package/dist/src/zed-integration/schema.js +311 -0
- package/dist/src/zed-integration/schema.js.map +1 -0
- package/dist/src/zed-integration/zedIntegration.d.ts +10 -0
- package/dist/src/zed-integration/zedIntegration.js +765 -0
- package/dist/src/zed-integration/zedIntegration.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +44 -108
- package/bundle/fss-link.js +0 -129302
- /package/{bundle → dist/src/utils}/sandbox-macos-permissive-closed.sb +0 -0
- /package/{bundle → dist/src/utils}/sandbox-macos-permissive-open.sb +0 -0
- /package/{bundle → dist/src/utils}/sandbox-macos-permissive-proxied.sb +0 -0
- /package/{bundle → dist/src/utils}/sandbox-macos-restrictive-closed.sb +0 -0
- /package/{bundle → dist/src/utils}/sandbox-macos-restrictive-open.sb +0 -0
- /package/{bundle → dist/src/utils}/sandbox-macos-restrictive-proxied.sb +0 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { promises as fs } from 'fs';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import toml from '@iarna/toml';
|
|
9
|
+
import { glob } from 'glob';
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import { getProjectCommandsDir, getUserCommandsDir, } from 'fss-link-core';
|
|
12
|
+
import { CommandKind, } from '../ui/commands/types.js';
|
|
13
|
+
import { DefaultArgumentProcessor } from './prompt-processors/argumentProcessor.js';
|
|
14
|
+
import { SHORTHAND_ARGS_PLACEHOLDER, SHELL_INJECTION_TRIGGER, } from './prompt-processors/types.js';
|
|
15
|
+
import { ConfirmationRequiredError, ShellProcessor, } from './prompt-processors/shellProcessor.js';
|
|
16
|
+
/**
|
|
17
|
+
* Defines the Zod schema for a command definition file. This serves as the
|
|
18
|
+
* single source of truth for both validation and type inference.
|
|
19
|
+
*/
|
|
20
|
+
const TomlCommandDefSchema = z.object({
|
|
21
|
+
prompt: z.string({
|
|
22
|
+
required_error: "The 'prompt' field is required.",
|
|
23
|
+
invalid_type_error: "The 'prompt' field must be a string.",
|
|
24
|
+
}),
|
|
25
|
+
description: z.string().optional(),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Discovers and loads custom slash commands from .toml files in both the
|
|
29
|
+
* user's global config directory and the current project's directory.
|
|
30
|
+
*
|
|
31
|
+
* This loader is responsible for:
|
|
32
|
+
* - Recursively scanning command directories.
|
|
33
|
+
* - Parsing and validating TOML files.
|
|
34
|
+
* - Adapting valid definitions into executable SlashCommand objects.
|
|
35
|
+
* - Handling file system errors and malformed files gracefully.
|
|
36
|
+
*/
|
|
37
|
+
export class FileCommandLoader {
|
|
38
|
+
config;
|
|
39
|
+
projectRoot;
|
|
40
|
+
constructor(config) {
|
|
41
|
+
this.config = config;
|
|
42
|
+
this.projectRoot = config?.getProjectRoot() || process.cwd();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Loads all commands from user, project, and extension directories.
|
|
46
|
+
* Returns commands in order: user → project → extensions (alphabetically).
|
|
47
|
+
*
|
|
48
|
+
* Order is important for conflict resolution in CommandService:
|
|
49
|
+
* - User/project commands (without extensionName) use "last wins" strategy
|
|
50
|
+
* - Extension commands (with extensionName) get renamed if conflicts exist
|
|
51
|
+
*
|
|
52
|
+
* @param signal An AbortSignal to cancel the loading process.
|
|
53
|
+
* @returns A promise that resolves to an array of all loaded SlashCommands.
|
|
54
|
+
*/
|
|
55
|
+
async loadCommands(signal) {
|
|
56
|
+
const allCommands = [];
|
|
57
|
+
const globOptions = {
|
|
58
|
+
nodir: true,
|
|
59
|
+
dot: true,
|
|
60
|
+
signal,
|
|
61
|
+
follow: true,
|
|
62
|
+
};
|
|
63
|
+
// Load commands from each directory
|
|
64
|
+
const commandDirs = this.getCommandDirectories();
|
|
65
|
+
for (const dirInfo of commandDirs) {
|
|
66
|
+
try {
|
|
67
|
+
const files = await glob('**/*.toml', {
|
|
68
|
+
...globOptions,
|
|
69
|
+
cwd: dirInfo.path,
|
|
70
|
+
});
|
|
71
|
+
const commandPromises = files.map((file) => this.parseAndAdaptFile(path.join(dirInfo.path, file), dirInfo.path, dirInfo.extensionName));
|
|
72
|
+
const commands = (await Promise.all(commandPromises)).filter((cmd) => cmd !== null);
|
|
73
|
+
// Add all commands without deduplication
|
|
74
|
+
allCommands.push(...commands);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
if (error.code !== 'ENOENT') {
|
|
78
|
+
console.error(`[FileCommandLoader] Error loading commands from ${dirInfo.path}:`, error);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return allCommands;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get all command directories in order for loading.
|
|
86
|
+
* User commands → Project commands → Extension commands
|
|
87
|
+
* This order ensures extension commands can detect all conflicts.
|
|
88
|
+
*/
|
|
89
|
+
getCommandDirectories() {
|
|
90
|
+
const dirs = [];
|
|
91
|
+
// 1. User commands
|
|
92
|
+
dirs.push({ path: getUserCommandsDir() });
|
|
93
|
+
// 2. Project commands (override user commands)
|
|
94
|
+
dirs.push({ path: getProjectCommandsDir(this.projectRoot) });
|
|
95
|
+
// 3. Extension commands (processed last to detect all conflicts)
|
|
96
|
+
if (this.config) {
|
|
97
|
+
const activeExtensions = this.config
|
|
98
|
+
.getExtensions()
|
|
99
|
+
.filter((ext) => ext.isActive)
|
|
100
|
+
.sort((a, b) => a.name.localeCompare(b.name)); // Sort alphabetically for deterministic loading
|
|
101
|
+
const extensionCommandDirs = activeExtensions.map((ext) => ({
|
|
102
|
+
path: path.join(ext.path, 'commands'),
|
|
103
|
+
extensionName: ext.name,
|
|
104
|
+
}));
|
|
105
|
+
dirs.push(...extensionCommandDirs);
|
|
106
|
+
}
|
|
107
|
+
return dirs;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Parses a single .toml file and transforms it into a SlashCommand object.
|
|
111
|
+
* @param filePath The absolute path to the .toml file.
|
|
112
|
+
* @param baseDir The root command directory for name calculation.
|
|
113
|
+
* @param extensionName Optional extension name to prefix commands with.
|
|
114
|
+
* @returns A promise resolving to a SlashCommand, or null if the file is invalid.
|
|
115
|
+
*/
|
|
116
|
+
async parseAndAdaptFile(filePath, baseDir, extensionName) {
|
|
117
|
+
let fileContent;
|
|
118
|
+
try {
|
|
119
|
+
fileContent = await fs.readFile(filePath, 'utf-8');
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
console.error(`[FileCommandLoader] Failed to read file ${filePath}:`, error instanceof Error ? error.message : String(error));
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
let parsed;
|
|
126
|
+
try {
|
|
127
|
+
parsed = toml.parse(fileContent);
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
console.error(`[FileCommandLoader] Failed to parse TOML file ${filePath}:`, error instanceof Error ? error.message : String(error));
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const validationResult = TomlCommandDefSchema.safeParse(parsed);
|
|
134
|
+
if (!validationResult.success) {
|
|
135
|
+
console.error(`[FileCommandLoader] Skipping invalid command file: ${filePath}. Validation errors:`, validationResult.error.flatten());
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
const validDef = validationResult.data;
|
|
139
|
+
const relativePathWithExt = path.relative(baseDir, filePath);
|
|
140
|
+
const relativePath = relativePathWithExt.substring(0, relativePathWithExt.length - 5);
|
|
141
|
+
const baseCommandName = relativePath
|
|
142
|
+
.split(path.sep)
|
|
143
|
+
// Sanitize each path segment to prevent ambiguity. Since ':' is our
|
|
144
|
+
// namespace separator, we replace any literal colons in filenames
|
|
145
|
+
// with underscores to avoid naming conflicts.
|
|
146
|
+
.map((segment) => segment.replaceAll(':', '_'))
|
|
147
|
+
.join(':');
|
|
148
|
+
// Add extension name tag for extension commands
|
|
149
|
+
const defaultDescription = `Custom command from ${path.basename(filePath)}`;
|
|
150
|
+
let description = validDef.description || defaultDescription;
|
|
151
|
+
if (extensionName) {
|
|
152
|
+
description = `[${extensionName}] ${description}`;
|
|
153
|
+
}
|
|
154
|
+
const processors = [];
|
|
155
|
+
const usesArgs = validDef.prompt.includes(SHORTHAND_ARGS_PLACEHOLDER);
|
|
156
|
+
const usesShellInjection = validDef.prompt.includes(SHELL_INJECTION_TRIGGER);
|
|
157
|
+
// Interpolation (Shell Execution and Argument Injection)
|
|
158
|
+
// If the prompt uses either shell injection OR argument placeholders,
|
|
159
|
+
// we must use the ShellProcessor.
|
|
160
|
+
if (usesShellInjection || usesArgs) {
|
|
161
|
+
processors.push(new ShellProcessor(baseCommandName));
|
|
162
|
+
}
|
|
163
|
+
// Default Argument Handling
|
|
164
|
+
// If NO explicit argument injection ({{args}}) was used, we append the raw invocation.
|
|
165
|
+
if (!usesArgs) {
|
|
166
|
+
processors.push(new DefaultArgumentProcessor());
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
name: baseCommandName,
|
|
170
|
+
description,
|
|
171
|
+
kind: CommandKind.FILE,
|
|
172
|
+
extensionName,
|
|
173
|
+
action: async (context, _args) => {
|
|
174
|
+
if (!context.invocation) {
|
|
175
|
+
console.error(`[FileCommandLoader] Critical error: Command '${baseCommandName}' was executed without invocation context.`);
|
|
176
|
+
return {
|
|
177
|
+
type: 'submit_prompt',
|
|
178
|
+
content: validDef.prompt, // Fallback to unprocessed prompt
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
try {
|
|
182
|
+
let processedPrompt = validDef.prompt;
|
|
183
|
+
for (const processor of processors) {
|
|
184
|
+
processedPrompt = await processor.process(processedPrompt, context);
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
type: 'submit_prompt',
|
|
188
|
+
content: processedPrompt,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
catch (e) {
|
|
192
|
+
// Check if it's our specific error type
|
|
193
|
+
if (e instanceof ConfirmationRequiredError) {
|
|
194
|
+
// Halt and request confirmation from the UI layer.
|
|
195
|
+
return {
|
|
196
|
+
type: 'confirm_shell_commands',
|
|
197
|
+
commandsToConfirm: e.commandsToConfirm,
|
|
198
|
+
originalInvocation: {
|
|
199
|
+
raw: context.invocation.raw,
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
// Re-throw other errors to be handled by the global error handler.
|
|
204
|
+
throw e;
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=FileCommandLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileCommandLoader.js","sourceRoot":"","sources":["../../../src/services/FileCommandLoader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE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C,CAAC,iBAAiB;4BACtC,kBAAkB,EAAE;gCAClB,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG;6BAC5B;yBACF,CAAC;oBACJ,CAAC;oBACD,mEAAmE;oBACnE,MAAM,CAAC,CAAC;gBACV,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Config } from 'fss-link-core';
|
|
7
|
+
import { SlashCommand } from '../ui/commands/types.js';
|
|
8
|
+
import { ICommandLoader } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Discovers and loads executable slash commands from prompts exposed by
|
|
11
|
+
* Model-Context-Protocol (MCP) servers.
|
|
12
|
+
*/
|
|
13
|
+
export declare class McpPromptLoader implements ICommandLoader {
|
|
14
|
+
private readonly config;
|
|
15
|
+
constructor(config: Config | null);
|
|
16
|
+
/**
|
|
17
|
+
* Loads all available prompts from all configured MCP servers and adapts
|
|
18
|
+
* them into executable SlashCommand objects.
|
|
19
|
+
*
|
|
20
|
+
* @param _signal An AbortSignal (unused for this synchronous loader).
|
|
21
|
+
* @returns A promise that resolves to an array of loaded SlashCommands.
|
|
22
|
+
*/
|
|
23
|
+
loadCommands(_signal: AbortSignal): Promise<SlashCommand[]>;
|
|
24
|
+
private parseArgs;
|
|
25
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { getErrorMessage, getMCPServerPrompts, } from 'fss-link-core';
|
|
7
|
+
import { CommandKind, } from '../ui/commands/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Discovers and loads executable slash commands from prompts exposed by
|
|
10
|
+
* Model-Context-Protocol (MCP) servers.
|
|
11
|
+
*/
|
|
12
|
+
export class McpPromptLoader {
|
|
13
|
+
config;
|
|
14
|
+
constructor(config) {
|
|
15
|
+
this.config = config;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Loads all available prompts from all configured MCP servers and adapts
|
|
19
|
+
* them into executable SlashCommand objects.
|
|
20
|
+
*
|
|
21
|
+
* @param _signal An AbortSignal (unused for this synchronous loader).
|
|
22
|
+
* @returns A promise that resolves to an array of loaded SlashCommands.
|
|
23
|
+
*/
|
|
24
|
+
loadCommands(_signal) {
|
|
25
|
+
const promptCommands = [];
|
|
26
|
+
if (!this.config) {
|
|
27
|
+
return Promise.resolve([]);
|
|
28
|
+
}
|
|
29
|
+
const mcpServers = this.config.getMcpServers() || {};
|
|
30
|
+
for (const serverName in mcpServers) {
|
|
31
|
+
const prompts = getMCPServerPrompts(this.config, serverName) || [];
|
|
32
|
+
for (const prompt of prompts) {
|
|
33
|
+
const commandName = `${prompt.name}`;
|
|
34
|
+
const newPromptCommand = {
|
|
35
|
+
name: commandName,
|
|
36
|
+
description: prompt.description || `Invoke prompt ${prompt.name}`,
|
|
37
|
+
kind: CommandKind.MCP_PROMPT,
|
|
38
|
+
subCommands: [
|
|
39
|
+
{
|
|
40
|
+
name: 'help',
|
|
41
|
+
description: 'Show help for this prompt',
|
|
42
|
+
kind: CommandKind.MCP_PROMPT,
|
|
43
|
+
action: async () => {
|
|
44
|
+
if (!prompt.arguments || prompt.arguments.length === 0) {
|
|
45
|
+
return {
|
|
46
|
+
type: 'message',
|
|
47
|
+
messageType: 'info',
|
|
48
|
+
content: `Prompt "${prompt.name}" has no arguments.`,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
let helpMessage = `Arguments for "${prompt.name}":\n\n`;
|
|
52
|
+
if (prompt.arguments && prompt.arguments.length > 0) {
|
|
53
|
+
helpMessage += `You can provide arguments by name (e.g., --argName="value") or by position.\n\n`;
|
|
54
|
+
helpMessage += `e.g., ${prompt.name} ${prompt.arguments?.map((_) => `"foo"`)} is equivalent to ${prompt.name} ${prompt.arguments?.map((arg) => `--${arg.name}="foo"`)}\n\n`;
|
|
55
|
+
}
|
|
56
|
+
for (const arg of prompt.arguments) {
|
|
57
|
+
helpMessage += ` --${arg.name}\n`;
|
|
58
|
+
if (arg.description) {
|
|
59
|
+
helpMessage += ` ${arg.description}\n`;
|
|
60
|
+
}
|
|
61
|
+
helpMessage += ` (required: ${arg.required ? 'yes' : 'no'})\n\n`;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
type: 'message',
|
|
65
|
+
messageType: 'info',
|
|
66
|
+
content: helpMessage,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
action: async (context, args) => {
|
|
72
|
+
if (!this.config) {
|
|
73
|
+
return {
|
|
74
|
+
type: 'message',
|
|
75
|
+
messageType: 'error',
|
|
76
|
+
content: 'Config not loaded.',
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const promptInputs = this.parseArgs(args, prompt.arguments);
|
|
80
|
+
if (promptInputs instanceof Error) {
|
|
81
|
+
return {
|
|
82
|
+
type: 'message',
|
|
83
|
+
messageType: 'error',
|
|
84
|
+
content: promptInputs.message,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
const mcpServers = this.config.getMcpServers() || {};
|
|
89
|
+
const mcpServerConfig = mcpServers[serverName];
|
|
90
|
+
if (!mcpServerConfig) {
|
|
91
|
+
return {
|
|
92
|
+
type: 'message',
|
|
93
|
+
messageType: 'error',
|
|
94
|
+
content: `MCP server config not found for '${serverName}'.`,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const result = await prompt.invoke(promptInputs);
|
|
98
|
+
if (result['error']) {
|
|
99
|
+
return {
|
|
100
|
+
type: 'message',
|
|
101
|
+
messageType: 'error',
|
|
102
|
+
content: `Error invoking prompt: ${result['error']}`,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (!result.messages?.[0]?.content?.['text']) {
|
|
106
|
+
return {
|
|
107
|
+
type: 'message',
|
|
108
|
+
messageType: 'error',
|
|
109
|
+
content: 'Received an empty or invalid prompt response from the server.',
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
type: 'submit_prompt',
|
|
114
|
+
content: JSON.stringify(result.messages[0].content.text),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
return {
|
|
119
|
+
type: 'message',
|
|
120
|
+
messageType: 'error',
|
|
121
|
+
content: `Error: ${getErrorMessage(error)}`,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
completion: async (_, partialArg) => {
|
|
126
|
+
if (!prompt || !prompt.arguments) {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
const suggestions = [];
|
|
130
|
+
const usedArgNames = new Set((partialArg.match(/--([^=]+)/g) || []).map((s) => s.substring(2)));
|
|
131
|
+
for (const arg of prompt.arguments) {
|
|
132
|
+
if (!usedArgNames.has(arg.name)) {
|
|
133
|
+
suggestions.push(`--${arg.name}=""`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return suggestions;
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
promptCommands.push(newPromptCommand);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return Promise.resolve(promptCommands);
|
|
143
|
+
}
|
|
144
|
+
parseArgs(userArgs, promptArgs) {
|
|
145
|
+
const argValues = {};
|
|
146
|
+
const promptInputs = {};
|
|
147
|
+
// arg parsing: --key="value" or --key=value
|
|
148
|
+
const namedArgRegex = /--([^=]+)=(?:"((?:\\.|[^"\\])*)"|([^ ]*))/g;
|
|
149
|
+
let match;
|
|
150
|
+
const remainingArgs = [];
|
|
151
|
+
let lastIndex = 0;
|
|
152
|
+
while ((match = namedArgRegex.exec(userArgs)) !== null) {
|
|
153
|
+
const key = match[1];
|
|
154
|
+
const value = match[2] ?? match[3]; // Quoted or unquoted value
|
|
155
|
+
argValues[key] = value;
|
|
156
|
+
// Capture text between matches as potential positional args
|
|
157
|
+
if (match.index > lastIndex) {
|
|
158
|
+
remainingArgs.push(userArgs.substring(lastIndex, match.index).trim());
|
|
159
|
+
}
|
|
160
|
+
lastIndex = namedArgRegex.lastIndex;
|
|
161
|
+
}
|
|
162
|
+
// Capture any remaining text after the last named arg
|
|
163
|
+
if (lastIndex < userArgs.length) {
|
|
164
|
+
remainingArgs.push(userArgs.substring(lastIndex).trim());
|
|
165
|
+
}
|
|
166
|
+
const positionalArgs = remainingArgs.join(' ').split(/ +/);
|
|
167
|
+
if (!promptArgs) {
|
|
168
|
+
return promptInputs;
|
|
169
|
+
}
|
|
170
|
+
for (const arg of promptArgs) {
|
|
171
|
+
if (argValues[arg.name]) {
|
|
172
|
+
promptInputs[arg.name] = argValues[arg.name];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const unfilledArgs = promptArgs.filter((arg) => arg.required && !promptInputs[arg.name]);
|
|
176
|
+
const missingArgs = [];
|
|
177
|
+
for (let i = 0; i < unfilledArgs.length; i++) {
|
|
178
|
+
if (positionalArgs.length > i && positionalArgs[i]) {
|
|
179
|
+
promptInputs[unfilledArgs[i].name] = positionalArgs[i];
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
missingArgs.push(unfilledArgs[i].name);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (missingArgs.length > 0) {
|
|
186
|
+
const missingArgNames = missingArgs.map((name) => `--${name}`).join(', ');
|
|
187
|
+
return new Error(`Missing required argument(s): ${missingArgNames}`);
|
|
188
|
+
}
|
|
189
|
+
return promptInputs;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=McpPromptLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mcp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|
|
11
|
+
* Configuration provider for search engine API keys
|
|
12
|
+
* Loads from database and sets environment variables
|
|
13
|
+
*/
|
|
14
|
+
export declare class SearchEngineConfigProvider {
|
|
15
|
+
private static instance;
|
|
16
|
+
static getInstance(): SearchEngineConfigProvider;
|
|
17
|
+
/**
|
|
18
|
+
* Load search engine configuration from database and set environment variables
|
|
19
|
+
*/
|
|
20
|
+
loadConfiguration(): Promise<SearchEngineConfig>;
|
|
21
|
+
/**
|
|
22
|
+
* Save search engine configuration to database
|
|
23
|
+
*/
|
|
24
|
+
saveConfiguration(config: SearchEngineConfig): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Check if search engines are configured
|
|
27
|
+
*/
|
|
28
|
+
hasConfiguration(): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* Get configuration status for display
|
|
31
|
+
*/
|
|
32
|
+
getConfigurationStatus(): Promise<string>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { getFSSLinkDatabase } from '../config/database.js';
|
|
7
|
+
/**
|
|
8
|
+
* Configuration provider for search engine API keys
|
|
9
|
+
* Loads from database and sets environment variables
|
|
10
|
+
*/
|
|
11
|
+
export class SearchEngineConfigProvider {
|
|
12
|
+
static instance = null;
|
|
13
|
+
static getInstance() {
|
|
14
|
+
if (!SearchEngineConfigProvider.instance) {
|
|
15
|
+
SearchEngineConfigProvider.instance = new SearchEngineConfigProvider();
|
|
16
|
+
}
|
|
17
|
+
return SearchEngineConfigProvider.instance;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Load search engine configuration from database and set environment variables
|
|
21
|
+
*/
|
|
22
|
+
async loadConfiguration() {
|
|
23
|
+
const db = await getFSSLinkDatabase();
|
|
24
|
+
const braveApiKey = await db.getUserPreference('webscraper.brave_api_key');
|
|
25
|
+
const tavilyApiKey = await db.getUserPreference('webscraper.tavily_api_key');
|
|
26
|
+
// Set environment variables for immediate use
|
|
27
|
+
if (braveApiKey) {
|
|
28
|
+
process.env['BRAVE_SEARCH_API_KEY'] = braveApiKey;
|
|
29
|
+
}
|
|
30
|
+
if (tavilyApiKey) {
|
|
31
|
+
process.env['TAVILY_API_KEY'] = tavilyApiKey;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
braveApiKey: braveApiKey || undefined,
|
|
35
|
+
tavilyApiKey: tavilyApiKey || undefined,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Save search engine configuration to database
|
|
40
|
+
*/
|
|
41
|
+
async saveConfiguration(config) {
|
|
42
|
+
const db = await getFSSLinkDatabase();
|
|
43
|
+
if (config.braveApiKey) {
|
|
44
|
+
await db.setUserPreference('webscraper.brave_api_key', config.braveApiKey);
|
|
45
|
+
await db.setUserPreference('webscraper.brave_enabled', 'true');
|
|
46
|
+
process.env['BRAVE_SEARCH_API_KEY'] = config.braveApiKey;
|
|
47
|
+
}
|
|
48
|
+
if (config.tavilyApiKey) {
|
|
49
|
+
await db.setUserPreference('webscraper.tavily_api_key', config.tavilyApiKey);
|
|
50
|
+
await db.setUserPreference('webscraper.tavily_enabled', 'true');
|
|
51
|
+
process.env['TAVILY_API_KEY'] = config.tavilyApiKey;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Check if search engines are configured
|
|
56
|
+
*/
|
|
57
|
+
async hasConfiguration() {
|
|
58
|
+
const config = await this.loadConfiguration();
|
|
59
|
+
return !!(config.braveApiKey || config.tavilyApiKey);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get configuration status for display
|
|
63
|
+
*/
|
|
64
|
+
async getConfigurationStatus() {
|
|
65
|
+
const config = await this.loadConfiguration();
|
|
66
|
+
let status = '🔍 Search Engine Configuration:\n';
|
|
67
|
+
if (config.braveApiKey) {
|
|
68
|
+
status += `✅ Brave Search: Configured\n`;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
status += `❌ Brave Search: Not configured\n`;
|
|
72
|
+
}
|
|
73
|
+
if (config.tavilyApiKey) {
|
|
74
|
+
status += `✅ Tavily Search: Configured\n`;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
status += `❌ Tavily Search: Not configured\n`;
|
|
78
|
+
}
|
|
79
|
+
return status;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=SearchEngineConfigProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchEngineConfigProvider.js","sourceRoot":"","sources":["../../../src/services/SearchEngineConfigProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAO3D;;;GAGG;AACH,MAAM,OAAO,0BAA0B;IAC7B,MAAM,CAAC,QAAQ,GAAsC,IAAI,CAAC;IAElE,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,0BAA0B,CAAC,QAAQ,EAAE,CAAC;YACzC,0BAA0B,CAAC,QAAQ,GAAG,IAAI,0BAA0B,EAAE,CAAC;QACzE,CAAC;QACD,OAAO,0BAA0B,CAAC,QAAQ,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB;QACrB,MAAM,EAAE,GAAG,MAAM,kBAAkB,EAAE,CAAC;QAEtC,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,iBAAiB,CAAC,0BAA0B,CAAC,CAAC;QAC3E,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CAAC;QAE7E,8CAA8C;QAC9C,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,GAAG,WAAW,CAAC;QACpD,CAAC;QACD,IAAI,Y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MAAM,CAAC,WAAW,EAAE,CAAC;YACvB,MAAM,IAAI,8BAA8B,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,kCAAkC,CAAC;QAC/C,CAAC;QAED,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,MAAM,IAAI,+BAA+B,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,mCAAmC,CAAC;QAChD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { IPromptProcessor } from './types.js';
|
|
7
|
+
import { CommandContext } from '../../ui/commands/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Appends the user's full command invocation to the prompt if arguments are
|
|
10
|
+
* provided, allowing the model to perform its own argument parsing.
|
|
11
|
+
*
|
|
12
|
+
* This processor is only used if the prompt does NOT contain {{args}}.
|
|
13
|
+
*/
|
|
14
|
+
export declare class DefaultArgumentProcessor implements IPromptProcessor {
|
|
15
|
+
process(prompt: string, context: CommandContext): Promise<string>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Appends the user's full command invocation to the prompt if arguments are
|
|
8
|
+
* provided, allowing the model to perform its own argument parsing.
|
|
9
|
+
*
|
|
10
|
+
* This processor is only used if the prompt does NOT contain {{args}}.
|
|
11
|
+
*/
|
|
12
|
+
export class DefaultArgumentProcessor {
|
|
13
|
+
async process(prompt, context) {
|
|
14
|
+
if (context.invocation.args) {
|
|
15
|
+
return `${prompt}\n\n${context.invocation.raw}`;
|
|
16
|
+
}
|
|
17
|
+
return prompt;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=argumentProcessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argumentProcessor.js","sourceRoot":"","sources":["../../../../src/services/prompt-processors/argumentProcessor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;;;;GAKG;AACH,MAAM,OAAO,wBAAwB;IACnC,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAuB;QACnD,IAAI,OAAO,CAAC,UAAW,CAAC,IAAI,EAAE,CAAC;YAC7B,OAAO,GAAG,MAAM,OAAO,OAAO,CAAC,UAAW,CAAC,GAAG,EAAE,CAAC;QACnD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CommandContext } from '../../ui/commands/types.js';
|
|
7
|
+
import { IPromptProcessor } from './types.js';
|
|
8
|
+
export declare class ConfirmationRequiredError extends Error {
|
|
9
|
+
commandsToConfirm: string[];
|
|
10
|
+
constructor(message: string, commandsToConfirm: string[]);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Handles prompt interpolation, including shell command execution (`!{...}`)
|
|
14
|
+
* and context-aware argument injection (`{{args}}`).
|
|
15
|
+
*
|
|
16
|
+
* This processor ensures that:
|
|
17
|
+
* 1. `{{args}}` outside `!{...}` are replaced with raw input.
|
|
18
|
+
* 2. `{{args}}` inside `!{...}` are replaced with shell-escaped input.
|
|
19
|
+
* 3. Shell commands are executed securely after argument substitution.
|
|
20
|
+
* 4. Parsing correctly handles nested braces.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ShellProcessor implements IPromptProcessor {
|
|
23
|
+
private readonly commandName;
|
|
24
|
+
constructor(commandName: string);
|
|
25
|
+
process(prompt: string, context: CommandContext): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Iteratively parses the prompt string to extract shell injections (!{...}),
|
|
28
|
+
* correctly handling nested braces within the command.
|
|
29
|
+
*
|
|
30
|
+
* @param prompt The prompt string to parse.
|
|
31
|
+
* @returns An array of extracted ShellInjection objects.
|
|
32
|
+
* @throws Error if an unclosed injection (`!{`) is found.
|
|
33
|
+
*/
|
|
34
|
+
private extractInjections;
|
|
35
|
+
}
|