erosolar-cli 1.0.2 → 1.0.5
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 +80 -44
- package/agents/erosolar-code.rules.json +167 -0
- package/agents/general.rules.json +188 -0
- package/dist/adapters/browser/index.d.ts +12 -0
- package/dist/adapters/browser/index.d.ts.map +1 -0
- package/dist/adapters/browser/index.js +1 -0
- package/dist/adapters/browser/index.js.map +1 -0
- package/dist/adapters/node/index.d.ts +17 -0
- package/dist/adapters/node/index.d.ts.map +1 -0
- package/dist/adapters/node/index.js +1 -0
- package/dist/adapters/node/index.js.map +1 -0
- package/dist/adapters/remote/index.d.ts +13 -0
- package/dist/adapters/remote/index.d.ts.map +1 -0
- package/dist/adapters/remote/index.js +1 -0
- package/dist/adapters/remote/index.js.map +1 -0
- package/dist/adapters/types.d.ts +14 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +1 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/bin/erosolar.d.ts +3 -0
- package/dist/bin/erosolar.d.ts.map +1 -0
- package/dist/bin/erosolar.js +1 -0
- package/dist/bin/erosolar.js.map +1 -0
- package/dist/capabilities/bashCapability.d.ts +13 -0
- package/dist/capabilities/bashCapability.d.ts.map +1 -0
- package/dist/capabilities/bashCapability.js +1 -0
- package/dist/capabilities/bashCapability.js.map +1 -0
- package/dist/capabilities/codeAnalysisCapability.d.ts +13 -0
- package/dist/capabilities/codeAnalysisCapability.d.ts.map +1 -0
- package/dist/capabilities/codeAnalysisCapability.js +24 -0
- package/dist/capabilities/codeAnalysisCapability.js.map +1 -0
- package/dist/capabilities/codeGenerationCapability.d.ts +13 -0
- package/dist/capabilities/codeGenerationCapability.d.ts.map +1 -0
- package/dist/capabilities/codeGenerationCapability.js +25 -0
- package/dist/capabilities/codeGenerationCapability.js.map +1 -0
- package/dist/capabilities/codeQualityCapability.d.ts +13 -0
- package/dist/capabilities/codeQualityCapability.d.ts.map +1 -0
- package/dist/capabilities/codeQualityCapability.js +25 -0
- package/dist/capabilities/codeQualityCapability.js.map +1 -0
- package/dist/capabilities/dependencySecurityCapability.d.ts +13 -0
- package/dist/capabilities/dependencySecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/dependencySecurityCapability.js +24 -0
- package/dist/capabilities/dependencySecurityCapability.js.map +1 -0
- package/dist/capabilities/devCapability.d.ts +13 -0
- package/dist/capabilities/devCapability.d.ts.map +1 -0
- package/dist/capabilities/devCapability.js +24 -0
- package/dist/capabilities/devCapability.js.map +1 -0
- package/dist/capabilities/filesystemCapability.d.ts +13 -0
- package/dist/capabilities/filesystemCapability.d.ts.map +1 -0
- package/dist/capabilities/filesystemCapability.js +1 -0
- package/dist/capabilities/filesystemCapability.js.map +1 -0
- package/dist/capabilities/index.d.ts +10 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +7 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/refactoringCapability.d.ts +13 -0
- package/dist/capabilities/refactoringCapability.d.ts.map +1 -0
- package/dist/capabilities/refactoringCapability.js +25 -0
- package/dist/capabilities/refactoringCapability.js.map +1 -0
- package/dist/capabilities/repoChecksCapability.d.ts +10 -0
- package/dist/capabilities/repoChecksCapability.d.ts.map +1 -0
- package/dist/capabilities/repoChecksCapability.js +24 -0
- package/dist/capabilities/repoChecksCapability.js.map +1 -0
- package/dist/capabilities/searchCapability.d.ts +13 -0
- package/dist/capabilities/searchCapability.d.ts.map +1 -0
- package/dist/capabilities/searchCapability.js +1 -0
- package/dist/capabilities/searchCapability.js.map +1 -0
- package/dist/capabilities/testingCapability.d.ts +13 -0
- package/dist/capabilities/testingCapability.d.ts.map +1 -0
- package/dist/capabilities/testingCapability.js +25 -0
- package/dist/capabilities/testingCapability.js.map +1 -0
- package/dist/capabilities/toolManifest.d.ts +3 -0
- package/dist/capabilities/toolManifest.d.ts.map +1 -0
- package/dist/capabilities/toolManifest.js +160 -0
- package/dist/capabilities/toolManifest.js.map +1 -0
- package/dist/capabilities/toolRegistry.d.ts +22 -0
- package/dist/capabilities/toolRegistry.d.ts.map +1 -0
- package/dist/capabilities/toolRegistry.js +49 -32
- package/dist/capabilities/toolRegistry.js.map +1 -0
- package/dist/config.d.ts +25 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +103 -23
- package/dist/config.js.map +1 -0
- package/dist/contracts/agent-profiles.schema.json +43 -0
- package/dist/contracts/agent-schemas.json +293 -0
- package/dist/contracts/schemas/agent-profile.schema.json +157 -0
- package/dist/contracts/schemas/agent-rules.schema.json +238 -0
- package/dist/contracts/schemas/agent-schemas.schema.json +528 -0
- package/dist/contracts/schemas/agent.schema.json +89 -0
- package/dist/contracts/schemas/tool-selection.schema.json +174 -0
- package/dist/contracts/tools.schema.json +100 -0
- package/dist/contracts/v1/agent.d.ts +147 -0
- package/dist/contracts/v1/agent.d.ts.map +1 -0
- package/dist/contracts/v1/agent.js +1 -0
- package/dist/contracts/v1/agent.js.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts +60 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.js +9 -0
- package/dist/contracts/v1/agentProfileManifest.js.map +1 -0
- package/dist/contracts/v1/agentRules.d.ts +60 -0
- package/dist/contracts/v1/agentRules.d.ts.map +1 -0
- package/dist/contracts/v1/agentRules.js +10 -0
- package/dist/contracts/v1/agentRules.js.map +1 -0
- package/dist/contracts/v1/provider.d.ts +149 -0
- package/dist/contracts/v1/provider.d.ts.map +1 -0
- package/dist/contracts/v1/provider.js +1 -0
- package/dist/contracts/v1/provider.js.map +1 -0
- package/dist/contracts/v1/tool.d.ts +136 -0
- package/dist/contracts/v1/tool.d.ts.map +1 -0
- package/dist/contracts/v1/tool.js +1 -0
- package/dist/contracts/v1/tool.js.map +1 -0
- package/dist/contracts/v1/toolAccess.d.ts +43 -0
- package/dist/contracts/v1/toolAccess.d.ts.map +1 -0
- package/dist/contracts/v1/toolAccess.js +9 -0
- package/dist/contracts/v1/toolAccess.js.map +1 -0
- package/dist/core/agent.d.ts +35 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +17 -9
- package/dist/core/agent.js.map +1 -0
- package/dist/core/agentProfileManifest.d.ts +3 -0
- package/dist/core/agentProfileManifest.d.ts.map +1 -0
- package/dist/core/agentProfileManifest.js +188 -0
- package/dist/core/agentProfileManifest.js.map +1 -0
- package/dist/core/agentProfiles.d.ts +22 -0
- package/dist/core/agentProfiles.d.ts.map +1 -0
- package/dist/core/agentProfiles.js +1 -0
- package/dist/core/agentProfiles.js.map +1 -0
- package/dist/core/agentRulebook.d.ts +11 -0
- package/dist/core/agentRulebook.d.ts.map +1 -0
- package/dist/core/agentRulebook.js +136 -0
- package/dist/core/agentRulebook.js.map +1 -0
- package/dist/core/agentSchemaLoader.d.ts +131 -0
- package/dist/core/agentSchemaLoader.d.ts.map +1 -0
- package/dist/core/agentSchemaLoader.js +221 -0
- package/dist/core/agentSchemaLoader.js.map +1 -0
- package/dist/core/contextWindow.d.ts +6 -0
- package/dist/core/contextWindow.d.ts.map +1 -0
- package/dist/core/contextWindow.js +1 -0
- package/dist/core/contextWindow.js.map +1 -0
- package/dist/core/errors/apiKeyErrors.d.ts +11 -0
- package/dist/core/errors/apiKeyErrors.d.ts.map +1 -0
- package/dist/core/errors/apiKeyErrors.js +1 -0
- package/dist/core/errors/apiKeyErrors.js.map +1 -0
- package/dist/core/errors.d.ts +4 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +33 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/preferences.d.ts +21 -0
- package/dist/core/preferences.d.ts.map +1 -0
- package/dist/core/preferences.js +13 -7
- package/dist/core/preferences.js.map +1 -0
- package/dist/core/schemaValidator.d.ts +6 -0
- package/dist/core/schemaValidator.d.ts.map +1 -0
- package/dist/core/schemaValidator.js +93 -0
- package/dist/core/schemaValidator.js.map +1 -0
- package/dist/core/secretStore.d.ts +20 -0
- package/dist/core/secretStore.d.ts.map +1 -0
- package/dist/core/secretStore.js +3 -8
- package/dist/core/secretStore.js.map +1 -0
- package/dist/core/toolRuntime.d.ts +42 -0
- package/dist/core/toolRuntime.d.ts.map +1 -0
- package/dist/core/toolRuntime.js +25 -10
- package/dist/core/toolRuntime.js.map +1 -0
- package/dist/core/types.d.ts +86 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +1 -0
- package/dist/core/types.js.map +1 -0
- package/dist/plugins/providers/anthropic/index.d.ts +2 -0
- package/dist/plugins/providers/anthropic/index.d.ts.map +1 -0
- package/dist/plugins/providers/anthropic/index.js +6 -4
- package/dist/plugins/providers/anthropic/index.js.map +1 -0
- package/dist/plugins/providers/deepseek/index.d.ts +2 -0
- package/dist/plugins/providers/deepseek/index.d.ts.map +1 -0
- package/dist/plugins/providers/deepseek/index.js +1 -0
- package/dist/plugins/providers/deepseek/index.js.map +1 -0
- package/dist/plugins/providers/google/index.d.ts +2 -0
- package/dist/plugins/providers/google/index.d.ts.map +1 -0
- package/dist/plugins/providers/google/index.js +6 -4
- package/dist/plugins/providers/google/index.js.map +1 -0
- package/dist/plugins/providers/index.d.ts +2 -0
- package/dist/plugins/providers/index.d.ts.map +1 -0
- package/dist/plugins/providers/index.js +1 -0
- package/dist/plugins/providers/index.js.map +1 -0
- package/dist/plugins/providers/openai/index.d.ts +3 -0
- package/dist/plugins/providers/openai/index.d.ts.map +1 -0
- package/dist/plugins/providers/openai/index.js +6 -4
- package/dist/plugins/providers/openai/index.js.map +1 -0
- package/dist/plugins/providers/xai/index.d.ts +2 -0
- package/dist/plugins/providers/xai/index.d.ts.map +1 -0
- package/dist/plugins/providers/xai/index.js +1 -0
- package/dist/plugins/providers/xai/index.js.map +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.d.ts +3 -0
- package/dist/plugins/tools/bash/localBashPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.js +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.js.map +1 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +3 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js +14 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +1 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +3 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +14 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +1 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +3 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +14 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +1 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +3 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.js +12 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.js.map +1 -0
- package/dist/plugins/tools/development/devPlugin.d.ts +3 -0
- package/dist/plugins/tools/development/devPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/development/devPlugin.js +14 -0
- package/dist/plugins/tools/development/devPlugin.js.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +3 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +1 -0
- package/dist/plugins/tools/index.d.ts +3 -0
- package/dist/plugins/tools/index.d.ts.map +1 -0
- package/dist/plugins/tools/index.js +1 -0
- package/dist/plugins/tools/index.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +2 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -0
- package/dist/plugins/tools/nodeDefaults.js +15 -2
- package/dist/plugins/tools/nodeDefaults.js.map +1 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +3 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.js +12 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +1 -0
- package/dist/plugins/tools/registry.d.ts +22 -0
- package/dist/plugins/tools/registry.d.ts.map +1 -0
- package/dist/plugins/tools/registry.js +1 -0
- package/dist/plugins/tools/registry.js.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts +3 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.js +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.js.map +1 -0
- package/dist/plugins/tools/testing/testingPlugin.d.ts +3 -0
- package/dist/plugins/tools/testing/testingPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/testing/testingPlugin.js +12 -0
- package/dist/plugins/tools/testing/testingPlugin.js.map +1 -0
- package/dist/providers/anthropicProvider.d.ts +23 -0
- package/dist/providers/anthropicProvider.d.ts.map +1 -0
- package/dist/providers/anthropicProvider.js +3 -2
- package/dist/providers/anthropicProvider.js.map +1 -0
- package/dist/providers/googleProvider.d.ts +19 -0
- package/dist/providers/googleProvider.d.ts.map +1 -0
- package/dist/providers/googleProvider.js +1 -1
- package/dist/providers/googleProvider.js.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts +16 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js.map +1 -0
- package/dist/providers/openaiResponsesProvider.d.ts +20 -0
- package/dist/providers/openaiResponsesProvider.d.ts.map +1 -0
- package/dist/providers/openaiResponsesProvider.js +1 -0
- package/dist/providers/openaiResponsesProvider.js.map +1 -0
- package/dist/providers/providerFactory.d.ts +18 -0
- package/dist/providers/providerFactory.d.ts.map +1 -0
- package/dist/providers/providerFactory.js +5 -1
- package/dist/providers/providerFactory.js.map +1 -0
- package/dist/runtime/agentHost.d.ts +61 -0
- package/dist/runtime/agentHost.d.ts.map +1 -0
- package/dist/runtime/agentHost.js +5 -1
- package/dist/runtime/agentHost.js.map +1 -0
- package/dist/runtime/agentSession.d.ts +32 -0
- package/dist/runtime/agentSession.d.ts.map +1 -0
- package/dist/runtime/agentSession.js +17 -1
- package/dist/runtime/agentSession.js.map +1 -0
- package/dist/runtime/browser.d.ts +7 -0
- package/dist/runtime/browser.d.ts.map +1 -0
- package/dist/runtime/browser.js +1 -0
- package/dist/runtime/browser.js.map +1 -0
- package/dist/runtime/cloud.d.ts +7 -0
- package/dist/runtime/cloud.d.ts.map +1 -0
- package/dist/runtime/cloud.js +1 -0
- package/dist/runtime/cloud.js.map +1 -0
- package/dist/runtime/node.d.ts +8 -0
- package/dist/runtime/node.d.ts.map +1 -0
- package/dist/runtime/node.js +1 -0
- package/dist/runtime/node.js.map +1 -0
- package/dist/runtime/universal.d.ts +21 -0
- package/dist/runtime/universal.d.ts.map +1 -0
- package/dist/runtime/universal.js +1 -0
- package/dist/runtime/universal.js.map +1 -0
- package/dist/shell/bracketedPasteManager.d.ts +23 -0
- package/dist/shell/bracketedPasteManager.d.ts.map +1 -0
- package/dist/shell/bracketedPasteManager.js +1 -0
- package/dist/shell/bracketedPasteManager.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +131 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -0
- package/dist/shell/interactiveShell.js +325 -262
- package/dist/shell/interactiveShell.js.map +1 -0
- package/dist/shell/liveStatus.d.ts +29 -0
- package/dist/shell/liveStatus.d.ts.map +1 -0
- package/dist/shell/liveStatus.js +77 -0
- package/dist/shell/liveStatus.js.map +1 -0
- package/dist/shell/promptSkin.d.ts +43 -0
- package/dist/shell/promptSkin.d.ts.map +1 -0
- package/dist/shell/promptSkin.js +330 -0
- package/dist/shell/promptSkin.js.map +1 -0
- package/dist/shell/shellApp.d.ts +10 -0
- package/dist/shell/shellApp.d.ts.map +1 -0
- package/dist/shell/shellApp.js +149 -78
- package/dist/shell/shellApp.js.map +1 -0
- package/dist/shell/systemPrompt.d.ts +3 -0
- package/dist/shell/systemPrompt.d.ts.map +1 -0
- package/dist/shell/systemPrompt.js +64 -0
- package/dist/shell/systemPrompt.js.map +1 -0
- package/dist/shell/updateManager.d.ts +2 -0
- package/dist/shell/updateManager.d.ts.map +1 -0
- package/dist/shell/updateManager.js +109 -0
- package/dist/shell/updateManager.js.map +1 -0
- package/dist/tools/bashTools.d.ts +8 -0
- package/dist/tools/bashTools.d.ts.map +1 -0
- package/dist/tools/bashTools.js +18 -15
- package/dist/tools/bashTools.js.map +1 -0
- package/dist/tools/codeAnalysisTools.d.ts +74 -0
- package/dist/tools/codeAnalysisTools.d.ts.map +1 -0
- package/dist/tools/codeAnalysisTools.js +642 -0
- package/dist/tools/codeAnalysisTools.js.map +1 -0
- package/dist/tools/codeGenerationTools.d.ts +3 -0
- package/dist/tools/codeGenerationTools.d.ts.map +1 -0
- package/dist/tools/codeGenerationTools.js +369 -0
- package/dist/tools/codeGenerationTools.js.map +1 -0
- package/dist/tools/codeQualityTools.d.ts +3 -0
- package/dist/tools/codeQualityTools.d.ts.map +1 -0
- package/dist/tools/codeQualityTools.js +295 -0
- package/dist/tools/codeQualityTools.js.map +1 -0
- package/dist/tools/dependencyTools.d.ts +3 -0
- package/dist/tools/dependencyTools.d.ts.map +1 -0
- package/dist/tools/dependencyTools.js +283 -0
- package/dist/tools/dependencyTools.js.map +1 -0
- package/dist/tools/devTools.d.ts +10 -0
- package/dist/tools/devTools.d.ts.map +1 -0
- package/dist/tools/devTools.js +239 -0
- package/dist/tools/devTools.js.map +1 -0
- package/dist/tools/diffUtils.d.ts +8 -0
- package/dist/tools/diffUtils.d.ts.map +1 -0
- package/dist/tools/diffUtils.js +2 -1
- package/dist/tools/diffUtils.js.map +1 -0
- package/dist/tools/fileTools.d.ts +3 -0
- package/dist/tools/fileTools.d.ts.map +1 -0
- package/dist/tools/fileTools.js +72 -21
- package/dist/tools/fileTools.js.map +1 -0
- package/dist/tools/refactoringTools.d.ts +3 -0
- package/dist/tools/refactoringTools.d.ts.map +1 -0
- package/dist/tools/refactoringTools.js +294 -0
- package/dist/tools/refactoringTools.js.map +1 -0
- package/dist/tools/repoChecksTools.d.ts +3 -0
- package/dist/tools/repoChecksTools.d.ts.map +1 -0
- package/dist/tools/repoChecksTools.js +161 -0
- package/dist/tools/repoChecksTools.js.map +1 -0
- package/dist/tools/searchTools.d.ts +3 -0
- package/dist/tools/searchTools.d.ts.map +1 -0
- package/dist/tools/searchTools.js +50 -22
- package/dist/tools/searchTools.js.map +1 -0
- package/dist/tools/testingTools.d.ts +3 -0
- package/dist/tools/testingTools.d.ts.map +1 -0
- package/dist/tools/testingTools.js +233 -0
- package/dist/tools/testingTools.js.map +1 -0
- package/dist/ui/ShellUIAdapter.d.ts +96 -0
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -0
- package/dist/ui/ShellUIAdapter.js +442 -0
- package/dist/ui/ShellUIAdapter.js.map +1 -0
- package/dist/ui/UnifiedUIController.d.ts +196 -0
- package/dist/ui/UnifiedUIController.d.ts.map +1 -0
- package/dist/ui/UnifiedUIController.js +640 -0
- package/dist/ui/UnifiedUIController.js.map +1 -0
- package/dist/ui/animation/AnimationScheduler.d.ts +192 -0
- package/dist/ui/animation/AnimationScheduler.d.ts.map +1 -0
- package/dist/ui/animation/AnimationScheduler.js +432 -0
- package/dist/ui/animation/AnimationScheduler.js.map +1 -0
- package/dist/ui/codeHighlighter.d.ts +6 -0
- package/dist/ui/codeHighlighter.d.ts.map +1 -0
- package/dist/ui/codeHighlighter.js +41 -29
- package/dist/ui/codeHighlighter.js.map +1 -0
- package/dist/ui/designSystem.d.ts +26 -0
- package/dist/ui/designSystem.d.ts.map +1 -0
- package/dist/ui/designSystem.js +17 -1
- package/dist/ui/designSystem.js.map +1 -0
- package/dist/ui/display.d.ts +160 -0
- package/dist/ui/display.d.ts.map +1 -0
- package/dist/ui/display.js +492 -231
- package/dist/ui/display.js.map +1 -0
- package/dist/ui/interrupts/InterruptManager.d.ts +142 -0
- package/dist/ui/interrupts/InterruptManager.d.ts.map +1 -0
- package/dist/ui/interrupts/InterruptManager.js +439 -0
- package/dist/ui/interrupts/InterruptManager.js.map +1 -0
- package/dist/ui/layout.d.ts +17 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +12 -7
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/orchestration/StatusOrchestrator.d.ts +156 -0
- package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +1 -0
- package/dist/ui/orchestration/StatusOrchestrator.js +405 -0
- package/dist/ui/orchestration/StatusOrchestrator.js.map +1 -0
- package/dist/ui/overlay/OverlayManager.d.ts +105 -0
- package/dist/ui/overlay/OverlayManager.d.ts.map +1 -0
- package/dist/ui/overlay/OverlayManager.js +291 -0
- package/dist/ui/overlay/OverlayManager.js.map +1 -0
- package/dist/ui/richText.d.ts +6 -0
- package/dist/ui/richText.d.ts.map +1 -0
- package/dist/ui/richText.js +13 -4
- package/dist/ui/richText.js.map +1 -0
- package/dist/ui/telemetry/UITelemetry.d.ts +181 -0
- package/dist/ui/telemetry/UITelemetry.d.ts.map +1 -0
- package/dist/ui/telemetry/UITelemetry.js +446 -0
- package/dist/ui/telemetry/UITelemetry.js.map +1 -0
- package/dist/ui/theme.d.ts +77 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +19 -6
- package/dist/ui/theme.js.map +1 -0
- package/dist/utils/errorUtils.d.ts +16 -0
- package/dist/utils/errorUtils.d.ts.map +1 -0
- package/dist/utils/errorUtils.js +66 -0
- package/dist/utils/errorUtils.js.map +1 -0
- package/dist/utils/nodeVersion.d.ts +3 -0
- package/dist/utils/nodeVersion.d.ts.map +1 -0
- package/dist/utils/nodeVersion.js +51 -0
- package/dist/utils/nodeVersion.js.map +1 -0
- package/dist/workspace.d.ts +8 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +72 -11
- package/dist/workspace.js.map +1 -0
- package/package.json +35 -16
- package/scripts/health-check.mjs +176 -0
- package/ARCHITECTURE.json +0 -157
- package/Agents.md +0 -207
- package/SOURCE_OF_TRUTH.json +0 -103
- package/dist/capabilities/tavilyCapability.js +0 -26
- package/dist/plugins/tools/tavily/tavilyPlugin.js +0 -16
- package/dist/shell/__tests__/bracketedPasteManager.test.js +0 -35
- package/dist/tools/tavilyTools.js +0 -176
- package/dist/ui/__tests__/richText.test.js +0 -36
|
@@ -3,37 +3,15 @@ import { stdin as input, stdout as output, exit } from 'node:process';
|
|
|
3
3
|
import { display } from '../ui/display.js';
|
|
4
4
|
import { formatUserPrompt, theme } from '../ui/theme.js';
|
|
5
5
|
import { getContextWindowTokens } from '../core/contextWindow.js';
|
|
6
|
-
import { ensureSecretForProvider, getSecretValue, listSecretDefinitions, maskSecret, setSecretValue, } from '../core/secretStore.js';
|
|
6
|
+
import { ensureSecretForProvider, getSecretDefinitionForProvider, getSecretValue, listSecretDefinitions, maskSecret, setSecretValue, } from '../core/secretStore.js';
|
|
7
7
|
import { saveActiveProfilePreference, saveModelPreference, loadToolSettings, saveToolSettings, clearToolSettings, clearActiveProfilePreference, } from '../core/preferences.js';
|
|
8
|
-
import { buildEnabledToolSet, getToolToggleOptions, } from '../capabilities/toolRegistry.js';
|
|
8
|
+
import { buildEnabledToolSet, evaluateToolPermissions, getToolToggleOptions, } from '../capabilities/toolRegistry.js';
|
|
9
9
|
import { BracketedPasteManager } from './bracketedPasteManager.js';
|
|
10
|
+
import { PromptSkin } from './promptSkin.js';
|
|
10
11
|
import { detectApiKeyError } from '../core/errors/apiKeyErrors.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
label: 'Direct',
|
|
15
|
-
description: 'Fast edits with minimal narration or visible reasoning.',
|
|
16
|
-
instruction: 'Operate in direct mode: answer concisely, skip verbose reasoning, and surface only the minimum context needed before giving the final response.',
|
|
17
|
-
reasoningEffort: 'low',
|
|
18
|
-
textVerbosity: 'low',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
id: 'balanced',
|
|
22
|
-
label: 'Balanced',
|
|
23
|
-
description: 'Blend short reasoning snippets with actionable guidance.',
|
|
24
|
-
instruction: 'Operate in balanced mode: share a couple of focused reasoning bullets before the final answer so the operator can follow along.',
|
|
25
|
-
reasoningEffort: 'medium',
|
|
26
|
-
textVerbosity: 'medium',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: 'deep',
|
|
30
|
-
label: 'Deep',
|
|
31
|
-
description: 'Full investigative reasoning for gnarly bugs or planning.',
|
|
32
|
-
instruction: 'Operate in deep thinking mode: narrate a careful, multi-step reasoning path before finalizing, especially when analyzing complex code paths.',
|
|
33
|
-
reasoningEffort: 'high',
|
|
34
|
-
textVerbosity: 'high',
|
|
35
|
-
},
|
|
36
|
-
];
|
|
12
|
+
import { buildWorkspaceContext } from '../workspace.js';
|
|
13
|
+
import { buildInteractiveSystemPrompt } from './systemPrompt.js';
|
|
14
|
+
import { getModels, getSlashCommands, getProviders } from '../core/agentSchemaLoader.js';
|
|
37
15
|
const DROPDOWN_COLORS = [
|
|
38
16
|
theme.primary,
|
|
39
17
|
theme.info,
|
|
@@ -42,124 +20,23 @@ const DROPDOWN_COLORS = [
|
|
|
42
20
|
theme.success,
|
|
43
21
|
theme.warning,
|
|
44
22
|
];
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
provider: 'openai',
|
|
63
|
-
description: 'OpenAI\'s flagship GPT-5 Pro for maximum depth and planning.',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: 'gpt-5-mini',
|
|
67
|
-
label: 'gpt-5-mini',
|
|
68
|
-
provider: 'openai',
|
|
69
|
-
description: 'GPT-5 Mini with faster turnarounds while staying code-aware.',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: 'gpt-5-nano',
|
|
73
|
-
label: 'gpt-5-nano',
|
|
74
|
-
provider: 'openai',
|
|
75
|
-
description: 'Ultra-responsive GPT-5 Nano tuned for edits and quick summaries.',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
id: 'claude-sonnet-4-5-20250929',
|
|
79
|
-
label: 'sonnet-4.5',
|
|
80
|
-
provider: 'anthropic',
|
|
81
|
-
description: 'Anthropic Sonnet 4.5 tuned for deeper planning across large repositories.',
|
|
82
|
-
temperature: 0.7,
|
|
83
|
-
maxTokens: 4096,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: 'claude-opus-4.1',
|
|
87
|
-
label: 'opus-4.1',
|
|
88
|
-
provider: 'anthropic',
|
|
89
|
-
description: 'Anthropic Opus 4.1 for the richest Claude reasoning runs.',
|
|
90
|
-
temperature: 0.7,
|
|
91
|
-
maxTokens: 4096,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: 'claude-haiku-4.5',
|
|
95
|
-
label: 'haiku-4.5',
|
|
96
|
-
provider: 'anthropic',
|
|
97
|
-
description: 'Anthropic Haiku 4.5 focused on latency-sensitive workflows.',
|
|
98
|
-
temperature: 0.5,
|
|
99
|
-
maxTokens: 4096,
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
id: 'deepseek-reasoner',
|
|
103
|
-
label: 'deepseek-reasoner',
|
|
104
|
-
provider: 'deepseek',
|
|
105
|
-
description: 'DeepSeek Reasoner for chain-of-thought exploration with tool depth.',
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
id: 'deepseek-chat',
|
|
109
|
-
label: 'deepseek-chat',
|
|
110
|
-
provider: 'deepseek',
|
|
111
|
-
description: 'DeepSeek Chat for faster interactive editing and summarization.',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
id: 'grok-4',
|
|
115
|
-
label: 'grok-4',
|
|
116
|
-
provider: 'xai',
|
|
117
|
-
description: 'xAI Grok-4 for their highest quality coding and reasoning responses.',
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: 'grok-4-fast-reasoning',
|
|
121
|
-
label: 'grok-4-fast-reasoning',
|
|
122
|
-
provider: 'xai',
|
|
123
|
-
description: 'Grok-4 fast reasoning mode when you need lower latency with thinking enabled.',
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
id: 'grok-4-fast-non-reasoning',
|
|
127
|
-
label: 'grok-4-fast-non-reasoning',
|
|
128
|
-
provider: 'xai',
|
|
129
|
-
description: 'Grok-4 fast non reasoning variant for concise edits and summaries.',
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
id: 'grok-code-fast-1',
|
|
133
|
-
label: 'grok-code-fast-1',
|
|
134
|
-
provider: 'xai',
|
|
135
|
-
description: 'xAI Grok Code Fast 1 tuned specifically for rapid coding assistance.',
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
id: 'gemini-2.5-pro',
|
|
139
|
-
label: 'gemini-2.5-pro',
|
|
140
|
-
provider: 'google',
|
|
141
|
-
description: 'Google Gemini 2.5 Pro for multimodal deep reasoning with longer outputs.',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: 'gemini-2.5-flash',
|
|
145
|
-
label: 'gemini-2.5-flash',
|
|
146
|
-
provider: 'google',
|
|
147
|
-
description: 'Google Gemini 2.5 Flash for lower-latency edits and iterative coding.',
|
|
148
|
-
},
|
|
149
|
-
];
|
|
150
|
-
const BASE_SLASH_COMMANDS = [
|
|
151
|
-
{ command: '/model', description: 'Choose what model to use' },
|
|
152
|
-
{ command: '/secrets', description: 'Configure API keys' },
|
|
153
|
-
{ command: '/tools', description: 'Enable or disable CLI tools' },
|
|
154
|
-
];
|
|
155
|
-
const PROVIDER_LABELS = {
|
|
156
|
-
openai: 'OpenAI',
|
|
157
|
-
anthropic: 'Anthropic',
|
|
158
|
-
deepseek: 'DeepSeek',
|
|
159
|
-
xai: 'xAI',
|
|
160
|
-
tavily: 'Tavily',
|
|
161
|
-
google: 'Google Gemini',
|
|
162
|
-
};
|
|
23
|
+
// Load MODEL_PRESETS from centralized schema
|
|
24
|
+
const MODEL_PRESETS = getModels().map((model) => ({
|
|
25
|
+
id: model.id,
|
|
26
|
+
label: model.label,
|
|
27
|
+
provider: model.provider,
|
|
28
|
+
description: model.description ?? '',
|
|
29
|
+
reasoningEffort: model.reasoningEffort,
|
|
30
|
+
temperature: model.temperature,
|
|
31
|
+
maxTokens: model.maxTokens,
|
|
32
|
+
}));
|
|
33
|
+
// Load BASE_SLASH_COMMANDS from centralized schema
|
|
34
|
+
const BASE_SLASH_COMMANDS = getSlashCommands().map((cmd) => ({
|
|
35
|
+
command: cmd.command,
|
|
36
|
+
description: cmd.description,
|
|
37
|
+
}));
|
|
38
|
+
// Load PROVIDER_LABELS from centralized schema
|
|
39
|
+
const PROVIDER_LABELS = Object.fromEntries(getProviders().map((provider) => [provider.id, provider.label]));
|
|
163
40
|
const MULTILINE_INPUT_FLUSH_DELAY_MS = 30;
|
|
164
41
|
const BRACKETED_PASTE_ENABLE = '\u001b[?2004h';
|
|
165
42
|
const BRACKETED_PASTE_DISABLE = '\u001b[?2004l';
|
|
@@ -180,8 +57,8 @@ export class InteractiveShell {
|
|
|
180
57
|
profileLabel;
|
|
181
58
|
workingDir;
|
|
182
59
|
runtimeSession;
|
|
183
|
-
toolContext;
|
|
184
60
|
baseSystemPrompt;
|
|
61
|
+
workspaceOptions;
|
|
185
62
|
sessionState;
|
|
186
63
|
isProcessing = false;
|
|
187
64
|
pendingInteraction = null;
|
|
@@ -198,25 +75,31 @@ export class InteractiveShell {
|
|
|
198
75
|
agentMenu;
|
|
199
76
|
slashCommands;
|
|
200
77
|
bannerSessionState = null;
|
|
78
|
+
promptSkin;
|
|
79
|
+
statusTracker;
|
|
80
|
+
uiAdapter;
|
|
81
|
+
statusSubscription = null;
|
|
82
|
+
activeContextWindowTokens = null;
|
|
83
|
+
promptSkinOutputDisposer = null;
|
|
201
84
|
constructor(config) {
|
|
202
85
|
this.profile = config.profile;
|
|
203
86
|
this.profileLabel = config.profileLabel;
|
|
204
87
|
this.workingDir = config.workingDir;
|
|
205
88
|
this.runtimeSession = config.session;
|
|
206
|
-
this.toolContext = this.runtimeSession.toolContext;
|
|
207
89
|
this.baseSystemPrompt = config.baseSystemPrompt;
|
|
90
|
+
this.workspaceOptions = { ...config.workspaceOptions };
|
|
208
91
|
this.sessionState = {
|
|
209
92
|
provider: config.initialModel.provider,
|
|
210
93
|
model: config.initialModel.model,
|
|
211
94
|
temperature: config.initialModel.temperature,
|
|
212
95
|
maxTokens: config.initialModel.maxTokens,
|
|
213
|
-
|
|
96
|
+
reasoningEffort: config.initialModel.reasoningEffort,
|
|
214
97
|
};
|
|
98
|
+
this.applyPresetReasoningDefaults();
|
|
215
99
|
// The welcome banner only includes model + provider on launch, so mark that as the initial state.
|
|
216
100
|
this.bannerSessionState = {
|
|
217
101
|
model: this.sessionState.model,
|
|
218
102
|
provider: this.sessionState.provider,
|
|
219
|
-
thoughtLabel: undefined,
|
|
220
103
|
};
|
|
221
104
|
this.agentMenu = config.agentSelection ?? null;
|
|
222
105
|
this.slashCommands = [...BASE_SLASH_COMMANDS];
|
|
@@ -226,12 +109,22 @@ export class InteractiveShell {
|
|
|
226
109
|
description: 'Select the default agent profile (applies on next launch)',
|
|
227
110
|
});
|
|
228
111
|
}
|
|
112
|
+
this.statusTracker = config.statusTracker;
|
|
113
|
+
this.uiAdapter = config.uiAdapter;
|
|
229
114
|
this.rl = readline.createInterface({
|
|
230
115
|
input,
|
|
231
116
|
output,
|
|
232
117
|
prompt: formatUserPrompt(this.profileLabel || this.profile),
|
|
233
118
|
terminal: true,
|
|
234
119
|
});
|
|
120
|
+
this.promptSkin = new PromptSkin(this.rl);
|
|
121
|
+
// Keep legacy components for backward compatibility during transition
|
|
122
|
+
this.promptSkinOutputDisposer = display.registerOutputInterceptor({
|
|
123
|
+
beforeWrite: () => this.promptSkin.beginOutput(),
|
|
124
|
+
afterWrite: () => this.promptSkin.endOutput(),
|
|
125
|
+
});
|
|
126
|
+
this.setupStatusTracking();
|
|
127
|
+
this.refreshContextGauge();
|
|
235
128
|
this.bracketedPasteEnabled = this.enableBracketedPasteMode();
|
|
236
129
|
this.bracketedPaste = new BracketedPasteManager(this.bracketedPasteEnabled);
|
|
237
130
|
this.rebuildAgent();
|
|
@@ -241,7 +134,9 @@ export class InteractiveShell {
|
|
|
241
134
|
async start(initialPrompt) {
|
|
242
135
|
if (initialPrompt) {
|
|
243
136
|
display.newLine();
|
|
137
|
+
this.promptSkin.beginOutput();
|
|
244
138
|
console.log(`${formatUserPrompt(this.profileLabel || this.profile)}${initialPrompt}`);
|
|
139
|
+
this.promptSkin.endOutput();
|
|
245
140
|
await this.processInputBlock(initialPrompt);
|
|
246
141
|
return;
|
|
247
142
|
}
|
|
@@ -386,8 +281,25 @@ export class InteractiveShell {
|
|
|
386
281
|
});
|
|
387
282
|
this.rl.on('close', () => {
|
|
388
283
|
this.disableBracketedPasteMode();
|
|
284
|
+
this.teardownStatusTracking();
|
|
285
|
+
if (this.promptSkinOutputDisposer) {
|
|
286
|
+
this.promptSkinOutputDisposer();
|
|
287
|
+
this.promptSkinOutputDisposer = null;
|
|
288
|
+
}
|
|
289
|
+
this.promptSkin.dispose();
|
|
290
|
+
// Dispose unified UI adapter
|
|
291
|
+
this.uiAdapter.dispose();
|
|
389
292
|
display.newLine();
|
|
390
|
-
|
|
293
|
+
const highlightedEmail = theme.info('support@ero.solar');
|
|
294
|
+
const infoMessage = [
|
|
295
|
+
'Made available for defensive and offensive security operations.',
|
|
296
|
+
'',
|
|
297
|
+
'Learn more:',
|
|
298
|
+
'https://www.anthropic.com/news/disrupting-AI-espionage',
|
|
299
|
+
'',
|
|
300
|
+
`Email ${highlightedEmail} with any bugs or feedback`,
|
|
301
|
+
].join('\n');
|
|
302
|
+
display.showInfo(infoMessage);
|
|
391
303
|
exit(0);
|
|
392
304
|
});
|
|
393
305
|
this.setupSlashCommandPreviewHandler();
|
|
@@ -402,6 +314,40 @@ export class InteractiveShell {
|
|
|
402
314
|
this.handleSlashCommandPreviewChange();
|
|
403
315
|
});
|
|
404
316
|
}
|
|
317
|
+
setupStatusTracking() {
|
|
318
|
+
this.statusSubscription = this.statusTracker.subscribe((state) => {
|
|
319
|
+
this.promptSkin.setStatus(state);
|
|
320
|
+
});
|
|
321
|
+
this.setIdleStatus();
|
|
322
|
+
}
|
|
323
|
+
teardownStatusTracking() {
|
|
324
|
+
if (this.statusSubscription) {
|
|
325
|
+
this.statusSubscription();
|
|
326
|
+
this.statusSubscription = null;
|
|
327
|
+
}
|
|
328
|
+
this.statusTracker.reset();
|
|
329
|
+
}
|
|
330
|
+
setIdleStatus(detail) {
|
|
331
|
+
this.statusTracker.setBase('Ready for prompts', {
|
|
332
|
+
detail: detail ?? this.describeModelDetail(),
|
|
333
|
+
tone: 'success',
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
setProcessingStatus(detail) {
|
|
337
|
+
this.statusTracker.setBase('Working on your request', {
|
|
338
|
+
detail: detail ?? this.describeModelDetail(),
|
|
339
|
+
tone: 'info',
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
describeModelDetail() {
|
|
343
|
+
const provider = this.providerLabel(this.sessionState.provider);
|
|
344
|
+
return `${provider} · ${this.sessionState.model}`;
|
|
345
|
+
}
|
|
346
|
+
refreshContextGauge() {
|
|
347
|
+
const tokens = getContextWindowTokens(this.sessionState.model);
|
|
348
|
+
this.activeContextWindowTokens =
|
|
349
|
+
typeof tokens === 'number' && Number.isFinite(tokens) ? tokens : null;
|
|
350
|
+
}
|
|
405
351
|
handleSlashCommandPreviewChange() {
|
|
406
352
|
if (this.pendingInteraction || this.awaitingPasteConfirmation) {
|
|
407
353
|
this.slashPreviewVisible = false;
|
|
@@ -415,6 +361,7 @@ export class InteractiveShell {
|
|
|
415
361
|
}
|
|
416
362
|
if (!shouldShow && this.slashPreviewVisible) {
|
|
417
363
|
this.slashPreviewVisible = false;
|
|
364
|
+
this.uiAdapter.hideSlashCommandPreview();
|
|
418
365
|
}
|
|
419
366
|
}
|
|
420
367
|
shouldShowSlashCommandPreview() {
|
|
@@ -428,6 +375,9 @@ export class InteractiveShell {
|
|
|
428
375
|
showSlashCommandPreview() {
|
|
429
376
|
const preview = this.buildSlashCommandList('Slash Commands:');
|
|
430
377
|
display.showSystemMessage(preview);
|
|
378
|
+
// Also show in the unified UI
|
|
379
|
+
const commands = this.slashCommands.map(cmd => cmd.command);
|
|
380
|
+
this.uiAdapter.showSlashCommandPreview(commands);
|
|
431
381
|
this.rl.prompt(true);
|
|
432
382
|
}
|
|
433
383
|
enqueueUserInput(line, flushImmediately = false) {
|
|
@@ -466,6 +416,7 @@ export class InteractiveShell {
|
|
|
466
416
|
}
|
|
467
417
|
async processInputBlock(line, wasRapidMultiLine = false) {
|
|
468
418
|
this.slashPreviewVisible = false;
|
|
419
|
+
this.uiAdapter.hideSlashCommandPreview();
|
|
469
420
|
const trimmed = line.trim();
|
|
470
421
|
if (await this.handlePendingInteraction(trimmed)) {
|
|
471
422
|
return;
|
|
@@ -533,9 +484,6 @@ export class InteractiveShell {
|
|
|
533
484
|
case 'model':
|
|
534
485
|
await this.handleModelSelection(input);
|
|
535
486
|
return true;
|
|
536
|
-
case 'thought-level':
|
|
537
|
-
await this.handleThoughtLevelSelection(input);
|
|
538
|
-
return true;
|
|
539
487
|
case 'secret-select':
|
|
540
488
|
await this.handleSecretSelection(input);
|
|
541
489
|
return true;
|
|
@@ -564,6 +512,15 @@ export class InteractiveShell {
|
|
|
564
512
|
case '/tools':
|
|
565
513
|
this.showToolsMenu();
|
|
566
514
|
break;
|
|
515
|
+
case '/doctor':
|
|
516
|
+
this.runDoctor();
|
|
517
|
+
break;
|
|
518
|
+
case '/checks':
|
|
519
|
+
await this.runRepoChecksCommand();
|
|
520
|
+
break;
|
|
521
|
+
case '/context':
|
|
522
|
+
await this.refreshWorkspaceContextCommand(input);
|
|
523
|
+
break;
|
|
567
524
|
case '/agents':
|
|
568
525
|
this.showAgentsMenu();
|
|
569
526
|
break;
|
|
@@ -581,6 +538,143 @@ export class InteractiveShell {
|
|
|
581
538
|
];
|
|
582
539
|
display.showSystemMessage(info.join('\n'));
|
|
583
540
|
}
|
|
541
|
+
runDoctor() {
|
|
542
|
+
const lines = [];
|
|
543
|
+
lines.push(theme.bold('Environment diagnostics'));
|
|
544
|
+
lines.push('');
|
|
545
|
+
lines.push(`${theme.secondary('Workspace')}: ${this.workingDir}`);
|
|
546
|
+
lines.push('');
|
|
547
|
+
lines.push(theme.bold('Provider credentials'));
|
|
548
|
+
const providerDefinition = getSecretDefinitionForProvider(this.sessionState.provider);
|
|
549
|
+
if (providerDefinition) {
|
|
550
|
+
const currentValue = getSecretValue(providerDefinition.id);
|
|
551
|
+
if (currentValue) {
|
|
552
|
+
lines.push(`${theme.success('✓')} ${providerDefinition.label} configured (${providerDefinition.envVar}).`);
|
|
553
|
+
}
|
|
554
|
+
else {
|
|
555
|
+
lines.push(`${theme.warning('⚠')} Missing ${providerDefinition.label} (${providerDefinition.envVar}). Run /secrets to configure it.`);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
else {
|
|
559
|
+
lines.push(`${theme.secondary('•')} ${this.providerLabel(this.sessionState.provider)} does not require an API key.`);
|
|
560
|
+
}
|
|
561
|
+
lines.push('');
|
|
562
|
+
lines.push(theme.bold('Tool suites'));
|
|
563
|
+
const toolSettings = loadToolSettings();
|
|
564
|
+
const selection = buildEnabledToolSet(toolSettings);
|
|
565
|
+
const permissions = evaluateToolPermissions(selection);
|
|
566
|
+
const options = getToolToggleOptions();
|
|
567
|
+
const enabledLabels = options
|
|
568
|
+
.filter((option) => selection.has(option.id))
|
|
569
|
+
.map((option) => option.label);
|
|
570
|
+
lines.push(`Enabled: ${enabledLabels.length ? enabledLabels.join(', ') : 'none'}`);
|
|
571
|
+
if (!permissions.warnings.length) {
|
|
572
|
+
lines.push(theme.success('All enabled suites loaded successfully.'));
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
lines.push(theme.warning('Issues detected:'));
|
|
576
|
+
for (const warning of permissions.warnings) {
|
|
577
|
+
const detail = this.describeToolWarning(warning);
|
|
578
|
+
lines.push(` - ${detail}`);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
display.showSystemMessage(lines.join('\n'));
|
|
582
|
+
}
|
|
583
|
+
async runRepoChecksCommand() {
|
|
584
|
+
if (this.isProcessing) {
|
|
585
|
+
display.showWarning('Wait for the active response to finish before running checks.');
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
const call = {
|
|
589
|
+
id: 'manual-run-repo-checks',
|
|
590
|
+
name: 'run_repo_checks',
|
|
591
|
+
arguments: {},
|
|
592
|
+
};
|
|
593
|
+
display.showInfo('Running repo checks (npm test/build/lint when available)...');
|
|
594
|
+
const output = await this.runtimeSession.toolRuntime.execute(call);
|
|
595
|
+
display.showSystemMessage(output);
|
|
596
|
+
}
|
|
597
|
+
async refreshWorkspaceContextCommand(input) {
|
|
598
|
+
if (this.isProcessing) {
|
|
599
|
+
display.showWarning('Wait for the active response to finish before refreshing the snapshot.');
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
const { overrides, error } = this.parseContextOverrideTokens(input);
|
|
603
|
+
if (error) {
|
|
604
|
+
display.showWarning(`${error} ${this.describeContextOverrideUsage()}`);
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
if (overrides) {
|
|
608
|
+
this.workspaceOptions = { ...this.workspaceOptions, ...overrides };
|
|
609
|
+
}
|
|
610
|
+
display.showInfo('Refreshing workspace snapshot...');
|
|
611
|
+
const context = buildWorkspaceContext(this.workingDir, this.workspaceOptions);
|
|
612
|
+
const profileConfig = this.runtimeSession.refreshWorkspaceContext(context);
|
|
613
|
+
const tools = this.runtimeSession.toolRuntime.listProviderTools();
|
|
614
|
+
this.baseSystemPrompt = buildInteractiveSystemPrompt(profileConfig.systemPrompt, profileConfig.label, tools);
|
|
615
|
+
if (this.rebuildAgent()) {
|
|
616
|
+
display.showInfo(`Workspace snapshot refreshed (${this.describeWorkspaceOptions()}).`);
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
display.showWarning('Workspace snapshot refreshed, but the agent failed to rebuild. Run /doctor for details.');
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
parseContextOverrideTokens(input) {
|
|
623
|
+
const overrides = {};
|
|
624
|
+
let hasOverride = false;
|
|
625
|
+
const tokens = input
|
|
626
|
+
.trim()
|
|
627
|
+
.split(/\s+/)
|
|
628
|
+
.slice(1);
|
|
629
|
+
for (const token of tokens) {
|
|
630
|
+
if (!token) {
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
const [rawKey, rawValue] = token.split('=');
|
|
634
|
+
if (!rawKey || !rawValue) {
|
|
635
|
+
return { overrides: null, error: `Invalid option "${token}".` };
|
|
636
|
+
}
|
|
637
|
+
const key = rawKey.toLowerCase();
|
|
638
|
+
const value = Number.parseInt(rawValue, 10);
|
|
639
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
640
|
+
return { overrides: null, error: `Value for "${key}" must be a positive integer.` };
|
|
641
|
+
}
|
|
642
|
+
switch (key) {
|
|
643
|
+
case 'depth':
|
|
644
|
+
overrides.treeDepth = value;
|
|
645
|
+
hasOverride = true;
|
|
646
|
+
break;
|
|
647
|
+
case 'entries':
|
|
648
|
+
overrides.maxEntries = value;
|
|
649
|
+
hasOverride = true;
|
|
650
|
+
break;
|
|
651
|
+
case 'excerpt':
|
|
652
|
+
case 'doc':
|
|
653
|
+
case 'docs':
|
|
654
|
+
overrides.docExcerptLimit = value;
|
|
655
|
+
hasOverride = true;
|
|
656
|
+
break;
|
|
657
|
+
default:
|
|
658
|
+
return { overrides: null, error: `Unknown option "${key}".` };
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
return { overrides: hasOverride ? overrides : null };
|
|
662
|
+
}
|
|
663
|
+
describeWorkspaceOptions() {
|
|
664
|
+
const depth = this.workspaceOptions.treeDepth ?? 'default';
|
|
665
|
+
const entries = this.workspaceOptions.maxEntries ?? 'default';
|
|
666
|
+
const excerpt = this.workspaceOptions.docExcerptLimit ?? 'default';
|
|
667
|
+
return `depth=${depth}, entries=${entries}, excerpt=${excerpt}`;
|
|
668
|
+
}
|
|
669
|
+
describeContextOverrideUsage() {
|
|
670
|
+
return 'Usage: /context [depth=<n>] [entries=<n>] [excerpt=<n>]';
|
|
671
|
+
}
|
|
672
|
+
describeToolWarning(warning) {
|
|
673
|
+
if (warning.reason === 'missing-secret' && warning.secretId) {
|
|
674
|
+
return `${warning.label}: missing ${warning.secretId}. Use /secrets to configure it.`;
|
|
675
|
+
}
|
|
676
|
+
return `${warning.label}: ${warning.reason}.`;
|
|
677
|
+
}
|
|
584
678
|
buildSlashCommandList(header) {
|
|
585
679
|
const lines = [theme.gradient.primary(header), ''];
|
|
586
680
|
for (const command of this.slashCommands) {
|
|
@@ -649,34 +743,6 @@ export class InteractiveShell {
|
|
|
649
743
|
display.showSystemMessage(lines.join('\n'));
|
|
650
744
|
this.pendingInteraction = { type: 'model', provider: option.provider, options: models };
|
|
651
745
|
}
|
|
652
|
-
showThoughtLevelMenu(preset) {
|
|
653
|
-
const options = preset.thoughtLevels ?? [];
|
|
654
|
-
if (!options.length) {
|
|
655
|
-
return;
|
|
656
|
-
}
|
|
657
|
-
const lines = [
|
|
658
|
-
theme.bold(`Select a thought level for ${preset.label}:`),
|
|
659
|
-
...options.map((option, index) => {
|
|
660
|
-
const isCurrent = this.sessionState.model === preset.id && this.sessionState.thoughtLevel?.id === option.id;
|
|
661
|
-
const label = this.colorizeDropdownLine(`${index + 1}. ${option.label}`, index);
|
|
662
|
-
const suffix = isCurrent ? ` ${theme.primary('• current')}` : '';
|
|
663
|
-
const description = this.colorizeDropdownLine(` ${option.description}`, index);
|
|
664
|
-
return `${label}${suffix}\n${description}`;
|
|
665
|
-
}),
|
|
666
|
-
'Type the number of the thought level to use it, type "back" to pick another model, or type "cancel".',
|
|
667
|
-
];
|
|
668
|
-
display.showSystemMessage(lines.join('\n'));
|
|
669
|
-
this.pendingInteraction = { type: 'thought-level', preset, options };
|
|
670
|
-
}
|
|
671
|
-
showModelsForProvider(providerId) {
|
|
672
|
-
const providerOptions = this.buildProviderOptions();
|
|
673
|
-
const target = providerOptions.find((entry) => entry.provider === providerId);
|
|
674
|
-
if (target) {
|
|
675
|
-
this.showProviderModels(target);
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
678
|
-
this.showModelMenu();
|
|
679
|
-
}
|
|
680
746
|
showSecretsMenu() {
|
|
681
747
|
const definitions = listSecretDefinitions();
|
|
682
748
|
const lines = [
|
|
@@ -836,77 +902,27 @@ export class InteractiveShell {
|
|
|
836
902
|
return;
|
|
837
903
|
}
|
|
838
904
|
this.pendingInteraction = null;
|
|
839
|
-
if (preset.thoughtLevels && preset.thoughtLevels.length > 0) {
|
|
840
|
-
this.showThoughtLevelMenu(preset);
|
|
841
|
-
this.rl.prompt();
|
|
842
|
-
return;
|
|
843
|
-
}
|
|
844
905
|
await this.applyModelPreset(preset);
|
|
845
906
|
this.rl.prompt();
|
|
846
907
|
}
|
|
847
|
-
async
|
|
848
|
-
const pending = this.pendingInteraction;
|
|
849
|
-
if (!pending || pending.type !== 'thought-level') {
|
|
850
|
-
return;
|
|
851
|
-
}
|
|
852
|
-
const trimmed = input.trim();
|
|
853
|
-
if (!trimmed) {
|
|
854
|
-
display.showWarning('Enter a number, type "back", or type "cancel".');
|
|
855
|
-
this.rl.prompt();
|
|
856
|
-
return;
|
|
857
|
-
}
|
|
858
|
-
const normalized = trimmed.toLowerCase();
|
|
859
|
-
if (normalized === 'back') {
|
|
860
|
-
this.pendingInteraction = null;
|
|
861
|
-
this.showModelsForProvider(pending.preset.provider);
|
|
862
|
-
this.rl.prompt();
|
|
863
|
-
return;
|
|
864
|
-
}
|
|
865
|
-
if (normalized === 'cancel') {
|
|
866
|
-
this.pendingInteraction = null;
|
|
867
|
-
display.showInfo('Thought level selection cancelled.');
|
|
868
|
-
this.rl.prompt();
|
|
869
|
-
return;
|
|
870
|
-
}
|
|
871
|
-
const choice = Number.parseInt(trimmed, 10);
|
|
872
|
-
if (!Number.isFinite(choice)) {
|
|
873
|
-
display.showWarning('Please enter a valid number.');
|
|
874
|
-
this.rl.prompt();
|
|
875
|
-
return;
|
|
876
|
-
}
|
|
877
|
-
const option = pending.options[choice - 1];
|
|
878
|
-
if (!option) {
|
|
879
|
-
display.showWarning('That option is not available.');
|
|
880
|
-
this.rl.prompt();
|
|
881
|
-
return;
|
|
882
|
-
}
|
|
883
|
-
this.pendingInteraction = null;
|
|
884
|
-
await this.applyModelPreset(pending.preset, option);
|
|
885
|
-
this.rl.prompt();
|
|
886
|
-
}
|
|
887
|
-
async applyModelPreset(preset, thoughtLevel) {
|
|
908
|
+
async applyModelPreset(preset) {
|
|
888
909
|
try {
|
|
889
910
|
ensureSecretForProvider(preset.provider);
|
|
890
911
|
}
|
|
891
912
|
catch (error) {
|
|
892
|
-
this.handleAgentSetupError(error, () => this.applyModelPreset(preset
|
|
913
|
+
this.handleAgentSetupError(error, () => this.applyModelPreset(preset), preset.provider);
|
|
893
914
|
return;
|
|
894
915
|
}
|
|
895
|
-
const existingThoughtLevelId = this.sessionState.thoughtLevel?.id;
|
|
896
|
-
const resolvedThoughtLevel = thoughtLevel ??
|
|
897
|
-
(preset.thoughtLevels?.length && existingThoughtLevelId
|
|
898
|
-
? preset.thoughtLevels.find((option) => option.id === existingThoughtLevelId)
|
|
899
|
-
: undefined);
|
|
900
916
|
this.sessionState = {
|
|
901
917
|
provider: preset.provider,
|
|
902
918
|
model: preset.id,
|
|
903
919
|
temperature: preset.temperature,
|
|
904
920
|
maxTokens: preset.maxTokens,
|
|
905
|
-
|
|
921
|
+
reasoningEffort: preset.reasoningEffort,
|
|
906
922
|
};
|
|
923
|
+
this.applyPresetReasoningDefaults();
|
|
907
924
|
if (this.rebuildAgent()) {
|
|
908
|
-
|
|
909
|
-
display.showInfo(`Switched to ${preset.label}${suffix}.`);
|
|
925
|
+
display.showInfo(`Switched to ${preset.label}.`);
|
|
910
926
|
this.refreshBannerSessionInfo();
|
|
911
927
|
this.persistSessionPreference();
|
|
912
928
|
}
|
|
@@ -997,8 +1013,12 @@ export class InteractiveShell {
|
|
|
997
1013
|
return;
|
|
998
1014
|
}
|
|
999
1015
|
this.isProcessing = true;
|
|
1016
|
+
this.promptSkin.setOverlayVisible(false);
|
|
1017
|
+
this.uiAdapter.startProcessing('Working on your request');
|
|
1018
|
+
this.setProcessingStatus();
|
|
1000
1019
|
try {
|
|
1001
1020
|
display.newLine();
|
|
1021
|
+
display.showThinking('Working on your request...');
|
|
1002
1022
|
await agent.send(request);
|
|
1003
1023
|
await this.awaitPendingCleanup();
|
|
1004
1024
|
}
|
|
@@ -1009,7 +1029,11 @@ export class InteractiveShell {
|
|
|
1009
1029
|
}
|
|
1010
1030
|
}
|
|
1011
1031
|
finally {
|
|
1032
|
+
display.stopThinking();
|
|
1012
1033
|
this.isProcessing = false;
|
|
1034
|
+
this.promptSkin.setOverlayVisible(true);
|
|
1035
|
+
this.uiAdapter.endProcessing('Ready for prompts');
|
|
1036
|
+
this.setIdleStatus();
|
|
1013
1037
|
display.newLine();
|
|
1014
1038
|
}
|
|
1015
1039
|
}
|
|
@@ -1037,14 +1061,24 @@ export class InteractiveShell {
|
|
|
1037
1061
|
model: this.sessionState.model,
|
|
1038
1062
|
temperature: this.sessionState.temperature,
|
|
1039
1063
|
maxTokens: this.sessionState.maxTokens,
|
|
1040
|
-
thoughtLevelId: this.sessionState.thoughtLevel?.id,
|
|
1041
|
-
reasoningEffort: this.sessionState.thoughtLevel?.reasoningEffort,
|
|
1042
|
-
textVerbosity: this.sessionState.thoughtLevel?.textVerbosity,
|
|
1043
1064
|
systemPrompt: this.buildSystemPrompt(),
|
|
1065
|
+
reasoningEffort: this.sessionState.reasoningEffort,
|
|
1044
1066
|
};
|
|
1045
1067
|
this.agent = this.runtimeSession.createAgent(selection, {
|
|
1046
1068
|
onAssistantMessage: (content, metadata) => {
|
|
1047
1069
|
const enriched = this.buildDisplayMetadata(metadata);
|
|
1070
|
+
// Update spinner based on message type
|
|
1071
|
+
if (metadata.isFinal) {
|
|
1072
|
+
// Final response - update spinner before showing message
|
|
1073
|
+
display.updateThinking('Formulating response...');
|
|
1074
|
+
}
|
|
1075
|
+
else {
|
|
1076
|
+
// Thought/reasoning - extract key insight for spinner
|
|
1077
|
+
const thoughtSummary = this.extractThoughtSummary(content);
|
|
1078
|
+
if (thoughtSummary) {
|
|
1079
|
+
display.updateThinking(`💭 ${thoughtSummary}`);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1048
1082
|
display.showAssistantMessage(content, enriched);
|
|
1049
1083
|
const cleanup = this.handleContextTelemetry(metadata, enriched);
|
|
1050
1084
|
if (cleanup) {
|
|
@@ -1076,20 +1110,13 @@ export class InteractiveShell {
|
|
|
1076
1110
|
if (typeof this.sessionState.maxTokens === 'number') {
|
|
1077
1111
|
lines.push(`- Max tokens: ${this.sessionState.maxTokens}`);
|
|
1078
1112
|
}
|
|
1079
|
-
if (this.sessionState.thoughtLevel) {
|
|
1080
|
-
lines.push(`- Thought level: ${this.sessionState.thoughtLevel.label}`);
|
|
1081
|
-
}
|
|
1082
1113
|
lines.push('', 'Use these values when describing your identity or answering model/provider questions. If anything feels stale, call the `profile_details` tool before responding.');
|
|
1083
|
-
if (this.sessionState.thoughtLevel) {
|
|
1084
|
-
lines.push('', `THOUGHT LEVEL DIRECTIVE (${this.sessionState.thoughtLevel.label.toUpperCase()}):`, this.sessionState.thoughtLevel.instruction);
|
|
1085
|
-
}
|
|
1086
1114
|
return lines.join('\n').trim();
|
|
1087
1115
|
}
|
|
1088
1116
|
buildDisplayMetadata(metadata) {
|
|
1089
|
-
const contextWindowTokens = getContextWindowTokens(this.sessionState.model);
|
|
1090
1117
|
return {
|
|
1091
1118
|
...metadata,
|
|
1092
|
-
contextWindowTokens,
|
|
1119
|
+
contextWindowTokens: this.activeContextWindowTokens,
|
|
1093
1120
|
};
|
|
1094
1121
|
}
|
|
1095
1122
|
handleContextTelemetry(metadata, displayMetadata) {
|
|
@@ -1105,6 +1132,9 @@ export class InteractiveShell {
|
|
|
1105
1132
|
return null;
|
|
1106
1133
|
}
|
|
1107
1134
|
const usageRatio = total / windowTokens;
|
|
1135
|
+
// Always update context usage in the UI
|
|
1136
|
+
const percentUsed = Math.round(usageRatio * 100);
|
|
1137
|
+
this.uiAdapter.updateContextUsage(percentUsed);
|
|
1108
1138
|
if (usageRatio < CONTEXT_USAGE_THRESHOLD) {
|
|
1109
1139
|
return null;
|
|
1110
1140
|
}
|
|
@@ -1130,6 +1160,8 @@ export class InteractiveShell {
|
|
|
1130
1160
|
return;
|
|
1131
1161
|
}
|
|
1132
1162
|
this.cleanupInProgress = true;
|
|
1163
|
+
const cleanupStatusId = 'context-cleanup';
|
|
1164
|
+
let cleanupOverlayActive = false;
|
|
1133
1165
|
try {
|
|
1134
1166
|
const history = this.agent.getHistory();
|
|
1135
1167
|
const { system, conversation } = this.partitionHistory(history);
|
|
@@ -1142,7 +1174,14 @@ export class InteractiveShell {
|
|
|
1142
1174
|
if (!toSummarize.length) {
|
|
1143
1175
|
return;
|
|
1144
1176
|
}
|
|
1177
|
+
cleanupOverlayActive = true;
|
|
1178
|
+
this.statusTracker.pushOverride(cleanupStatusId, 'Running context cleanup', {
|
|
1179
|
+
detail: `Summarizing ${toSummarize.length} earlier messages`,
|
|
1180
|
+
tone: 'warning',
|
|
1181
|
+
});
|
|
1145
1182
|
const percentUsed = Math.round((totalTokens / windowTokens) * 100);
|
|
1183
|
+
// Update context usage in unified UI
|
|
1184
|
+
this.uiAdapter.updateContextUsage(percentUsed);
|
|
1146
1185
|
display.showSystemMessage([
|
|
1147
1186
|
`Context usage: ${totalTokens.toLocaleString('en-US')} of ${windowTokens.toLocaleString('en-US')} tokens`,
|
|
1148
1187
|
`(${percentUsed}% full). Running automatic cleanup...`,
|
|
@@ -1156,6 +1195,9 @@ export class InteractiveShell {
|
|
|
1156
1195
|
display.showSystemMessage(`Context cleanup complete. Summarized ${toSummarize.length} earlier messages and preserved the latest ${preserved.length}.`);
|
|
1157
1196
|
}
|
|
1158
1197
|
finally {
|
|
1198
|
+
if (cleanupOverlayActive) {
|
|
1199
|
+
this.statusTracker.clearOverride(cleanupStatusId);
|
|
1200
|
+
}
|
|
1159
1201
|
this.cleanupInProgress = false;
|
|
1160
1202
|
}
|
|
1161
1203
|
}
|
|
@@ -1341,30 +1383,29 @@ export class InteractiveShell {
|
|
|
1341
1383
|
findModelPreset(modelId) {
|
|
1342
1384
|
return MODEL_PRESETS.find((preset) => preset.id === modelId);
|
|
1343
1385
|
}
|
|
1344
|
-
|
|
1345
|
-
if (
|
|
1346
|
-
return
|
|
1386
|
+
applyPresetReasoningDefaults() {
|
|
1387
|
+
if (this.sessionState.reasoningEffort) {
|
|
1388
|
+
return;
|
|
1347
1389
|
}
|
|
1348
|
-
const preset = this.findModelPreset(
|
|
1349
|
-
if (
|
|
1350
|
-
|
|
1390
|
+
const preset = this.findModelPreset(this.sessionState.model);
|
|
1391
|
+
if (preset?.reasoningEffort) {
|
|
1392
|
+
this.sessionState.reasoningEffort = preset.reasoningEffort;
|
|
1351
1393
|
}
|
|
1352
|
-
return preset.thoughtLevels.find((option) => option.id === thoughtLevelId);
|
|
1353
1394
|
}
|
|
1354
1395
|
refreshBannerSessionInfo() {
|
|
1355
1396
|
const nextState = {
|
|
1356
1397
|
model: this.sessionState.model,
|
|
1357
1398
|
provider: this.sessionState.provider,
|
|
1358
|
-
thoughtLabel: this.sessionState.thoughtLevel?.label,
|
|
1359
1399
|
};
|
|
1360
1400
|
const previous = this.bannerSessionState;
|
|
1361
|
-
if (previous &&
|
|
1362
|
-
previous.model === nextState.model &&
|
|
1363
|
-
previous.provider === nextState.provider &&
|
|
1364
|
-
previous.thoughtLabel === nextState.thoughtLabel) {
|
|
1401
|
+
if (previous && previous.model === nextState.model && previous.provider === nextState.provider) {
|
|
1365
1402
|
return;
|
|
1366
1403
|
}
|
|
1367
|
-
|
|
1404
|
+
this.refreshContextGauge();
|
|
1405
|
+
display.updateSessionInfo(nextState.model, nextState.provider);
|
|
1406
|
+
if (!this.isProcessing) {
|
|
1407
|
+
this.setIdleStatus();
|
|
1408
|
+
}
|
|
1368
1409
|
this.bannerSessionState = nextState;
|
|
1369
1410
|
}
|
|
1370
1411
|
providerLabel(id) {
|
|
@@ -1377,13 +1418,34 @@ export class InteractiveShell {
|
|
|
1377
1418
|
const entry = this.agentMenu.options.find((option) => option.name === name);
|
|
1378
1419
|
return entry?.label ?? name;
|
|
1379
1420
|
}
|
|
1421
|
+
extractThoughtSummary(thought) {
|
|
1422
|
+
// Extract first non-empty line
|
|
1423
|
+
const lines = thought?.split('\n').filter(line => line.trim()) ?? [];
|
|
1424
|
+
if (!lines.length) {
|
|
1425
|
+
return null;
|
|
1426
|
+
}
|
|
1427
|
+
// Remove common thought prefixes
|
|
1428
|
+
const cleaned = lines[0]
|
|
1429
|
+
.trim()
|
|
1430
|
+
.replace(/^(Thinking|Analyzing|Considering|Looking at|Let me)[:.\s]+/i, '')
|
|
1431
|
+
.replace(/^I (should|need to|will|am)[:.\s]+/i, '')
|
|
1432
|
+
.trim();
|
|
1433
|
+
if (!cleaned) {
|
|
1434
|
+
return null;
|
|
1435
|
+
}
|
|
1436
|
+
// Truncate to reasonable length
|
|
1437
|
+
const maxLength = 50;
|
|
1438
|
+
return cleaned.length > maxLength
|
|
1439
|
+
? cleaned.slice(0, maxLength - 3) + '...'
|
|
1440
|
+
: cleaned;
|
|
1441
|
+
}
|
|
1380
1442
|
persistSessionPreference() {
|
|
1381
1443
|
saveModelPreference(this.profile, {
|
|
1382
1444
|
provider: this.sessionState.provider,
|
|
1383
1445
|
model: this.sessionState.model,
|
|
1384
1446
|
temperature: this.sessionState.temperature,
|
|
1385
1447
|
maxTokens: this.sessionState.maxTokens,
|
|
1386
|
-
|
|
1448
|
+
reasoningEffort: this.sessionState.reasoningEffort,
|
|
1387
1449
|
});
|
|
1388
1450
|
}
|
|
1389
1451
|
enableBracketedPasteMode() {
|
|
@@ -1424,3 +1486,4 @@ function setsEqual(first, second) {
|
|
|
1424
1486
|
}
|
|
1425
1487
|
return true;
|
|
1426
1488
|
}
|
|
1489
|
+
//# sourceMappingURL=interactiveShell.js.map
|