erosolar-cli 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Agents.md +411 -200
- package/README.md +77 -44
- 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 +28 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +98 -23
- package/dist/config.js.map +1 -0
- package/dist/contracts/agent-profiles.schema.json +43 -0
- package/dist/contracts/agent-schema.snapshot.json +437 -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.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 +52 -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 +176 -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 +10 -0
- package/dist/core/agentRulebook.d.ts.map +1 -0
- package/dist/core/agentRulebook.js +153 -0
- package/dist/core/agentRulebook.js.map +1 -0
- package/dist/core/agentSchemaSnapshot.d.ts +14 -0
- package/dist/core/agentSchemaSnapshot.d.ts.map +1 -0
- package/dist/core/agentSchemaSnapshot.js +38 -0
- package/dist/core/agentSchemaSnapshot.js.map +1 -0
- package/dist/core/agentsDocument.d.ts +4 -0
- package/dist/core/agentsDocument.d.ts.map +1 -0
- package/dist/core/agentsDocument.js +70 -0
- package/dist/core/agentsDocument.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 +48 -0
- package/dist/core/toolRuntime.d.ts.map +1 -0
- package/dist/core/toolRuntime.js +34 -11
- 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 +23 -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 +128 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -0
- package/dist/shell/interactiveShell.js +264 -146
- package/dist/shell/interactiveShell.js.map +1 -0
- package/dist/shell/liveStatus.d.ts +33 -0
- package/dist/shell/liveStatus.d.ts.map +1 -0
- package/dist/shell/liveStatus.js +89 -0
- package/dist/shell/liveStatus.js.map +1 -0
- package/dist/shell/promptSkin.d.ts +50 -0
- package/dist/shell/promptSkin.d.ts.map +1 -0
- package/dist/shell/promptSkin.js +380 -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 +155 -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/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 +1 -0
- package/dist/ui/designSystem.js.map +1 -0
- package/dist/ui/display.d.ts +78 -0
- package/dist/ui/display.d.ts.map +1 -0
- package/dist/ui/display.js +211 -153
- package/dist/ui/display.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/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/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/ui/unified/UIEventBus.d.ts +93 -0
- package/dist/ui/unified/UIEventBus.d.ts.map +1 -0
- package/dist/ui/unified/UIEventBus.js +124 -0
- package/dist/ui/unified/UIEventBus.js.map +1 -0
- package/dist/ui/unified/UIState.d.ts +123 -0
- package/dist/ui/unified/UIState.d.ts.map +1 -0
- package/dist/ui/unified/UIState.js +188 -0
- package/dist/ui/unified/UIState.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 +68 -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 +63 -11
- package/dist/workspace.js.map +1 -0
- package/package.json +27 -14
- package/scripts/health-check.mjs +179 -0
- package/ARCHITECTURE.json +0 -157
- 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 { INTERRUPT_HINT } from './liveStatus.js';
|
|
13
|
+
import { buildWorkspaceContext } from '../workspace.js';
|
|
14
|
+
import { buildInteractiveSystemPrompt } from './systemPrompt.js';
|
|
37
15
|
const DROPDOWN_COLORS = [
|
|
38
16
|
theme.primary,
|
|
39
17
|
theme.info,
|
|
@@ -48,31 +26,35 @@ const MODEL_PRESETS = [
|
|
|
48
26
|
label: 'gpt-5.1-codex',
|
|
49
27
|
provider: 'openai',
|
|
50
28
|
description: 'Optimized for Erosolar Code with the latest coding weights from OpenAI.',
|
|
51
|
-
|
|
29
|
+
reasoningEffort: 'medium',
|
|
52
30
|
},
|
|
53
31
|
{
|
|
54
32
|
id: 'gpt-5.1',
|
|
55
33
|
label: 'gpt-5.1',
|
|
56
34
|
provider: 'openai',
|
|
57
35
|
description: 'Balanced reasoning model when you need equal parts code and analysis.',
|
|
36
|
+
reasoningEffort: 'medium',
|
|
58
37
|
},
|
|
59
38
|
{
|
|
60
39
|
id: 'gpt-5-pro',
|
|
61
40
|
label: 'gpt-5-pro',
|
|
62
41
|
provider: 'openai',
|
|
63
42
|
description: 'OpenAI\'s flagship GPT-5 Pro for maximum depth and planning.',
|
|
43
|
+
reasoningEffort: 'medium',
|
|
64
44
|
},
|
|
65
45
|
{
|
|
66
46
|
id: 'gpt-5-mini',
|
|
67
47
|
label: 'gpt-5-mini',
|
|
68
48
|
provider: 'openai',
|
|
69
49
|
description: 'GPT-5 Mini with faster turnarounds while staying code-aware.',
|
|
50
|
+
reasoningEffort: 'medium',
|
|
70
51
|
},
|
|
71
52
|
{
|
|
72
53
|
id: 'gpt-5-nano',
|
|
73
54
|
label: 'gpt-5-nano',
|
|
74
55
|
provider: 'openai',
|
|
75
56
|
description: 'Ultra-responsive GPT-5 Nano tuned for edits and quick summaries.',
|
|
57
|
+
reasoningEffort: 'medium',
|
|
76
58
|
},
|
|
77
59
|
{
|
|
78
60
|
id: 'claude-sonnet-4-5-20250929',
|
|
@@ -151,13 +133,15 @@ const BASE_SLASH_COMMANDS = [
|
|
|
151
133
|
{ command: '/model', description: 'Choose what model to use' },
|
|
152
134
|
{ command: '/secrets', description: 'Configure API keys' },
|
|
153
135
|
{ command: '/tools', description: 'Enable or disable CLI tools' },
|
|
136
|
+
{ command: '/doctor', description: 'Check environment, secrets, and tool readiness' },
|
|
137
|
+
{ command: '/checks', description: 'Run repo checks (npm test / npm run build / npm run lint)' },
|
|
138
|
+
{ command: '/context', description: 'Refresh workspace snapshot (depth/excerpt overrides)' },
|
|
154
139
|
];
|
|
155
140
|
const PROVIDER_LABELS = {
|
|
156
141
|
openai: 'OpenAI',
|
|
157
142
|
anthropic: 'Anthropic',
|
|
158
143
|
deepseek: 'DeepSeek',
|
|
159
144
|
xai: 'xAI',
|
|
160
|
-
tavily: 'Tavily',
|
|
161
145
|
google: 'Google Gemini',
|
|
162
146
|
};
|
|
163
147
|
const MULTILINE_INPUT_FLUSH_DELAY_MS = 30;
|
|
@@ -180,8 +164,8 @@ export class InteractiveShell {
|
|
|
180
164
|
profileLabel;
|
|
181
165
|
workingDir;
|
|
182
166
|
runtimeSession;
|
|
183
|
-
toolContext;
|
|
184
167
|
baseSystemPrompt;
|
|
168
|
+
workspaceOptions;
|
|
185
169
|
sessionState;
|
|
186
170
|
isProcessing = false;
|
|
187
171
|
pendingInteraction = null;
|
|
@@ -198,25 +182,30 @@ export class InteractiveShell {
|
|
|
198
182
|
agentMenu;
|
|
199
183
|
slashCommands;
|
|
200
184
|
bannerSessionState = null;
|
|
185
|
+
promptSkin;
|
|
186
|
+
statusTracker;
|
|
187
|
+
statusSubscription = null;
|
|
188
|
+
activeContextWindowTokens = null;
|
|
189
|
+
promptSkinOutputDisposer = null;
|
|
201
190
|
constructor(config) {
|
|
202
191
|
this.profile = config.profile;
|
|
203
192
|
this.profileLabel = config.profileLabel;
|
|
204
193
|
this.workingDir = config.workingDir;
|
|
205
194
|
this.runtimeSession = config.session;
|
|
206
|
-
this.toolContext = this.runtimeSession.toolContext;
|
|
207
195
|
this.baseSystemPrompt = config.baseSystemPrompt;
|
|
196
|
+
this.workspaceOptions = { ...config.workspaceOptions };
|
|
208
197
|
this.sessionState = {
|
|
209
198
|
provider: config.initialModel.provider,
|
|
210
199
|
model: config.initialModel.model,
|
|
211
200
|
temperature: config.initialModel.temperature,
|
|
212
201
|
maxTokens: config.initialModel.maxTokens,
|
|
213
|
-
|
|
202
|
+
reasoningEffort: config.initialModel.reasoningEffort,
|
|
214
203
|
};
|
|
204
|
+
this.applyPresetReasoningDefaults();
|
|
215
205
|
// The welcome banner only includes model + provider on launch, so mark that as the initial state.
|
|
216
206
|
this.bannerSessionState = {
|
|
217
207
|
model: this.sessionState.model,
|
|
218
208
|
provider: this.sessionState.provider,
|
|
219
|
-
thoughtLabel: undefined,
|
|
220
209
|
};
|
|
221
210
|
this.agentMenu = config.agentSelection ?? null;
|
|
222
211
|
this.slashCommands = [...BASE_SLASH_COMMANDS];
|
|
@@ -226,12 +215,20 @@ export class InteractiveShell {
|
|
|
226
215
|
description: 'Select the default agent profile (applies on next launch)',
|
|
227
216
|
});
|
|
228
217
|
}
|
|
218
|
+
this.statusTracker = config.statusTracker;
|
|
229
219
|
this.rl = readline.createInterface({
|
|
230
220
|
input,
|
|
231
221
|
output,
|
|
232
222
|
prompt: formatUserPrompt(this.profileLabel || this.profile),
|
|
233
223
|
terminal: true,
|
|
234
224
|
});
|
|
225
|
+
this.promptSkin = new PromptSkin(this.rl);
|
|
226
|
+
this.promptSkinOutputDisposer = display.registerOutputInterceptor({
|
|
227
|
+
beforeWrite: () => this.promptSkin.beginOutput(),
|
|
228
|
+
afterWrite: () => this.promptSkin.endOutput(),
|
|
229
|
+
});
|
|
230
|
+
this.setupStatusTracking();
|
|
231
|
+
this.refreshContextGauge();
|
|
235
232
|
this.bracketedPasteEnabled = this.enableBracketedPasteMode();
|
|
236
233
|
this.bracketedPaste = new BracketedPasteManager(this.bracketedPasteEnabled);
|
|
237
234
|
this.rebuildAgent();
|
|
@@ -241,7 +238,9 @@ export class InteractiveShell {
|
|
|
241
238
|
async start(initialPrompt) {
|
|
242
239
|
if (initialPrompt) {
|
|
243
240
|
display.newLine();
|
|
241
|
+
this.promptSkin.beginOutput();
|
|
244
242
|
console.log(`${formatUserPrompt(this.profileLabel || this.profile)}${initialPrompt}`);
|
|
243
|
+
this.promptSkin.endOutput();
|
|
245
244
|
await this.processInputBlock(initialPrompt);
|
|
246
245
|
return;
|
|
247
246
|
}
|
|
@@ -386,8 +385,15 @@ export class InteractiveShell {
|
|
|
386
385
|
});
|
|
387
386
|
this.rl.on('close', () => {
|
|
388
387
|
this.disableBracketedPasteMode();
|
|
388
|
+
this.teardownStatusTracking();
|
|
389
|
+
if (this.promptSkinOutputDisposer) {
|
|
390
|
+
this.promptSkinOutputDisposer();
|
|
391
|
+
this.promptSkinOutputDisposer = null;
|
|
392
|
+
}
|
|
393
|
+
this.promptSkin.dispose();
|
|
389
394
|
display.newLine();
|
|
390
|
-
|
|
395
|
+
const highlightedEmail = theme.info('support@ero.solar');
|
|
396
|
+
display.showInfo(`⚠️ WARNING: This is pre-alpha testing software. May contain bugs and potential dangers. Email ${highlightedEmail} for support.`);
|
|
391
397
|
exit(0);
|
|
392
398
|
});
|
|
393
399
|
this.setupSlashCommandPreviewHandler();
|
|
@@ -402,6 +408,49 @@ export class InteractiveShell {
|
|
|
402
408
|
this.handleSlashCommandPreviewChange();
|
|
403
409
|
});
|
|
404
410
|
}
|
|
411
|
+
setupStatusTracking() {
|
|
412
|
+
this.statusSubscription = this.statusTracker.subscribe((state) => {
|
|
413
|
+
this.promptSkin.setStatus(state);
|
|
414
|
+
});
|
|
415
|
+
this.setIdleStatus();
|
|
416
|
+
}
|
|
417
|
+
teardownStatusTracking() {
|
|
418
|
+
if (this.statusSubscription) {
|
|
419
|
+
this.statusSubscription();
|
|
420
|
+
this.statusSubscription = null;
|
|
421
|
+
}
|
|
422
|
+
this.statusTracker.reset();
|
|
423
|
+
}
|
|
424
|
+
setIdleStatus(detail) {
|
|
425
|
+
const details = this.buildStatusDetail(detail ?? this.describeModelDetail());
|
|
426
|
+
this.statusTracker.setBase('Ready for prompts', {
|
|
427
|
+
detail: details,
|
|
428
|
+
tone: 'success',
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
setProcessingStatus(detail) {
|
|
432
|
+
const details = this.buildStatusDetail(detail ?? this.describeModelDetail(), INTERRUPT_HINT);
|
|
433
|
+
this.statusTracker.setBase('Working on your request', {
|
|
434
|
+
detail: details,
|
|
435
|
+
tone: 'info',
|
|
436
|
+
animate: true,
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
describeModelDetail() {
|
|
440
|
+
const provider = this.providerLabel(this.sessionState.provider);
|
|
441
|
+
return `${provider} · ${this.sessionState.model}`;
|
|
442
|
+
}
|
|
443
|
+
buildStatusDetail(...segments) {
|
|
444
|
+
const normalized = segments
|
|
445
|
+
.map((segment) => (typeof segment === 'string' ? segment.trim() : ''))
|
|
446
|
+
.filter((segment) => Boolean(segment));
|
|
447
|
+
return normalized.length ? normalized : undefined;
|
|
448
|
+
}
|
|
449
|
+
refreshContextGauge() {
|
|
450
|
+
const tokens = getContextWindowTokens(this.sessionState.model);
|
|
451
|
+
this.activeContextWindowTokens =
|
|
452
|
+
typeof tokens === 'number' && Number.isFinite(tokens) ? tokens : null;
|
|
453
|
+
}
|
|
405
454
|
handleSlashCommandPreviewChange() {
|
|
406
455
|
if (this.pendingInteraction || this.awaitingPasteConfirmation) {
|
|
407
456
|
this.slashPreviewVisible = false;
|
|
@@ -533,9 +582,6 @@ export class InteractiveShell {
|
|
|
533
582
|
case 'model':
|
|
534
583
|
await this.handleModelSelection(input);
|
|
535
584
|
return true;
|
|
536
|
-
case 'thought-level':
|
|
537
|
-
await this.handleThoughtLevelSelection(input);
|
|
538
|
-
return true;
|
|
539
585
|
case 'secret-select':
|
|
540
586
|
await this.handleSecretSelection(input);
|
|
541
587
|
return true;
|
|
@@ -564,6 +610,15 @@ export class InteractiveShell {
|
|
|
564
610
|
case '/tools':
|
|
565
611
|
this.showToolsMenu();
|
|
566
612
|
break;
|
|
613
|
+
case '/doctor':
|
|
614
|
+
this.runDoctor();
|
|
615
|
+
break;
|
|
616
|
+
case '/checks':
|
|
617
|
+
await this.runRepoChecksCommand();
|
|
618
|
+
break;
|
|
619
|
+
case '/context':
|
|
620
|
+
await this.refreshWorkspaceContextCommand(input);
|
|
621
|
+
break;
|
|
567
622
|
case '/agents':
|
|
568
623
|
this.showAgentsMenu();
|
|
569
624
|
break;
|
|
@@ -581,6 +636,143 @@ export class InteractiveShell {
|
|
|
581
636
|
];
|
|
582
637
|
display.showSystemMessage(info.join('\n'));
|
|
583
638
|
}
|
|
639
|
+
runDoctor() {
|
|
640
|
+
const lines = [];
|
|
641
|
+
lines.push(theme.bold('Environment diagnostics'));
|
|
642
|
+
lines.push('');
|
|
643
|
+
lines.push(`${theme.secondary('Workspace')}: ${this.workingDir}`);
|
|
644
|
+
lines.push('');
|
|
645
|
+
lines.push(theme.bold('Provider credentials'));
|
|
646
|
+
const providerDefinition = getSecretDefinitionForProvider(this.sessionState.provider);
|
|
647
|
+
if (providerDefinition) {
|
|
648
|
+
const currentValue = getSecretValue(providerDefinition.id);
|
|
649
|
+
if (currentValue) {
|
|
650
|
+
lines.push(`${theme.success('✓')} ${providerDefinition.label} configured (${providerDefinition.envVar}).`);
|
|
651
|
+
}
|
|
652
|
+
else {
|
|
653
|
+
lines.push(`${theme.warning('⚠')} Missing ${providerDefinition.label} (${providerDefinition.envVar}). Run /secrets to configure it.`);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
lines.push(`${theme.secondary('•')} ${this.providerLabel(this.sessionState.provider)} does not require an API key.`);
|
|
658
|
+
}
|
|
659
|
+
lines.push('');
|
|
660
|
+
lines.push(theme.bold('Tool suites'));
|
|
661
|
+
const toolSettings = loadToolSettings();
|
|
662
|
+
const selection = buildEnabledToolSet(toolSettings);
|
|
663
|
+
const permissions = evaluateToolPermissions(selection);
|
|
664
|
+
const options = getToolToggleOptions();
|
|
665
|
+
const enabledLabels = options
|
|
666
|
+
.filter((option) => selection.has(option.id))
|
|
667
|
+
.map((option) => option.label);
|
|
668
|
+
lines.push(`Enabled: ${enabledLabels.length ? enabledLabels.join(', ') : 'none'}`);
|
|
669
|
+
if (!permissions.warnings.length) {
|
|
670
|
+
lines.push(theme.success('All enabled suites loaded successfully.'));
|
|
671
|
+
}
|
|
672
|
+
else {
|
|
673
|
+
lines.push(theme.warning('Issues detected:'));
|
|
674
|
+
for (const warning of permissions.warnings) {
|
|
675
|
+
const detail = this.describeToolWarning(warning);
|
|
676
|
+
lines.push(` - ${detail}`);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
display.showSystemMessage(lines.join('\n'));
|
|
680
|
+
}
|
|
681
|
+
async runRepoChecksCommand() {
|
|
682
|
+
if (this.isProcessing) {
|
|
683
|
+
display.showWarning('Wait for the active response to finish before running checks.');
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
const call = {
|
|
687
|
+
id: 'manual-run-repo-checks',
|
|
688
|
+
name: 'run_repo_checks',
|
|
689
|
+
arguments: {},
|
|
690
|
+
};
|
|
691
|
+
display.showInfo('Running repo checks (npm test/build/lint when available)...');
|
|
692
|
+
const output = await this.runtimeSession.toolRuntime.execute(call);
|
|
693
|
+
display.showSystemMessage(output);
|
|
694
|
+
}
|
|
695
|
+
async refreshWorkspaceContextCommand(input) {
|
|
696
|
+
if (this.isProcessing) {
|
|
697
|
+
display.showWarning('Wait for the active response to finish before refreshing the snapshot.');
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
const { overrides, error } = this.parseContextOverrideTokens(input);
|
|
701
|
+
if (error) {
|
|
702
|
+
display.showWarning(`${error} ${this.describeContextOverrideUsage()}`);
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
if (overrides) {
|
|
706
|
+
this.workspaceOptions = { ...this.workspaceOptions, ...overrides };
|
|
707
|
+
}
|
|
708
|
+
display.showInfo('Refreshing workspace snapshot...');
|
|
709
|
+
const context = buildWorkspaceContext(this.workingDir, this.workspaceOptions);
|
|
710
|
+
const profileConfig = this.runtimeSession.refreshWorkspaceContext(context);
|
|
711
|
+
const tools = this.runtimeSession.toolRuntime.listProviderTools();
|
|
712
|
+
this.baseSystemPrompt = buildInteractiveSystemPrompt(profileConfig.systemPrompt, profileConfig.label, tools);
|
|
713
|
+
if (this.rebuildAgent()) {
|
|
714
|
+
display.showInfo(`Workspace snapshot refreshed (${this.describeWorkspaceOptions()}).`);
|
|
715
|
+
}
|
|
716
|
+
else {
|
|
717
|
+
display.showWarning('Workspace snapshot refreshed, but the agent failed to rebuild. Run /doctor for details.');
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
parseContextOverrideTokens(input) {
|
|
721
|
+
const overrides = {};
|
|
722
|
+
let hasOverride = false;
|
|
723
|
+
const tokens = input
|
|
724
|
+
.trim()
|
|
725
|
+
.split(/\s+/)
|
|
726
|
+
.slice(1);
|
|
727
|
+
for (const token of tokens) {
|
|
728
|
+
if (!token) {
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
const [rawKey, rawValue] = token.split('=');
|
|
732
|
+
if (!rawKey || !rawValue) {
|
|
733
|
+
return { overrides: null, error: `Invalid option "${token}".` };
|
|
734
|
+
}
|
|
735
|
+
const key = rawKey.toLowerCase();
|
|
736
|
+
const value = Number.parseInt(rawValue, 10);
|
|
737
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
738
|
+
return { overrides: null, error: `Value for "${key}" must be a positive integer.` };
|
|
739
|
+
}
|
|
740
|
+
switch (key) {
|
|
741
|
+
case 'depth':
|
|
742
|
+
overrides.treeDepth = value;
|
|
743
|
+
hasOverride = true;
|
|
744
|
+
break;
|
|
745
|
+
case 'entries':
|
|
746
|
+
overrides.maxEntries = value;
|
|
747
|
+
hasOverride = true;
|
|
748
|
+
break;
|
|
749
|
+
case 'excerpt':
|
|
750
|
+
case 'doc':
|
|
751
|
+
case 'docs':
|
|
752
|
+
overrides.docExcerptLimit = value;
|
|
753
|
+
hasOverride = true;
|
|
754
|
+
break;
|
|
755
|
+
default:
|
|
756
|
+
return { overrides: null, error: `Unknown option "${key}".` };
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
return { overrides: hasOverride ? overrides : null };
|
|
760
|
+
}
|
|
761
|
+
describeWorkspaceOptions() {
|
|
762
|
+
const depth = this.workspaceOptions.treeDepth ?? 'default';
|
|
763
|
+
const entries = this.workspaceOptions.maxEntries ?? 'default';
|
|
764
|
+
const excerpt = this.workspaceOptions.docExcerptLimit ?? 'default';
|
|
765
|
+
return `depth=${depth}, entries=${entries}, excerpt=${excerpt}`;
|
|
766
|
+
}
|
|
767
|
+
describeContextOverrideUsage() {
|
|
768
|
+
return 'Usage: /context [depth=<n>] [entries=<n>] [excerpt=<n>]';
|
|
769
|
+
}
|
|
770
|
+
describeToolWarning(warning) {
|
|
771
|
+
if (warning.reason === 'missing-secret' && warning.secretId) {
|
|
772
|
+
return `${warning.label}: missing ${warning.secretId}. Use /secrets to configure it.`;
|
|
773
|
+
}
|
|
774
|
+
return `${warning.label}: ${warning.reason}.`;
|
|
775
|
+
}
|
|
584
776
|
buildSlashCommandList(header) {
|
|
585
777
|
const lines = [theme.gradient.primary(header), ''];
|
|
586
778
|
for (const command of this.slashCommands) {
|
|
@@ -649,34 +841,6 @@ export class InteractiveShell {
|
|
|
649
841
|
display.showSystemMessage(lines.join('\n'));
|
|
650
842
|
this.pendingInteraction = { type: 'model', provider: option.provider, options: models };
|
|
651
843
|
}
|
|
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
844
|
showSecretsMenu() {
|
|
681
845
|
const definitions = listSecretDefinitions();
|
|
682
846
|
const lines = [
|
|
@@ -836,77 +1000,27 @@ export class InteractiveShell {
|
|
|
836
1000
|
return;
|
|
837
1001
|
}
|
|
838
1002
|
this.pendingInteraction = null;
|
|
839
|
-
if (preset.thoughtLevels && preset.thoughtLevels.length > 0) {
|
|
840
|
-
this.showThoughtLevelMenu(preset);
|
|
841
|
-
this.rl.prompt();
|
|
842
|
-
return;
|
|
843
|
-
}
|
|
844
1003
|
await this.applyModelPreset(preset);
|
|
845
1004
|
this.rl.prompt();
|
|
846
1005
|
}
|
|
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) {
|
|
1006
|
+
async applyModelPreset(preset) {
|
|
888
1007
|
try {
|
|
889
1008
|
ensureSecretForProvider(preset.provider);
|
|
890
1009
|
}
|
|
891
1010
|
catch (error) {
|
|
892
|
-
this.handleAgentSetupError(error, () => this.applyModelPreset(preset
|
|
1011
|
+
this.handleAgentSetupError(error, () => this.applyModelPreset(preset), preset.provider);
|
|
893
1012
|
return;
|
|
894
1013
|
}
|
|
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
1014
|
this.sessionState = {
|
|
901
1015
|
provider: preset.provider,
|
|
902
1016
|
model: preset.id,
|
|
903
1017
|
temperature: preset.temperature,
|
|
904
1018
|
maxTokens: preset.maxTokens,
|
|
905
|
-
|
|
1019
|
+
reasoningEffort: preset.reasoningEffort,
|
|
906
1020
|
};
|
|
1021
|
+
this.applyPresetReasoningDefaults();
|
|
907
1022
|
if (this.rebuildAgent()) {
|
|
908
|
-
|
|
909
|
-
display.showInfo(`Switched to ${preset.label}${suffix}.`);
|
|
1023
|
+
display.showInfo(`Switched to ${preset.label}.`);
|
|
910
1024
|
this.refreshBannerSessionInfo();
|
|
911
1025
|
this.persistSessionPreference();
|
|
912
1026
|
}
|
|
@@ -997,6 +1111,7 @@ export class InteractiveShell {
|
|
|
997
1111
|
return;
|
|
998
1112
|
}
|
|
999
1113
|
this.isProcessing = true;
|
|
1114
|
+
this.setProcessingStatus();
|
|
1000
1115
|
try {
|
|
1001
1116
|
display.newLine();
|
|
1002
1117
|
await agent.send(request);
|
|
@@ -1010,6 +1125,7 @@ export class InteractiveShell {
|
|
|
1010
1125
|
}
|
|
1011
1126
|
finally {
|
|
1012
1127
|
this.isProcessing = false;
|
|
1128
|
+
this.setIdleStatus();
|
|
1013
1129
|
display.newLine();
|
|
1014
1130
|
}
|
|
1015
1131
|
}
|
|
@@ -1037,10 +1153,8 @@ export class InteractiveShell {
|
|
|
1037
1153
|
model: this.sessionState.model,
|
|
1038
1154
|
temperature: this.sessionState.temperature,
|
|
1039
1155
|
maxTokens: this.sessionState.maxTokens,
|
|
1040
|
-
thoughtLevelId: this.sessionState.thoughtLevel?.id,
|
|
1041
|
-
reasoningEffort: this.sessionState.thoughtLevel?.reasoningEffort,
|
|
1042
|
-
textVerbosity: this.sessionState.thoughtLevel?.textVerbosity,
|
|
1043
1156
|
systemPrompt: this.buildSystemPrompt(),
|
|
1157
|
+
reasoningEffort: this.sessionState.reasoningEffort,
|
|
1044
1158
|
};
|
|
1045
1159
|
this.agent = this.runtimeSession.createAgent(selection, {
|
|
1046
1160
|
onAssistantMessage: (content, metadata) => {
|
|
@@ -1076,20 +1190,13 @@ export class InteractiveShell {
|
|
|
1076
1190
|
if (typeof this.sessionState.maxTokens === 'number') {
|
|
1077
1191
|
lines.push(`- Max tokens: ${this.sessionState.maxTokens}`);
|
|
1078
1192
|
}
|
|
1079
|
-
if (this.sessionState.thoughtLevel) {
|
|
1080
|
-
lines.push(`- Thought level: ${this.sessionState.thoughtLevel.label}`);
|
|
1081
|
-
}
|
|
1082
1193
|
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
1194
|
return lines.join('\n').trim();
|
|
1087
1195
|
}
|
|
1088
1196
|
buildDisplayMetadata(metadata) {
|
|
1089
|
-
const contextWindowTokens = getContextWindowTokens(this.sessionState.model);
|
|
1090
1197
|
return {
|
|
1091
1198
|
...metadata,
|
|
1092
|
-
contextWindowTokens,
|
|
1199
|
+
contextWindowTokens: this.activeContextWindowTokens,
|
|
1093
1200
|
};
|
|
1094
1201
|
}
|
|
1095
1202
|
handleContextTelemetry(metadata, displayMetadata) {
|
|
@@ -1130,6 +1237,8 @@ export class InteractiveShell {
|
|
|
1130
1237
|
return;
|
|
1131
1238
|
}
|
|
1132
1239
|
this.cleanupInProgress = true;
|
|
1240
|
+
const cleanupStatusId = 'context-cleanup';
|
|
1241
|
+
let cleanupOverlayActive = false;
|
|
1133
1242
|
try {
|
|
1134
1243
|
const history = this.agent.getHistory();
|
|
1135
1244
|
const { system, conversation } = this.partitionHistory(history);
|
|
@@ -1142,6 +1251,12 @@ export class InteractiveShell {
|
|
|
1142
1251
|
if (!toSummarize.length) {
|
|
1143
1252
|
return;
|
|
1144
1253
|
}
|
|
1254
|
+
cleanupOverlayActive = true;
|
|
1255
|
+
this.statusTracker.pushOverride(cleanupStatusId, 'Running context cleanup', {
|
|
1256
|
+
detail: this.buildStatusDetail(`Summarizing ${toSummarize.length} earlier messages`, INTERRUPT_HINT),
|
|
1257
|
+
tone: 'warning',
|
|
1258
|
+
animate: true,
|
|
1259
|
+
});
|
|
1145
1260
|
const percentUsed = Math.round((totalTokens / windowTokens) * 100);
|
|
1146
1261
|
display.showSystemMessage([
|
|
1147
1262
|
`Context usage: ${totalTokens.toLocaleString('en-US')} of ${windowTokens.toLocaleString('en-US')} tokens`,
|
|
@@ -1156,6 +1271,9 @@ export class InteractiveShell {
|
|
|
1156
1271
|
display.showSystemMessage(`Context cleanup complete. Summarized ${toSummarize.length} earlier messages and preserved the latest ${preserved.length}.`);
|
|
1157
1272
|
}
|
|
1158
1273
|
finally {
|
|
1274
|
+
if (cleanupOverlayActive) {
|
|
1275
|
+
this.statusTracker.clearOverride(cleanupStatusId);
|
|
1276
|
+
}
|
|
1159
1277
|
this.cleanupInProgress = false;
|
|
1160
1278
|
}
|
|
1161
1279
|
}
|
|
@@ -1341,30 +1459,29 @@ export class InteractiveShell {
|
|
|
1341
1459
|
findModelPreset(modelId) {
|
|
1342
1460
|
return MODEL_PRESETS.find((preset) => preset.id === modelId);
|
|
1343
1461
|
}
|
|
1344
|
-
|
|
1345
|
-
if (
|
|
1346
|
-
return
|
|
1462
|
+
applyPresetReasoningDefaults() {
|
|
1463
|
+
if (this.sessionState.reasoningEffort) {
|
|
1464
|
+
return;
|
|
1347
1465
|
}
|
|
1348
|
-
const preset = this.findModelPreset(
|
|
1349
|
-
if (
|
|
1350
|
-
|
|
1466
|
+
const preset = this.findModelPreset(this.sessionState.model);
|
|
1467
|
+
if (preset?.reasoningEffort) {
|
|
1468
|
+
this.sessionState.reasoningEffort = preset.reasoningEffort;
|
|
1351
1469
|
}
|
|
1352
|
-
return preset.thoughtLevels.find((option) => option.id === thoughtLevelId);
|
|
1353
1470
|
}
|
|
1354
1471
|
refreshBannerSessionInfo() {
|
|
1355
1472
|
const nextState = {
|
|
1356
1473
|
model: this.sessionState.model,
|
|
1357
1474
|
provider: this.sessionState.provider,
|
|
1358
|
-
thoughtLabel: this.sessionState.thoughtLevel?.label,
|
|
1359
1475
|
};
|
|
1360
1476
|
const previous = this.bannerSessionState;
|
|
1361
|
-
if (previous &&
|
|
1362
|
-
previous.model === nextState.model &&
|
|
1363
|
-
previous.provider === nextState.provider &&
|
|
1364
|
-
previous.thoughtLabel === nextState.thoughtLabel) {
|
|
1477
|
+
if (previous && previous.model === nextState.model && previous.provider === nextState.provider) {
|
|
1365
1478
|
return;
|
|
1366
1479
|
}
|
|
1367
|
-
|
|
1480
|
+
this.refreshContextGauge();
|
|
1481
|
+
display.updateSessionInfo(nextState.model, nextState.provider);
|
|
1482
|
+
if (!this.isProcessing) {
|
|
1483
|
+
this.setIdleStatus();
|
|
1484
|
+
}
|
|
1368
1485
|
this.bannerSessionState = nextState;
|
|
1369
1486
|
}
|
|
1370
1487
|
providerLabel(id) {
|
|
@@ -1383,7 +1500,7 @@ export class InteractiveShell {
|
|
|
1383
1500
|
model: this.sessionState.model,
|
|
1384
1501
|
temperature: this.sessionState.temperature,
|
|
1385
1502
|
maxTokens: this.sessionState.maxTokens,
|
|
1386
|
-
|
|
1503
|
+
reasoningEffort: this.sessionState.reasoningEffort,
|
|
1387
1504
|
});
|
|
1388
1505
|
}
|
|
1389
1506
|
enableBracketedPasteMode() {
|
|
@@ -1424,3 +1541,4 @@ function setsEqual(first, second) {
|
|
|
1424
1541
|
}
|
|
1425
1542
|
return true;
|
|
1426
1543
|
}
|
|
1544
|
+
//# sourceMappingURL=interactiveShell.js.map
|