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,664 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { DatabaseOperationQueue } from './database-queue.js';
|
|
7
|
-
// Enable debug logging only when explicitly requested
|
|
8
|
-
// - Tests (VITEST=true): All conditions false β DEBUG_DB = false (silent)
|
|
9
|
-
// - Production default: All conditions false β DEBUG_DB = false (clean output)
|
|
10
|
-
// - Production with --debug: FSS_DEBUG=true β DEBUG_DB = true (verbose)
|
|
11
|
-
// - Development: NODE_ENV=development β DEBUG_DB = true (verbose)
|
|
12
|
-
const DEBUG_DB = process.env['FSS_DEBUG'] === 'true' ||
|
|
13
|
-
process.env['NODE_ENV'] === 'development' ||
|
|
14
|
-
process.env['FSS_DB_DEBUG'] === 'true';
|
|
15
|
-
/**
|
|
16
|
-
* TEMPORARY DATABASE UTILITIES
|
|
17
|
-
*
|
|
18
|
-
* These wrapper functions provide immediate relief from manual memory management
|
|
19
|
-
* while we transition to a proper ORM/repository pattern.
|
|
20
|
-
*
|
|
21
|
-
* @todo PHASE 2: Replace with Repository pattern (BaseRepository, ModelRepository, etc.)
|
|
22
|
-
* @todo PHASE 3: Consider migrating to Drizzle ORM or similar for full type safety
|
|
23
|
-
*
|
|
24
|
-
* Current problems these wrappers solve:
|
|
25
|
-
* - Manual .free() calls causing memory leaks
|
|
26
|
-
* - Inconsistent error handling patterns
|
|
27
|
-
* - No automatic cleanup on exceptions
|
|
28
|
-
* - Raw SQL scattered throughout business logic
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* Safe query execution with automatic statement cleanup.
|
|
32
|
-
* Returns all matching rows as an array.
|
|
33
|
-
*
|
|
34
|
-
* @todo UPGRADE: Replace with repository.findMany() method
|
|
35
|
-
*
|
|
36
|
-
* @param db - SQLite database instance
|
|
37
|
-
* @param sql - SQL query string
|
|
38
|
-
* @param params - Query parameters (optional)
|
|
39
|
-
* @returns Array of query results
|
|
40
|
-
* @throws DatabaseError for SQL execution errors
|
|
41
|
-
*/
|
|
42
|
-
export function safeQuery(db, sql, params = []) {
|
|
43
|
-
let stmt = null;
|
|
44
|
-
// π DETAILED OPERATION LOGGING
|
|
45
|
-
if (DEBUG_DB) {
|
|
46
|
-
if (DEBUG_DB)
|
|
47
|
-
console.log(`π [DB-OP] QUERY START: ${sql.substring(0, 100)}${sql.length > 100 ? '...' : ''}`);
|
|
48
|
-
if (params && params.length > 0) {
|
|
49
|
-
if (DEBUG_DB)
|
|
50
|
-
console.log(`π [DB-OP] QUERY PARAMS:`, params);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
try {
|
|
54
|
-
// Validate database connection type before attempting prepare
|
|
55
|
-
if (!db || typeof db.prepare !== 'function') {
|
|
56
|
-
throw new DatabaseError(`Invalid database connection - missing prepare() method. Type: ${typeof db}`);
|
|
57
|
-
}
|
|
58
|
-
if (DEBUG_DB)
|
|
59
|
-
console.log(`π [STMT] PREPARE: ${sql.substring(0, 80)}${sql.length > 80 ? '...' : ''}`);
|
|
60
|
-
stmt = db.prepare(sql);
|
|
61
|
-
if (DEBUG_DB)
|
|
62
|
-
console.log(`π [STMT] PREPARE SUCCESS`);
|
|
63
|
-
if (params.length > 0) {
|
|
64
|
-
if (DEBUG_DB)
|
|
65
|
-
console.log(`π [STMT] BIND PARAMS:`, params);
|
|
66
|
-
stmt.bind(params);
|
|
67
|
-
if (DEBUG_DB)
|
|
68
|
-
console.log(`π [STMT] BIND SUCCESS`);
|
|
69
|
-
}
|
|
70
|
-
if (DEBUG_DB)
|
|
71
|
-
console.log(`π [STMT] EXECUTING QUERY...`);
|
|
72
|
-
const results = [];
|
|
73
|
-
let stepCount = 0;
|
|
74
|
-
while (stmt.step()) {
|
|
75
|
-
stepCount++;
|
|
76
|
-
results.push(stmt.getAsObject());
|
|
77
|
-
if (stepCount % 100 === 0) {
|
|
78
|
-
if (DEBUG_DB)
|
|
79
|
-
console.log(`π [STMT] PROCESSED ${stepCount} rows...`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (DEBUG_DB)
|
|
83
|
-
console.log(`π [STMT] QUERY COMPLETE: ${results.length} results, ${stepCount} steps`);
|
|
84
|
-
return results;
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
console.error(`β [DB-OP] QUERY FAILED: ${sql}`);
|
|
88
|
-
console.error(`β [DB-OP] ERROR:`, error);
|
|
89
|
-
// π― DETECT STATEMENT CLOSED ERRORS - Indicates database corruption
|
|
90
|
-
if (error instanceof Error && error.message.includes('Statement closed')) {
|
|
91
|
-
console.error(`π¨ [DB-OP] STATEMENT CLOSED ERROR DETECTED!`);
|
|
92
|
-
console.error(`π¨ [DB-OP] SQL: ${sql}`);
|
|
93
|
-
console.error(`π¨ [DB-OP] PARAMS:`, params);
|
|
94
|
-
console.error(`π¨ [DB-OP] STATEMENT STATE:`, stmt ? 'exists' : 'null');
|
|
95
|
-
throw new DatabaseError(`Database corruption detected (Statement closed): ${sql}`, error);
|
|
96
|
-
}
|
|
97
|
-
throw new DatabaseError(`Query failed: ${sql}`, error);
|
|
98
|
-
}
|
|
99
|
-
finally {
|
|
100
|
-
if (stmt) {
|
|
101
|
-
if (DEBUG_DB)
|
|
102
|
-
console.log(`π [STMT] FREEING STATEMENT...`);
|
|
103
|
-
try {
|
|
104
|
-
stmt.free();
|
|
105
|
-
if (DEBUG_DB)
|
|
106
|
-
console.log(`π [STMT] STATEMENT FREED SUCCESSFULLY`);
|
|
107
|
-
}
|
|
108
|
-
catch (freeError) {
|
|
109
|
-
console.error(`β [STMT] FAILED TO FREE STATEMENT:`, freeError);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
if (DEBUG_DB)
|
|
114
|
-
console.log(`π [STMT] NO STATEMENT TO FREE`);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Safe query execution returning first result or null.
|
|
120
|
-
* Automatically handles statement cleanup.
|
|
121
|
-
*
|
|
122
|
-
* @todo UPGRADE: Replace with repository.findFirst() method
|
|
123
|
-
*
|
|
124
|
-
* @param db - SQLite database instance
|
|
125
|
-
* @param sql - SQL query string
|
|
126
|
-
* @param params - Query parameters (optional)
|
|
127
|
-
* @returns First matching row or null
|
|
128
|
-
* @throws DatabaseError for SQL execution errors
|
|
129
|
-
*/
|
|
130
|
-
export function safeQueryFirst(db, sql, params = []) {
|
|
131
|
-
let stmt = null;
|
|
132
|
-
// π DETAILED OPERATION LOGGING
|
|
133
|
-
if (DEBUG_DB)
|
|
134
|
-
console.log(`π [DB-OP] QUERY_FIRST START: ${sql.substring(0, 100)}${sql.length > 100 ? '...' : ''}`);
|
|
135
|
-
if (params && params.length > 0) {
|
|
136
|
-
if (DEBUG_DB)
|
|
137
|
-
console.log(`π [DB-OP] QUERY_FIRST PARAMS:`, params);
|
|
138
|
-
}
|
|
139
|
-
try {
|
|
140
|
-
if (DEBUG_DB)
|
|
141
|
-
console.log(`π [STMT] PREPARE FIRST: ${sql.substring(0, 80)}${sql.length > 80 ? '...' : ''}`);
|
|
142
|
-
stmt = db.prepare(sql);
|
|
143
|
-
if (DEBUG_DB)
|
|
144
|
-
console.log(`π [STMT] PREPARE FIRST SUCCESS`);
|
|
145
|
-
if (params.length > 0) {
|
|
146
|
-
if (DEBUG_DB)
|
|
147
|
-
console.log(`π [STMT] BIND FIRST PARAMS:`, params);
|
|
148
|
-
stmt.bind(params);
|
|
149
|
-
if (DEBUG_DB)
|
|
150
|
-
console.log(`π [STMT] BIND FIRST SUCCESS`);
|
|
151
|
-
}
|
|
152
|
-
if (DEBUG_DB)
|
|
153
|
-
console.log(`π [STMT] EXECUTING FIRST QUERY...`);
|
|
154
|
-
const hasResult = stmt.step();
|
|
155
|
-
const result = hasResult ? stmt.getAsObject() : null;
|
|
156
|
-
if (DEBUG_DB)
|
|
157
|
-
console.log(`π [STMT] QUERY_FIRST COMPLETE:`, hasResult ? 'Found result' : 'No result');
|
|
158
|
-
return result;
|
|
159
|
-
}
|
|
160
|
-
catch (error) {
|
|
161
|
-
console.error(`β [DB-OP] QUERY_FIRST FAILED: ${sql}`);
|
|
162
|
-
console.error(`β [DB-OP] ERROR:`, error);
|
|
163
|
-
// π― DETECT STATEMENT CLOSED ERRORS
|
|
164
|
-
if (error instanceof Error && error.message.includes('Statement closed')) {
|
|
165
|
-
console.error(`π¨ [DB-OP] STATEMENT CLOSED ERROR IN QUERY_FIRST!`);
|
|
166
|
-
console.error(`π¨ [DB-OP] SQL: ${sql}`);
|
|
167
|
-
console.error(`π¨ [DB-OP] PARAMS:`, params);
|
|
168
|
-
throw new DatabaseError(`Database corruption detected (Statement closed): ${sql}`, error);
|
|
169
|
-
}
|
|
170
|
-
throw new DatabaseError(`Query failed: ${sql}`, error);
|
|
171
|
-
}
|
|
172
|
-
finally {
|
|
173
|
-
if (stmt) {
|
|
174
|
-
if (DEBUG_DB)
|
|
175
|
-
console.log(`π [STMT] FREEING FIRST STATEMENT...`);
|
|
176
|
-
try {
|
|
177
|
-
stmt.free();
|
|
178
|
-
if (DEBUG_DB)
|
|
179
|
-
console.log(`π [STMT] FIRST STATEMENT FREED SUCCESSFULLY`);
|
|
180
|
-
}
|
|
181
|
-
catch (freeError) {
|
|
182
|
-
console.error(`β [STMT] FAILED TO FREE FIRST STATEMENT:`, freeError);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
if (DEBUG_DB)
|
|
187
|
-
console.log(`π [STMT] NO FIRST STATEMENT TO FREE`);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Safe execution of INSERT/UPDATE/DELETE statements.
|
|
193
|
-
* Automatically handles statement cleanup.
|
|
194
|
-
*
|
|
195
|
-
* @todo UPGRADE: Replace with repository.create()/update()/delete() methods
|
|
196
|
-
*
|
|
197
|
-
* @param db - SQLite database instance
|
|
198
|
-
* @param sql - SQL statement string
|
|
199
|
-
* @param params - Statement parameters (optional)
|
|
200
|
-
* @returns Number of affected rows
|
|
201
|
-
* @throws DatabaseError for SQL execution errors
|
|
202
|
-
*/
|
|
203
|
-
export function safeExec(db, sql, params = []) {
|
|
204
|
-
let stmt = null;
|
|
205
|
-
// π DETAILED OPERATION LOGGING
|
|
206
|
-
if (DEBUG_DB)
|
|
207
|
-
console.log(`π [DB-OP] EXEC START: ${sql.substring(0, 100)}${sql.length > 100 ? '...' : ''}`);
|
|
208
|
-
if (params && params.length > 0) {
|
|
209
|
-
if (DEBUG_DB)
|
|
210
|
-
console.log(`π [DB-OP] EXEC PARAMS:`, params);
|
|
211
|
-
}
|
|
212
|
-
try {
|
|
213
|
-
if (DEBUG_DB)
|
|
214
|
-
console.log(`π [STMT] PREPARE EXEC: ${sql.substring(0, 80)}${sql.length > 80 ? '...' : ''}`);
|
|
215
|
-
stmt = db.prepare(sql);
|
|
216
|
-
if (DEBUG_DB)
|
|
217
|
-
console.log(`π [STMT] PREPARE EXEC SUCCESS`);
|
|
218
|
-
if (params.length > 0) {
|
|
219
|
-
if (DEBUG_DB)
|
|
220
|
-
console.log(`π [STMT] BIND EXEC PARAMS:`, params);
|
|
221
|
-
stmt.bind(params);
|
|
222
|
-
if (DEBUG_DB)
|
|
223
|
-
console.log(`π [STMT] BIND EXEC SUCCESS`);
|
|
224
|
-
}
|
|
225
|
-
if (DEBUG_DB)
|
|
226
|
-
console.log(`π [STMT] EXECUTING STATEMENT...`);
|
|
227
|
-
stmt.step();
|
|
228
|
-
if (DEBUG_DB)
|
|
229
|
-
console.log(`π [STMT] STATEMENT EXECUTED SUCCESSFULLY`);
|
|
230
|
-
// Get affected rows count for INSERT/UPDATE/DELETE
|
|
231
|
-
if (DEBUG_DB)
|
|
232
|
-
console.log(`π [STMT] GETTING CHANGES COUNT...`);
|
|
233
|
-
const changes = db.exec('SELECT changes() as count')[0];
|
|
234
|
-
const changeCount = changes?.values?.[0]?.[0] || 0;
|
|
235
|
-
if (DEBUG_DB)
|
|
236
|
-
console.log(`π [STMT] EXEC COMPLETE: ${changeCount} rows affected`);
|
|
237
|
-
return changeCount;
|
|
238
|
-
}
|
|
239
|
-
catch (error) {
|
|
240
|
-
console.error(`β [DB-OP] EXEC FAILED: ${sql}`);
|
|
241
|
-
console.error(`β [DB-OP] ERROR:`, error);
|
|
242
|
-
// π― DETECT STATEMENT CLOSED ERRORS
|
|
243
|
-
if (error instanceof Error && error.message.includes('Statement closed')) {
|
|
244
|
-
console.error(`π¨ [DB-OP] STATEMENT CLOSED ERROR IN EXEC!`);
|
|
245
|
-
console.error(`π¨ [DB-OP] SQL: ${sql}`);
|
|
246
|
-
console.error(`π¨ [DB-OP] PARAMS:`, params);
|
|
247
|
-
throw new DatabaseError(`Database corruption detected (Statement closed): ${sql}`, error);
|
|
248
|
-
}
|
|
249
|
-
console.error(`π¨ [DEBUG] Detailed execution error:`, error);
|
|
250
|
-
console.error(`π¨ [DEBUG] Error type:`, typeof error);
|
|
251
|
-
console.error(`π¨ [DEBUG] Error message:`, error?.message);
|
|
252
|
-
console.error(`π¨ [DEBUG] Error stack:`, error?.stack);
|
|
253
|
-
throw new DatabaseError(`Execution failed: ${sql}`, error);
|
|
254
|
-
}
|
|
255
|
-
finally {
|
|
256
|
-
if (stmt) {
|
|
257
|
-
if (DEBUG_DB)
|
|
258
|
-
console.log(`π [STMT] FREEING EXEC STATEMENT...`);
|
|
259
|
-
try {
|
|
260
|
-
stmt.free();
|
|
261
|
-
if (DEBUG_DB)
|
|
262
|
-
console.log(`π [STMT] EXEC STATEMENT FREED SUCCESSFULLY`);
|
|
263
|
-
}
|
|
264
|
-
catch (freeError) {
|
|
265
|
-
console.error(`β [STMT] FAILED TO FREE EXEC STATEMENT:`, freeError);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
if (DEBUG_DB)
|
|
270
|
-
console.log(`π [STMT] NO EXEC STATEMENT TO FREE`);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Safe transaction execution with automatic rollback on error.
|
|
276
|
-
* Ensures consistent database state even if operations fail.
|
|
277
|
-
*
|
|
278
|
-
* @todo UPGRADE: Replace with repository.withTransaction() method
|
|
279
|
-
*
|
|
280
|
-
* @param db - SQLite database instance
|
|
281
|
-
* @param operations - Function containing database operations
|
|
282
|
-
* @returns Result of operations function
|
|
283
|
-
* @throws DatabaseError for transaction failures
|
|
284
|
-
*/
|
|
285
|
-
export function safeTransaction(db, operations) {
|
|
286
|
-
try {
|
|
287
|
-
db.exec('BEGIN TRANSACTION');
|
|
288
|
-
const result = operations();
|
|
289
|
-
db.exec('COMMIT');
|
|
290
|
-
return result;
|
|
291
|
-
}
|
|
292
|
-
catch (error) {
|
|
293
|
-
try {
|
|
294
|
-
db.exec('ROLLBACK');
|
|
295
|
-
}
|
|
296
|
-
catch (rollbackError) {
|
|
297
|
-
// Log rollback failure but throw original error
|
|
298
|
-
console.error('Failed to rollback transaction:', rollbackError);
|
|
299
|
-
}
|
|
300
|
-
throw new DatabaseError('Transaction failed', error);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Get the last inserted row ID from an INSERT operation.
|
|
305
|
-
* Helper for operations that need the new record ID.
|
|
306
|
-
*
|
|
307
|
-
* @todo UPGRADE: Repository pattern will handle this automatically
|
|
308
|
-
*
|
|
309
|
-
* @param db - SQLite database instance
|
|
310
|
-
* @returns Last inserted row ID
|
|
311
|
-
*/
|
|
312
|
-
export function getLastInsertId(db) {
|
|
313
|
-
const result = safeQueryFirst(db, 'SELECT last_insert_rowid() as id');
|
|
314
|
-
return result?.id || 0;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Custom error class for database operations.
|
|
318
|
-
* Provides consistent error handling across all database functions.
|
|
319
|
-
*
|
|
320
|
-
* @todo UPGRADE: Repository pattern will have more specific error types
|
|
321
|
-
*/
|
|
322
|
-
export class DatabaseError extends Error {
|
|
323
|
-
cause;
|
|
324
|
-
constructor(message, cause) {
|
|
325
|
-
super(message);
|
|
326
|
-
this.cause = cause;
|
|
327
|
-
this.name = 'DatabaseError';
|
|
328
|
-
// Include original error details if available
|
|
329
|
-
if (cause instanceof Error) {
|
|
330
|
-
this.message += ` (${cause.message})`;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* MIGRATION HELPERS
|
|
336
|
-
*
|
|
337
|
-
* These functions help gradually replace manual prepare/free patterns
|
|
338
|
-
* throughout the existing codebase.
|
|
339
|
-
*/
|
|
340
|
-
/**
|
|
341
|
-
* Check if a table exists in the database.
|
|
342
|
-
* Common pattern used in migration logic.
|
|
343
|
-
*
|
|
344
|
-
* @param db - SQLite database instance
|
|
345
|
-
* @param tableName - Name of table to check
|
|
346
|
-
* @returns True if table exists
|
|
347
|
-
*/
|
|
348
|
-
export function tableExists(db, tableName) {
|
|
349
|
-
const result = safeQueryFirst(db, 'SELECT COUNT(*) as count FROM sqlite_master WHERE type="table" AND name=?', [tableName]);
|
|
350
|
-
return (result?.count || 0) > 0;
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Check if a column exists in a table.
|
|
354
|
-
* Useful for schema validation and migrations.
|
|
355
|
-
*
|
|
356
|
-
* @param db - SQLite database instance
|
|
357
|
-
* @param tableName - Name of table
|
|
358
|
-
* @param columnName - Name of column to check
|
|
359
|
-
* @returns True if column exists
|
|
360
|
-
*/
|
|
361
|
-
export function columnExists(db, tableName, columnName) {
|
|
362
|
-
try {
|
|
363
|
-
const result = safeQuery(db, `PRAGMA table_info(${tableName})`);
|
|
364
|
-
return result.some((col) => col.name === columnName);
|
|
365
|
-
}
|
|
366
|
-
catch {
|
|
367
|
-
return false;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* COMMON UTILITY PATTERNS
|
|
372
|
-
*
|
|
373
|
-
* These higher-level helpers encapsulate frequent database patterns
|
|
374
|
-
*/
|
|
375
|
-
/**
|
|
376
|
-
* Check if any records exist matching the criteria
|
|
377
|
-
* @param db - SQLite database instance
|
|
378
|
-
* @param table - Table name
|
|
379
|
-
* @param whereClause - WHERE clause (without WHERE keyword)
|
|
380
|
-
* @param params - Parameters for WHERE clause
|
|
381
|
-
* @returns True if any records exist
|
|
382
|
-
*/
|
|
383
|
-
export function recordExists(db, table, whereClause, params = []) {
|
|
384
|
-
const result = safeQueryFirst(db, `SELECT COUNT(*) as count FROM ${table} WHERE ${whereClause}`, params);
|
|
385
|
-
return (result?.count || 0) > 0;
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* Count records matching criteria
|
|
389
|
-
* @param db - SQLite database instance
|
|
390
|
-
* @param table - Table name
|
|
391
|
-
* @param whereClause - WHERE clause (without WHERE keyword, optional)
|
|
392
|
-
* @param params - Parameters for WHERE clause
|
|
393
|
-
* @returns Number of matching records
|
|
394
|
-
*/
|
|
395
|
-
export function countRecords(db, table, whereClause, params = []) {
|
|
396
|
-
const sql = whereClause
|
|
397
|
-
? `SELECT COUNT(*) as count FROM ${table} WHERE ${whereClause}`
|
|
398
|
-
: `SELECT COUNT(*) as count FROM ${table}`;
|
|
399
|
-
const result = safeQueryFirst(db, sql, params);
|
|
400
|
-
return result?.count || 0;
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* Delete records with safe execution
|
|
404
|
-
* @param db - SQLite database instance
|
|
405
|
-
* @param table - Table name
|
|
406
|
-
* @param whereClause - WHERE clause (without WHERE keyword)
|
|
407
|
-
* @param params - Parameters for WHERE clause
|
|
408
|
-
* @returns Number of deleted records
|
|
409
|
-
*/
|
|
410
|
-
export function deleteRecords(db, table, whereClause, params = []) {
|
|
411
|
-
return safeExec(db, `DELETE FROM ${table} WHERE ${whereClause}`, params);
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Update records with safe execution
|
|
415
|
-
* @param db - SQLite database instance
|
|
416
|
-
* @param table - Table name
|
|
417
|
-
* @param setClause - SET clause (without SET keyword)
|
|
418
|
-
* @param whereClause - WHERE clause (without WHERE keyword)
|
|
419
|
-
* @param params - Parameters for SET and WHERE clauses
|
|
420
|
-
* @returns Number of updated records
|
|
421
|
-
*/
|
|
422
|
-
export function updateRecords(db, table, setClause, whereClause, params = []) {
|
|
423
|
-
return safeExec(db, `UPDATE ${table} SET ${setClause} WHERE ${whereClause}`, params);
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* ======================================================================================
|
|
427
|
-
* ASYNC LOCKING WRAPPER FUNCTIONS - PHASE 1 ASYNC INFRASTRUCTURE
|
|
428
|
-
* ======================================================================================
|
|
429
|
-
*
|
|
430
|
-
* These functions provide thread-safe database operations by wrapping the existing
|
|
431
|
-
* safe utility functions with DatabaseOperationQueue serialization. This ELIMINATES
|
|
432
|
-
* "Statement closed" errors and race conditions by ensuring only ONE database
|
|
433
|
-
* operation executes at a time.
|
|
434
|
-
*
|
|
435
|
-
* @author Emma - Technical Implementation Specialist
|
|
436
|
-
* @task Task 3: Enhanced Database Utils with Locking
|
|
437
|
-
* @dependencies Task 1 (AsyncMutex), Task 2 (DatabaseOperationQueue)
|
|
438
|
-
*/
|
|
439
|
-
// Global database queue instance
|
|
440
|
-
const dbQueue = DatabaseOperationQueue.getInstance();
|
|
441
|
-
/**
|
|
442
|
-
* Thread-safe query execution with async locking protection.
|
|
443
|
-
* Wraps safeQuery() with DatabaseOperationQueue serialization.
|
|
444
|
-
*
|
|
445
|
-
* @param db - SQLite database instance
|
|
446
|
-
* @param sql - SQL query string
|
|
447
|
-
* @param params - Query parameters (optional)
|
|
448
|
-
* @returns Promise<Array> of query results
|
|
449
|
-
* @throws DatabaseError for SQL execution errors
|
|
450
|
-
*/
|
|
451
|
-
export async function safeQueryWithLocking(db, sql, params = []) {
|
|
452
|
-
return dbQueue.executeOperation(async () => {
|
|
453
|
-
if (DEBUG_DB)
|
|
454
|
-
console.log(`π [ASYNC-QUERY] Executing with locking protection: ${sql.substring(0, 80)}...`);
|
|
455
|
-
const result = safeQuery(db, sql, params);
|
|
456
|
-
if (DEBUG_DB)
|
|
457
|
-
console.log(`β
[ASYNC-QUERY] Completed successfully: ${result.length} results`);
|
|
458
|
-
return result;
|
|
459
|
-
}, `query:${sql.substring(0, 50)}...`);
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* Thread-safe query first execution with async locking protection.
|
|
463
|
-
* Wraps safeQueryFirst() with DatabaseOperationQueue serialization.
|
|
464
|
-
*
|
|
465
|
-
* @param db - SQLite database instance
|
|
466
|
-
* @param sql - SQL query string
|
|
467
|
-
* @param params - Query parameters (optional)
|
|
468
|
-
* @returns Promise<T | null> first matching row or null
|
|
469
|
-
* @throws DatabaseError for SQL execution errors
|
|
470
|
-
*/
|
|
471
|
-
export async function safeQueryFirstWithLocking(db, sql, params = []) {
|
|
472
|
-
return dbQueue.executeOperation(async () => {
|
|
473
|
-
if (DEBUG_DB)
|
|
474
|
-
console.log(`π [ASYNC-QUERY-FIRST] Executing with locking protection: ${sql.substring(0, 80)}...`);
|
|
475
|
-
const result = safeQueryFirst(db, sql, params);
|
|
476
|
-
if (DEBUG_DB)
|
|
477
|
-
console.log(`β
[ASYNC-QUERY-FIRST] Completed successfully: ${result ? 'Found result' : 'No result'}`);
|
|
478
|
-
return result;
|
|
479
|
-
}, `queryFirst:${sql.substring(0, 50)}...`);
|
|
480
|
-
}
|
|
481
|
-
/**
|
|
482
|
-
* Thread-safe execution with async locking protection.
|
|
483
|
-
* Wraps safeExec() with DatabaseOperationQueue serialization.
|
|
484
|
-
*
|
|
485
|
-
* @param db - SQLite database instance
|
|
486
|
-
* @param sql - SQL statement string
|
|
487
|
-
* @param params - Statement parameters (optional)
|
|
488
|
-
* @returns Promise<number> of affected rows
|
|
489
|
-
* @throws DatabaseError for SQL execution errors
|
|
490
|
-
*/
|
|
491
|
-
export async function safeExecWithLocking(db, sql, params = []) {
|
|
492
|
-
return dbQueue.executeOperation(async () => {
|
|
493
|
-
if (DEBUG_DB)
|
|
494
|
-
console.log(`π [ASYNC-EXEC] Executing with locking protection: ${sql.substring(0, 80)}...`);
|
|
495
|
-
const result = safeExec(db, sql, params);
|
|
496
|
-
if (DEBUG_DB)
|
|
497
|
-
console.log(`β
[ASYNC-EXEC] Completed successfully: ${result} rows affected`);
|
|
498
|
-
return result;
|
|
499
|
-
}, `exec:${sql.substring(0, 50)}...`);
|
|
500
|
-
}
|
|
501
|
-
/**
|
|
502
|
-
* Thread-safe transaction execution with async locking protection.
|
|
503
|
-
* Wraps safeTransaction() with DatabaseOperationQueue serialization.
|
|
504
|
-
*
|
|
505
|
-
* CRITICAL: This ensures atomic transactions with NO race conditions.
|
|
506
|
-
* Multiple transactions CANNOT run concurrently - GUARANTEED serialization.
|
|
507
|
-
*
|
|
508
|
-
* @param db - SQLite database instance
|
|
509
|
-
* @param operations - Function containing database operations
|
|
510
|
-
* @returns Promise<T> result of operations function
|
|
511
|
-
* @throws DatabaseError for transaction failures
|
|
512
|
-
*/
|
|
513
|
-
export async function safeTransactionWithLocking(db, operations) {
|
|
514
|
-
return dbQueue.executeOperation(async () => {
|
|
515
|
-
if (DEBUG_DB)
|
|
516
|
-
console.log(`π [ASYNC-TRANSACTION] Starting transaction with locking protection`);
|
|
517
|
-
try {
|
|
518
|
-
db.exec('BEGIN TRANSACTION');
|
|
519
|
-
if (DEBUG_DB)
|
|
520
|
-
console.log(`π [ASYNC-TRANSACTION] Transaction started`);
|
|
521
|
-
const result = await operations(db);
|
|
522
|
-
db.exec('COMMIT');
|
|
523
|
-
if (DEBUG_DB)
|
|
524
|
-
console.log(`β
[ASYNC-TRANSACTION] Transaction committed successfully`);
|
|
525
|
-
return result;
|
|
526
|
-
}
|
|
527
|
-
catch (error) {
|
|
528
|
-
console.error(`β [ASYNC-TRANSACTION] Transaction failed, rolling back:`, error);
|
|
529
|
-
try {
|
|
530
|
-
db.exec('ROLLBACK');
|
|
531
|
-
if (DEBUG_DB)
|
|
532
|
-
console.log(`π [ASYNC-TRANSACTION] Rollback completed`);
|
|
533
|
-
}
|
|
534
|
-
catch (rollbackError) {
|
|
535
|
-
console.error(`π¨ [ASYNC-TRANSACTION] Rollback failed:`, rollbackError);
|
|
536
|
-
}
|
|
537
|
-
throw new DatabaseError('Async transaction failed', error);
|
|
538
|
-
}
|
|
539
|
-
}, 'transaction');
|
|
540
|
-
}
|
|
541
|
-
/**
|
|
542
|
-
* UTILITY WRAPPERS WITH ASYNC LOCKING
|
|
543
|
-
*
|
|
544
|
-
* These provide async-safe versions of common utility functions
|
|
545
|
-
*/
|
|
546
|
-
/**
|
|
547
|
-
* Thread-safe record existence check with async locking protection.
|
|
548
|
-
*/
|
|
549
|
-
export async function recordExistsWithLocking(db, table, whereClause, params = []) {
|
|
550
|
-
return dbQueue.executeOperation(async () => {
|
|
551
|
-
if (DEBUG_DB)
|
|
552
|
-
console.log(`π [ASYNC-EXISTS] Checking record existence: ${table} WHERE ${whereClause}`);
|
|
553
|
-
const result = recordExists(db, table, whereClause, params);
|
|
554
|
-
if (DEBUG_DB)
|
|
555
|
-
console.log(`β
[ASYNC-EXISTS] Record existence check: ${result}`);
|
|
556
|
-
return result;
|
|
557
|
-
}, `exists:${table}`);
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* Thread-safe record counting with async locking protection.
|
|
561
|
-
*/
|
|
562
|
-
export async function countRecordsWithLocking(db, table, whereClause, params = []) {
|
|
563
|
-
return dbQueue.executeOperation(async () => {
|
|
564
|
-
if (DEBUG_DB)
|
|
565
|
-
console.log(`π [ASYNC-COUNT] Counting records: ${table}${whereClause ? ` WHERE ${whereClause}` : ''}`);
|
|
566
|
-
const result = countRecords(db, table, whereClause, params);
|
|
567
|
-
if (DEBUG_DB)
|
|
568
|
-
console.log(`β
[ASYNC-COUNT] Record count: ${result}`);
|
|
569
|
-
return result;
|
|
570
|
-
}, `count:${table}`);
|
|
571
|
-
}
|
|
572
|
-
/**
|
|
573
|
-
* Thread-safe record deletion with async locking protection.
|
|
574
|
-
*/
|
|
575
|
-
export async function deleteRecordsWithLocking(db, table, whereClause, params = []) {
|
|
576
|
-
return dbQueue.executeOperation(async () => {
|
|
577
|
-
if (DEBUG_DB)
|
|
578
|
-
console.log(`π [ASYNC-DELETE] Deleting records: ${table} WHERE ${whereClause}`);
|
|
579
|
-
const result = deleteRecords(db, table, whereClause, params);
|
|
580
|
-
if (DEBUG_DB)
|
|
581
|
-
console.log(`β
[ASYNC-DELETE] Records deleted: ${result}`);
|
|
582
|
-
return result;
|
|
583
|
-
}, `delete:${table}`);
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* Thread-safe record updating with async locking protection.
|
|
587
|
-
*/
|
|
588
|
-
export async function updateRecordsWithLocking(db, table, setClause, whereClause, params = []) {
|
|
589
|
-
return dbQueue.executeOperation(async () => {
|
|
590
|
-
if (DEBUG_DB)
|
|
591
|
-
console.log(`π [ASYNC-UPDATE] Updating records: ${table} SET ${setClause} WHERE ${whereClause}`);
|
|
592
|
-
const result = updateRecords(db, table, setClause, whereClause, params);
|
|
593
|
-
if (DEBUG_DB)
|
|
594
|
-
console.log(`β
[ASYNC-UPDATE] Records updated: ${result}`);
|
|
595
|
-
return result;
|
|
596
|
-
}, `update:${table}`);
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* Thread-safe last insert ID retrieval with async locking protection.
|
|
600
|
-
*/
|
|
601
|
-
export async function getLastInsertIdWithLocking(db) {
|
|
602
|
-
return dbQueue.executeOperation(async () => {
|
|
603
|
-
if (DEBUG_DB)
|
|
604
|
-
console.log(`π [ASYNC-LAST-ID] Getting last insert ID`);
|
|
605
|
-
// This function should only be called with Database type
|
|
606
|
-
// FSSLinkDatabase should use pool.withConnection() pattern
|
|
607
|
-
const result = getLastInsertId(db);
|
|
608
|
-
if (DEBUG_DB)
|
|
609
|
-
console.log(`β
[ASYNC-LAST-ID] Last insert ID: ${result}`);
|
|
610
|
-
return result;
|
|
611
|
-
}, 'lastInsertId');
|
|
612
|
-
}
|
|
613
|
-
/**
|
|
614
|
-
* ======================================================================================
|
|
615
|
-
* MIGRATION GUIDE: FROM UNSAFE TO ASYNC-SAFE DATABASE OPERATIONS
|
|
616
|
-
* ======================================================================================
|
|
617
|
-
*
|
|
618
|
-
* OLD (race condition prone):
|
|
619
|
-
* const results = safeQuery(db, 'SELECT * FROM model_configs WHERE auth_type = ?', [authType]);
|
|
620
|
-
* const count = safeExec(db, 'UPDATE model_configs SET is_active = 0');
|
|
621
|
-
*
|
|
622
|
-
* NEW (thread-safe with async locking):
|
|
623
|
-
* const results = await safeQueryWithLocking(db, 'SELECT * FROM model_configs WHERE auth_type = ?', [authType]);
|
|
624
|
-
* const count = await safeExecWithLocking(db, 'UPDATE model_configs SET is_active = 0');
|
|
625
|
-
*
|
|
626
|
-
* TRANSACTION EXAMPLE:
|
|
627
|
-
* const result = await safeTransactionWithLocking(db, async (db) => {
|
|
628
|
-
* await safeExecWithLocking(db, 'UPDATE model_configs SET is_active = 0');
|
|
629
|
-
* await safeExecWithLocking(db, 'UPDATE model_configs SET is_active = 1 WHERE id = ?', [modelId]);
|
|
630
|
-
* return { success: true };
|
|
631
|
-
* });
|
|
632
|
-
*
|
|
633
|
-
* UTILITY EXAMPLES:
|
|
634
|
-
* const exists = await recordExistsWithLocking(db, 'model_configs', 'is_active = 1');
|
|
635
|
-
* const count = await countRecordsWithLocking(db, 'model_configs', 'auth_type = ?', ['ollama']);
|
|
636
|
-
* const deleted = await deleteRecordsWithLocking(db, 'model_configs', 'is_active = 0 AND last_used < ?', [cutoffDate]);
|
|
637
|
-
*/
|
|
638
|
-
/**
|
|
639
|
-
* EXAMPLE MIGRATION FROM OLD PATTERN TO NEW PATTERN:
|
|
640
|
-
*
|
|
641
|
-
* // OLD (manual memory management):
|
|
642
|
-
* const stmt = db.prepare('SELECT * FROM model_configs WHERE auth_type = ?');
|
|
643
|
-
* stmt.bind([authType]);
|
|
644
|
-
* const results = [];
|
|
645
|
-
* while (stmt.step()) {
|
|
646
|
-
* results.push(stmt.getAsObject());
|
|
647
|
-
* }
|
|
648
|
-
* stmt.free(); // Easy to forget!
|
|
649
|
-
*
|
|
650
|
-
* // NEW (automatic cleanup):
|
|
651
|
-
* const results = safeQuery(db, 'SELECT * FROM model_configs WHERE auth_type = ?', [authType]);
|
|
652
|
-
*
|
|
653
|
-
* // UTILITY HELPERS:
|
|
654
|
-
* const hasActiveModels = recordExists(db, 'model_configs', 'is_active = 1');
|
|
655
|
-
* const modelCount = countRecords(db, 'model_configs', 'auth_type = ?', ['ollama']);
|
|
656
|
-
* const deletedCount = deleteRecords(db, 'model_configs', 'is_active = 0 AND last_used < ?', [cutoffDate]);
|
|
657
|
-
*
|
|
658
|
-
* // FUTURE (repository pattern):
|
|
659
|
-
* const results = await modelRepo.findByAuthType(authType);
|
|
660
|
-
* const hasActive = await modelRepo.hasActive();
|
|
661
|
-
* const count = await modelRepo.countByAuthType('ollama');
|
|
662
|
-
* const deleted = await modelRepo.deleteInactive(cutoffDate);
|
|
663
|
-
*/
|
|
664
|
-
//# sourceMappingURL=database-utils.js.map
|