fss-link 1.2.1 → 1.2.3
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/bundle/fss-link.js +127361 -0
- package/package.json +109 -44
- package/dist/.last_build +0 -0
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -14
- package/dist/index.js.map +0 -1
- package/dist/package.json +0 -89
- package/dist/src/commands/mcp/add.d.ts +0 -7
- package/dist/src/commands/mcp/add.js +0 -166
- package/dist/src/commands/mcp/add.js.map +0 -1
- package/dist/src/commands/mcp/list.d.ts +0 -8
- package/dist/src/commands/mcp/list.js +0 -110
- package/dist/src/commands/mcp/list.js.map +0 -1
- package/dist/src/commands/mcp/remove.d.ts +0 -7
- package/dist/src/commands/mcp/remove.js +0 -44
- package/dist/src/commands/mcp/remove.js.map +0 -1
- package/dist/src/commands/mcp.d.ts +0 -7
- package/dist/src/commands/mcp.js +0 -23
- package/dist/src/commands/mcp.js.map +0 -1
- package/dist/src/config/archive-repository-pattern/README.md +0 -26
- package/dist/src/config/archive-repository-pattern/base-repository.d.ts +0 -252
- package/dist/src/config/archive-repository-pattern/base-repository.js +0 -280
- package/dist/src/config/archive-repository-pattern/base-repository.js.map +0 -1
- package/dist/src/config/archive-repository-pattern/model-repository.d.ts +0 -274
- package/dist/src/config/archive-repository-pattern/model-repository.js +0 -482
- package/dist/src/config/archive-repository-pattern/model-repository.js.map +0 -1
- package/dist/src/config/archive-repository-pattern/preferences-repository.d.ts +0 -307
- package/dist/src/config/archive-repository-pattern/preferences-repository.js +0 -604
- package/dist/src/config/archive-repository-pattern/preferences-repository.js.map +0 -1
- package/dist/src/config/archive-repository-pattern/repository-types.d.ts +0 -166
- package/dist/src/config/archive-repository-pattern/repository-types.js +0 -67
- package/dist/src/config/archive-repository-pattern/repository-types.js.map +0 -1
- package/dist/src/config/archive-repository-pattern/settings-repository.d.ts +0 -274
- package/dist/src/config/archive-repository-pattern/settings-repository.js +0 -531
- package/dist/src/config/archive-repository-pattern/settings-repository.js.map +0 -1
- package/dist/src/config/async-mutex.d.ts +0 -61
- package/dist/src/config/async-mutex.js +0 -121
- package/dist/src/config/async-mutex.js.map +0 -1
- package/dist/src/config/async-mutex.test.d.ts +0 -6
- package/dist/src/config/async-mutex.test.js +0 -271
- package/dist/src/config/async-mutex.test.js.map +0 -1
- package/dist/src/config/auth-stress-simplified.test.d.ts +0 -6
- package/dist/src/config/auth-stress-simplified.test.js +0 -329
- package/dist/src/config/auth-stress-simplified.test.js.map +0 -1
- package/dist/src/config/auth-stress.test.d.ts +0 -9
- package/dist/src/config/auth-stress.test.js +0 -544
- package/dist/src/config/auth-stress.test.js.map +0 -1
- package/dist/src/config/auth.d.ts +0 -96
- package/dist/src/config/auth.js +0 -371
- package/dist/src/config/auth.js.map +0 -1
- package/dist/src/config/auth.test.d.ts +0 -6
- package/dist/src/config/auth.test.js +0 -61
- package/dist/src/config/auth.test.js.map +0 -1
- package/dist/src/config/base-repository.d.ts +0 -252
- package/dist/src/config/base-repository.js +0 -272
- package/dist/src/config/base-repository.js.map +0 -1
- package/dist/src/config/config.d.ts +0 -51
- package/dist/src/config/config.js +0 -553
- package/dist/src/config/config.js.map +0 -1
- package/dist/src/config/core-database.d.ts +0 -112
- package/dist/src/config/core-database.js +0 -370
- package/dist/src/config/core-database.js.map +0 -1
- package/dist/src/config/database-integration.test.d.ts +0 -6
- package/dist/src/config/database-integration.test.js +0 -547
- package/dist/src/config/database-integration.test.js.map +0 -1
- package/dist/src/config/database-legacy-wrapper.d.ts +0 -202
- package/dist/src/config/database-legacy-wrapper.js +0 -391
- package/dist/src/config/database-legacy-wrapper.js.map +0 -1
- package/dist/src/config/database-monitor.d.ts +0 -135
- package/dist/src/config/database-monitor.js +0 -306
- package/dist/src/config/database-monitor.js.map +0 -1
- package/dist/src/config/database-queue.d.ts +0 -106
- package/dist/src/config/database-queue.js +0 -187
- package/dist/src/config/database-queue.js.map +0 -1
- package/dist/src/config/database-queue.test.d.ts +0 -6
- package/dist/src/config/database-queue.test.js +0 -344
- package/dist/src/config/database-queue.test.js.map +0 -1
- package/dist/src/config/database-regression-simple.test.d.ts +0 -6
- package/dist/src/config/database-regression-simple.test.js +0 -335
- package/dist/src/config/database-regression-simple.test.js.map +0 -1
- package/dist/src/config/database-regression.test.d.ts +0 -6
- package/dist/src/config/database-regression.test.js +0 -523
- package/dist/src/config/database-regression.test.js.map +0 -1
- package/dist/src/config/database-stress.test.d.ts +0 -6
- package/dist/src/config/database-stress.test.js +0 -522
- package/dist/src/config/database-stress.test.js.map +0 -1
- package/dist/src/config/database-utils.d.ts +0 -281
- package/dist/src/config/database-utils.js +0 -664
- package/dist/src/config/database-utils.js.map +0 -1
- package/dist/src/config/database-utils.test.d.ts +0 -6
- package/dist/src/config/database-utils.test.js +0 -278
- package/dist/src/config/database-utils.test.js.map +0 -1
- package/dist/src/config/database.d.ts +0 -212
- package/dist/src/config/database.js +0 -458
- package/dist/src/config/database.js.map +0 -1
- package/dist/src/config/databaseBackup.d.ts +0 -114
- package/dist/src/config/databaseBackup.js +0 -334
- package/dist/src/config/databaseBackup.js.map +0 -1
- package/dist/src/config/databaseHealthMonitor.d.ts +0 -86
- package/dist/src/config/databaseHealthMonitor.js +0 -180
- package/dist/src/config/databaseHealthMonitor.js.map +0 -1
- package/dist/src/config/databaseMetrics.d.ts +0 -147
- package/dist/src/config/databaseMetrics.js +0 -369
- package/dist/src/config/databaseMetrics.js.map +0 -1
- package/dist/src/config/databaseMigrations.d.ts +0 -75
- package/dist/src/config/databaseMigrations.js +0 -405
- package/dist/src/config/databaseMigrations.js.map +0 -1
- package/dist/src/config/databasePool.d.ts +0 -72
- package/dist/src/config/databasePool.js +0 -226
- package/dist/src/config/databasePool.js.map +0 -1
- package/dist/src/config/databaseSchemaValidator.d.ts +0 -114
- package/dist/src/config/databaseSchemaValidator.js +0 -497
- package/dist/src/config/databaseSchemaValidator.js.map +0 -1
- package/dist/src/config/extension.d.ts +0 -23
- package/dist/src/config/extension.js +0 -126
- package/dist/src/config/extension.js.map +0 -1
- package/dist/src/config/health-database.d.ts +0 -172
- package/dist/src/config/health-database.js +0 -283
- package/dist/src/config/health-database.js.map +0 -1
- package/dist/src/config/keyBindings.d.ts +0 -66
- package/dist/src/config/keyBindings.js +0 -141
- package/dist/src/config/keyBindings.js.map +0 -1
- package/dist/src/config/keyBindings.test.d.ts +0 -6
- package/dist/src/config/keyBindings.test.js +0 -51
- package/dist/src/config/keyBindings.test.js.map +0 -1
- package/dist/src/config/model-database.d.ts +0 -157
- package/dist/src/config/model-database.js +0 -379
- package/dist/src/config/model-database.js.map +0 -1
- package/dist/src/config/model-repository.d.ts +0 -274
- package/dist/src/config/model-repository.js +0 -482
- package/dist/src/config/model-repository.js.map +0 -1
- package/dist/src/config/modelManager.d.ts +0 -146
- package/dist/src/config/modelManager.js +0 -573
- package/dist/src/config/modelManager.js.map +0 -1
- package/dist/src/config/preferences-database.d.ts +0 -101
- package/dist/src/config/preferences-database.js +0 -209
- package/dist/src/config/preferences-database.js.map +0 -1
- package/dist/src/config/preferences-repository.d.ts +0 -307
- package/dist/src/config/preferences-repository.js +0 -604
- package/dist/src/config/preferences-repository.js.map +0 -1
- package/dist/src/config/provider-database.d.ts +0 -102
- package/dist/src/config/provider-database.js +0 -250
- package/dist/src/config/provider-database.js.map +0 -1
- package/dist/src/config/providerPersistence.d.ts +0 -82
- package/dist/src/config/providerPersistence.js +0 -62
- package/dist/src/config/providerPersistence.js.map +0 -1
- package/dist/src/config/queryOptimizer.d.ts +0 -127
- package/dist/src/config/queryOptimizer.js +0 -330
- package/dist/src/config/queryOptimizer.js.map +0 -1
- package/dist/src/config/repository-types.d.ts +0 -166
- package/dist/src/config/repository-types.js +0 -67
- package/dist/src/config/repository-types.js.map +0 -1
- package/dist/src/config/sandboxConfig.d.ts +0 -13
- package/dist/src/config/sandboxConfig.js +0 -75
- package/dist/src/config/sandboxConfig.js.map +0 -1
- package/dist/src/config/settings-repository.d.ts +0 -274
- package/dist/src/config/settings-repository.js +0 -531
- package/dist/src/config/settings-repository.js.map +0 -1
- package/dist/src/config/settings.d.ts +0 -56
- package/dist/src/config/settings.js +0 -411
- package/dist/src/config/settings.js.map +0 -1
- package/dist/src/config/settingsSchema.d.ts +0 -703
- package/dist/src/config/settingsSchema.js +0 -679
- package/dist/src/config/settingsSchema.js.map +0 -1
- package/dist/src/config/settingsSchema.test.d.ts +0 -6
- package/dist/src/config/settingsSchema.test.js +0 -195
- package/dist/src/config/settingsSchema.test.js.map +0 -1
- package/dist/src/config/trustedFolders.d.ts +0 -37
- package/dist/src/config/trustedFolders.js +0 -118
- package/dist/src/config/trustedFolders.js.map +0 -1
- package/dist/src/config/trustedFolders.test.d.ts +0 -6
- package/dist/src/config/trustedFolders.test.js +0 -160
- package/dist/src/config/trustedFolders.test.js.map +0 -1
- package/dist/src/config/unified-database.d.ts +0 -383
- package/dist/src/config/unified-database.js +0 -651
- package/dist/src/config/unified-database.js.map +0 -1
- package/dist/src/config/unified-database.test.d.ts +0 -6
- package/dist/src/config/unified-database.test.js +0 -162
- package/dist/src/config/unified-database.test.js.map +0 -1
- package/dist/src/gemini.d.ts +0 -9
- package/dist/src/gemini.js +0 -334
- package/dist/src/gemini.js.map +0 -1
- package/dist/src/gemini.test.d.ts +0 -6
- package/dist/src/gemini.test.js +0 -193
- package/dist/src/gemini.test.js.map +0 -1
- package/dist/src/generated/git-commit.d.ts +0 -7
- package/dist/src/generated/git-commit.js +0 -10
- package/dist/src/generated/git-commit.js.map +0 -1
- package/dist/src/nonInteractiveCli.d.ts +0 -7
- package/dist/src/nonInteractiveCli.js +0 -103
- package/dist/src/nonInteractiveCli.js.map +0 -1
- package/dist/src/patches/is-in-ci.d.ts +0 -7
- package/dist/src/patches/is-in-ci.js +0 -15
- package/dist/src/patches/is-in-ci.js.map +0 -1
- package/dist/src/services/BuiltinCommandLoader.d.ts +0 -24
- package/dist/src/services/BuiltinCommandLoader.js +0 -92
- package/dist/src/services/BuiltinCommandLoader.js.map +0 -1
- package/dist/src/services/BuiltinCommandLoader.test.d.ts +0 -6
- package/dist/src/services/BuiltinCommandLoader.test.js +0 -108
- package/dist/src/services/BuiltinCommandLoader.test.js.map +0 -1
- package/dist/src/services/CommandService.d.ts +0 -55
- package/dist/src/services/CommandService.js +0 -90
- package/dist/src/services/CommandService.js.map +0 -1
- package/dist/src/services/CommandService.test.d.ts +0 -6
- package/dist/src/services/CommandService.test.js +0 -232
- package/dist/src/services/CommandService.test.js.map +0 -1
- package/dist/src/services/FileCommandLoader.d.ts +0 -49
- package/dist/src/services/FileCommandLoader.js +0 -210
- package/dist/src/services/FileCommandLoader.js.map +0 -1
- package/dist/src/services/McpPromptLoader.d.ts +0 -25
- package/dist/src/services/McpPromptLoader.js +0 -192
- package/dist/src/services/McpPromptLoader.js.map +0 -1
- package/dist/src/services/SearchEngineConfigProvider.d.ts +0 -33
- package/dist/src/services/SearchEngineConfigProvider.js +0 -82
- package/dist/src/services/SearchEngineConfigProvider.js.map +0 -1
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +0 -16
- package/dist/src/services/prompt-processors/argumentProcessor.js +0 -20
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +0 -1
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +0 -35
- package/dist/src/services/prompt-processors/shellProcessor.js +0 -162
- package/dist/src/services/prompt-processors/shellProcessor.js.map +0 -1
- package/dist/src/services/prompt-processors/types.d.ts +0 -40
- package/dist/src/services/prompt-processors/types.js +0 -16
- package/dist/src/services/prompt-processors/types.js.map +0 -1
- package/dist/src/services/types.d.ts +0 -22
- package/dist/src/services/types.js +0 -7
- package/dist/src/services/types.js.map +0 -1
- package/dist/src/test-utils/customMatchers.d.ts +0 -14
- package/dist/src/test-utils/customMatchers.js +0 -46
- package/dist/src/test-utils/customMatchers.js.map +0 -1
- package/dist/src/test-utils/mockCommandContext.d.ts +0 -18
- package/dist/src/test-utils/mockCommandContext.js +0 -87
- package/dist/src/test-utils/mockCommandContext.js.map +0 -1
- package/dist/src/test-utils/mockCommandContext.test.d.ts +0 -6
- package/dist/src/test-utils/mockCommandContext.test.js +0 -51
- package/dist/src/test-utils/mockCommandContext.test.js.map +0 -1
- package/dist/src/test-utils/render.d.ts +0 -8
- package/dist/src/test-utils/render.js +0 -10
- package/dist/src/test-utils/render.js.map +0 -1
- package/dist/src/ui/App.d.ts +0 -15
- package/dist/src/ui/App.js +0 -687
- package/dist/src/ui/App.js.map +0 -1
- package/dist/src/ui/IdeIntegrationNudge.d.ts +0 -16
- package/dist/src/ui/IdeIntegrationNudge.js +0 -52
- package/dist/src/ui/IdeIntegrationNudge.js.map +0 -1
- package/dist/src/ui/colors.d.ts +0 -7
- package/dist/src/ui/colors.js +0 -54
- package/dist/src/ui/colors.js.map +0 -1
- package/dist/src/ui/commands/aboutCommand.d.ts +0 -7
- package/dist/src/ui/commands/aboutCommand.js +0 -43
- package/dist/src/ui/commands/aboutCommand.js.map +0 -1
- package/dist/src/ui/commands/authCommand.d.ts +0 -7
- package/dist/src/ui/commands/authCommand.js +0 -16
- package/dist/src/ui/commands/authCommand.js.map +0 -1
- package/dist/src/ui/commands/bugCommand.d.ts +0 -7
- package/dist/src/ui/commands/bugCommand.js +0 -71
- package/dist/src/ui/commands/bugCommand.js.map +0 -1
- package/dist/src/ui/commands/chatCommand.d.ts +0 -7
- package/dist/src/ui/commands/chatCommand.js +0 -234
- package/dist/src/ui/commands/chatCommand.js.map +0 -1
- package/dist/src/ui/commands/clearCommand.d.ts +0 -7
- package/dist/src/ui/commands/clearCommand.js +0 -27
- package/dist/src/ui/commands/clearCommand.js.map +0 -1
- package/dist/src/ui/commands/compressCommand.d.ts +0 -7
- package/dist/src/ui/commands/compressCommand.js +0 -64
- package/dist/src/ui/commands/compressCommand.js.map +0 -1
- package/dist/src/ui/commands/contextCommand.d.ts +0 -7
- package/dist/src/ui/commands/contextCommand.js +0 -115
- package/dist/src/ui/commands/contextCommand.js.map +0 -1
- package/dist/src/ui/commands/copyCommand.d.ts +0 -7
- package/dist/src/ui/commands/copyCommand.js +0 -59
- package/dist/src/ui/commands/copyCommand.js.map +0 -1
- package/dist/src/ui/commands/corgiCommand.d.ts +0 -7
- package/dist/src/ui/commands/corgiCommand.js +0 -15
- package/dist/src/ui/commands/corgiCommand.js.map +0 -1
- package/dist/src/ui/commands/directoryCommand.d.ts +0 -8
- package/dist/src/ui/commands/directoryCommand.js +0 -133
- package/dist/src/ui/commands/directoryCommand.js.map +0 -1
- package/dist/src/ui/commands/docsCommand.d.ts +0 -7
- package/dist/src/ui/commands/docsCommand.js +0 -31
- package/dist/src/ui/commands/docsCommand.js.map +0 -1
- package/dist/src/ui/commands/editorCommand.d.ts +0 -7
- package/dist/src/ui/commands/editorCommand.js +0 -16
- package/dist/src/ui/commands/editorCommand.js.map +0 -1
- package/dist/src/ui/commands/extensionsCommand.d.ts +0 -7
- package/dist/src/ui/commands/extensionsCommand.js +0 -31
- package/dist/src/ui/commands/extensionsCommand.js.map +0 -1
- package/dist/src/ui/commands/helpCommand.d.ts +0 -7
- package/dist/src/ui/commands/helpCommand.js +0 -21
- package/dist/src/ui/commands/helpCommand.js.map +0 -1
- package/dist/src/ui/commands/ideCommand.d.ts +0 -8
- package/dist/src/ui/commands/ideCommand.js +0 -218
- package/dist/src/ui/commands/ideCommand.js.map +0 -1
- package/dist/src/ui/commands/initCommand.d.ts +0 -7
- package/dist/src/ui/commands/initCommand.js +0 -105
- package/dist/src/ui/commands/initCommand.js.map +0 -1
- package/dist/src/ui/commands/mcpCommand.d.ts +0 -7
- package/dist/src/ui/commands/mcpCommand.js +0 -424
- package/dist/src/ui/commands/mcpCommand.js.map +0 -1
- package/dist/src/ui/commands/memoryCommand.d.ts +0 -7
- package/dist/src/ui/commands/memoryCommand.js +0 -224
- package/dist/src/ui/commands/memoryCommand.js.map +0 -1
- package/dist/src/ui/commands/privacyCommand.d.ts +0 -7
- package/dist/src/ui/commands/privacyCommand.js +0 -16
- package/dist/src/ui/commands/privacyCommand.js.map +0 -1
- package/dist/src/ui/commands/quitCommand.d.ts +0 -7
- package/dist/src/ui/commands/quitCommand.js +0 -34
- package/dist/src/ui/commands/quitCommand.js.map +0 -1
- package/dist/src/ui/commands/restoreCommand.d.ts +0 -8
- package/dist/src/ui/commands/restoreCommand.js +0 -128
- package/dist/src/ui/commands/restoreCommand.js.map +0 -1
- package/dist/src/ui/commands/searchEngineSetupCommand.d.ts +0 -7
- package/dist/src/ui/commands/searchEngineSetupCommand.js +0 -17
- package/dist/src/ui/commands/searchEngineSetupCommand.js.map +0 -1
- package/dist/src/ui/commands/settingsCommand.d.ts +0 -7
- package/dist/src/ui/commands/settingsCommand.js +0 -16
- package/dist/src/ui/commands/settingsCommand.js.map +0 -1
- package/dist/src/ui/commands/setupGithubCommand.d.ts +0 -9
- package/dist/src/ui/commands/setupGithubCommand.js +0 -154
- package/dist/src/ui/commands/setupGithubCommand.js.map +0 -1
- package/dist/src/ui/commands/setupGithubCommand.test.d.ts +0 -6
- package/dist/src/ui/commands/setupGithubCommand.test.js +0 -167
- package/dist/src/ui/commands/setupGithubCommand.test.js.map +0 -1
- package/dist/src/ui/commands/speakCommand.d.ts +0 -7
- package/dist/src/ui/commands/speakCommand.js +0 -136
- package/dist/src/ui/commands/speakCommand.js.map +0 -1
- package/dist/src/ui/commands/statsCommand.d.ts +0 -7
- package/dist/src/ui/commands/statsCommand.js +0 -54
- package/dist/src/ui/commands/statsCommand.js.map +0 -1
- package/dist/src/ui/commands/terminalSetupCommand.d.ts +0 -13
- package/dist/src/ui/commands/terminalSetupCommand.js +0 -41
- package/dist/src/ui/commands/terminalSetupCommand.js.map +0 -1
- package/dist/src/ui/commands/themeCommand.d.ts +0 -7
- package/dist/src/ui/commands/themeCommand.js +0 -16
- package/dist/src/ui/commands/themeCommand.js.map +0 -1
- package/dist/src/ui/commands/toolsCommand.d.ts +0 -7
- package/dist/src/ui/commands/toolsCommand.js +0 -56
- package/dist/src/ui/commands/toolsCommand.js.map +0 -1
- package/dist/src/ui/commands/ttsCommand.d.ts +0 -7
- package/dist/src/ui/commands/ttsCommand.js +0 -122
- package/dist/src/ui/commands/ttsCommand.js.map +0 -1
- package/dist/src/ui/commands/types.d.ts +0 -157
- package/dist/src/ui/commands/types.js +0 -12
- package/dist/src/ui/commands/types.js.map +0 -1
- package/dist/src/ui/commands/vimCommand.d.ts +0 -7
- package/dist/src/ui/commands/vimCommand.js +0 -23
- package/dist/src/ui/commands/vimCommand.js.map +0 -1
- package/dist/src/ui/commands/voiceCommand.d.ts +0 -7
- package/dist/src/ui/commands/voiceCommand.js +0 -95
- package/dist/src/ui/commands/voiceCommand.js.map +0 -1
- package/dist/src/ui/components/AboutBox.d.ts +0 -17
- package/dist/src/ui/components/AboutBox.js +0 -6
- package/dist/src/ui/components/AboutBox.js.map +0 -1
- package/dist/src/ui/components/AsciiArt.d.ts +0 -8
- package/dist/src/ui/components/AsciiArt.js +0 -53
- package/dist/src/ui/components/AsciiArt.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.d.ts +0 -15
- package/dist/src/ui/components/AuthDialog.js +0 -174
- package/dist/src/ui/components/AuthDialog.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.test.d.ts +0 -6
- package/dist/src/ui/components/AuthDialog.test.js +0 -220
- package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
- package/dist/src/ui/components/AuthInProgress.d.ts +0 -11
- package/dist/src/ui/components/AuthInProgress.js +0 -28
- package/dist/src/ui/components/AuthInProgress.js.map +0 -1
- package/dist/src/ui/components/AutoAcceptIndicator.d.ts +0 -12
- package/dist/src/ui/components/AutoAcceptIndicator.js +0 -26
- package/dist/src/ui/components/AutoAcceptIndicator.js.map +0 -1
- package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +0 -11
- package/dist/src/ui/components/ConsoleSummaryDisplay.js +0 -11
- package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +0 -1
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +0 -20
- package/dist/src/ui/components/ContextSummaryDisplay.js +0 -65
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +0 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +0 -11
- package/dist/src/ui/components/ContextUsageDisplay.js +0 -100
- package/dist/src/ui/components/ContextUsageDisplay.js.map +0 -1
- package/dist/src/ui/components/DebugProfiler.d.ts +0 -6
- package/dist/src/ui/components/DebugProfiler.js +0 -27
- package/dist/src/ui/components/DebugProfiler.js.map +0 -1
- package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +0 -14
- package/dist/src/ui/components/DetailedMessagesDisplay.js +0 -34
- package/dist/src/ui/components/DetailedMessagesDisplay.js.map +0 -1
- package/dist/src/ui/components/EditorSettingsDialog.d.ts +0 -15
- package/dist/src/ui/components/EditorSettingsDialog.js +0 -74
- package/dist/src/ui/components/EditorSettingsDialog.js.map +0 -1
- package/dist/src/ui/components/FolderTrustDialog.d.ts +0 -16
- package/dist/src/ui/components/FolderTrustDialog.js +0 -39
- package/dist/src/ui/components/FolderTrustDialog.js.map +0 -1
- package/dist/src/ui/components/FolderTrustDialog.test.d.ts +0 -6
- package/dist/src/ui/components/FolderTrustDialog.test.js +0 -26
- package/dist/src/ui/components/FolderTrustDialog.test.js.map +0 -1
- package/dist/src/ui/components/Footer.d.ts +0 -24
- package/dist/src/ui/components/Footer.js +0 -25
- package/dist/src/ui/components/Footer.js.map +0 -1
- package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +0 -17
- package/dist/src/ui/components/GeminiRespondingSpinner.js +0 -16
- package/dist/src/ui/components/GeminiRespondingSpinner.js.map +0 -1
- package/dist/src/ui/components/Header.d.ts +0 -13
- package/dist/src/ui/components/Header.js +0 -28
- package/dist/src/ui/components/Header.js.map +0 -1
- package/dist/src/ui/components/Header.test.d.ts +0 -6
- package/dist/src/ui/components/Header.test.js +0 -37
- package/dist/src/ui/components/Header.test.js.map +0 -1
- package/dist/src/ui/components/Help.d.ts +0 -12
- package/dist/src/ui/components/Help.js +0 -10
- package/dist/src/ui/components/Help.js.map +0 -1
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +0 -20
- package/dist/src/ui/components/HistoryItemDisplay.js +0 -18
- package/dist/src/ui/components/HistoryItemDisplay.js.map +0 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -91
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
- package/dist/src/ui/components/InputPrompt.d.ts +0 -28
- package/dist/src/ui/components/InputPrompt.js +0 -440
- package/dist/src/ui/components/InputPrompt.js.map +0 -1
- package/dist/src/ui/components/LMStudioModelPrompt.d.ts +0 -12
- package/dist/src/ui/components/LMStudioModelPrompt.js +0 -100
- package/dist/src/ui/components/LMStudioModelPrompt.js.map +0 -1
- package/dist/src/ui/components/LoadingIndicator.d.ts +0 -15
- package/dist/src/ui/components/LoadingIndicator.js +0 -25
- package/dist/src/ui/components/LoadingIndicator.js.map +0 -1
- package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
- package/dist/src/ui/components/LoadingIndicator.test.js +0 -190
- package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
- package/dist/src/ui/components/MemoryUsageDisplay.d.ts +0 -7
- package/dist/src/ui/components/MemoryUsageDisplay.js +0 -27
- package/dist/src/ui/components/MemoryUsageDisplay.js.map +0 -1
- package/dist/src/ui/components/ModelStatsDisplay.d.ts +0 -7
- package/dist/src/ui/components/ModelStatsDisplay.js +0 -33
- package/dist/src/ui/components/ModelStatsDisplay.js.map +0 -1
- package/dist/src/ui/components/OllamaModelPrompt.d.ts +0 -12
- package/dist/src/ui/components/OllamaModelPrompt.js +0 -94
- package/dist/src/ui/components/OllamaModelPrompt.js.map +0 -1
- package/dist/src/ui/components/OpenAIEndpointDialog.d.ts +0 -18
- package/dist/src/ui/components/OpenAIEndpointDialog.js +0 -77
- package/dist/src/ui/components/OpenAIEndpointDialog.js.map +0 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.d.ts +0 -13
- package/dist/src/ui/components/OpenAIKeyPrompt.js +0 -118
- package/dist/src/ui/components/OpenAIKeyPrompt.js.map +0 -1
- package/dist/src/ui/components/OpenAIKeyPrompt.test.d.ts +0 -6
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js +0 -44
- package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +0 -1
- package/dist/src/ui/components/PrepareLabel.d.ts +0 -15
- package/dist/src/ui/components/PrepareLabel.js +0 -16
- package/dist/src/ui/components/PrepareLabel.js.map +0 -1
- package/dist/src/ui/components/SearchEngineConfigDialog.d.ts +0 -18
- package/dist/src/ui/components/SearchEngineConfigDialog.js +0 -180
- package/dist/src/ui/components/SearchEngineConfigDialog.js.map +0 -1
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +0 -11
- package/dist/src/ui/components/SessionSummaryDisplay.js +0 -4
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +0 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +0 -14
- package/dist/src/ui/components/SettingsDialog.js +0 -519
- package/dist/src/ui/components/SettingsDialog.js.map +0 -1
- package/dist/src/ui/components/SettingsDialog.test.d.ts +0 -6
- package/dist/src/ui/components/SettingsDialog.test.js +0 -568
- package/dist/src/ui/components/SettingsDialog.test.js.map +0 -1
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +0 -15
- package/dist/src/ui/components/ShellConfirmationDialog.js +0 -46
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +0 -1
- package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +0 -6
- package/dist/src/ui/components/ShellConfirmationDialog.test.js +0 -40
- package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +0 -1
- package/dist/src/ui/components/ShellModeIndicator.d.ts +0 -7
- package/dist/src/ui/components/ShellModeIndicator.js +0 -5
- package/dist/src/ui/components/ShellModeIndicator.js.map +0 -1
- package/dist/src/ui/components/ShowMoreLines.d.ts +0 -10
- package/dist/src/ui/components/ShowMoreLines.js +0 -24
- package/dist/src/ui/components/ShowMoreLines.js.map +0 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +0 -12
- package/dist/src/ui/components/StatsDisplay.js +0 -43
- package/dist/src/ui/components/StatsDisplay.js.map +0 -1
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +0 -22
- package/dist/src/ui/components/SuggestionsDisplay.js +0 -32
- package/dist/src/ui/components/SuggestionsDisplay.js.map +0 -1
- package/dist/src/ui/components/ThemeDialog.d.ts +0 -19
- package/dist/src/ui/components/ThemeDialog.js +0 -143
- package/dist/src/ui/components/ThemeDialog.js.map +0 -1
- package/dist/src/ui/components/Tips.d.ts +0 -12
- package/dist/src/ui/components/Tips.js +0 -8
- package/dist/src/ui/components/Tips.js.map +0 -1
- package/dist/src/ui/components/TodoDisplay.d.ts +0 -16
- package/dist/src/ui/components/TodoDisplay.js +0 -27
- package/dist/src/ui/components/TodoDisplay.js.map +0 -1
- package/dist/src/ui/components/TodoDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/TodoDisplay.test.js +0 -77
- package/dist/src/ui/components/TodoDisplay.test.js.map +0 -1
- package/dist/src/ui/components/ToolStatsDisplay.d.ts +0 -7
- package/dist/src/ui/components/ToolStatsDisplay.js +0 -41
- package/dist/src/ui/components/ToolStatsDisplay.js.map +0 -1
- package/dist/src/ui/components/UpdateNotification.d.ts +0 -10
- package/dist/src/ui/components/UpdateNotification.js +0 -10
- package/dist/src/ui/components/UpdateNotification.js.map +0 -1
- package/dist/src/ui/components/WelcomeBackDialog.d.ts +0 -36
- package/dist/src/ui/components/WelcomeBackDialog.js +0 -109
- package/dist/src/ui/components/WelcomeBackDialog.js.map +0 -1
- package/dist/src/ui/components/messages/CompressionMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/CompressionMessage.js +0 -16
- package/dist/src/ui/components/messages/CompressionMessage.js.map +0 -1
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +0 -16
- package/dist/src/ui/components/messages/DiffRenderer.js +0 -222
- package/dist/src/ui/components/messages/DiffRenderer.js.map +0 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
- package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -239
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
- package/dist/src/ui/components/messages/ErrorMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/ErrorMessage.js +0 -9
- package/dist/src/ui/components/messages/ErrorMessage.js.map +0 -1
- package/dist/src/ui/components/messages/GeminiMessage.d.ts +0 -14
- package/dist/src/ui/components/messages/GeminiMessage.js +0 -10
- package/dist/src/ui/components/messages/GeminiMessage.js.map +0 -1
- package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +0 -14
- package/dist/src/ui/components/messages/GeminiMessageContent.js +0 -15
- package/dist/src/ui/components/messages/GeminiMessageContent.js.map +0 -1
- package/dist/src/ui/components/messages/InfoMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/InfoMessage.js +0 -10
- package/dist/src/ui/components/messages/InfoMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +0 -15
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +0 -145
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -37
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +0 -18
- package/dist/src/ui/components/messages/ToolGroupMessage.js +0 -55
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolMessage.d.ts +0 -15
- package/dist/src/ui/components/messages/ToolMessage.js +0 -111
- package/dist/src/ui/components/messages/ToolMessage.js.map +0 -1
- package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
- package/dist/src/ui/components/messages/ToolMessage.test.js +0 -118
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
- package/dist/src/ui/components/messages/UserMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/UserMessage.js +0 -12
- package/dist/src/ui/components/messages/UserMessage.js.map +0 -1
- package/dist/src/ui/components/messages/UserShellMessage.d.ts +0 -11
- package/dist/src/ui/components/messages/UserShellMessage.js +0 -9
- package/dist/src/ui/components/messages/UserShellMessage.js.map +0 -1
- package/dist/src/ui/components/shared/MaxSizedBox.d.ts +0 -61
- package/dist/src/ui/components/shared/MaxSizedBox.js +0 -451
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +0 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -154
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +0 -46
- package/dist/src/ui/components/shared/RadioButtonSelect.js +0 -121
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +0 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +0 -6
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js +0 -111
- package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +0 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +0 -467
- package/dist/src/ui/components/shared/text-buffer.js +0 -1533
- package/dist/src/ui/components/shared/text-buffer.js.map +0 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +0 -72
- package/dist/src/ui/components/shared/vim-buffer-actions.js +0 -552
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +0 -1
- package/dist/src/ui/constants.d.ts +0 -9
- package/dist/src/ui/constants.js +0 -13
- package/dist/src/ui/constants.js.map +0 -1
- package/dist/src/ui/contexts/KeypressContext.d.ts +0 -30
- package/dist/src/ui/contexts/KeypressContext.js +0 -331
- package/dist/src/ui/contexts/KeypressContext.js.map +0 -1
- package/dist/src/ui/contexts/KeypressContext.test.d.ts +0 -6
- package/dist/src/ui/contexts/KeypressContext.test.js +0 -275
- package/dist/src/ui/contexts/KeypressContext.test.js.map +0 -1
- package/dist/src/ui/contexts/OverflowContext.d.ts +0 -19
- package/dist/src/ui/contexts/OverflowContext.js +0 -43
- package/dist/src/ui/contexts/OverflowContext.js.map +0 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +0 -39
- package/dist/src/ui/contexts/SessionContext.js +0 -60
- package/dist/src/ui/contexts/SessionContext.js.map +0 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +0 -9
- package/dist/src/ui/contexts/SettingsContext.js +0 -15
- package/dist/src/ui/contexts/SettingsContext.js.map +0 -1
- package/dist/src/ui/contexts/StreamingContext.d.ts +0 -9
- package/dist/src/ui/contexts/StreamingContext.js +0 -15
- package/dist/src/ui/contexts/StreamingContext.js.map +0 -1
- package/dist/src/ui/contexts/VimModeContext.d.ts +0 -19
- package/dist/src/ui/contexts/VimModeContext.js +0 -48
- package/dist/src/ui/contexts/VimModeContext.js.map +0 -1
- package/dist/src/ui/editors/editorSettingsManager.d.ts +0 -19
- package/dist/src/ui/editors/editorSettingsManager.js +0 -47
- package/dist/src/ui/editors/editorSettingsManager.js.map +0 -1
- package/dist/src/ui/hooks/atCommandProcessor.d.ts +0 -31
- package/dist/src/ui/hooks/atCommandProcessor.js +0 -365
- package/dist/src/ui/hooks/atCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +0 -6
- package/dist/src/ui/hooks/atCommandProcessor.test.js +0 -824
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +0 -17
- package/dist/src/ui/hooks/shellCommandProcessor.js +0 -233
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +0 -6
- package/dist/src/ui/hooks/shellCommandProcessor.test.js +0 -328
- package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +0 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +0 -28
- package/dist/src/ui/hooks/slashCommandProcessor.js +0 -459
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +0 -1
- package/dist/src/ui/hooks/useAtCompletion.d.ts +0 -23
- package/dist/src/ui/hooks/useAtCompletion.js +0 -179
- package/dist/src/ui/hooks/useAtCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useAuthCommand.d.ts +0 -14
- package/dist/src/ui/hooks/useAuthCommand.js +0 -100
- package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +0 -10
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js +0 -37
- package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +0 -1
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +0 -6
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +0 -190
- package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +0 -1
- package/dist/src/ui/hooks/useBracketedPaste.d.ts +0 -12
- package/dist/src/ui/hooks/useBracketedPaste.js +0 -32
- package/dist/src/ui/hooks/useBracketedPaste.js.map +0 -1
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +0 -29
- package/dist/src/ui/hooks/useCommandCompletion.js +0 -165
- package/dist/src/ui/hooks/useCommandCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +0 -24
- package/dist/src/ui/hooks/useCompletion.js +0 -88
- package/dist/src/ui/hooks/useCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useConsoleMessages.d.ts +0 -12
- package/dist/src/ui/hooks/useConsoleMessages.js +0 -76
- package/dist/src/ui/hooks/useConsoleMessages.js.map +0 -1
- package/dist/src/ui/hooks/useEditorSettings.d.ts +0 -16
- package/dist/src/ui/hooks/useEditorSettings.js +0 -43
- package/dist/src/ui/hooks/useEditorSettings.js.map +0 -1
- package/dist/src/ui/hooks/useEditorSettings.test.d.ts +0 -6
- package/dist/src/ui/hooks/useEditorSettings.test.js +0 -164
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +0 -1
- package/dist/src/ui/hooks/useFocus.d.ts +0 -10
- package/dist/src/ui/hooks/useFocus.js +0 -41
- package/dist/src/ui/hooks/useFocus.js.map +0 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +0 -12
- package/dist/src/ui/hooks/useFolderTrust.js +0 -55
- package/dist/src/ui/hooks/useFolderTrust.js.map +0 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +0 -24
- package/dist/src/ui/hooks/useGeminiStream.js +0 -653
- package/dist/src/ui/hooks/useGeminiStream.js.map +0 -1
- package/dist/src/ui/hooks/useGitBranchName.d.ts +0 -6
- package/dist/src/ui/hooks/useGitBranchName.js +0 -61
- package/dist/src/ui/hooks/useGitBranchName.js.map +0 -1
- package/dist/src/ui/hooks/useGitBranchName.test.d.ts +0 -6
- package/dist/src/ui/hooks/useGitBranchName.test.js +0 -215
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +0 -1
- package/dist/src/ui/hooks/useHistoryManager.d.ts +0 -22
- package/dist/src/ui/hooks/useHistoryManager.js +0 -72
- package/dist/src/ui/hooks/useHistoryManager.js.map +0 -1
- package/dist/src/ui/hooks/useHistoryManager.test.d.ts +0 -6
- package/dist/src/ui/hooks/useHistoryManager.test.js +0 -171
- package/dist/src/ui/hooks/useHistoryManager.test.js.map +0 -1
- package/dist/src/ui/hooks/useInputHistory.d.ts +0 -19
- package/dist/src/ui/hooks/useInputHistory.js +0 -84
- package/dist/src/ui/hooks/useInputHistory.js.map +0 -1
- package/dist/src/ui/hooks/useInputHistory.test.d.ts +0 -6
- package/dist/src/ui/hooks/useInputHistory.test.js +0 -207
- package/dist/src/ui/hooks/useInputHistory.test.js.map +0 -1
- package/dist/src/ui/hooks/useKeypress.d.ts +0 -17
- package/dist/src/ui/hooks/useKeypress.js +0 -27
- package/dist/src/ui/hooks/useKeypress.js.map +0 -1
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +0 -15
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +0 -20
- package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +0 -1
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +0 -10
- package/dist/src/ui/hooks/useLoadingIndicator.js +0 -44
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +0 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +0 -6
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +0 -91
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +0 -1
- package/dist/src/ui/hooks/useLogger.d.ts +0 -10
- package/dist/src/ui/hooks/useLogger.js +0 -29
- package/dist/src/ui/hooks/useLogger.js.map +0 -1
- package/dist/src/ui/hooks/useMessageQueue.d.ts +0 -22
- package/dist/src/ui/hooks/useMessageQueue.js +0 -49
- package/dist/src/ui/hooks/useMessageQueue.js.map +0 -1
- package/dist/src/ui/hooks/useMessageQueue.test.d.ts +0 -6
- package/dist/src/ui/hooks/useMessageQueue.test.js +0 -158
- package/dist/src/ui/hooks/useMessageQueue.test.js.map +0 -1
- package/dist/src/ui/hooks/usePhraseCycler.d.ts +0 -14
- package/dist/src/ui/hooks/usePhraseCycler.js +0 -187
- package/dist/src/ui/hooks/usePhraseCycler.js.map +0 -1
- package/dist/src/ui/hooks/usePrivacySettings.d.ts +0 -16
- package/dist/src/ui/hooks/usePrivacySettings.js +0 -119
- package/dist/src/ui/hooks/usePrivacySettings.js.map +0 -1
- package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +0 -6
- package/dist/src/ui/hooks/usePrivacySettings.test.js +0 -154
- package/dist/src/ui/hooks/usePrivacySettings.test.js.map +0 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +0 -33
- package/dist/src/ui/hooks/useReactToolScheduler.js +0 -187
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +0 -1
- package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +0 -6
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js +0 -7
- package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +0 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +0 -19
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +0 -56
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +0 -6
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +0 -163
- package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +0 -1
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +0 -10
- package/dist/src/ui/hooks/useSettingsCommand.js +0 -21
- package/dist/src/ui/hooks/useSettingsCommand.js.map +0 -1
- package/dist/src/ui/hooks/useShellHistory.d.ts +0 -13
- package/dist/src/ui/hooks/useShellHistory.js +0 -112
- package/dist/src/ui/hooks/useShellHistory.js.map +0 -1
- package/dist/src/ui/hooks/useShellHistory.test.d.ts +0 -6
- package/dist/src/ui/hooks/useShellHistory.test.js +0 -162
- package/dist/src/ui/hooks/useShellHistory.test.js.map +0 -1
- package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +0 -9
- package/dist/src/ui/hooks/useShowMemoryCommand.js +0 -58
- package/dist/src/ui/hooks/useShowMemoryCommand.js.map +0 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +0 -20
- package/dist/src/ui/hooks/useSlashCompletion.js +0 -135
- package/dist/src/ui/hooks/useSlashCompletion.js.map +0 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +0 -6
- package/dist/src/ui/hooks/useSlashCompletion.test.js +0 -272
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +0 -1
- package/dist/src/ui/hooks/useStateAndRef.d.ts +0 -7
- package/dist/src/ui/hooks/useStateAndRef.js +0 -26
- package/dist/src/ui/hooks/useStateAndRef.js.map +0 -1
- package/dist/src/ui/hooks/useTerminalSize.d.ts +0 -9
- package/dist/src/ui/hooks/useTerminalSize.js +0 -27
- package/dist/src/ui/hooks/useTerminalSize.js.map +0 -1
- package/dist/src/ui/hooks/useThemeCommand.d.ts +0 -15
- package/dist/src/ui/hooks/useThemeCommand.js +0 -79
- package/dist/src/ui/hooks/useThemeCommand.js.map +0 -1
- package/dist/src/ui/hooks/useTimer.d.ts +0 -12
- package/dist/src/ui/hooks/useTimer.js +0 -58
- package/dist/src/ui/hooks/useTimer.js.map +0 -1
- package/dist/src/ui/hooks/useTimer.test.d.ts +0 -6
- package/dist/src/ui/hooks/useTimer.test.js +0 -90
- package/dist/src/ui/hooks/useTimer.test.js.map +0 -1
- package/dist/src/ui/hooks/useToolScheduler.test.d.ts +0 -6
- package/dist/src/ui/hooks/useToolScheduler.test.js +0 -845
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +0 -1
- package/dist/src/ui/hooks/useWelcomeBack.d.ts +0 -52
- package/dist/src/ui/hooks/useWelcomeBack.js +0 -214
- package/dist/src/ui/hooks/useWelcomeBack.js.map +0 -1
- package/dist/src/ui/hooks/vim.d.ts +0 -28
- package/dist/src/ui/hooks/vim.js +0 -639
- package/dist/src/ui/hooks/vim.js.map +0 -1
- package/dist/src/ui/keyMatchers.d.ts +0 -26
- package/dist/src/ui/keyMatchers.js +0 -68
- package/dist/src/ui/keyMatchers.js.map +0 -1
- package/dist/src/ui/keyMatchers.test.d.ts +0 -6
- package/dist/src/ui/keyMatchers.test.js +0 -276
- package/dist/src/ui/keyMatchers.test.js.map +0 -1
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +0 -41
- package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +0 -18
- package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +0 -10
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js +0 -18
- package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +0 -1
- package/dist/src/ui/privacy/PrivacyNotice.d.ts +0 -12
- package/dist/src/ui/privacy/PrivacyNotice.js +0 -25
- package/dist/src/ui/privacy/PrivacyNotice.js.map +0 -1
- package/dist/src/ui/semantic-colors.d.ts +0 -7
- package/dist/src/ui/semantic-colors.js +0 -24
- package/dist/src/ui/semantic-colors.js.map +0 -1
- package/dist/src/ui/themes/ansi-light.d.ts +0 -7
- package/dist/src/ui/themes/ansi-light.js +0 -142
- package/dist/src/ui/themes/ansi-light.js.map +0 -1
- package/dist/src/ui/themes/ansi.d.ts +0 -7
- package/dist/src/ui/themes/ansi.js +0 -152
- package/dist/src/ui/themes/ansi.js.map +0 -1
- package/dist/src/ui/themes/atom-one-dark.d.ts +0 -7
- package/dist/src/ui/themes/atom-one-dark.js +0 -139
- package/dist/src/ui/themes/atom-one-dark.js.map +0 -1
- package/dist/src/ui/themes/ayu-light.d.ts +0 -7
- package/dist/src/ui/themes/ayu-light.js +0 -131
- package/dist/src/ui/themes/ayu-light.js.map +0 -1
- package/dist/src/ui/themes/ayu.d.ts +0 -7
- package/dist/src/ui/themes/ayu.js +0 -105
- package/dist/src/ui/themes/ayu.js.map +0 -1
- package/dist/src/ui/themes/color-utils.d.ts +0 -21
- package/dist/src/ui/themes/color-utils.js +0 -221
- package/dist/src/ui/themes/color-utils.js.map +0 -1
- package/dist/src/ui/themes/color-utils.test.d.ts +0 -6
- package/dist/src/ui/themes/color-utils.test.js +0 -197
- package/dist/src/ui/themes/color-utils.test.js.map +0 -1
- package/dist/src/ui/themes/default-light.d.ts +0 -7
- package/dist/src/ui/themes/default-light.js +0 -101
- package/dist/src/ui/themes/default-light.js.map +0 -1
- package/dist/src/ui/themes/default.d.ts +0 -7
- package/dist/src/ui/themes/default.js +0 -144
- package/dist/src/ui/themes/default.js.map +0 -1
- package/dist/src/ui/themes/dracula.d.ts +0 -7
- package/dist/src/ui/themes/dracula.js +0 -116
- package/dist/src/ui/themes/dracula.js.map +0 -1
- package/dist/src/ui/themes/fss-code-dark.d.ts +0 -7
- package/dist/src/ui/themes/fss-code-dark.js +0 -148
- package/dist/src/ui/themes/fss-code-dark.js.map +0 -1
- package/dist/src/ui/themes/fss-dark.d.ts +0 -7
- package/dist/src/ui/themes/fss-dark.js +0 -105
- package/dist/src/ui/themes/fss-dark.js.map +0 -1
- package/dist/src/ui/themes/fss-light.d.ts +0 -7
- package/dist/src/ui/themes/fss-light.js +0 -131
- package/dist/src/ui/themes/fss-light.js.map +0 -1
- package/dist/src/ui/themes/github-dark.d.ts +0 -7
- package/dist/src/ui/themes/github-dark.js +0 -139
- package/dist/src/ui/themes/github-dark.js.map +0 -1
- package/dist/src/ui/themes/github-light.d.ts +0 -7
- package/dist/src/ui/themes/github-light.js +0 -141
- package/dist/src/ui/themes/github-light.js.map +0 -1
- package/dist/src/ui/themes/googlecode.d.ts +0 -7
- package/dist/src/ui/themes/googlecode.js +0 -138
- package/dist/src/ui/themes/googlecode.js.map +0 -1
- package/dist/src/ui/themes/no-color.d.ts +0 -7
- package/dist/src/ui/themes/no-color.js +0 -115
- package/dist/src/ui/themes/no-color.js.map +0 -1
- package/dist/src/ui/themes/qwen-dark.d.ts +0 -7
- package/dist/src/ui/themes/qwen-dark.js +0 -109
- package/dist/src/ui/themes/qwen-dark.js.map +0 -1
- package/dist/src/ui/themes/qwen-light.d.ts +0 -7
- package/dist/src/ui/themes/qwen-light.js +0 -135
- package/dist/src/ui/themes/qwen-light.js.map +0 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +0 -37
- package/dist/src/ui/themes/semantic-tokens.js +0 -94
- package/dist/src/ui/themes/semantic-tokens.js.map +0 -1
- package/dist/src/ui/themes/shades-of-purple.d.ts +0 -11
- package/dist/src/ui/themes/shades-of-purple.js +0 -305
- package/dist/src/ui/themes/shades-of-purple.js.map +0 -1
- package/dist/src/ui/themes/theme-manager.d.ts +0 -64
- package/dist/src/ui/themes/theme-manager.js +0 -209
- package/dist/src/ui/themes/theme-manager.js.map +0 -1
- package/dist/src/ui/themes/theme-manager.test.d.ts +0 -6
- package/dist/src/ui/themes/theme-manager.test.js +0 -83
- package/dist/src/ui/themes/theme-manager.test.js.map +0 -1
- package/dist/src/ui/themes/theme.d.ts +0 -130
- package/dist/src/ui/themes/theme.js +0 -351
- package/dist/src/ui/themes/theme.js.map +0 -1
- package/dist/src/ui/themes/xcode.d.ts +0 -7
- package/dist/src/ui/themes/xcode.js +0 -146
- package/dist/src/ui/themes/xcode.js.map +0 -1
- package/dist/src/ui/types.d.ts +0 -191
- package/dist/src/ui/types.js +0 -44
- package/dist/src/ui/types.js.map +0 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +0 -17
- package/dist/src/ui/utils/CodeColorizer.js +0 -110
- package/dist/src/ui/utils/CodeColorizer.js.map +0 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +0 -25
- package/dist/src/ui/utils/ConsolePatcher.js +0 -52
- package/dist/src/ui/utils/ConsolePatcher.js.map +0 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +0 -16
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +0 -111
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +0 -1
- package/dist/src/ui/utils/MarkdownDisplay.d.ts +0 -14
- package/dist/src/ui/utils/MarkdownDisplay.js +0 -207
- package/dist/src/ui/utils/MarkdownDisplay.js.map +0 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
- package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -151
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
- package/dist/src/ui/utils/TableRenderer.d.ts +0 -17
- package/dist/src/ui/utils/TableRenderer.js +0 -84
- package/dist/src/ui/utils/TableRenderer.js.map +0 -1
- package/dist/src/ui/utils/clipboardUtils.d.ts +0 -22
- package/dist/src/ui/utils/clipboardUtils.js +0 -127
- package/dist/src/ui/utils/clipboardUtils.js.map +0 -1
- package/dist/src/ui/utils/clipboardUtils.test.d.ts +0 -6
- package/dist/src/ui/utils/clipboardUtils.test.js +0 -65
- package/dist/src/ui/utils/clipboardUtils.test.js.map +0 -1
- package/dist/src/ui/utils/commandUtils.d.ts +0 -24
- package/dist/src/ui/utils/commandUtils.js +0 -93
- package/dist/src/ui/utils/commandUtils.js.map +0 -1
- package/dist/src/ui/utils/commandUtils.test.d.ts +0 -6
- package/dist/src/ui/utils/commandUtils.test.js +0 -294
- package/dist/src/ui/utils/commandUtils.test.js.map +0 -1
- package/dist/src/ui/utils/computeStats.d.ts +0 -10
- package/dist/src/ui/utils/computeStats.js +0 -57
- package/dist/src/ui/utils/computeStats.js.map +0 -1
- package/dist/src/ui/utils/displayUtils.d.ts +0 -17
- package/dist/src/ui/utils/displayUtils.js +0 -24
- package/dist/src/ui/utils/displayUtils.js.map +0 -1
- package/dist/src/ui/utils/displayUtils.test.d.ts +0 -6
- package/dist/src/ui/utils/displayUtils.test.js +0 -42
- package/dist/src/ui/utils/displayUtils.test.js.map +0 -1
- package/dist/src/ui/utils/formatters.d.ts +0 -13
- package/dist/src/ui/utils/formatters.js +0 -56
- package/dist/src/ui/utils/formatters.js.map +0 -1
- package/dist/src/ui/utils/formatters.test.d.ts +0 -6
- package/dist/src/ui/utils/formatters.test.js +0 -56
- package/dist/src/ui/utils/formatters.test.js.map +0 -1
- package/dist/src/ui/utils/isNarrowWidth.d.ts +0 -6
- package/dist/src/ui/utils/isNarrowWidth.js +0 -9
- package/dist/src/ui/utils/isNarrowWidth.js.map +0 -1
- package/dist/src/ui/utils/kittyProtocolDetector.d.ts +0 -13
- package/dist/src/ui/utils/kittyProtocolDetector.js +0 -88
- package/dist/src/ui/utils/kittyProtocolDetector.js.map +0 -1
- package/dist/src/ui/utils/markdownUtilities.d.ts +0 -6
- package/dist/src/ui/utils/markdownUtilities.js +0 -110
- package/dist/src/ui/utils/markdownUtilities.js.map +0 -1
- package/dist/src/ui/utils/markdownUtilities.test.d.ts +0 -6
- package/dist/src/ui/utils/markdownUtilities.test.js +0 -42
- package/dist/src/ui/utils/markdownUtilities.test.js.map +0 -1
- package/dist/src/ui/utils/platformConstants.d.ts +0 -45
- package/dist/src/ui/utils/platformConstants.js +0 -46
- package/dist/src/ui/utils/platformConstants.js.map +0 -1
- package/dist/src/ui/utils/terminalSetup.d.ts +0 -30
- package/dist/src/ui/utils/terminalSetup.js +0 -281
- package/dist/src/ui/utils/terminalSetup.js.map +0 -1
- package/dist/src/ui/utils/textUtils.d.ts +0 -14
- package/dist/src/ui/utils/textUtils.js +0 -36
- package/dist/src/ui/utils/textUtils.js.map +0 -1
- package/dist/src/ui/utils/updateCheck.d.ts +0 -12
- package/dist/src/ui/utils/updateCheck.js +0 -78
- package/dist/src/ui/utils/updateCheck.js.map +0 -1
- package/dist/src/ui/utils/updateCheck.test.d.ts +0 -6
- package/dist/src/ui/utils/updateCheck.test.js +0 -145
- package/dist/src/ui/utils/updateCheck.test.js.map +0 -1
- package/dist/src/utils/checks.d.ts +0 -19
- package/dist/src/utils/checks.js +0 -24
- package/dist/src/utils/checks.js.map +0 -1
- package/dist/src/utils/cleanup.d.ts +0 -8
- package/dist/src/utils/cleanup.js +0 -34
- package/dist/src/utils/cleanup.js.map +0 -1
- package/dist/src/utils/dialogScopeUtils.d.ts +0 -31
- package/dist/src/utils/dialogScopeUtils.js +0 -48
- package/dist/src/utils/dialogScopeUtils.js.map +0 -1
- package/dist/src/utils/events.d.ts +0 -11
- package/dist/src/utils/events.js +0 -13
- package/dist/src/utils/events.js.map +0 -1
- package/dist/src/utils/gitUtils.d.ts +0 -30
- package/dist/src/utils/gitUtils.js +0 -89
- package/dist/src/utils/gitUtils.js.map +0 -1
- package/dist/src/utils/gitUtils.test.d.ts +0 -6
- package/dist/src/utils/gitUtils.test.js +0 -113
- package/dist/src/utils/gitUtils.test.js.map +0 -1
- package/dist/src/utils/handleAutoUpdate.d.ts +0 -11
- package/dist/src/utils/handleAutoUpdate.js +0 -101
- package/dist/src/utils/handleAutoUpdate.js.map +0 -1
- package/dist/src/utils/installationInfo.d.ts +0 -23
- package/dist/src/utils/installationInfo.js +0 -169
- package/dist/src/utils/installationInfo.js.map +0 -1
- package/dist/src/utils/installationInfo.test.d.ts +0 -6
- package/dist/src/utils/installationInfo.test.js +0 -242
- package/dist/src/utils/installationInfo.test.js.map +0 -1
- package/dist/src/utils/package.d.ts +0 -12
- package/dist/src/utils/package.js +0 -24
- package/dist/src/utils/package.js.map +0 -1
- package/dist/src/utils/readStdin.d.ts +0 -6
- package/dist/src/utils/readStdin.js +0 -44
- package/dist/src/utils/readStdin.js.map +0 -1
- package/dist/src/utils/resolvePath.d.ts +0 -6
- package/dist/src/utils/resolvePath.js +0 -21
- package/dist/src/utils/resolvePath.js.map +0 -1
- package/dist/src/utils/sandbox.d.ts +0 -7
- package/dist/src/utils/sandbox.js +0 -739
- package/dist/src/utils/sandbox.js.map +0 -1
- package/dist/src/utils/settingsUtils.d.ts +0 -134
- package/dist/src/utils/settingsUtils.js +0 -336
- package/dist/src/utils/settingsUtils.js.map +0 -1
- package/dist/src/utils/settingsUtils.test.d.ts +0 -6
- package/dist/src/utils/settingsUtils.test.js +0 -514
- package/dist/src/utils/settingsUtils.test.js.map +0 -1
- package/dist/src/utils/spawnWrapper.d.ts +0 -7
- package/dist/src/utils/spawnWrapper.js +0 -8
- package/dist/src/utils/spawnWrapper.js.map +0 -1
- package/dist/src/utils/startupWarnings.d.ts +0 -6
- package/dist/src/utils/startupWarnings.js +0 -40
- package/dist/src/utils/startupWarnings.js.map +0 -1
- package/dist/src/utils/updateEventEmitter.d.ts +0 -11
- package/dist/src/utils/updateEventEmitter.js +0 -12
- package/dist/src/utils/updateEventEmitter.js.map +0 -1
- package/dist/src/utils/userStartupWarnings.d.ts +0 -6
- package/dist/src/utils/userStartupWarnings.js +0 -54
- package/dist/src/utils/userStartupWarnings.js.map +0 -1
- package/dist/src/utils/userStartupWarnings.test.d.ts +0 -6
- package/dist/src/utils/userStartupWarnings.test.js +0 -67
- package/dist/src/utils/userStartupWarnings.test.js.map +0 -1
- package/dist/src/utils/version.d.ts +0 -6
- package/dist/src/utils/version.js +0 -11
- package/dist/src/utils/version.js.map +0 -1
- package/dist/src/validateNonInterActiveAuth.d.ts +0 -7
- package/dist/src/validateNonInterActiveAuth.js +0 -51
- package/dist/src/validateNonInterActiveAuth.js.map +0 -1
- package/dist/src/zed-integration/acp.d.ts +0 -63
- package/dist/src/zed-integration/acp.js +0 -225
- package/dist/src/zed-integration/acp.js.map +0 -1
- package/dist/src/zed-integration/fileSystemService.d.ts +0 -19
- package/dist/src/zed-integration/fileSystemService.js +0 -43
- package/dist/src/zed-integration/fileSystemService.js.map +0 -1
- package/dist/src/zed-integration/schema.d.ts +0 -11782
- package/dist/src/zed-integration/schema.js +0 -311
- package/dist/src/zed-integration/schema.js.map +0 -1
- package/dist/src/zed-integration/zedIntegration.d.ts +0 -10
- package/dist/src/zed-integration/zedIntegration.js +0 -765
- package/dist/src/zed-integration/zedIntegration.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/{dist/src/utils → bundle}/sandbox-macos-permissive-closed.sb +0 -0
- /package/{dist/src/utils → bundle}/sandbox-macos-permissive-open.sb +0 -0
- /package/{dist/src/utils → bundle}/sandbox-macos-permissive-proxied.sb +0 -0
- /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-closed.sb +0 -0
- /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-open.sb +0 -0
- /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-proxied.sb +0 -0
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { safeQueryWithLocking, safeQueryFirstWithLocking, safeExecWithLocking, getLastInsertId } from './database-utils.js';
|
|
7
|
-
import { FSSLinkDatabase } from './database.js';
|
|
8
|
-
/**
|
|
9
|
-
* Model Database Manager - Extracted from monolithic database.ts
|
|
10
|
-
*
|
|
11
|
-
* Handles all model configuration operations:
|
|
12
|
-
* - Active model management
|
|
13
|
-
* - Model configuration CRUD operations
|
|
14
|
-
* - Model switching and persistence
|
|
15
|
-
*
|
|
16
|
-
* ARCHITECTURAL IMPROVEMENT: Reduces database.ts from 2076 to ~1500 lines
|
|
17
|
-
*/
|
|
18
|
-
export class ModelDatabase {
|
|
19
|
-
db;
|
|
20
|
-
constructor(db) {
|
|
21
|
-
this.db = db;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Get the currently active model configuration
|
|
25
|
-
*/
|
|
26
|
-
async getActiveModel() {
|
|
27
|
-
if (!this.db) {
|
|
28
|
-
throw new Error('Database not initialized');
|
|
29
|
-
}
|
|
30
|
-
const result = await safeQueryFirstWithLocking(this.db, 'SELECT * FROM model_configs WHERE is_active = 1 LIMIT 1;');
|
|
31
|
-
if (!result) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
return this.mapDatabaseRecordToConfig(result);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Get the first model configuration for a specific auth type
|
|
38
|
-
*/
|
|
39
|
-
async getModelByAuthType(authType) {
|
|
40
|
-
if (!this.db) {
|
|
41
|
-
throw new Error('Database not initialized');
|
|
42
|
-
}
|
|
43
|
-
const result = await safeQueryFirstWithLocking(this.db, 'SELECT * FROM model_configs WHERE auth_type = ? LIMIT 1;', [authType]);
|
|
44
|
-
if (!result) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
return this.mapDatabaseRecordToConfig(result);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Set a model as active (and deactivate all others)
|
|
51
|
-
*/
|
|
52
|
-
async setActiveModel(id) {
|
|
53
|
-
if (!this.db) {
|
|
54
|
-
throw new Error('Database not initialized');
|
|
55
|
-
}
|
|
56
|
-
console.log(`🔥 [TRACE] setActiveModel(${id}) - Stack trace:`);
|
|
57
|
-
console.log(new Error().stack);
|
|
58
|
-
// First, deactivate all models
|
|
59
|
-
await safeExecWithLocking(this.db, 'UPDATE model_configs SET is_active = 0;');
|
|
60
|
-
console.log(`🔥 [DEBUG] Deactivated all models`);
|
|
61
|
-
// Then activate the specified model
|
|
62
|
-
await safeExecWithLocking(this.db, 'UPDATE model_configs SET is_active = 1, last_used = CURRENT_TIMESTAMP WHERE id = ?;', [id]);
|
|
63
|
-
console.log(`🔥 [DEBUG] Activated model id=${id}`);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Normalize endpoint URL to canonical form:
|
|
67
|
-
* - undefined → NULL
|
|
68
|
-
* - '' (empty string) → NULL
|
|
69
|
-
* - whitespace-only → NULL
|
|
70
|
-
* - Non-empty string → trimmed string
|
|
71
|
-
*
|
|
72
|
-
* This ensures UNIQUE(auth_type, model_name, endpoint_url) works correctly
|
|
73
|
-
*/
|
|
74
|
-
normalizeEndpointUrl(endpointUrl) {
|
|
75
|
-
// Handle undefined, null, empty string, or whitespace-only
|
|
76
|
-
if (!endpointUrl || endpointUrl.trim() === '') {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
// Return trimmed non-empty string
|
|
80
|
-
return endpointUrl.trim();
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Find model by UNIQUE constraint (auth_type, model_name, endpoint_url)
|
|
84
|
-
* With canonical NULL normalization, we use simple exact match
|
|
85
|
-
*/
|
|
86
|
-
async findByUniqueKey(authType, modelName, endpointUrl) {
|
|
87
|
-
if (endpointUrl === null) {
|
|
88
|
-
// Query for NULL endpoint (unspecified)
|
|
89
|
-
return await safeQueryFirstWithLocking(this.db, `SELECT id FROM model_configs
|
|
90
|
-
WHERE auth_type = ?
|
|
91
|
-
AND model_name = ?
|
|
92
|
-
AND endpoint_url IS NULL
|
|
93
|
-
LIMIT 1`, [authType, modelName]);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
// Query for exact endpoint URL
|
|
97
|
-
return await safeQueryFirstWithLocking(this.db, `SELECT id FROM model_configs
|
|
98
|
-
WHERE auth_type = ?
|
|
99
|
-
AND model_name = ?
|
|
100
|
-
AND endpoint_url = ?
|
|
101
|
-
LIMIT 1`, [authType, modelName, endpointUrl]);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Update existing model record with canonical normalization
|
|
106
|
-
*/
|
|
107
|
-
async updateModelRecord(recordId, config, normalizedModelName, normalizedEndpointUrl, encryptedApiKey) {
|
|
108
|
-
const updateParams = [
|
|
109
|
-
config.authType || '',
|
|
110
|
-
normalizedModelName,
|
|
111
|
-
normalizedEndpointUrl, // NULL or actual URL (never '')
|
|
112
|
-
encryptedApiKey,
|
|
113
|
-
config.displayName || null,
|
|
114
|
-
config.isFavorite === true ? 1 : 0,
|
|
115
|
-
config.isActive === true ? 1 : 0,
|
|
116
|
-
recordId
|
|
117
|
-
];
|
|
118
|
-
await safeExecWithLocking(this.db, `
|
|
119
|
-
UPDATE model_configs SET
|
|
120
|
-
auth_type = ?,
|
|
121
|
-
model_name = ?,
|
|
122
|
-
endpoint_url = ?, -- Can be NULL
|
|
123
|
-
api_key = ?,
|
|
124
|
-
display_name = ?,
|
|
125
|
-
is_favorite = ?,
|
|
126
|
-
is_active = ?,
|
|
127
|
-
last_used = CURRENT_TIMESTAMP
|
|
128
|
-
WHERE id = ?
|
|
129
|
-
`, updateParams);
|
|
130
|
-
return recordId;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Insert new model record with canonical normalization
|
|
134
|
-
*/
|
|
135
|
-
async insertModelRecord(config, normalizedModelName, normalizedEndpointUrl, encryptedApiKey) {
|
|
136
|
-
const insertParams = [
|
|
137
|
-
config.authType || '',
|
|
138
|
-
normalizedModelName,
|
|
139
|
-
normalizedEndpointUrl, // NULL or actual URL (never '')
|
|
140
|
-
encryptedApiKey,
|
|
141
|
-
config.displayName || null,
|
|
142
|
-
config.isFavorite === true ? 1 : 0,
|
|
143
|
-
config.isActive === true ? 1 : 0,
|
|
144
|
-
config.source || 'db'
|
|
145
|
-
];
|
|
146
|
-
await safeExecWithLocking(this.db, `
|
|
147
|
-
INSERT INTO model_configs
|
|
148
|
-
(auth_type, model_name, endpoint_url, api_key, display_name, is_favorite, is_active, last_used, source)
|
|
149
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP, ?)
|
|
150
|
-
`, insertParams);
|
|
151
|
-
return getLastInsertId(this.db);
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Upsert model configuration - UPDATE existing or INSERT new
|
|
155
|
-
*
|
|
156
|
-
* Uses cascading lookup strategy:
|
|
157
|
-
* 1. Level 1: Lookup by ID (explicit update)
|
|
158
|
-
* 2. Level 2: Lookup by UNIQUE key (auth_type, model_name, endpoint_url)
|
|
159
|
-
* 3. Level 3: Fallback to auth_type only (backward compatibility)
|
|
160
|
-
*/
|
|
161
|
-
async upsertModelConfig(config) {
|
|
162
|
-
if (!this.db) {
|
|
163
|
-
throw new Error('Database not initialized');
|
|
164
|
-
}
|
|
165
|
-
// === STEP 1: CANONICAL NORMALIZATION ===
|
|
166
|
-
// Encrypt API key
|
|
167
|
-
const encryptedApiKey = config.apiKey
|
|
168
|
-
? FSSLinkDatabase.encryptApiKey(config.apiKey)
|
|
169
|
-
: null;
|
|
170
|
-
// 🎯 CANONICAL NORMALIZATION: undefined/''/' ' → NULL
|
|
171
|
-
const normalizedEndpointUrl = this.normalizeEndpointUrl(config.endpointUrl);
|
|
172
|
-
// Normalize model name (empty string → empty string, for consistency)
|
|
173
|
-
const normalizedModelName = config.modelName?.trim() || '';
|
|
174
|
-
// === STEP 2: CASCADING LOOKUP (3 LEVELS) ===
|
|
175
|
-
let existingRecord = null;
|
|
176
|
-
// LEVEL 1: Lookup by ID (highest priority - explicit update)
|
|
177
|
-
if (config.id) {
|
|
178
|
-
existingRecord = await safeQueryFirstWithLocking(this.db, 'SELECT id FROM model_configs WHERE id = ?', [config.id]);
|
|
179
|
-
if (existingRecord) {
|
|
180
|
-
return await this.updateModelRecord(existingRecord.id, config, normalizedModelName, normalizedEndpointUrl, encryptedApiKey);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
// LEVEL 2: Lookup by full UNIQUE key (auth_type, model_name, endpoint_url)
|
|
184
|
-
existingRecord = await this.findByUniqueKey(config.authType, normalizedModelName, normalizedEndpointUrl);
|
|
185
|
-
if (existingRecord) {
|
|
186
|
-
return await this.updateModelRecord(existingRecord.id, config, normalizedModelName, normalizedEndpointUrl, encryptedApiKey);
|
|
187
|
-
}
|
|
188
|
-
// LEVEL 3: Fallback - lookup by auth_type only (backward compatibility)
|
|
189
|
-
// Only use if modelName is NOT provided (prevents wrong matches)
|
|
190
|
-
if (!normalizedModelName || normalizedModelName === '') {
|
|
191
|
-
existingRecord = await safeQueryFirstWithLocking(this.db, 'SELECT id FROM model_configs WHERE auth_type = ? LIMIT 1', [config.authType]);
|
|
192
|
-
if (existingRecord) {
|
|
193
|
-
return await this.updateModelRecord(existingRecord.id, config, normalizedModelName, normalizedEndpointUrl, encryptedApiKey);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
// === STEP 3: NO MATCH FOUND - INSERT NEW RECORD ===
|
|
197
|
-
return await this.insertModelRecord(config, normalizedModelName, normalizedEndpointUrl, encryptedApiKey);
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Get all model configurations
|
|
201
|
-
*/
|
|
202
|
-
async getAllModels() {
|
|
203
|
-
if (!this.db) {
|
|
204
|
-
throw new Error('Database not initialized');
|
|
205
|
-
}
|
|
206
|
-
const results = await safeQueryWithLocking(this.db, 'SELECT * FROM model_configs ORDER BY last_used DESC;');
|
|
207
|
-
return results.map(record => this.mapDatabaseRecordToConfig(record));
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Delete model configuration by ID
|
|
211
|
-
*/
|
|
212
|
-
async deleteModel(id) {
|
|
213
|
-
if (!this.db) {
|
|
214
|
-
throw new Error('Database not initialized');
|
|
215
|
-
}
|
|
216
|
-
await safeExecWithLocking(this.db, 'DELETE FROM model_configs WHERE id = ?;', [id]);
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Get model configuration by ID - for unified-database compatibility
|
|
220
|
-
*/
|
|
221
|
-
async getModelConfig(id) {
|
|
222
|
-
if (!this.db) {
|
|
223
|
-
throw new Error('Database not initialized');
|
|
224
|
-
}
|
|
225
|
-
const result = await safeQueryFirstWithLocking(this.db, 'SELECT * FROM model_configs WHERE id = ? LIMIT 1;', [id]);
|
|
226
|
-
if (!result) {
|
|
227
|
-
return null;
|
|
228
|
-
}
|
|
229
|
-
return this.mapDatabaseRecordToConfig(result);
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Delete model configuration by ID - for unified-database compatibility
|
|
233
|
-
*/
|
|
234
|
-
async deleteModelConfig(id) {
|
|
235
|
-
return this.deleteModel(id);
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Search model configurations
|
|
239
|
-
*/
|
|
240
|
-
async searchModelConfigs(criteria, options) {
|
|
241
|
-
if (!this.db) {
|
|
242
|
-
throw new Error('Database not initialized');
|
|
243
|
-
}
|
|
244
|
-
let query = 'SELECT * FROM model_configs WHERE 1=1';
|
|
245
|
-
const params = [];
|
|
246
|
-
if (criteria.authType) {
|
|
247
|
-
query += ' AND auth_type = ?';
|
|
248
|
-
params.push(criteria.authType);
|
|
249
|
-
}
|
|
250
|
-
if (criteria.modelName) {
|
|
251
|
-
query += ' AND model_name LIKE ?';
|
|
252
|
-
params.push(`%${criteria.modelName}%`);
|
|
253
|
-
}
|
|
254
|
-
if (criteria.isFavorite !== undefined) {
|
|
255
|
-
query += ' AND is_favorite = ?';
|
|
256
|
-
params.push(criteria.isFavorite ? 1 : 0);
|
|
257
|
-
}
|
|
258
|
-
if (criteria.isActive !== undefined) {
|
|
259
|
-
query += ' AND is_active = ?';
|
|
260
|
-
params.push(criteria.isActive ? 1 : 0);
|
|
261
|
-
}
|
|
262
|
-
if (options?.orderBy) {
|
|
263
|
-
query += ` ORDER BY ${options.orderBy}`;
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
query += ' ORDER BY last_used DESC';
|
|
267
|
-
}
|
|
268
|
-
if (options?.limit) {
|
|
269
|
-
query += ' LIMIT ?';
|
|
270
|
-
params.push(options.limit);
|
|
271
|
-
}
|
|
272
|
-
if (options?.offset) {
|
|
273
|
-
query += ' OFFSET ?';
|
|
274
|
-
params.push(options.offset);
|
|
275
|
-
}
|
|
276
|
-
const results = await safeQueryWithLocking(this.db, query, params);
|
|
277
|
-
return results.map(record => this.mapDatabaseRecordToConfig(record));
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Get favorite models
|
|
281
|
-
*/
|
|
282
|
-
async getFavoriteModels() {
|
|
283
|
-
return this.searchModelConfigs({ isFavorite: true });
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Toggle model favorite status
|
|
287
|
-
*/
|
|
288
|
-
async toggleModelFavorite(id) {
|
|
289
|
-
if (!this.db) {
|
|
290
|
-
throw new Error('Database not initialized');
|
|
291
|
-
}
|
|
292
|
-
const model = await this.getModelConfig(id);
|
|
293
|
-
if (!model) {
|
|
294
|
-
throw new Error(`Model with ID ${id} not found`);
|
|
295
|
-
}
|
|
296
|
-
const newFavoriteStatus = !model.isFavorite;
|
|
297
|
-
await safeExecWithLocking(this.db, 'UPDATE model_configs SET is_favorite = ? WHERE id = ?;', [newFavoriteStatus ? 1 : 0, id]);
|
|
298
|
-
return newFavoriteStatus;
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Update model last used timestamp
|
|
302
|
-
*/
|
|
303
|
-
async updateModelLastUsed(id) {
|
|
304
|
-
if (!this.db) {
|
|
305
|
-
throw new Error('Database not initialized');
|
|
306
|
-
}
|
|
307
|
-
await safeExecWithLocking(this.db, 'UPDATE model_configs SET last_used = CURRENT_TIMESTAMP WHERE id = ?;', [id]);
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Get recently used models
|
|
311
|
-
*/
|
|
312
|
-
async getRecentlyUsedModels(limit = 5) {
|
|
313
|
-
return this.searchModelConfigs({}, { limit, orderBy: 'last_used DESC' });
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Get models by auth type
|
|
317
|
-
*/
|
|
318
|
-
async getModelsByAuthType(authType) {
|
|
319
|
-
return this.searchModelConfigs({ authType });
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Get model usage statistics
|
|
323
|
-
*/
|
|
324
|
-
async getModelUsageStats() {
|
|
325
|
-
if (!this.db) {
|
|
326
|
-
throw new Error('Database not initialized');
|
|
327
|
-
}
|
|
328
|
-
const result = await safeQueryWithLocking(this.db, `SELECT
|
|
329
|
-
auth_type,
|
|
330
|
-
COUNT(*) as count,
|
|
331
|
-
MAX(last_used) as last_used
|
|
332
|
-
FROM model_configs
|
|
333
|
-
GROUP BY auth_type
|
|
334
|
-
ORDER BY count DESC;`);
|
|
335
|
-
return result;
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Bulk update model configurations
|
|
339
|
-
*/
|
|
340
|
-
async bulkUpdateModelConfigs(updates) {
|
|
341
|
-
if (!this.db) {
|
|
342
|
-
throw new Error('Database not initialized');
|
|
343
|
-
}
|
|
344
|
-
for (const update of updates) {
|
|
345
|
-
if (update.id) {
|
|
346
|
-
await this.upsertModelConfig(update);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Check if model configuration exists
|
|
352
|
-
*/
|
|
353
|
-
async modelConfigExists(authType, modelName) {
|
|
354
|
-
if (!this.db) {
|
|
355
|
-
throw new Error('Database not initialized');
|
|
356
|
-
}
|
|
357
|
-
const result = await safeQueryFirstWithLocking(this.db, 'SELECT COUNT(*) as count FROM model_configs WHERE auth_type = ? AND model_name = ?;', [authType, modelName]);
|
|
358
|
-
return (result?.count || 0) > 0;
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* Map database record to model configuration
|
|
362
|
-
*/
|
|
363
|
-
mapDatabaseRecordToConfig(record) {
|
|
364
|
-
return {
|
|
365
|
-
id: record.id,
|
|
366
|
-
authType: record.auth_type,
|
|
367
|
-
modelName: record.model_name,
|
|
368
|
-
endpointUrl: record.endpoint_url || undefined,
|
|
369
|
-
apiKey: record.api_key
|
|
370
|
-
? FSSLinkDatabase.decryptApiKey(record.api_key)
|
|
371
|
-
: undefined,
|
|
372
|
-
displayName: record.display_name || undefined,
|
|
373
|
-
isFavorite: record.is_favorite === 1,
|
|
374
|
-
isActive: record.is_active === 1,
|
|
375
|
-
source: record.source
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
//# sourceMappingURL=model-database.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-database.js","sourceRoot":"","sources":["../../../src/config/model-database.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA4ChD;;;;;;;;;GASG;AACH,MAAM,OAAO,aAAa;IACJ;IAApB,YAAoB,EAAY;QAAZ,OAAE,GAAF,EAAE,CAAU;IAAG,CAAC;IAEpC;;OAEG;IACH,KAAK,CAAC,cAAc;QAClB,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC9C,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAC5C,IAAI,CAAC,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AAC;QAEF,OAAO,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACK,yBAAyB,CAAC,MAA2B;QAC3D,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,QAAQ,EAAE,MAAM,CAAC,SAAS;YAC1B,SAAS,EAAE,MAAM,CAAC,UAAU;YAC5B,WAAW,EAAE,MAAM,CAAC,YAAY,IAAI,SAAS;YAC7C,MAAM,EAAE,MAAM,CAAC,OAAO;gBACpB,CAAC,CAAC,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC;gBAC/C,CAAC,CAAC,SAAS;YACb,WAAW,EAAE,MAAM,CAAC,YAAY,IAAI,SAAS;YAC7C,UAAU,EAAE,MAAM,CAAC,WAAW,KAAK,CAAC;YACpC,QAAQ,EAAE,MAAM,CAAC,SAAS,KAAK,CAAC;YAChC,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { Database } from 'sql.js';
|
|
7
|
-
import type { FSSLinkDatabase } from './database.js';
|
|
8
|
-
import { ModelConfig } from 'fss-link-core';
|
|
9
|
-
import { BaseRepository, BaseEntity } from './base-repository.js';
|
|
10
|
-
import { QueryParameters } from './repository-types.js';
|
|
11
|
-
/**
|
|
12
|
-
* ======================================================================================
|
|
13
|
-
* MODEL REPOSITORY - PHASE 2 REPOSITORY PATTERN IMPLEMENTATION
|
|
14
|
-
* ======================================================================================
|
|
15
|
-
*
|
|
16
|
-
* Thread-safe model configuration repository with async locking protection.
|
|
17
|
-
* Replaces direct model config database calls to eliminate "Statement closed"
|
|
18
|
-
* errors and race conditions in the auth system.
|
|
19
|
-
*
|
|
20
|
-
* @author Emma - Technical Implementation Specialist
|
|
21
|
-
* @task Task 6: ModelRepository Implementation
|
|
22
|
-
* @dependencies Task 5 (BaseRepository)
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* Extended ModelConfig interface for database operations
|
|
26
|
-
*/
|
|
27
|
-
export interface ModelConfigEntity extends BaseEntity {
|
|
28
|
-
id?: number;
|
|
29
|
-
auth_type: string;
|
|
30
|
-
model_name: string;
|
|
31
|
-
endpoint_url?: string;
|
|
32
|
-
api_key?: string;
|
|
33
|
-
display_name?: string;
|
|
34
|
-
is_favorite: boolean;
|
|
35
|
-
is_active: boolean;
|
|
36
|
-
last_used?: string;
|
|
37
|
-
created_at?: string;
|
|
38
|
-
source?: string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Model statistics interface
|
|
42
|
-
*/
|
|
43
|
-
export interface ModelStatistics {
|
|
44
|
-
totalModels: number;
|
|
45
|
-
activeModels: number;
|
|
46
|
-
favoriteModels: number;
|
|
47
|
-
modelsByAuthType: Record<string, number>;
|
|
48
|
-
recentlyUsed: Array<ModelConfigEntity>;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Model Repository providing thread-safe model configuration management.
|
|
52
|
-
*
|
|
53
|
-
* This repository ELIMINATES "Statement closed" errors by using async locking
|
|
54
|
-
* for all database operations. Critical for auth system reliability.
|
|
55
|
-
*/
|
|
56
|
-
export declare class ModelRepository extends BaseRepository<ModelConfigEntity> {
|
|
57
|
-
constructor(db: Database | FSSLinkDatabase);
|
|
58
|
-
/**
|
|
59
|
-
* Get table name for this repository
|
|
60
|
-
*/
|
|
61
|
-
protected getTableName(): string;
|
|
62
|
-
/**
|
|
63
|
-
* ======================================================================================
|
|
64
|
-
* CORE CRUD OPERATIONS - THREAD SAFE
|
|
65
|
-
* ======================================================================================
|
|
66
|
-
*/
|
|
67
|
-
/**
|
|
68
|
-
* Create a new model configuration
|
|
69
|
-
*
|
|
70
|
-
* @param model - Partial model configuration
|
|
71
|
-
* @returns Promise<number> ID of created model
|
|
72
|
-
*/
|
|
73
|
-
create(model: Partial<ModelConfigEntity>): Promise<number>;
|
|
74
|
-
/**
|
|
75
|
-
* Find model by ID
|
|
76
|
-
*
|
|
77
|
-
* @param id - Model ID
|
|
78
|
-
* @returns Promise<ModelConfigEntity | null>
|
|
79
|
-
*/
|
|
80
|
-
findById(id: number): Promise<ModelConfigEntity | null>;
|
|
81
|
-
/**
|
|
82
|
-
* Update model by ID
|
|
83
|
-
*
|
|
84
|
-
* @param id - Model ID to update
|
|
85
|
-
* @param updates - Partial model data with updates
|
|
86
|
-
* @returns Promise<boolean> true if updated
|
|
87
|
-
*/
|
|
88
|
-
update(id: number, updates: Partial<ModelConfigEntity>): Promise<boolean>;
|
|
89
|
-
/**
|
|
90
|
-
* Delete model by ID
|
|
91
|
-
*
|
|
92
|
-
* @param id - Model ID to delete
|
|
93
|
-
* @returns Promise<boolean> true if deleted
|
|
94
|
-
*/
|
|
95
|
-
delete(id: number): Promise<boolean>;
|
|
96
|
-
/**
|
|
97
|
-
* Find all models with optional filtering
|
|
98
|
-
*
|
|
99
|
-
* @param whereClause - Optional WHERE clause
|
|
100
|
-
* @param params - Parameters for WHERE clause
|
|
101
|
-
* @param orderBy - Optional ORDER BY clause
|
|
102
|
-
* @param limit - Optional LIMIT
|
|
103
|
-
* @returns Promise<Array<ModelConfigEntity>>
|
|
104
|
-
*/
|
|
105
|
-
findAll(whereClause?: string, params?: QueryParameters, orderBy?: string, limit?: number): Promise<Array<ModelConfigEntity>>;
|
|
106
|
-
/**
|
|
107
|
-
* Find first model matching criteria
|
|
108
|
-
*
|
|
109
|
-
* @param whereClause - WHERE clause
|
|
110
|
-
* @param params - Parameters for WHERE clause
|
|
111
|
-
* @returns Promise<ModelConfigEntity | null>
|
|
112
|
-
*/
|
|
113
|
-
findFirst(whereClause: string, params: QueryParameters): Promise<ModelConfigEntity | null>;
|
|
114
|
-
/**
|
|
115
|
-
* ======================================================================================
|
|
116
|
-
* MODEL-SPECIFIC OPERATIONS - AUTH SYSTEM CRITICAL
|
|
117
|
-
* ======================================================================================
|
|
118
|
-
*/
|
|
119
|
-
/**
|
|
120
|
-
* Get the currently active model (CRITICAL for auth system)
|
|
121
|
-
*
|
|
122
|
-
* @returns Promise<ModelConfigEntity | null>
|
|
123
|
-
*/
|
|
124
|
-
getActiveModel(): Promise<ModelConfigEntity | null>;
|
|
125
|
-
/**
|
|
126
|
-
* Set model as active (deactivates all others) - ATOMIC OPERATION
|
|
127
|
-
*
|
|
128
|
-
* @param modelId - ID of model to activate
|
|
129
|
-
* @returns Promise<boolean> true if successful
|
|
130
|
-
*/
|
|
131
|
-
setActiveModel(modelId: number): Promise<boolean>;
|
|
132
|
-
/**
|
|
133
|
-
* Switch to model by auth type and model name
|
|
134
|
-
*
|
|
135
|
-
* @param authType - Auth type
|
|
136
|
-
* @param modelName - Model name
|
|
137
|
-
* @returns Promise<boolean> true if switched
|
|
138
|
-
*/
|
|
139
|
-
switchToModel(authType: string, modelName: string): Promise<boolean>;
|
|
140
|
-
/**
|
|
141
|
-
* Upsert model configuration (insert or update)
|
|
142
|
-
*
|
|
143
|
-
* @param model - Model configuration
|
|
144
|
-
* @returns Promise<number> model ID
|
|
145
|
-
*/
|
|
146
|
-
upsertModel(model: Partial<ModelConfigEntity>): Promise<number>;
|
|
147
|
-
/**
|
|
148
|
-
* ======================================================================================
|
|
149
|
-
* QUERY OPERATIONS - OPTIMIZED
|
|
150
|
-
* ======================================================================================
|
|
151
|
-
*/
|
|
152
|
-
/**
|
|
153
|
-
* Find models by auth type
|
|
154
|
-
*
|
|
155
|
-
* @param authType - Auth type to filter by
|
|
156
|
-
* @returns Promise<Array<ModelConfigEntity>>
|
|
157
|
-
*/
|
|
158
|
-
findByAuthType(authType: string): Promise<Array<ModelConfigEntity>>;
|
|
159
|
-
/**
|
|
160
|
-
* Find favorite models
|
|
161
|
-
*
|
|
162
|
-
* @returns Promise<Array<ModelConfigEntity>>
|
|
163
|
-
*/
|
|
164
|
-
findFavorites(): Promise<Array<ModelConfigEntity>>;
|
|
165
|
-
/**
|
|
166
|
-
* Find recently used models
|
|
167
|
-
*
|
|
168
|
-
* @param limit - Number of recent models to return
|
|
169
|
-
* @returns Promise<Array<ModelConfigEntity>>
|
|
170
|
-
*/
|
|
171
|
-
findRecentlyUsed(limit?: number): Promise<Array<ModelConfigEntity>>;
|
|
172
|
-
/**
|
|
173
|
-
* Check if any models exist for auth type
|
|
174
|
-
*
|
|
175
|
-
* @param authType - Auth type to check
|
|
176
|
-
* @returns Promise<boolean>
|
|
177
|
-
*/
|
|
178
|
-
hasModelsForAuthType(authType: string): Promise<boolean>;
|
|
179
|
-
/**
|
|
180
|
-
* Check if active model exists
|
|
181
|
-
*
|
|
182
|
-
* @returns Promise<boolean>
|
|
183
|
-
*/
|
|
184
|
-
hasActiveModel(): Promise<boolean>;
|
|
185
|
-
/**
|
|
186
|
-
* ======================================================================================
|
|
187
|
-
* STATISTICS AND DIAGNOSTICS
|
|
188
|
-
* ======================================================================================
|
|
189
|
-
*/
|
|
190
|
-
/**
|
|
191
|
-
* Get comprehensive model statistics
|
|
192
|
-
*
|
|
193
|
-
* @returns Promise<ModelStatistics>
|
|
194
|
-
*/
|
|
195
|
-
getModelStatistics(): Promise<ModelStatistics>;
|
|
196
|
-
/**
|
|
197
|
-
* Cleanup inactive models older than specified date
|
|
198
|
-
*
|
|
199
|
-
* @param cutoffDate - Date before which to delete inactive models
|
|
200
|
-
* @returns Promise<number> number of deleted models
|
|
201
|
-
*/
|
|
202
|
-
cleanupOldModels(cutoffDate: Date): Promise<number>;
|
|
203
|
-
/**
|
|
204
|
-
* ======================================================================================
|
|
205
|
-
* UTILITY METHODS
|
|
206
|
-
* ======================================================================================
|
|
207
|
-
*/
|
|
208
|
-
/**
|
|
209
|
-
* Map database result to proper ModelConfigEntity with type conversion
|
|
210
|
-
*
|
|
211
|
-
* @param result - Raw database result
|
|
212
|
-
* @returns ModelConfigEntity with proper types
|
|
213
|
-
*/
|
|
214
|
-
private mapDatabaseResult;
|
|
215
|
-
/**
|
|
216
|
-
* Convert ModelConfig (from core) to ModelConfigEntity
|
|
217
|
-
*
|
|
218
|
-
* @param config - ModelConfig from fss-link-core
|
|
219
|
-
* @returns ModelConfigEntity for database operations
|
|
220
|
-
*/
|
|
221
|
-
static fromModelConfig(config: ModelConfig): Partial<ModelConfigEntity>;
|
|
222
|
-
/**
|
|
223
|
-
* Convert ModelConfigEntity to ModelConfig (for core)
|
|
224
|
-
*
|
|
225
|
-
* @param entity - ModelConfigEntity from database
|
|
226
|
-
* @returns ModelConfig for fss-link-core
|
|
227
|
-
*/
|
|
228
|
-
static toModelConfig(entity: ModelConfigEntity): ModelConfig;
|
|
229
|
-
/**
|
|
230
|
-
* Execute operations within a transaction (PUBLIC API for tests)
|
|
231
|
-
*
|
|
232
|
-
* @param operations - Async function containing database operations
|
|
233
|
-
* @returns Promise<T> result of operations
|
|
234
|
-
*/
|
|
235
|
-
executeTransaction<U>(operations: (db: Database) => Promise<U>): Promise<U>;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* ======================================================================================
|
|
239
|
-
* MIGRATION GUIDE: REPLACING DIRECT DATABASE CALLS
|
|
240
|
-
* ======================================================================================
|
|
241
|
-
*
|
|
242
|
-
* OLD (race condition prone):
|
|
243
|
-
* const db = await getFSSLinkDatabase();
|
|
244
|
-
* const models = safeQuery(db, 'SELECT * FROM model_configs WHERE auth_type = ?', [authType]);
|
|
245
|
-
* const result = safeExec(db, 'UPDATE model_configs SET is_active = 1 WHERE id = ?', [modelId]);
|
|
246
|
-
*
|
|
247
|
-
* NEW (thread-safe with async locking):
|
|
248
|
-
* const modelRepo = new ModelRepository(db);
|
|
249
|
-
* const models = await modelRepo.findByAuthType(authType);
|
|
250
|
-
* const success = await modelRepo.setActiveModel(modelId);
|
|
251
|
-
*
|
|
252
|
-
* EXAMPLES:
|
|
253
|
-
*
|
|
254
|
-
* // Get active model (critical for auth system)
|
|
255
|
-
* const activeModel = await modelRepo.getActiveModel();
|
|
256
|
-
*
|
|
257
|
-
* // Switch models atomically
|
|
258
|
-
* const switched = await modelRepo.switchToModel('ollama', 'qwen3:4b');
|
|
259
|
-
*
|
|
260
|
-
* // Upsert model configuration
|
|
261
|
-
* const modelId = await modelRepo.upsertModel({
|
|
262
|
-
* auth_type: 'ollama',
|
|
263
|
-
* model_name: 'qwen3:4b',
|
|
264
|
-
* is_favorite: true,
|
|
265
|
-
* is_active: false
|
|
266
|
-
* });
|
|
267
|
-
*
|
|
268
|
-
* // Get statistics
|
|
269
|
-
* const stats = await modelRepo.getModelStatistics();
|
|
270
|
-
* console.log(`Total: ${stats.totalModels}, Active: ${stats.activeModels}`);
|
|
271
|
-
*
|
|
272
|
-
* // Cleanup old models
|
|
273
|
-
* const deleted = await modelRepo.cleanupOldModels(new Date(Date.now() - 30 * 24 * 60 * 60 * 1000));
|
|
274
|
-
*/
|