@blackbox_ai/blackbox-cli 0.0.7 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -183
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/package.json +13 -3
- package/dist/src/built-in-extensions/conductor/README.md +242 -0
- package/dist/src/built-in-extensions/conductor/blackbox-extension.json +5 -0
- package/dist/src/built-in-extensions/conductor/commands/conductor/implement.toml +170 -0
- package/dist/src/built-in-extensions/conductor/commands/conductor/newTrack.toml +142 -0
- package/dist/src/built-in-extensions/conductor/commands/conductor/revert.toml +122 -0
- package/dist/src/built-in-extensions/conductor/commands/conductor/setup.toml +424 -0
- package/dist/src/built-in-extensions/conductor/commands/conductor/status.toml +57 -0
- package/dist/src/built-in-extensions/conductor/templates/code_styleguides/general.md +23 -0
- package/dist/src/built-in-extensions/conductor/templates/code_styleguides/go.md +48 -0
- package/dist/src/built-in-extensions/conductor/templates/code_styleguides/html-css.md +49 -0
- package/dist/src/built-in-extensions/conductor/templates/code_styleguides/javascript.md +51 -0
- package/dist/src/built-in-extensions/conductor/templates/code_styleguides/python.md +37 -0
- package/dist/src/built-in-extensions/conductor/templates/code_styleguides/typescript.md +43 -0
- package/dist/src/built-in-extensions/conductor/templates/workflow.md +333 -0
- package/dist/src/built-in-extensions-data.d.ts +15 -0
- package/dist/src/built-in-extensions-data.js +61 -0
- package/dist/src/built-in-extensions-data.js.map +1 -0
- package/dist/src/commands/configure/ConfigureUI.d.ts +14 -0
- package/dist/src/commands/configure/ConfigureUI.js +556 -0
- package/dist/src/commands/configure/ConfigureUI.js.map +1 -0
- package/dist/src/commands/configure/index.d.ts +7 -0
- package/dist/src/commands/configure/index.js +62 -0
- package/dist/src/commands/configure/index.js.map +1 -0
- package/dist/src/commands/configure.d.ts +7 -0
- package/dist/src/commands/configure.js +276 -0
- package/dist/src/commands/configure.js.map +1 -0
- package/dist/src/commands/configure.test.d.ts +6 -0
- package/dist/src/commands/configure.test.js +32 -0
- package/dist/src/commands/configure.test.js.map +1 -0
- package/dist/src/commands/extensions/enable.js +1 -1
- package/dist/src/commands/extensions/enable.js.map +1 -1
- package/dist/src/commands/extensions/examples/context/CONTEXT.md +16 -0
- package/dist/src/commands/extensions/examples/context/blackbox-extension.json +5 -0
- package/dist/src/commands/extensions/examples/custom-commands/blackbox-extension.json +4 -0
- package/dist/src/commands/extensions/examples/custom-commands/commands/deploy.toml +12 -0
- package/dist/src/commands/extensions/examples/exclude-tools/README.md +28 -0
- package/dist/src/commands/extensions/examples/exclude-tools/blackbox-extension.json +5 -0
- package/dist/src/commands/extensions/install.d.ts +6 -2
- package/dist/src/commands/extensions/install.js +109 -15
- package/dist/src/commands/extensions/install.js.map +1 -1
- package/dist/src/commands/extensions/link.d.ts +12 -0
- package/dist/src/commands/extensions/link.js +53 -0
- package/dist/src/commands/extensions/link.js.map +1 -0
- package/dist/src/commands/extensions/list.js +2 -2
- package/dist/src/commands/extensions/list.js.map +1 -1
- package/dist/src/commands/extensions/new.d.ts +13 -0
- package/dist/src/commands/extensions/new.js +145 -0
- package/dist/src/commands/extensions/new.js.map +1 -0
- package/dist/src/commands/extensions/settings.d.ts +18 -0
- package/dist/src/commands/extensions/settings.js +98 -0
- package/dist/src/commands/extensions/settings.js.map +1 -0
- package/dist/src/commands/extensions/update.d.ts +2 -1
- package/dist/src/commands/extensions/update.js +59 -10
- package/dist/src/commands/extensions/update.js.map +1 -1
- package/dist/src/commands/extensions/validate.d.ts +12 -0
- package/dist/src/commands/extensions/validate.js +72 -0
- package/dist/src/commands/extensions/validate.js.map +1 -0
- package/dist/src/commands/extensions.js +10 -1
- package/dist/src/commands/extensions.js.map +1 -1
- package/dist/src/commands/mcp/add.d.ts +11 -0
- package/dist/src/commands/mcp/add.js +61 -7
- package/dist/src/commands/mcp/add.js.map +1 -1
- package/dist/src/commands/update.d.ts +7 -0
- package/dist/src/commands/update.js +103 -0
- package/dist/src/commands/update.js.map +1 -0
- package/dist/src/commands/voice.d.ts +7 -0
- package/dist/src/commands/voice.js +510 -0
- package/dist/src/commands/voice.js.map +1 -0
- package/dist/src/config/auth.d.ts +32 -1
- package/dist/src/config/auth.js +317 -2
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.d.ts +7 -1
- package/dist/src/config/config.js +71 -10
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +6 -1
- package/dist/src/config/extension.js +137 -11
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/extensions/github.d.ts +48 -0
- package/dist/src/config/extensions/github.js +308 -0
- package/dist/src/config/extensions/github.js.map +1 -0
- package/dist/src/config/keyBindings.d.ts +1 -0
- package/dist/src/config/keyBindings.js +3 -0
- package/dist/src/config/keyBindings.js.map +1 -1
- package/dist/src/config/modelFetcher.d.ts +21 -0
- package/dist/src/config/modelFetcher.js +226 -0
- package/dist/src/config/modelFetcher.js.map +1 -0
- package/dist/src/config/settings.js +101 -0
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +626 -0
- package/dist/src/config/settingsSchema.js +626 -0
- package/dist/src/config/settingsSchema.js.map +1 -1
- package/dist/src/config/voice.d.ts +31 -0
- package/dist/src/config/voice.js +82 -0
- package/dist/src/config/voice.js.map +1 -0
- package/dist/src/encrypt/attestation.d.ts +5 -0
- package/dist/src/encrypt/attestation.js +100 -0
- package/dist/src/encrypt/attestation.js.map +1 -0
- package/dist/src/encrypt/bridge.d.ts +30 -0
- package/dist/src/encrypt/bridge.js +32 -0
- package/dist/src/encrypt/bridge.js.map +1 -0
- package/dist/src/encrypt/client.d.ts +14 -0
- package/dist/src/encrypt/client.js +133 -0
- package/dist/src/encrypt/client.js.map +1 -0
- package/dist/src/encrypt/config.d.ts +26 -0
- package/dist/src/encrypt/config.js +51 -0
- package/dist/src/encrypt/config.js.map +1 -0
- package/dist/src/encrypt/crypto-utils.d.ts +57 -0
- package/dist/src/encrypt/crypto-utils.js +257 -0
- package/dist/src/encrypt/crypto-utils.js.map +1 -0
- package/dist/src/encrypt/index.d.ts +12 -0
- package/dist/src/encrypt/index.js +13 -0
- package/dist/src/encrypt/index.js.map +1 -0
- package/dist/src/encrypt/retry-utils.d.ts +20 -0
- package/dist/src/encrypt/retry-utils.js +60 -0
- package/dist/src/encrypt/retry-utils.js.map +1 -0
- package/dist/src/encrypt/sessions.d.ts +17 -0
- package/dist/src/encrypt/sessions.js +221 -0
- package/dist/src/encrypt/sessions.js.map +1 -0
- package/dist/src/encrypt/streaming-client.d.ts +29 -0
- package/dist/src/encrypt/streaming-client.js +226 -0
- package/dist/src/encrypt/streaming-client.js.map +1 -0
- package/dist/src/encrypt/types.d.ts +81 -0
- package/dist/src/encrypt/types.js +2 -0
- package/dist/src/encrypt/types.js.map +1 -0
- package/dist/src/gemini.d.ts +1 -1
- package/dist/src/gemini.js +61 -28
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +3 -3
- package/dist/src/generated/git-commit.js +3 -3
- package/dist/src/nonInteractiveCli.d.ts +4 -0
- package/dist/src/nonInteractiveCli.js +563 -6
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/on-demand-extensions/README.md +266 -0
- package/dist/src/on-demand-extensions/git-helper/README.md +16 -0
- package/dist/src/on-demand-extensions/git-helper/blackbox-extension.json +5 -0
- package/dist/src/on-demand-extensions/git-helper/commands/git/branch-cleanup.toml +18 -0
- package/dist/src/on-demand-extensions/git-helper/commands/git/smart-commit.toml +22 -0
- package/dist/src/on-demand-extensions/greet/README.md +76 -0
- package/dist/src/on-demand-extensions/greet/blackbox-extension.json +5 -0
- package/dist/src/on-demand-extensions/greet/commands/greet/hello.toml +9 -0
- package/dist/src/on-demand-extensions/registry.json +251 -0
- package/dist/src/services/BuiltinCommandLoader.js +20 -2
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/EncryptedContentGenerator.d.ts +63 -0
- package/dist/src/services/EncryptedContentGenerator.js +426 -0
- package/dist/src/services/EncryptedContentGenerator.js.map +1 -0
- package/dist/src/services/McpCommandLoader.d.ts +24 -0
- package/dist/src/services/McpCommandLoader.js +50 -0
- package/dist/src/services/McpCommandLoader.js.map +1 -0
- package/dist/src/services/McpPromptLoader.js +17 -2
- package/dist/src/services/McpPromptLoader.js.map +1 -1
- package/dist/src/services/ReleaseNotesCache.d.ts +57 -0
- package/dist/src/services/ReleaseNotesCache.js +186 -0
- package/dist/src/services/ReleaseNotesCache.js.map +1 -0
- package/dist/src/services/elevenLabsErrors.d.ts +65 -0
- package/dist/src/services/elevenLabsErrors.js +233 -0
- package/dist/src/services/elevenLabsErrors.js.map +1 -0
- package/dist/src/services/elevenLabsService.d.ts +62 -0
- package/dist/src/services/elevenLabsService.js +186 -0
- package/dist/src/services/elevenLabsService.js.map +1 -0
- package/dist/src/services/elevenLabsStreamingService.d.ts +59 -0
- package/dist/src/services/elevenLabsStreamingService.js +202 -0
- package/dist/src/services/elevenLabsStreamingService.js.map +1 -0
- package/dist/src/services/elevenLabsTokenService.d.ts +21 -0
- package/dist/src/services/elevenLabsTokenService.js +42 -0
- package/dist/src/services/elevenLabsTokenService.js.map +1 -0
- package/dist/src/services/voiceInputHandler.d.ts +26 -0
- package/dist/src/services/voiceInputHandler.js +209 -0
- package/dist/src/services/voiceInputHandler.js.map +1 -0
- package/dist/src/services/voiceRecordingService.d.ts +69 -0
- package/dist/src/services/voiceRecordingService.js +397 -0
- package/dist/src/services/voiceRecordingService.js.map +1 -0
- package/dist/src/ui/App.d.ts +1 -0
- package/dist/src/ui/App.js +412 -63
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/browseExtensionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/browseExtensionsCommand.js +16 -0
- package/dist/src/ui/commands/browseExtensionsCommand.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.js +356 -16
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/dbCommand.d.ts +7 -0
- package/dist/src/ui/commands/dbCommand.js +37 -0
- package/dist/src/ui/commands/dbCommand.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.js +1 -1
- package/dist/src/ui/commands/docsCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpCommand.js +3 -2
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/mcpInvokeCommand.d.ts +16 -0
- package/dist/src/ui/commands/mcpInvokeCommand.js +263 -0
- package/dist/src/ui/commands/mcpInvokeCommand.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.js +79 -5
- package/dist/src/ui/commands/modelCommand.js.map +1 -1
- package/dist/src/ui/commands/multiAgentCommand.d.ts +7 -0
- package/dist/src/ui/commands/multiAgentCommand.js +833 -0
- package/dist/src/ui/commands/multiAgentCommand.js.map +1 -0
- package/dist/src/ui/commands/multiAgentConfigureCommand.d.ts +7 -0
- package/dist/src/ui/commands/multiAgentConfigureCommand.js +17 -0
- package/dist/src/ui/commands/multiAgentConfigureCommand.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.js +71 -2
- package/dist/src/ui/commands/quitCommand.js.map +1 -1
- package/dist/src/ui/commands/releasesCommand.d.ts +7 -0
- package/dist/src/ui/commands/releasesCommand.js +16 -0
- package/dist/src/ui/commands/releasesCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/shellPermissionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/shellPermissionsCommand.js +109 -0
- package/dist/src/ui/commands/shellPermissionsCommand.js.map +1 -0
- package/dist/src/ui/commands/skillCommand.d.ts +7 -0
- package/dist/src/ui/commands/skillCommand.js +240 -0
- package/dist/src/ui/commands/skillCommand.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.js +243 -1
- package/dist/src/ui/commands/statsCommand.js.map +1 -1
- package/dist/src/ui/commands/tasksCommand.d.ts +7 -0
- package/dist/src/ui/commands/tasksCommand.js +535 -0
- package/dist/src/ui/commands/tasksCommand.js.map +1 -0
- package/dist/src/ui/commands/toolPermissionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/toolPermissionsCommand.js +408 -0
- package/dist/src/ui/commands/toolPermissionsCommand.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +10 -2
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/voiceCommand.d.ts +7 -0
- package/dist/src/ui/commands/voiceCommand.js +525 -0
- package/dist/src/ui/commands/voiceCommand.js.map +1 -0
- package/dist/src/ui/components/AuthDialog.d.ts +4 -2
- package/dist/src/ui/components/AuthDialog.js +349 -64
- package/dist/src/ui/components/AuthDialog.js.map +1 -1
- package/dist/src/ui/components/AuthInProgress.js +3 -1
- package/dist/src/ui/components/AuthInProgress.js.map +1 -1
- package/dist/src/ui/components/ExtensionsDialog.d.ts +11 -0
- package/dist/src/ui/components/ExtensionsDialog.js +303 -0
- package/dist/src/ui/components/ExtensionsDialog.js.map +1 -0
- package/dist/src/ui/components/GenericProviderKeyPrompt.d.ts +24 -0
- package/dist/src/ui/components/GenericProviderKeyPrompt.js +99 -0
- package/dist/src/ui/components/GenericProviderKeyPrompt.js.map +1 -0
- package/dist/src/ui/components/Header.js +10 -1
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/HistoryBrowserDialog.d.ts +15 -0
- package/dist/src/ui/components/HistoryBrowserDialog.js +166 -0
- package/dist/src/ui/components/HistoryBrowserDialog.js.map +1 -0
- package/dist/src/ui/components/HistoryItemDisplay.js +13 -1
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +22 -8
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.d.ts +4 -0
- package/dist/src/ui/components/LoadingIndicator.js +16 -4
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.test.js +108 -16
- package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/components/ModelSelectionDialog.d.ts +2 -0
- package/dist/src/ui/components/ModelSelectionDialog.js +33 -4
- package/dist/src/ui/components/ModelSelectionDialog.js.map +1 -1
- package/dist/src/ui/components/ModelSelectionDialog.test.js +41 -4
- package/dist/src/ui/components/ModelSelectionDialog.test.js.map +1 -1
- package/dist/src/ui/components/ReleaseNotesDialog.d.ts +23 -0
- package/dist/src/ui/components/ReleaseNotesDialog.js +150 -0
- package/dist/src/ui/components/ReleaseNotesDialog.js.map +1 -0
- package/dist/src/ui/components/ReleaseNotesDisplay.d.ts +18 -0
- package/dist/src/ui/components/ReleaseNotesDisplay.js +14 -0
- package/dist/src/ui/components/ReleaseNotesDisplay.js.map +1 -0
- package/dist/src/ui/components/SessionSummaryDisplay.d.ts +2 -0
- package/dist/src/ui/components/SessionSummaryDisplay.js +1 -1
- package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +3 -1
- package/dist/src/ui/components/SettingsDialog.js +17 -7
- package/dist/src/ui/components/SettingsDialog.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +2 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js +7 -3
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -1
- package/dist/src/ui/components/StatsDisplay.d.ts +2 -0
- package/dist/src/ui/components/StatsDisplay.js +92 -7
- package/dist/src/ui/components/StatsDisplay.js.map +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js +6 -1
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.d.ts +3 -1
- package/dist/src/ui/components/ThemeDialog.js +5 -2
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/Tips.js +1 -4
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/TodoListDialog.d.ts +13 -0
- package/dist/src/ui/components/TodoListDialog.js +29 -0
- package/dist/src/ui/components/TodoListDialog.js.map +1 -0
- package/dist/src/ui/components/TodoListDialog.test.d.ts +6 -0
- package/dist/src/ui/components/TodoListDialog.test.js +60 -0
- package/dist/src/ui/components/TodoListDialog.test.js.map +1 -0
- package/dist/src/ui/components/VoiceConfigDialog.d.ts +17 -0
- package/dist/src/ui/components/VoiceConfigDialog.js +47 -0
- package/dist/src/ui/components/VoiceConfigDialog.js.map +1 -0
- package/dist/src/ui/components/messages/GeminiMessage.js +4 -0
- package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -1
- package/dist/src/ui/components/messages/GeminiMessageContent.js +4 -0
- package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +2 -0
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +96 -9
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js +3 -3
- package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.js +1 -1
- package/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +9 -12
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/multiagent/MultiAgentConfigDialog.d.ts +25 -0
- package/dist/src/ui/components/multiagent/MultiAgentConfigDialog.js +179 -0
- package/dist/src/ui/components/multiagent/MultiAgentConfigDialog.js.map +1 -0
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +3 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +57 -18
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/TextInput.d.ts +2 -1
- package/dist/src/ui/components/shared/TextInput.js +5 -2
- package/dist/src/ui/components/shared/TextInput.js.map +1 -1
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js +3 -3
- package/dist/src/ui/components/subagents/runtime/AgentExecutionDisplay.js.map +1 -1
- package/dist/src/ui/constants.d.ts +3 -3
- package/dist/src/ui/constants.js +3 -3
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +6 -0
- package/dist/src/ui/contexts/SessionContext.js +24 -2
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +139 -57
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +2 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +189 -17
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAdaptiveStream.d.ts +42 -0
- package/dist/src/ui/hooks/useAdaptiveStream.js +31 -0
- package/dist/src/ui/hooks/useAdaptiveStream.js.map +1 -0
- package/dist/src/ui/hooks/useAtCompletion.js +20 -4
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useAuthCommand.d.ts +2 -2
- package/dist/src/ui/hooks/useAuthCommand.js +99 -5
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
- package/dist/src/ui/hooks/useCommandCompletion.js +14 -10
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useDialogClose.d.ts +10 -0
- package/dist/src/ui/hooks/useDialogClose.js +25 -0
- package/dist/src/ui/hooks/useDialogClose.js.map +1 -1
- package/dist/src/ui/hooks/useDialogCloseAnimation.d.ts +22 -0
- package/dist/src/ui/hooks/useDialogCloseAnimation.js +68 -0
- package/dist/src/ui/hooks/useDialogCloseAnimation.js.map +1 -0
- package/dist/src/ui/hooks/useEncryptedStream.d.ts +22 -0
- package/dist/src/ui/hooks/useEncryptedStream.js +378 -0
- package/dist/src/ui/hooks/useEncryptedStream.js.map +1 -0
- package/dist/src/ui/hooks/useExtensionsDialog.d.ts +10 -0
- package/dist/src/ui/hooks/useExtensionsDialog.js +21 -0
- package/dist/src/ui/hooks/useExtensionsDialog.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.js +6 -2
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.d.ts +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.js +3 -2
- package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -1
- package/dist/src/ui/hooks/useLoadingIndicator.test.js +27 -5
- package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -1
- package/dist/src/ui/hooks/useMultiAgentConfigCommand.d.ts +10 -0
- package/dist/src/ui/hooks/useMultiAgentConfigCommand.js +21 -0
- package/dist/src/ui/hooks/useMultiAgentConfigCommand.js.map +1 -0
- package/dist/src/ui/hooks/useReleasesDialog.d.ts +20 -0
- package/dist/src/ui/hooks/useReleasesDialog.js +214 -0
- package/dist/src/ui/hooks/useReleasesDialog.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.js +10 -8
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useTodoList.d.ts +17 -0
- package/dist/src/ui/hooks/useTodoList.js +51 -0
- package/dist/src/ui/hooks/useTodoList.js.map +1 -0
- package/dist/src/ui/keyMatchers.test.js +6 -0
- package/dist/src/ui/keyMatchers.test.js.map +1 -1
- package/dist/src/ui/themes/blackbox-dark.js +1 -1
- package/dist/src/ui/themes/blackbox-dark.js.map +1 -1
- package/dist/src/ui/themes/blackbox-light.js +1 -1
- package/dist/src/ui/themes/blackbox-light.js.map +1 -1
- package/dist/src/ui/types.d.ts +15 -2
- package/dist/src/ui/types.js +1 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/computeStats.d.ts +25 -1
- package/dist/src/ui/utils/computeStats.js +58 -1
- package/dist/src/ui/utils/computeStats.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.js +37 -54
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/utils/backgroundUpdateCheck.d.ts +15 -0
- package/dist/src/utils/backgroundUpdateCheck.js +48 -0
- package/dist/src/utils/backgroundUpdateCheck.js.map +1 -0
- package/dist/src/utils/gitAutoDetect.d.ts +16 -0
- package/dist/src/utils/gitAutoDetect.js +45 -0
- package/dist/src/utils/gitAutoDetect.js.map +1 -0
- package/dist/src/utils/installationInfo.d.ts +1 -0
- package/dist/src/utils/installationInfo.js +24 -4
- package/dist/src/utils/installationInfo.js.map +1 -1
- package/dist/src/utils/preLaunchUpdateCheck.d.ts +17 -0
- package/dist/src/utils/preLaunchUpdateCheck.js +75 -0
- package/dist/src/utils/preLaunchUpdateCheck.js.map +1 -0
- package/dist/src/utils/version.js +12 -1
- package/dist/src/utils/version.js.map +1 -1
- package/dist/src/utils/versionStorage.d.ts +50 -0
- package/dist/src/utils/versionStorage.js +224 -0
- package/dist/src/utils/versionStorage.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.js +10 -3
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/src/virtual-extensions.d.ts +14 -0
- package/dist/src/virtual-extensions.js +56 -0
- package/dist/src/virtual-extensions.js.map +1 -0
- package/dist/src/zed-integration/fileSystemService.d.ts +3 -3
- package/dist/src/zed-integration/fileSystemService.js +5 -7
- package/dist/src/zed-integration/fileSystemService.js.map +1 -1
- package/dist/src/zed-integration/zedIntegration.js +62 -17
- package/dist/src/zed-integration/zedIntegration.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -3
- package/dist/src/utils/handleAutoUpdate.d.ts +0 -11
- package/dist/src/utils/handleAutoUpdate.js +0 -102
- package/dist/src/utils/handleAutoUpdate.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/zed-integration/acp.d.ts +0 -63
- package/dist/src/zed-integration/acp.js +0 -226
- package/dist/src/zed-integration/acp.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
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { getErrorMessage } from '@blackbox_ai/blackbox-cli-core';
|
|
7
|
+
import { ElevenLabsService } from './elevenLabsService.js';
|
|
8
|
+
import { VoiceRecordingService } from './voiceRecordingService.js';
|
|
9
|
+
// Debug mode flag - can be set via environment variable
|
|
10
|
+
const DEBUG_MODE = process.env['DEBUG'] === 'true' || process.env['DEBUG'] === '1' || process.env['DEBUG_MODE'] === 'true' || process.env['DEBUG_MODE'] === '1';
|
|
11
|
+
function debugLog(...args) {
|
|
12
|
+
if (DEBUG_MODE) {
|
|
13
|
+
console.debug('[DEBUG][VoiceInputHandler]', ...args);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function sanitizeApiKey(apiKey) {
|
|
17
|
+
if (apiKey.length <= 8)
|
|
18
|
+
return '***';
|
|
19
|
+
return `${apiKey.substring(0, 4)}...${apiKey.substring(apiKey.length - 4)}`;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Handle voice input: record audio and transcribe to text
|
|
23
|
+
*/
|
|
24
|
+
export async function handleVoiceInput(options) {
|
|
25
|
+
const { settings, language, onRecordingStart, onRecordingStop, onTranscriptionStart, onTranscriptionComplete, onError, } = options;
|
|
26
|
+
debugLog('handleVoiceInput called');
|
|
27
|
+
try {
|
|
28
|
+
// Get API key from settings or environment
|
|
29
|
+
const apiKey = settings.voice?.elevenLabs?.apiKey || process.env['ELEVENLABS_API_KEY'];
|
|
30
|
+
if (!apiKey) {
|
|
31
|
+
debugLog('No API key found');
|
|
32
|
+
throw new Error('ElevenLabs API key not configured. Run: blackbox voice configure');
|
|
33
|
+
}
|
|
34
|
+
debugLog('API key found:', sanitizeApiKey(apiKey));
|
|
35
|
+
debugLog('Voice settings:', {
|
|
36
|
+
sampleRate: settings.voice?.sampleRate,
|
|
37
|
+
audioFormat: settings.voice?.audioFormat,
|
|
38
|
+
language: language || settings.voice?.language,
|
|
39
|
+
});
|
|
40
|
+
// Initialize services
|
|
41
|
+
const voiceService = new VoiceRecordingService({
|
|
42
|
+
sampleRate: settings.voice?.sampleRate,
|
|
43
|
+
audioFormat: settings.voice?.audioFormat,
|
|
44
|
+
silenceThreshold: settings.voice?.silenceThreshold,
|
|
45
|
+
silenceDuration: settings.voice?.silenceDuration,
|
|
46
|
+
});
|
|
47
|
+
// Start recording
|
|
48
|
+
debugLog('Starting recording...');
|
|
49
|
+
if (onRecordingStart) {
|
|
50
|
+
onRecordingStart();
|
|
51
|
+
}
|
|
52
|
+
// Create temporary file path for recording
|
|
53
|
+
const os = await import('node:os');
|
|
54
|
+
const path = await import('node:path');
|
|
55
|
+
const tempFilePath = path.join(os.tmpdir(), `voice-recording-${Date.now()}.${settings.voice?.audioFormat || 'wav'}`);
|
|
56
|
+
// Start recording (will continue until stopped)
|
|
57
|
+
debugLog('Recording to file:', tempFilePath);
|
|
58
|
+
await voiceService.startRecording(tempFilePath);
|
|
59
|
+
let filePath;
|
|
60
|
+
try {
|
|
61
|
+
// Wait for user to press Enter to stop recording
|
|
62
|
+
debugLog('Waiting for user to stop recording...');
|
|
63
|
+
await waitForEnterKey();
|
|
64
|
+
// Stop recording
|
|
65
|
+
debugLog('Stopping recording...');
|
|
66
|
+
const result = await voiceService.stopRecording();
|
|
67
|
+
filePath = result.filePath;
|
|
68
|
+
debugLog('Recording stopped. File:', filePath, 'Size:', result.size, 'bytes, Duration:', result.duration, 's');
|
|
69
|
+
if (onRecordingStop) {
|
|
70
|
+
onRecordingStop();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
// Handle cancellation (Ctrl+C or ESC)
|
|
75
|
+
debugLog('Recording cancelled:', getErrorMessage(error));
|
|
76
|
+
await voiceService.cancelRecording();
|
|
77
|
+
if (onRecordingStop) {
|
|
78
|
+
onRecordingStop();
|
|
79
|
+
}
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
// Transcribe audio
|
|
83
|
+
debugLog('Starting transcription...');
|
|
84
|
+
if (onTranscriptionStart) {
|
|
85
|
+
onTranscriptionStart();
|
|
86
|
+
}
|
|
87
|
+
const elevenLabsService = new ElevenLabsService({
|
|
88
|
+
apiKey,
|
|
89
|
+
agentId: settings.voice?.elevenLabs?.agentId,
|
|
90
|
+
model: settings.voice?.elevenLabs?.model,
|
|
91
|
+
language: language || settings.voice?.language,
|
|
92
|
+
});
|
|
93
|
+
debugLog('Calling ElevenLabs transcription service...');
|
|
94
|
+
const transcription = await elevenLabsService.transcribe(filePath);
|
|
95
|
+
debugLog('Transcription received, length:', transcription.text.length);
|
|
96
|
+
debugLog('Transcription text:', transcription.text ? `"${transcription.text}"` : '(empty)');
|
|
97
|
+
// Cleanup audio file
|
|
98
|
+
const fs = await import('node:fs');
|
|
99
|
+
try {
|
|
100
|
+
debugLog('Cleaning up audio file:', filePath);
|
|
101
|
+
fs.unlinkSync(filePath);
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
// Ignore cleanup errors
|
|
105
|
+
debugLog('Failed to cleanup audio file:', getErrorMessage(error));
|
|
106
|
+
console.warn('Failed to cleanup audio file:', error);
|
|
107
|
+
}
|
|
108
|
+
if (onTranscriptionComplete) {
|
|
109
|
+
onTranscriptionComplete(transcription.text);
|
|
110
|
+
}
|
|
111
|
+
debugLog('Voice input completed successfully');
|
|
112
|
+
return transcription.text;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
const errorMessage = getErrorMessage(error);
|
|
116
|
+
debugLog('Voice input error:', errorMessage);
|
|
117
|
+
// The error message from ElevenLabsService already contains formatted error info
|
|
118
|
+
// Just wrap it with a prefix for context
|
|
119
|
+
const enhancedMessage = `Voice input failed: ${errorMessage}`;
|
|
120
|
+
const err = new Error(enhancedMessage);
|
|
121
|
+
if (onError) {
|
|
122
|
+
onError(err);
|
|
123
|
+
}
|
|
124
|
+
throw err;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Wait for user to press Enter key
|
|
129
|
+
*/
|
|
130
|
+
async function waitForEnterKey() {
|
|
131
|
+
return new Promise((resolve, reject) => {
|
|
132
|
+
const stdin = process.stdin;
|
|
133
|
+
stdin.setRawMode(true);
|
|
134
|
+
stdin.resume();
|
|
135
|
+
stdin.setEncoding('utf8');
|
|
136
|
+
const onData = (key) => {
|
|
137
|
+
// Check for Enter key (carriage return or newline)
|
|
138
|
+
if (key === '\r' || key === '\n') {
|
|
139
|
+
stdin.setRawMode(false);
|
|
140
|
+
stdin.pause();
|
|
141
|
+
stdin.removeListener('data', onData);
|
|
142
|
+
resolve();
|
|
143
|
+
}
|
|
144
|
+
// Check for Ctrl+C to cancel
|
|
145
|
+
if (key === '\u0003') {
|
|
146
|
+
stdin.setRawMode(false);
|
|
147
|
+
stdin.pause();
|
|
148
|
+
stdin.removeListener('data', onData);
|
|
149
|
+
reject(new Error('Recording cancelled'));
|
|
150
|
+
}
|
|
151
|
+
// Check for ESC key to cancel
|
|
152
|
+
if (key === '\u001b') {
|
|
153
|
+
stdin.setRawMode(false);
|
|
154
|
+
stdin.pause();
|
|
155
|
+
stdin.removeListener('data', onData);
|
|
156
|
+
reject(new Error('Recording cancelled'));
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
stdin.on('data', onData);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Check if voice input is properly configured
|
|
164
|
+
*/
|
|
165
|
+
export async function isVoiceConfigured(settings) {
|
|
166
|
+
debugLog('Checking voice configuration...');
|
|
167
|
+
const errors = [];
|
|
168
|
+
// Check API key
|
|
169
|
+
const apiKey = settings.voice?.elevenLabs?.apiKey || process.env['ELEVENLABS_API_KEY'];
|
|
170
|
+
if (!apiKey) {
|
|
171
|
+
debugLog('No API key found in configuration');
|
|
172
|
+
errors.push('ElevenLabs API key not configured');
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
debugLog('API key found:', sanitizeApiKey(apiKey));
|
|
176
|
+
}
|
|
177
|
+
// Validate API key if available
|
|
178
|
+
if (apiKey) {
|
|
179
|
+
try {
|
|
180
|
+
debugLog('Validating API key...');
|
|
181
|
+
const elevenLabsService = new ElevenLabsService({ apiKey });
|
|
182
|
+
const validation = await elevenLabsService.validateApiKeyDetailed();
|
|
183
|
+
debugLog('API key validation result:', validation.valid ? 'valid' : 'invalid');
|
|
184
|
+
if (!validation.valid) {
|
|
185
|
+
// Use the formatted error message from validation result
|
|
186
|
+
if (validation.error) {
|
|
187
|
+
debugLog('Validation error:', validation.error);
|
|
188
|
+
errors.push(validation.error);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
debugLog('Validation failed with no specific error');
|
|
192
|
+
errors.push('ElevenLabs API key validation failed');
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
const errorMsg = `Failed to validate API key: ${getErrorMessage(error)}`;
|
|
198
|
+
debugLog('Validation exception:', errorMsg);
|
|
199
|
+
errors.push(errorMsg);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const configured = errors.length === 0;
|
|
203
|
+
debugLog('Voice configuration check complete. Configured:', configured, 'Errors:', errors.length);
|
|
204
|
+
return {
|
|
205
|
+
configured,
|
|
206
|
+
errors,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=voiceInputHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voiceInputHandler.js","sourceRoot":"","sources":["../../../src/services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Q,CAAC,0CAA0C,CAAC,CAAC;oBACrD,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;gBACtD,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,QAAQ,GAAG,+BAA+B,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;YACzE,QAAQ,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;YAC5C,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC;IACvC,QAAQ,CAAC,iDAAiD,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAElG,OAAO;QACL,UAAU;QACV,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export interface VoiceRecordingConfig {
|
|
7
|
+
sampleRate?: number;
|
|
8
|
+
channels?: number;
|
|
9
|
+
audioFormat?: 'wav' | 'mp3';
|
|
10
|
+
silenceThreshold?: number;
|
|
11
|
+
silenceDuration?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface RecordingResult {
|
|
14
|
+
filePath: string;
|
|
15
|
+
duration: number;
|
|
16
|
+
size: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Service for recording audio from microphone
|
|
20
|
+
* Uses ffmpeg directly for cross-platform audio recording
|
|
21
|
+
*/
|
|
22
|
+
export declare class VoiceRecordingService {
|
|
23
|
+
private readonly sampleRate;
|
|
24
|
+
private readonly channels;
|
|
25
|
+
private readonly audioFormat;
|
|
26
|
+
private ffmpegProcess;
|
|
27
|
+
private outputFilePath;
|
|
28
|
+
private fileStream;
|
|
29
|
+
private startTime;
|
|
30
|
+
private audioStream;
|
|
31
|
+
constructor(config?: VoiceRecordingConfig);
|
|
32
|
+
/**
|
|
33
|
+
* List available audio input devices on Windows using DirectShow
|
|
34
|
+
*/
|
|
35
|
+
private listWindowsAudioDevices;
|
|
36
|
+
/**
|
|
37
|
+
* Get the appropriate ffmpeg input device and format based on platform
|
|
38
|
+
*/
|
|
39
|
+
private getInputDeviceConfig;
|
|
40
|
+
/**
|
|
41
|
+
* Start recording audio from microphone
|
|
42
|
+
* Recording continues until stopRecording() is called
|
|
43
|
+
* @param outputPath Optional custom output path. If not provided, audio will only be streamed via callback
|
|
44
|
+
* @param onAudioChunk Optional callback for streaming audio chunks
|
|
45
|
+
* @returns Promise that resolves with the output file path when recording starts (or empty string if no file)
|
|
46
|
+
*/
|
|
47
|
+
startRecording(outputPath?: string, onAudioChunk?: (chunk: Buffer) => void): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Parse ffmpeg error messages to provide helpful feedback
|
|
50
|
+
*/
|
|
51
|
+
private parseFFmpegError;
|
|
52
|
+
/**
|
|
53
|
+
* Stop the current recording
|
|
54
|
+
* @returns Recording result with file path and metadata (file path will be empty if no file was created)
|
|
55
|
+
*/
|
|
56
|
+
stopRecording(): Promise<RecordingResult>;
|
|
57
|
+
/**
|
|
58
|
+
* Check if recording is currently in progress
|
|
59
|
+
*/
|
|
60
|
+
isRecording(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Cancel the current recording and delete the file if it exists
|
|
63
|
+
*/
|
|
64
|
+
cancelRecording(): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Clean up recording resources
|
|
67
|
+
*/
|
|
68
|
+
private cleanup;
|
|
69
|
+
}
|